diff --git a/.fernignore b/.fernignore new file mode 100644 index 0000000..084a8eb --- /dev/null +++ b/.fernignore @@ -0,0 +1 @@ +# Specify files that shouldn't be modified by Fern diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1a55fdb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up node + uses: actions/setup-node@v3 + + - name: Compile + run: yarn && yarn build + + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up node + uses: actions/setup-node@v3 + + - name: Compile + run: yarn && yarn test + + publish: + needs: [ compile, test ] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up node + uses: actions/setup-node@v3 + - name: Install dependencies + run: yarn install + - name: Build + run: yarn build + + - name: Publish to npm + run: | + npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} + if [[ ${GITHUB_REF} == *alpha* ]]; then + npm publish --access public --tag alpha + elif [[ ${GITHUB_REF} == *beta* ]]; then + npm publish --access public --tag beta + else + npm publish --access public + fi + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72271e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +.DS_Store +/dist \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..6db0876 --- /dev/null +++ b/.npmignore @@ -0,0 +1,9 @@ +node_modules +src +tests +.gitignore +.github +.fernignore +.prettierrc.yml +tsconfig.json +yarn.lock \ No newline at end of file diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..0c06786 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,2 @@ +tabWidth: 4 +printWidth: 120 diff --git a/README.md b/README.md index 555e4ea..36a9837 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,137 @@ -# sdk-typescript -TypeScript SDK generated by Fern +# Devrev TypeScript Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern) +[![npm shield](https://img.shields.io/npm/v/@devrev/api)](https://www.npmjs.com/package/@devrev/api) + +The Devrev TypeScript library provides convenient access to the Devrev API from TypeScript. + +## Installation + +```sh +npm i -s @devrev/api +``` + +## Usage + +Instantiate and use the client with the following: + +```typescript +import { DevRevClient } from "@devrev/api"; + +const client = new DevRevClient({ token: "YOUR_TOKEN" }); +await client.accounts.create({ + displayName: "display_name", +}); +``` + +## Request And Response Types + +The SDK exports all request and response types as TypeScript interfaces. Simply import them with the +following namespace: + +```typescript +import { DevRev } from "@devrev/api"; + +const request: DevRev.AccountsCreateRequest = { + ... +}; +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error +will be thrown. + +```typescript +import { DevRevError } from "@devrev/api"; + +try { + await client.accounts.create(...); +} catch (err) { + if (err instanceof DevRevError) { + console.log(err.statusCode); + console.log(err.message); + console.log(err.body); + } +} +``` + +## Advanced + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retriable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retriable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `maxRetries` request option to configure this behavior. + +```typescript +const response = await client.accounts.create(..., { + maxRetries: 0 // override maxRetries at the request level +}); +``` + +### Timeouts + +The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior. + +```typescript +const response = await client.accounts.create(..., { + timeoutInSeconds: 30 // override timeout to 30s +}); +``` + +### Aborting Requests + +The SDK allows users to abort requests at any point by passing in an abort signal. + +```typescript +const controller = new AbortController(); +const response = await client.accounts.create(..., { + abortSignal: controller.signal +}); +controller.abort(); // aborts the request +``` + +### Runtime Compatibility + +The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following +runtimes: + +- Node.js 18+ +- Vercel +- Cloudflare Workers +- Deno v1.25+ +- Bun 1.0+ +- React Native + +### Customizing Fetch Client + +The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an +unsupported environment, this provides a way for you to break glass and ensure the SDK works. + +```typescript +import { DevRevClient } from "@devrev/api"; + +const client = new DevRevClient({ + ... + fetcher: // provide your implementation here +}); +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..35d6e65 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('jest').Config} */ +module.exports = { + preset: "ts-jest", + testEnvironment: "node", +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..03ae68a --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "@devrev/api", + "version": "0.0.14", + "private": false, + "repository": "https://github.com/devrev/sdk-typescript", + "main": "./index.js", + "types": "./index.d.ts", + "scripts": { + "format": "prettier . --write --ignore-unknown", + "build": "tsc", + "prepack": "cp -rv dist/. .", + "test": "jest" + }, + "dependencies": { + "url-join": "4.0.1", + "form-data": "^4.0.0", + "formdata-node": "^6.0.3", + "node-fetch": "2.7.0", + "qs": "6.11.2", + "js-base64": "3.7.2" + }, + "devDependencies": { + "@types/url-join": "4.0.1", + "@types/qs": "6.9.8", + "@types/node-fetch": "2.6.9", + "jest": "29.7.0", + "@types/jest": "29.5.5", + "ts-jest": "29.1.1", + "jest-environment-jsdom": "29.7.0", + "@types/node": "17.0.33", + "prettier": "2.7.1", + "typescript": "4.6.4" + }, + "browser": { + "fs": false, + "os": false, + "path": false + } +} diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..0dbc2a3 --- /dev/null +++ b/reference.md @@ -0,0 +1,4763 @@ +# Reference + +## accounts + +
client.accounts.create({ ...params }) -> DevRev.AccountsCreateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an account, which is a record representing a customer or an +organization. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.create({ + displayName: "display_name", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.delete({ ...params }) -> DevRev.AccountsDeleteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes an account. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.delete({ + id: "ACC-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsDeleteRequest` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.export({ ...params }) -> DevRev.AccountsExportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exports a collection of accounts. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.export({ + createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z"), +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsExportQuery` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.exportPost({ ...params }) -> DevRev.AccountsExportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exports a collection of accounts. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.exportPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsExportRequest` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.get({ ...params }) -> DevRev.AccountsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves an account's information. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.get({ + id: "ACC-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsGetQuery` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.getPost({ ...params }) -> DevRev.AccountsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves an account's information. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.getPost({ + id: "ACC-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsGetRequest` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.list({ ...params }) -> DevRev.AccountsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of accounts. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.list({ + createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z"), +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsListQuery` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.listPost({ ...params }) -> DevRev.AccountsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of accounts. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.listPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsListRequest` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.accounts.update({ ...params }) -> DevRev.AccountsUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an account's information. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.accounts.update({ + id: "ACC-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.AccountsUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `Accounts.RequestOptions` + +
+
+
+
+ +
+
+
+ +## articles + +
client.articles.count({ ...params }) -> DevRev.ArticlesCountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get count of articles matching given filter. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.count(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArticlesCountQuery` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.countPost({ ...params }) -> DevRev.ArticlesCountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get count of articles matching given filter. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.countPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArticlesCountRequest` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.create({ ...params }) -> DevRev.ArticlesCreateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Article is an object which can contain a URL or artifacts in the +resource. It also contains the data regarding the owner, author, status +and published date of the object. This call creates an article. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.create({ + appliesToParts: ["PROD-12345"], + ownedBy: ["DEVU-12345"], + resource: {}, + title: "title", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArticlesCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.delete({ ...params }) -> DevRev.ArticlesDeleteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes an article. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.delete({ + id: "ARTICLE-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArticlesDeleteRequest` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.get({ ...params }) -> DevRev.ArticlesGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets an article. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.get({ + id: "ARTICLE-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GetArticleQuery` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.getPost({ ...params }) -> DevRev.ArticlesGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets an article. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.getPost({ + id: "ARTICLE-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArticlesGetRequest` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.list({ ...params }) -> DevRev.ArticlesListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists a collection of articles. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.list(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ListArticlesQuery` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.listPost({ ...params }) -> DevRev.ArticlesListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists a collection of articles. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.listPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArticlesListRequest` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.articles.update({ ...params }) -> DevRev.ArticlesUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an article. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.articles.update({ + id: "ARTICLE-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArticlesUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `Articles.RequestOptions` + +
+
+
+
+ +
+
+
+ +## artifacts + +
client.artifacts.prepare({ ...params }) -> DevRev.ArtifactsPrepareResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an artifact and generates an upload URL for its data. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.artifacts.prepare({ + fileName: "file_name", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArtifactsPrepareRequest` + +
+
+ +
+
+ +**requestOptions:** `Artifacts.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.artifacts.versionsPrepare({ ...params }) -> DevRev.ArtifactsVersionsPrepareResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Prepares a new version for an artifact, returning the URL and form data +to upload the updated file. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.artifacts.versionsPrepare({ + id: "ARTIFACT-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ArtifactsVersionsPrepareRequest` + +
+
+ +
+
+ +**requestOptions:** `Artifacts.RequestOptions` + +
+
+
+
+ +
+
+
+ +## code-changes + +
client.codeChanges.create({ ...params }) -> DevRev.CodeChangesCreateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a code change object. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.codeChanges.create({ + key: "value", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.CodeChangesCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `CodeChanges.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.codeChanges.delete({ ...params }) -> DevRev.CodeChangesDeleteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a code change object. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.codeChanges.delete({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.CodeChangesDeleteRequest` + +
+
+ +
+
+ +**requestOptions:** `CodeChanges.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.codeChanges.get({ ...params }) -> DevRev.CodeChangesGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a code change object. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.codeChanges.get({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.CodeChangesGetQuery` + +
+
+ +
+
+ +**requestOptions:** `CodeChanges.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.codeChanges.getPost({ ...params }) -> DevRev.CodeChangesGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a code change object. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.codeChanges.getPost({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.CodeChangesGetRequest` + +
+
+ +
+
+ +**requestOptions:** `CodeChanges.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.codeChanges.list({ ...params }) -> DevRev.CodeChangesListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists code change objects. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.codeChanges.list(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.CodeChangesListQuery` + +
+
+ +
+
+ +**requestOptions:** `CodeChanges.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.codeChanges.listPost({ ...params }) -> DevRev.CodeChangesListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists code change objects. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.codeChanges.listPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.CodeChangesListRequest` + +
+
+ +
+
+ +**requestOptions:** `CodeChanges.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.codeChanges.update({ ...params }) -> DevRev.CodeChangesUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a code change object. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.codeChanges.update({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.CodeChangesUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `CodeChanges.RequestOptions` + +
+
+
+
+ +
+
+
+ +## conversations + +
client.conversations.create({ ...params }) -> DevRev.ConversationsCreateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a conversation. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.create({ + type: "support", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.delete({ ...params }) -> DevRev.ConversationsDeleteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes the requested conversation. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.delete({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsDeleteRequest` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.export({ ...params }) -> DevRev.ConversationsExportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exports a collection of conversation items. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.export({ + tagsV2Id: "TAG-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsExportQuery` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.exportPost({ ...params }) -> DevRev.ConversationsExportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exports a collection of conversation items. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.exportPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsExportRequest` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.get({ ...params }) -> DevRev.ConversationsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the requested conversation's information. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.get({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsGetQuery` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.getPost({ ...params }) -> DevRev.ConversationsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the requested conversation's information. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.getPost({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsGetRequest` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.list({ ...params }) -> DevRev.ConversationsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the available conversations. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.list({ + tagsV2Id: "TAG-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsListQuery` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.listPost({ ...params }) -> DevRev.ConversationsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the available conversations. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.listPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsListRequest` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.conversations.update({ ...params }) -> DevRev.ConversationsUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the requested conversation. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.update({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.ConversationsUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `Conversations.RequestOptions` + +
+
+
+
+ +
+
+
+ +## dev-users + +
client.devUsers.identitiesLink({ ...params }) -> DevRev.DevUsersIdentitiesLinkResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Links an external/secondary identity to the Dev user. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.devUsers.identitiesLink({ + devUser: "dev_user", + id: "id", + issuer: "issuer", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.DevUsersIdentitiesLinkRequest` + +
+
+ +
+
+ +**requestOptions:** `DevUsers.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.devUsers.identitiesUnlink({ ...params }) -> DevRev.DevUsersIdentitiesUnlinkResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Unlinks an external/secondary identity from the Dev user. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.devUsers.identitiesUnlink({ + devUser: "dev_user", + issuer: "issuer", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.DevUsersIdentitiesUnlinkRequest` + +
+
+ +
+
+ +**requestOptions:** `DevUsers.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.devUsers.selfUpdate({ ...params }) -> DevRev.DevUsersUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the authenticated user. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.devUsers.selfUpdate(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.DevUsersSelfUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `DevUsers.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.devUsers.update({ ...params }) -> DevRev.DevUsersUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the user corresponding to the input Id. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.devUsers.update({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.DevUsersUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `DevUsers.RequestOptions` + +
+
+
+
+ +
+
+
+ +## engagements + +
client.engagements.count({ ...params }) -> DevRev.EngagementsCountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Counts the engagement records. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.count(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsCountQuery` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.countPost({ ...params }) -> DevRev.EngagementsCountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Counts the engagement records. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.countPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsCountRequest` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.create({ ...params }) -> DevRev.EngagementsCreateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new engagement record. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.create({ + members: ["DEVU-12345"], + parent: "ACC-12345", + scheduledDate: new Date("2023-01-01T12:00:00.000Z"), + title: "title", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.delete({ ...params }) -> DevRev.EngagementsDeleteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes the engagement record. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.delete({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsDeleteRequest` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.get({ ...params }) -> DevRev.EngagementsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the engagement record. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.get({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsGetQuery` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.getPost({ ...params }) -> DevRev.EngagementsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the engagement record. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.getPost({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsGetRequest` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.list({ ...params }) -> DevRev.EngagementsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the engagement records. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.list(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsListQuery` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.listPost({ ...params }) -> DevRev.EngagementsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the engagement records. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.listPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsListRequest` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.engagements.update({ ...params }) -> DevRev.EngagementsUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the engagement record. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.engagements.update({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EngagementsUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `Engagements.RequestOptions` + +
+
+
+
+ +
+
+
+ +## event-source + +
client.eventSource.get({ ...params }) -> DevRev.EventSourceGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets an event source. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.eventSource.get({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EventSourcesGetQuery` + +
+
+ +
+
+ +**requestOptions:** `EventSource.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.eventSource.getPost({ ...params }) -> DevRev.EventSourceGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets an event source. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.eventSource.getPost({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EventSourceGetRequest` + +
+
+ +
+
+ +**requestOptions:** `EventSource.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.eventSource.scheduleEvent({ ...params }) -> DevRev.EventSourcesScheduleEventResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Schedules an event to be published to the specified event source. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.eventSource.scheduleEvent({ + eventType: "event_type", + id: "id", + payload: "payload", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EventSourcesScheduleEventRequest` + +
+
+ +
+
+ +**requestOptions:** `EventSource.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.eventSource.deleteScheduledEvent({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes an event scheduled for the specified event source. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.eventSource.deleteScheduledEvent({ + eventKey: "event_key", + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.EventSourcesDeleteScheduledEventRequest` + +
+
+ +
+
+ +**requestOptions:** `EventSource.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.eventSource.trackEventsPublish({ ...params }) -> DevRev.TrackEventsPublishResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Allows publishing of events (example from plug widget). + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.eventSource.trackEventsPublish({ + eventsList: [ + { + name: "name", + payload: { + key: "value", + }, + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.TrackEventsPublishRequest` + +
+
+ +
+
+ +**requestOptions:** `EventSource.RequestOptions` + +
+
+
+
+ +
+
+
+ +## groups + +
client.groups.create({ ...params }) -> DevRev.GroupsCreateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new group. A group is a collection of users. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.create({ + description: "description", + name: "name", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupsCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.get({ ...params }) -> DevRev.GroupsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the requested group. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.get({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupsGetQuery` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.getPost({ ...params }) -> DevRev.GroupsGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the requested group. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.getPost({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupsGetRequest` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.list({ ...params }) -> DevRev.GroupsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the available groups. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.list(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupsListQuery` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.listPost({ ...params }) -> DevRev.GroupsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the available groups. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.listPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupsListRequest` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.groupMembersAdd({ ...params }) -> DevRev.GroupMembersAddResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Adds a member to a group. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.groupMembersAdd({ + group: "group", + member: "DEVU-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupMembersAddRequest` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.groupMembersList({ ...params }) -> DevRev.GroupMembersListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the members in a group. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.groupMembersList({ + group: "group", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupMembersListQuery` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.groupMembersListPost({ ...params }) -> DevRev.GroupMembersListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the members in a group. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.groupMembersListPost({ + group: "group", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupMembersListRequest` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.groupMembersRemove({ ...params }) -> DevRev.GroupMembersRemoveResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Removes a member from a group. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.groupMembersRemove({ + group: "group", + member: "DEVU-12345", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupMembersRemoveRequest` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.groups.update({ ...params }) -> DevRev.GroupsUpdateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the requested group. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.groups.update({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.GroupsUpdateRequest` + +
+
+ +
+
+ +**requestOptions:** `Groups.RequestOptions` + +
+
+
+
+ +
+
+
+ +## links + +
client.links.create({ ...params }) -> DevRev.LinksCreateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link between two objects to indicate a relationship. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.links.create({ + linkType: DevRev.LinkType.CustomLink, + source: "string", + target: "string", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.LinksCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Links.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.links.delete({ ...params }) -> DevRev.LinksDeleteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a link. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.links.delete({ + id: "id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.LinksDeleteRequest` + +
+
+ +
+
+ +**requestOptions:** `Links.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.links.get({ ...params }) -> DevRev.LinksGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the requested link's information. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.links.get({ + id: "string", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.LinksGetQuery` + +
+
+ +
+
+ +**requestOptions:** `Links.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.links.getPost({ ...params }) -> DevRev.LinksGetResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets the requested link's information. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.links.getPost({ + id: "string", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.LinksGetRequest` + +
+
+ +
+
+ +**requestOptions:** `Links.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.links.list({ ...params }) -> DevRev.LinksListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the available links. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.links.list({ + object: "object", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.LinksListQuery` + +
+
+ +
+
+ +**requestOptions:** `Links.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.links.listPost({ ...params }) -> DevRev.LinksListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists the available links. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.links.listPost({ + object: "object", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.LinksListRequest` + +
+
+ +
+
+ +**requestOptions:** `Links.RequestOptions` + +
+
+
+
+ +
+
+
+ +## slas + +
client.slas.metricDefinitionsList({ ...params }) -> DevRev.MetricDefinitionsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists metric definitions matching a filter. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.slas.metricDefinitionsList(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.MetricDefinitionsListQuery` + +
+
+ +
+
+ +**requestOptions:** `Slas.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.slas.metricDefinitionsListPost({ ...params }) -> DevRev.MetricDefinitionsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists metric definitions matching a filter. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.slas.metricDefinitionsListPost(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.MetricDefinitionsListRequest` + +
+
+ +
+
+ +**requestOptions:** `Slas.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.slas.assign({ ...params }) -> DevRev.SlasAssignResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assigns the SLA to a set of Rev organizations. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.slas.assign({ + revOrgs: ["REV-AbCdEfGh"], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DevRev.SlasAssignRequest` + +
+
+ +
+
+ +**requestOptions:** `Slas.RequestOptions` + +
+
+
+
+ +
+
diff --git a/src/Client.ts b/src/Client.ts new file mode 100644 index 0000000..d348eb3 --- /dev/null +++ b/src/Client.ts @@ -0,0 +1,209 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "./environments"; +import * as core from "./core"; +import { Accounts } from "./api/resources/accounts/client/Client"; +import { Articles } from "./api/resources/articles/client/Client"; +import { Artifacts } from "./api/resources/artifacts/client/Client"; +import { CodeChanges } from "./api/resources/codeChanges/client/Client"; +import { Conversations } from "./api/resources/conversations/client/Client"; +import { DevUsers } from "./api/resources/devUsers/client/Client"; +import { Engagements } from "./api/resources/engagements/client/Client"; +import { EventSource } from "./api/resources/eventSource/client/Client"; +import { Groups } from "./api/resources/groups/client/Client"; +import { Links } from "./api/resources/links/client/Client"; +import { Slas } from "./api/resources/slas/client/Client"; +import { ProductUsage } from "./api/resources/productUsage/client/Client"; +import { Schedules } from "./api/resources/schedules/client/Client"; +import { Parts } from "./api/resources/parts/client/Client"; +import { QuestionAnswers } from "./api/resources/questionAnswers/client/Client"; +import { RevOrgs } from "./api/resources/revOrgs/client/Client"; +import { RevUsers } from "./api/resources/revUsers/client/Client"; +import { Customization } from "./api/resources/customization/client/Client"; +import { Search } from "./api/resources/search/client/Client"; +import { ServiceAccounts } from "./api/resources/serviceAccounts/client/Client"; +import { SnapIns } from "./api/resources/snapIns/client/Client"; +import { SnapWidgets } from "./api/resources/snapWidgets/client/Client"; +import { Surveys } from "./api/resources/surveys/client/Client"; +import { SysUsers } from "./api/resources/sysUsers/client/Client"; +import { TimelineEntries } from "./api/resources/timelineEntries/client/Client"; +import { Works } from "./api/resources/works/client/Client"; + +export declare namespace DevRevClient { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +export class DevRevClient { + constructor(protected readonly _options: DevRevClient.Options = {}) {} + + protected _accounts: Accounts | undefined; + + public get accounts(): Accounts { + return (this._accounts ??= new Accounts(this._options)); + } + + protected _articles: Articles | undefined; + + public get articles(): Articles { + return (this._articles ??= new Articles(this._options)); + } + + protected _artifacts: Artifacts | undefined; + + public get artifacts(): Artifacts { + return (this._artifacts ??= new Artifacts(this._options)); + } + + protected _codeChanges: CodeChanges | undefined; + + public get codeChanges(): CodeChanges { + return (this._codeChanges ??= new CodeChanges(this._options)); + } + + protected _conversations: Conversations | undefined; + + public get conversations(): Conversations { + return (this._conversations ??= new Conversations(this._options)); + } + + protected _devUsers: DevUsers | undefined; + + public get devUsers(): DevUsers { + return (this._devUsers ??= new DevUsers(this._options)); + } + + protected _engagements: Engagements | undefined; + + public get engagements(): Engagements { + return (this._engagements ??= new Engagements(this._options)); + } + + protected _eventSource: EventSource | undefined; + + public get eventSource(): EventSource { + return (this._eventSource ??= new EventSource(this._options)); + } + + protected _groups: Groups | undefined; + + public get groups(): Groups { + return (this._groups ??= new Groups(this._options)); + } + + protected _links: Links | undefined; + + public get links(): Links { + return (this._links ??= new Links(this._options)); + } + + protected _slas: Slas | undefined; + + public get slas(): Slas { + return (this._slas ??= new Slas(this._options)); + } + + protected _productUsage: ProductUsage | undefined; + + public get productUsage(): ProductUsage { + return (this._productUsage ??= new ProductUsage(this._options)); + } + + protected _schedules: Schedules | undefined; + + public get schedules(): Schedules { + return (this._schedules ??= new Schedules(this._options)); + } + + protected _parts: Parts | undefined; + + public get parts(): Parts { + return (this._parts ??= new Parts(this._options)); + } + + protected _questionAnswers: QuestionAnswers | undefined; + + public get questionAnswers(): QuestionAnswers { + return (this._questionAnswers ??= new QuestionAnswers(this._options)); + } + + protected _revOrgs: RevOrgs | undefined; + + public get revOrgs(): RevOrgs { + return (this._revOrgs ??= new RevOrgs(this._options)); + } + + protected _revUsers: RevUsers | undefined; + + public get revUsers(): RevUsers { + return (this._revUsers ??= new RevUsers(this._options)); + } + + protected _customization: Customization | undefined; + + public get customization(): Customization { + return (this._customization ??= new Customization(this._options)); + } + + protected _search: Search | undefined; + + public get search(): Search { + return (this._search ??= new Search(this._options)); + } + + protected _serviceAccounts: ServiceAccounts | undefined; + + public get serviceAccounts(): ServiceAccounts { + return (this._serviceAccounts ??= new ServiceAccounts(this._options)); + } + + protected _snapIns: SnapIns | undefined; + + public get snapIns(): SnapIns { + return (this._snapIns ??= new SnapIns(this._options)); + } + + protected _snapWidgets: SnapWidgets | undefined; + + public get snapWidgets(): SnapWidgets { + return (this._snapWidgets ??= new SnapWidgets(this._options)); + } + + protected _surveys: Surveys | undefined; + + public get surveys(): Surveys { + return (this._surveys ??= new Surveys(this._options)); + } + + protected _sysUsers: SysUsers | undefined; + + public get sysUsers(): SysUsers { + return (this._sysUsers ??= new SysUsers(this._options)); + } + + protected _timelineEntries: TimelineEntries | undefined; + + public get timelineEntries(): TimelineEntries { + return (this._timelineEntries ??= new TimelineEntries(this._options)); + } + + protected _works: Works | undefined; + + public get works(): Works { + return (this._works ??= new Works(this._options)); + } +} diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts new file mode 100644 index 0000000..6df4e08 --- /dev/null +++ b/src/api/errors/BadRequestError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class BadRequestError extends errors.DevRevError { + constructor(body: DevRev.ErrorBadRequest) { + super({ + message: "BadRequestError", + statusCode: 400, + body: body, + }); + Object.setPrototypeOf(this, BadRequestError.prototype); + } +} diff --git a/src/api/errors/ConflictError.ts b/src/api/errors/ConflictError.ts new file mode 100644 index 0000000..9d274ac --- /dev/null +++ b/src/api/errors/ConflictError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class ConflictError extends errors.DevRevError { + constructor(body: DevRev.ErrorConflict) { + super({ + message: "ConflictError", + statusCode: 409, + body: body, + }); + Object.setPrototypeOf(this, ConflictError.prototype); + } +} diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts new file mode 100644 index 0000000..29e5562 --- /dev/null +++ b/src/api/errors/ForbiddenError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class ForbiddenError extends errors.DevRevError { + constructor(body: DevRev.ErrorForbidden) { + super({ + message: "ForbiddenError", + statusCode: 403, + body: body, + }); + Object.setPrototypeOf(this, ForbiddenError.prototype); + } +} diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts new file mode 100644 index 0000000..b61d941 --- /dev/null +++ b/src/api/errors/InternalServerError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class InternalServerError extends errors.DevRevError { + constructor(body: DevRev.ErrorInternalServerError) { + super({ + message: "InternalServerError", + statusCode: 500, + body: body, + }); + Object.setPrototypeOf(this, InternalServerError.prototype); + } +} diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts new file mode 100644 index 0000000..30d3620 --- /dev/null +++ b/src/api/errors/NotFoundError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class NotFoundError extends errors.DevRevError { + constructor(body: DevRev.ErrorNotFound) { + super({ + message: "NotFoundError", + statusCode: 404, + body: body, + }); + Object.setPrototypeOf(this, NotFoundError.prototype); + } +} diff --git a/src/api/errors/ServiceUnavailableError.ts b/src/api/errors/ServiceUnavailableError.ts new file mode 100644 index 0000000..c8840d4 --- /dev/null +++ b/src/api/errors/ServiceUnavailableError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class ServiceUnavailableError extends errors.DevRevError { + constructor(body: DevRev.ErrorServiceUnavailable) { + super({ + message: "ServiceUnavailableError", + statusCode: 503, + body: body, + }); + Object.setPrototypeOf(this, ServiceUnavailableError.prototype); + } +} diff --git a/src/api/errors/TooManyRequestsError.ts b/src/api/errors/TooManyRequestsError.ts new file mode 100644 index 0000000..a88696c --- /dev/null +++ b/src/api/errors/TooManyRequestsError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class TooManyRequestsError extends errors.DevRevError { + constructor(body: DevRev.ErrorTooManyRequests) { + super({ + message: "TooManyRequestsError", + statusCode: 429, + body: body, + }); + Object.setPrototypeOf(this, TooManyRequestsError.prototype); + } +} diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts new file mode 100644 index 0000000..1b451a4 --- /dev/null +++ b/src/api/errors/UnauthorizedError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as errors from "../../errors/index"; +import * as DevRev from "../index"; + +export class UnauthorizedError extends errors.DevRevError { + constructor(body: DevRev.ErrorUnauthorized) { + super({ + message: "UnauthorizedError", + statusCode: 401, + body: body, + }); + Object.setPrototypeOf(this, UnauthorizedError.prototype); + } +} diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts new file mode 100644 index 0000000..50bf98f --- /dev/null +++ b/src/api/errors/index.ts @@ -0,0 +1,8 @@ +export * from "./BadRequestError"; +export * from "./UnauthorizedError"; +export * from "./ForbiddenError"; +export * from "./ConflictError"; +export * from "./TooManyRequestsError"; +export * from "./InternalServerError"; +export * from "./ServiceUnavailableError"; +export * from "./NotFoundError"; diff --git a/src/api/index.ts b/src/api/index.ts new file mode 100644 index 0000000..1cb55b6 --- /dev/null +++ b/src/api/index.ts @@ -0,0 +1,3 @@ +export * from "./types"; +export * from "./errors"; +export * from "./resources"; diff --git a/src/api/resources/accounts/client/Client.ts b/src/api/resources/accounts/client/Client.ts new file mode 100644 index 0000000..20d2a72 --- /dev/null +++ b/src/api/resources/accounts/client/Client.ts @@ -0,0 +1,1601 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Accounts { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Accounts management APIs + */ +export class Accounts { + constructor(protected readonly _options: Accounts.Options = {}) {} + + /** + * Creates an account, which is a record representing a customer or an + * organization. + * + * @param {DevRev.AccountsCreateRequest} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.ConflictError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.create({ + * displayName: "display_name" + * }) + */ + public async create( + request: DevRev.AccountsCreateRequest, + requestOptions?: Accounts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.AccountsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 409: + throw new DevRev.ConflictError( + serializers.ErrorConflict.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes an account. + * + * @param {DevRev.AccountsDeleteRequest} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.delete({ + * id: "ACC-12345" + * }) + */ + public async delete( + request: DevRev.AccountsDeleteRequest, + requestOptions?: Accounts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.AccountsDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Exports a collection of accounts. + * + * @param {DevRev.AccountsExportQuery} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.export({ + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * }) + */ + public async export( + request: DevRev.AccountsExportQuery = {}, + requestOptions?: Accounts.RequestOptions + ): Promise { + const { + createdBy, + createdDateAfter, + createdDateBefore, + customFields, + displayName, + domains, + externalRefs, + first, + modifiedDateAfter, + modifiedDateBefore, + ownedBy, + sortBy, + stage, + tags, + } = request; + const _queryParams: Record = {}; + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (createdDateAfter != null) { + _queryParams["created_date.after"] = createdDateAfter.toISOString(); + } + + if (createdDateBefore != null) { + _queryParams["created_date.before"] = createdDateBefore.toISOString(); + } + + if (customFields != null) { + _queryParams["custom_fields"] = JSON.stringify(customFields); + } + + if (displayName != null) { + if (Array.isArray(displayName)) { + _queryParams["display_name"] = displayName.map((item) => item); + } else { + _queryParams["display_name"] = displayName; + } + } + + if (domains != null) { + if (Array.isArray(domains)) { + _queryParams["domains"] = domains.map((item) => item); + } else { + _queryParams["domains"] = domains; + } + } + + if (externalRefs != null) { + if (Array.isArray(externalRefs)) { + _queryParams["external_refs"] = externalRefs.map((item) => item); + } else { + _queryParams["external_refs"] = externalRefs; + } + } + + if (first != null) { + _queryParams["first"] = first.toString(); + } + + if (modifiedDateAfter != null) { + _queryParams["modified_date.after"] = modifiedDateAfter.toISOString(); + } + + if (modifiedDateBefore != null) { + _queryParams["modified_date.before"] = modifiedDateBefore.toISOString(); + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (stage != null) { + if (Array.isArray(stage)) { + _queryParams["stage"] = stage.map((item) => item); + } else { + _queryParams["stage"] = stage; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.export" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsExportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Exports a collection of accounts. + * + * @param {DevRev.AccountsExportRequest} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.exportPost() + */ + public async exportPost( + request: DevRev.AccountsExportRequest = {}, + requestOptions?: Accounts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.export" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.AccountsExportRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsExportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Retrieves an account's information. + * + * @param {DevRev.AccountsGetQuery} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.get({ + * id: "ACC-12345" + * }) + */ + public async get( + request: DevRev.AccountsGetQuery, + requestOptions?: Accounts.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Retrieves an account's information. + * + * @param {DevRev.AccountsGetRequest} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.getPost({ + * id: "ACC-12345" + * }) + */ + public async getPost( + request: DevRev.AccountsGetRequest, + requestOptions?: Accounts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.AccountsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a list of accounts. + * + * @param {DevRev.AccountsListQuery} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.list({ + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * }) + */ + public async list( + request: DevRev.AccountsListQuery = {}, + requestOptions?: Accounts.RequestOptions + ): Promise { + const { + createdBy, + createdDateAfter, + createdDateBefore, + cursor, + customFields, + displayName, + domains, + externalRefs, + limit, + mode, + modifiedDateAfter, + modifiedDateBefore, + ownedBy, + sortBy, + stage, + tags, + } = request; + const _queryParams: Record = {}; + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (createdDateAfter != null) { + _queryParams["created_date.after"] = createdDateAfter.toISOString(); + } + + if (createdDateBefore != null) { + _queryParams["created_date.before"] = createdDateBefore.toISOString(); + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (customFields != null) { + _queryParams["custom_fields"] = JSON.stringify(customFields); + } + + if (displayName != null) { + if (Array.isArray(displayName)) { + _queryParams["display_name"] = displayName.map((item) => item); + } else { + _queryParams["display_name"] = displayName; + } + } + + if (domains != null) { + if (Array.isArray(domains)) { + _queryParams["domains"] = domains.map((item) => item); + } else { + _queryParams["domains"] = domains; + } + } + + if (externalRefs != null) { + if (Array.isArray(externalRefs)) { + _queryParams["external_refs"] = externalRefs.map((item) => item); + } else { + _queryParams["external_refs"] = externalRefs; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (modifiedDateAfter != null) { + _queryParams["modified_date.after"] = modifiedDateAfter.toISOString(); + } + + if (modifiedDateBefore != null) { + _queryParams["modified_date.before"] = modifiedDateBefore.toISOString(); + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (stage != null) { + if (Array.isArray(stage)) { + _queryParams["stage"] = stage.map((item) => item); + } else { + _queryParams["stage"] = stage; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a list of accounts. + * + * @param {DevRev.AccountsListRequest} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.listPost() + */ + public async listPost( + request: DevRev.AccountsListRequest = {}, + requestOptions?: Accounts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.AccountsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates an account's information. + * + * @param {DevRev.AccountsUpdateRequest} request + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.ConflictError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.accounts.update({ + * id: "ACC-12345" + * }) + */ + public async update( + request: DevRev.AccountsUpdateRequest, + requestOptions?: Accounts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "accounts.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.AccountsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AccountsUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 409: + throw new DevRev.ConflictError( + serializers.ErrorConflict.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/accounts/client/index.ts b/src/api/resources/accounts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/accounts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/accounts/client/requests/AccountsCreateRequest.ts b/src/api/resources/accounts/client/requests/AccountsCreateRequest.ts new file mode 100644 index 0000000..6fc2110 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsCreateRequest.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * displayName: "display_name" + * } + */ +export interface AccountsCreateRequest { + /** The IDs of the artifacts to associate with the account. */ + artifacts?: string[]; + /** Application-defined custom fields. */ + customFields?: Record; + /** Description of the account. */ + description?: string; + /** Name of the account. */ + displayName: string; + /** List of company's domain names. Example - ['devrev.ai']. */ + domains?: string[]; + /** + * External refs are unique identifiers from your customer system of + * records, stored as a list. + * + */ + externalRefs?: string[]; + /** List of Dev users owning this account. */ + ownedBy?: string[]; + /** Schema fragment IDs associated with this account SOR. */ + schemaFragmentIds?: string[]; + /** Tags associated with the account. */ + tags?: DevRev.SetTagWithValue[]; + /** The tier of the account. */ + tier?: string; + /** + * List of company websites. Example - ['www.devrev.ai', + * 'www.marketplace.devrev.ai']. + * + */ + websites?: string[]; +} diff --git a/src/api/resources/accounts/client/requests/AccountsDeleteRequest.ts b/src/api/resources/accounts/client/requests/AccountsDeleteRequest.ts new file mode 100644 index 0000000..bedab72 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ACC-12345" + * } + */ +export interface AccountsDeleteRequest { + /** The ID of account to delete. */ + id: string; +} diff --git a/src/api/resources/accounts/client/requests/AccountsExportQuery.ts b/src/api/resources/accounts/client/requests/AccountsExportQuery.ts new file mode 100644 index 0000000..1dbdf40 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsExportQuery.ts @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * } + */ +export interface AccountsExportQuery { + /** + * Filters for accounts created by the specified user(s). + */ + createdBy?: string | string[]; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + createdDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + createdDateBefore?: Date; + /** + * Filters for custom fields. + */ + customFields?: Record; + /** + * Array of display names of accounts to be filtered. + */ + displayName?: string | string[]; + /** + * Domains for accounts to be filtered. + */ + domains?: string | string[]; + /** + * Array of references of accounts to be filtered. + */ + externalRefs?: string | string[]; + /** + * The number of accounts to return. The default is '50'. + */ + first?: number; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + modifiedDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + modifiedDateBefore?: Date; + /** + * Filters for accounts owned by the specified user(s). + */ + ownedBy?: string | string[]; + /** + * Fields to sort the accounts by and the direction to sort them in. + */ + sortBy?: string | string[]; + /** + * Filters for accounts on specified stages. + */ + stage?: string | string[]; + /** + * List of tags to be filtered. + */ + tags?: string | string[]; +} diff --git a/src/api/resources/accounts/client/requests/AccountsExportRequest.ts b/src/api/resources/accounts/client/requests/AccountsExportRequest.ts new file mode 100644 index 0000000..142efd2 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsExportRequest.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface AccountsExportRequest { + /** Filters for accounts created by the specified user(s). */ + createdBy?: string[]; + createdDate?: DevRev.DateTimeFilter; + /** Filters for custom fields. */ + customFields?: Record; + /** Array of display names of accounts to be filtered. */ + displayName?: string[]; + /** Domains for accounts to be filtered. */ + domains?: string[]; + /** Array of references of accounts to be filtered. */ + externalRefs?: string[]; + /** The number of accounts to return. The default is '50'. */ + first?: number; + modifiedDate?: DevRev.DateTimeFilter; + /** Filters for accounts owned by the specified user(s). */ + ownedBy?: string[]; + /** + * Fields to sort the accounts by and the direction to sort them in. + * + */ + sortBy?: string[]; + /** Filters for accounts on specified stages. */ + stage?: string[]; + /** List of tags to be filtered. */ + tags?: string[]; +} diff --git a/src/api/resources/accounts/client/requests/AccountsGetQuery.ts b/src/api/resources/accounts/client/requests/AccountsGetQuery.ts new file mode 100644 index 0000000..56890f6 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ACC-12345" + * } + */ +export interface AccountsGetQuery { + /** + * The ID of the account to be retrieved. + */ + id: string; +} diff --git a/src/api/resources/accounts/client/requests/AccountsGetRequest.ts b/src/api/resources/accounts/client/requests/AccountsGetRequest.ts new file mode 100644 index 0000000..af525fd --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ACC-12345" + * } + */ +export interface AccountsGetRequest { + /** The ID of the account to be retrieved. */ + id: string; +} diff --git a/src/api/resources/accounts/client/requests/AccountsListQuery.ts b/src/api/resources/accounts/client/requests/AccountsListQuery.ts new file mode 100644 index 0000000..95254c4 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsListQuery.ts @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * } + */ +export interface AccountsListQuery { + /** + * Filters for accounts created by the specified user(s). + */ + createdBy?: string | string[]; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + createdDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + createdDateBefore?: Date; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters for custom fields. + */ + customFields?: Record; + /** + * Array of display names of accounts to be filtered. + */ + displayName?: string | string[]; + /** + * Domains for accounts to be filtered. + */ + domains?: string | string[]; + /** + * Array of references of accounts to be filtered. + */ + externalRefs?: string | string[]; + /** + * The maximum number of accounts to return per page. The default is + * '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + modifiedDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + modifiedDateBefore?: Date; + /** + * Filters for accounts owned by the specified user(s). + */ + ownedBy?: string | string[]; + /** + * Fields to sort the accounts by and the direction to sort them in. + */ + sortBy?: string | string[]; + /** + * Filters for accounts on specified stages. + */ + stage?: string | string[]; + /** + * List of tags to be filtered. + */ + tags?: string | string[]; +} diff --git a/src/api/resources/accounts/client/requests/AccountsListRequest.ts b/src/api/resources/accounts/client/requests/AccountsListRequest.ts new file mode 100644 index 0000000..a809633 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsListRequest.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface AccountsListRequest { + /** Filters for accounts created by the specified user(s). */ + createdBy?: string[]; + createdDate?: DevRev.DateTimeFilter; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** Filters for custom fields. */ + customFields?: Record; + /** Array of display names of accounts to be filtered. */ + displayName?: string[]; + /** Domains for accounts to be filtered. */ + domains?: string[]; + /** Array of references of accounts to be filtered. */ + externalRefs?: string[]; + /** + * The maximum number of accounts to return per page. The default is + * '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + modifiedDate?: DevRev.DateTimeFilter; + /** Filters for accounts owned by the specified user(s). */ + ownedBy?: string[]; + /** + * Fields to sort the accounts by and the direction to sort them in. + * + */ + sortBy?: string[]; + /** Filters for accounts on specified stages. */ + stage?: string[]; + /** List of tags to be filtered. */ + tags?: string[]; +} diff --git a/src/api/resources/accounts/client/requests/AccountsUpdateRequest.ts b/src/api/resources/accounts/client/requests/AccountsUpdateRequest.ts new file mode 100644 index 0000000..9749430 --- /dev/null +++ b/src/api/resources/accounts/client/requests/AccountsUpdateRequest.ts @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "ACC-12345" + * } + */ +export interface AccountsUpdateRequest { + artifacts?: DevRev.AccountsUpdateRequestArtifacts; + /** Application-defined custom fields. */ + customFields?: Record; + /** Updated description of the account. */ + description?: string; + /** Updated display name for the account. */ + displayName?: string; + /** + * Updated list of company's domain names. Example - ['devrev.ai']. + * + */ + domains?: string[]; + /** Updated External Refs of account. */ + externalRefs?: string[]; + /** The ID of account to update. */ + id: string; + /** Updated list of the users owning this account. */ + ownedBy?: string[]; + /** Schema fragment IDs associated with this account SOR. */ + schemaFragmentIds?: string[]; + /** Updated tags list associated with the account. */ + tags?: DevRev.SetTagWithValue[]; + /** Updated tier of the account. */ + tier?: string; +} diff --git a/src/api/resources/accounts/client/requests/index.ts b/src/api/resources/accounts/client/requests/index.ts new file mode 100644 index 0000000..e73dfb9 --- /dev/null +++ b/src/api/resources/accounts/client/requests/index.ts @@ -0,0 +1,9 @@ +export { type AccountsCreateRequest } from "./AccountsCreateRequest"; +export { type AccountsDeleteRequest } from "./AccountsDeleteRequest"; +export { type AccountsExportQuery } from "./AccountsExportQuery"; +export { type AccountsExportRequest } from "./AccountsExportRequest"; +export { type AccountsGetQuery } from "./AccountsGetQuery"; +export { type AccountsGetRequest } from "./AccountsGetRequest"; +export { type AccountsListQuery } from "./AccountsListQuery"; +export { type AccountsListRequest } from "./AccountsListRequest"; +export { type AccountsUpdateRequest } from "./AccountsUpdateRequest"; diff --git a/src/api/resources/accounts/index.ts b/src/api/resources/accounts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/accounts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/articles/client/Client.ts b/src/api/resources/articles/client/Client.ts new file mode 100644 index 0000000..29af369 --- /dev/null +++ b/src/api/resources/articles/client/Client.ts @@ -0,0 +1,1464 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace Articles { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Articles management APIs. + */ +export class Articles { + constructor(protected readonly _options: Articles.Options = {}) {} + + /** + * Get count of articles matching given filter. + * + * @param {DevRev.ArticlesCountQuery} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.count() + */ + public async count( + request: DevRev.ArticlesCountQuery = {}, + requestOptions?: Articles.RequestOptions + ): Promise { + const { ancestor, appliesToParts, articleType, authoredBy, createdBy, modifiedBy, ownedBy, scope } = request; + const _queryParams: Record = {}; + if (ancestor != null) { + _queryParams["ancestor"] = ancestor; + } + + if (appliesToParts != null) { + if (Array.isArray(appliesToParts)) { + _queryParams["applies_to_parts"] = appliesToParts.map((item) => item); + } else { + _queryParams["applies_to_parts"] = appliesToParts; + } + } + + if (articleType != null) { + if (Array.isArray(articleType)) { + _queryParams["article_type"] = articleType.map((item) => item); + } else { + _queryParams["article_type"] = articleType; + } + } + + if (authoredBy != null) { + if (Array.isArray(authoredBy)) { + _queryParams["authored_by"] = authoredBy.map((item) => item); + } else { + _queryParams["authored_by"] = authoredBy; + } + } + + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (modifiedBy != null) { + if (Array.isArray(modifiedBy)) { + _queryParams["modified_by"] = modifiedBy.map((item) => item); + } else { + _queryParams["modified_by"] = modifiedBy; + } + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (scope != null) { + if (Array.isArray(scope)) { + _queryParams["scope"] = scope.map((item) => item.toString()); + } else { + _queryParams["scope"] = scope.toString(); + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.count" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesCountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Get count of articles matching given filter. + * + * @param {DevRev.ArticlesCountRequest} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.countPost() + */ + public async countPost( + request: DevRev.ArticlesCountRequest = {}, + requestOptions?: Articles.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.count" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArticlesCountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesCountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Article is an object which can contain a URL or artifacts in the + * resource. It also contains the data regarding the owner, author, status + * and published date of the object. This call creates an article. + * + * @param {DevRev.ArticlesCreateRequest} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.create({ + * appliesToParts: ["PROD-12345"], + * ownedBy: ["DEVU-12345"], + * resource: {}, + * title: "title" + * }) + */ + public async create( + request: DevRev.ArticlesCreateRequest, + requestOptions?: Articles.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArticlesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes an article. + * + * @param {DevRev.ArticlesDeleteRequest} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.delete({ + * id: "ARTICLE-12345" + * }) + */ + public async delete( + request: DevRev.ArticlesDeleteRequest, + requestOptions?: Articles.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArticlesDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an article. + * + * @param {DevRev.GetArticleQuery} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.get({ + * id: "ARTICLE-12345" + * }) + */ + public async get( + request: DevRev.GetArticleQuery, + requestOptions?: Articles.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an article. + * + * @param {DevRev.ArticlesGetRequest} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.getPost({ + * id: "ARTICLE-12345" + * }) + */ + public async getPost( + request: DevRev.ArticlesGetRequest, + requestOptions?: Articles.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArticlesGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of articles. + * + * @param {DevRev.ListArticlesQuery} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.list() + */ + public async list( + request: DevRev.ListArticlesQuery = {}, + requestOptions?: Articles.RequestOptions + ): Promise { + const { appliesToParts, articleType, authoredBy, createdBy, cursor, limit, mode, modifiedBy, ownedBy, scope } = + request; + const _queryParams: Record = {}; + if (appliesToParts != null) { + if (Array.isArray(appliesToParts)) { + _queryParams["applies_to_parts"] = appliesToParts.map((item) => item); + } else { + _queryParams["applies_to_parts"] = appliesToParts; + } + } + + if (articleType != null) { + if (Array.isArray(articleType)) { + _queryParams["article_type"] = articleType.map((item) => item); + } else { + _queryParams["article_type"] = articleType; + } + } + + if (authoredBy != null) { + if (Array.isArray(authoredBy)) { + _queryParams["authored_by"] = authoredBy.map((item) => item); + } else { + _queryParams["authored_by"] = authoredBy; + } + } + + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (modifiedBy != null) { + if (Array.isArray(modifiedBy)) { + _queryParams["modified_by"] = modifiedBy.map((item) => item); + } else { + _queryParams["modified_by"] = modifiedBy; + } + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (scope != null) { + if (Array.isArray(scope)) { + _queryParams["scope"] = scope.map((item) => item.toString()); + } else { + _queryParams["scope"] = scope.toString(); + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of articles. + * + * @param {DevRev.ArticlesListRequest} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.listPost() + */ + public async listPost( + request: DevRev.ArticlesListRequest = {}, + requestOptions?: Articles.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArticlesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates an article. + * + * @param {DevRev.ArticlesUpdateRequest} request + * @param {Articles.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.articles.update({ + * id: "ARTICLE-12345" + * }) + */ + public async update( + request: DevRev.ArticlesUpdateRequest, + requestOptions?: Articles.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "articles.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArticlesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArticlesUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/articles/client/index.ts b/src/api/resources/articles/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/articles/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/articles/client/requests/ArticlesCountQuery.ts b/src/api/resources/articles/client/requests/ArticlesCountQuery.ts new file mode 100644 index 0000000..6c41b7b --- /dev/null +++ b/src/api/resources/articles/client/requests/ArticlesCountQuery.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface ArticlesCountQuery { + /** + * The ancestor directory of the articles. + */ + ancestor?: string; + /** + * Filters for articles belonging to any of the provided parts. + */ + appliesToParts?: string | string[]; + /** + * Filter for the type of articles. If this is not provided, then + * articles that are not content blocks are returned. + */ + articleType?: DevRev.ArticleType | DevRev.ArticleType[]; + /** + * Filters for articles authored by any of the provided users. + */ + authoredBy?: string | string[]; + /** + * Filters for articles created by any of the provided users. + */ + createdBy?: string | string[]; + /** + * Filters for articles modified by any of the provided users. + */ + modifiedBy?: string | string[]; + /** + * Filters for articles owned by any of the provided users. + */ + ownedBy?: string | string[]; + /** + * Filter for the scope of the articles. If this is not provided, then + * only external articles are returned. + */ + scope?: number | number[]; +} diff --git a/src/api/resources/articles/client/requests/ArticlesCountRequest.ts b/src/api/resources/articles/client/requests/ArticlesCountRequest.ts new file mode 100644 index 0000000..8221fd2 --- /dev/null +++ b/src/api/resources/articles/client/requests/ArticlesCountRequest.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface ArticlesCountRequest { + /** The ancestor directory of the articles. */ + ancestor?: string; + /** + * Filters for articles belonging to any of the provided parts. + * + */ + appliesToParts?: string[]; + /** + * Filter for the type of articles. If this is not provided, then + * articles that are not content blocks are returned. + * + */ + articleType?: DevRev.ArticleType[]; + /** + * Filters for articles authored by any of the provided users. + * + */ + authoredBy?: string[]; + /** + * Filters for articles created by any of the provided users. + * + */ + createdBy?: string[]; + /** + * Filters for articles modified by any of the provided users. + * + */ + modifiedBy?: string[]; + /** Filters for articles owned by any of the provided users. */ + ownedBy?: string[]; + /** + * Filter for the scope of the articles. If this is not provided, then + * only external articles are returned. + * + */ + scope?: number[]; + /** Filter for articles based on intended audience. */ + sharedWith?: DevRev.SharedWithMembershipFilter[]; +} diff --git a/src/api/resources/articles/client/requests/ArticlesCreateRequest.ts b/src/api/resources/articles/client/requests/ArticlesCreateRequest.ts new file mode 100644 index 0000000..a8cbbe3 --- /dev/null +++ b/src/api/resources/articles/client/requests/ArticlesCreateRequest.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * appliesToParts: ["PROD-12345"], + * ownedBy: ["DEVU-12345"], + * resource: {}, + * title: "title" + * } + */ +export interface ArticlesCreateRequest { + accessLevel?: DevRev.AccessLevel; + /** The parts that the article applies to. */ + appliesToParts: string[]; + articleType?: DevRev.ArticleType; + /** The authors of the article. */ + authoredBy?: string[]; + /** Description for the article. */ + description?: string; + /** ID of the extracted content artifact. */ + extractedContent?: string[]; + /** Language of the article. */ + language?: string; + /** The users that own the article. */ + ownedBy: string[]; + /** The parent directory of the article. */ + parent?: string; + /** The published date of the article. */ + publishedAt?: Date; + resource: DevRev.ArticlesCreateRequestResource; + /** The scope of the article. */ + scope?: number; + /** + * Information about the role the member receives due to the share. + * + */ + sharedWith?: DevRev.SetSharedWithMembership[]; + status?: DevRev.ArticleStatus; + /** Tags associated with the article. */ + tags?: DevRev.SetTagWithValue[]; + /** Name of the article. */ + title: string; +} diff --git a/src/api/resources/articles/client/requests/ArticlesDeleteRequest.ts b/src/api/resources/articles/client/requests/ArticlesDeleteRequest.ts new file mode 100644 index 0000000..0446906 --- /dev/null +++ b/src/api/resources/articles/client/requests/ArticlesDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ARTICLE-12345" + * } + */ +export interface ArticlesDeleteRequest { + /** The ID of the article to delete. */ + id: string; +} diff --git a/src/api/resources/articles/client/requests/ArticlesGetRequest.ts b/src/api/resources/articles/client/requests/ArticlesGetRequest.ts new file mode 100644 index 0000000..7378101 --- /dev/null +++ b/src/api/resources/articles/client/requests/ArticlesGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ARTICLE-12345" + * } + */ +export interface ArticlesGetRequest { + /** The ID of the required article. */ + id: string; +} diff --git a/src/api/resources/articles/client/requests/ArticlesListRequest.ts b/src/api/resources/articles/client/requests/ArticlesListRequest.ts new file mode 100644 index 0000000..dc2efc2 --- /dev/null +++ b/src/api/resources/articles/client/requests/ArticlesListRequest.ts @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface ArticlesListRequest { + /** + * Filters for articles belonging to any of the provided parts. + * + */ + appliesToParts?: string[]; + /** + * Filter for the type of articles. If this is not provided, then + * articles that are not content blocks are returned. + * + */ + articleType?: DevRev.ArticleType[]; + /** + * Filters for articles authored by any of the provided users. + * + */ + authoredBy?: string[]; + /** + * Filters for articles created by any of the provided users. + * + */ + createdBy?: string[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of articles to return. The default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** + * Filters for articles modified by any of the provided users. + * + */ + modifiedBy?: string[]; + /** Filters for articles owned by any of the provided users. */ + ownedBy?: string[]; + /** + * Filter for the scope of the articles. If this is not provided, then + * only external articles are returned. + * + */ + scope?: number[]; + /** Filter for articles based on intended audience. */ + sharedWith?: DevRev.SharedWithMembershipFilter[]; +} diff --git a/src/api/resources/articles/client/requests/ArticlesUpdateRequest.ts b/src/api/resources/articles/client/requests/ArticlesUpdateRequest.ts new file mode 100644 index 0000000..25ab70b --- /dev/null +++ b/src/api/resources/articles/client/requests/ArticlesUpdateRequest.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "ARTICLE-12345" + * } + */ +export interface ArticlesUpdateRequest { + accessLevel?: DevRev.AccessLevel; + appliesToParts?: DevRev.ArticlesUpdateRequestAppliesToParts; + artifacts?: DevRev.ArticlesUpdateRequestArtifacts; + authoredBy?: DevRev.ArticlesUpdateRequestAuthoredBy; + /** + * Updated description of the article object, or unchanged if not + * provided. + * + */ + description?: string; + extractedContent?: DevRev.ArticlesUpdateRequestExtractedContent; + /** The article's ID. */ + id: string; + /** Updates the language of the article. */ + language?: string; + ownedBy?: DevRev.ArticlesUpdateRequestOwnedBy; + /** The updated parent directory for the article. */ + parent?: string; + /** Updates the the latest published version. */ + publishedVersion?: string; + reorder?: DevRev.ArticlesUpdateRequestReorder; + sharedWith?: DevRev.ArticlesUpdateRequestSharedWith; + status?: DevRev.ArticleStatus; + tags?: DevRev.ArticlesUpdateRequestTags; + /** + * Updated title of the article object, or unchanged if not provided. + * + */ + title?: string; + /** Updates the URL of the external article. */ + url?: string; +} diff --git a/src/api/resources/articles/client/requests/GetArticleQuery.ts b/src/api/resources/articles/client/requests/GetArticleQuery.ts new file mode 100644 index 0000000..304c72a --- /dev/null +++ b/src/api/resources/articles/client/requests/GetArticleQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ARTICLE-12345" + * } + */ +export interface GetArticleQuery { + /** + * The ID of the required article. + */ + id: string; +} diff --git a/src/api/resources/articles/client/requests/ListArticlesQuery.ts b/src/api/resources/articles/client/requests/ListArticlesQuery.ts new file mode 100644 index 0000000..0390b27 --- /dev/null +++ b/src/api/resources/articles/client/requests/ListArticlesQuery.ts @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface ListArticlesQuery { + /** + * Filters for articles belonging to any of the provided parts. + */ + appliesToParts?: string | string[]; + /** + * Filter for the type of articles. If this is not provided, then + * articles that are not content blocks are returned. + */ + articleType?: DevRev.ArticleType | DevRev.ArticleType[]; + /** + * Filters for articles authored by any of the provided users. + */ + authoredBy?: string | string[]; + /** + * Filters for articles created by any of the provided users. + */ + createdBy?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of articles to return. The default is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for articles modified by any of the provided users. + */ + modifiedBy?: string | string[]; + /** + * Filters for articles owned by any of the provided users. + */ + ownedBy?: string | string[]; + /** + * Filter for the scope of the articles. If this is not provided, then + * only external articles are returned. + */ + scope?: number | number[]; +} diff --git a/src/api/resources/articles/client/requests/index.ts b/src/api/resources/articles/client/requests/index.ts new file mode 100644 index 0000000..d85c9c0 --- /dev/null +++ b/src/api/resources/articles/client/requests/index.ts @@ -0,0 +1,9 @@ +export { type ArticlesCountQuery } from "./ArticlesCountQuery"; +export { type ArticlesCountRequest } from "./ArticlesCountRequest"; +export { type ArticlesCreateRequest } from "./ArticlesCreateRequest"; +export { type ArticlesDeleteRequest } from "./ArticlesDeleteRequest"; +export { type GetArticleQuery } from "./GetArticleQuery"; +export { type ArticlesGetRequest } from "./ArticlesGetRequest"; +export { type ListArticlesQuery } from "./ListArticlesQuery"; +export { type ArticlesListRequest } from "./ArticlesListRequest"; +export { type ArticlesUpdateRequest } from "./ArticlesUpdateRequest"; diff --git a/src/api/resources/articles/index.ts b/src/api/resources/articles/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/articles/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/artifacts/client/Client.ts b/src/api/resources/artifacts/client/Client.ts new file mode 100644 index 0000000..24b0145 --- /dev/null +++ b/src/api/resources/artifacts/client/Client.ts @@ -0,0 +1,322 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Artifacts { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Artifact (file) management APIs. + */ +export class Artifacts { + constructor(protected readonly _options: Artifacts.Options = {}) {} + + /** + * Creates an artifact and generates an upload URL for its data. + * + * @param {DevRev.ArtifactsPrepareRequest} request + * @param {Artifacts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.artifacts.prepare({ + * fileName: "file_name" + * }) + */ + public async prepare( + request: DevRev.ArtifactsPrepareRequest, + requestOptions?: Artifacts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "artifacts.prepare" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArtifactsPrepareRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArtifactsPrepareResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Prepares a new version for an artifact, returning the URL and form data + * to upload the updated file. + * + * @param {DevRev.ArtifactsVersionsPrepareRequest} request + * @param {Artifacts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.artifacts.versionsPrepare({ + * id: "ARTIFACT-12345" + * }) + */ + public async versionsPrepare( + request: DevRev.ArtifactsVersionsPrepareRequest, + requestOptions?: Artifacts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "artifacts.versions.prepare" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ArtifactsVersionsPrepareRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ArtifactsVersionsPrepareResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/artifacts/client/index.ts b/src/api/resources/artifacts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/artifacts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/artifacts/client/requests/ArtifactsPrepareRequest.ts b/src/api/resources/artifacts/client/requests/ArtifactsPrepareRequest.ts new file mode 100644 index 0000000..b0ec25c --- /dev/null +++ b/src/api/resources/artifacts/client/requests/ArtifactsPrepareRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * fileName: "file_name" + * } + */ +export interface ArtifactsPrepareRequest { + /** The name of the file that's being uploaded. */ + fileName: string; + /** The type of file that's being uploaded. */ + fileType?: string; +} diff --git a/src/api/resources/artifacts/client/requests/ArtifactsVersionsPrepareRequest.ts b/src/api/resources/artifacts/client/requests/ArtifactsVersionsPrepareRequest.ts new file mode 100644 index 0000000..a2db975 --- /dev/null +++ b/src/api/resources/artifacts/client/requests/ArtifactsVersionsPrepareRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ARTIFACT-12345" + * } + */ +export interface ArtifactsVersionsPrepareRequest { + /** The ID of the artifact to prepare a new version for. */ + id: string; +} diff --git a/src/api/resources/artifacts/client/requests/index.ts b/src/api/resources/artifacts/client/requests/index.ts new file mode 100644 index 0000000..d02a1d5 --- /dev/null +++ b/src/api/resources/artifacts/client/requests/index.ts @@ -0,0 +1,2 @@ +export { type ArtifactsPrepareRequest } from "./ArtifactsPrepareRequest"; +export { type ArtifactsVersionsPrepareRequest } from "./ArtifactsVersionsPrepareRequest"; diff --git a/src/api/resources/artifacts/index.ts b/src/api/resources/artifacts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/artifacts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/codeChanges/client/Client.ts b/src/api/resources/codeChanges/client/Client.ts new file mode 100644 index 0000000..acd332e --- /dev/null +++ b/src/api/resources/codeChanges/client/Client.ts @@ -0,0 +1,1024 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace CodeChanges { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Code change interactions. + */ +export class CodeChanges { + constructor(protected readonly _options: CodeChanges.Options = {}) {} + + /** + * Creates a code change object. + * + * @param {DevRev.CodeChangesCreateRequest} request + * @param {CodeChanges.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.codeChanges.create({ + * "key": "value" + * }) + */ + public async create( + request: DevRev.CodeChangesCreateRequest, + requestOptions?: CodeChanges.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "code-changes.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CodeChangesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CodeChangesCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes a code change object. + * + * @param {DevRev.CodeChangesDeleteRequest} request + * @param {CodeChanges.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.codeChanges.delete({ + * id: "id" + * }) + */ + public async delete( + request: DevRev.CodeChangesDeleteRequest, + requestOptions?: CodeChanges.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "code-changes.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CodeChangesDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CodeChangesDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a code change object. + * + * @param {DevRev.CodeChangesGetQuery} request + * @param {CodeChanges.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.codeChanges.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.CodeChangesGetQuery, + requestOptions?: CodeChanges.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "code-changes.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CodeChangesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a code change object. + * + * @param {DevRev.CodeChangesGetRequest} request + * @param {CodeChanges.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.codeChanges.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.CodeChangesGetRequest, + requestOptions?: CodeChanges.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "code-changes.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CodeChangesGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CodeChangesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists code change objects. + * + * @param {DevRev.CodeChangesListQuery} request + * @param {CodeChanges.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.codeChanges.list() + */ + public async list( + request: DevRev.CodeChangesListQuery = {}, + requestOptions?: CodeChanges.RequestOptions + ): Promise { + const { cursor, limit, mode } = request; + const _queryParams: Record = {}; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "code-changes.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CodeChangesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists code change objects. + * + * @param {DevRev.CodeChangesListRequest} request + * @param {CodeChanges.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.codeChanges.listPost() + */ + public async listPost( + request: DevRev.CodeChangesListRequest = {}, + requestOptions?: CodeChanges.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "code-changes.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CodeChangesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CodeChangesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a code change object. + * + * @param {DevRev.CodeChangesUpdateRequest} request + * @param {CodeChanges.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.codeChanges.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.CodeChangesUpdateRequest, + requestOptions?: CodeChanges.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "code-changes.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CodeChangesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CodeChangesUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/codeChanges/client/index.ts b/src/api/resources/codeChanges/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/codeChanges/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/codeChanges/client/requests/CodeChangesDeleteRequest.ts b/src/api/resources/codeChanges/client/requests/CodeChangesDeleteRequest.ts new file mode 100644 index 0000000..b3a0d52 --- /dev/null +++ b/src/api/resources/codeChanges/client/requests/CodeChangesDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CodeChangesDeleteRequest { + /** ID of the code change object which is to be deleted. */ + id: string; +} diff --git a/src/api/resources/codeChanges/client/requests/CodeChangesGetQuery.ts b/src/api/resources/codeChanges/client/requests/CodeChangesGetQuery.ts new file mode 100644 index 0000000..f58ddcb --- /dev/null +++ b/src/api/resources/codeChanges/client/requests/CodeChangesGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CodeChangesGetQuery { + /** + * The code change object ID. + */ + id: string; +} diff --git a/src/api/resources/codeChanges/client/requests/CodeChangesGetRequest.ts b/src/api/resources/codeChanges/client/requests/CodeChangesGetRequest.ts new file mode 100644 index 0000000..e671231 --- /dev/null +++ b/src/api/resources/codeChanges/client/requests/CodeChangesGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CodeChangesGetRequest { + /** The code change object ID. */ + id: string; +} diff --git a/src/api/resources/codeChanges/client/requests/CodeChangesListQuery.ts b/src/api/resources/codeChanges/client/requests/CodeChangesListQuery.ts new file mode 100644 index 0000000..7be9222 --- /dev/null +++ b/src/api/resources/codeChanges/client/requests/CodeChangesListQuery.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface CodeChangesListQuery { + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of code change objects to return. The default is + * '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; +} diff --git a/src/api/resources/codeChanges/client/requests/CodeChangesListRequest.ts b/src/api/resources/codeChanges/client/requests/CodeChangesListRequest.ts new file mode 100644 index 0000000..e6bc72d --- /dev/null +++ b/src/api/resources/codeChanges/client/requests/CodeChangesListRequest.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface CodeChangesListRequest { + createdDate?: DevRev.DateFilter; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of code change objects to return. The default is + * '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + modifiedDate?: DevRev.DateFilter; +} diff --git a/src/api/resources/codeChanges/client/requests/CodeChangesUpdateRequest.ts b/src/api/resources/codeChanges/client/requests/CodeChangesUpdateRequest.ts new file mode 100644 index 0000000..836b7da --- /dev/null +++ b/src/api/resources/codeChanges/client/requests/CodeChangesUpdateRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CodeChangesUpdateRequest { + /** The ID of the code change object to be updated. */ + id: string; +} diff --git a/src/api/resources/codeChanges/client/requests/index.ts b/src/api/resources/codeChanges/client/requests/index.ts new file mode 100644 index 0000000..89e5f9e --- /dev/null +++ b/src/api/resources/codeChanges/client/requests/index.ts @@ -0,0 +1,6 @@ +export { type CodeChangesDeleteRequest } from "./CodeChangesDeleteRequest"; +export { type CodeChangesGetQuery } from "./CodeChangesGetQuery"; +export { type CodeChangesGetRequest } from "./CodeChangesGetRequest"; +export { type CodeChangesListQuery } from "./CodeChangesListQuery"; +export { type CodeChangesListRequest } from "./CodeChangesListRequest"; +export { type CodeChangesUpdateRequest } from "./CodeChangesUpdateRequest"; diff --git a/src/api/resources/codeChanges/index.ts b/src/api/resources/codeChanges/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/codeChanges/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/conversations/client/Client.ts b/src/api/resources/conversations/client/Client.ts new file mode 100644 index 0000000..0963e81 --- /dev/null +++ b/src/api/resources/conversations/client/Client.ts @@ -0,0 +1,1561 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Conversations { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev conversation interaction. + */ +export class Conversations { + constructor(protected readonly _options: Conversations.Options = {}) {} + + /** + * Creates a conversation. + * + * @param {DevRev.ConversationsCreateRequest} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.create({ + * type: "support" + * }) + */ + public async create( + request: DevRev.ConversationsCreateRequest, + requestOptions?: Conversations.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: { + ...serializers.ConversationsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + type: "support", + }, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes the requested conversation. + * + * @param {DevRev.ConversationsDeleteRequest} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.delete({ + * id: "id" + * }) + */ + public async delete( + request: DevRev.ConversationsDeleteRequest, + requestOptions?: Conversations.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ConversationsDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Exports a collection of conversation items. + * + * @param {DevRev.ConversationsExportQuery} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.export({ + * tagsV2Id: "TAG-12345" + * }) + */ + public async export( + request: DevRev.ConversationsExportQuery = {}, + requestOptions?: Conversations.RequestOptions + ): Promise { + const { + appliesToParts, + first, + group, + isCreatorVerified, + isSpam, + members, + ownedBy, + revOrg, + slaSummaryStage, + sourceChannels, + stageName, + tags, + tagsV2Id, + tagsV2Value, + } = request; + const _queryParams: Record = {}; + if (appliesToParts != null) { + if (Array.isArray(appliesToParts)) { + _queryParams["applies_to_parts"] = appliesToParts.map((item) => item); + } else { + _queryParams["applies_to_parts"] = appliesToParts; + } + } + + if (first != null) { + _queryParams["first"] = first.toString(); + } + + if (group != null) { + if (Array.isArray(group)) { + _queryParams["group"] = group.map((item) => item); + } else { + _queryParams["group"] = group; + } + } + + if (isCreatorVerified != null) { + _queryParams["is_creator_verified"] = isCreatorVerified.toString(); + } + + if (isSpam != null) { + _queryParams["is_spam"] = isSpam.toString(); + } + + if (members != null) { + if (Array.isArray(members)) { + _queryParams["members"] = members.map((item) => item); + } else { + _queryParams["members"] = members; + } + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (revOrg != null) { + if (Array.isArray(revOrg)) { + _queryParams["rev_org"] = revOrg.map((item) => item); + } else { + _queryParams["rev_org"] = revOrg; + } + } + + if (slaSummaryStage != null) { + if (Array.isArray(slaSummaryStage)) { + _queryParams["sla_summary.stage"] = slaSummaryStage.map((item) => item); + } else { + _queryParams["sla_summary.stage"] = slaSummaryStage; + } + } + + if (sourceChannels != null) { + if (Array.isArray(sourceChannels)) { + _queryParams["source_channels"] = sourceChannels.map((item) => item); + } else { + _queryParams["source_channels"] = sourceChannels; + } + } + + if (stageName != null) { + if (Array.isArray(stageName)) { + _queryParams["stage.name"] = stageName.map((item) => item); + } else { + _queryParams["stage.name"] = stageName; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + if (tagsV2Id != null) { + _queryParams["tags_v2.id"] = tagsV2Id; + } + + if (tagsV2Value != null) { + _queryParams["tags_v2.value"] = tagsV2Value; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.export" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsExportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Exports a collection of conversation items. + * + * @param {DevRev.ConversationsExportRequest} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.exportPost() + */ + public async exportPost( + request: DevRev.ConversationsExportRequest = {}, + requestOptions?: Conversations.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.export" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ConversationsExportRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsExportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the requested conversation's information. + * + * @param {DevRev.ConversationsGetQuery} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.ConversationsGetQuery, + requestOptions?: Conversations.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the requested conversation's information. + * + * @param {DevRev.ConversationsGetRequest} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.ConversationsGetRequest, + requestOptions?: Conversations.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ConversationsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the available conversations. + * + * @param {DevRev.ConversationsListQuery} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.list({ + * tagsV2Id: "TAG-12345" + * }) + */ + public async list( + request: DevRev.ConversationsListQuery = {}, + requestOptions?: Conversations.RequestOptions + ): Promise { + const { + appliesToParts, + cursor, + group, + isCreatorVerified, + isSpam, + limit, + members, + mode, + ownedBy, + revOrg, + slaSummaryStage, + sourceChannels, + stageName, + tags, + tagsV2Id, + tagsV2Value, + } = request; + const _queryParams: Record = {}; + if (appliesToParts != null) { + if (Array.isArray(appliesToParts)) { + _queryParams["applies_to_parts"] = appliesToParts.map((item) => item); + } else { + _queryParams["applies_to_parts"] = appliesToParts; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (group != null) { + if (Array.isArray(group)) { + _queryParams["group"] = group.map((item) => item); + } else { + _queryParams["group"] = group; + } + } + + if (isCreatorVerified != null) { + _queryParams["is_creator_verified"] = isCreatorVerified.toString(); + } + + if (isSpam != null) { + _queryParams["is_spam"] = isSpam.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (members != null) { + if (Array.isArray(members)) { + _queryParams["members"] = members.map((item) => item); + } else { + _queryParams["members"] = members; + } + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (revOrg != null) { + if (Array.isArray(revOrg)) { + _queryParams["rev_org"] = revOrg.map((item) => item); + } else { + _queryParams["rev_org"] = revOrg; + } + } + + if (slaSummaryStage != null) { + if (Array.isArray(slaSummaryStage)) { + _queryParams["sla_summary.stage"] = slaSummaryStage.map((item) => item); + } else { + _queryParams["sla_summary.stage"] = slaSummaryStage; + } + } + + if (sourceChannels != null) { + if (Array.isArray(sourceChannels)) { + _queryParams["source_channels"] = sourceChannels.map((item) => item); + } else { + _queryParams["source_channels"] = sourceChannels; + } + } + + if (stageName != null) { + if (Array.isArray(stageName)) { + _queryParams["stage.name"] = stageName.map((item) => item); + } else { + _queryParams["stage.name"] = stageName; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + if (tagsV2Id != null) { + _queryParams["tags_v2.id"] = tagsV2Id; + } + + if (tagsV2Value != null) { + _queryParams["tags_v2.value"] = tagsV2Value; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the available conversations. + * + * @param {DevRev.ConversationsListRequest} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.listPost() + */ + public async listPost( + request: DevRev.ConversationsListRequest = {}, + requestOptions?: Conversations.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ConversationsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates the requested conversation. + * + * @param {DevRev.ConversationsUpdateRequest} request + * @param {Conversations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.conversations.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.ConversationsUpdateRequest, + requestOptions?: Conversations.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "conversations.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ConversationsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ConversationsUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/conversations/client/index.ts b/src/api/resources/conversations/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/conversations/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/conversations/client/requests/ConversationsCreateRequest.ts b/src/api/resources/conversations/client/requests/ConversationsCreateRequest.ts new file mode 100644 index 0000000..78978f1 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsCreateRequest.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * type: "support" + * } + */ +export interface ConversationsCreateRequest { + /** Description for the conversation. */ + description?: string; + /** The group that the conversation is associated with. */ + group?: string; + /** Whether the conversation is spam. */ + isSpam?: boolean; + /** The users in the conversation. */ + members?: string[]; + /** Initial messages on the conversation. */ + messages?: DevRev.ConversationsCreateRequestMessage[]; + metadata?: DevRev.ConversationsCreateRequestMetadata; + /** Whether the conversation is from a source channel. */ + sourceChannel?: string; + stage?: DevRev.StageInit; + /** Tags associated with the conversation. */ + tags?: DevRev.SetTagWithValue[]; + /** The title for the conversation. */ + title?: string; + /** + * The IDs of user sessions associated with the conversation. + * + */ + userSessions?: string[]; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsDeleteRequest.ts b/src/api/resources/conversations/client/requests/ConversationsDeleteRequest.ts new file mode 100644 index 0000000..ded3524 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface ConversationsDeleteRequest { + /** The ID of the conversation to delete. */ + id: string; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsExportQuery.ts b/src/api/resources/conversations/client/requests/ConversationsExportQuery.ts new file mode 100644 index 0000000..626dde1 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsExportQuery.ts @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * tagsV2Id: "TAG-12345" + * } + */ +export interface ConversationsExportQuery { + /** + * Filters for conversations belonging to any of the provided parts. + */ + appliesToParts?: string | string[]; + /** + * The number of conversation items to return. The default is '50', the + * maximum is '5000'. + */ + first?: number; + /** + * Filters for conversation that belong to the given groups. + */ + group?: string | string[]; + /** + * Filters for conversations that are created by verified users. + */ + isCreatorVerified?: boolean; + /** + * Filters for conversations that are spam. + */ + isSpam?: boolean; + /** + * Filters for conversations where these users are participants. + */ + members?: string | string[]; + /** + * Filters for conversations owned by any of these users. + */ + ownedBy?: string | string[]; + /** + * Filters for conversations that are associated with any of the + * provided Rev organizations. + */ + revOrg?: string | string[]; + /** + * Filters for records with any of the provided SLA stages. + */ + slaSummaryStage?: DevRev.SlaSummaryStage | DevRev.SlaSummaryStage[]; + /** + * Filters for conversations with any of the provided source channels. + */ + sourceChannels?: string | string[]; + /** + * Filters for records in the provided stage(s) by name. + */ + stageName?: string | string[]; + /** + * Filters for conversations with any of the provided tags. + */ + tags?: string | string[]; + /** + * The ID of the tag. + */ + tagsV2Id?: string; + /** + * The value for the object's association with the tag. If specified, + * the value must be one that's specified in the tag's allowed values. + */ + tagsV2Value?: string; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsExportRequest.ts b/src/api/resources/conversations/client/requests/ConversationsExportRequest.ts new file mode 100644 index 0000000..12de676 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsExportRequest.ts @@ -0,0 +1,62 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface ConversationsExportRequest { + /** + * Filters for conversations belonging to any of the provided parts. + * + */ + appliesToParts?: string[]; + /** + * The number of conversation items to return. The default is '50', + * the maximum is '5000'. + * + */ + first?: number; + /** + * Filters for conversation that belong to the given groups. + * + */ + group?: string[]; + /** + * Filters for conversations that are created by verified users. + * + */ + isCreatorVerified?: boolean; + /** Filters for conversations that are spam. */ + isSpam?: boolean; + /** + * Filters for conversations where these users are participants. + * + */ + members?: string[]; + /** Filters for conversations owned by any of these users. */ + ownedBy?: string[]; + /** + * Filters for conversations that are associated with any of the + * provided Rev organizations. + * + */ + revOrg?: string[]; + slaSummary?: DevRev.SlaSummaryFilter; + /** + * Filters for conversations with any of the provided source channels. + * + */ + sourceChannels?: string[]; + stage?: DevRev.StageFilter; + /** Filters for conversations with any of the provided tags. */ + tags?: string[]; + /** + * Filters for conversations with any of the provided tags with value. + * + */ + tagsV2?: DevRev.TagWithValueFilter[]; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsGetQuery.ts b/src/api/resources/conversations/client/requests/ConversationsGetQuery.ts new file mode 100644 index 0000000..718d992 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface ConversationsGetQuery { + /** + * The requested conversation's ID. + */ + id: string; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsGetRequest.ts b/src/api/resources/conversations/client/requests/ConversationsGetRequest.ts new file mode 100644 index 0000000..4275c69 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface ConversationsGetRequest { + /** The requested conversation's ID. */ + id: string; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsListQuery.ts b/src/api/resources/conversations/client/requests/ConversationsListQuery.ts new file mode 100644 index 0000000..02b1f26 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsListQuery.ts @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * tagsV2Id: "TAG-12345" + * } + */ +export interface ConversationsListQuery { + /** + * Filters for conversations belonging to any of the provided parts. + */ + appliesToParts?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters for conversation that belong to the given groups. + */ + group?: string | string[]; + /** + * Filters for conversations that are created by verified users. + */ + isCreatorVerified?: boolean; + /** + * Filters for conversations that are spam. + */ + isSpam?: boolean; + /** + * The maximum number of conversations to return. The default is '50'. + */ + limit?: number; + /** + * Filters for conversations where these users are participants. + */ + members?: string | string[]; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for conversations owned by any of these users. + */ + ownedBy?: string | string[]; + /** + * Filters for conversations that are associated with any of the + * provided Rev organizations. + */ + revOrg?: string | string[]; + /** + * Filters for records with any of the provided SLA stages. + */ + slaSummaryStage?: DevRev.SlaSummaryStage | DevRev.SlaSummaryStage[]; + /** + * Filters for conversations with any of the provided source channels. + */ + sourceChannels?: string | string[]; + /** + * Filters for records in the provided stage(s) by name. + */ + stageName?: string | string[]; + /** + * Filters for conversations with any of the provided tags. + */ + tags?: string | string[]; + /** + * The ID of the tag. + */ + tagsV2Id?: string; + /** + * The value for the object's association with the tag. If specified, + * the value must be one that's specified in the tag's allowed values. + */ + tagsV2Value?: string; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsListRequest.ts b/src/api/resources/conversations/client/requests/ConversationsListRequest.ts new file mode 100644 index 0000000..134d443 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsListRequest.ts @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface ConversationsListRequest { + /** + * Filters for conversations belonging to any of the provided parts. + * + */ + appliesToParts?: string[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * Filters for conversation that belong to the given groups. + * + */ + group?: string[]; + /** + * Filters for conversations that are created by verified users. + * + */ + isCreatorVerified?: boolean; + /** Filters for conversations that are spam. */ + isSpam?: boolean; + /** + * The maximum number of conversations to return. The default is '50'. + * + */ + limit?: number; + /** + * Filters for conversations where these users are participants. + * + */ + members?: string[]; + mode?: DevRev.ListMode; + /** Filters for conversations owned by any of these users. */ + ownedBy?: string[]; + /** + * Filters for conversations that are associated with any of the + * provided Rev organizations. + * + */ + revOrg?: string[]; + slaSummary?: DevRev.SlaSummaryFilter; + /** + * Filters for conversations with any of the provided source channels. + * + */ + sourceChannels?: string[]; + stage?: DevRev.StageFilter; + /** Filters for conversations with any of the provided tags. */ + tags?: string[]; + /** + * Filters for conversations with any of the provided tags with value. + * + */ + tagsV2?: DevRev.TagWithValueFilter[]; +} diff --git a/src/api/resources/conversations/client/requests/ConversationsUpdateRequest.ts b/src/api/resources/conversations/client/requests/ConversationsUpdateRequest.ts new file mode 100644 index 0000000..3c9d4a1 --- /dev/null +++ b/src/api/resources/conversations/client/requests/ConversationsUpdateRequest.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface ConversationsUpdateRequest { + appliesToParts?: DevRev.ConversationsUpdateRequestAppliesToParts; + /** The updated description for the conversation. */ + description?: string; + /** The group that the conversation is associated with. */ + group?: string; + /** The ID of the conversation to update. */ + id: string; + /** Whether the conversation is spam. */ + isSpam?: boolean; + metadata?: DevRev.ConversationsUpdateRequestMetadata; + stage?: DevRev.StageUpdate; + /** The updated status of the conversation. */ + status?: string; + tags?: DevRev.ConversationsUpdateRequestTags; + /** The updated title of the conversation. */ + title?: string; + userSessions?: DevRev.ConversationsUpdateRequestUserSessions; +} diff --git a/src/api/resources/conversations/client/requests/index.ts b/src/api/resources/conversations/client/requests/index.ts new file mode 100644 index 0000000..3116695 --- /dev/null +++ b/src/api/resources/conversations/client/requests/index.ts @@ -0,0 +1,9 @@ +export { type ConversationsCreateRequest } from "./ConversationsCreateRequest"; +export { type ConversationsDeleteRequest } from "./ConversationsDeleteRequest"; +export { type ConversationsExportQuery } from "./ConversationsExportQuery"; +export { type ConversationsExportRequest } from "./ConversationsExportRequest"; +export { type ConversationsGetQuery } from "./ConversationsGetQuery"; +export { type ConversationsGetRequest } from "./ConversationsGetRequest"; +export { type ConversationsListQuery } from "./ConversationsListQuery"; +export { type ConversationsListRequest } from "./ConversationsListRequest"; +export { type ConversationsUpdateRequest } from "./ConversationsUpdateRequest"; diff --git a/src/api/resources/conversations/index.ts b/src/api/resources/conversations/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/conversations/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/customization/client/Client.ts b/src/api/resources/customization/client/Client.ts new file mode 100644 index 0000000..5ac17a1 --- /dev/null +++ b/src/api/resources/customization/client/Client.ts @@ -0,0 +1,3858 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace Customization { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev customization. + */ +export class Customization { + constructor(protected readonly _options: Customization.Options = {}) {} + + /** + * Gets the aggregated schema. + * + * @param {DevRev.AggregatedSchemaGetQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.aggregatedSchemaGet({ + * customSchemaFragmentIds: "string", + * leafType: "string", + * stockSchemaFragmentId: "string" + * }) + */ + public async aggregatedSchemaGet( + request: DevRev.AggregatedSchemaGetQuery = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const { customSchemaFragmentIds, leafType, stockSchemaFragmentId } = request; + const _queryParams: Record = {}; + if (customSchemaFragmentIds != null) { + if (Array.isArray(customSchemaFragmentIds)) { + _queryParams["custom_schema_fragment_ids"] = customSchemaFragmentIds.map((item) => item); + } else { + _queryParams["custom_schema_fragment_ids"] = customSchemaFragmentIds; + } + } + + if (leafType != null) { + _queryParams["leaf_type"] = leafType; + } + + if (stockSchemaFragmentId != null) { + _queryParams["stock_schema_fragment_id"] = stockSchemaFragmentId; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.aggregated.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AggregatedSchemaGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the aggregated schema. + * + * @param {DevRev.AggregatedSchemaGetRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.aggregatedSchemaGetPost({ + * customSchemaFragmentIds: ["custom_schema_fragment_ids"] + * }) + */ + public async aggregatedSchemaGetPost( + request: DevRev.AggregatedSchemaGetRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.aggregated.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.AggregatedSchemaGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.AggregatedSchemaGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a custom schema fragment. + * + * @param {DevRev.CustomSchemaFragmentsGetQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customSchemaFragmentsGet({ + * id: "string" + * }) + */ + public async customSchemaFragmentsGet( + request: DevRev.CustomSchemaFragmentsGetQuery, + requestOptions?: Customization.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.custom.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomSchemaFragmentsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a custom schema fragment. + * + * @param {DevRev.CustomSchemaFragmentsGetRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customSchemaFragmentsGetPost({ + * id: "string" + * }) + */ + public async customSchemaFragmentsGetPost( + request: DevRev.CustomSchemaFragmentsGetRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.custom.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomSchemaFragmentsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomSchemaFragmentsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists custom schema fragments. + * + * @param {DevRev.CustomSchemaFragmentsListQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customSchemaFragmentsList() + */ + public async customSchemaFragmentsList( + request: DevRev.CustomSchemaFragmentsListQuery = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const { app, cursor, deprecated, leafType, limit, mode, prune, sortBy, subtype, types } = request; + const _queryParams: Record = {}; + if (app != null) { + if (Array.isArray(app)) { + _queryParams["app"] = app.map((item) => item); + } else { + _queryParams["app"] = app; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (deprecated != null) { + _queryParams["deprecated"] = deprecated.toString(); + } + + if (leafType != null) { + if (Array.isArray(leafType)) { + _queryParams["leaf_type"] = leafType.map((item) => item); + } else { + _queryParams["leaf_type"] = leafType; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (prune != null) { + if (Array.isArray(prune)) { + _queryParams["prune"] = prune.map((item) => item); + } else { + _queryParams["prune"] = prune; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (subtype != null) { + if (Array.isArray(subtype)) { + _queryParams["subtype"] = subtype.map((item) => item); + } else { + _queryParams["subtype"] = subtype; + } + } + + if (types != null) { + if (Array.isArray(types)) { + _queryParams["types"] = types.map((item) => item); + } else { + _queryParams["types"] = types; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.custom.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomSchemaFragmentsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists custom schema fragments. + * + * @param {DevRev.CustomSchemaFragmentsListRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customSchemaFragmentsListPost() + */ + public async customSchemaFragmentsListPost( + request: DevRev.CustomSchemaFragmentsListRequest = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.custom.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomSchemaFragmentsListRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomSchemaFragmentsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Creates or updates a custom schema fragment. + * + * @param {DevRev.CustomSchemaFragmentsSetRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customSchemaFragmentsSet({ + * type: "app_fragment", + * conditions: [{ + * "string": { + * "key": "value" + * } + * }], + * deletedFields: ["string"], + * deprecated: true, + * description: "string", + * fields: [{ + * fieldType: "array", + * value: { + * "key": "value" + * } + * }], + * isCustomLeafType: true, + * leafType: "string", + * app: "string" + * }) + */ + public async customSchemaFragmentsSet( + request: DevRev.CustomSchemaFragmentsSetRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.custom.set" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomSchemaFragmentsSetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomSchemaFragmentsSetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a stock schema fragment. + * + * @param {DevRev.StockSchemaFragmentsGetQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.stockSchemaFragmentsGet() + */ + public async stockSchemaFragmentsGet( + request: DevRev.StockSchemaFragmentsGetQuery = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const { id, leafType } = request; + const _queryParams: Record = {}; + if (id != null) { + _queryParams["id"] = id; + } + + if (leafType != null) { + _queryParams["leaf_type"] = leafType; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.stock.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.StockSchemaFragmentsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a stock schema fragment. + * + * @param {DevRev.StockSchemaFragmentsGetRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.stockSchemaFragmentsGetPost() + */ + public async stockSchemaFragmentsGetPost( + request: DevRev.StockSchemaFragmentsGetRequest = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.stock.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.StockSchemaFragmentsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.StockSchemaFragmentsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists stock schema fragments. + * + * @param {DevRev.StockSchemaFragmentsListQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.stockSchemaFragmentsList() + */ + public async stockSchemaFragmentsList( + request: DevRev.StockSchemaFragmentsListQuery = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const { cursor, filterPreset, leafType, limit, mode, prune, sortBy } = request; + const _queryParams: Record = {}; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (filterPreset != null) { + _queryParams["filter_preset"] = filterPreset; + } + + if (leafType != null) { + if (Array.isArray(leafType)) { + _queryParams["leaf_type"] = leafType.map((item) => item); + } else { + _queryParams["leaf_type"] = leafType; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (prune != null) { + if (Array.isArray(prune)) { + _queryParams["prune"] = prune.map((item) => item); + } else { + _queryParams["prune"] = prune; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.stock.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.StockSchemaFragmentsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists stock schema fragments. + * + * @param {DevRev.StockSchemaFragmentsListRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.stockSchemaFragmentsListPost() + */ + public async stockSchemaFragmentsListPost( + request: DevRev.StockSchemaFragmentsListRequest = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.stock.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.StockSchemaFragmentsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.StockSchemaFragmentsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists subtypes. + * + * @param {DevRev.SubtypesListQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.subtypesList() + */ + public async subtypesList( + request: DevRev.SubtypesListQuery = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const { leafType, leafTypes } = request; + const _queryParams: Record = {}; + if (leafType != null) { + _queryParams["leaf_type"] = leafType; + } + + if (leafTypes != null) { + if (Array.isArray(leafTypes)) { + _queryParams["leaf_types"] = leafTypes.map((item) => item); + } else { + _queryParams["leaf_types"] = leafTypes; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.subtypes.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SubtypesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists subtypes. + * + * @param {DevRev.SubtypesListRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.subtypesListPost() + */ + public async subtypesListPost( + request: DevRev.SubtypesListRequest = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "schemas.subtypes.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SubtypesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SubtypesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Creates a custom stage. + * + * @param {DevRev.CustomStagesCreateRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStagesCreate({ + * name: "name", + * ordinal: 1, + * state: "state" + * }) + */ + public async customStagesCreate( + request: DevRev.CustomStagesCreateRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "stages.custom.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStagesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStagesCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a custom stage. + * + * @param {DevRev.CustomStagesGetQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStagesGet({ + * id: "id" + * }) + */ + public async customStagesGet( + request: DevRev.CustomStagesGetQuery, + requestOptions?: Customization.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "stages.custom.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStagesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a custom stage. + * + * @param {DevRev.CustomStagesGetRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStagesGetPost({ + * id: "id" + * }) + */ + public async customStagesGetPost( + request: DevRev.CustomStagesGetRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "stages.custom.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStagesGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStagesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists custom stages. + * + * @param {DevRev.CustomStagesListQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStagesList() + */ + public async customStagesList( + request: DevRev.CustomStagesListQuery = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const { cursor, limit, name, ordinal, sortBy } = request; + const _queryParams: Record = {}; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (name != null) { + if (Array.isArray(name)) { + _queryParams["name"] = name.map((item) => item); + } else { + _queryParams["name"] = name; + } + } + + if (ordinal != null) { + if (Array.isArray(ordinal)) { + _queryParams["ordinal"] = ordinal.map((item) => item.toString()); + } else { + _queryParams["ordinal"] = ordinal.toString(); + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "stages.custom.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStagesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists custom stages. + * + * @param {DevRev.CustomStagesListRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStagesListPost() + */ + public async customStagesListPost( + request: DevRev.CustomStagesListRequest = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "stages.custom.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStagesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStagesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a custom stage. + * + * @param {DevRev.CustomStagesUpdateRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStagesUpdate({ + * id: "id" + * }) + */ + public async customStagesUpdate( + request: DevRev.CustomStagesUpdateRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "stages.custom.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStagesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStagesUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Creates a custom state. + * + * @param {DevRev.CustomStatesCreateRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStatesCreate({ + * name: "name", + * ordinal: 1 + * }) + */ + public async customStatesCreate( + request: DevRev.CustomStatesCreateRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "states.custom.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStatesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStatesCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a custom state. + * + * @param {DevRev.CustomStatesGetQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStatesGet({ + * id: "id" + * }) + */ + public async customStatesGet( + request: DevRev.CustomStatesGetQuery, + requestOptions?: Customization.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "states.custom.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStatesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a custom state. + * + * @param {DevRev.CustomStatesGetRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStatesGetPost({ + * id: "id" + * }) + */ + public async customStatesGetPost( + request: DevRev.CustomStatesGetRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "states.custom.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStatesGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStatesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists custom states. + * + * @param {DevRev.CustomStatesListQuery} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStatesList() + */ + public async customStatesList( + request: DevRev.CustomStatesListQuery = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const { cursor, isFinal, limit, name, ordinal, sortBy } = request; + const _queryParams: Record = {}; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (isFinal != null) { + _queryParams["is_final"] = isFinal.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (name != null) { + if (Array.isArray(name)) { + _queryParams["name"] = name.map((item) => item); + } else { + _queryParams["name"] = name; + } + } + + if (ordinal != null) { + if (Array.isArray(ordinal)) { + _queryParams["ordinal"] = ordinal.map((item) => item.toString()); + } else { + _queryParams["ordinal"] = ordinal.toString(); + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "states.custom.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStatesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists custom states. + * + * @param {DevRev.CustomStatesListRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStatesListPost() + */ + public async customStatesListPost( + request: DevRev.CustomStatesListRequest = {}, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "states.custom.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStatesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStatesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a custom state. + * + * @param {DevRev.CustomStatesUpdateRequest} request + * @param {Customization.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.customization.customStatesUpdate({ + * id: "id" + * }) + */ + public async customStatesUpdate( + request: DevRev.CustomStatesUpdateRequest, + requestOptions?: Customization.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "states.custom.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.CustomStatesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.CustomStatesUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/customization/client/index.ts b/src/api/resources/customization/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/customization/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/customization/client/requests/AggregatedSchemaGetQuery.ts b/src/api/resources/customization/client/requests/AggregatedSchemaGetQuery.ts new file mode 100644 index 0000000..0b59102 --- /dev/null +++ b/src/api/resources/customization/client/requests/AggregatedSchemaGetQuery.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * customSchemaFragmentIds: "string", + * leafType: "string", + * stockSchemaFragmentId: "string" + * } + */ +export interface AggregatedSchemaGetQuery { + /** + * The list of custom schema fragment DONs which are to be aggregated. + */ + customSchemaFragmentIds?: string | string[]; + /** + * The leaf type. Used for inferring the default stage diagram and + * tenant fragment ID. + */ + leafType?: string; + /** + * The stock schema fragment which is to be aggregated. + */ + stockSchemaFragmentId?: string; +} diff --git a/src/api/resources/customization/client/requests/AggregatedSchemaGetRequest.ts b/src/api/resources/customization/client/requests/AggregatedSchemaGetRequest.ts new file mode 100644 index 0000000..7cbef56 --- /dev/null +++ b/src/api/resources/customization/client/requests/AggregatedSchemaGetRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * customSchemaFragmentIds: ["custom_schema_fragment_ids"] + * } + */ +export interface AggregatedSchemaGetRequest { + /** + * The list of custom schema fragment DONs which are to be aggregated. + * + */ + customSchemaFragmentIds: string[]; + /** + * The leaf type. Used for inferring the default stage diagram and + * tenant fragment ID. + * + */ + leafType?: string; + /** Per object schema, if associated with the leaf type. */ + perObjectSchema?: DevRev.FieldDescriptor[]; + /** The stock schema fragment which is to be aggregated. */ + stockSchemaFragmentId?: string; +} diff --git a/src/api/resources/customization/client/requests/CustomSchemaFragmentsGetQuery.ts b/src/api/resources/customization/client/requests/CustomSchemaFragmentsGetQuery.ts new file mode 100644 index 0000000..4eba27e --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomSchemaFragmentsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface CustomSchemaFragmentsGetQuery { + /** + * The ID of the custom schema fragment. + */ + id: string; +} diff --git a/src/api/resources/customization/client/requests/CustomSchemaFragmentsGetRequest.ts b/src/api/resources/customization/client/requests/CustomSchemaFragmentsGetRequest.ts new file mode 100644 index 0000000..25b40eb --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomSchemaFragmentsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface CustomSchemaFragmentsGetRequest { + /** The ID of the custom schema fragment. */ + id: string; +} diff --git a/src/api/resources/customization/client/requests/CustomSchemaFragmentsListQuery.ts b/src/api/resources/customization/client/requests/CustomSchemaFragmentsListQuery.ts new file mode 100644 index 0000000..f025b8f --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomSchemaFragmentsListQuery.ts @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface CustomSchemaFragmentsListQuery { + /** + * The list of app names. + */ + app?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Whether only deprecated fragments should be filtered. + */ + deprecated?: boolean; + /** + * The list of leaf types. + */ + leafType?: string | string[]; + /** + * The maximum number of items. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * List of fields which are not required in the payload and can be + * pruned away. + */ + prune?: DevRev.CustomSchemaFragmentsListRequestPrune | DevRev.CustomSchemaFragmentsListRequestPrune[]; + /** + * The list of fields to sort the items by and how to sort them. + */ + sortBy?: string | string[]; + /** + * The list of subtypes. + */ + subtype?: string | string[]; + /** + * Filters for custom schema fragment of the provided types. + */ + types?: DevRev.CustomSchemaFragmentType | DevRev.CustomSchemaFragmentType[]; +} diff --git a/src/api/resources/customization/client/requests/CustomSchemaFragmentsListRequest.ts b/src/api/resources/customization/client/requests/CustomSchemaFragmentsListRequest.ts new file mode 100644 index 0000000..904c586 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomSchemaFragmentsListRequest.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface CustomSchemaFragmentsListRequest { + /** The list of app names. */ + app?: string[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** Whether only deprecated fragments should be filtered. */ + deprecated?: boolean; + /** The list of leaf types. */ + leafType?: string[]; + /** The maximum number of items. */ + limit?: number; + mode?: DevRev.ListMode; + /** + * List of fields which are not required in the payload and can be + * pruned away. + * + */ + prune?: DevRev.CustomSchemaFragmentsListRequestPrune[]; + /** + * The list of fields to sort the items by and how to sort them. + * + */ + sortBy?: string[]; + /** The list of subtypes. */ + subtype?: string[]; + /** + * Filters for custom schema fragment of the provided types. + * + */ + types?: DevRev.CustomSchemaFragmentType[]; +} diff --git a/src/api/resources/customization/client/requests/CustomStagesCreateRequest.ts b/src/api/resources/customization/client/requests/CustomStagesCreateRequest.ts new file mode 100644 index 0000000..70eefa6 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStagesCreateRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * name: "name", + * ordinal: 1, + * state: "state" + * } + */ +export interface CustomStagesCreateRequest { + /** + * A reference to the marketplace item from which this stage was + * imported. + * + */ + marketplaceRef?: string; + /** The name of the custom stage. */ + name: string; + /** The ordinal of the custom stage used for ordering. */ + ordinal: number; + /** The state ID. */ + state: string; +} diff --git a/src/api/resources/customization/client/requests/CustomStagesGetQuery.ts b/src/api/resources/customization/client/requests/CustomStagesGetQuery.ts new file mode 100644 index 0000000..c3a91ef --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStagesGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CustomStagesGetQuery { + /** + * The ID of the custom stage to get. + */ + id: string; +} diff --git a/src/api/resources/customization/client/requests/CustomStagesGetRequest.ts b/src/api/resources/customization/client/requests/CustomStagesGetRequest.ts new file mode 100644 index 0000000..0396900 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStagesGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CustomStagesGetRequest { + /** The ID of the custom stage to get. */ + id: string; +} diff --git a/src/api/resources/customization/client/requests/CustomStagesListQuery.ts b/src/api/resources/customization/client/requests/CustomStagesListQuery.ts new file mode 100644 index 0000000..4a54015 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStagesListQuery.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface CustomStagesListQuery { + /** + * The cursor to resume iteration from, otherwise if not provided, then + * iteration starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of items. + */ + limit?: number; + /** + * The list of stage names. + */ + name?: string | string[]; + /** + * The list of stage ordinals. + */ + ordinal?: number | number[]; + /** + * The list of fields to sort the items by and how to sort them. + */ + sortBy?: string | string[]; +} diff --git a/src/api/resources/customization/client/requests/CustomStagesListRequest.ts b/src/api/resources/customization/client/requests/CustomStagesListRequest.ts new file mode 100644 index 0000000..fb1f2e5 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStagesListRequest.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface CustomStagesListRequest { + /** + * The cursor to resume iteration from, otherwise if not provided, + * then iteration starts from the beginning. + * + */ + cursor?: string; + /** The maximum number of items. */ + limit?: number; + /** The list of stage names. */ + name?: string[]; + /** The list of stage ordinals. */ + ordinal?: number[]; + /** + * The list of fields to sort the items by and how to sort them. + * + */ + sortBy?: string[]; +} diff --git a/src/api/resources/customization/client/requests/CustomStagesUpdateRequest.ts b/src/api/resources/customization/client/requests/CustomStagesUpdateRequest.ts new file mode 100644 index 0000000..42ee31f --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStagesUpdateRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CustomStagesUpdateRequest { + /** The ID of the custom stage to update. */ + id: string; + /** The updated name of the custom stage. */ + name?: string; + /** The ordinal of the custom stage. */ + ordinal?: number; + /** The state ID. */ + stateId?: string; +} diff --git a/src/api/resources/customization/client/requests/CustomStatesCreateRequest.ts b/src/api/resources/customization/client/requests/CustomStatesCreateRequest.ts new file mode 100644 index 0000000..b2936a4 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStatesCreateRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * name: "name", + * ordinal: 1 + * } + */ +export interface CustomStatesCreateRequest { + /** Whether this is a final state. */ + isFinal?: boolean; + /** The name of the custom state. */ + name: string; + /** + * Ordinal of the custom state used to identify system states. + * + */ + ordinal: number; +} diff --git a/src/api/resources/customization/client/requests/CustomStatesGetQuery.ts b/src/api/resources/customization/client/requests/CustomStatesGetQuery.ts new file mode 100644 index 0000000..247f249 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStatesGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CustomStatesGetQuery { + /** + * The ID of the custom state to get. + */ + id: string; +} diff --git a/src/api/resources/customization/client/requests/CustomStatesGetRequest.ts b/src/api/resources/customization/client/requests/CustomStatesGetRequest.ts new file mode 100644 index 0000000..8ad737d --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStatesGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CustomStatesGetRequest { + /** The ID of the custom state to get. */ + id: string; +} diff --git a/src/api/resources/customization/client/requests/CustomStatesListQuery.ts b/src/api/resources/customization/client/requests/CustomStatesListQuery.ts new file mode 100644 index 0000000..2937472 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStatesListQuery.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface CustomStatesListQuery { + /** + * The cursor to resume iteration from, otherwise if not provided, then + * iteration starts from the beginning. + */ + cursor?: string; + /** + * Whether only final states should be filtered. + */ + isFinal?: boolean; + /** + * The maximum number of items. + */ + limit?: number; + /** + * The list of state names. + */ + name?: string | string[]; + /** + * The list of state ordinals. + */ + ordinal?: number | number[]; + /** + * The list of fields to sort the items by and how to sort them. + */ + sortBy?: string | string[]; +} diff --git a/src/api/resources/customization/client/requests/CustomStatesListRequest.ts b/src/api/resources/customization/client/requests/CustomStatesListRequest.ts new file mode 100644 index 0000000..46b8d8d --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStatesListRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface CustomStatesListRequest { + /** + * The cursor to resume iteration from, otherwise if not provided, + * then iteration starts from the beginning. + * + */ + cursor?: string; + /** Whether only final states should be filtered. */ + isFinal?: boolean; + /** The maximum number of items. */ + limit?: number; + /** The list of state names. */ + name?: string[]; + /** The list of state ordinals. */ + ordinal?: number[]; + /** + * The list of fields to sort the items by and how to sort them. + * + */ + sortBy?: string[]; +} diff --git a/src/api/resources/customization/client/requests/CustomStatesUpdateRequest.ts b/src/api/resources/customization/client/requests/CustomStatesUpdateRequest.ts new file mode 100644 index 0000000..6588792 --- /dev/null +++ b/src/api/resources/customization/client/requests/CustomStatesUpdateRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface CustomStatesUpdateRequest { + /** The ID of the custom state to update. */ + id: string; + /** Whether this is a final state. */ + isFinal?: boolean; + /** The name of the custom state. */ + name?: string; + /** + * Ordinal of the custom state used to identify system states. + * + */ + ordinal?: number; +} diff --git a/src/api/resources/customization/client/requests/StockSchemaFragmentsGetQuery.ts b/src/api/resources/customization/client/requests/StockSchemaFragmentsGetQuery.ts new file mode 100644 index 0000000..1191fde --- /dev/null +++ b/src/api/resources/customization/client/requests/StockSchemaFragmentsGetQuery.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface StockSchemaFragmentsGetQuery { + /** + * The ID of the stock schema fragment. + */ + id?: string; + /** + * The leaf type this fragment applies to. + */ + leafType?: string; +} diff --git a/src/api/resources/customization/client/requests/StockSchemaFragmentsGetRequest.ts b/src/api/resources/customization/client/requests/StockSchemaFragmentsGetRequest.ts new file mode 100644 index 0000000..f7cf733 --- /dev/null +++ b/src/api/resources/customization/client/requests/StockSchemaFragmentsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface StockSchemaFragmentsGetRequest { + /** The ID of the stock schema fragment. */ + id?: string; + /** The leaf type this fragment applies to. */ + leafType?: string; +} diff --git a/src/api/resources/customization/client/requests/StockSchemaFragmentsListQuery.ts b/src/api/resources/customization/client/requests/StockSchemaFragmentsListQuery.ts new file mode 100644 index 0000000..59b2706 --- /dev/null +++ b/src/api/resources/customization/client/requests/StockSchemaFragmentsListQuery.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface StockSchemaFragmentsListQuery { + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filter preset to specify whether to filter only customization enabled + * leaf types. + */ + filterPreset?: DevRev.StockSchemaFragmentsListRequestFilterPreset; + /** + * The list of leaf types. + */ + leafType?: string | string[]; + /** + * The maximum number of items. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * List of fields which are not required in the payload and can be + * pruned away. + */ + prune?: DevRev.StockSchemaFragmentsListRequestPrune | DevRev.StockSchemaFragmentsListRequestPrune[]; + /** + * The list of fields to sort the items by and how to sort them. + */ + sortBy?: string | string[]; +} diff --git a/src/api/resources/customization/client/requests/StockSchemaFragmentsListRequest.ts b/src/api/resources/customization/client/requests/StockSchemaFragmentsListRequest.ts new file mode 100644 index 0000000..d83c598 --- /dev/null +++ b/src/api/resources/customization/client/requests/StockSchemaFragmentsListRequest.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface StockSchemaFragmentsListRequest { + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + filterPreset?: DevRev.StockSchemaFragmentsListRequestFilterPreset; + /** The list of leaf types. */ + leafType?: string[]; + /** The maximum number of items. */ + limit?: number; + mode?: DevRev.ListMode; + /** + * List of fields which are not required in the payload and can be + * pruned away. + * + */ + prune?: DevRev.StockSchemaFragmentsListRequestPrune[]; + /** + * The list of fields to sort the items by and how to sort them. + * + */ + sortBy?: string[]; +} diff --git a/src/api/resources/customization/client/requests/SubtypesListQuery.ts b/src/api/resources/customization/client/requests/SubtypesListQuery.ts new file mode 100644 index 0000000..638f57a --- /dev/null +++ b/src/api/resources/customization/client/requests/SubtypesListQuery.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface SubtypesListQuery { + /** + * Leaf type for which subtypes are required. + */ + leafType?: string; + /** + * List of leaf types for which subtypes are required. + */ + leafTypes?: string | string[]; +} diff --git a/src/api/resources/customization/client/requests/SubtypesListRequest.ts b/src/api/resources/customization/client/requests/SubtypesListRequest.ts new file mode 100644 index 0000000..a7e95b6 --- /dev/null +++ b/src/api/resources/customization/client/requests/SubtypesListRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface SubtypesListRequest { + /** Leaf type for which subtypes are required. */ + leafType?: string; + /** List of leaf types for which subtypes are required. */ + leafTypes?: string[]; +} diff --git a/src/api/resources/customization/client/requests/index.ts b/src/api/resources/customization/client/requests/index.ts new file mode 100644 index 0000000..3c7df86 --- /dev/null +++ b/src/api/resources/customization/client/requests/index.ts @@ -0,0 +1,24 @@ +export { type AggregatedSchemaGetQuery } from "./AggregatedSchemaGetQuery"; +export { type AggregatedSchemaGetRequest } from "./AggregatedSchemaGetRequest"; +export { type CustomSchemaFragmentsGetQuery } from "./CustomSchemaFragmentsGetQuery"; +export { type CustomSchemaFragmentsGetRequest } from "./CustomSchemaFragmentsGetRequest"; +export { type CustomSchemaFragmentsListQuery } from "./CustomSchemaFragmentsListQuery"; +export { type CustomSchemaFragmentsListRequest } from "./CustomSchemaFragmentsListRequest"; +export { type StockSchemaFragmentsGetQuery } from "./StockSchemaFragmentsGetQuery"; +export { type StockSchemaFragmentsGetRequest } from "./StockSchemaFragmentsGetRequest"; +export { type StockSchemaFragmentsListQuery } from "./StockSchemaFragmentsListQuery"; +export { type StockSchemaFragmentsListRequest } from "./StockSchemaFragmentsListRequest"; +export { type SubtypesListQuery } from "./SubtypesListQuery"; +export { type SubtypesListRequest } from "./SubtypesListRequest"; +export { type CustomStagesCreateRequest } from "./CustomStagesCreateRequest"; +export { type CustomStagesGetQuery } from "./CustomStagesGetQuery"; +export { type CustomStagesGetRequest } from "./CustomStagesGetRequest"; +export { type CustomStagesListQuery } from "./CustomStagesListQuery"; +export { type CustomStagesListRequest } from "./CustomStagesListRequest"; +export { type CustomStagesUpdateRequest } from "./CustomStagesUpdateRequest"; +export { type CustomStatesCreateRequest } from "./CustomStatesCreateRequest"; +export { type CustomStatesGetQuery } from "./CustomStatesGetQuery"; +export { type CustomStatesGetRequest } from "./CustomStatesGetRequest"; +export { type CustomStatesListQuery } from "./CustomStatesListQuery"; +export { type CustomStatesListRequest } from "./CustomStatesListRequest"; +export { type CustomStatesUpdateRequest } from "./CustomStatesUpdateRequest"; diff --git a/src/api/resources/customization/index.ts b/src/api/resources/customization/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/customization/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/devUsers/client/Client.ts b/src/api/resources/devUsers/client/Client.ts new file mode 100644 index 0000000..b365a6b --- /dev/null +++ b/src/api/resources/devUsers/client/Client.ts @@ -0,0 +1,620 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace DevUsers { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Dev user interactions. + */ +export class DevUsers { + constructor(protected readonly _options: DevUsers.Options = {}) {} + + /** + * Links an external/secondary identity to the Dev user. + * + * @param {DevRev.DevUsersIdentitiesLinkRequest} request + * @param {DevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.devUsers.identitiesLink({ + * devUser: "dev_user", + * id: "id", + * issuer: "issuer" + * }) + */ + public async identitiesLink( + request: DevRev.DevUsersIdentitiesLinkRequest, + requestOptions?: DevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "dev-users.identities.link" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.DevUsersIdentitiesLinkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.DevUsersIdentitiesLinkResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Unlinks an external/secondary identity from the Dev user. + * + * @param {DevRev.DevUsersIdentitiesUnlinkRequest} request + * @param {DevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.devUsers.identitiesUnlink({ + * devUser: "dev_user", + * issuer: "issuer" + * }) + */ + public async identitiesUnlink( + request: DevRev.DevUsersIdentitiesUnlinkRequest, + requestOptions?: DevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "dev-users.identities.unlink" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.DevUsersIdentitiesUnlinkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.DevUsersIdentitiesUnlinkResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates the authenticated user. + * + * @param {DevRev.DevUsersSelfUpdateRequest} request + * @param {DevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.devUsers.selfUpdate() + */ + public async selfUpdate( + request: DevRev.DevUsersSelfUpdateRequest = {}, + requestOptions?: DevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "dev-users.self.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.DevUsersSelfUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.DevUsersUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates the user corresponding to the input Id. + * + * @param {DevRev.DevUsersUpdateRequest} request + * @param {DevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.devUsers.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.DevUsersUpdateRequest, + requestOptions?: DevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "dev-users.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.DevUsersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.DevUsersUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/devUsers/client/index.ts b/src/api/resources/devUsers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/devUsers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/devUsers/client/requests/DevUsersIdentitiesLinkRequest.ts b/src/api/resources/devUsers/client/requests/DevUsersIdentitiesLinkRequest.ts new file mode 100644 index 0000000..df4916d --- /dev/null +++ b/src/api/resources/devUsers/client/requests/DevUsersIdentitiesLinkRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * devUser: "dev_user", + * id: "id", + * issuer: "issuer" + * } + */ +export interface DevUsersIdentitiesLinkRequest { + /** The ID of the Dev user to link the external identity to. */ + devUser: string; + /** Display name of the Dev user in the external source. */ + displayName?: string; + /** Unique ID of the Dev user in the external source. */ + id: string; + /** Issuer of the external identity of the Dev user. */ + issuer: string; +} diff --git a/src/api/resources/devUsers/client/requests/DevUsersIdentitiesUnlinkRequest.ts b/src/api/resources/devUsers/client/requests/DevUsersIdentitiesUnlinkRequest.ts new file mode 100644 index 0000000..b4b532e --- /dev/null +++ b/src/api/resources/devUsers/client/requests/DevUsersIdentitiesUnlinkRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * devUser: "dev_user", + * issuer: "issuer" + * } + */ +export interface DevUsersIdentitiesUnlinkRequest { + /** + * The ID of the Dev user to unlink the external identity from. + * + */ + devUser: string; + /** Issuer that needs to be unlinked from a Dev user. */ + issuer: string; +} diff --git a/src/api/resources/devUsers/client/requests/DevUsersSelfUpdateRequest.ts b/src/api/resources/devUsers/client/requests/DevUsersSelfUpdateRequest.ts new file mode 100644 index 0000000..dee7544 --- /dev/null +++ b/src/api/resources/devUsers/client/requests/DevUsersSelfUpdateRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface DevUsersSelfUpdateRequest { + /** The updated display name of the Dev user. */ + displayName?: string; + /** The updated full name of the Dev user. */ + fullName?: string; + jobTitle?: DevRev.DevUserJobTitle; +} diff --git a/src/api/resources/devUsers/client/requests/DevUsersUpdateRequest.ts b/src/api/resources/devUsers/client/requests/DevUsersUpdateRequest.ts new file mode 100644 index 0000000..9e7d7fc --- /dev/null +++ b/src/api/resources/devUsers/client/requests/DevUsersUpdateRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface DevUsersUpdateRequest { + /** The updated display name of the Dev user. */ + displayName?: string; + /** The updated full name of the Dev user. */ + fullName?: string; + /** The ID for the Dev user to be updated. */ + id: string; + jobTitle?: DevRev.DevUserJobTitle; +} diff --git a/src/api/resources/devUsers/client/requests/index.ts b/src/api/resources/devUsers/client/requests/index.ts new file mode 100644 index 0000000..3443b35 --- /dev/null +++ b/src/api/resources/devUsers/client/requests/index.ts @@ -0,0 +1,4 @@ +export { type DevUsersIdentitiesLinkRequest } from "./DevUsersIdentitiesLinkRequest"; +export { type DevUsersIdentitiesUnlinkRequest } from "./DevUsersIdentitiesUnlinkRequest"; +export { type DevUsersSelfUpdateRequest } from "./DevUsersSelfUpdateRequest"; +export { type DevUsersUpdateRequest } from "./DevUsersUpdateRequest"; diff --git a/src/api/resources/devUsers/index.ts b/src/api/resources/devUsers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/devUsers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/engagements/client/Client.ts b/src/api/resources/engagements/client/Client.ts new file mode 100644 index 0000000..9ff0817 --- /dev/null +++ b/src/api/resources/engagements/client/Client.ts @@ -0,0 +1,1417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace Engagements { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev engagements. + */ +export class Engagements { + constructor(protected readonly _options: Engagements.Options = {}) {} + + /** + * Counts the engagement records. + * + * @param {DevRev.EngagementsCountQuery} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.count() + */ + public async count( + request: DevRev.EngagementsCountQuery = {}, + requestOptions?: Engagements.RequestOptions + ): Promise { + const { externalRef, members, parent, type: type_ } = request; + const _queryParams: Record = {}; + if (externalRef != null) { + if (Array.isArray(externalRef)) { + _queryParams["external_ref"] = externalRef.map((item) => item); + } else { + _queryParams["external_ref"] = externalRef; + } + } + + if (members != null) { + if (Array.isArray(members)) { + _queryParams["members"] = members.map((item) => item); + } else { + _queryParams["members"] = members; + } + } + + if (parent != null) { + if (Array.isArray(parent)) { + _queryParams["parent"] = parent.map((item) => item); + } else { + _queryParams["parent"] = parent; + } + } + + if (type_ != null) { + if (Array.isArray(type_)) { + _queryParams["type"] = type_.map((item) => item); + } else { + _queryParams["type"] = type_; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.count" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsCountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Counts the engagement records. + * + * @param {DevRev.EngagementsCountRequest} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.countPost() + */ + public async countPost( + request: DevRev.EngagementsCountRequest = {}, + requestOptions?: Engagements.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.count" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EngagementsCountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsCountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Creates a new engagement record. + * + * @param {DevRev.EngagementsCreateRequest} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.create({ + * members: ["DEVU-12345"], + * parent: "ACC-12345", + * scheduledDate: new Date("2023-01-01T12:00:00.000Z"), + * title: "title" + * }) + */ + public async create( + request: DevRev.EngagementsCreateRequest, + requestOptions?: Engagements.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EngagementsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes the engagement record. + * + * @param {DevRev.EngagementsDeleteRequest} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.delete({ + * id: "id" + * }) + */ + public async delete( + request: DevRev.EngagementsDeleteRequest, + requestOptions?: Engagements.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EngagementsDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the engagement record. + * + * @param {DevRev.EngagementsGetQuery} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.EngagementsGetQuery, + requestOptions?: Engagements.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the engagement record. + * + * @param {DevRev.EngagementsGetRequest} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.EngagementsGetRequest, + requestOptions?: Engagements.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EngagementsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the engagement records. + * + * @param {DevRev.EngagementsListQuery} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.list() + */ + public async list( + request: DevRev.EngagementsListQuery = {}, + requestOptions?: Engagements.RequestOptions + ): Promise { + const { cursor, externalRef, limit, members, mode, parent, sortBy, type: type_ } = request; + const _queryParams: Record = {}; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (externalRef != null) { + if (Array.isArray(externalRef)) { + _queryParams["external_ref"] = externalRef.map((item) => item); + } else { + _queryParams["external_ref"] = externalRef; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (members != null) { + if (Array.isArray(members)) { + _queryParams["members"] = members.map((item) => item); + } else { + _queryParams["members"] = members; + } + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (parent != null) { + if (Array.isArray(parent)) { + _queryParams["parent"] = parent.map((item) => item); + } else { + _queryParams["parent"] = parent; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (type_ != null) { + if (Array.isArray(type_)) { + _queryParams["type"] = type_.map((item) => item); + } else { + _queryParams["type"] = type_; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the engagement records. + * + * @param {DevRev.EngagementsListRequest} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.listPost() + */ + public async listPost( + request: DevRev.EngagementsListRequest = {}, + requestOptions?: Engagements.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EngagementsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates the engagement record. + * + * @param {DevRev.EngagementsUpdateRequest} request + * @param {Engagements.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.engagements.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.EngagementsUpdateRequest, + requestOptions?: Engagements.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "engagements.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EngagementsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EngagementsUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/engagements/client/index.ts b/src/api/resources/engagements/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/engagements/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/engagements/client/requests/EngagementsCountQuery.ts b/src/api/resources/engagements/client/requests/EngagementsCountQuery.ts new file mode 100644 index 0000000..7e54bf1 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsCountQuery.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface EngagementsCountQuery { + /** + * Filters for meetings with the provided external_refs. + */ + externalRef?: string | string[]; + /** + * Filters for engagement of the provided members. + */ + members?: string | string[]; + /** + * Filters for engagements with the provided parent. + */ + parent?: string | string[]; + /** + * Filters for engagement of the provided types. + */ + type?: DevRev.EngagementType | DevRev.EngagementType[]; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsCountRequest.ts b/src/api/resources/engagements/client/requests/EngagementsCountRequest.ts new file mode 100644 index 0000000..b31adc4 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsCountRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface EngagementsCountRequest { + /** Filters for engagement of the provided types. */ + type?: DevRev.EngagementType[]; + /** Filters for meetings with the provided external_refs. */ + externalRef?: string[]; + /** Filters for engagement of the provided members. */ + members?: string[]; + /** Filters for engagements with the provided parent. */ + parent?: string[]; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsCreateRequest.ts b/src/api/resources/engagements/client/requests/EngagementsCreateRequest.ts new file mode 100644 index 0000000..ff8d60f --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsCreateRequest.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * members: ["DEVU-12345"], + * parent: "ACC-12345", + * scheduledDate: new Date("2023-01-01T12:00:00.000Z"), + * title: "title" + * } + */ +export interface EngagementsCreateRequest { + /** + * The IDs of the artifacts to associate with the engagement. + * + */ + artifacts?: string[]; + /** The description of the engagement. */ + description?: string; + engagementType?: DevRev.EngagementsCreateRequestEngagementType; + /** External Reference for the engagement. */ + externalRef?: string; + /** External URL for the engagement. */ + externalUrl?: string; + /** IDs of the users that were part of the engagement. */ + members: string[]; + /** + * The parent object ID in which the engagement was created. + * Currently, only accounts and opportunities are supported. + * + */ + parent: string; + /** The date and time when the engagement was scheduled. */ + scheduledDate: Date; + /** Tags associated with the engagement. */ + tags?: DevRev.SetTagWithValue[]; + /** The title of the engagement. */ + title: string; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsDeleteRequest.ts b/src/api/resources/engagements/client/requests/EngagementsDeleteRequest.ts new file mode 100644 index 0000000..f631cc8 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface EngagementsDeleteRequest { + /** The engagement ID. */ + id: string; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsGetQuery.ts b/src/api/resources/engagements/client/requests/EngagementsGetQuery.ts new file mode 100644 index 0000000..f8ad771 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface EngagementsGetQuery { + /** + * The engagement ID. + */ + id: string; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsGetRequest.ts b/src/api/resources/engagements/client/requests/EngagementsGetRequest.ts new file mode 100644 index 0000000..44f0360 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface EngagementsGetRequest { + /** The engagement ID. */ + id: string; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsListQuery.ts b/src/api/resources/engagements/client/requests/EngagementsListQuery.ts new file mode 100644 index 0000000..a7acf49 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsListQuery.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface EngagementsListQuery { + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters for meetings with the provided external_refs. + */ + externalRef?: string | string[]; + /** + * The maximum number of engagements to return. + */ + limit?: number; + /** + * Filters for engagement of the provided members. + */ + members?: string | string[]; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for engagements with the provided parent. + */ + parent?: string | string[]; + /** + * Fields to sort the engagements by and the direction to sort them. + */ + sortBy?: string | string[]; + /** + * Filters for engagement of the provided types. + */ + type?: DevRev.EngagementType | DevRev.EngagementType[]; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsListRequest.ts b/src/api/resources/engagements/client/requests/EngagementsListRequest.ts new file mode 100644 index 0000000..c7db7b4 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsListRequest.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface EngagementsListRequest { + /** Filters for engagement of the provided types. */ + type?: DevRev.EngagementType[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** Filters for meetings with the provided external_refs. */ + externalRef?: string[]; + /** The maximum number of engagements to return. */ + limit?: number; + /** Filters for engagement of the provided members. */ + members?: string[]; + mode?: DevRev.ListMode; + /** Filters for engagements with the provided parent. */ + parent?: string[]; + /** + * Fields to sort the engagements by and the direction to sort them. + * + */ + sortBy?: string[]; +} diff --git a/src/api/resources/engagements/client/requests/EngagementsUpdateRequest.ts b/src/api/resources/engagements/client/requests/EngagementsUpdateRequest.ts new file mode 100644 index 0000000..d96f521 --- /dev/null +++ b/src/api/resources/engagements/client/requests/EngagementsUpdateRequest.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface EngagementsUpdateRequest { + artifacts?: DevRev.EngagementsUpdateRequestArtifactIds; + /** Updates the description of the engagement. */ + description?: string; + /** External Reference for the engagement. */ + externalRef?: string; + /** Updates the external URL for the engagement. */ + externalUrl?: string; + /** The engagement ID. */ + id: string; + members?: DevRev.EngagementsUpdateRequestMembers; + /** + * Updates the date and time when the engagement was scheduled. + * + */ + scheduledDate?: Date; + tags?: DevRev.EngagementsUpdateRequestTags; + /** Updates the title of the engagement. */ + title?: string; +} diff --git a/src/api/resources/engagements/client/requests/index.ts b/src/api/resources/engagements/client/requests/index.ts new file mode 100644 index 0000000..5c99fd2 --- /dev/null +++ b/src/api/resources/engagements/client/requests/index.ts @@ -0,0 +1,9 @@ +export { type EngagementsCountQuery } from "./EngagementsCountQuery"; +export { type EngagementsCountRequest } from "./EngagementsCountRequest"; +export { type EngagementsCreateRequest } from "./EngagementsCreateRequest"; +export { type EngagementsDeleteRequest } from "./EngagementsDeleteRequest"; +export { type EngagementsGetQuery } from "./EngagementsGetQuery"; +export { type EngagementsGetRequest } from "./EngagementsGetRequest"; +export { type EngagementsListQuery } from "./EngagementsListQuery"; +export { type EngagementsListRequest } from "./EngagementsListRequest"; +export { type EngagementsUpdateRequest } from "./EngagementsUpdateRequest"; diff --git a/src/api/resources/engagements/index.ts b/src/api/resources/engagements/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/engagements/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/eventSource/client/Client.ts b/src/api/resources/eventSource/client/Client.ts new file mode 100644 index 0000000..f957eaa --- /dev/null +++ b/src/api/resources/eventSource/client/Client.ts @@ -0,0 +1,788 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace EventSource { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Event source interactions. + */ +export class EventSource { + constructor(protected readonly _options: EventSource.Options = {}) {} + + /** + * Gets an event source. + * + * @param {DevRev.EventSourcesGetQuery} request + * @param {EventSource.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.eventSource.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.EventSourcesGetQuery, + requestOptions?: EventSource.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "event-sources.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EventSourceGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an event source. + * + * @param {DevRev.EventSourceGetRequest} request + * @param {EventSource.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.eventSource.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.EventSourceGetRequest, + requestOptions?: EventSource.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "event-sources.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EventSourceGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EventSourceGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Schedules an event to be published to the specified event source. + * + * @param {DevRev.EventSourcesScheduleEventRequest} request + * @param {EventSource.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.eventSource.scheduleEvent({ + * eventType: "event_type", + * id: "id", + * payload: "payload" + * }) + */ + public async scheduleEvent( + request: DevRev.EventSourcesScheduleEventRequest, + requestOptions?: EventSource.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "event-sources.schedule" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EventSourcesScheduleEventRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.EventSourcesScheduleEventResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes an event scheduled for the specified event source. + * + * @param {DevRev.EventSourcesDeleteScheduledEventRequest} request + * @param {EventSource.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.eventSource.deleteScheduledEvent({ + * eventKey: "event_key", + * id: "id" + * }) + */ + public async deleteScheduledEvent( + request: DevRev.EventSourcesDeleteScheduledEventRequest, + requestOptions?: EventSource.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "event-sources.unschedule" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.EventSourcesDeleteScheduledEventRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Allows publishing of events (example from plug widget). + * + * @param {DevRev.TrackEventsPublishRequest} request + * @param {EventSource.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.eventSource.trackEventsPublish({ + * eventsList: [{ + * name: "name", + * payload: { + * "key": "value" + * } + * }] + * }) + */ + public async trackEventsPublish( + request: DevRev.TrackEventsPublishRequest, + requestOptions?: EventSource.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "track-events.publish" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.TrackEventsPublishRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.TrackEventsPublishResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/eventSource/client/index.ts b/src/api/resources/eventSource/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/eventSource/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/eventSource/client/requests/EventSourceGetRequest.ts b/src/api/resources/eventSource/client/requests/EventSourceGetRequest.ts new file mode 100644 index 0000000..3fc7e2d --- /dev/null +++ b/src/api/resources/eventSource/client/requests/EventSourceGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface EventSourceGetRequest { + /** The event source's ID. */ + id: string; +} diff --git a/src/api/resources/eventSource/client/requests/EventSourcesDeleteScheduledEventRequest.ts b/src/api/resources/eventSource/client/requests/EventSourcesDeleteScheduledEventRequest.ts new file mode 100644 index 0000000..1cbcb0b --- /dev/null +++ b/src/api/resources/eventSource/client/requests/EventSourcesDeleteScheduledEventRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * eventKey: "event_key", + * id: "id" + * } + */ +export interface EventSourcesDeleteScheduledEventRequest { + /** The event key for the event which we want to delete. */ + eventKey: string; + /** The event source's ID. */ + id: string; +} diff --git a/src/api/resources/eventSource/client/requests/EventSourcesGetQuery.ts b/src/api/resources/eventSource/client/requests/EventSourcesGetQuery.ts new file mode 100644 index 0000000..5d3c3a1 --- /dev/null +++ b/src/api/resources/eventSource/client/requests/EventSourcesGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface EventSourcesGetQuery { + /** + * The event source's ID. + */ + id: string; +} diff --git a/src/api/resources/eventSource/client/requests/EventSourcesScheduleEventRequest.ts b/src/api/resources/eventSource/client/requests/EventSourcesScheduleEventRequest.ts new file mode 100644 index 0000000..e40454b --- /dev/null +++ b/src/api/resources/eventSource/client/requests/EventSourcesScheduleEventRequest.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * eventType: "event_type", + * id: "id", + * payload: "payload" + * } + */ +export interface EventSourcesScheduleEventRequest { + /** + * A unique key for this event (scoped to an event source) used for + * updating/getting/deleting scheduled events. + * + */ + eventKey?: string; + /** The type of the event. */ + eventType: string; + /** The event source's ID. */ + id: string; + /** The raw payload of the event. */ + payload: string; + /** + * The timestamp at which the event should be published. The event is + * guaranteed to be published after this. If omitted, the event is + * published immediately. + * + */ + publishAt?: Date; + /** + * Whether or not to update an existing scheduled event with the same + * event key. If this is false, and an event is already scheduled with + * the same event key, then HTTP 409 Conflict is returned. + * + */ + updateIfExists?: boolean; +} diff --git a/src/api/resources/eventSource/client/requests/TrackEventsPublishRequest.ts b/src/api/resources/eventSource/client/requests/TrackEventsPublishRequest.ts new file mode 100644 index 0000000..8d34a58 --- /dev/null +++ b/src/api/resources/eventSource/client/requests/TrackEventsPublishRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * eventsList: [{ + * name: "name", + * payload: { + * "key": "value" + * } + * }] + * } + */ +export interface TrackEventsPublishRequest { + eventsList: DevRev.TrackEvent[]; +} diff --git a/src/api/resources/eventSource/client/requests/index.ts b/src/api/resources/eventSource/client/requests/index.ts new file mode 100644 index 0000000..c1ed9d7 --- /dev/null +++ b/src/api/resources/eventSource/client/requests/index.ts @@ -0,0 +1,5 @@ +export { type EventSourcesGetQuery } from "./EventSourcesGetQuery"; +export { type EventSourceGetRequest } from "./EventSourceGetRequest"; +export { type EventSourcesScheduleEventRequest } from "./EventSourcesScheduleEventRequest"; +export { type EventSourcesDeleteScheduledEventRequest } from "./EventSourcesDeleteScheduledEventRequest"; +export { type TrackEventsPublishRequest } from "./TrackEventsPublishRequest"; diff --git a/src/api/resources/eventSource/index.ts b/src/api/resources/eventSource/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/eventSource/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/groups/client/Client.ts b/src/api/resources/groups/client/Client.ts new file mode 100644 index 0000000..6fefbff --- /dev/null +++ b/src/api/resources/groups/client/Client.ts @@ -0,0 +1,1539 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Groups { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Manages groups in a Dev organization. + */ +export class Groups { + constructor(protected readonly _options: Groups.Options = {}) {} + + /** + * Creates a new group. A group is a collection of users. + * + * @param {DevRev.GroupsCreateRequest} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.create({ + * description: "description", + * name: "name" + * }) + */ + public async create( + request: DevRev.GroupsCreateRequest, + requestOptions?: Groups.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.GroupsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the requested group. + * + * @param {DevRev.GroupsGetQuery} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.GroupsGetQuery, + requestOptions?: Groups.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the requested group. + * + * @param {DevRev.GroupsGetRequest} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.GroupsGetRequest, + requestOptions?: Groups.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.GroupsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the available groups. + * + * @param {DevRev.GroupsListQuery} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.list() + */ + public async list( + request: DevRev.GroupsListQuery = {}, + requestOptions?: Groups.RequestOptions + ): Promise { + const { cursor, groupType, isDefault, limit, memberType, mode, sortBy } = request; + const _queryParams: Record = {}; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (groupType != null) { + if (Array.isArray(groupType)) { + _queryParams["group_type"] = groupType.map((item) => item); + } else { + _queryParams["group_type"] = groupType; + } + } + + if (isDefault != null) { + _queryParams["is_default"] = isDefault.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (memberType != null) { + if (Array.isArray(memberType)) { + _queryParams["member_type"] = memberType.map((item) => item); + } else { + _queryParams["member_type"] = memberType; + } + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the available groups. + * + * @param {DevRev.GroupsListRequest} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.listPost() + */ + public async listPost( + request: DevRev.GroupsListRequest = {}, + requestOptions?: Groups.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.GroupsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Adds a member to a group. + * + * @param {DevRev.GroupMembersAddRequest} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.groupMembersAdd({ + * group: "group", + * member: "DEVU-12345" + * }) + */ + public async groupMembersAdd( + request: DevRev.GroupMembersAddRequest, + requestOptions?: Groups.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.members.add" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.GroupMembersAddRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupMembersAddResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the members in a group. + * + * @param {DevRev.GroupMembersListQuery} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.groupMembersList({ + * group: "group" + * }) + */ + public async groupMembersList( + request: DevRev.GroupMembersListQuery, + requestOptions?: Groups.RequestOptions + ): Promise { + const { group, cursor, limit, mode } = request; + const _queryParams: Record = {}; + _queryParams["group"] = group; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.members.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupMembersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the members in a group. + * + * @param {DevRev.GroupMembersListRequest} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.groupMembersListPost({ + * group: "group" + * }) + */ + public async groupMembersListPost( + request: DevRev.GroupMembersListRequest, + requestOptions?: Groups.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.members.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.GroupMembersListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupMembersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Removes a member from a group. + * + * @param {DevRev.GroupMembersRemoveRequest} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.groupMembersRemove({ + * group: "group", + * member: "DEVU-12345" + * }) + */ + public async groupMembersRemove( + request: DevRev.GroupMembersRemoveRequest, + requestOptions?: Groups.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.members.remove" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.GroupMembersRemoveRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupMembersRemoveResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates the requested group. + * + * @param {DevRev.GroupsUpdateRequest} request + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.groups.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.GroupsUpdateRequest, + requestOptions?: Groups.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "groups.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.GroupsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.GroupsUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/groups/client/index.ts b/src/api/resources/groups/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/groups/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/groups/client/requests/GroupMembersAddRequest.ts b/src/api/resources/groups/client/requests/GroupMembersAddRequest.ts new file mode 100644 index 0000000..2420b82 --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupMembersAddRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * group: "group", + * member: "DEVU-12345" + * } + */ +export interface GroupMembersAddRequest { + /** ID of the group where the member is being added. */ + group: string; + /** ID of the member to be added. */ + member: string; +} diff --git a/src/api/resources/groups/client/requests/GroupMembersListQuery.ts b/src/api/resources/groups/client/requests/GroupMembersListQuery.ts new file mode 100644 index 0000000..9792bc3 --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupMembersListQuery.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * group: "group" + * } + */ +export interface GroupMembersListQuery { + /** + * ID of the group for which to list members. + */ + group: string; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of members to return. If not set, then the default + * is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; +} diff --git a/src/api/resources/groups/client/requests/GroupMembersListRequest.ts b/src/api/resources/groups/client/requests/GroupMembersListRequest.ts new file mode 100644 index 0000000..ce0fd68 --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupMembersListRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * group: "group" + * } + */ +export interface GroupMembersListRequest { + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** ID of the group for which to list members. */ + group: string; + /** + * The maximum number of members to return. If not set, then the + * default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; +} diff --git a/src/api/resources/groups/client/requests/GroupMembersRemoveRequest.ts b/src/api/resources/groups/client/requests/GroupMembersRemoveRequest.ts new file mode 100644 index 0000000..7f691a3 --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupMembersRemoveRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * group: "group", + * member: "DEVU-12345" + * } + */ +export interface GroupMembersRemoveRequest { + /** ID of the group where the member is being removed. */ + group: string; + /** ID of the member to be removed. */ + member: string; +} diff --git a/src/api/resources/groups/client/requests/GroupsCreateRequest.ts b/src/api/resources/groups/client/requests/GroupsCreateRequest.ts new file mode 100644 index 0000000..d53a8cc --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupsCreateRequest.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * description: "description", + * name: "name" + * } + */ +export interface GroupsCreateRequest { + type?: DevRev.GroupType; + /** Description of the group. */ + description: string; + dynamicGroupInfo?: DevRev.DynamicGroupInfo; + memberType?: DevRev.GroupMemberType; + /** Unique name of the group. */ + name: string; + /** Owner of the group. */ + owner?: string; +} diff --git a/src/api/resources/groups/client/requests/GroupsGetQuery.ts b/src/api/resources/groups/client/requests/GroupsGetQuery.ts new file mode 100644 index 0000000..bbefb5d --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface GroupsGetQuery { + /** + * The ID of the group to get. + */ + id: string; +} diff --git a/src/api/resources/groups/client/requests/GroupsGetRequest.ts b/src/api/resources/groups/client/requests/GroupsGetRequest.ts new file mode 100644 index 0000000..8b5b582 --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface GroupsGetRequest { + /** The ID of the group to get. */ + id: string; +} diff --git a/src/api/resources/groups/client/requests/GroupsListQuery.ts b/src/api/resources/groups/client/requests/GroupsListQuery.ts new file mode 100644 index 0000000..6186c83 --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupsListQuery.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface GroupsListQuery { + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters the groups based on the group type. + */ + groupType?: DevRev.GroupType | DevRev.GroupType[]; + /** + * Whether to fetch default or custom groups. + */ + isDefault?: boolean; + /** + * The maximum number of groups to return. The default is '50'. + */ + limit?: number; + /** + * Filters the groups on basis of member type. + */ + memberType?: DevRev.GroupMemberType | DevRev.GroupMemberType[]; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Comma-separated fields to sort the groups by. + */ + sortBy?: string | string[]; +} diff --git a/src/api/resources/groups/client/requests/GroupsListRequest.ts b/src/api/resources/groups/client/requests/GroupsListRequest.ts new file mode 100644 index 0000000..0b8ee68 --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupsListRequest.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface GroupsListRequest { + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** Filters the groups based on the group type. */ + groupType?: DevRev.GroupType[]; + /** Whether to fetch default or custom groups. */ + isDefault?: boolean; + /** + * The maximum number of groups to return. The default is '50'. + * + */ + limit?: number; + /** Filters the groups on basis of member type. */ + memberType?: DevRev.GroupMemberType[]; + mode?: DevRev.ListMode; + /** Comma-separated fields to sort the groups by. */ + sortBy?: string[]; +} diff --git a/src/api/resources/groups/client/requests/GroupsUpdateRequest.ts b/src/api/resources/groups/client/requests/GroupsUpdateRequest.ts new file mode 100644 index 0000000..98f8a9b --- /dev/null +++ b/src/api/resources/groups/client/requests/GroupsUpdateRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface GroupsUpdateRequest { + /** The updated group's description. */ + description?: string; + dynamicGroupInfo?: DevRev.GroupsUpdateRequestDynamicGroupInfo; + /** The ID of the group to update. */ + id: string; + /** The updated group's name. */ + name?: string; + /** The updated group's owner. */ + owner?: string; +} diff --git a/src/api/resources/groups/client/requests/index.ts b/src/api/resources/groups/client/requests/index.ts new file mode 100644 index 0000000..80276a8 --- /dev/null +++ b/src/api/resources/groups/client/requests/index.ts @@ -0,0 +1,10 @@ +export { type GroupsCreateRequest } from "./GroupsCreateRequest"; +export { type GroupsGetQuery } from "./GroupsGetQuery"; +export { type GroupsGetRequest } from "./GroupsGetRequest"; +export { type GroupsListQuery } from "./GroupsListQuery"; +export { type GroupsListRequest } from "./GroupsListRequest"; +export { type GroupMembersAddRequest } from "./GroupMembersAddRequest"; +export { type GroupMembersListQuery } from "./GroupMembersListQuery"; +export { type GroupMembersListRequest } from "./GroupMembersListRequest"; +export { type GroupMembersRemoveRequest } from "./GroupMembersRemoveRequest"; +export { type GroupsUpdateRequest } from "./GroupsUpdateRequest"; diff --git a/src/api/resources/groups/index.ts b/src/api/resources/groups/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/groups/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts new file mode 100644 index 0000000..6a4f613 --- /dev/null +++ b/src/api/resources/index.ts @@ -0,0 +1,51 @@ +export * as accounts from "./accounts"; +export * as articles from "./articles"; +export * as artifacts from "./artifacts"; +export * as codeChanges from "./codeChanges"; +export * as conversations from "./conversations"; +export * as devUsers from "./devUsers"; +export * as engagements from "./engagements"; +export * as eventSource from "./eventSource"; +export * as groups from "./groups"; +export * as links from "./links"; +export * as slas from "./slas"; +export * as productUsage from "./productUsage"; +export * as schedules from "./schedules"; +export * as parts from "./parts"; +export * as questionAnswers from "./questionAnswers"; +export * as revOrgs from "./revOrgs"; +export * as revUsers from "./revUsers"; +export * as customization from "./customization"; +export * as search from "./search"; +export * as serviceAccounts from "./serviceAccounts"; +export * as snapIns from "./snapIns"; +export * as snapWidgets from "./snapWidgets"; +export * as surveys from "./surveys"; +export * as sysUsers from "./sysUsers"; +export * as timelineEntries from "./timelineEntries"; +export * as works from "./works"; +export * from "./accounts/client/requests"; +export * from "./articles/client/requests"; +export * from "./artifacts/client/requests"; +export * from "./codeChanges/client/requests"; +export * from "./conversations/client/requests"; +export * from "./devUsers/client/requests"; +export * from "./engagements/client/requests"; +export * from "./eventSource/client/requests"; +export * from "./groups/client/requests"; +export * from "./links/client/requests"; +export * from "./slas/client/requests"; +export * from "./productUsage/client/requests"; +export * from "./schedules/client/requests"; +export * from "./parts/client/requests"; +export * from "./questionAnswers/client/requests"; +export * from "./revOrgs/client/requests"; +export * from "./revUsers/client/requests"; +export * from "./customization/client/requests"; +export * from "./search/client/requests"; +export * from "./serviceAccounts/client/requests"; +export * from "./snapIns/client/requests"; +export * from "./surveys/client/requests"; +export * from "./sysUsers/client/requests"; +export * from "./timelineEntries/client/requests"; +export * from "./works/client/requests"; diff --git a/src/api/resources/links/client/Client.ts b/src/api/resources/links/client/Client.ts new file mode 100644 index 0000000..0894942 --- /dev/null +++ b/src/api/resources/links/client/Client.ts @@ -0,0 +1,954 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Links { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev link interactions. + */ +export class Links { + constructor(protected readonly _options: Links.Options = {}) {} + + /** + * Creates a link between two objects to indicate a relationship. + * + * @param {DevRev.LinksCreateRequest} request + * @param {Links.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.links.create({ + * linkType: DevRev.LinkType.CustomLink, + * source: "string", + * target: "string" + * }) + */ + public async create( + request: DevRev.LinksCreateRequest, + requestOptions?: Links.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "links.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.LinksCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.LinksCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes a link. + * + * @param {DevRev.LinksDeleteRequest} request + * @param {Links.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.links.delete({ + * id: "id" + * }) + */ + public async delete( + request: DevRev.LinksDeleteRequest, + requestOptions?: Links.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "links.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.LinksDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.LinksDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the requested link's information. + * + * @param {DevRev.LinksGetQuery} request + * @param {Links.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.links.get({ + * id: "string" + * }) + */ + public async get( + request: DevRev.LinksGetQuery, + requestOptions?: Links.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "links.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.LinksGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the requested link's information. + * + * @param {DevRev.LinksGetRequest} request + * @param {Links.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.links.getPost({ + * id: "string" + * }) + */ + public async getPost( + request: DevRev.LinksGetRequest, + requestOptions?: Links.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "links.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.LinksGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.LinksGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the available links. + * + * @param {DevRev.LinksListQuery} request + * @param {Links.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.links.list({ + * object: "object" + * }) + */ + public async list( + request: DevRev.LinksListQuery, + requestOptions?: Links.RequestOptions + ): Promise { + const { object, cursor, direction, limit, linkType, mode, objectTypes, types } = request; + const _queryParams: Record = {}; + _queryParams["object"] = object; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (direction != null) { + _queryParams["direction"] = direction; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (linkType != null) { + if (Array.isArray(linkType)) { + _queryParams["link_type"] = linkType.map((item) => item); + } else { + _queryParams["link_type"] = linkType; + } + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (objectTypes != null) { + if (Array.isArray(objectTypes)) { + _queryParams["object_types"] = objectTypes.map((item) => item); + } else { + _queryParams["object_types"] = objectTypes; + } + } + + if (types != null) { + if (Array.isArray(types)) { + _queryParams["types"] = types.map((item) => item); + } else { + _queryParams["types"] = types; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "links.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.LinksListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the available links. + * + * @param {DevRev.LinksListRequest} request + * @param {Links.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.links.listPost({ + * object: "object" + * }) + */ + public async listPost( + request: DevRev.LinksListRequest, + requestOptions?: Links.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "links.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.LinksListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.LinksListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/links/client/index.ts b/src/api/resources/links/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/links/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/links/client/requests/LinksCreateRequest.ts b/src/api/resources/links/client/requests/LinksCreateRequest.ts new file mode 100644 index 0000000..740be41 --- /dev/null +++ b/src/api/resources/links/client/requests/LinksCreateRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * linkType: DevRev.LinkType.CustomLink, + * source: "string", + * target: "string" + * } + */ +export interface LinksCreateRequest { + linkType: DevRev.LinkType; + /** The ID of the source object. */ + source: string; + /** The ID of the target object. */ + target: string; +} diff --git a/src/api/resources/links/client/requests/LinksDeleteRequest.ts b/src/api/resources/links/client/requests/LinksDeleteRequest.ts new file mode 100644 index 0000000..e3e5a0a --- /dev/null +++ b/src/api/resources/links/client/requests/LinksDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface LinksDeleteRequest { + /** The ID of the link to delete. */ + id: string; +} diff --git a/src/api/resources/links/client/requests/LinksGetQuery.ts b/src/api/resources/links/client/requests/LinksGetQuery.ts new file mode 100644 index 0000000..536e54f --- /dev/null +++ b/src/api/resources/links/client/requests/LinksGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface LinksGetQuery { + /** + * The requested link's ID. + */ + id: string; +} diff --git a/src/api/resources/links/client/requests/LinksGetRequest.ts b/src/api/resources/links/client/requests/LinksGetRequest.ts new file mode 100644 index 0000000..666d0a6 --- /dev/null +++ b/src/api/resources/links/client/requests/LinksGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface LinksGetRequest { + /** The requested link's ID. */ + id: string; +} diff --git a/src/api/resources/links/client/requests/LinksListQuery.ts b/src/api/resources/links/client/requests/LinksListQuery.ts new file mode 100644 index 0000000..a353545 --- /dev/null +++ b/src/api/resources/links/client/requests/LinksListQuery.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * object: "object" + * } + */ +export interface LinksListQuery { + /** + * The ID of the object to list the links for. + */ + object: string; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The direction of the links to list, otherwise if not present, then + * links in both directions (source and target) are included. + */ + direction?: DevRev.LinksDirection; + /** + * The maximum number of links to return. If not set, then the default + * is '50'. + */ + limit?: number; + /** + * The link type(s) to filter for, otherwise if not present, all link + * types are included. + */ + linkType?: DevRev.LinkType | DevRev.LinkType[]; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * The object types to filter for, otherwise if not present, all object + * types are included. + */ + objectTypes?: DevRev.LinkEndpointType | DevRev.LinkEndpointType[]; + /** + * The link types to filter for, otherwise if not present, all link + * types are included. + */ + types?: DevRev.LinkType | DevRev.LinkType[]; +} diff --git a/src/api/resources/links/client/requests/LinksListRequest.ts b/src/api/resources/links/client/requests/LinksListRequest.ts new file mode 100644 index 0000000..b3b5c16 --- /dev/null +++ b/src/api/resources/links/client/requests/LinksListRequest.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * object: "object" + * } + */ +export interface LinksListRequest { + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + direction?: DevRev.LinksDirection; + /** + * The maximum number of links to return. If not set, then the default + * is '50'. + * + */ + limit?: number; + /** + * The link type(s) to filter for, otherwise if not present, all link + * types are included. + * + */ + linkType?: DevRev.LinkType[]; + mode?: DevRev.ListMode; + /** The ID of the object to list the links for. */ + object: string; + /** + * The object types to filter for, otherwise if not present, all + * object types are included. + * + */ + objectTypes?: DevRev.LinkEndpointType[]; + /** + * The link types to filter for, otherwise if not present, all link + * types are included. + * + */ + types?: DevRev.LinkType[]; +} diff --git a/src/api/resources/links/client/requests/index.ts b/src/api/resources/links/client/requests/index.ts new file mode 100644 index 0000000..e1f9ed6 --- /dev/null +++ b/src/api/resources/links/client/requests/index.ts @@ -0,0 +1,6 @@ +export { type LinksCreateRequest } from "./LinksCreateRequest"; +export { type LinksDeleteRequest } from "./LinksDeleteRequest"; +export { type LinksGetQuery } from "./LinksGetQuery"; +export { type LinksGetRequest } from "./LinksGetRequest"; +export { type LinksListQuery } from "./LinksListQuery"; +export { type LinksListRequest } from "./LinksListRequest"; diff --git a/src/api/resources/links/index.ts b/src/api/resources/links/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/links/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/parts/client/Client.ts b/src/api/resources/parts/client/Client.ts new file mode 100644 index 0000000..f2944f2 --- /dev/null +++ b/src/api/resources/parts/client/Client.ts @@ -0,0 +1,1138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Parts { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev part interactions. + */ +export class Parts { + constructor(protected readonly _options: Parts.Options = {}) {} + + /** + * Creates new [part](https://devrev.ai/docs/product/parts). + * + * @param {DevRev.PartsCreateRequest} request + * @param {Parts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.parts.create({ + * type: "capability", + * artifacts: ["string"], + * customFields: { + * "string": { + * "key": "value" + * } + * }, + * customSchemaFragments: ["string"], + * description: "string", + * name: "string", + * ownedBy: ["string"], + * parentPart: ["string"] + * }) + */ + public async create( + request: DevRev.PartsCreateRequest, + requestOptions?: Parts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "parts.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.PartsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.PartsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes a [part](https://devrev.ai/docs/product/parts). + * + * @param {DevRev.PartsDeleteRequest} request + * @param {Parts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.parts.delete({ + * id: "PROD-12345" + * }) + */ + public async delete( + request: DevRev.PartsDeleteRequest, + requestOptions?: Parts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "parts.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.PartsDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.PartsDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a [part's](https://devrev.ai/docs/product/parts) information. + * + * @param {DevRev.PartsGetQuery} request + * @param {Parts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.parts.get({ + * id: "string" + * }) + */ + public async get( + request: DevRev.PartsGetQuery, + requestOptions?: Parts.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "parts.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.PartsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a [part's](https://devrev.ai/docs/product/parts) information. + * + * @param {DevRev.PartsGetRequest} request + * @param {Parts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.parts.getPost({ + * id: "string" + * }) + */ + public async getPost( + request: DevRev.PartsGetRequest, + requestOptions?: Parts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "parts.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.PartsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.PartsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of [parts](https://devrev.ai/docs/product/parts). + * + * @param {DevRev.PartsListQuery} request + * @param {Parts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.parts.list() + */ + public async list( + request: DevRev.PartsListQuery = {}, + requestOptions?: Parts.RequestOptions + ): Promise { + const { + createdBy, + cursor, + limit, + mode, + name, + ownedBy, + parentPartLevel, + parentPartParts, + type: type_, + } = request; + const _queryParams: Record = {}; + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (name != null) { + if (Array.isArray(name)) { + _queryParams["name"] = name.map((item) => item); + } else { + _queryParams["name"] = name; + } + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (parentPartLevel != null) { + _queryParams["parent_part.level"] = parentPartLevel.toString(); + } + + if (parentPartParts != null) { + if (Array.isArray(parentPartParts)) { + _queryParams["parent_part.parts"] = parentPartParts.map((item) => item); + } else { + _queryParams["parent_part.parts"] = parentPartParts; + } + } + + if (type_ != null) { + if (Array.isArray(type_)) { + _queryParams["type"] = type_.map((item) => item); + } else { + _queryParams["type"] = type_; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "parts.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.PartsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of [parts](https://devrev.ai/docs/product/parts). + * + * @param {DevRev.PartsListRequest} request + * @param {Parts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.parts.listPost() + */ + public async listPost( + request: DevRev.PartsListRequest = {}, + requestOptions?: Parts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "parts.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.PartsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.PartsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a [part's](https://devrev.ai/docs/product/parts) information. + * + * @param {DevRev.PartsUpdateRequest} request + * @param {Parts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.parts.update({ + * type: "capability", + * value: { + * "string": { + * "key": "value" + * } + * } + * }) + */ + public async update( + request: DevRev.PartsUpdateRequest, + requestOptions?: Parts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "parts.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.PartsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.PartsUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/parts/client/index.ts b/src/api/resources/parts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/parts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/parts/client/requests/PartsDeleteRequest.ts b/src/api/resources/parts/client/requests/PartsDeleteRequest.ts new file mode 100644 index 0000000..a71d2f8 --- /dev/null +++ b/src/api/resources/parts/client/requests/PartsDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "PROD-12345" + * } + */ +export interface PartsDeleteRequest { + /** The ID of the part to delete. */ + id: string; +} diff --git a/src/api/resources/parts/client/requests/PartsGetQuery.ts b/src/api/resources/parts/client/requests/PartsGetQuery.ts new file mode 100644 index 0000000..6b9fbe2 --- /dev/null +++ b/src/api/resources/parts/client/requests/PartsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface PartsGetQuery { + /** + * The ID of the part to retrieve. + */ + id: string; +} diff --git a/src/api/resources/parts/client/requests/PartsGetRequest.ts b/src/api/resources/parts/client/requests/PartsGetRequest.ts new file mode 100644 index 0000000..2609dde --- /dev/null +++ b/src/api/resources/parts/client/requests/PartsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface PartsGetRequest { + /** The ID of the part to retrieve. */ + id: string; +} diff --git a/src/api/resources/parts/client/requests/PartsListQuery.ts b/src/api/resources/parts/client/requests/PartsListQuery.ts new file mode 100644 index 0000000..8ec6d59 --- /dev/null +++ b/src/api/resources/parts/client/requests/PartsListQuery.ts @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface PartsListQuery { + /** + * Filters for parts created by any of these users. + */ + createdBy?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of parts to return. The default is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for parts of the provided name(s). + */ + name?: string | string[]; + /** + * Filters for parts owned by any of these users. + */ + ownedBy?: string | string[]; + /** + * Number of levels to fetch the part hierarchy up to. + */ + parentPartLevel?: number; + /** + * Part IDs to fetch the hierarchy for. Required if any parent_part.\* + * fields are provided. + */ + parentPartParts?: string | string[]; + /** + * Filters for parts of the provided type(s). + */ + type?: DevRev.PartType | DevRev.PartType[]; +} diff --git a/src/api/resources/parts/client/requests/PartsListRequest.ts b/src/api/resources/parts/client/requests/PartsListRequest.ts new file mode 100644 index 0000000..251c035 --- /dev/null +++ b/src/api/resources/parts/client/requests/PartsListRequest.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface PartsListRequest { + /** Filters for parts of the provided type(s). */ + type?: DevRev.PartType[]; + /** Filters for parts created by any of these users. */ + createdBy?: string[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of parts to return. The default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** Filters for parts of the provided name(s). */ + name?: string[]; + /** Filters for parts owned by any of these users. */ + ownedBy?: string[]; + parentPart?: DevRev.ParentPartFilter; +} diff --git a/src/api/resources/parts/client/requests/index.ts b/src/api/resources/parts/client/requests/index.ts new file mode 100644 index 0000000..9624a9e --- /dev/null +++ b/src/api/resources/parts/client/requests/index.ts @@ -0,0 +1,5 @@ +export { type PartsDeleteRequest } from "./PartsDeleteRequest"; +export { type PartsGetQuery } from "./PartsGetQuery"; +export { type PartsGetRequest } from "./PartsGetRequest"; +export { type PartsListQuery } from "./PartsListQuery"; +export { type PartsListRequest } from "./PartsListRequest"; diff --git a/src/api/resources/parts/index.ts b/src/api/resources/parts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/parts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/productUsage/client/Client.ts b/src/api/resources/productUsage/client/Client.ts new file mode 100644 index 0000000..74cdc4c --- /dev/null +++ b/src/api/resources/productUsage/client/Client.ts @@ -0,0 +1,1604 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace ProductUsage { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Product Usage APIs + */ +export class ProductUsage { + constructor(protected readonly _options: ProductUsage.Options = {}) {} + + /** + * Ingest endpoint for DevRev metrics data from clients. + * + * @param {DevRev.MetricsDataIngestRequest} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.metricsDevrevIngest({ + * metrics: [{ + * accountRef: "account_ref", + * dataPoints: [{ + * timestamp: new Date("2023-01-01T12:00:00.000Z"), + * value: 1.1 + * }], + * name: "name" + * }] + * }) + */ + public async metricsDevrevIngest( + request: DevRev.MetricsDataIngestRequest, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "metrics.devrev.ingest" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.MetricsDataIngestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Counts the number of Unit of Measurements based on the given filters. + * + * @param {DevRev.UomsCountQuery} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsCount() + */ + public async uomsCount( + request: DevRev.UomsCountQuery = {}, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const { aggregationTypes, ids, metricNames, partIds, productIds, unitTypes } = request; + const _queryParams: Record = {}; + if (aggregationTypes != null) { + if (Array.isArray(aggregationTypes)) { + _queryParams["aggregation_types"] = aggregationTypes.map((item) => item); + } else { + _queryParams["aggregation_types"] = aggregationTypes; + } + } + + if (ids != null) { + if (Array.isArray(ids)) { + _queryParams["ids"] = ids.map((item) => item); + } else { + _queryParams["ids"] = ids; + } + } + + if (metricNames != null) { + if (Array.isArray(metricNames)) { + _queryParams["metric_names"] = metricNames.map((item) => item); + } else { + _queryParams["metric_names"] = metricNames; + } + } + + if (partIds != null) { + if (Array.isArray(partIds)) { + _queryParams["part_ids"] = partIds.map((item) => item); + } else { + _queryParams["part_ids"] = partIds; + } + } + + if (productIds != null) { + if (Array.isArray(productIds)) { + _queryParams["product_ids"] = productIds.map((item) => item); + } else { + _queryParams["product_ids"] = productIds; + } + } + + if (unitTypes != null) { + if (Array.isArray(unitTypes)) { + _queryParams["unit_types"] = unitTypes.map((item) => item); + } else { + _queryParams["unit_types"] = unitTypes; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.count" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsCountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Counts the number of Unit of Measurements based on the given filters. + * + * @param {DevRev.UomsCountRequest} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsCountPost() + */ + public async uomsCountPost( + request: DevRev.UomsCountRequest = {}, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.count" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.UomsCountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsCountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Creates a Unit of Measurement on a part. + * + * @param {DevRev.UomsCreateRequest} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsCreate({ + * aggregationDetail: { + * aggregationType: DevRev.AggregationDetailAggregationType.Duration, + * uniqueDimension: "string" + * }, + * description: "string", + * dimensions: ["string"], + * metricName: "string", + * name: "string", + * partId: "string", + * productId: "string", + * unit: { + * type: DevRev.UnitType.Boolean, + * name: "string" + * } + * }) + */ + public async uomsCreate( + request: DevRev.UomsCreateRequest, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.UomsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes a Unit of Measurement. + * + * @param {DevRev.UomsDeleteRequest} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsDelete({ + * id: "id" + * }) + */ + public async uomsDelete( + request: DevRev.UomsDeleteRequest, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.UomsDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a Unit of Measurement. + * + * @param {DevRev.UomsGetQuery} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsGet({ + * id: "string" + * }) + */ + public async uomsGet( + request: DevRev.UomsGetQuery, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a Unit of Measurement. + * + * @param {DevRev.UomsGetRequest} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsGetPost({ + * id: "string" + * }) + */ + public async uomsGetPost( + request: DevRev.UomsGetRequest, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.UomsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the Unit of Measurements based on the given filters. + * + * @param {DevRev.UomsListQuery} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsList() + */ + public async uomsList( + request: DevRev.UomsListQuery = {}, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const { aggregationTypes, cursor, ids, limit, metricNames, mode, partIds, productIds, sortBy, unitTypes } = + request; + const _queryParams: Record = {}; + if (aggregationTypes != null) { + if (Array.isArray(aggregationTypes)) { + _queryParams["aggregation_types"] = aggregationTypes.map((item) => item); + } else { + _queryParams["aggregation_types"] = aggregationTypes; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (ids != null) { + if (Array.isArray(ids)) { + _queryParams["ids"] = ids.map((item) => item); + } else { + _queryParams["ids"] = ids; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (metricNames != null) { + if (Array.isArray(metricNames)) { + _queryParams["metric_names"] = metricNames.map((item) => item); + } else { + _queryParams["metric_names"] = metricNames; + } + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (partIds != null) { + if (Array.isArray(partIds)) { + _queryParams["part_ids"] = partIds.map((item) => item); + } else { + _queryParams["part_ids"] = partIds; + } + } + + if (productIds != null) { + if (Array.isArray(productIds)) { + _queryParams["product_ids"] = productIds.map((item) => item); + } else { + _queryParams["product_ids"] = productIds; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (unitTypes != null) { + if (Array.isArray(unitTypes)) { + _queryParams["unit_types"] = unitTypes.map((item) => item); + } else { + _queryParams["unit_types"] = unitTypes; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the Unit of Measurements based on the given filters. + * + * @param {DevRev.UomsListRequest} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsListPost() + */ + public async uomsListPost( + request: DevRev.UomsListRequest = {}, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.UomsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a Unit of Measurement. + * + * @param {DevRev.UomsUpdateRequest} request + * @param {ProductUsage.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.productUsage.uomsUpdate({ + * aggregationType: DevRev.AggregationDetailAggregationType.Duration, + * description: "string", + * dimensions: { + * add: ["string"], + * remove: ["string"] + * }, + * id: "string", + * isEnabled: true, + * name: "string", + * partId: "string", + * productId: "string", + * unit: "string" + * }) + */ + public async uomsUpdate( + request: DevRev.UomsUpdateRequest, + requestOptions?: ProductUsage.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "uoms.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.UomsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UomsUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/productUsage/client/index.ts b/src/api/resources/productUsage/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/productUsage/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/productUsage/client/requests/MetricsDataIngestRequest.ts b/src/api/resources/productUsage/client/requests/MetricsDataIngestRequest.ts new file mode 100644 index 0000000..538d4ec --- /dev/null +++ b/src/api/resources/productUsage/client/requests/MetricsDataIngestRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * metrics: [{ + * accountRef: "account_ref", + * dataPoints: [{ + * timestamp: new Date("2023-01-01T12:00:00.000Z"), + * value: 1.1 + * }], + * name: "name" + * }] + * } + */ +export interface MetricsDataIngestRequest { + /** Metrics data received from Dev orgs. */ + metrics: DevRev.MetricsData[]; +} diff --git a/src/api/resources/productUsage/client/requests/UomsCountQuery.ts b/src/api/resources/productUsage/client/requests/UomsCountQuery.ts new file mode 100644 index 0000000..9596e58 --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsCountQuery.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface UomsCountQuery { + /** + * List of aggregation types for filtering list of UOMs. + */ + aggregationTypes?: DevRev.AggregationDetailAggregationType | DevRev.AggregationDetailAggregationType[]; + /** + * List of Unit of Measurement (UOM) DONs to be used in filtering + * complete list of UOMs defined in a Dev Org. + */ + ids?: string | string[]; + /** + * List of metric names for filtering list of UOMs. + */ + metricNames?: string | string[]; + /** + * List of part IDs for filtering list of UOMs. + */ + partIds?: string | string[]; + /** + * List of product IDs for filtering list of UOMs. + */ + productIds?: string | string[]; + /** + * List of unit types for filtering list of UOMs. + */ + unitTypes?: DevRev.UnitType | DevRev.UnitType[]; +} diff --git a/src/api/resources/productUsage/client/requests/UomsCountRequest.ts b/src/api/resources/productUsage/client/requests/UomsCountRequest.ts new file mode 100644 index 0000000..9a0909a --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsCountRequest.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface UomsCountRequest { + /** List of aggregation types for filtering list of UOMs. */ + aggregationTypes?: DevRev.AggregationDetailAggregationType[]; + /** + * List of Unit of Measurement (UOM) DONs to be used in filtering + * complete list of UOMs defined in a Dev Org. + * + */ + ids?: string[]; + /** List of metric names for filtering list of UOMs. */ + metricNames?: string[]; + /** List of part IDs for filtering list of UOMs. */ + partIds?: string[]; + /** List of product IDs for filtering list of UOMs. */ + productIds?: string[]; + /** List of unit types for filtering list of UOMs. */ + unitTypes?: DevRev.UnitType[]; +} diff --git a/src/api/resources/productUsage/client/requests/UomsCreateRequest.ts b/src/api/resources/productUsage/client/requests/UomsCreateRequest.ts new file mode 100644 index 0000000..1550cc3 --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsCreateRequest.ts @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * aggregationDetail: { + * aggregationType: DevRev.AggregationDetailAggregationType.Duration, + * uniqueDimension: "string" + * }, + * description: "string", + * dimensions: ["string"], + * metricName: "string", + * name: "string", + * partId: "string", + * productId: "string", + * unit: { + * type: DevRev.UnitType.Boolean, + * name: "string" + * } + * } + */ +export interface UomsCreateRequest { + aggregationDetail: DevRev.AggregationDetail; + /** Description of the Unit of Measurement (UOM). */ + description?: string; + /** + * The list of dimensions that can be emitted as part of metrics data. + * Dimensions consist of list of key-value pairs. For example, if the + * UOM is 'number_of_api_calls', then dimensions can be ['api_name', + * 'api_version'].Dimension keys can only contain alphanumeric + * characters (A-Z, a-z, and 0-9) and underscores (_). Dimension keys + * cannot start with a number and is case-insensitive.Dimension keys + * must be unique and it is not allowed to have more than one value + * with the same key.Metrics data ingested in DevRev metrics format + * will be grouped and aggregated based on the dimensions specified in + * UOM. + * + */ + dimensions?: string[]; + /** + * Name of the Unit of Measurement (UOM). Unit of Measurement is a + * unit of measure defined over a part offered by a Dev Org. A single + * part can have multiple unit of measurements defined over it. For + * example, a part can be 'video call', one UOM defined on this can be + * 'number_of_calls', other UOM can be 'call_duration' etc.Metric name + * should be unique across all UOMs in a Dev Org.Metric name can only + * contain alphanumeric characters (A-Z, a-z, and 0-9) and underscores + * (_). Metric name cannot start with a number and is + * case-insensitive. + * + */ + metricName: string; + /** Human readable name of the Unit of Measurement (UOM). */ + name: string; + /** + * The part ID for which the Unit of Measurement (UOM) is defined. + * When defined, ingested metrics data will be associated with part + * and product specified in UOM. + * + */ + partId?: string; + /** + * The product ID for which the Unit of Measurement (UOM) is defined. + * + */ + productId: string; + unit: DevRev.Unit; +} diff --git a/src/api/resources/productUsage/client/requests/UomsDeleteRequest.ts b/src/api/resources/productUsage/client/requests/UomsDeleteRequest.ts new file mode 100644 index 0000000..6ed65d2 --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface UomsDeleteRequest { + /** The Unit of Measurement (UOM)'s DON. */ + id: string; +} diff --git a/src/api/resources/productUsage/client/requests/UomsGetQuery.ts b/src/api/resources/productUsage/client/requests/UomsGetQuery.ts new file mode 100644 index 0000000..625b98f --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface UomsGetQuery { + /** + * The Unit of Measurement (UOM)'s DON. + */ + id: string; +} diff --git a/src/api/resources/productUsage/client/requests/UomsGetRequest.ts b/src/api/resources/productUsage/client/requests/UomsGetRequest.ts new file mode 100644 index 0000000..9e8f6b4 --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface UomsGetRequest { + /** The Unit of Measurement (UOM)'s DON. */ + id: string; +} diff --git a/src/api/resources/productUsage/client/requests/UomsListQuery.ts b/src/api/resources/productUsage/client/requests/UomsListQuery.ts new file mode 100644 index 0000000..0289b79 --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsListQuery.ts @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface UomsListQuery { + /** + * List of aggregation types for filtering list of UOMs. + */ + aggregationTypes?: DevRev.AggregationDetailAggregationType | DevRev.AggregationDetailAggregationType[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * List of Unit of Measurement (UOM) DONs to be used in filtering + * complete list of UOMs defined in a Dev Org. + */ + ids?: string | string[]; + /** + * The maximum number of UOMs to be returned in a response. The default + * is '50'. + */ + limit?: number; + /** + * List of metric names for filtering list of UOMs. + */ + metricNames?: string | string[]; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * List of part IDs for filtering list of UOMs. + */ + partIds?: string | string[]; + /** + * List of product IDs for filtering list of UOMs. + */ + productIds?: string | string[]; + /** + * Fields to sort the Unit Of Measuments (UOMs) by and the direction to + * sort them. + */ + sortBy?: string | string[]; + /** + * List of unit types for filtering list of UOMs. + */ + unitTypes?: DevRev.UnitType | DevRev.UnitType[]; +} diff --git a/src/api/resources/productUsage/client/requests/UomsListRequest.ts b/src/api/resources/productUsage/client/requests/UomsListRequest.ts new file mode 100644 index 0000000..05c34a6 --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsListRequest.ts @@ -0,0 +1,47 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface UomsListRequest { + /** List of aggregation types for filtering list of UOMs. */ + aggregationTypes?: DevRev.AggregationDetailAggregationType[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * List of Unit of Measurement (UOM) DONs to be used in filtering + * complete list of UOMs defined in a Dev Org. + * + */ + ids?: string[]; + /** + * The maximum number of UOMs to be returned in a response. The + * default is '50'. + * + */ + limit?: number; + /** List of metric names for filtering list of UOMs. */ + metricNames?: string[]; + mode?: DevRev.ListMode; + /** List of part IDs for filtering list of UOMs. */ + partIds?: string[]; + /** List of product IDs for filtering list of UOMs. */ + productIds?: string[]; + /** + * Fields to sort the Unit Of Measuments (UOMs) by and the direction + * to sort them. + * + */ + sortBy?: string[]; + /** List of unit types for filtering list of UOMs. */ + unitTypes?: DevRev.UnitType[]; +} diff --git a/src/api/resources/productUsage/client/requests/UomsUpdateRequest.ts b/src/api/resources/productUsage/client/requests/UomsUpdateRequest.ts new file mode 100644 index 0000000..5cf61ba --- /dev/null +++ b/src/api/resources/productUsage/client/requests/UomsUpdateRequest.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * aggregationType: DevRev.AggregationDetailAggregationType.Duration, + * description: "string", + * dimensions: { + * add: ["string"], + * remove: ["string"] + * }, + * id: "string", + * isEnabled: true, + * name: "string", + * partId: "string", + * productId: "string", + * unit: "string" + * } + */ +export interface UomsUpdateRequest { + aggregationType?: DevRev.AggregationDetailAggregationType; + /** Description of the Unit of Measurement (UOM). */ + description?: string; + dimensions?: DevRev.UomsUpdateRequestDimensions; + /** The Unit of Measurement (UOM)'s DON. */ + id: string; + /** + * Flag used to enable/disable the Unit of Measurement (UOM). When + * disabled, any metricsrecords ingested against this UOM will be + * dropped. + * + */ + isEnabled?: boolean; + /** Human readable name of the Unit of Measurement (UOM). */ + name?: string; + /** + * The part ID such as feature or capability for which the Unit of + * Measurement (UOM) is defined. + * + */ + partId?: string; + /** + * The product ID for which the Unit of Measurement (UOM) is defined. + * + */ + productId?: string; + /** Unit name of the Unit of Measurement (UOM). */ + unit?: string; +} diff --git a/src/api/resources/productUsage/client/requests/index.ts b/src/api/resources/productUsage/client/requests/index.ts new file mode 100644 index 0000000..fd4c376 --- /dev/null +++ b/src/api/resources/productUsage/client/requests/index.ts @@ -0,0 +1,10 @@ +export { type MetricsDataIngestRequest } from "./MetricsDataIngestRequest"; +export { type UomsCountQuery } from "./UomsCountQuery"; +export { type UomsCountRequest } from "./UomsCountRequest"; +export { type UomsCreateRequest } from "./UomsCreateRequest"; +export { type UomsDeleteRequest } from "./UomsDeleteRequest"; +export { type UomsGetQuery } from "./UomsGetQuery"; +export { type UomsGetRequest } from "./UomsGetRequest"; +export { type UomsListQuery } from "./UomsListQuery"; +export { type UomsListRequest } from "./UomsListRequest"; +export { type UomsUpdateRequest } from "./UomsUpdateRequest"; diff --git a/src/api/resources/productUsage/index.ts b/src/api/resources/productUsage/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/productUsage/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/questionAnswers/client/Client.ts b/src/api/resources/questionAnswers/client/Client.ts new file mode 100644 index 0000000..88f3056 --- /dev/null +++ b/src/api/resources/questionAnswers/client/Client.ts @@ -0,0 +1,1095 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace QuestionAnswers { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +export class QuestionAnswers { + constructor(protected readonly _options: QuestionAnswers.Options = {}) {} + + /** + * Creates a question-answer. + * + * @param {DevRev.QuestionAnswersCreateRequest} request + * @param {QuestionAnswers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.questionAnswers.create({ + * answer: "answer", + * appliesToParts: ["PROD-12345"], + * ownedBy: ["DEVU-12345"], + * question: "question", + * status: DevRev.QuestionAnswerStatus.Archived + * }) + */ + public async create( + request: DevRev.QuestionAnswersCreateRequest, + requestOptions?: QuestionAnswers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "question-answers.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.QuestionAnswersCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.QuestionAnswersCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes a question-answer. + * + * @param {DevRev.QuestionAnswersDeleteRequest} request + * @param {QuestionAnswers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.questionAnswers.delete({ + * id: "id" + * }) + */ + public async delete( + request: DevRev.QuestionAnswersDeleteRequest, + requestOptions?: QuestionAnswers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "question-answers.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.QuestionAnswersDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a question-answer. + * + * @param {DevRev.GetQuestionAnswerQuery} request + * @param {QuestionAnswers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.questionAnswers.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.GetQuestionAnswerQuery, + requestOptions?: QuestionAnswers.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "question-answers.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.QuestionAnswersGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a question-answer. + * + * @param {DevRev.QuestionAnswersGetRequest} request + * @param {QuestionAnswers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.questionAnswers.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.QuestionAnswersGetRequest, + requestOptions?: QuestionAnswers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "question-answers.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.QuestionAnswersGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.QuestionAnswersGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of question-answers. + * + * @param {DevRev.ListQuestionAnswersQuery} request + * @param {QuestionAnswers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.questionAnswers.list() + */ + public async list( + request: DevRev.ListQuestionAnswersQuery = {}, + requestOptions?: QuestionAnswers.RequestOptions + ): Promise { + const { appliesToArticles, appliesToParts, createdBy, cursor, limit, mode, ownedBy } = request; + const _queryParams: Record = {}; + if (appliesToArticles != null) { + if (Array.isArray(appliesToArticles)) { + _queryParams["applies_to_articles"] = appliesToArticles.map((item) => item); + } else { + _queryParams["applies_to_articles"] = appliesToArticles; + } + } + + if (appliesToParts != null) { + if (Array.isArray(appliesToParts)) { + _queryParams["applies_to_parts"] = appliesToParts.map((item) => item); + } else { + _queryParams["applies_to_parts"] = appliesToParts; + } + } + + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "question-answers.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.QuestionAnswersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of question-answers. + * + * @param {DevRev.QuestionAnswersListRequest} request + * @param {QuestionAnswers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.questionAnswers.listPost() + */ + public async listPost( + request: DevRev.QuestionAnswersListRequest = {}, + requestOptions?: QuestionAnswers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "question-answers.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.QuestionAnswersListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.QuestionAnswersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a question-answer. + * + * @param {DevRev.QuestionAnswersUpdateRequest} request + * @param {QuestionAnswers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.questionAnswers.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.QuestionAnswersUpdateRequest, + requestOptions?: QuestionAnswers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "question-answers.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.QuestionAnswersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.QuestionAnswersUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/questionAnswers/client/index.ts b/src/api/resources/questionAnswers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/questionAnswers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/questionAnswers/client/requests/GetQuestionAnswerQuery.ts b/src/api/resources/questionAnswers/client/requests/GetQuestionAnswerQuery.ts new file mode 100644 index 0000000..99b354e --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/GetQuestionAnswerQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetQuestionAnswerQuery { + /** + * The ID of the required question-answer. + */ + id: string; +} diff --git a/src/api/resources/questionAnswers/client/requests/ListQuestionAnswersQuery.ts b/src/api/resources/questionAnswers/client/requests/ListQuestionAnswersQuery.ts new file mode 100644 index 0000000..03f71b1 --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/ListQuestionAnswersQuery.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface ListQuestionAnswersQuery { + /** + * Filters for question-answer belonging to any of the provided + * articles. + */ + appliesToArticles?: string | string[]; + /** + * Filters for question-answer belonging to any of the provided parts. + */ + appliesToParts?: string | string[]; + /** + * Filters for question-answers created by any of the provided users. + */ + createdBy?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of question-answers to return. The default is + * '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for question-answers owned by any of the provided users. + */ + ownedBy?: string | string[]; +} diff --git a/src/api/resources/questionAnswers/client/requests/QuestionAnswersCreateRequest.ts b/src/api/resources/questionAnswers/client/requests/QuestionAnswersCreateRequest.ts new file mode 100644 index 0000000..76d116c --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/QuestionAnswersCreateRequest.ts @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * answer: "answer", + * appliesToParts: ["PROD-12345"], + * ownedBy: ["DEVU-12345"], + * question: "question", + * status: DevRev.QuestionAnswerStatus.Archived + * } + */ +export interface QuestionAnswersCreateRequest { + accessLevel?: DevRev.AccessLevel; + /** Answer of the question-answer. */ + answer: string; + /** The articles that the question-answer applies to. */ + appliesToArticles?: string[]; + /** The parts that the question-answer applies to. */ + appliesToParts: string[]; + /** The users that own the question-answer. */ + ownedBy: string[]; + /** Question of the question-answer. */ + question: string; + /** + * Information about the role the member receives due to the share. + * + */ + sharedWith?: DevRev.SetSharedWithMembership[]; + /** The source of the question-answer. */ + sources?: string[]; + status: DevRev.QuestionAnswerStatus; + /** + * Alternative answer for the question-answer sugested by Q/A + * Discovery. + * + */ + suggestedAnswer?: string; + /** + * Whether the question-answer was suggeste to be deleted by Q/A + * Discovery. + * + */ + suggestedForDeletion?: boolean; + /** Tags associated with the question-answer. */ + tags?: DevRev.SetTagWithValue[]; + /** Topic of the question-answer. */ + topic?: string; + /** + * Whether the question-answer was verified by a user or not. + * + */ + verified?: boolean; +} diff --git a/src/api/resources/questionAnswers/client/requests/QuestionAnswersDeleteRequest.ts b/src/api/resources/questionAnswers/client/requests/QuestionAnswersDeleteRequest.ts new file mode 100644 index 0000000..d47ec77 --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/QuestionAnswersDeleteRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface QuestionAnswersDeleteRequest { + /** The ID of the question-answer. */ + id: string; + /** The ID of the question-answer. */ + questionAnswerId?: string; +} diff --git a/src/api/resources/questionAnswers/client/requests/QuestionAnswersGetRequest.ts b/src/api/resources/questionAnswers/client/requests/QuestionAnswersGetRequest.ts new file mode 100644 index 0000000..18a16ed --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/QuestionAnswersGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface QuestionAnswersGetRequest { + /** The ID of the required question-answer. */ + id: string; +} diff --git a/src/api/resources/questionAnswers/client/requests/QuestionAnswersListRequest.ts b/src/api/resources/questionAnswers/client/requests/QuestionAnswersListRequest.ts new file mode 100644 index 0000000..7debdc4 --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/QuestionAnswersListRequest.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface QuestionAnswersListRequest { + /** + * Filters for question-answer belonging to any of the provided + * articles. + * + */ + appliesToArticles?: string[]; + /** + * Filters for question-answer belonging to any of the provided parts. + * + */ + appliesToParts?: string[]; + /** + * Filters for question-answers created by any of the provided users. + * + */ + createdBy?: string[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of question-answers to return. The default is + * '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** + * Filters for question-answers owned by any of the provided users. + * + */ + ownedBy?: string[]; +} diff --git a/src/api/resources/questionAnswers/client/requests/QuestionAnswersUpdateRequest.ts b/src/api/resources/questionAnswers/client/requests/QuestionAnswersUpdateRequest.ts new file mode 100644 index 0000000..4b8222b --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/QuestionAnswersUpdateRequest.ts @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface QuestionAnswersUpdateRequest { + accessLevel?: DevRev.AccessLevel; + /** + * Updated answer of the question-answer object, or unchanged if not + * provided. + * + */ + answer?: string; + appliesToArticles?: DevRev.QuestionAnswersUpdateRequestAppliesToArticles; + appliesToParts?: DevRev.QuestionAnswersUpdateRequestAppliesToParts; + /** The question-answer's ID. */ + id: string; + ownedBy?: DevRev.QuestionAnswersUpdateRequestOwnedBy; + /** + * Updated question of the question-answer object, or unchanged if not + * provided. + * + */ + question?: string; + sharedWith?: DevRev.QuestionAnswersUpdateRequestSharedWith; + sources?: DevRev.QuestionAnswersUpdateRequestSources; + status?: DevRev.QuestionAnswerStatus; + /** + * Updated suggested_answer of the question-answer object, or + * unchanged if not provided. + * + */ + suggestedAnswer?: string; + /** + * Updated suggested_for_deletion of the question-answer object, or + * unchanged if not provided. + * + */ + suggestedForDeletion?: boolean; + tags?: DevRev.QuestionAnswersUpdateRequestTags; + /** + * Updated topic of the question-answer object, or unchanged if not + * provided. + * + */ + topic?: string; + /** + * Updates whether the question-answer was verified by a user or not. + * + */ + verified?: boolean; +} diff --git a/src/api/resources/questionAnswers/client/requests/index.ts b/src/api/resources/questionAnswers/client/requests/index.ts new file mode 100644 index 0000000..9eaba04 --- /dev/null +++ b/src/api/resources/questionAnswers/client/requests/index.ts @@ -0,0 +1,7 @@ +export { type QuestionAnswersCreateRequest } from "./QuestionAnswersCreateRequest"; +export { type QuestionAnswersDeleteRequest } from "./QuestionAnswersDeleteRequest"; +export { type GetQuestionAnswerQuery } from "./GetQuestionAnswerQuery"; +export { type QuestionAnswersGetRequest } from "./QuestionAnswersGetRequest"; +export { type ListQuestionAnswersQuery } from "./ListQuestionAnswersQuery"; +export { type QuestionAnswersListRequest } from "./QuestionAnswersListRequest"; +export { type QuestionAnswersUpdateRequest } from "./QuestionAnswersUpdateRequest"; diff --git a/src/api/resources/questionAnswers/index.ts b/src/api/resources/questionAnswers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/questionAnswers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/revOrgs/client/Client.ts b/src/api/resources/revOrgs/client/Client.ts new file mode 100644 index 0000000..4b5967a --- /dev/null +++ b/src/api/resources/revOrgs/client/Client.ts @@ -0,0 +1,1071 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace RevOrgs { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Rev organization interactions. + */ +export class RevOrgs { + constructor(protected readonly _options: RevOrgs.Options = {}) {} + + /** + * Creates a Rev organization in the authenticated user's Dev + * organization. + * + * @param {DevRev.RevOrgsCreateRequest} request + * @param {RevOrgs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.ConflictError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revOrgs.create({ + * displayName: "display_name" + * }) + */ + public async create( + request: DevRev.RevOrgsCreateRequest, + requestOptions?: RevOrgs.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-orgs.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevOrgsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevOrgsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 409: + throw new DevRev.ConflictError( + serializers.ErrorConflict.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Retrieves the Rev organization's information. + * + * @param {DevRev.RevOrgsGetQuery} request + * @param {RevOrgs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revOrgs.get({ + * account: "ACC-12345", + * id: "REV-AbCdEfGh" + * }) + */ + public async get( + request: DevRev.RevOrgsGetQuery = {}, + requestOptions?: RevOrgs.RequestOptions + ): Promise { + const { account, id } = request; + const _queryParams: Record = {}; + if (account != null) { + _queryParams["account"] = account; + } + + if (id != null) { + _queryParams["id"] = id; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-orgs.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevOrgsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Retrieves the Rev organization's information. + * + * @param {DevRev.RevOrgsGetRequest} request + * @param {RevOrgs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revOrgs.getPost() + */ + public async getPost( + request: DevRev.RevOrgsGetRequest = {}, + requestOptions?: RevOrgs.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-orgs.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevOrgsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevOrgsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the list of Rev organizations' information belonging to the + * authenticated user's Dev Organization which the user is also authorized + * to access. + * + * @param {DevRev.RevOrgsListQuery} request + * @param {RevOrgs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revOrgs.list({ + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * }) + */ + public async list( + request: DevRev.RevOrgsListQuery = {}, + requestOptions?: RevOrgs.RequestOptions + ): Promise { + const { + account, + createdBy, + createdDateAfter, + createdDateBefore, + cursor, + customFieldFilter, + customFields, + displayName, + externalRef, + limit, + mode, + modifiedDateAfter, + modifiedDateBefore, + sortBy, + tags, + } = request; + const _queryParams: Record = {}; + if (account != null) { + if (Array.isArray(account)) { + _queryParams["account"] = account.map((item) => item); + } else { + _queryParams["account"] = account; + } + } + + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (createdDateAfter != null) { + _queryParams["created_date.after"] = createdDateAfter.toISOString(); + } + + if (createdDateBefore != null) { + _queryParams["created_date.before"] = createdDateBefore.toISOString(); + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (customFieldFilter != null) { + if (Array.isArray(customFieldFilter)) { + _queryParams["custom_field_filter"] = customFieldFilter.map((item) => item); + } else { + _queryParams["custom_field_filter"] = customFieldFilter; + } + } + + if (customFields != null) { + _queryParams["custom_fields"] = JSON.stringify(customFields); + } + + if (displayName != null) { + if (Array.isArray(displayName)) { + _queryParams["display_name"] = displayName.map((item) => item); + } else { + _queryParams["display_name"] = displayName; + } + } + + if (externalRef != null) { + if (Array.isArray(externalRef)) { + _queryParams["external_ref"] = externalRef.map((item) => item); + } else { + _queryParams["external_ref"] = externalRef; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (modifiedDateAfter != null) { + _queryParams["modified_date.after"] = modifiedDateAfter.toISOString(); + } + + if (modifiedDateBefore != null) { + _queryParams["modified_date.before"] = modifiedDateBefore.toISOString(); + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-orgs.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevOrgsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets the list of Rev organizations' information belonging to the + * authenticated user's Dev Organization which the user is also authorized + * to access. + * + * @param {DevRev.RevOrgsListRequest} request + * @param {RevOrgs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revOrgs.listPost() + */ + public async listPost( + request: DevRev.RevOrgsListRequest = {}, + requestOptions?: RevOrgs.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-orgs.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevOrgsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevOrgsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates the Rev organization's information. + * + * @param {DevRev.RevOrgsUpdateRequest} request + * @param {RevOrgs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.ConflictError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revOrgs.update({ + * id: "REV-AbCdEfGh" + * }) + */ + public async update( + request: DevRev.RevOrgsUpdateRequest, + requestOptions?: RevOrgs.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-orgs.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevOrgsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevOrgsUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 409: + throw new DevRev.ConflictError( + serializers.ErrorConflict.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/revOrgs/client/index.ts b/src/api/resources/revOrgs/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/revOrgs/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/revOrgs/client/requests/RevOrgsCreateRequest.ts b/src/api/resources/revOrgs/client/requests/RevOrgsCreateRequest.ts new file mode 100644 index 0000000..c756ad4 --- /dev/null +++ b/src/api/resources/revOrgs/client/requests/RevOrgsCreateRequest.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * displayName: "display_name" + * } + */ +export interface RevOrgsCreateRequest { + /** Account Id to associate with this Rev organization. */ + account?: string; + /** + * The IDs of the artifacts to associate with the Rev organization. + * + */ + artifacts?: string[]; + /** Application-defined custom fields. */ + customFields?: Record; + /** + * Schema fragment IDs associated with this Rev organization. + * + */ + customSchemaFragments?: string[]; + /** Description of the Rev organization. */ + description?: string; + /** Name of the Rev organization. */ + displayName: string; + /** Company's domain name. Example - 'devrev.ai'. */ + domain?: string; + environment?: DevRev.OrgEnvironment; + /** + * External ref is a custom unique identifier which is a reference to + * an unique id for this organization's data in some system of + * records. + * + */ + externalRef?: string; + /** Tags associated with the Rev organization. */ + tags?: DevRev.SetTagWithValue[]; + /** The tier of the RevOrg. */ + tier?: string; +} diff --git a/src/api/resources/revOrgs/client/requests/RevOrgsGetQuery.ts b/src/api/resources/revOrgs/client/requests/RevOrgsGetQuery.ts new file mode 100644 index 0000000..aa697c2 --- /dev/null +++ b/src/api/resources/revOrgs/client/requests/RevOrgsGetQuery.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * account: "ACC-12345", + * id: "REV-AbCdEfGh" + * } + */ +export interface RevOrgsGetQuery { + /** + * The ID of account for which default Rev organization is to be + * fetched. + */ + account?: string; + /** + * The ID of the required Rev organization. + */ + id?: string; +} diff --git a/src/api/resources/revOrgs/client/requests/RevOrgsGetRequest.ts b/src/api/resources/revOrgs/client/requests/RevOrgsGetRequest.ts new file mode 100644 index 0000000..91643b2 --- /dev/null +++ b/src/api/resources/revOrgs/client/requests/RevOrgsGetRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface RevOrgsGetRequest { + /** + * The ID of account for which default Rev organization is to be + * fetched. + * + */ + account?: string; + /** The ID of the required Rev organization. */ + id?: string; +} diff --git a/src/api/resources/revOrgs/client/requests/RevOrgsListQuery.ts b/src/api/resources/revOrgs/client/requests/RevOrgsListQuery.ts new file mode 100644 index 0000000..2ef4af0 --- /dev/null +++ b/src/api/resources/revOrgs/client/requests/RevOrgsListQuery.ts @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * } + */ +export interface RevOrgsListQuery { + /** + * Filters by account. + */ + account?: string | string[]; + /** + * Filters by creator. + */ + createdBy?: string | string[]; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + createdDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + createdDateBefore?: Date; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters on custom fields. Input will be of the format + * (custom_field_filter=field_name1:val1,val2,val3&custom_field_filter=field_name2:val1,val2). + */ + customFieldFilter?: string | string[]; + /** + * Filters for custom fields. + */ + customFields?: Record; + /** + * Array of display names of Rev orgs to be filtered. + */ + displayName?: string | string[]; + /** + * List of external refs to filter Rev organizations for. + */ + externalRef?: string | string[]; + /** + * The maximum number of Rev organizations to be retrieved per page. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + modifiedDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + modifiedDateBefore?: Date; + /** + * Fields to sort the Rev organizations by and the direction to sort + * them. + */ + sortBy?: string | string[]; + /** + * List of tags to be filtered. + */ + tags?: string | string[]; +} diff --git a/src/api/resources/revOrgs/client/requests/RevOrgsListRequest.ts b/src/api/resources/revOrgs/client/requests/RevOrgsListRequest.ts new file mode 100644 index 0000000..1affa9a --- /dev/null +++ b/src/api/resources/revOrgs/client/requests/RevOrgsListRequest.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface RevOrgsListRequest { + /** Filters by account. */ + account?: string[]; + /** Filters by creator. */ + createdBy?: string[]; + createdDate?: DevRev.DateTimeFilter; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * Filters on custom fields. Input will be of the format + * (custom_field_filter=field_name1:val1,val2,val3&custom_field_filter=field_name2:val1,val2). + * + */ + customFieldFilter?: string[]; + /** Filters for custom fields. */ + customFields?: Record; + /** Array of display names of Rev orgs to be filtered. */ + displayName?: string[]; + /** List of external refs to filter Rev organizations for. */ + externalRef?: string[]; + /** + * The maximum number of Rev organizations to be retrieved per page. + * + */ + limit?: number; + mode?: DevRev.ListMode; + modifiedDate?: DevRev.DateTimeFilter; + /** + * Fields to sort the Rev organizations by and the direction to sort + * them. + * + */ + sortBy?: string[]; + /** List of tags to be filtered. */ + tags?: string[]; +} diff --git a/src/api/resources/revOrgs/client/requests/RevOrgsUpdateRequest.ts b/src/api/resources/revOrgs/client/requests/RevOrgsUpdateRequest.ts new file mode 100644 index 0000000..50084f0 --- /dev/null +++ b/src/api/resources/revOrgs/client/requests/RevOrgsUpdateRequest.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "REV-AbCdEfGh" + * } + */ +export interface RevOrgsUpdateRequest { + /** New account ID to associate with this Rev organization. */ + account?: string; + artifacts?: DevRev.RevOrgsUpdateRequestArtifacts; + /** + * Schema fragment IDs associated with this Rev organization. + * + */ + customSchemaFragments?: string[]; + /** Description of the Rev organization. */ + description?: string; + /** Customer chosen name for the Rev organization. */ + displayName?: string; + /** Company's domain name. Example - 'devrev.ai'. */ + domain?: string; + environment?: DevRev.OrgEnvironment; + /** + * External ref is a custom unique identifier which is a reference to + * an unique id for this organization's data in some system of + * records. + * + */ + externalRef?: string; + /** The ID of Rev organization to update. */ + id: string; + /** Tags associated with the Rev organization. */ + tags?: DevRev.SetTagWithValue[]; + /** The tier of the RevOrg. */ + tier?: string; +} diff --git a/src/api/resources/revOrgs/client/requests/index.ts b/src/api/resources/revOrgs/client/requests/index.ts new file mode 100644 index 0000000..874f31c --- /dev/null +++ b/src/api/resources/revOrgs/client/requests/index.ts @@ -0,0 +1,6 @@ +export { type RevOrgsCreateRequest } from "./RevOrgsCreateRequest"; +export { type RevOrgsGetQuery } from "./RevOrgsGetQuery"; +export { type RevOrgsGetRequest } from "./RevOrgsGetRequest"; +export { type RevOrgsListQuery } from "./RevOrgsListQuery"; +export { type RevOrgsListRequest } from "./RevOrgsListRequest"; +export { type RevOrgsUpdateRequest } from "./RevOrgsUpdateRequest"; diff --git a/src/api/resources/revOrgs/index.ts b/src/api/resources/revOrgs/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/revOrgs/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/revUsers/client/Client.ts b/src/api/resources/revUsers/client/Client.ts new file mode 100644 index 0000000..e13553f --- /dev/null +++ b/src/api/resources/revUsers/client/Client.ts @@ -0,0 +1,1509 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace RevUsers { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Rev user interactions. + */ +export class RevUsers { + constructor(protected readonly _options: RevUsers.Options = {}) {} + + /** + * Creates a Rev user for a Rev organization. Rev user can be a customer + * or a lead of an organization. + * + * @param {DevRev.RevUsersCreateRequest} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.ConflictError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.create() + */ + public async create( + request: DevRev.RevUsersCreateRequest = {}, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevUsersCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevUsersCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 409: + throw new DevRev.ConflictError( + serializers.ErrorConflict.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes a Rev user. + * + * @param {DevRev.RevUsersDeleteRequest} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.delete({ + * id: "id" + * }) + */ + public async delete( + request: DevRev.RevUsersDeleteRequest, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevUsersDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevUsersDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Returns the Rev user of a Rev organization by its ID. + * + * @param {DevRev.RevUsersGetQuery} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.RevUsersGetQuery, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevUsersGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Returns the Rev user of a Rev organization by its ID. + * + * @param {DevRev.RevUsersGetRequest} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.RevUsersGetRequest, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevUsersGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevUsersGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Links a rev user to a rev org. + * + * @param {DevRev.LinkRevUserToRevOrgRequest} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.linkRevUserToRevOrg() + */ + public async linkRevUserToRevOrg( + request: DevRev.LinkRevUserToRevOrgRequest = {}, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.link" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.LinkRevUserToRevOrgRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.LinkRevUserToRevOrgResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Returns a list of all Rev Users belonging to the authenticated user's + * Dev Organization. + * + * @param {DevRev.RevUsersListQuery} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.list({ + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * }) + */ + public async list( + request: DevRev.RevUsersListQuery = {}, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const { + createdBy, + createdDateAfter, + createdDateBefore, + cursor, + customFields, + email, + externalRef, + isVerified, + limit, + mode, + modifiedDateAfter, + modifiedDateBefore, + phoneNumbers, + revOrg, + sortBy, + tags, + } = request; + const _queryParams: Record = {}; + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (createdDateAfter != null) { + _queryParams["created_date.after"] = createdDateAfter.toISOString(); + } + + if (createdDateBefore != null) { + _queryParams["created_date.before"] = createdDateBefore.toISOString(); + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (customFields != null) { + _queryParams["custom_fields"] = JSON.stringify(customFields); + } + + if (email != null) { + if (Array.isArray(email)) { + _queryParams["email"] = email.map((item) => item); + } else { + _queryParams["email"] = email; + } + } + + if (externalRef != null) { + if (Array.isArray(externalRef)) { + _queryParams["external_ref"] = externalRef.map((item) => item); + } else { + _queryParams["external_ref"] = externalRef; + } + } + + if (isVerified != null) { + _queryParams["is_verified"] = isVerified.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (modifiedDateAfter != null) { + _queryParams["modified_date.after"] = modifiedDateAfter.toISOString(); + } + + if (modifiedDateBefore != null) { + _queryParams["modified_date.before"] = modifiedDateBefore.toISOString(); + } + + if (phoneNumbers != null) { + if (Array.isArray(phoneNumbers)) { + _queryParams["phone_numbers"] = phoneNumbers.map((item) => item); + } else { + _queryParams["phone_numbers"] = phoneNumbers; + } + } + + if (revOrg != null) { + if (Array.isArray(revOrg)) { + _queryParams["rev_org"] = revOrg.map((item) => item); + } else { + _queryParams["rev_org"] = revOrg; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevUsersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Returns a list of all Rev Users belonging to the authenticated user's + * Dev Organization. + * + * @param {DevRev.RevUsersListRequest} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.listPost() + */ + public async listPost( + request: DevRev.RevUsersListRequest = {}, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevUsersListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevUsersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Unlinks a rev user from a rev org. + * + * @param {DevRev.UnlinkRevUserFromRevOrgRequest} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.unlinkRevUserFromRevOrg() + */ + public async unlinkRevUserFromRevOrg( + request: DevRev.UnlinkRevUserFromRevOrgRequest = {}, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.unlink" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.UnlinkRevUserFromRevOrgRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.UnlinkRevUserFromRevOrgResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a Rev user. + * + * @param {DevRev.RevUsersUpdateRequest} request + * @param {RevUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.ConflictError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.revUsers.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.RevUsersUpdateRequest, + requestOptions?: RevUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "rev-users.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.RevUsersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.RevUsersUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 409: + throw new DevRev.ConflictError( + serializers.ErrorConflict.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/revUsers/client/index.ts b/src/api/resources/revUsers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/revUsers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/revUsers/client/requests/LinkRevUserToRevOrgRequest.ts b/src/api/resources/revUsers/client/requests/LinkRevUserToRevOrgRequest.ts new file mode 100644 index 0000000..fa081cf --- /dev/null +++ b/src/api/resources/revUsers/client/requests/LinkRevUserToRevOrgRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface LinkRevUserToRevOrgRequest { + /** The ID of the Rev user. */ + id?: string; + /** The ID of the Rev organization to link the Rev user to. */ + revOrg?: string; + /** + * The don of the rev org to link the rev user to. This is deprecated, + * use rev_org instead. + * + */ + revOrgDon?: string; + /** + * The don of the rev user to link. This is deprecated, use id + * instead. + * + */ + userDon?: string; +} diff --git a/src/api/resources/revUsers/client/requests/RevUsersCreateRequest.ts b/src/api/resources/revUsers/client/requests/RevUsersCreateRequest.ts new file mode 100644 index 0000000..bce84a6 --- /dev/null +++ b/src/api/resources/revUsers/client/requests/RevUsersCreateRequest.ts @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface RevUsersCreateRequest { + /** + * The ID of the account to which the created Rev user is associated. + * + */ + account?: string; + /** The IDs of the artifacts to associate with the Rev user. */ + artifacts?: string[]; + /** Application-defined custom fields. */ + customFields?: Record; + /** The schema fragment IDs associated with the Rev user. */ + customSchemaFragments?: string[]; + /** Description of the Rev user. */ + description?: string; + /** + * The user's display name. The name is non-unique and mutable. + * + */ + displayName?: string; + /** Email address of the Rev user. */ + email?: string; + /** + * External ref is a mutable unique identifier for a user within the + * Dev organization from your primary customer record. If none is + * available, a good alternative is the email address/phone number + * which could uniquely identify the user. If none is specified, a + * system-generated identifier will be assigned to the user. + * + */ + externalRef?: string; + /** Phone numbers, in E.164 format, of the Rev user. */ + phoneNumbers?: string[]; + /** + * The ID of the Rev organization to which the created Rev user is + * associated. + * + */ + revOrg?: string; + /** Tags associated with the Rev user. */ + tags?: DevRev.SetTagWithValue[]; +} diff --git a/src/api/resources/revUsers/client/requests/RevUsersDeleteRequest.ts b/src/api/resources/revUsers/client/requests/RevUsersDeleteRequest.ts new file mode 100644 index 0000000..dca41d2 --- /dev/null +++ b/src/api/resources/revUsers/client/requests/RevUsersDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface RevUsersDeleteRequest { + /** The ID of Rev user to delete. */ + id: string; +} diff --git a/src/api/resources/revUsers/client/requests/RevUsersGetQuery.ts b/src/api/resources/revUsers/client/requests/RevUsersGetQuery.ts new file mode 100644 index 0000000..e76ce89 --- /dev/null +++ b/src/api/resources/revUsers/client/requests/RevUsersGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface RevUsersGetQuery { + /** + * The ID of Rev user to be retrieved. + */ + id: string; +} diff --git a/src/api/resources/revUsers/client/requests/RevUsersGetRequest.ts b/src/api/resources/revUsers/client/requests/RevUsersGetRequest.ts new file mode 100644 index 0000000..249d92f --- /dev/null +++ b/src/api/resources/revUsers/client/requests/RevUsersGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface RevUsersGetRequest { + /** The ID of Rev user to be retrieved. */ + id: string; +} diff --git a/src/api/resources/revUsers/client/requests/RevUsersListQuery.ts b/src/api/resources/revUsers/client/requests/RevUsersListQuery.ts new file mode 100644 index 0000000..ec18a2c --- /dev/null +++ b/src/api/resources/revUsers/client/requests/RevUsersListQuery.ts @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * createdDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * createdDateBefore: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateAfter: new Date("2023-01-01T12:00:00.000Z"), + * modifiedDateBefore: new Date("2023-01-01T12:00:00.000Z") + * } + */ +export interface RevUsersListQuery { + /** + * Filters for Rev users that were created by the specified user(s). + */ + createdBy?: string | string[]; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + createdDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + createdDateBefore?: Date; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters for custom fields. + */ + customFields?: Record; + /** + * List of emails of Rev users to be filtered. + */ + email?: string | string[]; + /** + * List of external refs to filter Rev users for. + */ + externalRef?: string | string[]; + /** + * Value of is_verified field to filter the Rev users. + */ + isVerified?: boolean; + /** + * The maximum number of Rev users to return. The default is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for objects created after the provided timestamp (inclusive). + */ + modifiedDateAfter?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + modifiedDateBefore?: Date; + /** + * List of phone numbers, in E.164 format, to filter Rev users on. + */ + phoneNumbers?: string | string[]; + /** + * List of IDs of Rev organizations to be filtered. + */ + revOrg?: string | string[]; + /** + * Fields to sort the Rev users by and the direction to sort them. + */ + sortBy?: string | string[]; + /** + * List of tags to be filtered. + */ + tags?: string | string[]; +} diff --git a/src/api/resources/revUsers/client/requests/RevUsersListRequest.ts b/src/api/resources/revUsers/client/requests/RevUsersListRequest.ts new file mode 100644 index 0000000..7c4cfe7 --- /dev/null +++ b/src/api/resources/revUsers/client/requests/RevUsersListRequest.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface RevUsersListRequest { + /** + * Filters for Rev users that were created by the specified user(s). + * + */ + createdBy?: string[]; + createdDate?: DevRev.DateTimeFilter; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** Filters for custom fields. */ + customFields?: Record; + /** List of emails of Rev users to be filtered. */ + email?: string[]; + /** List of external refs to filter Rev users for. */ + externalRef?: string[]; + /** Value of is_verified field to filter the Rev users. */ + isVerified?: boolean; + /** + * The maximum number of Rev users to return. The default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + modifiedDate?: DevRev.DateTimeFilter; + /** + * List of phone numbers, in E.164 format, to filter Rev users on. + * + */ + phoneNumbers?: string[]; + /** List of IDs of Rev organizations to be filtered. */ + revOrg?: string[]; + /** + * Fields to sort the Rev users by and the direction to sort them. + * + */ + sortBy?: string[]; + /** List of tags to be filtered. */ + tags?: string[]; +} diff --git a/src/api/resources/revUsers/client/requests/RevUsersUpdateRequest.ts b/src/api/resources/revUsers/client/requests/RevUsersUpdateRequest.ts new file mode 100644 index 0000000..80c4b4c --- /dev/null +++ b/src/api/resources/revUsers/client/requests/RevUsersUpdateRequest.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface RevUsersUpdateRequest { + artifacts?: DevRev.RevUsersUpdateRequestArtifacts; + /** Application-defined custom fields. */ + customFields?: Record; + customSchemaFragments?: DevRev.RevUsersUpdateRequestCustomSchemaFragments; + /** Updated description of the Rev user. */ + description?: string; + /** Updated display name of the Rev user. */ + displayName?: string; + /** Updated email address of the Rev user. */ + email?: string; + /** Updated external ref value of the Rev user. */ + externalRef?: string; + /** The ID of Rev user to update. */ + id: string; + /** The phone numbers, in E.164 format, of the Rev user. */ + phoneNumbers?: string[]; + /** Tags associated with the Rev user. */ + tags?: DevRev.SetTagWithValue[]; +} diff --git a/src/api/resources/revUsers/client/requests/UnlinkRevUserFromRevOrgRequest.ts b/src/api/resources/revUsers/client/requests/UnlinkRevUserFromRevOrgRequest.ts new file mode 100644 index 0000000..594a638 --- /dev/null +++ b/src/api/resources/revUsers/client/requests/UnlinkRevUserFromRevOrgRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface UnlinkRevUserFromRevOrgRequest { + /** The ID of the Rev user. */ + id?: string; + /** + * The ID of the Rev organization to unlink the Rev user from. + * + */ + revOrg?: string; + /** + * The don of the rev org to unlink the rev user from. This is + * deprecated, use rev_org instead. + * + */ + revOrgDon?: string; + /** + * The don of the rev user to unlink. This is deprecated, use id + * instead. + * + */ + userDon?: string; +} diff --git a/src/api/resources/revUsers/client/requests/index.ts b/src/api/resources/revUsers/client/requests/index.ts new file mode 100644 index 0000000..20d2e2c --- /dev/null +++ b/src/api/resources/revUsers/client/requests/index.ts @@ -0,0 +1,9 @@ +export { type RevUsersCreateRequest } from "./RevUsersCreateRequest"; +export { type RevUsersDeleteRequest } from "./RevUsersDeleteRequest"; +export { type RevUsersGetQuery } from "./RevUsersGetQuery"; +export { type RevUsersGetRequest } from "./RevUsersGetRequest"; +export { type LinkRevUserToRevOrgRequest } from "./LinkRevUserToRevOrgRequest"; +export { type RevUsersListQuery } from "./RevUsersListQuery"; +export { type RevUsersListRequest } from "./RevUsersListRequest"; +export { type UnlinkRevUserFromRevOrgRequest } from "./UnlinkRevUserFromRevOrgRequest"; +export { type RevUsersUpdateRequest } from "./RevUsersUpdateRequest"; diff --git a/src/api/resources/revUsers/index.ts b/src/api/resources/revUsers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/revUsers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/schedules/client/Client.ts b/src/api/resources/schedules/client/Client.ts new file mode 100644 index 0000000..f810fc2 --- /dev/null +++ b/src/api/resources/schedules/client/Client.ts @@ -0,0 +1,1972 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Schedules { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Management APIs for availability schedules. + */ +export class Schedules { + constructor(protected readonly _options: Schedules.Options = {}) {} + + /** + * Creates an organization schedule fragment. + * + * @param {DevRev.OrgScheduleFragmentsCreateRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.orgScheduleFragmentsCreate({ + * from: new Date("2023-01-01T12:00:00.000Z"), + * intervals: [{ + * from: new Date("2023-01-01T12:00:00.000Z"), + * name: "name" + * }], + * name: "name", + * to: new Date("2023-01-01T12:00:00.000Z") + * }) + */ + public async orgScheduleFragmentsCreate( + request: DevRev.OrgScheduleFragmentsCreateRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedule-fragments.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgScheduleFragmentsCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgScheduleFragmentsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an organization schedule fragment. + * + * @param {DevRev.OrgScheduleFragmentsGetQuery} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.orgScheduleFragmentsGet({ + * id: "id" + * }) + */ + public async orgScheduleFragmentsGet( + request: DevRev.OrgScheduleFragmentsGetQuery, + requestOptions?: Schedules.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedule-fragments.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgScheduleFragmentsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an organization schedule fragment. + * + * @param {DevRev.OrgScheduleFragmentsGetRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.orgScheduleFragmentsGetPost({ + * id: "id" + * }) + */ + public async orgScheduleFragmentsGetPost( + request: DevRev.OrgScheduleFragmentsGetRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedule-fragments.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgScheduleFragmentsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgScheduleFragmentsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Changes stage of an organization schedule fragment. + * + * @param {DevRev.OrgScheduleFragmentsTransitionRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.orgScheduleFragmentsTransition({ + * id: "id", + * status: DevRev.OrgScheduleFragmentStatus.Archived + * }) + */ + public async orgScheduleFragmentsTransition( + request: DevRev.OrgScheduleFragmentsTransitionRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedule-fragments.transition" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgScheduleFragmentsTransitionRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgScheduleFragmentsTransitionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Creates an organization schedule with a default weekly organization + * schedule and a list of organization schedule fragments. + * + * @param {DevRev.OrgSchedulesCreateRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.create({ + * name: "name", + * timezone: "timezone" + * }) + */ + public async create( + request: DevRev.OrgSchedulesCreateRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgSchedulesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an organization schedule. + * + * @param {DevRev.OrgSchedulesGetQuery} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.OrgSchedulesGetQuery, + requestOptions?: Schedules.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an organization schedule. + * + * @param {DevRev.OrgSchedulesGetRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.OrgSchedulesGetRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgSchedulesGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets list of organization schedules. + * + * @param {DevRev.OrgSchedulesListQuery} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.list() + */ + public async list( + request: DevRev.OrgSchedulesListQuery = {}, + requestOptions?: Schedules.RequestOptions + ): Promise { + const { createdById, cursor, limit, mode, status } = request; + const _queryParams: Record = {}; + if (createdById != null) { + if (Array.isArray(createdById)) { + _queryParams["created_by_id"] = createdById.map((item) => item); + } else { + _queryParams["created_by_id"] = createdById; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (status != null) { + if (Array.isArray(status)) { + _queryParams["status"] = status.map((item) => item); + } else { + _queryParams["status"] = status; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets list of organization schedules. + * + * @param {DevRev.OrgSchedulesListRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.listPost() + */ + public async listPost( + request: DevRev.OrgSchedulesListRequest = {}, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgSchedulesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Sets next organization schedule fragment which must begin the day the + * last existing fragment ends. + * + * @param {DevRev.OrgSchedulesSetFutureRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.setFuture({ + * id: "id", + * orgScheduleFragmentId: "org_schedule_fragment_id" + * }) + */ + public async setFuture( + request: DevRev.OrgSchedulesSetFutureRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.set-future" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgSchedulesSetFutureRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesSetFutureResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Publishes or archives an organization schedule. + * + * @param {DevRev.OrgSchedulesTransitionRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.transition({ + * id: "id", + * status: DevRev.OrgScheduleStatus.Archived + * }) + */ + public async transition( + request: DevRev.OrgSchedulesTransitionRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.transition" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgSchedulesTransitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesTransitionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates an organization schedule. + * + * @param {DevRev.OrgSchedulesUpdateRequest} request + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.schedules.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.OrgSchedulesUpdateRequest, + requestOptions?: Schedules.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "org-schedules.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.OrgSchedulesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.OrgSchedulesUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.schedules.fragmentsCreate() + */ + public async fragmentsCreate(requestOptions?: Schedules.RequestOptions): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "fragments.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.schedules.fragmentsGet() + */ + public async fragmentsGet(requestOptions?: Schedules.RequestOptions): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "fragments.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.schedules.fragmentsGetPost() + */ + public async fragmentsGetPost(requestOptions?: Schedules.RequestOptions): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "fragments.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * @param {Schedules.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.schedules.fragmentsTransition() + */ + public async fragmentsTransition(requestOptions?: Schedules.RequestOptions): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "fragments.transition" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/schedules/client/index.ts b/src/api/resources/schedules/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/schedules/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/schedules/client/requests/OrgScheduleFragmentsCreateRequest.ts b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsCreateRequest.ts new file mode 100644 index 0000000..f1a21e3 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsCreateRequest.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * from: new Date("2023-01-01T12:00:00.000Z"), + * intervals: [{ + * from: new Date("2023-01-01T12:00:00.000Z"), + * name: "name" + * }], + * name: "name", + * to: new Date("2023-01-01T12:00:00.000Z") + * } + */ +export interface OrgScheduleFragmentsCreateRequest { + /** + * Date (inclusive) on which the organization schedule fragment + * begins. + * + */ + from: Date; + /** The intervals that comprise the schedule fragment. */ + intervals: DevRev.CreateOrgScheduleInterval[]; + /** Name of the organization schedule fragment. */ + name: string; + /** + * CLDR region code of the countries/regions it is meant to be valid + * for. Does not drive logic, serves only for easier filtering and + * organization. + * + */ + regionCodes?: string[]; + /** + * Date (exclusive) on which the organization schedule fragment's + * validity ends. + * + */ + to: Date; +} diff --git a/src/api/resources/schedules/client/requests/OrgScheduleFragmentsGetQuery.ts b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsGetQuery.ts new file mode 100644 index 0000000..8df5100 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface OrgScheduleFragmentsGetQuery { + /** + * Organization schedule Fragment ID. + */ + id: string; +} diff --git a/src/api/resources/schedules/client/requests/OrgScheduleFragmentsGetRequest.ts b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsGetRequest.ts new file mode 100644 index 0000000..5ff9528 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface OrgScheduleFragmentsGetRequest { + /** Organization schedule Fragment ID. */ + id: string; +} diff --git a/src/api/resources/schedules/client/requests/OrgScheduleFragmentsTransitionRequest.ts b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsTransitionRequest.ts new file mode 100644 index 0000000..97bcba2 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgScheduleFragmentsTransitionRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id", + * status: DevRev.OrgScheduleFragmentStatus.Archived + * } + */ +export interface OrgScheduleFragmentsTransitionRequest { + /** Organization schedule Fragment ID. */ + id: string; + status: DevRev.OrgScheduleFragmentStatus; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesCreateRequest.ts b/src/api/resources/schedules/client/requests/OrgSchedulesCreateRequest.ts new file mode 100644 index 0000000..21c4a93 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesCreateRequest.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * name: "name", + * timezone: "timezone" + * } + */ +export interface OrgSchedulesCreateRequest { + defaultWeeklyOrgSchedule?: DevRev.SetWeeklyOrgSchedule; + /** + * Organization schedule must be valid for at least this many days in + * the future. Meaning organization schedule fragments must cover this + * period. 0 if omitted. + * + */ + minValidDays?: number; + /** Human-readable name. */ + name: string; + /** + * List of organization schedule fragments with no overlaps or gaps. + * + */ + orgScheduleFragments?: DevRev.SetOrgScheduleFragmentSummary[]; + /** + * Timezone in which the organization schedule applies. Expected to be + * a valid IANA time zone name such as America/New_York. + * + */ + timezone: string; + /** + * If this day belongs to a named period according to the currently + * active organization schedule fragment, a weekly organization + * schedule from this list with the corresponding name will apply. + * + */ + weeklyOrgSchedules?: DevRev.SetWeeklyOrgSchedule[]; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesGetQuery.ts b/src/api/resources/schedules/client/requests/OrgSchedulesGetQuery.ts new file mode 100644 index 0000000..96dec59 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface OrgSchedulesGetQuery { + /** + * Organization schedule ID. + */ + id: string; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesGetRequest.ts b/src/api/resources/schedules/client/requests/OrgSchedulesGetRequest.ts new file mode 100644 index 0000000..49e519e --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface OrgSchedulesGetRequest { + /** Organization schedule ID. */ + id: string; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesListQuery.ts b/src/api/resources/schedules/client/requests/OrgSchedulesListQuery.ts new file mode 100644 index 0000000..ad3c18b --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesListQuery.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface OrgSchedulesListQuery { + /** + * Creator ID the filter matches. + */ + createdById?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Max number of organization schedules returned in a page. Default is 50. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * The organization schedule statuses the filter matches. + */ + status?: DevRev.OrgScheduleStatus | DevRev.OrgScheduleStatus[]; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesListRequest.ts b/src/api/resources/schedules/client/requests/OrgSchedulesListRequest.ts new file mode 100644 index 0000000..b4aee3b --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesListRequest.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface OrgSchedulesListRequest { + /** Creator ID the filter matches. */ + createdById?: string[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * Max number of organization schedules returned in a page. Default is + * 50. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** The organization schedule statuses the filter matches. */ + status?: DevRev.OrgScheduleStatus[]; + validUntil?: DevRev.DateFilter; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesSetFutureRequest.ts b/src/api/resources/schedules/client/requests/OrgSchedulesSetFutureRequest.ts new file mode 100644 index 0000000..3cb1fec --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesSetFutureRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id", + * orgScheduleFragmentId: "org_schedule_fragment_id" + * } + */ +export interface OrgSchedulesSetFutureRequest { + /** Organization schedule ID. */ + id: string; + /** Organization schedule Fragment ID. */ + orgScheduleFragmentId: string; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesTransitionRequest.ts b/src/api/resources/schedules/client/requests/OrgSchedulesTransitionRequest.ts new file mode 100644 index 0000000..1b52e17 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesTransitionRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id", + * status: DevRev.OrgScheduleStatus.Archived + * } + */ +export interface OrgSchedulesTransitionRequest { + /** Organization schedule ID. */ + id: string; + status: DevRev.OrgScheduleStatus; +} diff --git a/src/api/resources/schedules/client/requests/OrgSchedulesUpdateRequest.ts b/src/api/resources/schedules/client/requests/OrgSchedulesUpdateRequest.ts new file mode 100644 index 0000000..91f9975 --- /dev/null +++ b/src/api/resources/schedules/client/requests/OrgSchedulesUpdateRequest.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface OrgSchedulesUpdateRequest { + defaultWeeklyOrgSchedule?: DevRev.SetWeeklyOrgSchedule; + /** Organization schedule ID. */ + id: string; + /** + * Organization schedule must be valid for at least this many days in + * the future. Meaning organization schedule fragments must cover this + * period. 0 if omitted. + * + */ + minValidDays?: number; + /** Human-readable name. */ + name?: string; + /** + * List of organization schedule fragments with no overlaps or gaps. + * + */ + orgScheduleFragments?: DevRev.SetOrgScheduleFragmentSummary[]; + /** + * Timezone in which the organization schedule applies. Expected to be + * a valid IANA time zone name such as America/New_York. + * + */ + timezone?: string; + /** + * If this day belongs to a named period according to the currently + * active organization schedule fragment, a weekly organization + * schedule from this list with the corresponding name will apply. + * + */ + weeklyOrgSchedules?: DevRev.SetWeeklyOrgSchedule[]; +} diff --git a/src/api/resources/schedules/client/requests/index.ts b/src/api/resources/schedules/client/requests/index.ts new file mode 100644 index 0000000..308a8b4 --- /dev/null +++ b/src/api/resources/schedules/client/requests/index.ts @@ -0,0 +1,12 @@ +export { type OrgScheduleFragmentsCreateRequest } from "./OrgScheduleFragmentsCreateRequest"; +export { type OrgScheduleFragmentsGetQuery } from "./OrgScheduleFragmentsGetQuery"; +export { type OrgScheduleFragmentsGetRequest } from "./OrgScheduleFragmentsGetRequest"; +export { type OrgScheduleFragmentsTransitionRequest } from "./OrgScheduleFragmentsTransitionRequest"; +export { type OrgSchedulesCreateRequest } from "./OrgSchedulesCreateRequest"; +export { type OrgSchedulesGetQuery } from "./OrgSchedulesGetQuery"; +export { type OrgSchedulesGetRequest } from "./OrgSchedulesGetRequest"; +export { type OrgSchedulesListQuery } from "./OrgSchedulesListQuery"; +export { type OrgSchedulesListRequest } from "./OrgSchedulesListRequest"; +export { type OrgSchedulesSetFutureRequest } from "./OrgSchedulesSetFutureRequest"; +export { type OrgSchedulesTransitionRequest } from "./OrgSchedulesTransitionRequest"; +export { type OrgSchedulesUpdateRequest } from "./OrgSchedulesUpdateRequest"; diff --git a/src/api/resources/schedules/index.ts b/src/api/resources/schedules/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/schedules/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/search/client/Client.ts b/src/api/resources/search/client/Client.ts new file mode 100644 index 0000000..b1885b1 --- /dev/null +++ b/src/api/resources/search/client/Client.ts @@ -0,0 +1,638 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace Search { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev search. + */ +export class Search { + constructor(protected readonly _options: Search.Options = {}) {} + + /** + * Searches for records based on a given query. + * + * @param {DevRev.SearchCoreQuery} request + * @param {Search.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.search.core({ + * query: "query" + * }) + */ + public async core( + request: DevRev.SearchCoreQuery, + requestOptions?: Search.RequestOptions + ): Promise { + const { query, cursor, limit, namespaces, sortBy, sortOrder } = request; + const _queryParams: Record = {}; + _queryParams["query"] = query; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (namespaces != null) { + if (Array.isArray(namespaces)) { + _queryParams["namespaces"] = namespaces.map((item) => item); + } else { + _queryParams["namespaces"] = namespaces; + } + } + + if (sortBy != null) { + _queryParams["sort_by"] = sortBy; + } + + if (sortOrder != null) { + _queryParams["sort_order"] = sortOrder; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "search.core" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SearchCoreResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Searches for records based on a given query. + * + * @param {DevRev.SearchCoreRequest} request + * @param {Search.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.search.corePost({ + * query: "query" + * }) + */ + public async corePost( + request: DevRev.SearchCoreRequest, + requestOptions?: Search.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "search.core" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SearchCoreRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SearchCoreResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Performs search, using a combination of syntactic and semantic search. + * + * @param {DevRev.SearchHybridQuery} request + * @param {Search.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.search.hybrid({ + * namespace: DevRev.SearchHybridNamespace.Article, + * query: "query" + * }) + */ + public async hybrid( + request: DevRev.SearchHybridQuery, + requestOptions?: Search.RequestOptions + ): Promise { + const { namespace, query, limit, semanticWeight } = request; + const _queryParams: Record = {}; + _queryParams["namespace"] = namespace; + _queryParams["query"] = query; + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (semanticWeight != null) { + _queryParams["semantic_weight"] = semanticWeight.toString(); + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "search.hybrid" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SearchHybridResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Performs search, using a combination of syntactic and semantic search. + * + * @param {DevRev.SearchHybridRequest} request + * @param {Search.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.search.hybridPost({ + * namespace: DevRev.SearchHybridNamespace.Article, + * query: "query" + * }) + */ + public async hybridPost( + request: DevRev.SearchHybridRequest, + requestOptions?: Search.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "search.hybrid" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SearchHybridRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SearchHybridResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/search/client/index.ts b/src/api/resources/search/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/search/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/search/client/requests/SearchCoreQuery.ts b/src/api/resources/search/client/requests/SearchCoreQuery.ts new file mode 100644 index 0000000..66b9289 --- /dev/null +++ b/src/api/resources/search/client/requests/SearchCoreQuery.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * query: "query" + * } + */ +export interface SearchCoreQuery { + /** + * The query string. Search query language: + * https://docs.devrev.ai/product/search#fields + */ + query: string; + /** + * The cursor from where to begin iteration. Start from beginning if not + * provided. + */ + cursor?: string; + /** + * The maximum number of items to return in a page. The default is '10'. + */ + limit?: number; + /** + * The namespaces to search in. + */ + namespaces?: DevRev.SearchNamespace | DevRev.SearchNamespace[]; + /** + * The property on which to sort the search results. The default is + * RELEVANCE. + */ + sortBy?: DevRev.SearchSortByParam; + /** + * Sorting order. The default is DESCENDING. + */ + sortOrder?: DevRev.SearchSortOrderParam; +} diff --git a/src/api/resources/search/client/requests/SearchCoreRequest.ts b/src/api/resources/search/client/requests/SearchCoreRequest.ts new file mode 100644 index 0000000..8d8ac48 --- /dev/null +++ b/src/api/resources/search/client/requests/SearchCoreRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * query: "query" + * } + */ +export interface SearchCoreRequest { + /** + * The cursor from where to begin iteration. Start from beginning if + * not provided. + * + */ + cursor?: string; + /** + * The maximum number of items to return in a page. The default is + * '10'. + * + */ + limit?: number; + /** The namespaces to search in. */ + namespaces?: DevRev.SearchNamespace[]; + /** + * The query string. Search query language: + * https://docs.devrev.ai/product/search#fields + * + */ + query: string; + sortBy?: DevRev.SearchSortByParam; + sortOrder?: DevRev.SearchSortOrderParam; +} diff --git a/src/api/resources/search/client/requests/SearchHybridQuery.ts b/src/api/resources/search/client/requests/SearchHybridQuery.ts new file mode 100644 index 0000000..21aea1d --- /dev/null +++ b/src/api/resources/search/client/requests/SearchHybridQuery.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * namespace: DevRev.SearchHybridNamespace.Article, + * query: "query" + * } + */ +export interface SearchHybridQuery { + /** + * The hybrid namespace to search in. + */ + namespace: DevRev.SearchHybridNamespace; + /** + * The query string. + */ + query: string; + /** + * The maximum number of items to return in a page. The default is '10'. + */ + limit?: number; + /** + * The weightage for semantic search. Values between 0 and 1 are + * accepted. + */ + semanticWeight?: number; +} diff --git a/src/api/resources/search/client/requests/SearchHybridRequest.ts b/src/api/resources/search/client/requests/SearchHybridRequest.ts new file mode 100644 index 0000000..9fc37ea --- /dev/null +++ b/src/api/resources/search/client/requests/SearchHybridRequest.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * namespace: DevRev.SearchHybridNamespace.Article, + * query: "query" + * } + */ +export interface SearchHybridRequest { + /** + * The maximum number of items to return in a page. The default is + * '10'. + * + */ + limit?: number; + namespace: DevRev.SearchHybridNamespace; + /** The query string. */ + query: string; + /** + * The weightage for semantic search. Values between 0 and 1 are + * accepted. + * + */ + semanticWeight?: number; +} diff --git a/src/api/resources/search/client/requests/index.ts b/src/api/resources/search/client/requests/index.ts new file mode 100644 index 0000000..66e3a78 --- /dev/null +++ b/src/api/resources/search/client/requests/index.ts @@ -0,0 +1,4 @@ +export { type SearchCoreQuery } from "./SearchCoreQuery"; +export { type SearchCoreRequest } from "./SearchCoreRequest"; +export { type SearchHybridQuery } from "./SearchHybridQuery"; +export { type SearchHybridRequest } from "./SearchHybridRequest"; diff --git a/src/api/resources/search/index.ts b/src/api/resources/search/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/search/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/serviceAccounts/client/Client.ts b/src/api/resources/serviceAccounts/client/Client.ts new file mode 100644 index 0000000..9f499af --- /dev/null +++ b/src/api/resources/serviceAccounts/client/Client.ts @@ -0,0 +1,346 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace ServiceAccounts { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Service account interactions + */ +export class ServiceAccounts { + constructor(protected readonly _options: ServiceAccounts.Options = {}) {} + + /** + * Gets a service account. + * + * @param {DevRev.ServiceAccountsGetQuery} request + * @param {ServiceAccounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.serviceAccounts.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.ServiceAccountsGetQuery, + requestOptions?: ServiceAccounts.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "service-accounts.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ServiceAccountsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a service account. + * + * @param {DevRev.ServiceAccountsGetRequest} request + * @param {ServiceAccounts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.serviceAccounts.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.ServiceAccountsGetRequest, + requestOptions?: ServiceAccounts.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "service-accounts.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ServiceAccountsGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ServiceAccountsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/serviceAccounts/client/index.ts b/src/api/resources/serviceAccounts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/serviceAccounts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/serviceAccounts/client/requests/ServiceAccountsGetQuery.ts b/src/api/resources/serviceAccounts/client/requests/ServiceAccountsGetQuery.ts new file mode 100644 index 0000000..38c2edc --- /dev/null +++ b/src/api/resources/serviceAccounts/client/requests/ServiceAccountsGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface ServiceAccountsGetQuery { + /** + * The ID of the requested service account. + */ + id: string; +} diff --git a/src/api/resources/serviceAccounts/client/requests/ServiceAccountsGetRequest.ts b/src/api/resources/serviceAccounts/client/requests/ServiceAccountsGetRequest.ts new file mode 100644 index 0000000..92a6d46 --- /dev/null +++ b/src/api/resources/serviceAccounts/client/requests/ServiceAccountsGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface ServiceAccountsGetRequest { + /** The ID of the requested service account. */ + id: string; +} diff --git a/src/api/resources/serviceAccounts/client/requests/index.ts b/src/api/resources/serviceAccounts/client/requests/index.ts new file mode 100644 index 0000000..552e2aa --- /dev/null +++ b/src/api/resources/serviceAccounts/client/requests/index.ts @@ -0,0 +1,2 @@ +export { type ServiceAccountsGetQuery } from "./ServiceAccountsGetQuery"; +export { type ServiceAccountsGetRequest } from "./ServiceAccountsGetRequest"; diff --git a/src/api/resources/serviceAccounts/index.ts b/src/api/resources/serviceAccounts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/serviceAccounts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/slas/client/Client.ts b/src/api/resources/slas/client/Client.ts new file mode 100644 index 0000000..3c95d71 --- /dev/null +++ b/src/api/resources/slas/client/Client.ts @@ -0,0 +1,1560 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace Slas { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Management APIs for Service Level Agreements. + */ +export class Slas { + constructor(protected readonly _options: Slas.Options = {}) {} + + /** + * Lists metric definitions matching a filter. + * + * @param {DevRev.MetricDefinitionsListQuery} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.metricDefinitionsList() + */ + public async metricDefinitionsList( + request: DevRev.MetricDefinitionsListQuery = {}, + requestOptions?: Slas.RequestOptions + ): Promise { + const { appliesToType, cursor, includeCustomMetrics, limit, mode, status, type: type_ } = request; + const _queryParams: Record = {}; + if (appliesToType != null) { + if (Array.isArray(appliesToType)) { + _queryParams["applies_to_type"] = appliesToType.map((item) => item); + } else { + _queryParams["applies_to_type"] = appliesToType; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (includeCustomMetrics != null) { + _queryParams["include_custom_metrics"] = includeCustomMetrics.toString(); + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (status != null) { + if (Array.isArray(status)) { + _queryParams["status"] = status.map((item) => item); + } else { + _queryParams["status"] = status; + } + } + + if (type_ != null) { + if (Array.isArray(type_)) { + _queryParams["type"] = type_.map((item) => item); + } else { + _queryParams["type"] = type_; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "metric-definitions.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.MetricDefinitionsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists metric definitions matching a filter. + * + * @param {DevRev.MetricDefinitionsListRequest} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.metricDefinitionsListPost() + */ + public async metricDefinitionsListPost( + request: DevRev.MetricDefinitionsListRequest = {}, + requestOptions?: Slas.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "metric-definitions.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.MetricDefinitionsListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.MetricDefinitionsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Assigns the SLA to a set of Rev organizations. + * + * @param {DevRev.SlasAssignRequest} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.assign({ + * revOrgs: ["REV-AbCdEfGh"] + * }) + */ + public async assign( + request: DevRev.SlasAssignRequest, + requestOptions?: Slas.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.assign" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SlasAssignRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasAssignResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Creates an SLA in draft status. + * + * @param {DevRev.SlasCreateRequest} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.create({ + * name: "name" + * }) + */ + public async create( + request: DevRev.SlasCreateRequest, + requestOptions?: Slas.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SlasCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an SLA. + * + * @param {DevRev.SlasGetQuery} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.get({ + * id: "id" + * }) + */ + public async get( + request: DevRev.SlasGetQuery, + requestOptions?: Slas.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets an SLA. + * + * @param {DevRev.SlasGetRequest} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.getPost({ + * id: "id" + * }) + */ + public async getPost( + request: DevRev.SlasGetRequest, + requestOptions?: Slas.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SlasGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists SLAs matching a filter. + * + * @param {DevRev.SlasListQuery} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.list() + */ + public async list( + request: DevRev.SlasListQuery = {}, + requestOptions?: Slas.RequestOptions + ): Promise { + const { appliesTo, appliesToOp, cursor, limit, mode, slaType, status } = request; + const _queryParams: Record = {}; + if (appliesTo != null) { + if (Array.isArray(appliesTo)) { + _queryParams["applies_to"] = appliesTo.map((item) => item); + } else { + _queryParams["applies_to"] = appliesTo; + } + } + + if (appliesToOp != null) { + _queryParams["applies_to_op"] = appliesToOp; + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (slaType != null) { + if (Array.isArray(slaType)) { + _queryParams["sla_type"] = slaType.map((item) => item); + } else { + _queryParams["sla_type"] = slaType; + } + } + + if (status != null) { + if (Array.isArray(status)) { + _queryParams["status"] = status.map((item) => item); + } else { + _queryParams["status"] = status; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists SLAs matching a filter. + * + * @param {DevRev.SlasListRequest} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.listPost() + */ + public async listPost( + request: DevRev.SlasListRequest = {}, + requestOptions?: Slas.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SlasListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Changes the status of an SLA. + * + * @param {DevRev.SlasTransitionRequest} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.transition({ + * id: "id", + * status: DevRev.SlaStatus.Archived + * }) + */ + public async transition( + request: DevRev.SlasTransitionRequest, + requestOptions?: Slas.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.transition" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SlasTransitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasTransitionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a draft SLA. + * + * @param {DevRev.SlasUpdateRequest} request + * @param {Slas.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.slas.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.SlasUpdateRequest, + requestOptions?: Slas.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "slas.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SlasUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SlasUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/slas/client/index.ts b/src/api/resources/slas/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/slas/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/slas/client/requests/MetricDefinitionsListQuery.ts b/src/api/resources/slas/client/requests/MetricDefinitionsListQuery.ts new file mode 100644 index 0000000..9df89f3 --- /dev/null +++ b/src/api/resources/slas/client/requests/MetricDefinitionsListQuery.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface MetricDefinitionsListQuery { + /** + * The type of objects the metric definition applies to. + */ + appliesToType?: DevRev.MetricDefinitionAppliesTo | DevRev.MetricDefinitionAppliesTo[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Whether to include custom metrics in the response. If not set, then + * custom metrics are excluded. + */ + includeCustomMetrics?: boolean; + /** + * The maximum number of records to return. The default is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * The status of the metric definition. + */ + status?: DevRev.MetricDefinitionStatus | DevRev.MetricDefinitionStatus[]; + /** + * The type of metric definitions sought. + */ + type?: DevRev.MetricDefinitionMetricType | DevRev.MetricDefinitionMetricType[]; +} diff --git a/src/api/resources/slas/client/requests/MetricDefinitionsListRequest.ts b/src/api/resources/slas/client/requests/MetricDefinitionsListRequest.ts new file mode 100644 index 0000000..89bf76d --- /dev/null +++ b/src/api/resources/slas/client/requests/MetricDefinitionsListRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface MetricDefinitionsListRequest { + /** The type of metric definitions sought. */ + type?: DevRev.MetricDefinitionMetricType[]; + /** The type of objects the metric definition applies to. */ + appliesToType?: DevRev.MetricDefinitionAppliesTo[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * Whether to include custom metrics in the response. If not set, then + * custom metrics are excluded. + * + */ + includeCustomMetrics?: boolean; + /** + * The maximum number of records to return. The default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** The status of the metric definition. */ + status?: DevRev.MetricDefinitionStatus[]; +} diff --git a/src/api/resources/slas/client/requests/SlasAssignRequest.ts b/src/api/resources/slas/client/requests/SlasAssignRequest.ts new file mode 100644 index 0000000..2dedeef --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasAssignRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * revOrgs: ["REV-AbCdEfGh"] + * } + */ +export interface SlasAssignRequest { + /** + * The SLA which would be assigned to the Rev organizations. If + * omitted, the SLA of all the rev organizations referenced will be + * unset. + * + */ + id?: string; + /** The Rev organizations to apply the SLA to. */ + revOrgs: string[]; +} diff --git a/src/api/resources/slas/client/requests/SlasCreateRequest.ts b/src/api/resources/slas/client/requests/SlasCreateRequest.ts new file mode 100644 index 0000000..44f3e8b --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasCreateRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * name: "name" + * } + */ +export interface SlasCreateRequest { + accountSelector?: DevRev.AccountsFilters; + /** The object types this SLA can apply to. */ + appliesTo?: DevRev.SlaAppliesTo[]; + /** Description of the purpose and capabilities of the SLA. */ + description?: string; + evaluationPeriod?: DevRev.SlaEvaluationPeriod; + /** Human-readable name. */ + name: string; + /** + * The policies encompassed by this SLA, ordered in decreasing + * priority. + * + */ + policies?: DevRev.SetSlaPolicy[]; + slaType?: DevRev.SlaType; +} diff --git a/src/api/resources/slas/client/requests/SlasGetQuery.ts b/src/api/resources/slas/client/requests/SlasGetQuery.ts new file mode 100644 index 0000000..d8c6b16 --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface SlasGetQuery { + /** + * The ID of the SLA to get. + */ + id: string; +} diff --git a/src/api/resources/slas/client/requests/SlasGetRequest.ts b/src/api/resources/slas/client/requests/SlasGetRequest.ts new file mode 100644 index 0000000..04fcc39 --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface SlasGetRequest { + /** The ID of the SLA to get. */ + id: string; +} diff --git a/src/api/resources/slas/client/requests/SlasListQuery.ts b/src/api/resources/slas/client/requests/SlasListQuery.ts new file mode 100644 index 0000000..b4fee39 --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasListQuery.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SlasListQuery { + /** + * The object types the SLA applies to. + */ + appliesTo?: DevRev.SlaAppliesTo | DevRev.SlaAppliesTo[]; + /** + * The Filter operator to be applied on the applies to object types + * filter. + */ + appliesToOp?: DevRev.SlasFilterAppliesToOperatorType; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of SLAs to return. The default is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * The SLA types the filter matches. + */ + slaType?: DevRev.SlaType | DevRev.SlaType[]; + /** + * The SLA statuses the filter matches. + */ + status?: DevRev.SlaStatus | DevRev.SlaStatus[]; +} diff --git a/src/api/resources/slas/client/requests/SlasListRequest.ts b/src/api/resources/slas/client/requests/SlasListRequest.ts new file mode 100644 index 0000000..efd596c --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasListRequest.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SlasListRequest { + /** The object types the SLA applies to. */ + appliesTo?: DevRev.SlaAppliesTo[]; + appliesToOp?: DevRev.SlasFilterAppliesToOperatorType; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of SLAs to return. The default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** The SLA types the filter matches. */ + slaType?: DevRev.SlaType[]; + /** The SLA statuses the filter matches. */ + status?: DevRev.SlaStatus[]; +} diff --git a/src/api/resources/slas/client/requests/SlasTransitionRequest.ts b/src/api/resources/slas/client/requests/SlasTransitionRequest.ts new file mode 100644 index 0000000..e878952 --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasTransitionRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id", + * status: DevRev.SlaStatus.Archived + * } + */ +export interface SlasTransitionRequest { + /** The updated SLA. */ + id: string; + status: DevRev.SlaStatus; +} diff --git a/src/api/resources/slas/client/requests/SlasUpdateRequest.ts b/src/api/resources/slas/client/requests/SlasUpdateRequest.ts new file mode 100644 index 0000000..625c87e --- /dev/null +++ b/src/api/resources/slas/client/requests/SlasUpdateRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface SlasUpdateRequest { + accountSelector?: DevRev.AccountsFilters; + /** Description of the purpose and capabilities of the SLA. */ + description?: string; + evaluationPeriod?: DevRev.SlaEvaluationPeriod; + /** The SLA's ID. */ + id: string; + /** Human-readable name. */ + name?: string; + /** + * The policies encompassed by this SLA, ordered in decreasing + * priority, the whole array will be overwritten by the contents of + * this array. + * + */ + policies?: DevRev.SetSlaPolicy[]; +} diff --git a/src/api/resources/slas/client/requests/index.ts b/src/api/resources/slas/client/requests/index.ts new file mode 100644 index 0000000..081ba2c --- /dev/null +++ b/src/api/resources/slas/client/requests/index.ts @@ -0,0 +1,10 @@ +export { type MetricDefinitionsListQuery } from "./MetricDefinitionsListQuery"; +export { type MetricDefinitionsListRequest } from "./MetricDefinitionsListRequest"; +export { type SlasAssignRequest } from "./SlasAssignRequest"; +export { type SlasCreateRequest } from "./SlasCreateRequest"; +export { type SlasGetQuery } from "./SlasGetQuery"; +export { type SlasGetRequest } from "./SlasGetRequest"; +export { type SlasListQuery } from "./SlasListQuery"; +export { type SlasListRequest } from "./SlasListRequest"; +export { type SlasTransitionRequest } from "./SlasTransitionRequest"; +export { type SlasUpdateRequest } from "./SlasUpdateRequest"; diff --git a/src/api/resources/slas/index.ts b/src/api/resources/slas/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/slas/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/snapIns/client/Client.ts b/src/api/resources/snapIns/client/Client.ts new file mode 100644 index 0000000..0665fda --- /dev/null +++ b/src/api/resources/snapIns/client/Client.ts @@ -0,0 +1,327 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace SnapIns { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev snap-ins interactions. + */ +export class SnapIns { + constructor(protected readonly _options: SnapIns.Options = {}) {} + + /** + * Gets snap-in resources for a user in a snap-in. + * + * @param {DevRev.SnapInsResourcesQuery} request + * @param {SnapIns.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.snapIns.resources({ + * id: "id", + * user: "user" + * }) + */ + public async resources( + request: DevRev.SnapInsResourcesQuery, + requestOptions?: SnapIns.RequestOptions + ): Promise { + const { id, user } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + _queryParams["user"] = user; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "snap-ins.resources" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SnapInsResourcesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets snap-in resources for a user in a snap-in. + * + * @param {DevRev.SnapInsResourcesRequest} request + * @param {SnapIns.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.snapIns.resourcesPost({ + * id: "id", + * user: "user" + * }) + */ + public async resourcesPost( + request: DevRev.SnapInsResourcesRequest, + requestOptions?: SnapIns.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "snap-ins.resources" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SnapInsResourcesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SnapInsResourcesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/snapIns/client/index.ts b/src/api/resources/snapIns/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/snapIns/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/snapIns/client/requests/SnapInsResourcesQuery.ts b/src/api/resources/snapIns/client/requests/SnapInsResourcesQuery.ts new file mode 100644 index 0000000..d7c6cd4 --- /dev/null +++ b/src/api/resources/snapIns/client/requests/SnapInsResourcesQuery.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id", + * user: "user" + * } + */ +export interface SnapInsResourcesQuery { + /** + * The ID of the snap-in to get resources for. + */ + id: string; + /** + * The ID of the user to get resources for. + */ + user: string; +} diff --git a/src/api/resources/snapIns/client/requests/SnapInsResourcesRequest.ts b/src/api/resources/snapIns/client/requests/SnapInsResourcesRequest.ts new file mode 100644 index 0000000..8d2e32f --- /dev/null +++ b/src/api/resources/snapIns/client/requests/SnapInsResourcesRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id", + * user: "user" + * } + */ +export interface SnapInsResourcesRequest { + /** The ID of the snap-in to get resources for. */ + id: string; + /** The ID of the user to get resources for. */ + user: string; +} diff --git a/src/api/resources/snapIns/client/requests/index.ts b/src/api/resources/snapIns/client/requests/index.ts new file mode 100644 index 0000000..3f0443e --- /dev/null +++ b/src/api/resources/snapIns/client/requests/index.ts @@ -0,0 +1,2 @@ +export { type SnapInsResourcesQuery } from "./SnapInsResourcesQuery"; +export { type SnapInsResourcesRequest } from "./SnapInsResourcesRequest"; diff --git a/src/api/resources/snapIns/index.ts b/src/api/resources/snapIns/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/snapIns/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/snapWidgets/client/Client.ts b/src/api/resources/snapWidgets/client/Client.ts new file mode 100644 index 0000000..71a76f1 --- /dev/null +++ b/src/api/resources/snapWidgets/client/Client.ts @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace SnapWidgets { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * SnapWidget APIs + */ +export class SnapWidgets { + constructor(protected readonly _options: SnapWidgets.Options = {}) {} + + /** + * Create a snap widget object. + * + * @param {DevRev.SnapWidgetsCreateRequest} request + * @param {SnapWidgets.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.snapWidgets.create({ + * type: "email_preview", + * name: "string", + * namespace: DevRev.SnapWidgetNamespace.CommentSuggestionReplies, + * status: DevRev.SnapWidgetStatus.Draft, + * bcc: [{ + * address: "string", + * name: "string", + * user: "string" + * }], + * cc: [{ + * address: "string", + * name: "string", + * user: "string" + * }], + * from: [{ + * address: "string", + * name: "string", + * user: "string" + * }], + * htmlBody: "string", + * inReplyTo: "string", + * inlines: [{ + * artifact: "string", + * contentId: "string" + * }], + * isSpam: true, + * messageId: "string", + * rawEmailArtifact: "string", + * references: ["string"], + * replyTo: [{ + * address: "string", + * name: "string", + * user: "string" + * }], + * sentTimestamp: new Date("2024-01-15T09:30:00.000Z"), + * subject: "string", + * textBody: "string", + * to: [{ + * address: "string", + * name: "string", + * user: "string" + * }] + * }) + */ + public async create( + request: DevRev.SnapWidgetsCreateRequest, + requestOptions?: SnapWidgets.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "snap-widgets.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SnapWidgetsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SnapWidgetsCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/snapWidgets/client/index.ts b/src/api/resources/snapWidgets/client/index.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/api/resources/snapWidgets/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/snapWidgets/index.ts b/src/api/resources/snapWidgets/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/snapWidgets/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/surveys/client/Client.ts b/src/api/resources/surveys/client/Client.ts new file mode 100644 index 0000000..7f14997 --- /dev/null +++ b/src/api/resources/surveys/client/Client.ts @@ -0,0 +1,1259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Surveys { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * Surveys + */ +export class Surveys { + constructor(protected readonly _options: Surveys.Options = {}) {} + + /** + * Creates a schema for survey, which includes name and description of + * schema. + * + * @param {DevRev.SurveysCreateRequest} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.create({ + * name: "name" + * }) + */ + public async create( + request: DevRev.SurveysCreateRequest, + requestOptions?: Surveys.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SurveysCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes the specified survey. + * + * @param {DevRev.SurveysDeleteRequest} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.delete({ + * id: "id" + * }) + */ + public async delete( + request: DevRev.SurveysDeleteRequest, + requestOptions?: Surveys.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SurveysDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * List surveys requested by the user. + * + * @param {DevRev.SurveysListQuery} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.list() + */ + public async list( + request: DevRev.SurveysListQuery = {}, + requestOptions?: Surveys.RequestOptions + ): Promise { + const { createdBy, cursor, limit, mode, name, sortBy } = request; + const _queryParams: Record = {}; + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (name != null) { + if (Array.isArray(name)) { + _queryParams["name"] = name.map((item) => item); + } else { + _queryParams["name"] = name; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * List surveys requested by the user. + * + * @param {DevRev.SurveysListRequest} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.listPost() + */ + public async listPost( + request: DevRev.SurveysListRequest = {}, + requestOptions?: Surveys.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SurveysListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * List survey responses requested by the user. + * + * @param {DevRev.SurveysResponsesListQuery} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.responsesList() + */ + public async responsesList( + request: DevRev.SurveysResponsesListQuery = {}, + requestOptions?: Surveys.RequestOptions + ): Promise { + const { createdBy, cursor, limit, mode, objects, recipient, sortBy, stages, surveys } = request; + const _queryParams: Record = {}; + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (objects != null) { + if (Array.isArray(objects)) { + _queryParams["objects"] = objects.map((item) => item); + } else { + _queryParams["objects"] = objects; + } + } + + if (recipient != null) { + if (Array.isArray(recipient)) { + _queryParams["recipient"] = recipient.map((item) => item); + } else { + _queryParams["recipient"] = recipient; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (stages != null) { + if (Array.isArray(stages)) { + _queryParams["stages"] = stages.map((item) => item.toString()); + } else { + _queryParams["stages"] = stages.toString(); + } + } + + if (surveys != null) { + if (Array.isArray(surveys)) { + _queryParams["surveys"] = surveys.map((item) => item); + } else { + _queryParams["surveys"] = surveys; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.responses.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysResponsesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * List survey responses requested by the user. + * + * @param {DevRev.SurveysResponsesListRequest} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.responsesListPost() + */ + public async responsesListPost( + request: DevRev.SurveysResponsesListRequest = {}, + requestOptions?: Surveys.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.responses.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SurveysResponsesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysResponsesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Sends a survey on the specified channels. + * + * @param {DevRev.SurveysSendRequest} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.send({ + * email: { + * body: "body", + * recipients: ["recipients"], + * sender: "sender", + * subject: "subject" + * } + * }) + */ + public async send( + request: DevRev.SurveysSendRequest, + requestOptions?: Surveys.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.send" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SurveysSendRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysSendResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Submits a user response to a survey, which is defined by the survey ID. + * + * @param {DevRev.SurveysSubmitRequest} request + * @param {Surveys.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.surveys.submit({ + * object: "ACC-12345", + * survey: "survey" + * }) + */ + public async submit( + request: DevRev.SurveysSubmitRequest, + requestOptions?: Surveys.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "surveys.submit" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SurveysSubmitRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SurveysSubmitResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/surveys/client/index.ts b/src/api/resources/surveys/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/surveys/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/surveys/client/requests/SurveysCreateRequest.ts b/src/api/resources/surveys/client/requests/SurveysCreateRequest.ts new file mode 100644 index 0000000..d2497a3 --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysCreateRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * name: "name" + * } + */ +export interface SurveysCreateRequest { + /** Description about the survey. */ + description?: string; + /** + * Text posted when introducing the survey to the responder. + * + */ + introductoryText?: string; + /** The survey's name. */ + name: string; + /** Text posted after the response is collected. */ + responseText?: string; + /** Schema for the survey. */ + schema?: DevRev.FieldDescriptor[]; + /** The schema with metadata for the survey. */ + schemaWithMetadata?: DevRev.SurveyFieldWithMetadata[]; +} diff --git a/src/api/resources/surveys/client/requests/SurveysDeleteRequest.ts b/src/api/resources/surveys/client/requests/SurveysDeleteRequest.ts new file mode 100644 index 0000000..001da4e --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface SurveysDeleteRequest { + /** ID of the survey being deleted. */ + id: string; +} diff --git a/src/api/resources/surveys/client/requests/SurveysListQuery.ts b/src/api/resources/surveys/client/requests/SurveysListQuery.ts new file mode 100644 index 0000000..87d60ba --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysListQuery.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SurveysListQuery { + /** + * Filters for surveys created by any of these users. + */ + createdBy?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of surveys to return. If not set, then the default + * is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for surveys by name(s). + */ + name?: string | string[]; + /** + * Fields to sort the surveys by and the direction to sort them. + */ + sortBy?: string | string[]; +} diff --git a/src/api/resources/surveys/client/requests/SurveysListRequest.ts b/src/api/resources/surveys/client/requests/SurveysListRequest.ts new file mode 100644 index 0000000..a3836de --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysListRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SurveysListRequest { + /** Filters for surveys created by any of these users. */ + createdBy?: string[]; + createdDate?: DevRev.DateFilter; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of surveys to return. If not set, then the + * default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + modifiedDate?: DevRev.DateFilter; + /** Filters for surveys by name(s). */ + name?: string[]; + /** + * Fields to sort the surveys by and the direction to sort them. + * + */ + sortBy?: string[]; +} diff --git a/src/api/resources/surveys/client/requests/SurveysResponsesListQuery.ts b/src/api/resources/surveys/client/requests/SurveysResponsesListQuery.ts new file mode 100644 index 0000000..f163079 --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysResponsesListQuery.ts @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SurveysResponsesListQuery { + /** + * Filters for survey responses created by any of these users. + */ + createdBy?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of survey responses to return. If not set, then + * the default is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for survey responses created for the objects. + */ + objects?: string | string[]; + /** + * Filters for survey responses dispatched to any of these users. + */ + recipient?: string | string[]; + /** + * Fields to sort the survey responses by and the direction to sort + * them. + */ + sortBy?: string | string[]; + /** + * Filters for survey response stages. + */ + stages?: number | number[]; + /** + * Filters for survey responses for the provided survey IDs. + */ + surveys?: string | string[]; +} diff --git a/src/api/resources/surveys/client/requests/SurveysResponsesListRequest.ts b/src/api/resources/surveys/client/requests/SurveysResponsesListRequest.ts new file mode 100644 index 0000000..ab8a590 --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysResponsesListRequest.ts @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SurveysResponsesListRequest { + /** + * Filters for survey responses created by any of these users. + * + */ + createdBy?: string[]; + createdDate?: DevRev.DateFilter; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of survey responses to return. If not set, then + * the default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + modifiedDate?: DevRev.DateFilter; + /** Filters for survey responses created for the objects. */ + objects?: string[]; + /** + * Filters for survey responses dispatched to any of these users. + * + */ + recipient?: string[]; + /** + * Fields to sort the survey responses by and the direction to sort + * them. + * + */ + sortBy?: string[]; + /** Filters for survey response stages. */ + stages?: number[]; + /** + * Filters for survey responses for the provided survey IDs. + * + */ + surveys?: string[]; +} diff --git a/src/api/resources/surveys/client/requests/SurveysSendRequest.ts b/src/api/resources/surveys/client/requests/SurveysSendRequest.ts new file mode 100644 index 0000000..2012b8a --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysSendRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * email: { + * body: "body", + * recipients: ["recipients"], + * sender: "sender", + * subject: "subject" + * } + * } + */ +export interface SurveysSendRequest { + email: DevRev.SurveysSendRequestEmail; +} diff --git a/src/api/resources/surveys/client/requests/SurveysSubmitRequest.ts b/src/api/resources/surveys/client/requests/SurveysSubmitRequest.ts new file mode 100644 index 0000000..e5ec3b8 --- /dev/null +++ b/src/api/resources/surveys/client/requests/SurveysSubmitRequest.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * object: "ACC-12345", + * survey: "survey" + * } + */ +export interface SurveysSubmitRequest { + /** The unique ID associated with the dispatched survey. */ + dispatchId?: string; + /** + * The ordinals of the source channels on which the survey is sent. + * + */ + dispatchedChannels?: number[]; + /** + * The ID of the object this survey is on (e.g. ticket, conversation, + * etc). + * + */ + object: string; + /** + * The unique ID associated with the recipient of the survey. + * + */ + recipient?: string; + /** Survey response submitted for the object. */ + response?: Record; + /** + * The response score for the survey. Only applicable for CSAT and + * NPS. + * + */ + responseScore?: number; + /** + * The source channel from which survey response is submitted. + * + */ + sourceChannel?: string; + /** The stage ordinal of the survey response object. */ + stage?: number; + /** The ID of the survey to submit the response to. */ + survey: string; +} diff --git a/src/api/resources/surveys/client/requests/index.ts b/src/api/resources/surveys/client/requests/index.ts new file mode 100644 index 0000000..e18b338 --- /dev/null +++ b/src/api/resources/surveys/client/requests/index.ts @@ -0,0 +1,8 @@ +export { type SurveysCreateRequest } from "./SurveysCreateRequest"; +export { type SurveysDeleteRequest } from "./SurveysDeleteRequest"; +export { type SurveysListQuery } from "./SurveysListQuery"; +export { type SurveysListRequest } from "./SurveysListRequest"; +export { type SurveysResponsesListQuery } from "./SurveysResponsesListQuery"; +export { type SurveysResponsesListRequest } from "./SurveysResponsesListRequest"; +export { type SurveysSendRequest } from "./SurveysSendRequest"; +export { type SurveysSubmitRequest } from "./SurveysSubmitRequest"; diff --git a/src/api/resources/surveys/index.ts b/src/api/resources/surveys/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/surveys/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/sysUsers/client/Client.ts b/src/api/resources/sysUsers/client/Client.ts new file mode 100644 index 0000000..0157dc4 --- /dev/null +++ b/src/api/resources/sysUsers/client/Client.ts @@ -0,0 +1,488 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace SysUsers { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * System user interactions + */ +export class SysUsers { + constructor(protected readonly _options: SysUsers.Options = {}) {} + + /** + * Lists system users within your organization. + * + * @param {DevRev.SysUsersListQuery} request + * @param {SysUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.sysUsers.list() + */ + public async list( + request: DevRev.SysUsersListQuery = {}, + requestOptions?: SysUsers.RequestOptions + ): Promise { + const { cursor, limit, mode, sortBy } = request; + const _queryParams: Record = {}; + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "sys-users.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SysUsersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists system users within your organization. + * + * @param {DevRev.SysUsersListRequest} request + * @param {SysUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.sysUsers.listPost() + */ + public async listPost( + request: DevRev.SysUsersListRequest = {}, + requestOptions?: SysUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "sys-users.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SysUsersListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SysUsersListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates the system user. + * + * @param {DevRev.SysUsersUpdateRequest} request + * @param {SysUsers.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.sysUsers.update({ + * id: "id" + * }) + */ + public async update( + request: DevRev.SysUsersUpdateRequest, + requestOptions?: SysUsers.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "sys-users.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SysUsersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SysUsersUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/sysUsers/client/index.ts b/src/api/resources/sysUsers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/sysUsers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/sysUsers/client/requests/SysUsersListQuery.ts b/src/api/resources/sysUsers/client/requests/SysUsersListQuery.ts new file mode 100644 index 0000000..853250d --- /dev/null +++ b/src/api/resources/sysUsers/client/requests/SysUsersListQuery.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SysUsersListQuery { + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * The maximum number of system users to return. Value can range from + * '1' to '100', with a default of '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Fields to sort the system users by and the direction to sort them. + */ + sortBy?: string | string[]; +} diff --git a/src/api/resources/sysUsers/client/requests/SysUsersListRequest.ts b/src/api/resources/sysUsers/client/requests/SysUsersListRequest.ts new file mode 100644 index 0000000..767dce6 --- /dev/null +++ b/src/api/resources/sysUsers/client/requests/SysUsersListRequest.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface SysUsersListRequest { + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * The maximum number of system users to return. Value can range from + * '1' to '100', with a default of '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** + * Fields to sort the system users by and the direction to sort them. + * + */ + sortBy?: string[]; +} diff --git a/src/api/resources/sysUsers/client/requests/SysUsersUpdateRequest.ts b/src/api/resources/sysUsers/client/requests/SysUsersUpdateRequest.ts new file mode 100644 index 0000000..a172a03 --- /dev/null +++ b/src/api/resources/sysUsers/client/requests/SysUsersUpdateRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "id" + * } + */ +export interface SysUsersUpdateRequest { + /** Updated display name for the system user. */ + displayName?: string; + /** Artifact ID of the system user's new display picture. */ + displayPicture?: string; + /** Updated full name for the system user. */ + fullName?: string; + /** The ID of system user to update. */ + id: string; +} diff --git a/src/api/resources/sysUsers/client/requests/index.ts b/src/api/resources/sysUsers/client/requests/index.ts new file mode 100644 index 0000000..b67301a --- /dev/null +++ b/src/api/resources/sysUsers/client/requests/index.ts @@ -0,0 +1,3 @@ +export { type SysUsersListQuery } from "./SysUsersListQuery"; +export { type SysUsersListRequest } from "./SysUsersListRequest"; +export { type SysUsersUpdateRequest } from "./SysUsersUpdateRequest"; diff --git a/src/api/resources/sysUsers/index.ts b/src/api/resources/sysUsers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/sysUsers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/timelineEntries/client/Client.ts b/src/api/resources/timelineEntries/client/Client.ts new file mode 100644 index 0000000..7ba5857 --- /dev/null +++ b/src/api/resources/timelineEntries/client/Client.ts @@ -0,0 +1,677 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace TimelineEntries { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * APIs to manage timeline entries for objects. + */ +export class TimelineEntries { + constructor(protected readonly _options: TimelineEntries.Options = {}) {} + + /** + * Creates a new entry on an object's timeline. + * + * @param {DevRev.TimelineEntriesCreateRequest} request + * @param {TimelineEntries.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.timelineEntries.create({ + * type: "timeline_comment", + * collections: [DevRev.TimelineEntriesCollection.Discussions], + * expiresAt: new Date("2024-01-15T09:30:00.000Z"), + * labels: ["string"], + * object: "string", + * privateTo: ["string"], + * visibility: DevRev.TimelineEntryVisibility.External, + * artifacts: ["string"], + * body: "string", + * bodyType: DevRev.TimelineCommentBodyType.SnapKit, + * externalRef: "string", + * linkPreviews: ["string"], + * snapKitBody: {}, + * snapWidgetBody: ["string"] + * }) + */ + public async create( + request: DevRev.TimelineEntriesCreateRequest, + requestOptions?: TimelineEntries.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "timeline-entries.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.TimelineEntriesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.TimelineEntriesCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the timeline entries for an object. + * + * @param {DevRev.TimelineEntriesListQuery} request + * @param {TimelineEntries.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.timelineEntries.list({ + * object: "PROD-12345" + * }) + */ + public async list( + request: DevRev.TimelineEntriesListQuery, + requestOptions?: TimelineEntries.RequestOptions + ): Promise { + const { object, collections, cursor, labels, limit, mode, visibility } = request; + const _queryParams: Record = {}; + _queryParams["object"] = object; + if (collections != null) { + if (Array.isArray(collections)) { + _queryParams["collections"] = collections.map((item) => item); + } else { + _queryParams["collections"] = collections; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (labels != null) { + if (Array.isArray(labels)) { + _queryParams["labels"] = labels.map((item) => item); + } else { + _queryParams["labels"] = labels; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (visibility != null) { + if (Array.isArray(visibility)) { + _queryParams["visibility"] = visibility.map((item) => item); + } else { + _queryParams["visibility"] = visibility; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "timeline-entries.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.TimelineEntriesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists the timeline entries for an object. + * + * @param {DevRev.TimelineEntriesListRequest} request + * @param {TimelineEntries.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.timelineEntries.listPost({ + * object: "PROD-12345" + * }) + */ + public async listPost( + request: DevRev.TimelineEntriesListRequest, + requestOptions?: TimelineEntries.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "timeline-entries.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.TimelineEntriesListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.TimelineEntriesListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates an entry on an object's timeline. + * + * @param {DevRev.TimelineEntriesUpdateRequest} request + * @param {TimelineEntries.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.timelineEntries.update({ + * type: "timeline_comment", + * id: "string", + * artifacts: {}, + * body: "string", + * bodyType: DevRev.TimelineCommentBodyType.SnapKit, + * linkPreviews: {}, + * snapKitBody: {} + * }) + */ + public async update( + request: DevRev.TimelineEntriesUpdateRequest, + requestOptions?: TimelineEntries.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "timeline-entries.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.TimelineEntriesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.TimelineEntriesUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/timelineEntries/client/index.ts b/src/api/resources/timelineEntries/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/timelineEntries/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/timelineEntries/client/requests/TimelineEntriesListQuery.ts b/src/api/resources/timelineEntries/client/requests/TimelineEntriesListQuery.ts new file mode 100644 index 0000000..d0f0aea --- /dev/null +++ b/src/api/resources/timelineEntries/client/requests/TimelineEntriesListQuery.ts @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * object: "PROD-12345" + * } + */ +export interface TimelineEntriesListQuery { + /** + * The ID of the object to list timeline entries for. + */ + object: string; + /** + * The collection(s) to list entries from, otherwise if not provided, + * all entries are returned. + */ + collections?: DevRev.TimelineEntriesCollection | DevRev.TimelineEntriesCollection[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters for entries containing at least one of the provided labels, + * otherwise if no labels are provided, then no label filtering is done. + */ + labels?: string | string[]; + /** + * The maximum number of entries to return. If not set, then this + * defaults to `50`. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * The visibility of the timeline entries to filter for. Note this is a + * strict filter, such that only entries with the exact visibilities + * specified will be returned. + */ + visibility?: DevRev.TimelineEntryVisibility | DevRev.TimelineEntryVisibility[]; +} diff --git a/src/api/resources/timelineEntries/client/requests/TimelineEntriesListRequest.ts b/src/api/resources/timelineEntries/client/requests/TimelineEntriesListRequest.ts new file mode 100644 index 0000000..6d45251 --- /dev/null +++ b/src/api/resources/timelineEntries/client/requests/TimelineEntriesListRequest.ts @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * { + * object: "PROD-12345" + * } + */ +export interface TimelineEntriesListRequest { + /** + * The collection(s) to list entries from, otherwise if not provided, + * all entries are returned. + * + */ + collections?: DevRev.TimelineEntriesCollection[]; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** + * Filters for entries containing at least one of the provided labels, + * otherwise if no labels are provided, then no label filtering is + * done. + * + */ + labels?: string[]; + /** + * The maximum number of entries to return. If not set, then this + * defaults to `50`. + * + */ + limit?: number; + mode?: DevRev.ListMode; + /** The ID of the object to list timeline entries for. */ + object: string; + /** + * The visibility of the timeline entries to filter for. Note this is + * a strict filter, such that only entries with the exact visibilities + * specified will be returned. + * + */ + visibility?: DevRev.TimelineEntryVisibility[]; +} diff --git a/src/api/resources/timelineEntries/client/requests/index.ts b/src/api/resources/timelineEntries/client/requests/index.ts new file mode 100644 index 0000000..de635fc --- /dev/null +++ b/src/api/resources/timelineEntries/client/requests/index.ts @@ -0,0 +1,2 @@ +export { type TimelineEntriesListQuery } from "./TimelineEntriesListQuery"; +export { type TimelineEntriesListRequest } from "./TimelineEntriesListRequest"; diff --git a/src/api/resources/timelineEntries/index.ts b/src/api/resources/timelineEntries/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/timelineEntries/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/works/client/Client.ts b/src/api/resources/works/client/Client.ts new file mode 100644 index 0000000..b0e74d0 --- /dev/null +++ b/src/api/resources/works/client/Client.ts @@ -0,0 +1,2008 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as DevRev from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace Works { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + } +} + +/** + * DevRev work interactions. + */ +export class Works { + constructor(protected readonly _options: Works.Options = {}) {} + + /** + * Creates new work ([issue](https://devrev.ai/docs/product/build), + * [ticket](https://devrev.ai/docs/product/support)) item. + * [task](https://docs.devrev.ai/product/tasks) and opportunity work types + * are supported in the beta version. + * + * @param {DevRev.WorksCreateRequest} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.create({ + * type: "issue", + * appliesToPart: "string", + * artifacts: ["string"], + * body: "string", + * customFields: { + * "string": { + * "key": "value" + * } + * }, + * customSchemaFragments: ["string"], + * customSchemaSpec: { + * apps: ["string"], + * subtype: "string", + * tenantFragment: true, + * validateRequiredFields: true + * }, + * ownedBy: ["string"], + * reportedBy: ["string"], + * stage: { + * id: "string", + * name: "string" + * }, + * stageValidationOptions: ["allow_non_start"], + * tags: [{ + * id: "string", + * value: "string" + * }], + * targetCloseDate: new Date("2024-01-15T09:30:00.000Z"), + * title: "string", + * developedWith: ["string"], + * priority: DevRev.IssuePriority.P0, + * priorityV2: 1, + * sprint: "string", + * targetStartDate: new Date("2024-01-15T09:30:00.000Z") + * }) + */ + public async create( + request: DevRev.WorksCreateRequest, + requestOptions?: Works.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.create" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.WorksCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksCreateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deletes a work item. + * + * @param {DevRev.WorksDeleteRequest} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.delete({ + * id: "ISS-12345" + * }) + */ + public async delete( + request: DevRev.WorksDeleteRequest, + requestOptions?: Works.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.delete" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.WorksDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Exports a collection of work items. + * + * @param {DevRev.WorksExportQuery} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.export() + */ + public async export( + request: DevRev.WorksExportQuery = {}, + requestOptions?: Works.RequestOptions + ): Promise { + const { + appliesToPart, + createdBy, + customFields, + first, + issueAccounts, + issuePriority, + issuePriorityV2, + issueRevOrgs, + issueSlaSummaryStage, + issueSprint, + issueSubtype, + opportunityAccount, + opportunityContacts, + opportunitySubtype, + ownedBy, + reportedBy, + sortBy, + stageName, + stagedInfoIsStaged, + syncMetadataLastSyncInStatus, + syncMetadataLastSyncInSyncUnit, + syncMetadataLastSyncOutStatus, + syncMetadataLastSyncOutSyncUnit, + syncMetadataOriginSystem, + tags, + ticketChannels, + ticketGroup, + ticketIsSpam, + ticketNeedsResponse, + ticketRevOrg, + ticketSeverity, + ticketSlaSummaryStage, + ticketSourceChannel, + ticketSubtype, + type: type_, + } = request; + const _queryParams: Record = {}; + if (appliesToPart != null) { + if (Array.isArray(appliesToPart)) { + _queryParams["applies_to_part"] = appliesToPart.map((item) => item); + } else { + _queryParams["applies_to_part"] = appliesToPart; + } + } + + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (customFields != null) { + _queryParams["custom_fields"] = JSON.stringify(customFields); + } + + if (first != null) { + _queryParams["first"] = first.toString(); + } + + if (issueAccounts != null) { + if (Array.isArray(issueAccounts)) { + _queryParams["issue.accounts"] = issueAccounts.map((item) => item); + } else { + _queryParams["issue.accounts"] = issueAccounts; + } + } + + if (issuePriority != null) { + if (Array.isArray(issuePriority)) { + _queryParams["issue.priority"] = issuePriority.map((item) => item); + } else { + _queryParams["issue.priority"] = issuePriority; + } + } + + if (issuePriorityV2 != null) { + if (Array.isArray(issuePriorityV2)) { + _queryParams["issue.priority_v2"] = issuePriorityV2.map((item) => item.toString()); + } else { + _queryParams["issue.priority_v2"] = issuePriorityV2.toString(); + } + } + + if (issueRevOrgs != null) { + if (Array.isArray(issueRevOrgs)) { + _queryParams["issue.rev_orgs"] = issueRevOrgs.map((item) => item); + } else { + _queryParams["issue.rev_orgs"] = issueRevOrgs; + } + } + + if (issueSlaSummaryStage != null) { + if (Array.isArray(issueSlaSummaryStage)) { + _queryParams["issue.sla_summary.stage"] = issueSlaSummaryStage.map((item) => item); + } else { + _queryParams["issue.sla_summary.stage"] = issueSlaSummaryStage; + } + } + + if (issueSprint != null) { + if (Array.isArray(issueSprint)) { + _queryParams["issue.sprint"] = issueSprint.map((item) => item); + } else { + _queryParams["issue.sprint"] = issueSprint; + } + } + + if (issueSubtype != null) { + if (Array.isArray(issueSubtype)) { + _queryParams["issue.subtype"] = issueSubtype.map((item) => item); + } else { + _queryParams["issue.subtype"] = issueSubtype; + } + } + + if (opportunityAccount != null) { + if (Array.isArray(opportunityAccount)) { + _queryParams["opportunity.account"] = opportunityAccount.map((item) => item); + } else { + _queryParams["opportunity.account"] = opportunityAccount; + } + } + + if (opportunityContacts != null) { + if (Array.isArray(opportunityContacts)) { + _queryParams["opportunity.contacts"] = opportunityContacts.map((item) => item); + } else { + _queryParams["opportunity.contacts"] = opportunityContacts; + } + } + + if (opportunitySubtype != null) { + if (Array.isArray(opportunitySubtype)) { + _queryParams["opportunity.subtype"] = opportunitySubtype.map((item) => item); + } else { + _queryParams["opportunity.subtype"] = opportunitySubtype; + } + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (reportedBy != null) { + if (Array.isArray(reportedBy)) { + _queryParams["reported_by"] = reportedBy.map((item) => item); + } else { + _queryParams["reported_by"] = reportedBy; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (stageName != null) { + if (Array.isArray(stageName)) { + _queryParams["stage.name"] = stageName.map((item) => item); + } else { + _queryParams["stage.name"] = stageName; + } + } + + if (stagedInfoIsStaged != null) { + _queryParams["staged_info.is_staged"] = stagedInfoIsStaged.toString(); + } + + if (syncMetadataLastSyncInStatus != null) { + if (Array.isArray(syncMetadataLastSyncInStatus)) { + _queryParams["sync_metadata.last_sync_in.status"] = syncMetadataLastSyncInStatus.map((item) => item); + } else { + _queryParams["sync_metadata.last_sync_in.status"] = syncMetadataLastSyncInStatus; + } + } + + if (syncMetadataLastSyncInSyncUnit != null) { + if (Array.isArray(syncMetadataLastSyncInSyncUnit)) { + _queryParams["sync_metadata.last_sync_in.sync_unit"] = syncMetadataLastSyncInSyncUnit.map( + (item) => item + ); + } else { + _queryParams["sync_metadata.last_sync_in.sync_unit"] = syncMetadataLastSyncInSyncUnit; + } + } + + if (syncMetadataLastSyncOutStatus != null) { + if (Array.isArray(syncMetadataLastSyncOutStatus)) { + _queryParams["sync_metadata.last_sync_out.status"] = syncMetadataLastSyncOutStatus.map((item) => item); + } else { + _queryParams["sync_metadata.last_sync_out.status"] = syncMetadataLastSyncOutStatus; + } + } + + if (syncMetadataLastSyncOutSyncUnit != null) { + if (Array.isArray(syncMetadataLastSyncOutSyncUnit)) { + _queryParams["sync_metadata.last_sync_out.sync_unit"] = syncMetadataLastSyncOutSyncUnit.map( + (item) => item + ); + } else { + _queryParams["sync_metadata.last_sync_out.sync_unit"] = syncMetadataLastSyncOutSyncUnit; + } + } + + if (syncMetadataOriginSystem != null) { + if (Array.isArray(syncMetadataOriginSystem)) { + _queryParams["sync_metadata.origin_system"] = syncMetadataOriginSystem.map((item) => item); + } else { + _queryParams["sync_metadata.origin_system"] = syncMetadataOriginSystem; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + if (ticketChannels != null) { + if (Array.isArray(ticketChannels)) { + _queryParams["ticket.channels"] = ticketChannels.map((item) => item); + } else { + _queryParams["ticket.channels"] = ticketChannels; + } + } + + if (ticketGroup != null) { + if (Array.isArray(ticketGroup)) { + _queryParams["ticket.group"] = ticketGroup.map((item) => item); + } else { + _queryParams["ticket.group"] = ticketGroup; + } + } + + if (ticketIsSpam != null) { + _queryParams["ticket.is_spam"] = ticketIsSpam.toString(); + } + + if (ticketNeedsResponse != null) { + _queryParams["ticket.needs_response"] = ticketNeedsResponse.toString(); + } + + if (ticketRevOrg != null) { + if (Array.isArray(ticketRevOrg)) { + _queryParams["ticket.rev_org"] = ticketRevOrg.map((item) => item); + } else { + _queryParams["ticket.rev_org"] = ticketRevOrg; + } + } + + if (ticketSeverity != null) { + if (Array.isArray(ticketSeverity)) { + _queryParams["ticket.severity"] = ticketSeverity.map((item) => item); + } else { + _queryParams["ticket.severity"] = ticketSeverity; + } + } + + if (ticketSlaSummaryStage != null) { + if (Array.isArray(ticketSlaSummaryStage)) { + _queryParams["ticket.sla_summary.stage"] = ticketSlaSummaryStage.map((item) => item); + } else { + _queryParams["ticket.sla_summary.stage"] = ticketSlaSummaryStage; + } + } + + if (ticketSourceChannel != null) { + if (Array.isArray(ticketSourceChannel)) { + _queryParams["ticket.source_channel"] = ticketSourceChannel.map((item) => item); + } else { + _queryParams["ticket.source_channel"] = ticketSourceChannel; + } + } + + if (ticketSubtype != null) { + if (Array.isArray(ticketSubtype)) { + _queryParams["ticket.subtype"] = ticketSubtype.map((item) => item); + } else { + _queryParams["ticket.subtype"] = ticketSubtype; + } + } + + if (type_ != null) { + if (Array.isArray(type_)) { + _queryParams["type"] = type_.map((item) => item); + } else { + _queryParams["type"] = type_; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.export" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksExportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Exports a collection of work items. + * + * @param {DevRev.WorksExportRequest} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.exportPost() + */ + public async exportPost( + request: DevRev.WorksExportRequest = {}, + requestOptions?: Works.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.export" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.WorksExportRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksExportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a work item's information. + * + * @param {DevRev.WorksGetQuery} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.get({ + * id: "string" + * }) + */ + public async get( + request: DevRev.WorksGetQuery, + requestOptions?: Works.RequestOptions + ): Promise { + const { id } = request; + const _queryParams: Record = {}; + _queryParams["id"] = id; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.get" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Gets a work item's information. + * + * @param {DevRev.WorksGetRequest} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.getPost({ + * id: "string" + * }) + */ + public async getPost( + request: DevRev.WorksGetRequest, + requestOptions?: Works.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.get" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.WorksGetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of work items. + * + * @param {DevRev.WorksListQuery} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.list() + */ + public async list( + request: DevRev.WorksListQuery = {}, + requestOptions?: Works.RequestOptions + ): Promise { + const { + appliesToPart, + createdBy, + cursor, + customFields, + issueAccounts, + issuePriority, + issuePriorityV2, + issueRevOrgs, + issueSlaSummaryStage, + issueSprint, + issueSubtype, + limit, + mode, + opportunityAccount, + opportunityContacts, + opportunitySubtype, + ownedBy, + reportedBy, + sortBy, + stageName, + stagedInfoIsStaged, + syncMetadataLastSyncInStatus, + syncMetadataLastSyncInSyncUnit, + syncMetadataLastSyncOutStatus, + syncMetadataLastSyncOutSyncUnit, + syncMetadataOriginSystem, + tags, + ticketChannels, + ticketGroup, + ticketIsSpam, + ticketNeedsResponse, + ticketRevOrg, + ticketSeverity, + ticketSlaSummaryStage, + ticketSourceChannel, + ticketSubtype, + type: type_, + } = request; + const _queryParams: Record = {}; + if (appliesToPart != null) { + if (Array.isArray(appliesToPart)) { + _queryParams["applies_to_part"] = appliesToPart.map((item) => item); + } else { + _queryParams["applies_to_part"] = appliesToPart; + } + } + + if (createdBy != null) { + if (Array.isArray(createdBy)) { + _queryParams["created_by"] = createdBy.map((item) => item); + } else { + _queryParams["created_by"] = createdBy; + } + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (customFields != null) { + _queryParams["custom_fields"] = JSON.stringify(customFields); + } + + if (issueAccounts != null) { + if (Array.isArray(issueAccounts)) { + _queryParams["issue.accounts"] = issueAccounts.map((item) => item); + } else { + _queryParams["issue.accounts"] = issueAccounts; + } + } + + if (issuePriority != null) { + if (Array.isArray(issuePriority)) { + _queryParams["issue.priority"] = issuePriority.map((item) => item); + } else { + _queryParams["issue.priority"] = issuePriority; + } + } + + if (issuePriorityV2 != null) { + if (Array.isArray(issuePriorityV2)) { + _queryParams["issue.priority_v2"] = issuePriorityV2.map((item) => item.toString()); + } else { + _queryParams["issue.priority_v2"] = issuePriorityV2.toString(); + } + } + + if (issueRevOrgs != null) { + if (Array.isArray(issueRevOrgs)) { + _queryParams["issue.rev_orgs"] = issueRevOrgs.map((item) => item); + } else { + _queryParams["issue.rev_orgs"] = issueRevOrgs; + } + } + + if (issueSlaSummaryStage != null) { + if (Array.isArray(issueSlaSummaryStage)) { + _queryParams["issue.sla_summary.stage"] = issueSlaSummaryStage.map((item) => item); + } else { + _queryParams["issue.sla_summary.stage"] = issueSlaSummaryStage; + } + } + + if (issueSprint != null) { + if (Array.isArray(issueSprint)) { + _queryParams["issue.sprint"] = issueSprint.map((item) => item); + } else { + _queryParams["issue.sprint"] = issueSprint; + } + } + + if (issueSubtype != null) { + if (Array.isArray(issueSubtype)) { + _queryParams["issue.subtype"] = issueSubtype.map((item) => item); + } else { + _queryParams["issue.subtype"] = issueSubtype; + } + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (mode != null) { + _queryParams["mode"] = mode; + } + + if (opportunityAccount != null) { + if (Array.isArray(opportunityAccount)) { + _queryParams["opportunity.account"] = opportunityAccount.map((item) => item); + } else { + _queryParams["opportunity.account"] = opportunityAccount; + } + } + + if (opportunityContacts != null) { + if (Array.isArray(opportunityContacts)) { + _queryParams["opportunity.contacts"] = opportunityContacts.map((item) => item); + } else { + _queryParams["opportunity.contacts"] = opportunityContacts; + } + } + + if (opportunitySubtype != null) { + if (Array.isArray(opportunitySubtype)) { + _queryParams["opportunity.subtype"] = opportunitySubtype.map((item) => item); + } else { + _queryParams["opportunity.subtype"] = opportunitySubtype; + } + } + + if (ownedBy != null) { + if (Array.isArray(ownedBy)) { + _queryParams["owned_by"] = ownedBy.map((item) => item); + } else { + _queryParams["owned_by"] = ownedBy; + } + } + + if (reportedBy != null) { + if (Array.isArray(reportedBy)) { + _queryParams["reported_by"] = reportedBy.map((item) => item); + } else { + _queryParams["reported_by"] = reportedBy; + } + } + + if (sortBy != null) { + if (Array.isArray(sortBy)) { + _queryParams["sort_by"] = sortBy.map((item) => item); + } else { + _queryParams["sort_by"] = sortBy; + } + } + + if (stageName != null) { + if (Array.isArray(stageName)) { + _queryParams["stage.name"] = stageName.map((item) => item); + } else { + _queryParams["stage.name"] = stageName; + } + } + + if (stagedInfoIsStaged != null) { + _queryParams["staged_info.is_staged"] = stagedInfoIsStaged.toString(); + } + + if (syncMetadataLastSyncInStatus != null) { + if (Array.isArray(syncMetadataLastSyncInStatus)) { + _queryParams["sync_metadata.last_sync_in.status"] = syncMetadataLastSyncInStatus.map((item) => item); + } else { + _queryParams["sync_metadata.last_sync_in.status"] = syncMetadataLastSyncInStatus; + } + } + + if (syncMetadataLastSyncInSyncUnit != null) { + if (Array.isArray(syncMetadataLastSyncInSyncUnit)) { + _queryParams["sync_metadata.last_sync_in.sync_unit"] = syncMetadataLastSyncInSyncUnit.map( + (item) => item + ); + } else { + _queryParams["sync_metadata.last_sync_in.sync_unit"] = syncMetadataLastSyncInSyncUnit; + } + } + + if (syncMetadataLastSyncOutStatus != null) { + if (Array.isArray(syncMetadataLastSyncOutStatus)) { + _queryParams["sync_metadata.last_sync_out.status"] = syncMetadataLastSyncOutStatus.map((item) => item); + } else { + _queryParams["sync_metadata.last_sync_out.status"] = syncMetadataLastSyncOutStatus; + } + } + + if (syncMetadataLastSyncOutSyncUnit != null) { + if (Array.isArray(syncMetadataLastSyncOutSyncUnit)) { + _queryParams["sync_metadata.last_sync_out.sync_unit"] = syncMetadataLastSyncOutSyncUnit.map( + (item) => item + ); + } else { + _queryParams["sync_metadata.last_sync_out.sync_unit"] = syncMetadataLastSyncOutSyncUnit; + } + } + + if (syncMetadataOriginSystem != null) { + if (Array.isArray(syncMetadataOriginSystem)) { + _queryParams["sync_metadata.origin_system"] = syncMetadataOriginSystem.map((item) => item); + } else { + _queryParams["sync_metadata.origin_system"] = syncMetadataOriginSystem; + } + } + + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + + if (ticketChannels != null) { + if (Array.isArray(ticketChannels)) { + _queryParams["ticket.channels"] = ticketChannels.map((item) => item); + } else { + _queryParams["ticket.channels"] = ticketChannels; + } + } + + if (ticketGroup != null) { + if (Array.isArray(ticketGroup)) { + _queryParams["ticket.group"] = ticketGroup.map((item) => item); + } else { + _queryParams["ticket.group"] = ticketGroup; + } + } + + if (ticketIsSpam != null) { + _queryParams["ticket.is_spam"] = ticketIsSpam.toString(); + } + + if (ticketNeedsResponse != null) { + _queryParams["ticket.needs_response"] = ticketNeedsResponse.toString(); + } + + if (ticketRevOrg != null) { + if (Array.isArray(ticketRevOrg)) { + _queryParams["ticket.rev_org"] = ticketRevOrg.map((item) => item); + } else { + _queryParams["ticket.rev_org"] = ticketRevOrg; + } + } + + if (ticketSeverity != null) { + if (Array.isArray(ticketSeverity)) { + _queryParams["ticket.severity"] = ticketSeverity.map((item) => item); + } else { + _queryParams["ticket.severity"] = ticketSeverity; + } + } + + if (ticketSlaSummaryStage != null) { + if (Array.isArray(ticketSlaSummaryStage)) { + _queryParams["ticket.sla_summary.stage"] = ticketSlaSummaryStage.map((item) => item); + } else { + _queryParams["ticket.sla_summary.stage"] = ticketSlaSummaryStage; + } + } + + if (ticketSourceChannel != null) { + if (Array.isArray(ticketSourceChannel)) { + _queryParams["ticket.source_channel"] = ticketSourceChannel.map((item) => item); + } else { + _queryParams["ticket.source_channel"] = ticketSourceChannel; + } + } + + if (ticketSubtype != null) { + if (Array.isArray(ticketSubtype)) { + _queryParams["ticket.subtype"] = ticketSubtype.map((item) => item); + } else { + _queryParams["ticket.subtype"] = ticketSubtype; + } + } + + if (type_ != null) { + if (Array.isArray(type_)) { + _queryParams["type"] = type_.map((item) => item); + } else { + _queryParams["type"] = type_; + } + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.list" + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Lists a collection of work items. + * + * @param {DevRev.WorksListRequest} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.listPost() + */ + public async listPost( + request: DevRev.WorksListRequest = {}, + requestOptions?: Works.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.list" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.WorksListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Updates a work item's information. + * + * @param {DevRev.WorksUpdateRequest} request + * @param {Works.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link DevRev.BadRequestError} + * @throws {@link DevRev.UnauthorizedError} + * @throws {@link DevRev.ForbiddenError} + * @throws {@link DevRev.NotFoundError} + * @throws {@link DevRev.TooManyRequestsError} + * @throws {@link DevRev.InternalServerError} + * @throws {@link DevRev.ServiceUnavailableError} + * + * @example + * await client.works.update({ + * type: "issue", + * appliesToPart: "string", + * artifacts: {}, + * body: "string", + * customFields: { + * "string": { + * "key": "value" + * } + * }, + * customSchemaFragments: ["string"], + * customSchemaSpec: { + * apps: ["string"], + * subtype: "string", + * tenantFragment: true, + * validateRequiredFields: true + * }, + * id: "string", + * ownedBy: {}, + * reportedBy: {}, + * stage: { + * name: "string", + * stage: "string" + * }, + * stageValidationOptions: ["allow_invalid_transition"], + * stagedInfo: {}, + * tags: {}, + * targetCloseDate: new Date("2024-01-15T09:30:00.000Z"), + * title: "string", + * developedWith: {}, + * priority: DevRev.IssuePriority.P0, + * priorityV2: 1, + * sprint: "string", + * targetStartDate: new Date("2024-01-15T09:30:00.000Z") + * }) + */ + public async update( + request: DevRev.WorksUpdateRequest, + requestOptions?: Works.RequestOptions + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.DevRevEnvironment.Default, + "works.update" + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@devrev/api", + "X-Fern-SDK-Version": "0.0.14", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + requestType: "json", + body: serializers.WorksUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.WorksUpdateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new DevRev.BadRequestError( + serializers.ErrorBadRequest.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 401: + throw new DevRev.UnauthorizedError( + serializers.ErrorUnauthorized.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new DevRev.ForbiddenError( + serializers.ErrorForbidden.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new DevRev.NotFoundError( + serializers.ErrorNotFound.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new DevRev.TooManyRequestsError( + serializers.ErrorTooManyRequests.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new DevRev.InternalServerError( + serializers.ErrorInternalServerError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 503: + throw new DevRev.ServiceUnavailableError( + serializers.ErrorServiceUnavailable.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.DevRevError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.DevRevTimeoutError(); + case "unknown": + throw new errors.DevRevError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["DEVREV_TOKEN"]; + if (bearer == null) { + throw new errors.DevRevError({ + message: "Please specify DEVREV_TOKEN when instantiating the client.", + }); + } + + return `Bearer ${bearer}`; + } +} diff --git a/src/api/resources/works/client/index.ts b/src/api/resources/works/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/api/resources/works/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/works/client/requests/WorksDeleteRequest.ts b/src/api/resources/works/client/requests/WorksDeleteRequest.ts new file mode 100644 index 0000000..395c697 --- /dev/null +++ b/src/api/resources/works/client/requests/WorksDeleteRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "ISS-12345" + * } + */ +export interface WorksDeleteRequest { + /** The work's ID. */ + id: string; +} diff --git a/src/api/resources/works/client/requests/WorksExportQuery.ts b/src/api/resources/works/client/requests/WorksExportQuery.ts new file mode 100644 index 0000000..63f0cc6 --- /dev/null +++ b/src/api/resources/works/client/requests/WorksExportQuery.ts @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface WorksExportQuery { + /** + * Filters for work belonging to any of the provided parts. + */ + appliesToPart?: string | string[]; + /** + * Filters for work created by any of these users. + */ + createdBy?: string | string[]; + /** + * Filters for custom fields. + */ + customFields?: Record; + /** + * The number of work items to return. The default is '50', the maximum + * is '5000'. + */ + first?: number; + /** + * Filters for issues with any of the provided Accounts. + */ + issueAccounts?: string | string[]; + /** + * Filters for issues with any of the provided priorities. + */ + issuePriority?: DevRev.IssuePriority | DevRev.IssuePriority[]; + /** + * Filters for issues with any of the provided priority enum ids. + */ + issuePriorityV2?: number | number[]; + /** + * Filters for issues with any of the provided Rev organizations. + */ + issueRevOrgs?: string | string[]; + /** + * Filters for records with any of the provided SLA stages. + */ + issueSlaSummaryStage?: DevRev.SlaSummaryStage | DevRev.SlaSummaryStage[]; + /** + * Filters for issues with any of the sprint. + */ + issueSprint?: string | string[]; + /** + * Filters for issues with any of the provided subtypes. + */ + issueSubtype?: string | string[]; + /** + * Filters for opportunities belonging to any of the provided accounts. + */ + opportunityAccount?: string | string[]; + /** + * Filters for opportunities with any of the provided contacts. + */ + opportunityContacts?: string | string[]; + /** + * Filters for opportunity with any of the provided subtypes. + */ + opportunitySubtype?: string | string[]; + /** + * Filters for work owned by any of these users. + */ + ownedBy?: string | string[]; + /** + * Filters for work reported by any of these users. + */ + reportedBy?: string | string[]; + /** + * Fields to sort the work items by and the direction to sort them. + */ + sortBy?: string | string[]; + /** + * Filters for records in the provided stage(s) by name. + */ + stageName?: string | string[]; + /** + * Filters for issues that are staged. + */ + stagedInfoIsStaged?: boolean; + /** + * Filters for works with selected sync statuses. + */ + syncMetadataLastSyncInStatus?: + | DevRev.SyncMetadataFilterSyncInFilterStatus + | DevRev.SyncMetadataFilterSyncInFilterStatus[]; + /** + * Filters for works modified with selected sync units. + */ + syncMetadataLastSyncInSyncUnit?: string | string[]; + /** + * Filters for works with selected sync statuses. + */ + syncMetadataLastSyncOutStatus?: + | DevRev.SyncMetadataFilterSyncOutFilterStatus + | DevRev.SyncMetadataFilterSyncOutFilterStatus[]; + /** + * Filters for works modified with selected sync units. + */ + syncMetadataLastSyncOutSyncUnit?: string | string[]; + /** + * Filters for issues synced from this specific origin system. + */ + syncMetadataOriginSystem?: string | string[]; + /** + * Filters for work with any of the provided tags. + */ + tags?: string | string[]; + /** + * Filters for tickets with any of the provided channels. + */ + ticketChannels?: DevRev.TicketChannels | DevRev.TicketChannels[]; + /** + * Filters for tickets belonging to specific groups. + */ + ticketGroup?: string | string[]; + /** + * Filters for tickets that are spam. + */ + ticketIsSpam?: boolean; + /** + * Filters for tickets that need response. + */ + ticketNeedsResponse?: boolean; + /** + * Filters for tickets that are associated with any of the provided Rev + * organizations. + */ + ticketRevOrg?: string | string[]; + /** + * Filters for tickets with any of the provided severities. + */ + ticketSeverity?: DevRev.TicketSeverity | DevRev.TicketSeverity[]; + /** + * Filters for records with any of the provided SLA stages. + */ + ticketSlaSummaryStage?: DevRev.SlaSummaryStage | DevRev.SlaSummaryStage[]; + /** + * Filters for tickets with any of the provided source channels. + */ + ticketSourceChannel?: string | string[]; + /** + * Filters for tickets with any of the provided subtypes. + */ + ticketSubtype?: string | string[]; + /** + * Filters for work of the provided types. + */ + type?: DevRev.WorkType | DevRev.WorkType[]; +} diff --git a/src/api/resources/works/client/requests/WorksExportRequest.ts b/src/api/resources/works/client/requests/WorksExportRequest.ts new file mode 100644 index 0000000..ec56639 --- /dev/null +++ b/src/api/resources/works/client/requests/WorksExportRequest.ts @@ -0,0 +1,47 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface WorksExportRequest { + /** Filters for work of the provided types. */ + type?: DevRev.WorkType[]; + actualCloseDate?: DevRev.DateFilter; + /** Filters for work belonging to any of the provided parts. */ + appliesToPart?: string[]; + /** Filters for work created by any of these users. */ + createdBy?: string[]; + createdDate?: DevRev.DateFilter; + /** Filters for custom fields. */ + customFields?: Record; + /** + * The number of work items to return. The default is '50', the + * maximum is '5000'. + * + */ + first?: number; + issue?: DevRev.WorksFilterIssue; + modifiedDate?: DevRev.DateFilter; + opportunity?: DevRev.WorksFilterOpportunity; + /** Filters for work owned by any of these users. */ + ownedBy?: string[]; + /** Filters for work reported by any of these users. */ + reportedBy?: string[]; + /** + * Fields to sort the work items by and the direction to sort them. + * + */ + sortBy?: string[]; + stage?: DevRev.StageFilter; + stagedInfo?: DevRev.StagedInfoFilter; + syncMetadata?: DevRev.SyncMetadataFilter; + /** Filters for work with any of the provided tags. */ + tags?: string[]; + targetCloseDate?: DevRev.DateFilter; + ticket?: DevRev.WorksFilterTicket; +} diff --git a/src/api/resources/works/client/requests/WorksGetQuery.ts b/src/api/resources/works/client/requests/WorksGetQuery.ts new file mode 100644 index 0000000..99d22de --- /dev/null +++ b/src/api/resources/works/client/requests/WorksGetQuery.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface WorksGetQuery { + /** + * The work's ID. + */ + id: string; +} diff --git a/src/api/resources/works/client/requests/WorksGetRequest.ts b/src/api/resources/works/client/requests/WorksGetRequest.ts new file mode 100644 index 0000000..4a182c4 --- /dev/null +++ b/src/api/resources/works/client/requests/WorksGetRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * id: "string" + * } + */ +export interface WorksGetRequest { + /** The work's ID. */ + id: string; +} diff --git a/src/api/resources/works/client/requests/WorksListQuery.ts b/src/api/resources/works/client/requests/WorksListQuery.ts new file mode 100644 index 0000000..fb7d64c --- /dev/null +++ b/src/api/resources/works/client/requests/WorksListQuery.ts @@ -0,0 +1,167 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface WorksListQuery { + /** + * Filters for work belonging to any of the provided parts. + */ + appliesToPart?: string | string[]; + /** + * Filters for work created by any of these users. + */ + createdBy?: string | string[]; + /** + * The cursor to resume iteration from. If not provided, then iteration + * starts from the beginning. + */ + cursor?: string; + /** + * Filters for custom fields. + */ + customFields?: Record; + /** + * Filters for issues with any of the provided Accounts. + */ + issueAccounts?: string | string[]; + /** + * Filters for issues with any of the provided priorities. + */ + issuePriority?: DevRev.IssuePriority | DevRev.IssuePriority[]; + /** + * Filters for issues with any of the provided priority enum ids. + */ + issuePriorityV2?: number | number[]; + /** + * Filters for issues with any of the provided Rev organizations. + */ + issueRevOrgs?: string | string[]; + /** + * Filters for records with any of the provided SLA stages. + */ + issueSlaSummaryStage?: DevRev.SlaSummaryStage | DevRev.SlaSummaryStage[]; + /** + * Filters for issues with any of the sprint. + */ + issueSprint?: string | string[]; + /** + * Filters for issues with any of the provided subtypes. + */ + issueSubtype?: string | string[]; + /** + * The maximum number of works to return. The default is '50'. + */ + limit?: number; + /** + * The iteration mode to use, otherwise if not set, then "after" is + * used. + */ + mode?: DevRev.ListMode; + /** + * Filters for opportunities belonging to any of the provided accounts. + */ + opportunityAccount?: string | string[]; + /** + * Filters for opportunities with any of the provided contacts. + */ + opportunityContacts?: string | string[]; + /** + * Filters for opportunity with any of the provided subtypes. + */ + opportunitySubtype?: string | string[]; + /** + * Filters for work owned by any of these users. + */ + ownedBy?: string | string[]; + /** + * Filters for work reported by any of these users. + */ + reportedBy?: string | string[]; + /** + * Fields to sort the works by and the direction to sort them. + */ + sortBy?: string | string[]; + /** + * Filters for records in the provided stage(s) by name. + */ + stageName?: string | string[]; + /** + * Filters for issues that are staged. + */ + stagedInfoIsStaged?: boolean; + /** + * Filters for works with selected sync statuses. + */ + syncMetadataLastSyncInStatus?: + | DevRev.SyncMetadataFilterSyncInFilterStatus + | DevRev.SyncMetadataFilterSyncInFilterStatus[]; + /** + * Filters for works modified with selected sync units. + */ + syncMetadataLastSyncInSyncUnit?: string | string[]; + /** + * Filters for works with selected sync statuses. + */ + syncMetadataLastSyncOutStatus?: + | DevRev.SyncMetadataFilterSyncOutFilterStatus + | DevRev.SyncMetadataFilterSyncOutFilterStatus[]; + /** + * Filters for works modified with selected sync units. + */ + syncMetadataLastSyncOutSyncUnit?: string | string[]; + /** + * Filters for issues synced from this specific origin system. + */ + syncMetadataOriginSystem?: string | string[]; + /** + * Filters for work with any of the provided tags. + */ + tags?: string | string[]; + /** + * Filters for tickets with any of the provided channels. + */ + ticketChannels?: DevRev.TicketChannels | DevRev.TicketChannels[]; + /** + * Filters for tickets belonging to specific groups. + */ + ticketGroup?: string | string[]; + /** + * Filters for tickets that are spam. + */ + ticketIsSpam?: boolean; + /** + * Filters for tickets that need response. + */ + ticketNeedsResponse?: boolean; + /** + * Filters for tickets that are associated with any of the provided Rev + * organizations. + */ + ticketRevOrg?: string | string[]; + /** + * Filters for tickets with any of the provided severities. + */ + ticketSeverity?: DevRev.TicketSeverity | DevRev.TicketSeverity[]; + /** + * Filters for records with any of the provided SLA stages. + */ + ticketSlaSummaryStage?: DevRev.SlaSummaryStage | DevRev.SlaSummaryStage[]; + /** + * Filters for tickets with any of the provided source channels. + */ + ticketSourceChannel?: string | string[]; + /** + * Filters for tickets with any of the provided subtypes. + */ + ticketSubtype?: string | string[]; + /** + * Filters for work of the provided types. + */ + type?: DevRev.WorkType | DevRev.WorkType[]; +} diff --git a/src/api/resources/works/client/requests/WorksListRequest.ts b/src/api/resources/works/client/requests/WorksListRequest.ts new file mode 100644 index 0000000..f022bca --- /dev/null +++ b/src/api/resources/works/client/requests/WorksListRequest.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../../../../index"; + +/** + * @example + * {} + */ +export interface WorksListRequest { + /** Filters for work of the provided types. */ + type?: DevRev.WorkType[]; + actualCloseDate?: DevRev.DateFilter; + /** Filters for work belonging to any of the provided parts. */ + appliesToPart?: string[]; + /** Filters for work created by any of these users. */ + createdBy?: string[]; + createdDate?: DevRev.DateFilter; + /** + * The cursor to resume iteration from. If not provided, then + * iteration starts from the beginning. + * + */ + cursor?: string; + /** Filters for custom fields. */ + customFields?: Record; + issue?: DevRev.WorksFilterIssue; + /** + * The maximum number of works to return. The default is '50'. + * + */ + limit?: number; + mode?: DevRev.ListMode; + modifiedDate?: DevRev.DateFilter; + opportunity?: DevRev.WorksFilterOpportunity; + /** Filters for work owned by any of these users. */ + ownedBy?: string[]; + /** Filters for work reported by any of these users. */ + reportedBy?: string[]; + /** + * Fields to sort the works by and the direction to sort them. + * + */ + sortBy?: string[]; + stage?: DevRev.StageFilter; + stagedInfo?: DevRev.StagedInfoFilter; + syncMetadata?: DevRev.SyncMetadataFilter; + /** Filters for work with any of the provided tags. */ + tags?: string[]; + targetCloseDate?: DevRev.DateFilter; + ticket?: DevRev.WorksFilterTicket; +} diff --git a/src/api/resources/works/client/requests/index.ts b/src/api/resources/works/client/requests/index.ts new file mode 100644 index 0000000..826da04 --- /dev/null +++ b/src/api/resources/works/client/requests/index.ts @@ -0,0 +1,7 @@ +export { type WorksDeleteRequest } from "./WorksDeleteRequest"; +export { type WorksExportQuery } from "./WorksExportQuery"; +export { type WorksExportRequest } from "./WorksExportRequest"; +export { type WorksGetQuery } from "./WorksGetQuery"; +export { type WorksGetRequest } from "./WorksGetRequest"; +export { type WorksListQuery } from "./WorksListQuery"; +export { type WorksListRequest } from "./WorksListRequest"; diff --git a/src/api/resources/works/index.ts b/src/api/resources/works/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/works/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/types/AccessLevel.ts b/src/api/types/AccessLevel.ts new file mode 100644 index 0000000..d230de0 --- /dev/null +++ b/src/api/types/AccessLevel.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type AccessLevel = "external" | "internal" | "private" | "public" | "restricted"; + +export const AccessLevel = { + External: "external", + Internal: "internal", + Private: "private", + Public: "public", + Restricted: "restricted", +} as const; diff --git a/src/api/types/Account.ts b/src/api/types/Account.ts new file mode 100644 index 0000000..a779609 --- /dev/null +++ b/src/api/types/Account.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Account extends DevRev.OrgBase { + /** The artifacts attached to the Account. */ + artifacts?: DevRev.ArtifactSummary[]; + /** Custom fields. */ + customFields?: Record; + /** Custom schema fragments. */ + customSchemaFragments?: string[]; + /** Description of the corresponding Account. */ + description?: string; + /** Company's domain names. Example - 'devrev.ai'. */ + domains?: string[]; + /** + * External refs are unique identifiers from your customer system of + * records, stored as a list. + */ + externalRefs: string[]; + /** List of Dev user IDs owning this Account. */ + ownedBy: DevRev.UserSummary[]; + /** Stock schema fragment. */ + stockSchemaFragment?: string; + /** Subtype corresponding to the custom type fragment. */ + subtype?: string; + /** Tags associated with an object. */ + tags?: DevRev.TagWithValue[]; + /** The Tier of the corresponding Account. */ + tier?: string; +} diff --git a/src/api/types/AccountSearchSummary.ts b/src/api/types/AccountSearchSummary.ts new file mode 100644 index 0000000..d5472d7 --- /dev/null +++ b/src/api/types/AccountSearchSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface AccountSearchSummary extends DevRev.SearchSummaryBase { + account: DevRev.AccountSummary; + /** Comments on the work. */ + comments?: DevRev.CommentSearchSummary[]; +} diff --git a/src/api/types/AccountSummary.ts b/src/api/types/AccountSummary.ts new file mode 100644 index 0000000..432c6c9 --- /dev/null +++ b/src/api/types/AccountSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type AccountSummary = DevRev.OrgBaseSummary; diff --git a/src/api/types/AccountsCreateResponse.ts b/src/api/types/AccountsCreateResponse.ts new file mode 100644 index 0000000..5aac455 --- /dev/null +++ b/src/api/types/AccountsCreateResponse.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to creating a new account. + */ +export interface AccountsCreateResponse { + account: DevRev.Account; + defaultRevOrg: DevRev.RevOrg; +} diff --git a/src/api/types/AccountsDeleteResponse.ts b/src/api/types/AccountsDeleteResponse.ts new file mode 100644 index 0000000..f3f233e --- /dev/null +++ b/src/api/types/AccountsDeleteResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The response to deleting an account. + */ +export type AccountsDeleteResponse = Record; diff --git a/src/api/types/AccountsExportResponse.ts b/src/api/types/AccountsExportResponse.ts new file mode 100644 index 0000000..922e8e1 --- /dev/null +++ b/src/api/types/AccountsExportResponse.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to exporting a collection of accounts. + */ +export interface AccountsExportResponse { + /** The exported accounts. */ + accounts: DevRev.Account[]; +} diff --git a/src/api/types/AccountsFilters.ts b/src/api/types/AccountsFilters.ts new file mode 100644 index 0000000..0d832d0 --- /dev/null +++ b/src/api/types/AccountsFilters.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface AccountsFilters { + /** Filters for accounts created by the specified user(s). */ + createdBy?: string[]; + createdDate?: DevRev.DateTimeFilter; + /** Filters for custom fields. */ + customFields?: Record; + /** Array of display names of accounts to be filtered. */ + displayName?: string[]; + /** Domains for accounts to be filtered. */ + domains?: string[]; + /** Array of references of accounts to be filtered. */ + externalRefs?: string[]; + modifiedDate?: DevRev.DateTimeFilter; + /** Filters for accounts owned by the specified user(s). */ + ownedBy?: string[]; + /** Filters for accounts on specified stages. */ + stage?: string[]; + /** List of tags to be filtered. */ + tags?: string[]; +} diff --git a/src/api/types/AccountsGetResponse.ts b/src/api/types/AccountsGetResponse.ts new file mode 100644 index 0000000..8c6a181 --- /dev/null +++ b/src/api/types/AccountsGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The returned account. + */ +export interface AccountsGetResponse { + account: DevRev.Account; +} diff --git a/src/api/types/AccountsListResponse.ts b/src/api/types/AccountsListResponse.ts new file mode 100644 index 0000000..136ca26 --- /dev/null +++ b/src/api/types/AccountsListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to listing all accounts matching the filter criteria. + */ +export interface AccountsListResponse { + /** List containing all the accounts */ + accounts: DevRev.Account[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/AccountsUpdateRequestArtifacts.ts b/src/api/types/AccountsUpdateRequestArtifacts.ts new file mode 100644 index 0000000..8b9d9dd --- /dev/null +++ b/src/api/types/AccountsUpdateRequestArtifacts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface AccountsUpdateRequestArtifacts { + /** Sets the IDs to the provided artifact IDs. */ + set?: string[]; +} diff --git a/src/api/types/AccountsUpdateResponse.ts b/src/api/types/AccountsUpdateResponse.ts new file mode 100644 index 0000000..b3f9173 --- /dev/null +++ b/src/api/types/AccountsUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Updated account object. + */ +export interface AccountsUpdateResponse { + account: DevRev.Account; +} diff --git a/src/api/types/AggregatedSchema.ts b/src/api/types/AggregatedSchema.ts new file mode 100644 index 0000000..a63bb92 --- /dev/null +++ b/src/api/types/AggregatedSchema.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * List of custom fields from multiple source fragments. + */ +export type AggregatedSchema = Record; diff --git a/src/api/types/AggregatedSchemaGetResponse.ts b/src/api/types/AggregatedSchemaGetResponse.ts new file mode 100644 index 0000000..e8916e0 --- /dev/null +++ b/src/api/types/AggregatedSchemaGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface AggregatedSchemaGetResponse { + schema: DevRev.AggregatedSchema; +} diff --git a/src/api/types/AggregationDetail.ts b/src/api/types/AggregationDetail.ts new file mode 100644 index 0000000..2df2cce --- /dev/null +++ b/src/api/types/AggregationDetail.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Stores aggregation type and dimension information. + */ +export interface AggregationDetail { + aggregationType: DevRev.AggregationDetailAggregationType; + /** + * Unique dimension if provided to be considered for grouping metering + * data for the UOM. + */ + uniqueDimension?: string; +} diff --git a/src/api/types/AggregationDetailAggregationType.ts b/src/api/types/AggregationDetailAggregationType.ts new file mode 100644 index 0000000..7dbdc66 --- /dev/null +++ b/src/api/types/AggregationDetailAggregationType.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Aggregation type to be used while aggregating the metering data for the + * UOM. 1] Sum - sum of all the values for the meter in a given period Ex. + * { M1:2, M1:4 } => {M1:6} 2] Minimum - min of all the values for the + * meter in a given period Ex. { M1:2, M1:4 } => {M1:2} 3] Maximum - max + * of all the values for the meter in a given period Ex. { M1:2, M1:4 } => + * {M1:4} 4] Unique Count - Sum of distinct unique dimension observed for + * the meter in the given period (not considering the data from the + * previous billing period) Ex. January {M1:{VM:VM0}}, February + * {M1:{VM:VM1}, M1:{VM:VM2}, M1:{VM:VM1}} => {M1:2} 5] Running Total - + * Sum of distinct active unique dimension observed for a meter in the + * given period, taking into consideration the active data from the + * previous billing cycle Ex. January {M1:{VM:VM0,on}, {M1:{VM:VM1,off} + * February {M1:{VM:VM2, on}, M1:{VM:VM2, off}, M1:{VM:VM3, on}} => {M1:3} + * 6] Duration - Sum of distinct active unique dimension duration for a + * meter in the given period, taking into consideration the active data + * from the previous month Ex. January15 {M1:{VM:VM0,on, 4}} February15 + * {M1:{VM:VM0,off}, February18 {M1:{VM:VM1,on,5} => M1-> + * 30*4*charge_per_day + 10*5*charge_per_day 7] Latest - consider the + * latest/last meter in the given period 8] Oldest - consider the + * oldest/first record in the given period. + */ +export type AggregationDetailAggregationType = + | "duration" + | "latest" + | "maximum" + | "minimum" + | "oldest" + | "running_total" + | "sum" + | "unique_count"; + +export const AggregationDetailAggregationType = { + Duration: "duration", + Latest: "latest", + Maximum: "maximum", + Minimum: "minimum", + Oldest: "oldest", + RunningTotal: "running_total", + Sum: "sum", + UniqueCount: "unique_count", +} as const; diff --git a/src/api/types/AppFragment.ts b/src/api/types/AppFragment.ts new file mode 100644 index 0000000..442c563 --- /dev/null +++ b/src/api/types/AppFragment.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface AppFragment extends DevRev.CustomSchemaFragmentBase { + /** App this fragment applies to. */ + app?: string; +} diff --git a/src/api/types/AppFragmentSummary.ts b/src/api/types/AppFragmentSummary.ts new file mode 100644 index 0000000..bf0a6a6 --- /dev/null +++ b/src/api/types/AppFragmentSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type AppFragmentSummary = DevRev.CustomSchemaFragmentBaseSummary; diff --git a/src/api/types/ArchetypeMetricTarget.ts b/src/api/types/ArchetypeMetricTarget.ts new file mode 100644 index 0000000..c0c556e --- /dev/null +++ b/src/api/types/ArchetypeMetricTarget.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Metric with corresponding target values. + */ +export interface ArchetypeMetricTarget { + /** + * If true, the schedule attached to this metric is out of schedule at + * the time of the query. + */ + isOutOfSchedule?: boolean; + metricDefinition: DevRev.MetricDefinitionSummary; + orgSchedule?: DevRev.OrgScheduleSummary; + /** Time in minutes that remains on a paused metric. */ + remainingTime?: number; + /** Time at which the metric would breach SLA if no action taken. */ + targetTime?: Date; + /** + * Time at which the metric would reach the SLA warning limit if no + * action taken. + */ + warningTargetTime?: Date; +} diff --git a/src/api/types/Article.ts b/src/api/types/Article.ts new file mode 100644 index 0000000..c16fc8a --- /dev/null +++ b/src/api/types/Article.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Article extends DevRev.AtomBase { + /** Details of the parts relevant to the article. */ + appliesToParts: DevRev.PartSummary[]; + articleType?: DevRev.ArticleType; + /** Users that authored the article. */ + authoredBy?: DevRev.UserSummary[]; + /** Description of the article. */ + description?: string; + /** Artifacts containing the extracted content. */ + extractedContent?: DevRev.ArtifactSummary[]; + /** Number of downvotes on the article. */ + numDownvotes?: number; + /** Number of upvotes on the article. */ + numUpvotes?: number; + /** The users that own the article. */ + ownedBy: DevRev.UserSummary[]; + parent?: DevRev.DirectorySummary; + /** Rank of the article. */ + rank?: string; + resource?: DevRev.Resource; + scope?: DevRev.EnumValue; + /** Title of the article. */ + title?: string; +} diff --git a/src/api/types/ArticleSearchSummary.ts b/src/api/types/ArticleSearchSummary.ts new file mode 100644 index 0000000..ca4f0ef --- /dev/null +++ b/src/api/types/ArticleSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ArticleSearchSummary extends DevRev.SearchSummaryBase { + article: DevRev.ArticleSummary; +} diff --git a/src/api/types/ArticleStatus.ts b/src/api/types/ArticleStatus.ts new file mode 100644 index 0000000..122a922 --- /dev/null +++ b/src/api/types/ArticleStatus.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Status of the article. + */ +export type ArticleStatus = "archived" | "draft" | "published" | "review_needed"; + +export const ArticleStatus = { + Archived: "archived", + Draft: "draft", + Published: "published", + ReviewNeeded: "review_needed", +} as const; diff --git a/src/api/types/ArticleSummary.ts b/src/api/types/ArticleSummary.ts new file mode 100644 index 0000000..e177c24 --- /dev/null +++ b/src/api/types/ArticleSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ArticleSummary extends DevRev.AtomBaseSummary { + resource?: DevRev.ResourceSummary; + /** Title of the article. */ + title?: string; +} diff --git a/src/api/types/ArticleType.ts b/src/api/types/ArticleType.ts new file mode 100644 index 0000000..fa56e71 --- /dev/null +++ b/src/api/types/ArticleType.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of the article. + */ +export type ArticleType = "article" | "content_block"; + +export const ArticleType = { + Article: "article", + ContentBlock: "content_block", +} as const; diff --git a/src/api/types/ArticlesCountResponse.ts b/src/api/types/ArticlesCountResponse.ts new file mode 100644 index 0000000..1aeffc6 --- /dev/null +++ b/src/api/types/ArticlesCountResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesCountResponse { + /** The total number of articles matching the filter. */ + count: number; +} diff --git a/src/api/types/ArticlesCreateRequestResource.ts b/src/api/types/ArticlesCreateRequestResource.ts new file mode 100644 index 0000000..4494fe2 --- /dev/null +++ b/src/api/types/ArticlesCreateRequestResource.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesCreateRequestResource { + /** IDs of the artifacts. */ + artifacts?: string[]; + /** The latest published version. */ + publishedVersion?: string; + /** URL of the external article. */ + url?: string; +} diff --git a/src/api/types/ArticlesCreateResponse.ts b/src/api/types/ArticlesCreateResponse.ts new file mode 100644 index 0000000..7a58b3a --- /dev/null +++ b/src/api/types/ArticlesCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Create article response. + */ +export interface ArticlesCreateResponse { + article: DevRev.Article; +} diff --git a/src/api/types/ArticlesDeleteResponse.ts b/src/api/types/ArticlesDeleteResponse.ts new file mode 100644 index 0000000..3dd9e8f --- /dev/null +++ b/src/api/types/ArticlesDeleteResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ArticlesDeleteResponse = Record; diff --git a/src/api/types/ArticlesGetResponse.ts b/src/api/types/ArticlesGetResponse.ts new file mode 100644 index 0000000..81fc714 --- /dev/null +++ b/src/api/types/ArticlesGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Get article response. + */ +export interface ArticlesGetResponse { + article: DevRev.Article; +} diff --git a/src/api/types/ArticlesListResponse.ts b/src/api/types/ArticlesListResponse.ts new file mode 100644 index 0000000..5f1114b --- /dev/null +++ b/src/api/types/ArticlesListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * List articles response. + */ +export interface ArticlesListResponse { + /** The article entries matching the request. */ + articles: DevRev.Article[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** Total number of article items for the request. */ + total: number; +} diff --git a/src/api/types/ArticlesUpdateRequestAppliesToParts.ts b/src/api/types/ArticlesUpdateRequestAppliesToParts.ts new file mode 100644 index 0000000..72b8d58 --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestAppliesToParts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesUpdateRequestAppliesToParts { + /** Updates the parts that the article applies to. */ + set?: string[]; +} diff --git a/src/api/types/ArticlesUpdateRequestArtifacts.ts b/src/api/types/ArticlesUpdateRequestArtifacts.ts new file mode 100644 index 0000000..549c8f2 --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestArtifacts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesUpdateRequestArtifacts { + /** Updates IDs of the artifacts. */ + set?: string[]; +} diff --git a/src/api/types/ArticlesUpdateRequestAuthoredBy.ts b/src/api/types/ArticlesUpdateRequestAuthoredBy.ts new file mode 100644 index 0000000..fbf04f5 --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestAuthoredBy.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesUpdateRequestAuthoredBy { + /** Sets the users that authored the article. */ + set?: string[]; +} diff --git a/src/api/types/ArticlesUpdateRequestExtractedContent.ts b/src/api/types/ArticlesUpdateRequestExtractedContent.ts new file mode 100644 index 0000000..1fafa26 --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestExtractedContent.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesUpdateRequestExtractedContent { + /** Update the ID of the extracted content. */ + set?: string[]; +} diff --git a/src/api/types/ArticlesUpdateRequestOwnedBy.ts b/src/api/types/ArticlesUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..399ebc6 --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestOwnedBy.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesUpdateRequestOwnedBy { + /** + * Sets the owner IDs to the provided user IDs. This must not be + * empty. + */ + set?: string[]; +} diff --git a/src/api/types/ArticlesUpdateRequestReorder.ts b/src/api/types/ArticlesUpdateRequestReorder.ts new file mode 100644 index 0000000..3e4bb93 --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestReorder.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArticlesUpdateRequestReorder { + /** The article after which the reordered article is placed. */ + after?: string; + /** The article before which the reordered article is placed. */ + before?: string; +} diff --git a/src/api/types/ArticlesUpdateRequestSharedWith.ts b/src/api/types/ArticlesUpdateRequestSharedWith.ts new file mode 100644 index 0000000..dc4869e --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestSharedWith.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ArticlesUpdateRequestSharedWith { + /** Sets the field to the provided membership list. */ + set?: DevRev.SetSharedWithMembership[]; +} diff --git a/src/api/types/ArticlesUpdateRequestTags.ts b/src/api/types/ArticlesUpdateRequestTags.ts new file mode 100644 index 0000000..1c36eef --- /dev/null +++ b/src/api/types/ArticlesUpdateRequestTags.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ArticlesUpdateRequestTags { + /** Sets the provided tags on the article. */ + set?: DevRev.SetTagWithValue[]; +} diff --git a/src/api/types/ArticlesUpdateResponse.ts b/src/api/types/ArticlesUpdateResponse.ts new file mode 100644 index 0000000..05f7aaa --- /dev/null +++ b/src/api/types/ArticlesUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ArticlesUpdateResponse { + article: DevRev.Article; +} diff --git a/src/api/types/ArtifactSearchSummary.ts b/src/api/types/ArtifactSearchSummary.ts new file mode 100644 index 0000000..4936a23 --- /dev/null +++ b/src/api/types/ArtifactSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ArtifactSearchSummary extends DevRev.SearchSummaryBase { + artifact: DevRev.ArtifactSummary; +} diff --git a/src/api/types/ArtifactSummary.ts b/src/api/types/ArtifactSummary.ts new file mode 100644 index 0000000..67a38b7 --- /dev/null +++ b/src/api/types/ArtifactSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type ArtifactSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/ArtifactsPrepareResponse.ts b/src/api/types/ArtifactsPrepareResponse.ts new file mode 100644 index 0000000..207ce46 --- /dev/null +++ b/src/api/types/ArtifactsPrepareResponse.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to preparing a URL to upload a file. + */ +export interface ArtifactsPrepareResponse { + /** The POST policy form data. */ + formData: DevRev.ArtifactsPrepareResponseFormData[]; + /** The generated artifact's ID. */ + id: string; + /** The URL that the file's data should be uploaded to. */ + url: string; +} diff --git a/src/api/types/ArtifactsPrepareResponseFormData.ts b/src/api/types/ArtifactsPrepareResponseFormData.ts new file mode 100644 index 0000000..4666c3b --- /dev/null +++ b/src/api/types/ArtifactsPrepareResponseFormData.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArtifactsPrepareResponseFormData { + /** Key of the form field. */ + key: string; + /** Value corresponding to the key. */ + value: string; +} diff --git a/src/api/types/ArtifactsVersionsPrepareResponse.ts b/src/api/types/ArtifactsVersionsPrepareResponse.ts new file mode 100644 index 0000000..4918cff --- /dev/null +++ b/src/api/types/ArtifactsVersionsPrepareResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to preparing a new artifact version. + */ +export interface ArtifactsVersionsPrepareResponse { + /** The POST policy form data. */ + formData: DevRev.ArtifactsVersionsPrepareResponseFormData[]; + /** The URL that the file's data should be uploaded to. */ + url: string; +} diff --git a/src/api/types/ArtifactsVersionsPrepareResponseFormData.ts b/src/api/types/ArtifactsVersionsPrepareResponseFormData.ts new file mode 100644 index 0000000..e1e5674 --- /dev/null +++ b/src/api/types/ArtifactsVersionsPrepareResponseFormData.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ArtifactsVersionsPrepareResponseFormData { + /** Key of the form field. */ + key: string; + /** Value corresponding to the key. */ + value: string; +} diff --git a/src/api/types/AtomBase.ts b/src/api/types/AtomBase.ts new file mode 100644 index 0000000..ab3e06d --- /dev/null +++ b/src/api/types/AtomBase.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface AtomBase { + createdBy?: DevRev.UserSummary; + /** Timestamp when the object was created. */ + createdDate?: Date; + /** Human-readable object ID unique to the Dev organization. */ + displayId?: string; + /** Globally unique object ID. */ + id: string; + modifiedBy?: DevRev.UserSummary; + /** Timestamp when the object was last modified. */ + modifiedDate?: Date; +} diff --git a/src/api/types/AtomBaseSummary.ts b/src/api/types/AtomBaseSummary.ts new file mode 100644 index 0000000..38fe4a2 --- /dev/null +++ b/src/api/types/AtomBaseSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface AtomBaseSummary { + /** Human-readable object ID unique to the Dev organization. */ + displayId?: string; + /** Globally unique object ID. */ + id: string; +} diff --git a/src/api/types/AtomSummary.ts b/src/api/types/AtomSummary.ts new file mode 100644 index 0000000..90eebbe --- /dev/null +++ b/src/api/types/AtomSummary.ts @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type AtomSummary = + | DevRev.AtomSummary.Account + | DevRev.AtomSummary.AppFragment + | DevRev.AtomSummary.Capability + | DevRev.AtomSummary.Conversation + | DevRev.AtomSummary.CustomTypeFragment + | DevRev.AtomSummary.DevUser + | DevRev.AtomSummary.Engagement + | DevRev.AtomSummary.Enhancement + | DevRev.AtomSummary.Feature + | DevRev.AtomSummary.Issue + | DevRev.AtomSummary.Meeting + | DevRev.AtomSummary.Opportunity + | DevRev.AtomSummary.Product + | DevRev.AtomSummary.RevOrg + | DevRev.AtomSummary.RevUser + | DevRev.AtomSummary.ServiceAccount + | DevRev.AtomSummary.SysUser + | DevRev.AtomSummary.Tag + | DevRev.AtomSummary.Task + | DevRev.AtomSummary.TenantFragment + | DevRev.AtomSummary.Ticket + | DevRev.AtomSummary.TimelineComment + | DevRev.AtomSummary.Webhook; + +export declare namespace AtomSummary { + interface Account extends DevRev.OrgBaseSummary { + type: "account"; + } + + interface AppFragment extends DevRev.AtomBaseSummary { + type: "app_fragment"; + } + + interface Capability extends DevRev.PartBaseSummary { + type: "capability"; + } + + interface Conversation extends DevRev.ConversationSummary { + type: "conversation"; + } + + interface CustomTypeFragment extends DevRev.AtomBaseSummary { + type: "custom_type_fragment"; + } + + interface DevUser extends DevRev.UserBaseSummary { + type: "dev_user"; + } + + interface Engagement extends DevRev.AtomBaseSummary { + type: "engagement"; + } + + interface Enhancement extends DevRev.PartBaseSummary { + type: "enhancement"; + } + + interface Feature extends DevRev.PartBaseSummary { + type: "feature"; + } + + interface Issue extends DevRev.IssueSummary { + type: "issue"; + } + + interface Meeting extends DevRev.AtomBaseSummary { + type: "meeting"; + } + + interface Opportunity extends DevRev.WorkBaseSummary { + type: "opportunity"; + } + + interface Product extends DevRev.PartBaseSummary { + type: "product"; + } + + interface RevOrg extends DevRev.OrgBaseSummary { + type: "rev_org"; + } + + interface RevUser extends DevRev.RevUserSummary { + type: "rev_user"; + } + + interface ServiceAccount extends DevRev.UserBaseSummary { + type: "service_account"; + } + + interface SysUser extends DevRev.UserBaseSummary { + type: "sys_user"; + } + + interface Tag extends DevRev.TagSummary { + type: "tag"; + } + + interface Task extends DevRev.WorkBaseSummary { + type: "task"; + } + + interface TenantFragment extends DevRev.AtomBaseSummary { + type: "tenant_fragment"; + } + + interface Ticket extends DevRev.TicketSummary { + type: "ticket"; + } + + interface TimelineComment extends DevRev.AtomBaseSummary { + type: "timeline_comment"; + } + + interface Webhook extends DevRev.AtomBaseSummary { + type: "webhook"; + } +} diff --git a/src/api/types/AtomType.ts b/src/api/types/AtomType.ts new file mode 100644 index 0000000..33ae618 --- /dev/null +++ b/src/api/types/AtomType.ts @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type AtomType = + | "account" + | "app_fragment" + | "capability" + | "conversation" + | "custom_type_fragment" + | "dev_user" + | "engagement" + | "enhancement" + | "feature" + | "issue" + | "meeting" + | "opportunity" + | "product" + | "rev_org" + | "rev_user" + | "service_account" + | "sys_user" + | "tag" + | "task" + | "tenant_fragment" + | "ticket" + | "timeline_comment" + | "webhook"; + +export const AtomType = { + Account: "account", + AppFragment: "app_fragment", + Capability: "capability", + Conversation: "conversation", + CustomTypeFragment: "custom_type_fragment", + DevUser: "dev_user", + Engagement: "engagement", + Enhancement: "enhancement", + Feature: "feature", + Issue: "issue", + Meeting: "meeting", + Opportunity: "opportunity", + Product: "product", + RevOrg: "rev_org", + RevUser: "rev_user", + ServiceAccount: "service_account", + SysUser: "sys_user", + Tag: "tag", + Task: "task", + TenantFragment: "tenant_fragment", + Ticket: "ticket", + TimelineComment: "timeline_comment", + Webhook: "webhook", +} as const; diff --git a/src/api/types/BooleanExpression.ts b/src/api/types/BooleanExpression.ts new file mode 100644 index 0000000..6f377fa --- /dev/null +++ b/src/api/types/BooleanExpression.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Boolean expression. + */ +export type BooleanExpression = + | DevRev.BooleanExpression.And + | DevRev.BooleanExpression.Not + | DevRev.BooleanExpression.Or + | DevRev.BooleanExpression.Primitive; + +export declare namespace BooleanExpression { + interface And extends DevRev.BooleanExpressionAndExpression { + type: "and"; + } + + interface Not extends DevRev.BooleanExpressionNotExpression { + type: "not"; + } + + interface Or extends DevRev.BooleanExpressionOrExpression { + type: "or"; + } + + interface Primitive { + type: "primitive"; + value: DevRev.BooleanExpressionPrimitiveExpression; + } +} diff --git a/src/api/types/BooleanExpressionAndExpression.ts b/src/api/types/BooleanExpressionAndExpression.ts new file mode 100644 index 0000000..2dd6332 --- /dev/null +++ b/src/api/types/BooleanExpressionAndExpression.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * All the expressions would be 'and'ed together. + */ +export interface BooleanExpressionAndExpression { + expressions: DevRev.BooleanExpression[]; +} diff --git a/src/api/types/BooleanExpressionNotExpression.ts b/src/api/types/BooleanExpressionNotExpression.ts new file mode 100644 index 0000000..49c8918 --- /dev/null +++ b/src/api/types/BooleanExpressionNotExpression.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The expression would be negated. + */ +export interface BooleanExpressionNotExpression { + expression: DevRev.BooleanExpression; +} diff --git a/src/api/types/BooleanExpressionOrExpression.ts b/src/api/types/BooleanExpressionOrExpression.ts new file mode 100644 index 0000000..4fb0bab --- /dev/null +++ b/src/api/types/BooleanExpressionOrExpression.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * All the expressions would be 'or'ed together. + */ +export interface BooleanExpressionOrExpression { + expressions: DevRev.BooleanExpression[]; +} diff --git a/src/api/types/BooleanExpressionPrimitiveExpression.ts b/src/api/types/BooleanExpressionPrimitiveExpression.ts new file mode 100644 index 0000000..28f86aa --- /dev/null +++ b/src/api/types/BooleanExpressionPrimitiveExpression.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The primitive expression type. + */ +export type BooleanExpressionPrimitiveExpression = Record; diff --git a/src/api/types/BooleanExpressionType.ts b/src/api/types/BooleanExpressionType.ts new file mode 100644 index 0000000..f183c3f --- /dev/null +++ b/src/api/types/BooleanExpressionType.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type BooleanExpressionType = "and" | "not" | "or" | "primitive"; + +export const BooleanExpressionType = { + And: "and", + Not: "not", + Or: "or", + Primitive: "primitive", +} as const; diff --git a/src/api/types/Capability.ts b/src/api/types/Capability.ts new file mode 100644 index 0000000..dcbc111 --- /dev/null +++ b/src/api/types/Capability.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Capability = DevRev.PartBase; diff --git a/src/api/types/CapabilitySummary.ts b/src/api/types/CapabilitySummary.ts new file mode 100644 index 0000000..a716a0c --- /dev/null +++ b/src/api/types/CapabilitySummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CapabilitySummary = DevRev.PartBaseSummary; diff --git a/src/api/types/ClientContext.ts b/src/api/types/ClientContext.ts new file mode 100644 index 0000000..0d47868 --- /dev/null +++ b/src/api/types/ClientContext.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Properties of client to be used in track API. + */ +export interface ClientContext { + browser?: DevRev.ClientContextBrowser; + cpu?: DevRev.ClientContextCpu; + device?: DevRev.ClientContextDevice; + engine?: DevRev.ClientContextEngine; + /** IP address of the client. */ + ip?: string; + /** The client's locale, example: en-US. */ + locale?: string; + os?: DevRev.ClientContextOs; + page?: DevRev.ClientContextPage; + /** The client's timezone, example: Asia/Kolkata. */ + timezone?: string; + /** + * User agent of the client, example: Mozilla/5.0 (Macintosh; Intel + * Mac OS X. + */ + userAgent?: string; +} diff --git a/src/api/types/ClientContextBrowser.ts b/src/api/types/ClientContextBrowser.ts new file mode 100644 index 0000000..734a69d --- /dev/null +++ b/src/api/types/ClientContextBrowser.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Properties of client's browser to be used in track API. + */ +export interface ClientContextBrowser { + /** The browser's name, example: Chrome, Safari. */ + name?: string; + /** The browser's version, example: 53.0.2785.143. */ + version?: string; +} diff --git a/src/api/types/ClientContextCpu.ts b/src/api/types/ClientContextCpu.ts new file mode 100644 index 0000000..7cea43e --- /dev/null +++ b/src/api/types/ClientContextCpu.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Properties of client's CPU to be used in track API. + */ +export interface ClientContextCpu { + /** CPU architecture, example: amd64. */ + architecture?: string; +} diff --git a/src/api/types/ClientContextDevice.ts b/src/api/types/ClientContextDevice.ts new file mode 100644 index 0000000..1958107 --- /dev/null +++ b/src/api/types/ClientContextDevice.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Properties of client's device to be used in track API. + */ +export interface ClientContextDevice { + /** Device type, example: mobile, tablet, desktop. */ + type?: string; + /** Device manufacturer, example: Apple. */ + manufacturer?: string; + /** Device model, example: iphone 6s. */ + model?: string; +} diff --git a/src/api/types/ClientContextEngine.ts b/src/api/types/ClientContextEngine.ts new file mode 100644 index 0000000..410aafc --- /dev/null +++ b/src/api/types/ClientContextEngine.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Properties of client's engine to be used in track API. + */ +export interface ClientContextEngine { + /** The engine's name, example: Blink, WebKit. */ + name?: string; + /** The engine's version, example: 537.36. */ + version?: string; +} diff --git a/src/api/types/ClientContextOs.ts b/src/api/types/ClientContextOs.ts new file mode 100644 index 0000000..6504bb3 --- /dev/null +++ b/src/api/types/ClientContextOs.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Properties of client's OS to be used in track API. + */ +export interface ClientContextOs { + /** The OS's name, example : Windows, Mac OS X. */ + name?: string; + /** The OS's version, example : 10.11.1. */ + version?: string; +} diff --git a/src/api/types/ClientContextPage.ts b/src/api/types/ClientContextPage.ts new file mode 100644 index 0000000..4c758e6 --- /dev/null +++ b/src/api/types/ClientContextPage.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Properties of client's page to be used in track API. + */ +export interface ClientContextPage { + /** Page domain, example: devrev.ai */ + domain?: string; + /** Page path, example: /pricing */ + path?: string; + /** Page referrer, example: https://devrev.ai */ + referrer?: string; + /** Page title, example: Pricing */ + title?: string; + /** Page URL, example: https://devrev.ai/pricing */ + url?: string; +} diff --git a/src/api/types/CodeChange.ts b/src/api/types/CodeChange.ts new file mode 100644 index 0000000..676686d --- /dev/null +++ b/src/api/types/CodeChange.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CodeChange extends DevRev.AtomBase { + /** Name of the code branch in the repo. */ + branch?: string; + /** + * Time at which the code change corresponding to this object reached + * a closed or merged stage. For example, the time at which a Pull + * Request was either closed without merging or successfully merged. + */ + closedDate?: Date; + /** Commit ID of the merged commit in the target branch. */ + commitId?: string; + /** Detailed description of the contents of this change. */ + description?: string; + /** Unique external identifier for this change.e.g Pull Request URL. */ + externalIdentifier?: string; + filteredLoc?: DevRev.LinesOfCode; + /** URL pointing to the repo this change was on. */ + repoUrl?: string; + source?: DevRev.CodeChangeSource; + /** Name of the target branch in the repo. */ + targetBranch?: string; + /** Title describing in brief the contents of this change. */ + title?: string; + totalLoc?: DevRev.LinesOfCode; +} diff --git a/src/api/types/CodeChangeSource.ts b/src/api/types/CodeChangeSource.ts new file mode 100644 index 0000000..0e2a4ac --- /dev/null +++ b/src/api/types/CodeChangeSource.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Source of the code change object. + */ +export type CodeChangeSource = "bitbucket" | "github"; + +export const CodeChangeSource = { + Bitbucket: "bitbucket", + Github: "github", +} as const; diff --git a/src/api/types/CodeChangesCreateRequest.ts b/src/api/types/CodeChangesCreateRequest.ts new file mode 100644 index 0000000..7a243bf --- /dev/null +++ b/src/api/types/CodeChangesCreateRequest.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CodeChangesCreateRequest = Record; diff --git a/src/api/types/CodeChangesCreateResponse.ts b/src/api/types/CodeChangesCreateResponse.ts new file mode 100644 index 0000000..3556e2c --- /dev/null +++ b/src/api/types/CodeChangesCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CodeChangesCreateResponse { + codeChange: DevRev.CodeChange; +} diff --git a/src/api/types/CodeChangesDeleteResponse.ts b/src/api/types/CodeChangesDeleteResponse.ts new file mode 100644 index 0000000..d6af7c8 --- /dev/null +++ b/src/api/types/CodeChangesDeleteResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CodeChangesDeleteResponse = Record; diff --git a/src/api/types/CodeChangesGetResponse.ts b/src/api/types/CodeChangesGetResponse.ts new file mode 100644 index 0000000..d7f4ee5 --- /dev/null +++ b/src/api/types/CodeChangesGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CodeChangesGetResponse { + codeChange: DevRev.CodeChange; +} diff --git a/src/api/types/CodeChangesListResponse.ts b/src/api/types/CodeChangesListResponse.ts new file mode 100644 index 0000000..4864938 --- /dev/null +++ b/src/api/types/CodeChangesListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CodeChangesListResponse { + /** The list of requested code change objects. */ + codeChanges: DevRev.CodeChange[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/CodeChangesUpdateResponse.ts b/src/api/types/CodeChangesUpdateResponse.ts new file mode 100644 index 0000000..910e65e --- /dev/null +++ b/src/api/types/CodeChangesUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CodeChangesUpdateResponse { + codeChange: DevRev.CodeChange; +} diff --git a/src/api/types/CommentSearchSummary.ts b/src/api/types/CommentSearchSummary.ts new file mode 100644 index 0000000..a9c2aff --- /dev/null +++ b/src/api/types/CommentSearchSummary.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CommentSearchSummary { + comment?: DevRev.TimelineCommentSummary; + createdBy?: DevRev.UserSummary; + /** Timestamp when the comment was created. */ + createdDate?: Date; + /** Text snippet where the search hit occurred. */ + snippet?: string; +} diff --git a/src/api/types/Conversation.ts b/src/api/types/Conversation.ts new file mode 100644 index 0000000..c6e1736 --- /dev/null +++ b/src/api/types/Conversation.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Conversation extends DevRev.AtomBase { + /** Description of the conversation object. */ + description?: string; + group?: DevRev.GroupSummary; + /** The users in the conversation. */ + members: DevRev.UserSummary[]; + /** The latest messages on the conversation. */ + messages?: DevRev.TimelineEntry[]; + metadata?: DevRev.ConversationMetadata; + /** Owner IDs for the conversation. */ + ownedBy?: DevRev.UserSummary[]; + slaTracker?: DevRev.SlaTrackerSummary; + stage?: DevRev.LegacyStage; + /** Tags associated with the object. */ + tags?: DevRev.TagWithValue[]; + /** Title of the conversation object. */ + title?: string; +} diff --git a/src/api/types/ConversationMetadata.ts b/src/api/types/ConversationMetadata.ts new file mode 100644 index 0000000..a1afc38 --- /dev/null +++ b/src/api/types/ConversationMetadata.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Metadata on conversation. + */ +export interface ConversationMetadata { + /** + * URL from which the conversation was created if the conversation was + * created via PLuG. + */ + urlContext?: string; +} diff --git a/src/api/types/ConversationSearchSummary.ts b/src/api/types/ConversationSearchSummary.ts new file mode 100644 index 0000000..e36800b --- /dev/null +++ b/src/api/types/ConversationSearchSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ConversationSearchSummary extends DevRev.SearchSummaryBase { + /** Comments on the work. */ + comments?: DevRev.CommentSearchSummary[]; + conversation: DevRev.ConversationSummary; +} diff --git a/src/api/types/ConversationSummary.ts b/src/api/types/ConversationSummary.ts new file mode 100644 index 0000000..a62b050 --- /dev/null +++ b/src/api/types/ConversationSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ConversationSummary extends DevRev.AtomBaseSummary { + /** Title of the conversation object. */ + title?: string; +} diff --git a/src/api/types/ConversationsCreateRequestMessage.ts b/src/api/types/ConversationsCreateRequestMessage.ts new file mode 100644 index 0000000..c5bb798 --- /dev/null +++ b/src/api/types/ConversationsCreateRequestMessage.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ConversationsCreateRequestMessage { + /** The IDs of the artifacts to the message. */ + artifacts?: string[]; + /** The message's body. */ + body?: string; +} diff --git a/src/api/types/ConversationsCreateRequestMetadata.ts b/src/api/types/ConversationsCreateRequestMetadata.ts new file mode 100644 index 0000000..5cac8e7 --- /dev/null +++ b/src/api/types/ConversationsCreateRequestMetadata.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ConversationsCreateRequestMetadata { + urlContext?: string; +} diff --git a/src/api/types/ConversationsCreateRequestTypeValue.ts b/src/api/types/ConversationsCreateRequestTypeValue.ts new file mode 100644 index 0000000..5d99531 --- /dev/null +++ b/src/api/types/ConversationsCreateRequestTypeValue.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ConversationsCreateRequestTypeValue = "support"; diff --git a/src/api/types/ConversationsCreateResponse.ts b/src/api/types/ConversationsCreateResponse.ts new file mode 100644 index 0000000..1072e17 --- /dev/null +++ b/src/api/types/ConversationsCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to creating a new conversation. + */ +export interface ConversationsCreateResponse { + conversation: DevRev.Conversation; +} diff --git a/src/api/types/ConversationsDeleteResponse.ts b/src/api/types/ConversationsDeleteResponse.ts new file mode 100644 index 0000000..1fa2560 --- /dev/null +++ b/src/api/types/ConversationsDeleteResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The response for deleting a conversation. + */ +export type ConversationsDeleteResponse = Record; diff --git a/src/api/types/ConversationsExportResponse.ts b/src/api/types/ConversationsExportResponse.ts new file mode 100644 index 0000000..6a41af0 --- /dev/null +++ b/src/api/types/ConversationsExportResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ConversationsExportResponse { + /** The resulting collection of conversation items. */ + conversations: DevRev.Conversation[]; +} diff --git a/src/api/types/ConversationsGetResponse.ts b/src/api/types/ConversationsGetResponse.ts new file mode 100644 index 0000000..2e1d83f --- /dev/null +++ b/src/api/types/ConversationsGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to getting a conversation's information. + */ +export interface ConversationsGetResponse { + conversation: DevRev.Conversation; +} diff --git a/src/api/types/ConversationsListResponse.ts b/src/api/types/ConversationsListResponse.ts new file mode 100644 index 0000000..652382a --- /dev/null +++ b/src/api/types/ConversationsListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to listing the conversations. + */ +export interface ConversationsListResponse { + /** The list of conversations. */ + conversations: DevRev.Conversation[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/ConversationsUpdateRequestAppliesToParts.ts b/src/api/types/ConversationsUpdateRequestAppliesToParts.ts new file mode 100644 index 0000000..4cd0609 --- /dev/null +++ b/src/api/types/ConversationsUpdateRequestAppliesToParts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ConversationsUpdateRequestAppliesToParts { + /** Updates the parts that the conversation applies to. */ + set?: string[]; +} diff --git a/src/api/types/ConversationsUpdateRequestMetadata.ts b/src/api/types/ConversationsUpdateRequestMetadata.ts new file mode 100644 index 0000000..b50faaf --- /dev/null +++ b/src/api/types/ConversationsUpdateRequestMetadata.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ConversationsUpdateRequestMetadata { + urlContext?: string; +} diff --git a/src/api/types/ConversationsUpdateRequestTags.ts b/src/api/types/ConversationsUpdateRequestTags.ts new file mode 100644 index 0000000..342e46e --- /dev/null +++ b/src/api/types/ConversationsUpdateRequestTags.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ConversationsUpdateRequestTags { + /** Sets the tag IDs to the provided tags. */ + set?: DevRev.SetTagWithValue[]; +} diff --git a/src/api/types/ConversationsUpdateRequestUserSessions.ts b/src/api/types/ConversationsUpdateRequestUserSessions.ts new file mode 100644 index 0000000..236d446 --- /dev/null +++ b/src/api/types/ConversationsUpdateRequestUserSessions.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ConversationsUpdateRequestUserSessions { + /** The updated user sessions that the conversation is associated with. */ + set?: string[]; +} diff --git a/src/api/types/ConversationsUpdateResponse.ts b/src/api/types/ConversationsUpdateResponse.ts new file mode 100644 index 0000000..3b2f9a9 --- /dev/null +++ b/src/api/types/ConversationsUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response for updating a conversation. + */ +export interface ConversationsUpdateResponse { + conversation: DevRev.Conversation; +} diff --git a/src/api/types/CreateEmailInfo.ts b/src/api/types/CreateEmailInfo.ts new file mode 100644 index 0000000..5a70954 --- /dev/null +++ b/src/api/types/CreateEmailInfo.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Information related to an email. + */ +export interface CreateEmailInfo { + /** The address of the email address. */ + address: string; + /** The name of the email address. */ + name?: string; + /** The ID of the user associated with the email address. */ + user?: string; +} diff --git a/src/api/types/CreateEmailInlineAttachment.ts b/src/api/types/CreateEmailInlineAttachment.ts new file mode 100644 index 0000000..c5995ad --- /dev/null +++ b/src/api/types/CreateEmailInlineAttachment.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * An inline attachment. + */ +export interface CreateEmailInlineAttachment { + /** The artifact of the attachment. */ + artifact?: string; + /** The content id of the attachment. */ + contentId?: string; +} diff --git a/src/api/types/CreateEmailPreviewWidget.ts b/src/api/types/CreateEmailPreviewWidget.ts new file mode 100644 index 0000000..410faeb --- /dev/null +++ b/src/api/types/CreateEmailPreviewWidget.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * An email preview widget. + */ +export interface CreateEmailPreviewWidget { + /** The list of bcc addresses. */ + bcc?: DevRev.CreateEmailInfo[]; + /** The list of cc addresses. */ + cc?: DevRev.CreateEmailInfo[]; + /** The list of from addresses. */ + from?: DevRev.CreateEmailInfo[]; + /** The html body of the email. */ + htmlBody?: string; + /** The in reply to of the email. */ + inReplyTo?: string; + /** The list of inline attachments. */ + inlines?: DevRev.CreateEmailInlineAttachment[]; + /** Whether the email is spam. */ + isSpam?: boolean; + /** The message id of the email. */ + messageId?: string; + /** The raw email artifact. */ + rawEmailArtifact?: string; + /** The list of references in the email. */ + references?: string[]; + /** The list of reply to addresses. */ + replyTo?: DevRev.CreateEmailInfo[]; + /** The time the email was sent. */ + sentTimestamp?: Date; + /** The subject of the email. */ + subject?: string; + /** The text body of the email. */ + textBody?: string; + /** The list of to addresses. */ + to?: DevRev.CreateEmailInfo[]; +} diff --git a/src/api/types/CreateOrgScheduleInterval.ts b/src/api/types/CreateOrgScheduleInterval.ts new file mode 100644 index 0000000..140257c --- /dev/null +++ b/src/api/types/CreateOrgScheduleInterval.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CreateOrgScheduleInterval { + /** Date (inclusive) on which the interval begins. */ + from: Date; + /** + * If true, no organization schedule is looked up for these days and + * they are marked as holidays. + */ + isExcluded?: boolean; + /** + * The name of the period, for example the event or holiday it + * represents. + */ + name: string; + /** + * Date (exclusive) on which the interval ends. If omitted, it is a + * single day interval. + */ + to?: Date; +} diff --git a/src/api/types/CreateWeeklyOrgScheduleInterval.ts b/src/api/types/CreateWeeklyOrgScheduleInterval.ts new file mode 100644 index 0000000..6e7b44e --- /dev/null +++ b/src/api/types/CreateWeeklyOrgScheduleInterval.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CreateWeeklyOrgScheduleInterval { + /** + * Duration in minutes of the week when the interval starts. 0 is + * Sunday midnight, when Sunday ends and Monday begins. + */ + from: number; + /** + * Duration in minutes of the week when the interval ends (must be + * larger than 'from'). 0 is Sunday midnight, when Sunday ends and + * Monday begins. + */ + to: number; +} diff --git a/src/api/types/CuratedVistaSummary.ts b/src/api/types/CuratedVistaSummary.ts new file mode 100644 index 0000000..4c28445 --- /dev/null +++ b/src/api/types/CuratedVistaSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Static collection of Devrev objects. + */ +export type CuratedVistaSummary = DevRev.VistaBaseSummary; diff --git a/src/api/types/CustomObjectSearchSummary.ts b/src/api/types/CustomObjectSearchSummary.ts new file mode 100644 index 0000000..4d2a966 --- /dev/null +++ b/src/api/types/CustomObjectSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomObjectSearchSummary extends DevRev.SearchSummaryBase { + customObject: DevRev.CustomObjectSummary; +} diff --git a/src/api/types/CustomObjectSummary.ts b/src/api/types/CustomObjectSummary.ts new file mode 100644 index 0000000..55bb8da --- /dev/null +++ b/src/api/types/CustomObjectSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomObjectSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/CustomSchemaFragment.ts b/src/api/types/CustomSchemaFragment.ts new file mode 100644 index 0000000..9165da2 --- /dev/null +++ b/src/api/types/CustomSchemaFragment.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomSchemaFragment = + | DevRev.CustomSchemaFragment.AppFragment + | DevRev.CustomSchemaFragment.CustomTypeFragment + | DevRev.CustomSchemaFragment.TenantFragment; + +export declare namespace CustomSchemaFragment { + interface AppFragment extends DevRev.AppFragment { + type: "app_fragment"; + } + + interface CustomTypeFragment extends DevRev.CustomTypeFragment { + type: "custom_type_fragment"; + } + + interface TenantFragment extends DevRev.CustomSchemaFragmentBase { + type: "tenant_fragment"; + } +} diff --git a/src/api/types/CustomSchemaFragmentBase.ts b/src/api/types/CustomSchemaFragmentBase.ts new file mode 100644 index 0000000..776beaa --- /dev/null +++ b/src/api/types/CustomSchemaFragmentBase.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomSchemaFragmentBase extends DevRev.AtomBase { + /** The conditions associated with the fields. */ + conditions?: DevRev.CustomSchemaFragmentCondition[]; + /** + * Indicates if the fragment has been deprecated. Modifications to + * this field are done in-place and don't result in creation of a new + * fragment in chain. + */ + deprecated?: boolean; + /** Description of the custom schema fragment. */ + description?: string; + /** List of all fields in this custom schema fragment. */ + fields?: DevRev.SchemaFieldDescriptor[]; + fragmentType?: DevRev.CustomSchemaFragmentFragmentType; + /** Leaf type this fragment applies to. */ + leafType?: string; + newFragmentRef?: DevRev.CustomSchemaFragmentSummary; + oldFragmentRef?: DevRev.CustomSchemaFragmentSummary; +} diff --git a/src/api/types/CustomSchemaFragmentBaseSummary.ts b/src/api/types/CustomSchemaFragmentBaseSummary.ts new file mode 100644 index 0000000..8b16d92 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentBaseSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomSchemaFragmentBaseSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/CustomSchemaFragmentCondition.ts b/src/api/types/CustomSchemaFragmentCondition.ts new file mode 100644 index 0000000..82a622e --- /dev/null +++ b/src/api/types/CustomSchemaFragmentCondition.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The condition associated with a field. + */ +export type CustomSchemaFragmentCondition = Record; diff --git a/src/api/types/CustomSchemaFragmentFragmentType.ts b/src/api/types/CustomSchemaFragmentFragmentType.ts new file mode 100644 index 0000000..3b5e867 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentFragmentType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of the custom schema fragment. + */ +export type CustomSchemaFragmentFragmentType = "app" | "custom_type" | "tenant"; + +export const CustomSchemaFragmentFragmentType = { + App: "app", + CustomType: "custom_type", + Tenant: "tenant", +} as const; diff --git a/src/api/types/CustomSchemaFragmentSummary.ts b/src/api/types/CustomSchemaFragmentSummary.ts new file mode 100644 index 0000000..d2287b8 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomSchemaFragmentSummary = + | DevRev.CustomSchemaFragmentSummary.AppFragment + | DevRev.CustomSchemaFragmentSummary.CustomTypeFragment + | DevRev.CustomSchemaFragmentSummary.TenantFragment; + +export declare namespace CustomSchemaFragmentSummary { + interface AppFragment extends DevRev.AtomBaseSummary { + type: "app_fragment"; + } + + interface CustomTypeFragment extends DevRev.AtomBaseSummary { + type: "custom_type_fragment"; + } + + interface TenantFragment extends DevRev.AtomBaseSummary { + type: "tenant_fragment"; + } +} diff --git a/src/api/types/CustomSchemaFragmentType.ts b/src/api/types/CustomSchemaFragmentType.ts new file mode 100644 index 0000000..6eb14e5 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentType.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CustomSchemaFragmentType = "app_fragment" | "custom_type_fragment" | "tenant_fragment"; + +export const CustomSchemaFragmentType = { + AppFragment: "app_fragment", + CustomTypeFragment: "custom_type_fragment", + TenantFragment: "tenant_fragment", +} as const; diff --git a/src/api/types/CustomSchemaFragmentsGetResponse.ts b/src/api/types/CustomSchemaFragmentsGetResponse.ts new file mode 100644 index 0000000..148ab08 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomSchemaFragmentsGetResponse { + fragment: DevRev.CustomSchemaFragment; +} diff --git a/src/api/types/CustomSchemaFragmentsListRequestPrune.ts b/src/api/types/CustomSchemaFragmentsListRequestPrune.ts new file mode 100644 index 0000000..1c3196d --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsListRequestPrune.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CustomSchemaFragmentsListRequestPrune = "fields"; diff --git a/src/api/types/CustomSchemaFragmentsListResponse.ts b/src/api/types/CustomSchemaFragmentsListResponse.ts new file mode 100644 index 0000000..0f92537 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomSchemaFragmentsListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The custom schema fragments. */ + result: DevRev.CustomSchemaFragment[]; +} diff --git a/src/api/types/CustomSchemaFragmentsSetRequest.ts b/src/api/types/CustomSchemaFragmentsSetRequest.ts new file mode 100644 index 0000000..5d6baff --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsSetRequest.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomSchemaFragmentsSetRequest = + | DevRev.CustomSchemaFragmentsSetRequest.AppFragment + | DevRev.CustomSchemaFragmentsSetRequest.CustomTypeFragment + | DevRev.CustomSchemaFragmentsSetRequest.TenantFragment; + +export declare namespace CustomSchemaFragmentsSetRequest { + interface AppFragment extends DevRev.CustomSchemaFragmentsSetRequestAppFragment, _Base { + type: "app_fragment"; + } + + interface CustomTypeFragment extends DevRev.CustomSchemaFragmentsSetRequestCustomTypeFragment, _Base { + type: "custom_type_fragment"; + } + + interface TenantFragment extends DevRev.CustomSchemaFragmentsSetRequestTenantFragment, _Base { + type: "tenant_fragment"; + } + + interface _Base { + /** List of conditions for this fragment. */ + conditions?: DevRev.CustomSchemaFragmentCondition[]; + /** List of field names which are being dropped. */ + deletedFields?: string[]; + /** Whether this fragment has been deprecated. */ + deprecated?: boolean; + /** The description of the custom schema fragment. */ + description: string; + /** List of all fields in this fragment. */ + fields?: DevRev.SchemaFieldDescriptor[]; + /** Whether the leaf type corresponds to a custom object */ + isCustomLeafType?: boolean; + /** The leaf type this fragment applies to. */ + leafType: string; + } +} diff --git a/src/api/types/CustomSchemaFragmentsSetRequestAppFragment.ts b/src/api/types/CustomSchemaFragmentsSetRequestAppFragment.ts new file mode 100644 index 0000000..0bb6cac --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsSetRequestAppFragment.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CustomSchemaFragmentsSetRequestAppFragment { + /** The app this fragment applies to. */ + app: string; +} diff --git a/src/api/types/CustomSchemaFragmentsSetRequestCustomTypeFragment.ts b/src/api/types/CustomSchemaFragmentsSetRequestCustomTypeFragment.ts new file mode 100644 index 0000000..6176451 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsSetRequestCustomTypeFragment.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomSchemaFragmentsSetRequestCustomTypeFragment { + /** + * Path components used to display available custom types in tree + * form. + */ + path?: DevRev.CustomTypePathComponent[]; + /** The ID of the associated custom stage diagram. */ + stageDiagram?: string; + /** List of Per-DevOrg stock field overrides. */ + stockFieldOverrides?: DevRev.StockFieldOverride[]; + /** The string used to populate the subtype in the leaf type. */ + subtype: string; + /** The display name of the subtype. */ + subtypeDisplayName?: string; +} diff --git a/src/api/types/CustomSchemaFragmentsSetRequestTenantFragment.ts b/src/api/types/CustomSchemaFragmentsSetRequestTenantFragment.ts new file mode 100644 index 0000000..46e2201 --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsSetRequestTenantFragment.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomSchemaFragmentsSetRequestTenantFragment { + /** The display ID prefix for the custom object. */ + idPrefix?: string; + /** List of Per-DevOrg stock field overrides. */ + stockFieldOverrides?: DevRev.StockFieldOverride[]; +} diff --git a/src/api/types/CustomSchemaFragmentsSetRequestType.ts b/src/api/types/CustomSchemaFragmentsSetRequestType.ts new file mode 100644 index 0000000..5acca9e --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsSetRequestType.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type CustomSchemaFragmentsSetRequestType = "app_fragment" | "custom_type_fragment" | "tenant_fragment"; + +export const CustomSchemaFragmentsSetRequestType = { + AppFragment: "app_fragment", + CustomTypeFragment: "custom_type_fragment", + TenantFragment: "tenant_fragment", +} as const; diff --git a/src/api/types/CustomSchemaFragmentsSetResponse.ts b/src/api/types/CustomSchemaFragmentsSetResponse.ts new file mode 100644 index 0000000..25a512b --- /dev/null +++ b/src/api/types/CustomSchemaFragmentsSetResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface CustomSchemaFragmentsSetResponse { + /** The ID of the custom schema fragment. */ + id: string; +} diff --git a/src/api/types/CustomSchemaSpec.ts b/src/api/types/CustomSchemaSpec.ts new file mode 100644 index 0000000..426a70a --- /dev/null +++ b/src/api/types/CustomSchemaSpec.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Requested custom schemas described abstractly. Every provided schema's + * custom field must be specified, otherwise a bad request error is + * returned. If a new custom schema specifier is provided, then it will be + * added to the work, otherwise if a custom schema is omitted from the + * specifier, it remains unmodified. + */ +export interface CustomSchemaSpec { + /** List of apps that are requested. */ + apps?: string[]; + /** Name of the subtype requested. */ + subtype?: string; + /** Whether the tenant schema is requested. */ + tenantFragment?: boolean; + /** Whether to enforce required fields validation. */ + validateRequiredFields?: boolean; +} diff --git a/src/api/types/CustomStage.ts b/src/api/types/CustomStage.ts new file mode 100644 index 0000000..8a13c10 --- /dev/null +++ b/src/api/types/CustomStage.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomStage = DevRev.AtomBase; diff --git a/src/api/types/CustomStageSummary.ts b/src/api/types/CustomStageSummary.ts new file mode 100644 index 0000000..403d76c --- /dev/null +++ b/src/api/types/CustomStageSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomStageSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/CustomStagesCreateResponse.ts b/src/api/types/CustomStagesCreateResponse.ts new file mode 100644 index 0000000..9beb616 --- /dev/null +++ b/src/api/types/CustomStagesCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStagesCreateResponse { + customStage: DevRev.CustomStage; +} diff --git a/src/api/types/CustomStagesGetResponse.ts b/src/api/types/CustomStagesGetResponse.ts new file mode 100644 index 0000000..7f57f6a --- /dev/null +++ b/src/api/types/CustomStagesGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStagesGetResponse { + customStage: DevRev.CustomStage; +} diff --git a/src/api/types/CustomStagesListResponse.ts b/src/api/types/CustomStagesListResponse.ts new file mode 100644 index 0000000..d4970ee --- /dev/null +++ b/src/api/types/CustomStagesListResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStagesListResponse { + /** + * The cursor to resume iteration from, otherwise if not provided, + * then iteration starts from the beginning. + */ + cursor?: string; + /** The custom stages. */ + result: DevRev.CustomStage[]; +} diff --git a/src/api/types/CustomStagesUpdateResponse.ts b/src/api/types/CustomStagesUpdateResponse.ts new file mode 100644 index 0000000..0c55a68 --- /dev/null +++ b/src/api/types/CustomStagesUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStagesUpdateResponse { + customStage: DevRev.CustomStage; +} diff --git a/src/api/types/CustomState.ts b/src/api/types/CustomState.ts new file mode 100644 index 0000000..2aded07 --- /dev/null +++ b/src/api/types/CustomState.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomState = DevRev.AtomBase; diff --git a/src/api/types/CustomStatesCreateResponse.ts b/src/api/types/CustomStatesCreateResponse.ts new file mode 100644 index 0000000..1347ff4 --- /dev/null +++ b/src/api/types/CustomStatesCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStatesCreateResponse { + customState: DevRev.CustomState; +} diff --git a/src/api/types/CustomStatesGetResponse.ts b/src/api/types/CustomStatesGetResponse.ts new file mode 100644 index 0000000..689026e --- /dev/null +++ b/src/api/types/CustomStatesGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStatesGetResponse { + customState: DevRev.CustomState; +} diff --git a/src/api/types/CustomStatesListResponse.ts b/src/api/types/CustomStatesListResponse.ts new file mode 100644 index 0000000..3e7535d --- /dev/null +++ b/src/api/types/CustomStatesListResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStatesListResponse { + /** + * The cursor to resume iteration from, otherwise if not provided, + * then iteration starts from the beginning. + */ + cursor?: string; + /** The custom states. */ + result: DevRev.CustomState[]; +} diff --git a/src/api/types/CustomStatesUpdateResponse.ts b/src/api/types/CustomStatesUpdateResponse.ts new file mode 100644 index 0000000..be2aa62 --- /dev/null +++ b/src/api/types/CustomStatesUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomStatesUpdateResponse { + customState: DevRev.CustomState; +} diff --git a/src/api/types/CustomTypeFragment.ts b/src/api/types/CustomTypeFragment.ts new file mode 100644 index 0000000..e9e6896 --- /dev/null +++ b/src/api/types/CustomTypeFragment.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface CustomTypeFragment extends DevRev.CustomSchemaFragmentBase { + stageDiagram?: DevRev.StageDiagramSummary; + /** The string used to populate the subtype in the leaf type. */ + subtype?: string; + /** + * Display name of the subtype. Modifications to this field are done + * in-place and don't result in creation of a new fragment in chain. + */ + subtypeDisplayName?: string; +} diff --git a/src/api/types/CustomTypeFragmentSummary.ts b/src/api/types/CustomTypeFragmentSummary.ts new file mode 100644 index 0000000..fcd88db --- /dev/null +++ b/src/api/types/CustomTypeFragmentSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type CustomTypeFragmentSummary = DevRev.CustomSchemaFragmentBaseSummary; diff --git a/src/api/types/CustomTypePathComponent.ts b/src/api/types/CustomTypePathComponent.ts new file mode 100644 index 0000000..71453d3 --- /dev/null +++ b/src/api/types/CustomTypePathComponent.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Path component for rendering custom type lists in tree form. + */ +export type CustomTypePathComponent = Record; diff --git a/src/api/types/DashboardSearchSummary.ts b/src/api/types/DashboardSearchSummary.ts new file mode 100644 index 0000000..bf002ec --- /dev/null +++ b/src/api/types/DashboardSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface DashboardSearchSummary extends DevRev.SearchSummaryBase { + dashboard: DevRev.DashboardSummary; +} diff --git a/src/api/types/DashboardSummary.ts b/src/api/types/DashboardSummary.ts new file mode 100644 index 0000000..4e47709 --- /dev/null +++ b/src/api/types/DashboardSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type DashboardSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/DateFilter.ts b/src/api/types/DateFilter.ts new file mode 100644 index 0000000..a6bccb4 --- /dev/null +++ b/src/api/types/DateFilter.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Provides ways to specify date ranges on objects. + */ +export type DateFilter = DevRev.DateFilter.Preset | DevRev.DateFilter.Range; + +export declare namespace DateFilter { + interface Preset { + type: "preset"; + value: DevRev.DateTimePreset; + } + + interface Range extends DevRev.DateTimeFilter { + type: "range"; + } +} diff --git a/src/api/types/DateFilterType.ts b/src/api/types/DateFilterType.ts new file mode 100644 index 0000000..0cdfca2 --- /dev/null +++ b/src/api/types/DateFilterType.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of date filter. + */ +export type DateFilterType = "preset" | "range"; + +export const DateFilterType = { + Preset: "preset", + Range: "range", +} as const; diff --git a/src/api/types/DateTimeFilter.ts b/src/api/types/DateTimeFilter.ts new file mode 100644 index 0000000..ef379b7 --- /dev/null +++ b/src/api/types/DateTimeFilter.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DateTimeFilter { + /** + * Filters for objects created after the provided timestamp + * (inclusive). + */ + after?: Date; + /** + * Filters for objects created before the provided timestamp + * (inclusive). + */ + before?: Date; +} diff --git a/src/api/types/DateTimePreset.ts b/src/api/types/DateTimePreset.ts new file mode 100644 index 0000000..1832740 --- /dev/null +++ b/src/api/types/DateTimePreset.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Provides preset types for date filter. + */ +export type DateTimePreset = DevRev.DateTimePreset.LastNDays | DevRev.DateTimePreset.NextNDays; + +export declare namespace DateTimePreset { + interface LastNDays extends DevRev.DateTimePresetLastNDays { + presetType: "last_n_days"; + } + + interface NextNDays extends DevRev.DateTimePresetNextNDays { + presetType: "next_n_days"; + } +} diff --git a/src/api/types/DateTimePresetLastNDays.ts b/src/api/types/DateTimePresetLastNDays.ts new file mode 100644 index 0000000..643b102 --- /dev/null +++ b/src/api/types/DateTimePresetLastNDays.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DateTimePresetLastNDays { + /** + * The range starts from the current timestamp and continues for the + * past n days. + */ + days: number; +} diff --git a/src/api/types/DateTimePresetNextNDays.ts b/src/api/types/DateTimePresetNextNDays.ts new file mode 100644 index 0000000..4af6c69 --- /dev/null +++ b/src/api/types/DateTimePresetNextNDays.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DateTimePresetNextNDays { + /** + * The range starts from the current timestamp and continues for the + * next n days. + */ + days: number; +} diff --git a/src/api/types/DateTimePresetType.ts b/src/api/types/DateTimePresetType.ts new file mode 100644 index 0000000..567de29 --- /dev/null +++ b/src/api/types/DateTimePresetType.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of date preset. + */ +export type DateTimePresetType = "last_n_days" | "next_n_days"; + +export const DateTimePresetType = { + LastNDays: "last_n_days", + NextNDays: "next_n_days", +} as const; diff --git a/src/api/types/DevUser.ts b/src/api/types/DevUser.ts new file mode 100644 index 0000000..1a0d50f --- /dev/null +++ b/src/api/types/DevUser.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface DevUser extends DevRev.UserBase { + /** Start date of the user's employment. */ + experienceStartDate?: Date; + /** IDs of the Dev User outside the DevRev SOR. */ + externalIdentities?: DevRev.ExternalIdentity[]; + /** Job history of the user. */ + jobHistory?: DevRev.JobHistoryItem[]; + /** Array of skills of the user. */ + skills?: DevRev.UserSkill[]; +} diff --git a/src/api/types/DevUserJobTitle.ts b/src/api/types/DevUserJobTitle.ts new file mode 100644 index 0000000..65d9cfb --- /dev/null +++ b/src/api/types/DevUserJobTitle.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Job title of the Dev User. + */ +export type DevUserJobTitle = + | "customer_success_manager" + | "cxo" + | "designer" + | "developer" + | "head_of_support" + | "operations" + | "others" + | "product_manager" + | "qa" + | "revenue_leader" + | "support" + | "tech_lead"; + +export const DevUserJobTitle = { + CustomerSuccessManager: "customer_success_manager", + Cxo: "cxo", + Designer: "designer", + Developer: "developer", + HeadOfSupport: "head_of_support", + Operations: "operations", + Others: "others", + ProductManager: "product_manager", + Qa: "qa", + RevenueLeader: "revenue_leader", + Support: "support", + TechLead: "tech_lead", +} as const; diff --git a/src/api/types/DevUserSummary.ts b/src/api/types/DevUserSummary.ts new file mode 100644 index 0000000..599fafd --- /dev/null +++ b/src/api/types/DevUserSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type DevUserSummary = DevRev.UserBaseSummary; diff --git a/src/api/types/DevUsersIdentitiesLinkResponse.ts b/src/api/types/DevUsersIdentitiesLinkResponse.ts new file mode 100644 index 0000000..228578f --- /dev/null +++ b/src/api/types/DevUsersIdentitiesLinkResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Response for the request to link an external identity to a Dev user. + */ +export interface DevUsersIdentitiesLinkResponse { + devUser: DevRev.DevUser; +} diff --git a/src/api/types/DevUsersIdentitiesUnlinkResponse.ts b/src/api/types/DevUsersIdentitiesUnlinkResponse.ts new file mode 100644 index 0000000..ab9f62a --- /dev/null +++ b/src/api/types/DevUsersIdentitiesUnlinkResponse.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Response for the request to unlink an external identity from a Dev + * user. + */ +export interface DevUsersIdentitiesUnlinkResponse { + devUser: DevRev.DevUser; +} diff --git a/src/api/types/DevUsersUpdateResponse.ts b/src/api/types/DevUsersUpdateResponse.ts new file mode 100644 index 0000000..b14d498 --- /dev/null +++ b/src/api/types/DevUsersUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to update a Dev user. + */ +export interface DevUsersUpdateResponse { + devUser: DevRev.DevUser; +} diff --git a/src/api/types/DirectorySummary.ts b/src/api/types/DirectorySummary.ts new file mode 100644 index 0000000..476b592 --- /dev/null +++ b/src/api/types/DirectorySummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type DirectorySummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/DynamicGroupInfo.ts b/src/api/types/DynamicGroupInfo.ts new file mode 100644 index 0000000..ec8590b --- /dev/null +++ b/src/api/types/DynamicGroupInfo.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Information to define dynamic groups. + */ +export type DynamicGroupInfo = Record; diff --git a/src/api/types/DynamicVistaSummary.ts b/src/api/types/DynamicVistaSummary.ts new file mode 100644 index 0000000..1abd01e --- /dev/null +++ b/src/api/types/DynamicVistaSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Dynamic collection of Devrev objects, all adhering to a specific + * filter. + */ +export type DynamicVistaSummary = DevRev.VistaBaseSummary; diff --git a/src/api/types/EmailInfo.ts b/src/api/types/EmailInfo.ts new file mode 100644 index 0000000..e377671 --- /dev/null +++ b/src/api/types/EmailInfo.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EmailInfo { + /** The email address. */ + address: string; + /** The email recipient's name. */ + name?: string; + user?: DevRev.UserSummary; +} diff --git a/src/api/types/EmailInlineAttachment.ts b/src/api/types/EmailInlineAttachment.ts new file mode 100644 index 0000000..7a2c744 --- /dev/null +++ b/src/api/types/EmailInlineAttachment.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EmailInlineAttachment { + artifact?: DevRev.ArtifactSummary; + /** The content id of the attachment. */ + contentId?: string; +} diff --git a/src/api/types/EmailPreviewWidget.ts b/src/api/types/EmailPreviewWidget.ts new file mode 100644 index 0000000..840ba06 --- /dev/null +++ b/src/api/types/EmailPreviewWidget.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EmailPreviewWidget extends DevRev.SnapWidgetBase { + /** The list of bcc addresses. */ + bcc: DevRev.EmailInfo[]; + /** The list of cc addresses. */ + cc: DevRev.EmailInfo[]; + /** The list of from addresses. */ + from: DevRev.EmailInfo[]; + /** The html body of the email. */ + htmlBody?: string; + /** The in-reply-to header of the email. */ + inReplyTo?: string; + /** The list of inline attachments. */ + inlines: DevRev.EmailInlineAttachment[]; + /** Whether the email is spam. */ + isSpam?: boolean; + /** The message id of the email. */ + messageId?: string; + rawEmailArtifact?: DevRev.ArtifactSummary; + /** The references header in the email. */ + references: string[]; + /** The list of reply to addresses. */ + replyTo: DevRev.EmailInfo[]; + /** The time the email was sent. */ + sentTimestamp?: Date; + /** The subject of the email. */ + subject?: string; + /** The text body of the email. */ + textBody?: string; + /** The list of to addresses. */ + to: DevRev.EmailInfo[]; +} diff --git a/src/api/types/Empty.ts b/src/api/types/Empty.ts new file mode 100644 index 0000000..d2854a5 --- /dev/null +++ b/src/api/types/Empty.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type Empty = Record; diff --git a/src/api/types/Engagement.ts b/src/api/types/Engagement.ts new file mode 100644 index 0000000..57945da --- /dev/null +++ b/src/api/types/Engagement.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Engagement extends DevRev.AtomBase { + /** Description of the engagement object. */ + description?: string; +} diff --git a/src/api/types/EngagementSummary.ts b/src/api/types/EngagementSummary.ts new file mode 100644 index 0000000..163a8c2 --- /dev/null +++ b/src/api/types/EngagementSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type EngagementSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/EngagementType.ts b/src/api/types/EngagementType.ts new file mode 100644 index 0000000..b26cd67 --- /dev/null +++ b/src/api/types/EngagementType.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of engagement. + */ +export type EngagementType = "call" | "default" | "email" | "linked_in" | "meeting" | "offline" | "survey"; + +export const EngagementType = { + Call: "call", + Default: "default", + Email: "email", + LinkedIn: "linked_in", + Meeting: "meeting", + Offline: "offline", + Survey: "survey", +} as const; diff --git a/src/api/types/EngagementsCountResponse.ts b/src/api/types/EngagementsCountResponse.ts new file mode 100644 index 0000000..9b1dd2a --- /dev/null +++ b/src/api/types/EngagementsCountResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EngagementsCountResponse { + /** The number of engagements matching the filter. */ + count: number; +} diff --git a/src/api/types/EngagementsCreateRequestEngagementType.ts b/src/api/types/EngagementsCreateRequestEngagementType.ts new file mode 100644 index 0000000..8a77ce6 --- /dev/null +++ b/src/api/types/EngagementsCreateRequestEngagementType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The type of engagement. + */ +export type EngagementsCreateRequestEngagementType = "call" | "default" | "email" | "linked_in" | "offline"; + +export const EngagementsCreateRequestEngagementType = { + Call: "call", + Default: "default", + Email: "email", + LinkedIn: "linked_in", + Offline: "offline", +} as const; diff --git a/src/api/types/EngagementsCreateResponse.ts b/src/api/types/EngagementsCreateResponse.ts new file mode 100644 index 0000000..3c4ce58 --- /dev/null +++ b/src/api/types/EngagementsCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EngagementsCreateResponse { + engagement: DevRev.Engagement; +} diff --git a/src/api/types/EngagementsDeleteResponse.ts b/src/api/types/EngagementsDeleteResponse.ts new file mode 100644 index 0000000..7fba500 --- /dev/null +++ b/src/api/types/EngagementsDeleteResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EngagementsDeleteResponse = Record; diff --git a/src/api/types/EngagementsGetResponse.ts b/src/api/types/EngagementsGetResponse.ts new file mode 100644 index 0000000..8c77dab --- /dev/null +++ b/src/api/types/EngagementsGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EngagementsGetResponse { + engagement: DevRev.Engagement; +} diff --git a/src/api/types/EngagementsListResponse.ts b/src/api/types/EngagementsListResponse.ts new file mode 100644 index 0000000..2bed4eb --- /dev/null +++ b/src/api/types/EngagementsListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EngagementsListResponse { + /** The list of engagements. */ + engagements: DevRev.Engagement[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/EngagementsUpdateRequestArtifactIds.ts b/src/api/types/EngagementsUpdateRequestArtifactIds.ts new file mode 100644 index 0000000..d3500af --- /dev/null +++ b/src/api/types/EngagementsUpdateRequestArtifactIds.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EngagementsUpdateRequestArtifactIds { + /** Sets the IDs to the provided artifact IDs. */ + set?: string[]; +} diff --git a/src/api/types/EngagementsUpdateRequestMembers.ts b/src/api/types/EngagementsUpdateRequestMembers.ts new file mode 100644 index 0000000..db5b053 --- /dev/null +++ b/src/api/types/EngagementsUpdateRequestMembers.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EngagementsUpdateRequestMembers { + /** + * Sets the members to the provided user IDs. If specified, this must + * not be empty. + */ + set?: string[]; +} diff --git a/src/api/types/EngagementsUpdateRequestTags.ts b/src/api/types/EngagementsUpdateRequestTags.ts new file mode 100644 index 0000000..2f71dd4 --- /dev/null +++ b/src/api/types/EngagementsUpdateRequestTags.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EngagementsUpdateRequestTags { + /** Sets the provided tags on the engagement item. */ + set?: DevRev.SetTagWithValue[]; +} diff --git a/src/api/types/EngagementsUpdateResponse.ts b/src/api/types/EngagementsUpdateResponse.ts new file mode 100644 index 0000000..bc5bbc2 --- /dev/null +++ b/src/api/types/EngagementsUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EngagementsUpdateResponse { + engagement: DevRev.Engagement; +} diff --git a/src/api/types/Enhancement.ts b/src/api/types/Enhancement.ts new file mode 100644 index 0000000..511a218 --- /dev/null +++ b/src/api/types/Enhancement.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Enhancement = DevRev.PartBase; diff --git a/src/api/types/EnhancementSummary.ts b/src/api/types/EnhancementSummary.ts new file mode 100644 index 0000000..64236cc --- /dev/null +++ b/src/api/types/EnhancementSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type EnhancementSummary = DevRev.PartBaseSummary; diff --git a/src/api/types/EnumValue.ts b/src/api/types/EnumValue.ts new file mode 100644 index 0000000..8ab0230 --- /dev/null +++ b/src/api/types/EnumValue.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Enum Value defines the structure for an enum. + */ +export interface EnumValue { + /** Unique ID of the enum value. This is immutable. */ + id: number; + /** Display label of the enum value. This is mutable. */ + label: string; + /** Order number of the enum value. This is mutable. */ + ordinal: number; +} diff --git a/src/api/types/ErrorBadRequest.ts b/src/api/types/ErrorBadRequest.ts new file mode 100644 index 0000000..d52f1a9 --- /dev/null +++ b/src/api/types/ErrorBadRequest.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorBadRequest extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorBadRequestArtifactAlreadyAttachedToAParent.ts b/src/api/types/ErrorBadRequestArtifactAlreadyAttachedToAParent.ts new file mode 100644 index 0000000..b28ad8d --- /dev/null +++ b/src/api/types/ErrorBadRequestArtifactAlreadyAttachedToAParent.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestArtifactAlreadyAttachedToAParent { + /** The existing parent attached to the artifact. */ + existingParent: string; + /** Whether the existing parent is the same as the new parent. */ + isSame: boolean; +} diff --git a/src/api/types/ErrorBadRequestBadRequest.ts b/src/api/types/ErrorBadRequestBadRequest.ts new file mode 100644 index 0000000..4da51e1 --- /dev/null +++ b/src/api/types/ErrorBadRequestBadRequest.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorBadRequestBadRequest = Record; diff --git a/src/api/types/ErrorBadRequestInvalidApiVersion.ts b/src/api/types/ErrorBadRequestInvalidApiVersion.ts new file mode 100644 index 0000000..5acd3ef --- /dev/null +++ b/src/api/types/ErrorBadRequestInvalidApiVersion.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestInvalidApiVersion { + /** The provided API version. */ + value: string; +} diff --git a/src/api/types/ErrorBadRequestInvalidEnumValue.ts b/src/api/types/ErrorBadRequestInvalidEnumValue.ts new file mode 100644 index 0000000..2b1602a --- /dev/null +++ b/src/api/types/ErrorBadRequestInvalidEnumValue.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestInvalidEnumValue { + /** The allowed values for the field. */ + allowedValues: string[]; + /** The field whose enum value is invalid. */ + fieldName: string; + /** The value that was received. */ + value: string; +} diff --git a/src/api/types/ErrorBadRequestInvalidField.ts b/src/api/types/ErrorBadRequestInvalidField.ts new file mode 100644 index 0000000..9304d92 --- /dev/null +++ b/src/api/types/ErrorBadRequestInvalidField.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestInvalidField { + /** The field name that's invalid. */ + fieldName: string; +} diff --git a/src/api/types/ErrorBadRequestInvalidId.ts b/src/api/types/ErrorBadRequestInvalidId.ts new file mode 100644 index 0000000..bb462d9 --- /dev/null +++ b/src/api/types/ErrorBadRequestInvalidId.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestInvalidId { + /** The field whose ID is invalid. */ + fieldName: string; +} diff --git a/src/api/types/ErrorBadRequestMergeWorksError.ts b/src/api/types/ErrorBadRequestMergeWorksError.ts new file mode 100644 index 0000000..bc9e11e --- /dev/null +++ b/src/api/types/ErrorBadRequestMergeWorksError.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorBadRequestMergeWorksError { + /** The errors encountered during the validation of the merge. */ + errors?: DevRev.ErrorBadRequestMergeWorksErrorError[]; +} diff --git a/src/api/types/ErrorBadRequestMergeWorksErrorError.ts b/src/api/types/ErrorBadRequestMergeWorksErrorError.ts new file mode 100644 index 0000000..7adf979 --- /dev/null +++ b/src/api/types/ErrorBadRequestMergeWorksErrorError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorBadRequestMergeWorksErrorError { + alreadyMerged?: DevRev.ErrorBadRequestMergeWorksErrorErrorAlreadyMerged; + closed?: DevRev.ErrorBadRequestMergeWorksErrorErrorClosed; + /** The details of the error. */ + details: string; + differentWorkspace?: DevRev.ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace; + invalidStageTransition?: DevRev.ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition; + subtype?: DevRev.ErrorBadRequestMergeWorksErrorErrorSubtype; + /** The ID of the work which failed the validation. */ + work: string; +} diff --git a/src/api/types/ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.ts b/src/api/types/ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.ts new file mode 100644 index 0000000..701446e --- /dev/null +++ b/src/api/types/ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestMergeWorksErrorErrorAlreadyMerged { + /** ID of the work into which the work was merged. */ + mergedInto: string; +} diff --git a/src/api/types/ErrorBadRequestMergeWorksErrorErrorClosed.ts b/src/api/types/ErrorBadRequestMergeWorksErrorErrorClosed.ts new file mode 100644 index 0000000..c188a38 --- /dev/null +++ b/src/api/types/ErrorBadRequestMergeWorksErrorErrorClosed.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorBadRequestMergeWorksErrorErrorClosed = Record; diff --git a/src/api/types/ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.ts b/src/api/types/ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.ts new file mode 100644 index 0000000..f3bc49a --- /dev/null +++ b/src/api/types/ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace { + /** The workspace of the primary work. */ + primaryWorkspace: string; + /** The workspace of the secondary work. */ + secondaryWorkspace: string; +} diff --git a/src/api/types/ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.ts b/src/api/types/ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.ts new file mode 100644 index 0000000..276a63f --- /dev/null +++ b/src/api/types/ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition { + /** The current stage of the work. */ + currentStage: string; + /** The stage to which the transition isn't allowed. */ + requestedStage: string; +} diff --git a/src/api/types/ErrorBadRequestMergeWorksErrorErrorSubtype.ts b/src/api/types/ErrorBadRequestMergeWorksErrorErrorSubtype.ts new file mode 100644 index 0000000..a019d43 --- /dev/null +++ b/src/api/types/ErrorBadRequestMergeWorksErrorErrorSubtype.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorBadRequestMergeWorksErrorErrorSubtype = + | "already_merged" + | "closed" + | "different_workspace" + | "invalid_stage_transition"; + +export const ErrorBadRequestMergeWorksErrorErrorSubtype = { + AlreadyMerged: "already_merged", + Closed: "closed", + DifferentWorkspace: "different_workspace", + InvalidStageTransition: "invalid_stage_transition", +} as const; diff --git a/src/api/types/ErrorBadRequestMissingDependency.ts b/src/api/types/ErrorBadRequestMissingDependency.ts new file mode 100644 index 0000000..d3eb031 --- /dev/null +++ b/src/api/types/ErrorBadRequestMissingDependency.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorBadRequestMissingDependency { + /** The dependent fields. */ + dependencies?: DevRev.ErrorBadRequestMissingDependencyDependency[]; + /** The field on which the value depends. */ + dependentFieldName?: string; + /** The value which needs to be set of the dependent field. */ + dependentFieldValue?: string; + /** The field whose value was received. */ + providedFieldName?: string; + /** The value that was received. */ + providedFieldValue?: string; +} diff --git a/src/api/types/ErrorBadRequestMissingDependencyDependency.ts b/src/api/types/ErrorBadRequestMissingDependencyDependency.ts new file mode 100644 index 0000000..56f1102 --- /dev/null +++ b/src/api/types/ErrorBadRequestMissingDependencyDependency.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestMissingDependencyDependency { + /** The dependent field name. */ + fieldName: string; + /** The dependent field value. */ + fieldValue: string; +} diff --git a/src/api/types/ErrorBadRequestMissingRequiredField.ts b/src/api/types/ErrorBadRequestMissingRequiredField.ts new file mode 100644 index 0000000..2412a33 --- /dev/null +++ b/src/api/types/ErrorBadRequestMissingRequiredField.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestMissingRequiredField { + /** The missing field's name. */ + fieldName: string; +} diff --git a/src/api/types/ErrorBadRequestParseError.ts b/src/api/types/ErrorBadRequestParseError.ts new file mode 100644 index 0000000..471affa --- /dev/null +++ b/src/api/types/ErrorBadRequestParseError.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorBadRequestParseError = Record; diff --git a/src/api/types/ErrorBadRequestStaleSchemaFragments.ts b/src/api/types/ErrorBadRequestStaleSchemaFragments.ts new file mode 100644 index 0000000..55d3deb --- /dev/null +++ b/src/api/types/ErrorBadRequestStaleSchemaFragments.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Error indicating that the request contained one or more stale schema + * fragments, which are schema fragments that have been replaced by a + * newer version and are therefore considered deprecated schema fragments. + * The caller should refresh and use the latest schema fragments in their + * request. + */ +export type ErrorBadRequestStaleSchemaFragments = Record; diff --git a/src/api/types/ErrorBadRequestType.ts b/src/api/types/ErrorBadRequestType.ts new file mode 100644 index 0000000..dfc61ec --- /dev/null +++ b/src/api/types/ErrorBadRequestType.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorBadRequestType = + | "artifact_already_attached_to_a_parent" + | "bad_request" + | "invalid_api_version" + | "invalid_enum_value" + | "invalid_field" + | "invalid_id" + | "merge_works_error" + | "missing_dependency" + | "missing_required_field" + | "parse_error" + | "stale_schema_fragments" + | "unexpected_id_type" + | "unexpected_json_type" + | "value_not_permitted"; + +export const ErrorBadRequestType = { + ArtifactAlreadyAttachedToAParent: "artifact_already_attached_to_a_parent", + BadRequest: "bad_request", + InvalidApiVersion: "invalid_api_version", + InvalidEnumValue: "invalid_enum_value", + InvalidField: "invalid_field", + InvalidId: "invalid_id", + MergeWorksError: "merge_works_error", + MissingDependency: "missing_dependency", + MissingRequiredField: "missing_required_field", + ParseError: "parse_error", + StaleSchemaFragments: "stale_schema_fragments", + UnexpectedIdType: "unexpected_id_type", + UnexpectedJsonType: "unexpected_json_type", + ValueNotPermitted: "value_not_permitted", +} as const; diff --git a/src/api/types/ErrorBadRequestUnexpectedIdType.ts b/src/api/types/ErrorBadRequestUnexpectedIdType.ts new file mode 100644 index 0000000..1f1e15c --- /dev/null +++ b/src/api/types/ErrorBadRequestUnexpectedIdType.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestUnexpectedIdType { + /** The field whose ID type is unexpected. */ + fieldName: string; +} diff --git a/src/api/types/ErrorBadRequestUnexpectedJsonType.ts b/src/api/types/ErrorBadRequestUnexpectedJsonType.ts new file mode 100644 index 0000000..8b6bf4e --- /dev/null +++ b/src/api/types/ErrorBadRequestUnexpectedJsonType.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorBadRequestUnexpectedJsonType { + actual: DevRev.ErrorBadRequestUnexpectedJsonTypeType; + expected: DevRev.ErrorBadRequestUnexpectedJsonTypeType; + /** The field name that's invalid. */ + fieldName: string; +} diff --git a/src/api/types/ErrorBadRequestUnexpectedJsonTypeType.ts b/src/api/types/ErrorBadRequestUnexpectedJsonTypeType.ts new file mode 100644 index 0000000..d708b24 --- /dev/null +++ b/src/api/types/ErrorBadRequestUnexpectedJsonTypeType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorBadRequestUnexpectedJsonTypeType = "array" | "bool" | "null" | "number" | "object" | "string"; + +export const ErrorBadRequestUnexpectedJsonTypeType = { + Array: "array", + Bool: "bool", + Null: "null", + Number: "number", + Object: "object", + String: "string", +} as const; diff --git a/src/api/types/ErrorBadRequestValueNotPermitted.ts b/src/api/types/ErrorBadRequestValueNotPermitted.ts new file mode 100644 index 0000000..dfcec8a --- /dev/null +++ b/src/api/types/ErrorBadRequestValueNotPermitted.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBadRequestValueNotPermitted { + /** The allowed values for the field. */ + allowedValues?: string[]; + /** The field whose value is not permitted. */ + fieldName: string; + /** The reason the value isn't permitted. */ + reason?: string; +} diff --git a/src/api/types/ErrorBase.ts b/src/api/types/ErrorBase.ts new file mode 100644 index 0000000..c58d908 --- /dev/null +++ b/src/api/types/ErrorBase.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ErrorBase { + /** Error detail information. */ + detail?: string; + /** The message associated with the error. */ + message?: string; +} diff --git a/src/api/types/ErrorConflict.ts b/src/api/types/ErrorConflict.ts new file mode 100644 index 0000000..33b39db --- /dev/null +++ b/src/api/types/ErrorConflict.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorConflict extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorConflictConflict.ts b/src/api/types/ErrorConflictConflict.ts new file mode 100644 index 0000000..dbfb438 --- /dev/null +++ b/src/api/types/ErrorConflictConflict.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorConflictConflict = Record; diff --git a/src/api/types/ErrorConflictType.ts b/src/api/types/ErrorConflictType.ts new file mode 100644 index 0000000..7d6f559 --- /dev/null +++ b/src/api/types/ErrorConflictType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorConflictType = "conflict"; diff --git a/src/api/types/ErrorForbidden.ts b/src/api/types/ErrorForbidden.ts new file mode 100644 index 0000000..fbb3083 --- /dev/null +++ b/src/api/types/ErrorForbidden.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorForbidden extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorForbiddenForbidden.ts b/src/api/types/ErrorForbiddenForbidden.ts new file mode 100644 index 0000000..648f285 --- /dev/null +++ b/src/api/types/ErrorForbiddenForbidden.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorForbiddenForbidden = Record; diff --git a/src/api/types/ErrorForbiddenType.ts b/src/api/types/ErrorForbiddenType.ts new file mode 100644 index 0000000..2d7a598 --- /dev/null +++ b/src/api/types/ErrorForbiddenType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorForbiddenType = "forbidden"; diff --git a/src/api/types/ErrorInternalServerError.ts b/src/api/types/ErrorInternalServerError.ts new file mode 100644 index 0000000..b23b2b9 --- /dev/null +++ b/src/api/types/ErrorInternalServerError.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorInternalServerError extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorInternalServerErrorInternalError.ts b/src/api/types/ErrorInternalServerErrorInternalError.ts new file mode 100644 index 0000000..58ca773 --- /dev/null +++ b/src/api/types/ErrorInternalServerErrorInternalError.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorInternalServerErrorInternalError = Record; diff --git a/src/api/types/ErrorInternalServerErrorType.ts b/src/api/types/ErrorInternalServerErrorType.ts new file mode 100644 index 0000000..9aee550 --- /dev/null +++ b/src/api/types/ErrorInternalServerErrorType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorInternalServerErrorType = "internal_error"; diff --git a/src/api/types/ErrorNotFound.ts b/src/api/types/ErrorNotFound.ts new file mode 100644 index 0000000..9d9dbc5 --- /dev/null +++ b/src/api/types/ErrorNotFound.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorNotFound extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorNotFoundNotFound.ts b/src/api/types/ErrorNotFoundNotFound.ts new file mode 100644 index 0000000..ebb6389 --- /dev/null +++ b/src/api/types/ErrorNotFoundNotFound.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorNotFoundNotFound = Record; diff --git a/src/api/types/ErrorNotFoundType.ts b/src/api/types/ErrorNotFoundType.ts new file mode 100644 index 0000000..016f61d --- /dev/null +++ b/src/api/types/ErrorNotFoundType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorNotFoundType = "not_found"; diff --git a/src/api/types/ErrorServiceUnavailable.ts b/src/api/types/ErrorServiceUnavailable.ts new file mode 100644 index 0000000..2c69844 --- /dev/null +++ b/src/api/types/ErrorServiceUnavailable.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorServiceUnavailable extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorServiceUnavailableServiceUnavailable.ts b/src/api/types/ErrorServiceUnavailableServiceUnavailable.ts new file mode 100644 index 0000000..265a1de --- /dev/null +++ b/src/api/types/ErrorServiceUnavailableServiceUnavailable.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorServiceUnavailableServiceUnavailable = Record; diff --git a/src/api/types/ErrorServiceUnavailableType.ts b/src/api/types/ErrorServiceUnavailableType.ts new file mode 100644 index 0000000..8f9f13b --- /dev/null +++ b/src/api/types/ErrorServiceUnavailableType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorServiceUnavailableType = "service_unavailable"; diff --git a/src/api/types/ErrorTooManyRequests.ts b/src/api/types/ErrorTooManyRequests.ts new file mode 100644 index 0000000..ad1b3a3 --- /dev/null +++ b/src/api/types/ErrorTooManyRequests.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorTooManyRequests extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorTooManyRequestsTooManyRequests.ts b/src/api/types/ErrorTooManyRequestsTooManyRequests.ts new file mode 100644 index 0000000..6a13cfa --- /dev/null +++ b/src/api/types/ErrorTooManyRequestsTooManyRequests.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorTooManyRequestsTooManyRequests = Record; diff --git a/src/api/types/ErrorTooManyRequestsType.ts b/src/api/types/ErrorTooManyRequestsType.ts new file mode 100644 index 0000000..67bbf6d --- /dev/null +++ b/src/api/types/ErrorTooManyRequestsType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorTooManyRequestsType = "too_many_requests"; diff --git a/src/api/types/ErrorUnauthorized.ts b/src/api/types/ErrorUnauthorized.ts new file mode 100644 index 0000000..db97a67 --- /dev/null +++ b/src/api/types/ErrorUnauthorized.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ErrorUnauthorized extends DevRev.ErrorBase {} diff --git a/src/api/types/ErrorUnauthorizedType.ts b/src/api/types/ErrorUnauthorizedType.ts new file mode 100644 index 0000000..8f4c5b8 --- /dev/null +++ b/src/api/types/ErrorUnauthorizedType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorUnauthorizedType = "unauthenticated"; diff --git a/src/api/types/ErrorUnauthorizedUnauthenticated.ts b/src/api/types/ErrorUnauthorizedUnauthenticated.ts new file mode 100644 index 0000000..b7a5875 --- /dev/null +++ b/src/api/types/ErrorUnauthorizedUnauthenticated.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorUnauthorizedUnauthenticated = Record; diff --git a/src/api/types/Error_.ts b/src/api/types/Error_.ts new file mode 100644 index 0000000..268495a --- /dev/null +++ b/src/api/types/Error_.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface Error_ { + /** The error type. */ + type?: string; + /** Information about the error. */ + message: string; + /** The corresponding HTTP status code. */ + status: number; +} diff --git a/src/api/types/EventAccountCreated.ts b/src/api/types/EventAccountCreated.ts new file mode 100644 index 0000000..f6bf365 --- /dev/null +++ b/src/api/types/EventAccountCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventAccountCreated { + account: DevRev.Account; +} diff --git a/src/api/types/EventAccountDeleted.ts b/src/api/types/EventAccountDeleted.ts new file mode 100644 index 0000000..1079bcb --- /dev/null +++ b/src/api/types/EventAccountDeleted.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventAccountDeleted { + /** The ID of the account that was deleted. */ + id: string; + oldAccount?: DevRev.Account; +} diff --git a/src/api/types/EventAccountUpdated.ts b/src/api/types/EventAccountUpdated.ts new file mode 100644 index 0000000..fd6c2cd --- /dev/null +++ b/src/api/types/EventAccountUpdated.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventAccountUpdated { + account: DevRev.Account; + oldAccount?: DevRev.Account; +} diff --git a/src/api/types/EventConversationCreated.ts b/src/api/types/EventConversationCreated.ts new file mode 100644 index 0000000..f4af2dd --- /dev/null +++ b/src/api/types/EventConversationCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventConversationCreated { + conversation: DevRev.Conversation; +} diff --git a/src/api/types/EventConversationDeleted.ts b/src/api/types/EventConversationDeleted.ts new file mode 100644 index 0000000..abe43b6 --- /dev/null +++ b/src/api/types/EventConversationDeleted.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventConversationDeleted { + /** The ID of the conversation that was deleted. */ + id: string; +} diff --git a/src/api/types/EventConversationUpdated.ts b/src/api/types/EventConversationUpdated.ts new file mode 100644 index 0000000..ebd4f7e --- /dev/null +++ b/src/api/types/EventConversationUpdated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventConversationUpdated { + conversation: DevRev.Conversation; +} diff --git a/src/api/types/EventDevUserCreated.ts b/src/api/types/EventDevUserCreated.ts new file mode 100644 index 0000000..88b57bf --- /dev/null +++ b/src/api/types/EventDevUserCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventDevUserCreated { + devUser: DevRev.DevUser; +} diff --git a/src/api/types/EventDevUserDeleted.ts b/src/api/types/EventDevUserDeleted.ts new file mode 100644 index 0000000..12ee2f0 --- /dev/null +++ b/src/api/types/EventDevUserDeleted.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventDevUserDeleted { + /** The ID of the Dev user that was deleted. */ + id: string; + oldDevUser?: DevRev.DevUser; +} diff --git a/src/api/types/EventDevUserUpdated.ts b/src/api/types/EventDevUserUpdated.ts new file mode 100644 index 0000000..9cdb9b2 --- /dev/null +++ b/src/api/types/EventDevUserUpdated.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventDevUserUpdated { + devUser: DevRev.DevUser; + oldDevUser?: DevRev.DevUser; +} diff --git a/src/api/types/EventGroupCreated.ts b/src/api/types/EventGroupCreated.ts new file mode 100644 index 0000000..8d5dd8a --- /dev/null +++ b/src/api/types/EventGroupCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventGroupCreated { + group: DevRev.Group; +} diff --git a/src/api/types/EventGroupDeleted.ts b/src/api/types/EventGroupDeleted.ts new file mode 100644 index 0000000..0db073d --- /dev/null +++ b/src/api/types/EventGroupDeleted.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventGroupDeleted { + /** The ID of the group that was deleted. */ + id: string; +} diff --git a/src/api/types/EventGroupUpdated.ts b/src/api/types/EventGroupUpdated.ts new file mode 100644 index 0000000..19a8764 --- /dev/null +++ b/src/api/types/EventGroupUpdated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventGroupUpdated { + group: DevRev.Group; +} diff --git a/src/api/types/EventPartCreated.ts b/src/api/types/EventPartCreated.ts new file mode 100644 index 0000000..ff2d405 --- /dev/null +++ b/src/api/types/EventPartCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventPartCreated { + part: DevRev.Part; +} diff --git a/src/api/types/EventPartDeleted.ts b/src/api/types/EventPartDeleted.ts new file mode 100644 index 0000000..8917ed8 --- /dev/null +++ b/src/api/types/EventPartDeleted.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventPartDeleted { + /** The ID of the part that was deleted. */ + id: string; + oldPart?: DevRev.Part; +} diff --git a/src/api/types/EventPartUpdated.ts b/src/api/types/EventPartUpdated.ts new file mode 100644 index 0000000..6d08bd9 --- /dev/null +++ b/src/api/types/EventPartUpdated.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventPartUpdated { + oldPart?: DevRev.Part; + part: DevRev.Part; +} diff --git a/src/api/types/EventRevOrgCreated.ts b/src/api/types/EventRevOrgCreated.ts new file mode 100644 index 0000000..f21dac4 --- /dev/null +++ b/src/api/types/EventRevOrgCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventRevOrgCreated { + revOrg: DevRev.RevOrg; +} diff --git a/src/api/types/EventRevOrgDeleted.ts b/src/api/types/EventRevOrgDeleted.ts new file mode 100644 index 0000000..99e70cf --- /dev/null +++ b/src/api/types/EventRevOrgDeleted.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventRevOrgDeleted { + /** The ID of the Rev organization that was deleted. */ + id: string; + oldRevOrg?: DevRev.RevOrg; +} diff --git a/src/api/types/EventRevOrgUpdated.ts b/src/api/types/EventRevOrgUpdated.ts new file mode 100644 index 0000000..ade035d --- /dev/null +++ b/src/api/types/EventRevOrgUpdated.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventRevOrgUpdated { + oldRevOrg?: DevRev.RevOrg; + revOrg: DevRev.RevOrg; +} diff --git a/src/api/types/EventRevUserCreated.ts b/src/api/types/EventRevUserCreated.ts new file mode 100644 index 0000000..0edd35e --- /dev/null +++ b/src/api/types/EventRevUserCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventRevUserCreated { + revUser: DevRev.RevUser; +} diff --git a/src/api/types/EventRevUserDeleted.ts b/src/api/types/EventRevUserDeleted.ts new file mode 100644 index 0000000..33b8712 --- /dev/null +++ b/src/api/types/EventRevUserDeleted.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventRevUserDeleted { + /** The ID of the Rev user that was deleted. */ + id: string; + oldRevUser?: DevRev.RevUser; +} diff --git a/src/api/types/EventRevUserUpdated.ts b/src/api/types/EventRevUserUpdated.ts new file mode 100644 index 0000000..ee3d688 --- /dev/null +++ b/src/api/types/EventRevUserUpdated.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventRevUserUpdated { + oldRevUser?: DevRev.RevUser; + revUser: DevRev.RevUser; +} diff --git a/src/api/types/EventSlaTrackerCreated.ts b/src/api/types/EventSlaTrackerCreated.ts new file mode 100644 index 0000000..8632c4f --- /dev/null +++ b/src/api/types/EventSlaTrackerCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventSlaTrackerCreated { + slaTracker: DevRev.SlaTracker; +} diff --git a/src/api/types/EventSlaTrackerDeleted.ts b/src/api/types/EventSlaTrackerDeleted.ts new file mode 100644 index 0000000..9da690c --- /dev/null +++ b/src/api/types/EventSlaTrackerDeleted.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventSlaTrackerDeleted { + /** The ID of the SLA tracker that was deleted. */ + id: string; +} diff --git a/src/api/types/EventSlaTrackerUpdated.ts b/src/api/types/EventSlaTrackerUpdated.ts new file mode 100644 index 0000000..0fc7af2 --- /dev/null +++ b/src/api/types/EventSlaTrackerUpdated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventSlaTrackerUpdated { + slaTracker: DevRev.SlaTracker; +} diff --git a/src/api/types/EventSource.ts b/src/api/types/EventSource.ts new file mode 100644 index 0000000..14a67aa --- /dev/null +++ b/src/api/types/EventSource.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventSource extends DevRev.AtomBase { + /** + * Configuration of the event source. Fields depend on the event + * source type. + */ + config?: Record; + /** Name of the event source. */ + name?: string; + setupInstructions?: DevRev.EventSourceSetupInstructions; + status?: DevRev.EventSourceStatus; + /** + * The URL to trigger the event source. Valid only for HTTP + * based-event sources. This URL supports both GET and POST requests. + */ + triggerUrl?: string; +} diff --git a/src/api/types/EventSourceGetResponse.ts b/src/api/types/EventSourceGetResponse.ts new file mode 100644 index 0000000..8fcec4c --- /dev/null +++ b/src/api/types/EventSourceGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventSourceGetResponse { + eventSource: DevRev.EventSource; +} diff --git a/src/api/types/EventSourceSetupInstructions.ts b/src/api/types/EventSourceSetupInstructions.ts new file mode 100644 index 0000000..0288b0b --- /dev/null +++ b/src/api/types/EventSourceSetupInstructions.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Instructions for setting up the event source. + */ +export interface EventSourceSetupInstructions { + /** Content of the instructions. */ + content?: string; +} diff --git a/src/api/types/EventSourceStatus.ts b/src/api/types/EventSourceStatus.ts new file mode 100644 index 0000000..75b3a92 --- /dev/null +++ b/src/api/types/EventSourceStatus.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Status of the event source. Note that paused/blocked event sources + * return NotFound error on triggering. + */ +export type EventSourceStatus = "active" | "blocked" | "paused"; + +export const EventSourceStatus = { + Active: "active", + Blocked: "blocked", + Paused: "paused", +} as const; diff --git a/src/api/types/EventSourcesScheduleEventResponse.ts b/src/api/types/EventSourcesScheduleEventResponse.ts new file mode 100644 index 0000000..c0e23f3 --- /dev/null +++ b/src/api/types/EventSourcesScheduleEventResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventSourcesScheduleEventResponse { + /** + * The event key for this event. Auto-generated if the caller doesn't + * specify the event key. This may be empty if the event was published + * immediately. + */ + eventKey?: string; +} diff --git a/src/api/types/EventSurveyResponseCreated.ts b/src/api/types/EventSurveyResponseCreated.ts new file mode 100644 index 0000000..203c19d --- /dev/null +++ b/src/api/types/EventSurveyResponseCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventSurveyResponseCreated { + surveyResponse: DevRev.SurveyResponse; +} diff --git a/src/api/types/EventSurveyResponseDeleted.ts b/src/api/types/EventSurveyResponseDeleted.ts new file mode 100644 index 0000000..b95b2db --- /dev/null +++ b/src/api/types/EventSurveyResponseDeleted.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventSurveyResponseDeleted { + /** The ID of the survey response that was deleted. */ + id: string; +} diff --git a/src/api/types/EventSurveyResponseUpdated.ts b/src/api/types/EventSurveyResponseUpdated.ts new file mode 100644 index 0000000..80de988 --- /dev/null +++ b/src/api/types/EventSurveyResponseUpdated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventSurveyResponseUpdated { + surveyResponse: DevRev.SurveyResponse; +} diff --git a/src/api/types/EventTagCreated.ts b/src/api/types/EventTagCreated.ts new file mode 100644 index 0000000..0725976 --- /dev/null +++ b/src/api/types/EventTagCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventTagCreated { + tag: DevRev.Tag; +} diff --git a/src/api/types/EventTagDeleted.ts b/src/api/types/EventTagDeleted.ts new file mode 100644 index 0000000..0148437 --- /dev/null +++ b/src/api/types/EventTagDeleted.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventTagDeleted { + /** The ID of the tag that was deleted. */ + id: string; +} diff --git a/src/api/types/EventTagUpdated.ts b/src/api/types/EventTagUpdated.ts new file mode 100644 index 0000000..90cf3bc --- /dev/null +++ b/src/api/types/EventTagUpdated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventTagUpdated { + tag: DevRev.Tag; +} diff --git a/src/api/types/EventTimelineEntryCreated.ts b/src/api/types/EventTimelineEntryCreated.ts new file mode 100644 index 0000000..495e787 --- /dev/null +++ b/src/api/types/EventTimelineEntryCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventTimelineEntryCreated { + entry: DevRev.TimelineEntry; +} diff --git a/src/api/types/EventTimelineEntryDeleted.ts b/src/api/types/EventTimelineEntryDeleted.ts new file mode 100644 index 0000000..d66cc78 --- /dev/null +++ b/src/api/types/EventTimelineEntryDeleted.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventTimelineEntryDeleted { + /** The ID of the timeline entry that was deleted. */ + id: string; +} diff --git a/src/api/types/EventTimelineEntryUpdated.ts b/src/api/types/EventTimelineEntryUpdated.ts new file mode 100644 index 0000000..5192970 --- /dev/null +++ b/src/api/types/EventTimelineEntryUpdated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventTimelineEntryUpdated { + entry: DevRev.TimelineEntry; +} diff --git a/src/api/types/EventWebhookCreated.ts b/src/api/types/EventWebhookCreated.ts new file mode 100644 index 0000000..ebecff8 --- /dev/null +++ b/src/api/types/EventWebhookCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventWebhookCreated { + webhook: DevRev.Webhook; +} diff --git a/src/api/types/EventWebhookDeleted.ts b/src/api/types/EventWebhookDeleted.ts new file mode 100644 index 0000000..2990e0e --- /dev/null +++ b/src/api/types/EventWebhookDeleted.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface EventWebhookDeleted { + /** The ID of the webhook that was deleted. */ + id: string; +} diff --git a/src/api/types/EventWebhookUpdated.ts b/src/api/types/EventWebhookUpdated.ts new file mode 100644 index 0000000..3774cf9 --- /dev/null +++ b/src/api/types/EventWebhookUpdated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventWebhookUpdated { + webhook: DevRev.Webhook; +} diff --git a/src/api/types/EventWorkCreated.ts b/src/api/types/EventWorkCreated.ts new file mode 100644 index 0000000..58124e6 --- /dev/null +++ b/src/api/types/EventWorkCreated.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventWorkCreated { + work: DevRev.Work; +} diff --git a/src/api/types/EventWorkDeleted.ts b/src/api/types/EventWorkDeleted.ts new file mode 100644 index 0000000..a783a81 --- /dev/null +++ b/src/api/types/EventWorkDeleted.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventWorkDeleted { + /** The ID of the work that was deleted. */ + id: string; + oldWork?: DevRev.Work; +} diff --git a/src/api/types/EventWorkUpdated.ts b/src/api/types/EventWorkUpdated.ts new file mode 100644 index 0000000..b5952f7 --- /dev/null +++ b/src/api/types/EventWorkUpdated.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface EventWorkUpdated { + oldWork?: DevRev.Work; + work: DevRev.Work; +} diff --git a/src/api/types/ExternalIdentity.ts b/src/api/types/ExternalIdentity.ts new file mode 100644 index 0000000..1929d83 --- /dev/null +++ b/src/api/types/ExternalIdentity.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * External identity of a user. + */ +export interface ExternalIdentity { + /** Display name of the user in the external source. */ + displayName?: string; + /** Unique ID of the user in the external source. */ + id?: string; + /** Whether the external identity is verified or not. */ + isVerified?: boolean; + /** Issuer of the external identity of the user. */ + issuer?: string; +} diff --git a/src/api/types/Feature.ts b/src/api/types/Feature.ts new file mode 100644 index 0000000..e0f29c5 --- /dev/null +++ b/src/api/types/Feature.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Feature = DevRev.PartBase; diff --git a/src/api/types/FeatureSummary.ts b/src/api/types/FeatureSummary.ts new file mode 100644 index 0000000..7011fcb --- /dev/null +++ b/src/api/types/FeatureSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type FeatureSummary = DevRev.PartBaseSummary; diff --git a/src/api/types/FieldDescriptor.ts b/src/api/types/FieldDescriptor.ts new file mode 100644 index 0000000..c86fd96 --- /dev/null +++ b/src/api/types/FieldDescriptor.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Set of field attributes. + */ +export type FieldDescriptor = Record; diff --git a/src/api/types/Group.ts b/src/api/types/Group.ts new file mode 100644 index 0000000..4dd6aba --- /dev/null +++ b/src/api/types/Group.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Group extends DevRev.AtomBase { + /** Description of the group. */ + description?: string; + /** Whether it is a default group. */ + isDefault: boolean; + memberType?: DevRev.GroupMemberType; + /** Name of the group. */ + name?: string; + owner?: DevRev.UserSummary; +} diff --git a/src/api/types/GroupMemberType.ts b/src/api/types/GroupMemberType.ts new file mode 100644 index 0000000..236e617 --- /dev/null +++ b/src/api/types/GroupMemberType.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of the members in the group. + */ +export type GroupMemberType = "dev_user" | "rev_user"; + +export const GroupMemberType = { + DevUser: "dev_user", + RevUser: "rev_user", +} as const; diff --git a/src/api/types/GroupMembersAddResponse.ts b/src/api/types/GroupMembersAddResponse.ts new file mode 100644 index 0000000..040678b --- /dev/null +++ b/src/api/types/GroupMembersAddResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type GroupMembersAddResponse = Record; diff --git a/src/api/types/GroupMembersListResponse.ts b/src/api/types/GroupMembersListResponse.ts new file mode 100644 index 0000000..f3d9300 --- /dev/null +++ b/src/api/types/GroupMembersListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * List of group members. + */ +export interface GroupMembersListResponse { + /** List of members. */ + members: DevRev.GroupMembersListResponseMember[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/GroupMembersListResponseMember.ts b/src/api/types/GroupMembersListResponseMember.ts new file mode 100644 index 0000000..769b608 --- /dev/null +++ b/src/api/types/GroupMembersListResponseMember.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * A group member. + */ +export interface GroupMembersListResponseMember { + member: DevRev.MemberSummary; +} diff --git a/src/api/types/GroupMembersRemoveResponse.ts b/src/api/types/GroupMembersRemoveResponse.ts new file mode 100644 index 0000000..6b503f0 --- /dev/null +++ b/src/api/types/GroupMembersRemoveResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type GroupMembersRemoveResponse = Record; diff --git a/src/api/types/GroupSearchSummary.ts b/src/api/types/GroupSearchSummary.ts new file mode 100644 index 0000000..c600014 --- /dev/null +++ b/src/api/types/GroupSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface GroupSearchSummary extends DevRev.SearchSummaryBase { + group: DevRev.GroupSummary; +} diff --git a/src/api/types/GroupSummary.ts b/src/api/types/GroupSummary.ts new file mode 100644 index 0000000..5f1ece2 --- /dev/null +++ b/src/api/types/GroupSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface GroupSummary extends DevRev.AtomBaseSummary { + memberType?: DevRev.GroupMemberType; + /** Name of the group. */ + name?: string; +} diff --git a/src/api/types/GroupType.ts b/src/api/types/GroupType.ts new file mode 100644 index 0000000..f435d9a --- /dev/null +++ b/src/api/types/GroupType.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of the group. + */ +export type GroupType = "dynamic" | "static"; + +export const GroupType = { + Dynamic: "dynamic", + Static: "static", +} as const; diff --git a/src/api/types/GroupedVistaFlavor.ts b/src/api/types/GroupedVistaFlavor.ts new file mode 100644 index 0000000..4065be8 --- /dev/null +++ b/src/api/types/GroupedVistaFlavor.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Denotes the use case of the grouped vista. + */ +export type GroupedVistaFlavor = "nnl" | "sprint_board" | "support_inbox"; + +export const GroupedVistaFlavor = { + Nnl: "nnl", + SprintBoard: "sprint_board", + SupportInbox: "support_inbox", +} as const; diff --git a/src/api/types/GroupedVistaSummary.ts b/src/api/types/GroupedVistaSummary.ts new file mode 100644 index 0000000..4d37a8d --- /dev/null +++ b/src/api/types/GroupedVistaSummary.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Represents a group of multiple vistas as a single unit. + */ +export interface GroupedVistaSummary extends DevRev.VistaBaseSummary { + flavor?: DevRev.GroupedVistaFlavor; +} diff --git a/src/api/types/GroupsCreateResponse.ts b/src/api/types/GroupsCreateResponse.ts new file mode 100644 index 0000000..671f3fd --- /dev/null +++ b/src/api/types/GroupsCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to group creation. + */ +export interface GroupsCreateResponse { + group: DevRev.Group; +} diff --git a/src/api/types/GroupsGetResponse.ts b/src/api/types/GroupsGetResponse.ts new file mode 100644 index 0000000..2c1036e --- /dev/null +++ b/src/api/types/GroupsGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to getting the group. + */ +export interface GroupsGetResponse { + group: DevRev.Group; +} diff --git a/src/api/types/GroupsListResponse.ts b/src/api/types/GroupsListResponse.ts new file mode 100644 index 0000000..774ea65 --- /dev/null +++ b/src/api/types/GroupsListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to listing the groups. + */ +export interface GroupsListResponse { + /** The list of groups. */ + groups: DevRev.Group[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/GroupsUpdateRequestDynamicGroupInfo.ts b/src/api/types/GroupsUpdateRequestDynamicGroupInfo.ts new file mode 100644 index 0000000..c5b8361 --- /dev/null +++ b/src/api/types/GroupsUpdateRequestDynamicGroupInfo.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface GroupsUpdateRequestDynamicGroupInfo { + membershipExpression: DevRev.BooleanExpression; +} diff --git a/src/api/types/GroupsUpdateResponse.ts b/src/api/types/GroupsUpdateResponse.ts new file mode 100644 index 0000000..6d8bcca --- /dev/null +++ b/src/api/types/GroupsUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to group update. + */ +export interface GroupsUpdateResponse { + group: DevRev.Group; +} diff --git a/src/api/types/Issue.ts b/src/api/types/Issue.ts new file mode 100644 index 0000000..aaf472d --- /dev/null +++ b/src/api/types/Issue.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Issue extends DevRev.WorkBase { + /** Parts associated based on git events. */ + developedWith?: DevRev.PartSummary[]; + priority?: DevRev.IssuePriority; + slaTracker?: DevRev.SlaTrackerSummary; + sprint?: DevRev.VistaGroupItemSummary; + /** Target start date for the object. */ + targetStartDate?: Date; +} diff --git a/src/api/types/IssuePriority.ts b/src/api/types/IssuePriority.ts new file mode 100644 index 0000000..70785ca --- /dev/null +++ b/src/api/types/IssuePriority.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Priority of the work based upon impact and criticality. + */ +export type IssuePriority = "p0" | "p1" | "p2" | "p3"; + +export const IssuePriority = { + P0: "p0", + P1: "p1", + P2: "p2", + P3: "p3", +} as const; diff --git a/src/api/types/IssueSummary.ts b/src/api/types/IssueSummary.ts new file mode 100644 index 0000000..5ca8e7a --- /dev/null +++ b/src/api/types/IssueSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface IssueSummary extends DevRev.WorkBaseSummary { + priority?: DevRev.IssuePriority; +} diff --git a/src/api/types/JobHistoryItem.ts b/src/api/types/JobHistoryItem.ts new file mode 100644 index 0000000..f4dab23 --- /dev/null +++ b/src/api/types/JobHistoryItem.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Defines a job history line item. + */ +export interface JobHistoryItem { + employmentStatus?: DevRev.EnumValue; + /** The end date of the job, or not specified if current. */ + endDate?: Date; + /** Is this the current active job for the user. */ + isCurrent?: boolean; + /** The job location for the user. */ + location?: string; + /** The start date of the job. */ + startDate?: Date; + /** The job title for the user. */ + title?: string; +} diff --git a/src/api/types/LegacyStage.ts b/src/api/types/LegacyStage.ts new file mode 100644 index 0000000..6be84b6 --- /dev/null +++ b/src/api/types/LegacyStage.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Describes the current stage of a work item. + */ +export interface LegacyStage { + /** Current stage name of the work item. */ + name: string; + stage?: DevRev.CustomStageSummary; +} diff --git a/src/api/types/LegacyStageSummary.ts b/src/api/types/LegacyStageSummary.ts new file mode 100644 index 0000000..b834c06 --- /dev/null +++ b/src/api/types/LegacyStageSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Describes the current stage of a work item. + */ +export interface LegacyStageSummary { + /** Current stage name of the work item. */ + name: string; +} diff --git a/src/api/types/LinesOfCode.ts b/src/api/types/LinesOfCode.ts new file mode 100644 index 0000000..d3faa47 --- /dev/null +++ b/src/api/types/LinesOfCode.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Details of lines of code in this code change. + */ +export interface LinesOfCode { + /** Count of files involved in this code change. */ + fileCount?: number; + /** Number of new lines added in this code change. */ + linesAdded?: number; + /** Number of lines deleted in this code change. */ + linesDeleted?: number; + /** Number of lines modified in this code change. */ + linesModified?: number; +} diff --git a/src/api/types/Link.ts b/src/api/types/Link.ts new file mode 100644 index 0000000..f6898f4 --- /dev/null +++ b/src/api/types/Link.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Link extends DevRev.AtomBase { + linkType: DevRev.LinkType; + source: DevRev.LinkEndpointSummary; + target: DevRev.LinkEndpointSummary; +} diff --git a/src/api/types/LinkEndpointSummary.ts b/src/api/types/LinkEndpointSummary.ts new file mode 100644 index 0000000..1c99732 --- /dev/null +++ b/src/api/types/LinkEndpointSummary.ts @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type LinkEndpointSummary = + | DevRev.LinkEndpointSummary.Capability + | DevRev.LinkEndpointSummary.Conversation + | DevRev.LinkEndpointSummary.Enhancement + | DevRev.LinkEndpointSummary.Feature + | DevRev.LinkEndpointSummary.Issue + | DevRev.LinkEndpointSummary.Opportunity + | DevRev.LinkEndpointSummary.Product + | DevRev.LinkEndpointSummary.Task + | DevRev.LinkEndpointSummary.Ticket; + +export declare namespace LinkEndpointSummary { + interface Capability extends DevRev.PartBaseSummary { + type: "capability"; + } + + interface Conversation extends DevRev.ConversationSummary { + type: "conversation"; + } + + interface Enhancement extends DevRev.PartBaseSummary { + type: "enhancement"; + } + + interface Feature extends DevRev.PartBaseSummary { + type: "feature"; + } + + interface Issue extends DevRev.IssueSummary { + type: "issue"; + } + + interface Opportunity extends DevRev.WorkBaseSummary { + type: "opportunity"; + } + + interface Product extends DevRev.PartBaseSummary { + type: "product"; + } + + interface Task extends DevRev.WorkBaseSummary { + type: "task"; + } + + interface Ticket extends DevRev.TicketSummary { + type: "ticket"; + } +} diff --git a/src/api/types/LinkEndpointType.ts b/src/api/types/LinkEndpointType.ts new file mode 100644 index 0000000..eda2616 --- /dev/null +++ b/src/api/types/LinkEndpointType.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type LinkEndpointType = + | "capability" + | "conversation" + | "enhancement" + | "feature" + | "issue" + | "opportunity" + | "product" + | "task" + | "ticket"; + +export const LinkEndpointType = { + Capability: "capability", + Conversation: "conversation", + Enhancement: "enhancement", + Feature: "feature", + Issue: "issue", + Opportunity: "opportunity", + Product: "product", + Task: "task", + Ticket: "ticket", +} as const; diff --git a/src/api/types/LinkRevUserToRevOrgResponse.ts b/src/api/types/LinkRevUserToRevOrgResponse.ts new file mode 100644 index 0000000..29ae432 --- /dev/null +++ b/src/api/types/LinkRevUserToRevOrgResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Response for linking a Rev user to an existing Rev organization. + */ +export interface LinkRevUserToRevOrgResponse { + revUser: DevRev.RevUser; +} diff --git a/src/api/types/LinkSearchSummary.ts b/src/api/types/LinkSearchSummary.ts new file mode 100644 index 0000000..ba1fb0e --- /dev/null +++ b/src/api/types/LinkSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface LinkSearchSummary extends DevRev.SearchSummaryBase { + link: DevRev.LinkSummary; +} diff --git a/src/api/types/LinkSummary.ts b/src/api/types/LinkSummary.ts new file mode 100644 index 0000000..4a0cc0c --- /dev/null +++ b/src/api/types/LinkSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface LinkSummary extends DevRev.AtomBaseSummary { + linkType: DevRev.LinkType; + source: DevRev.LinkEndpointSummary; + target: DevRev.LinkEndpointSummary; +} diff --git a/src/api/types/LinkType.ts b/src/api/types/LinkType.ts new file mode 100644 index 0000000..3707bb9 --- /dev/null +++ b/src/api/types/LinkType.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of link used to define the relationship. + */ +export type LinkType = + | "custom_link" + | "developed_with" + | "imports" + | "is_dependent_on" + | "is_duplicate_of" + | "is_merged_into" + | "is_parent_of" + | "is_part_of" + | "is_related_to" + | "serves"; + +export const LinkType = { + CustomLink: "custom_link", + DevelopedWith: "developed_with", + Imports: "imports", + IsDependentOn: "is_dependent_on", + IsDuplicateOf: "is_duplicate_of", + IsMergedInto: "is_merged_into", + IsParentOf: "is_parent_of", + IsPartOf: "is_part_of", + IsRelatedTo: "is_related_to", + Serves: "serves", +} as const; diff --git a/src/api/types/LinksCreateResponse.ts b/src/api/types/LinksCreateResponse.ts new file mode 100644 index 0000000..fcd11b6 --- /dev/null +++ b/src/api/types/LinksCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to creating a new link. + */ +export interface LinksCreateResponse { + link: DevRev.Link; +} diff --git a/src/api/types/LinksDeleteResponse.ts b/src/api/types/LinksDeleteResponse.ts new file mode 100644 index 0000000..7e755e5 --- /dev/null +++ b/src/api/types/LinksDeleteResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The response for deleting a link. + */ +export type LinksDeleteResponse = Record; diff --git a/src/api/types/LinksDirection.ts b/src/api/types/LinksDirection.ts new file mode 100644 index 0000000..30496e5 --- /dev/null +++ b/src/api/types/LinksDirection.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The direction of link, which can either be outbound such that the + * object is the source of the link, otherwise inbound where the object is + * the target of the link. + */ +export type LinksDirection = "is_source" | "is_target"; + +export const LinksDirection = { + IsSource: "is_source", + IsTarget: "is_target", +} as const; diff --git a/src/api/types/LinksGetResponse.ts b/src/api/types/LinksGetResponse.ts new file mode 100644 index 0000000..51cc041 --- /dev/null +++ b/src/api/types/LinksGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to getting a link's information. + */ +export interface LinksGetResponse { + link: DevRev.Link; +} diff --git a/src/api/types/LinksListResponse.ts b/src/api/types/LinksListResponse.ts new file mode 100644 index 0000000..2ed048f --- /dev/null +++ b/src/api/types/LinksListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to listing the links. + */ +export interface LinksListResponse { + /** The list of links. */ + links: DevRev.Link[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/ListMode.ts b/src/api/types/ListMode.ts new file mode 100644 index 0000000..25429a5 --- /dev/null +++ b/src/api/types/ListMode.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The iteration mode to use. If "after", then entries after the provided + * cursor will be returned, or if no cursor is provided, then from the + * beginning. If "before", then entries before the provided cursor will be + * returned, or if no cursor is provided, then from the end. Entries will + * always be returned in the specified sort-by order. + */ +export type ListMode = "after" | "before"; + +export const ListMode = { + After: "after", + Before: "before", +} as const; diff --git a/src/api/types/MeetingSummary.ts b/src/api/types/MeetingSummary.ts new file mode 100644 index 0000000..0720395 --- /dev/null +++ b/src/api/types/MeetingSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type MeetingSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/MemberSummary.ts b/src/api/types/MemberSummary.ts new file mode 100644 index 0000000..8f18cc0 --- /dev/null +++ b/src/api/types/MemberSummary.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type MemberSummary = DevRev.MemberSummary.DevUser | DevRev.MemberSummary.RevUser | DevRev.MemberSummary.SysUser; + +export declare namespace MemberSummary { + interface DevUser extends DevRev.UserBaseSummary { + type: "dev_user"; + } + + interface RevUser extends DevRev.RevUserSummary { + type: "rev_user"; + } + + interface SysUser extends DevRev.UserBaseSummary { + type: "sys_user"; + } +} diff --git a/src/api/types/MemberType.ts b/src/api/types/MemberType.ts new file mode 100644 index 0000000..ff276e3 --- /dev/null +++ b/src/api/types/MemberType.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type MemberType = "dev_user" | "rev_user" | "sys_user"; + +export const MemberType = { + DevUser: "dev_user", + RevUser: "rev_user", + SysUser: "sys_user", +} as const; diff --git a/src/api/types/MetricDataPoint.ts b/src/api/types/MetricDataPoint.ts new file mode 100644 index 0000000..f327a94 --- /dev/null +++ b/src/api/types/MetricDataPoint.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface MetricDataPoint { + /** Key-value pairs for specifying additional attributes. */ + dimensions?: DevRev.MetricDataPointDimension[]; + /** + * An ID that uniquely identifies the metric data point. This ID will + * be used for deduplication. Clients can generate its own ID and send + * it in the request. If not provided, DevRev will perform + * content-based deduplication. + */ + id?: string; + /** Timestamp when metric value is captured. */ + timestamp: Date; + /** + * The value corresponding to the metric. For simply recording + * occurrence of an event, this value should be 1.0. + */ + value: number; +} diff --git a/src/api/types/MetricDataPointDimension.ts b/src/api/types/MetricDataPointDimension.ts new file mode 100644 index 0000000..4a4e00e --- /dev/null +++ b/src/api/types/MetricDataPointDimension.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface MetricDataPointDimension { + /** + * The key for the dimension. The keys must be unique and it is not + * allowed to have more than one value with the same key. Key must be + * at least one character long and cannot be longer than 64 + * characters.Key can only contain alphanumeric characters (A-Z, a-z, + * and 0-9) and underscores (\_). Key cannot start with a number and is + * case-insensitive. + */ + key: string; + /** + * The value for the dimension. Value could be any string and cannot + * be longer than 256 characters. + */ + value: string; +} diff --git a/src/api/types/MetricDefinition.ts b/src/api/types/MetricDefinition.ts new file mode 100644 index 0000000..7da6d80 --- /dev/null +++ b/src/api/types/MetricDefinition.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface MetricDefinition extends DevRev.AtomBase { + /** Human readable name of the metric. */ + name?: string; +} diff --git a/src/api/types/MetricDefinitionAppliesTo.ts b/src/api/types/MetricDefinitionAppliesTo.ts new file mode 100644 index 0000000..f98f2f1 --- /dev/null +++ b/src/api/types/MetricDefinitionAppliesTo.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The list of item types on which the metric might be applied. + */ +export type MetricDefinitionAppliesTo = "conversation" | "issue" | "ticket"; + +export const MetricDefinitionAppliesTo = { + Conversation: "conversation", + Issue: "issue", + Ticket: "ticket", +} as const; diff --git a/src/api/types/MetricDefinitionMetricType.ts b/src/api/types/MetricDefinitionMetricType.ts new file mode 100644 index 0000000..c55481e --- /dev/null +++ b/src/api/types/MetricDefinitionMetricType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The type of the metric. 'time' metrics track the time spent in some + * state, supporting operations like 'start', 'stop', 'pause', 'resume'. + * 'value' metrics track a value, supporting operations like 'set', + * 'increment', 'decrement'. + */ +export type MetricDefinitionMetricType = "time" | "value"; + +export const MetricDefinitionMetricType = { + Time: "time", + Value: "value", +} as const; diff --git a/src/api/types/MetricDefinitionStatus.ts b/src/api/types/MetricDefinitionStatus.ts new file mode 100644 index 0000000..0cec7a8 --- /dev/null +++ b/src/api/types/MetricDefinitionStatus.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The status of the metric. 'active' metrics can be used to create new + * SLAs, while 'inactive' metrics can not be used in new SLAs. Metrics can + * be updated between 'active' and 'inactive' states. + */ +export type MetricDefinitionStatus = "active" | "inactive"; + +export const MetricDefinitionStatus = { + Active: "active", + Inactive: "inactive", +} as const; diff --git a/src/api/types/MetricDefinitionSummary.ts b/src/api/types/MetricDefinitionSummary.ts new file mode 100644 index 0000000..bab05a6 --- /dev/null +++ b/src/api/types/MetricDefinitionSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface MetricDefinitionSummary extends DevRev.AtomBaseSummary { + /** Human readable name of the metric. */ + name?: string; +} diff --git a/src/api/types/MetricDefinitionsListResponse.ts b/src/api/types/MetricDefinitionsListResponse.ts new file mode 100644 index 0000000..4d39747 --- /dev/null +++ b/src/api/types/MetricDefinitionsListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface MetricDefinitionsListResponse { + /** The list of metric definitions. */ + metricDefinitions: DevRev.MetricDefinition[]; + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/MetricsData.ts b/src/api/types/MetricsData.ts new file mode 100644 index 0000000..3a70416 --- /dev/null +++ b/src/api/types/MetricsData.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface MetricsData { + /** + * Account ID or external_ref of the account for which metric is being + * published. Account ID is DevRev DON ID. For example, + * don:identity:dvrv-us-1:devo/0:account/156. External_ref is the + * identification of DevRev customer's customers. Devrev will + * internally resolve external_ref to Account ID and use it for + * further processing. For example, external_ref=customer_1 may + * resolve to don:identity:dvrv-us-1:devo/0:account/155. + */ + accountRef: string; + /** + * One or more data points collected for a given metric such as object + * usage, object state etc. + */ + dataPoints: DevRev.MetricDataPoint[]; + /** + * Name of the metric which is being measured. For example, + * num_api_calls, num_active_users, etc. + */ + name: string; + /** + * Rev Org ID or external_ref for which metric is being published.Rev + * Org ID is DevRev DON ID. For example, + * don:identity:dvrv-us-1:devo/0:revo/156. External_ref is the + * identification of DevRev customer's customers and maintained by + * DevRev's customers. Devrev will internally resolve external_ref to + * Rev Org ID and use it for further processing. For example, + * external_ref=org_customer_1 may resolve to + * don:identity:dvrv-us-1:devo/0:revo/155. + */ + orgRef?: string; + /** Rev User ID or user ref for which metric is being published. */ + userRef?: string; +} diff --git a/src/api/types/ObjectMemberSearchSummary.ts b/src/api/types/ObjectMemberSearchSummary.ts new file mode 100644 index 0000000..107a0fd --- /dev/null +++ b/src/api/types/ObjectMemberSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface ObjectMemberSearchSummary extends DevRev.SearchSummaryBase { + objectMember: DevRev.ObjectMemberSummary; +} diff --git a/src/api/types/ObjectMemberSummary.ts b/src/api/types/ObjectMemberSummary.ts new file mode 100644 index 0000000..01ca48c --- /dev/null +++ b/src/api/types/ObjectMemberSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type ObjectMemberSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/Opportunity.ts b/src/api/types/Opportunity.ts new file mode 100644 index 0000000..910a92d --- /dev/null +++ b/src/api/types/Opportunity.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Opportunity = DevRev.WorkBase; diff --git a/src/api/types/OpportunityForecastCategory.ts b/src/api/types/OpportunityForecastCategory.ts new file mode 100644 index 0000000..51ea664 --- /dev/null +++ b/src/api/types/OpportunityForecastCategory.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Forecast category of the opportunity. + */ +export type OpportunityForecastCategory = "commit" | "omitted" | "pipeline" | "strong_upside" | "upside" | "won"; + +export const OpportunityForecastCategory = { + Commit: "commit", + Omitted: "omitted", + Pipeline: "pipeline", + StrongUpside: "strong_upside", + Upside: "upside", + Won: "won", +} as const; diff --git a/src/api/types/OpportunityPriority.ts b/src/api/types/OpportunityPriority.ts new file mode 100644 index 0000000..9d5edce --- /dev/null +++ b/src/api/types/OpportunityPriority.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Priority of the opportunity. + */ +export type OpportunityPriority = "p0" | "p1" | "p2" | "p3"; + +export const OpportunityPriority = { + P0: "p0", + P1: "p1", + P2: "p2", + P3: "p3", +} as const; diff --git a/src/api/types/OpportunitySummary.ts b/src/api/types/OpportunitySummary.ts new file mode 100644 index 0000000..5b27a15 --- /dev/null +++ b/src/api/types/OpportunitySummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type OpportunitySummary = DevRev.WorkBaseSummary; diff --git a/src/api/types/OrgBase.ts b/src/api/types/OrgBase.ts new file mode 100644 index 0000000..032df15 --- /dev/null +++ b/src/api/types/OrgBase.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgBase extends DevRev.AtomBase { + /** Name of the Organization. */ + displayName?: string; +} diff --git a/src/api/types/OrgBaseSummary.ts b/src/api/types/OrgBaseSummary.ts new file mode 100644 index 0000000..76ed331 --- /dev/null +++ b/src/api/types/OrgBaseSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgBaseSummary extends DevRev.AtomBaseSummary { + /** Name of the Organization. */ + displayName?: string; +} diff --git a/src/api/types/OrgEnvironment.ts b/src/api/types/OrgEnvironment.ts new file mode 100644 index 0000000..3263abe --- /dev/null +++ b/src/api/types/OrgEnvironment.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The environment of the Org. Defaults to 'production' if not specified. + */ +export type OrgEnvironment = "production" | "staging" | "test"; + +export const OrgEnvironment = { + Production: "production", + Staging: "staging", + Test: "test", +} as const; diff --git a/src/api/types/OrgSchedule.ts b/src/api/types/OrgSchedule.ts new file mode 100644 index 0000000..5a1a9ff --- /dev/null +++ b/src/api/types/OrgSchedule.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSchedule extends DevRev.AtomBase { + defaultWeeklyOrgSchedule?: DevRev.WeeklyOrgSchedule; + /** + * The schedule must be valid and well-defined for at least this many + * days in the future, otherwise a warning notification is generated. + * Default is 0 if not specified. + */ + minValidDays?: number; + /** Human-readable name. */ + name?: string; + /** + * The list of schedule fragments. It must be an ordered list of + * contiguous fragments (the next starting when the previous one + * ends), updates in a published schedule are only allowed to add new + * ones to the future. + */ + orgScheduleFragments?: DevRev.OrgScheduleFragmentOverview[]; + status: DevRev.OrgScheduleStatus; + /** + * Timezone in which this is defined. Only organization schedules in + * the same timezone can be directly combined. + */ + timezone?: string; + /** + * Derived field indicating when a valid organization schedule will + * become invalid. If omitted, the schedule is already invalid. A + * schedule is valid if it has a weekly schedule for all named periods + * for all its schedule fragments, and if it has a schedule fragment + * for the time period in question. + */ + validUntil?: Date; + /** + * If the organization schedule fragment specifies that the given day + * belongs to a named period, a weekly schedule from this list with + * the matching name will be selected. + */ + weeklyOrgSchedules?: DevRev.WeeklyOrgSchedule[]; +} diff --git a/src/api/types/OrgScheduleFragment.ts b/src/api/types/OrgScheduleFragment.ts new file mode 100644 index 0000000..8a82447 --- /dev/null +++ b/src/api/types/OrgScheduleFragment.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgScheduleFragment extends DevRev.AtomBase { + /** + * The date (inclusive) on which the organization schedule fragment + * begins. + */ + from?: Date; + /** + * Periods during which the schedule is considered to be 'off' or to + * be in some specific named period. + */ + intervals?: DevRev.OrgScheduleInterval[]; + /** Human-readable name, indicating the purpose of the schedule. */ + name?: string; + /** + * CLDR region code of the countries/regions it is meant to be valid + * for. Does not drive logic, serves only for easier filtering and + * organization. + */ + regionCodes?: string[]; + status: DevRev.OrgScheduleFragmentStatus; + /** + * The date (exclusive) on which the organization schedule fragment's + * validity ends. + */ + to?: Date; +} diff --git a/src/api/types/OrgScheduleFragmentOverview.ts b/src/api/types/OrgScheduleFragmentOverview.ts new file mode 100644 index 0000000..911f6c0 --- /dev/null +++ b/src/api/types/OrgScheduleFragmentOverview.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The representation of the organization schedule fragment embedded + * inside a organization schedule, used to quickly look up the schedule + * fragment for the right period. + */ +export type OrgScheduleFragmentOverview = Record; diff --git a/src/api/types/OrgScheduleFragmentStatus.ts b/src/api/types/OrgScheduleFragmentStatus.ts new file mode 100644 index 0000000..0b6758f --- /dev/null +++ b/src/api/types/OrgScheduleFragmentStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Status determines how an item can be used. In 'draft' status an item + * can be edited but can't be used. When 'published' the item can longer + * be edited but can be used. 'Archived' is read-only. + */ +export type OrgScheduleFragmentStatus = "archived" | "draft" | "published"; + +export const OrgScheduleFragmentStatus = { + Archived: "archived", + Draft: "draft", + Published: "published", +} as const; diff --git a/src/api/types/OrgScheduleFragmentsCreateResponse.ts b/src/api/types/OrgScheduleFragmentsCreateResponse.ts new file mode 100644 index 0000000..f9dea9a --- /dev/null +++ b/src/api/types/OrgScheduleFragmentsCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgScheduleFragmentsCreateResponse { + orgScheduleFragment: DevRev.OrgScheduleFragment; +} diff --git a/src/api/types/OrgScheduleFragmentsGetResponse.ts b/src/api/types/OrgScheduleFragmentsGetResponse.ts new file mode 100644 index 0000000..d81cbcf --- /dev/null +++ b/src/api/types/OrgScheduleFragmentsGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgScheduleFragmentsGetResponse { + orgScheduleFragment: DevRev.OrgScheduleFragment; +} diff --git a/src/api/types/OrgScheduleFragmentsTransitionResponse.ts b/src/api/types/OrgScheduleFragmentsTransitionResponse.ts new file mode 100644 index 0000000..2ca79aa --- /dev/null +++ b/src/api/types/OrgScheduleFragmentsTransitionResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgScheduleFragmentsTransitionResponse { + orgScheduleFragment: DevRev.OrgScheduleFragment; +} diff --git a/src/api/types/OrgScheduleInterval.ts b/src/api/types/OrgScheduleInterval.ts new file mode 100644 index 0000000..78f0b4b --- /dev/null +++ b/src/api/types/OrgScheduleInterval.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * An optionally named period on day granularity. + */ +export type OrgScheduleInterval = Record; diff --git a/src/api/types/OrgScheduleStatus.ts b/src/api/types/OrgScheduleStatus.ts new file mode 100644 index 0000000..3cc3d7c --- /dev/null +++ b/src/api/types/OrgScheduleStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Status determines how an item can be used. In 'draft' status an item + * can be edited but can't be used. When 'published' the item can longer + * be edited but can be used. 'Archived' is read-only. + */ +export type OrgScheduleStatus = "archived" | "draft" | "published"; + +export const OrgScheduleStatus = { + Archived: "archived", + Draft: "draft", + Published: "published", +} as const; diff --git a/src/api/types/OrgScheduleSummary.ts b/src/api/types/OrgScheduleSummary.ts new file mode 100644 index 0000000..20c59f4 --- /dev/null +++ b/src/api/types/OrgScheduleSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgScheduleSummary extends DevRev.AtomBaseSummary { + /** Human-readable name. */ + name?: string; + status: DevRev.OrgScheduleStatus; + /** + * Timezone in which this is defined. Only organization schedules in + * the same timezone can be directly combined. + */ + timezone?: string; + /** + * Derived field indicating when a valid organization schedule will + * become invalid. If omitted, the schedule is already invalid. A + * schedule is valid if it has a weekly schedule for all named periods + * for all its schedule fragments, and if it has a schedule fragment + * for the time period in question. + */ + validUntil?: Date; +} diff --git a/src/api/types/OrgSchedulesCreateResponse.ts b/src/api/types/OrgSchedulesCreateResponse.ts new file mode 100644 index 0000000..2d4c4be --- /dev/null +++ b/src/api/types/OrgSchedulesCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSchedulesCreateResponse { + orgSchedule: DevRev.OrgSchedule; +} diff --git a/src/api/types/OrgSchedulesGetResponse.ts b/src/api/types/OrgSchedulesGetResponse.ts new file mode 100644 index 0000000..9af51a9 --- /dev/null +++ b/src/api/types/OrgSchedulesGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSchedulesGetResponse { + orgSchedule: DevRev.OrgSchedule; +} diff --git a/src/api/types/OrgSchedulesListResponse.ts b/src/api/types/OrgSchedulesListResponse.ts new file mode 100644 index 0000000..a2cc8b9 --- /dev/null +++ b/src/api/types/OrgSchedulesListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSchedulesListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** The list of organization schedules. */ + orgSchedules: DevRev.OrgSchedule[]; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/OrgSchedulesSetFutureResponse.ts b/src/api/types/OrgSchedulesSetFutureResponse.ts new file mode 100644 index 0000000..5f12357 --- /dev/null +++ b/src/api/types/OrgSchedulesSetFutureResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSchedulesSetFutureResponse { + orgSchedule: DevRev.OrgSchedule; +} diff --git a/src/api/types/OrgSchedulesTransitionResponse.ts b/src/api/types/OrgSchedulesTransitionResponse.ts new file mode 100644 index 0000000..454ffbe --- /dev/null +++ b/src/api/types/OrgSchedulesTransitionResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSchedulesTransitionResponse { + orgSchedule: DevRev.OrgSchedule; +} diff --git a/src/api/types/OrgSchedulesUpdateResponse.ts b/src/api/types/OrgSchedulesUpdateResponse.ts new file mode 100644 index 0000000..5a8ef4f --- /dev/null +++ b/src/api/types/OrgSchedulesUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSchedulesUpdateResponse { + orgSchedule: DevRev.OrgSchedule; +} diff --git a/src/api/types/OrgSearchSummary.ts b/src/api/types/OrgSearchSummary.ts new file mode 100644 index 0000000..443e422 --- /dev/null +++ b/src/api/types/OrgSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface OrgSearchSummary extends DevRev.SearchSummaryBase { + org: DevRev.OrgSummary; +} diff --git a/src/api/types/OrgSummary.ts b/src/api/types/OrgSummary.ts new file mode 100644 index 0000000..fba5806 --- /dev/null +++ b/src/api/types/OrgSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type OrgSummary = DevRev.OrgSummary.Account | DevRev.OrgSummary.RevOrg; + +export declare namespace OrgSummary { + interface Account extends DevRev.OrgBaseSummary { + type: "account"; + } + + interface RevOrg extends DevRev.OrgBaseSummary { + type: "rev_org"; + } +} diff --git a/src/api/types/OrgType.ts b/src/api/types/OrgType.ts new file mode 100644 index 0000000..f57f549 --- /dev/null +++ b/src/api/types/OrgType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type OrgType = "account" | "rev_org"; + +export const OrgType = { + Account: "account", + RevOrg: "rev_org", +} as const; diff --git a/src/api/types/ParentPartFilter.ts b/src/api/types/ParentPartFilter.ts new file mode 100644 index 0000000..4fd209c --- /dev/null +++ b/src/api/types/ParentPartFilter.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The filter for specifying parent part. + */ +export interface ParentPartFilter { + /** Number of levels to fetch the part hierarchy up to. */ + level?: number; + /** Part IDs to fetch the hierarchy for. */ + parts: string[]; +} diff --git a/src/api/types/Part.ts b/src/api/types/Part.ts new file mode 100644 index 0000000..3c42694 --- /dev/null +++ b/src/api/types/Part.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Part = DevRev.Part.Capability | DevRev.Part.Enhancement | DevRev.Part.Feature | DevRev.Part.Product; + +export declare namespace Part { + interface Capability extends DevRev.PartBase { + type: "capability"; + } + + interface Enhancement extends DevRev.PartBase { + type: "enhancement"; + } + + interface Feature extends DevRev.PartBase { + type: "feature"; + } + + interface Product extends DevRev.PartBase { + type: "product"; + } +} diff --git a/src/api/types/PartBase.ts b/src/api/types/PartBase.ts new file mode 100644 index 0000000..cb6468f --- /dev/null +++ b/src/api/types/PartBase.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface PartBase extends DevRev.AtomBase { + /** The attached artifacts. */ + artifacts?: DevRev.ArtifactSummary[]; + /** Custom fields. */ + customFields?: Record; + /** Custom schema fragments. */ + customSchemaFragments?: string[]; + /** Description of the part. */ + description?: string; + /** Name of the part. */ + name: string; + /** The users that own the part. */ + ownedBy: DevRev.UserSummary[]; + /** Stock schema fragment. */ + stockSchemaFragment?: string; + /** Subtype corresponding to the custom type fragment. */ + subtype?: string; + /** Tags associated with the object. */ + tags?: DevRev.TagWithValue[]; +} diff --git a/src/api/types/PartBaseSummary.ts b/src/api/types/PartBaseSummary.ts new file mode 100644 index 0000000..c4df38f --- /dev/null +++ b/src/api/types/PartBaseSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface PartBaseSummary extends DevRev.AtomBaseSummary { + /** Name of the part. */ + name: string; +} diff --git a/src/api/types/PartSearchSummary.ts b/src/api/types/PartSearchSummary.ts new file mode 100644 index 0000000..33dbe8f --- /dev/null +++ b/src/api/types/PartSearchSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface PartSearchSummary extends DevRev.SearchSummaryBase { + /** Comments on the work. */ + comments?: DevRev.CommentSearchSummary[]; + part: DevRev.PartSummary; +} diff --git a/src/api/types/PartSummary.ts b/src/api/types/PartSummary.ts new file mode 100644 index 0000000..0671c54 --- /dev/null +++ b/src/api/types/PartSummary.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type PartSummary = + | DevRev.PartSummary.Capability + | DevRev.PartSummary.Enhancement + | DevRev.PartSummary.Feature + | DevRev.PartSummary.Product; + +export declare namespace PartSummary { + interface Capability extends DevRev.PartBaseSummary { + type: "capability"; + } + + interface Enhancement extends DevRev.PartBaseSummary { + type: "enhancement"; + } + + interface Feature extends DevRev.PartBaseSummary { + type: "feature"; + } + + interface Product extends DevRev.PartBaseSummary { + type: "product"; + } +} diff --git a/src/api/types/PartType.ts b/src/api/types/PartType.ts new file mode 100644 index 0000000..718c958 --- /dev/null +++ b/src/api/types/PartType.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PartType = "capability" | "enhancement" | "feature" | "product"; + +export const PartType = { + Capability: "capability", + Enhancement: "enhancement", + Feature: "feature", + Product: "product", +} as const; diff --git a/src/api/types/PartsCreateRequest.ts b/src/api/types/PartsCreateRequest.ts new file mode 100644 index 0000000..b2bc6f9 --- /dev/null +++ b/src/api/types/PartsCreateRequest.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type PartsCreateRequest = + | DevRev.PartsCreateRequest.Capability + | DevRev.PartsCreateRequest.Enhancement + | DevRev.PartsCreateRequest.Feature + | DevRev.PartsCreateRequest.Product; + +export declare namespace PartsCreateRequest { + interface Capability extends DevRev.PartsCreateRequestCapability, _Base { + type: "capability"; + } + + interface Enhancement extends DevRev.PartsCreateRequestEnhancement, _Base { + type: "enhancement"; + } + + interface Feature extends DevRev.PartsCreateRequestFeature, _Base { + type: "feature"; + } + + interface Product extends _Base { + type: "product"; + value: DevRev.PartsCreateRequestProduct; + } + + interface _Base { + /** The IDs of the artifacts. */ + artifacts?: string[]; + /** Custom fields. */ + customFields?: Record; + /** The custom schema fragments to use. */ + customSchemaFragments?: string[]; + /** Description of the part. */ + description?: string; + /** Name of the part. */ + name: string; + /** The users that own the part. */ + ownedBy: string[]; + } +} diff --git a/src/api/types/PartsCreateRequestCapability.ts b/src/api/types/PartsCreateRequestCapability.ts new file mode 100644 index 0000000..d1e8cb5 --- /dev/null +++ b/src/api/types/PartsCreateRequestCapability.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PartsCreateRequestCapability { + /** ID of the parent product for the capability. */ + parentPart: string[]; +} diff --git a/src/api/types/PartsCreateRequestEnhancement.ts b/src/api/types/PartsCreateRequestEnhancement.ts new file mode 100644 index 0000000..0d31de0 --- /dev/null +++ b/src/api/types/PartsCreateRequestEnhancement.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PartsCreateRequestEnhancement { + /** ID of the parent part on which the enhancement is to be created. */ + parentPart: string[]; + /** Target close date by which enhancement is expected to be closed. */ + targetCloseDate?: Date; + /** + * Target start date by which enhancement is expected to be started. + * Example Date Format: 2000-11-01T01:01:01Z + */ + targetStartDate?: Date; +} diff --git a/src/api/types/PartsCreateRequestFeature.ts b/src/api/types/PartsCreateRequestFeature.ts new file mode 100644 index 0000000..560d10e --- /dev/null +++ b/src/api/types/PartsCreateRequestFeature.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PartsCreateRequestFeature { + /** ID of the parent capability/feature for the feature. */ + parentPart: string[]; +} diff --git a/src/api/types/PartsCreateRequestProduct.ts b/src/api/types/PartsCreateRequestProduct.ts new file mode 100644 index 0000000..491093d --- /dev/null +++ b/src/api/types/PartsCreateRequestProduct.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PartsCreateRequestProduct = Record; diff --git a/src/api/types/PartsCreateResponse.ts b/src/api/types/PartsCreateResponse.ts new file mode 100644 index 0000000..9452bfa --- /dev/null +++ b/src/api/types/PartsCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface PartsCreateResponse { + part: DevRev.Part; +} diff --git a/src/api/types/PartsDeleteResponse.ts b/src/api/types/PartsDeleteResponse.ts new file mode 100644 index 0000000..a0173c1 --- /dev/null +++ b/src/api/types/PartsDeleteResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PartsDeleteResponse = Record; diff --git a/src/api/types/PartsGetResponse.ts b/src/api/types/PartsGetResponse.ts new file mode 100644 index 0000000..b387f39 --- /dev/null +++ b/src/api/types/PartsGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface PartsGetResponse { + part: DevRev.Part; +} diff --git a/src/api/types/PartsListResponse.ts b/src/api/types/PartsListResponse.ts new file mode 100644 index 0000000..f62a612 --- /dev/null +++ b/src/api/types/PartsListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface PartsListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** The list of parts. */ + parts: DevRev.Part[]; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; +} diff --git a/src/api/types/PartsUpdateRequest.ts b/src/api/types/PartsUpdateRequest.ts new file mode 100644 index 0000000..6965a9c --- /dev/null +++ b/src/api/types/PartsUpdateRequest.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type PartsUpdateRequest = + | DevRev.PartsUpdateRequest.Capability + | DevRev.PartsUpdateRequest.Enhancement + | DevRev.PartsUpdateRequest.Feature + | DevRev.PartsUpdateRequest.None + | DevRev.PartsUpdateRequest.Product; + +export declare namespace PartsUpdateRequest { + interface Capability extends _Base { + type: "capability"; + value: DevRev.PartsUpdateRequestCapability; + } + + interface Enhancement extends DevRev.PartsUpdateRequestEnhancement, _Base { + type: "enhancement"; + } + + interface Feature extends _Base { + type: "feature"; + value: DevRev.PartsUpdateRequestFeature; + } + + interface None extends _Base { + type: "none"; + value: DevRev.Empty; + } + + interface Product extends _Base { + type: "product"; + value: DevRev.PartsUpdateRequestProduct; + } + + interface _Base { + artifacts?: DevRev.PartsUpdateRequestArtifacts; + /** Custom fields. */ + customFields?: Record; + /** The custom schema fragments to use. */ + customSchemaFragments?: string[]; + /** The updated description of the part. */ + description?: string; + /** The ID of the part to update. */ + id: string; + /** The updated name of the part. */ + name?: string; + ownedBy?: DevRev.PartsUpdateRequestOwnedBy; + } +} diff --git a/src/api/types/PartsUpdateRequestArtifacts.ts b/src/api/types/PartsUpdateRequestArtifacts.ts new file mode 100644 index 0000000..121ac06 --- /dev/null +++ b/src/api/types/PartsUpdateRequestArtifacts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PartsUpdateRequestArtifacts { + /** Sets the artifacts to the provided IDs. */ + set?: string[]; +} diff --git a/src/api/types/PartsUpdateRequestCapability.ts b/src/api/types/PartsUpdateRequestCapability.ts new file mode 100644 index 0000000..f7736c0 --- /dev/null +++ b/src/api/types/PartsUpdateRequestCapability.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PartsUpdateRequestCapability = Record; diff --git a/src/api/types/PartsUpdateRequestEnhancement.ts b/src/api/types/PartsUpdateRequestEnhancement.ts new file mode 100644 index 0000000..8a92517 --- /dev/null +++ b/src/api/types/PartsUpdateRequestEnhancement.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PartsUpdateRequestEnhancement { + /** Updates the target close date of the enhancement. */ + targetCloseDate?: Date; + /** + * Updates the target start date of the enhancement. Example Date + * Format: 2000-11-01T01:01:01Z + */ + targetStartDate?: Date; +} diff --git a/src/api/types/PartsUpdateRequestFeature.ts b/src/api/types/PartsUpdateRequestFeature.ts new file mode 100644 index 0000000..e94bc52 --- /dev/null +++ b/src/api/types/PartsUpdateRequestFeature.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PartsUpdateRequestFeature = Record; diff --git a/src/api/types/PartsUpdateRequestOwnedBy.ts b/src/api/types/PartsUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..f212564 --- /dev/null +++ b/src/api/types/PartsUpdateRequestOwnedBy.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PartsUpdateRequestOwnedBy { + /** + * Sets the owner IDs to the provided user IDs. This must not be + * empty. + */ + set?: string[]; +} diff --git a/src/api/types/PartsUpdateRequestProduct.ts b/src/api/types/PartsUpdateRequestProduct.ts new file mode 100644 index 0000000..1976826 --- /dev/null +++ b/src/api/types/PartsUpdateRequestProduct.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PartsUpdateRequestProduct = Record; diff --git a/src/api/types/PartsUpdateResponse.ts b/src/api/types/PartsUpdateResponse.ts new file mode 100644 index 0000000..60f4bf5 --- /dev/null +++ b/src/api/types/PartsUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface PartsUpdateResponse { + part: DevRev.Part; +} diff --git a/src/api/types/Product.ts b/src/api/types/Product.ts new file mode 100644 index 0000000..21443a7 --- /dev/null +++ b/src/api/types/Product.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Product = DevRev.PartBase; diff --git a/src/api/types/ProductSummary.ts b/src/api/types/ProductSummary.ts new file mode 100644 index 0000000..dad7101 --- /dev/null +++ b/src/api/types/ProductSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type ProductSummary = DevRev.PartBaseSummary; diff --git a/src/api/types/QuestionAnswer.ts b/src/api/types/QuestionAnswer.ts new file mode 100644 index 0000000..bdd001d --- /dev/null +++ b/src/api/types/QuestionAnswer.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface QuestionAnswer extends DevRev.AtomBase { + /** The Answer. */ + answer?: string; + /** The Question. */ + question?: string; + /** An alternative answer suggested by the Q/A generation algorithm. */ + suggestedAnswer?: string; + /** + * Whether the Q/A was marked for deletion by the Q/A generation + * algorithm. + */ + suggestedForDeletion?: boolean; + /** The topic to which the QA belongs. */ + topic?: string; + /** Whether the Q/A was verified. */ + verified?: boolean; +} diff --git a/src/api/types/QuestionAnswerSearchSummary.ts b/src/api/types/QuestionAnswerSearchSummary.ts new file mode 100644 index 0000000..3269b02 --- /dev/null +++ b/src/api/types/QuestionAnswerSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface QuestionAnswerSearchSummary extends DevRev.SearchSummaryBase { + questionAnswer: DevRev.QuestionAnswerSummary; +} diff --git a/src/api/types/QuestionAnswerStatus.ts b/src/api/types/QuestionAnswerStatus.ts new file mode 100644 index 0000000..a3032eb --- /dev/null +++ b/src/api/types/QuestionAnswerStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Status of the question answer. + */ +export type QuestionAnswerStatus = "archived" | "discarded" | "draft" | "published" | "review_needed"; + +export const QuestionAnswerStatus = { + Archived: "archived", + Discarded: "discarded", + Draft: "draft", + Published: "published", + ReviewNeeded: "review_needed", +} as const; diff --git a/src/api/types/QuestionAnswerSummary.ts b/src/api/types/QuestionAnswerSummary.ts new file mode 100644 index 0000000..91b3a89 --- /dev/null +++ b/src/api/types/QuestionAnswerSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface QuestionAnswerSummary extends DevRev.AtomBaseSummary { + /** The Question. */ + question?: string; +} diff --git a/src/api/types/QuestionAnswersCreateResponse.ts b/src/api/types/QuestionAnswersCreateResponse.ts new file mode 100644 index 0000000..ed55383 --- /dev/null +++ b/src/api/types/QuestionAnswersCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Create question-answer response. + */ +export interface QuestionAnswersCreateResponse { + questionAnswer: DevRev.QuestionAnswer; +} diff --git a/src/api/types/QuestionAnswersGetResponse.ts b/src/api/types/QuestionAnswersGetResponse.ts new file mode 100644 index 0000000..191cb92 --- /dev/null +++ b/src/api/types/QuestionAnswersGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Get question-answer response. + */ +export interface QuestionAnswersGetResponse { + questionAnswer: DevRev.QuestionAnswer; +} diff --git a/src/api/types/QuestionAnswersListResponse.ts b/src/api/types/QuestionAnswersListResponse.ts new file mode 100644 index 0000000..1397d3c --- /dev/null +++ b/src/api/types/QuestionAnswersListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * List question-answers response. + */ +export interface QuestionAnswersListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The question-answers entries matching the request. */ + questionAnswers: DevRev.QuestionAnswer[]; + /** Total number of question-answer items for the request. */ + total: number; +} diff --git a/src/api/types/QuestionAnswersUpdateRequestAppliesToArticles.ts b/src/api/types/QuestionAnswersUpdateRequestAppliesToArticles.ts new file mode 100644 index 0000000..c61e8ea --- /dev/null +++ b/src/api/types/QuestionAnswersUpdateRequestAppliesToArticles.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface QuestionAnswersUpdateRequestAppliesToArticles { + /** Updates the article that the question-answer applies to. */ + set?: string[]; +} diff --git a/src/api/types/QuestionAnswersUpdateRequestAppliesToParts.ts b/src/api/types/QuestionAnswersUpdateRequestAppliesToParts.ts new file mode 100644 index 0000000..157db4d --- /dev/null +++ b/src/api/types/QuestionAnswersUpdateRequestAppliesToParts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface QuestionAnswersUpdateRequestAppliesToParts { + /** Updates the parts that the question-answer applies to. */ + set?: string[]; +} diff --git a/src/api/types/QuestionAnswersUpdateRequestOwnedBy.ts b/src/api/types/QuestionAnswersUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..6762423 --- /dev/null +++ b/src/api/types/QuestionAnswersUpdateRequestOwnedBy.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface QuestionAnswersUpdateRequestOwnedBy { + /** + * Sets the owner IDs to the provided user IDs. This must not be + * empty. + */ + set?: string[]; +} diff --git a/src/api/types/QuestionAnswersUpdateRequestSharedWith.ts b/src/api/types/QuestionAnswersUpdateRequestSharedWith.ts new file mode 100644 index 0000000..ae3fe2d --- /dev/null +++ b/src/api/types/QuestionAnswersUpdateRequestSharedWith.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface QuestionAnswersUpdateRequestSharedWith { + /** Sets the field to the provided membership list. */ + set?: DevRev.SetSharedWithMembership[]; +} diff --git a/src/api/types/QuestionAnswersUpdateRequestSources.ts b/src/api/types/QuestionAnswersUpdateRequestSources.ts new file mode 100644 index 0000000..9f5ce16 --- /dev/null +++ b/src/api/types/QuestionAnswersUpdateRequestSources.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface QuestionAnswersUpdateRequestSources { + /** Sets the sources that generated the question-answer. */ + set?: string[]; +} diff --git a/src/api/types/QuestionAnswersUpdateRequestTags.ts b/src/api/types/QuestionAnswersUpdateRequestTags.ts new file mode 100644 index 0000000..0978de1 --- /dev/null +++ b/src/api/types/QuestionAnswersUpdateRequestTags.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface QuestionAnswersUpdateRequestTags { + /** Sets the provided tags on the question-answer. */ + set?: DevRev.SetTagWithValue[]; +} diff --git a/src/api/types/QuestionAnswersUpdateResponse.ts b/src/api/types/QuestionAnswersUpdateResponse.ts new file mode 100644 index 0000000..a717495 --- /dev/null +++ b/src/api/types/QuestionAnswersUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface QuestionAnswersUpdateResponse { + questionAnswer: DevRev.QuestionAnswer; +} diff --git a/src/api/types/Resource.ts b/src/api/types/Resource.ts new file mode 100644 index 0000000..3ddaea2 --- /dev/null +++ b/src/api/types/Resource.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Resource details. + */ +export interface Resource { + /** Ids of the artifacts. */ + artifacts?: DevRev.ArtifactSummary[]; + /** URL of the external article. */ + url?: string; +} diff --git a/src/api/types/ResourceSummary.ts b/src/api/types/ResourceSummary.ts new file mode 100644 index 0000000..2e6a396 --- /dev/null +++ b/src/api/types/ResourceSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Resource details. + */ +export interface ResourceSummary { + /** Ids of the artifacts. */ + artifacts?: DevRev.ArtifactSummary[]; + /** URL of the external article. */ + url?: string; +} diff --git a/src/api/types/RevOrg.ts b/src/api/types/RevOrg.ts new file mode 100644 index 0000000..7ec4e50 --- /dev/null +++ b/src/api/types/RevOrg.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface RevOrg extends DevRev.OrgBase { + account?: DevRev.AccountSummary; + /** The artifacts attached to the Rev organization. */ + artifacts?: DevRev.ArtifactSummary[]; + /** Custom fields. */ + customFields?: Record; + /** Custom schema fragments. */ + customSchemaFragments?: string[]; + /** Description of the Rev organization. */ + description?: string; + /** Company's domain name. Example - 'devrev.ai'. */ + domain?: string; + /** + * External ref is a unique identifier for the Rev (customer) + * organization from your primary customer system of records. If none + * is specified, a system-generated identifier will be assigned to the + * organization. + */ + externalRef?: string; + /** Stock schema fragment. */ + stockSchemaFragment?: string; + /** Subtype corresponding to the custom type fragment. */ + subtype?: string; + /** Tags associated with an object. */ + tags?: DevRev.TagWithValue[]; +} diff --git a/src/api/types/RevOrgSummary.ts b/src/api/types/RevOrgSummary.ts new file mode 100644 index 0000000..c09b914 --- /dev/null +++ b/src/api/types/RevOrgSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type RevOrgSummary = DevRev.OrgBaseSummary; diff --git a/src/api/types/RevOrgsCreateResponse.ts b/src/api/types/RevOrgsCreateResponse.ts new file mode 100644 index 0000000..ecc23c4 --- /dev/null +++ b/src/api/types/RevOrgsCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Response object for request to create a new Rev organization. + */ +export interface RevOrgsCreateResponse { + revOrg: DevRev.RevOrg; +} diff --git a/src/api/types/RevOrgsGetResponse.ts b/src/api/types/RevOrgsGetResponse.ts new file mode 100644 index 0000000..50a969d --- /dev/null +++ b/src/api/types/RevOrgsGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to getting a Rev organization's information. + */ +export interface RevOrgsGetResponse { + revOrg: DevRev.RevOrg; +} diff --git a/src/api/types/RevOrgsListResponse.ts b/src/api/types/RevOrgsListResponse.ts new file mode 100644 index 0000000..eeea315 --- /dev/null +++ b/src/api/types/RevOrgsListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to getting a list of Rev organizations' information. + */ +export interface RevOrgsListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** List with all of the Rev organizations' information. */ + revOrgs: DevRev.RevOrg[]; +} diff --git a/src/api/types/RevOrgsUpdateRequestArtifacts.ts b/src/api/types/RevOrgsUpdateRequestArtifacts.ts new file mode 100644 index 0000000..72d130f --- /dev/null +++ b/src/api/types/RevOrgsUpdateRequestArtifacts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface RevOrgsUpdateRequestArtifacts { + /** Sets the IDs to the provided artifact IDs. */ + set?: string[]; +} diff --git a/src/api/types/RevOrgsUpdateResponse.ts b/src/api/types/RevOrgsUpdateResponse.ts new file mode 100644 index 0000000..6a2f434 --- /dev/null +++ b/src/api/types/RevOrgsUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Response object to updating Rev organization's information. + */ +export interface RevOrgsUpdateResponse { + revOrg: DevRev.RevOrg; +} diff --git a/src/api/types/RevUser.ts b/src/api/types/RevUser.ts new file mode 100644 index 0000000..4a5f30b --- /dev/null +++ b/src/api/types/RevUser.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface RevUser extends DevRev.UserBase { + /** The artifacts attached to the Rev user. */ + artifacts?: DevRev.ArtifactSummary[]; + /** Custom fields. */ + customFields?: Record; + /** Custom schema fragments. */ + customSchemaFragments?: string[]; + /** Description of the Rev user. */ + description?: string; + /** + * External ref is a mutable unique identifier for a user within the + * Rev organization from your primary customer record. If none is + * available, a good alternative is the email address/phone number + * which could uniquely identify the user. If none is specified, a + * system-generated identifier will be assigned to the user. + */ + externalRef?: string; + /** Whether the Rev user is verified or not. */ + isVerified?: boolean; + revOrg?: DevRev.OrgSummary; + /** Stock schema fragment. */ + stockSchemaFragment?: string; + /** Subtype corresponding to the custom type fragment. */ + subtype?: string; + /** Tags associated with the object. */ + tags?: DevRev.TagWithValue[]; +} diff --git a/src/api/types/RevUserSummary.ts b/src/api/types/RevUserSummary.ts new file mode 100644 index 0000000..53c3d8c --- /dev/null +++ b/src/api/types/RevUserSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface RevUserSummary extends DevRev.UserBaseSummary { + /** + * External ref is a mutable unique identifier for a user within the + * Rev organization from your primary customer record. If none is + * available, a good alternative is the email address/phone number + * which could uniquely identify the user. If none is specified, a + * system-generated identifier will be assigned to the user. + */ + externalRef?: string; + revOrg?: DevRev.OrgSummary; +} diff --git a/src/api/types/RevUsersCreateResponse.ts b/src/api/types/RevUsersCreateResponse.ts new file mode 100644 index 0000000..01f1d2e --- /dev/null +++ b/src/api/types/RevUsersCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Response object for creating a new Rev user for Rev organization. + */ +export interface RevUsersCreateResponse { + revUser: DevRev.RevUser; +} diff --git a/src/api/types/RevUsersDeleteResponse.ts b/src/api/types/RevUsersDeleteResponse.ts new file mode 100644 index 0000000..82d968d --- /dev/null +++ b/src/api/types/RevUsersDeleteResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The response to deleting a Rev user of a Rev organization. + */ +export type RevUsersDeleteResponse = Record; diff --git a/src/api/types/RevUsersGetResponse.ts b/src/api/types/RevUsersGetResponse.ts new file mode 100644 index 0000000..9229dd9 --- /dev/null +++ b/src/api/types/RevUsersGetResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The returned Rev user. + */ +export interface RevUsersGetResponse { + revUser: DevRev.RevUser; +} diff --git a/src/api/types/RevUsersListResponse.ts b/src/api/types/RevUsersListResponse.ts new file mode 100644 index 0000000..e1df213 --- /dev/null +++ b/src/api/types/RevUsersListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to listing all Rev users matching the filter criteria. + */ +export interface RevUsersListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** List containing all the Rev users. */ + revUsers: DevRev.RevUser[]; +} diff --git a/src/api/types/RevUsersUpdateRequestArtifacts.ts b/src/api/types/RevUsersUpdateRequestArtifacts.ts new file mode 100644 index 0000000..3621797 --- /dev/null +++ b/src/api/types/RevUsersUpdateRequestArtifacts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface RevUsersUpdateRequestArtifacts { + /** Sets the IDs to the provided artifact IDs. */ + set?: string[]; +} diff --git a/src/api/types/RevUsersUpdateRequestCustomSchemaFragments.ts b/src/api/types/RevUsersUpdateRequestCustomSchemaFragments.ts new file mode 100644 index 0000000..8c14628 --- /dev/null +++ b/src/api/types/RevUsersUpdateRequestCustomSchemaFragments.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface RevUsersUpdateRequestCustomSchemaFragments { + /** Sets the IDs to the provided schema fragment IDs. */ + set?: string[]; +} diff --git a/src/api/types/RevUsersUpdateResponse.ts b/src/api/types/RevUsersUpdateResponse.ts new file mode 100644 index 0000000..e10df56 --- /dev/null +++ b/src/api/types/RevUsersUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Updated Rev user object. + */ +export interface RevUsersUpdateResponse { + revUser: DevRev.RevUser; +} diff --git a/src/api/types/SchemaBoolFieldDescriptor.ts b/src/api/types/SchemaBoolFieldDescriptor.ts new file mode 100644 index 0000000..e303347 --- /dev/null +++ b/src/api/types/SchemaBoolFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaBoolFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: boolean; +} diff --git a/src/api/types/SchemaBoolListFieldDescriptor.ts b/src/api/types/SchemaBoolListFieldDescriptor.ts new file mode 100644 index 0000000..d8f6f15 --- /dev/null +++ b/src/api/types/SchemaBoolListFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaBoolListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: boolean[]; +} diff --git a/src/api/types/SchemaCompositeFieldDescriptor.ts b/src/api/types/SchemaCompositeFieldDescriptor.ts new file mode 100644 index 0000000..fa3de69 --- /dev/null +++ b/src/api/types/SchemaCompositeFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaCompositeFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Composite type. Required when field type is composite. */ + compositeType?: string; +} diff --git a/src/api/types/SchemaCompositeListFieldDescriptor.ts b/src/api/types/SchemaCompositeListFieldDescriptor.ts new file mode 100644 index 0000000..d341484 --- /dev/null +++ b/src/api/types/SchemaCompositeListFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaCompositeListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Composite type. Required when field type is composite. */ + compositeType?: string; +} diff --git a/src/api/types/SchemaDateFieldDescriptor.ts b/src/api/types/SchemaDateFieldDescriptor.ts new file mode 100644 index 0000000..11c9009 --- /dev/null +++ b/src/api/types/SchemaDateFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaDateFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: string; +} diff --git a/src/api/types/SchemaDateListFieldDescriptor.ts b/src/api/types/SchemaDateListFieldDescriptor.ts new file mode 100644 index 0000000..12f78de --- /dev/null +++ b/src/api/types/SchemaDateListFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaDateListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: string[]; +} diff --git a/src/api/types/SchemaDoubleFieldDescriptor.ts b/src/api/types/SchemaDoubleFieldDescriptor.ts new file mode 100644 index 0000000..6678c10 --- /dev/null +++ b/src/api/types/SchemaDoubleFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaDoubleFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: number; +} diff --git a/src/api/types/SchemaDoubleListFieldDescriptor.ts b/src/api/types/SchemaDoubleListFieldDescriptor.ts new file mode 100644 index 0000000..495efa5 --- /dev/null +++ b/src/api/types/SchemaDoubleListFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaDoubleListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: number[]; +} diff --git a/src/api/types/SchemaEnumFieldDescriptor.ts b/src/api/types/SchemaEnumFieldDescriptor.ts new file mode 100644 index 0000000..bd2578e --- /dev/null +++ b/src/api/types/SchemaEnumFieldDescriptor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaEnumFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Allowed values for the field. */ + allowedValues: string[]; + /** Default value. */ + defaultValue?: string; +} diff --git a/src/api/types/SchemaEnumListFieldDescriptor.ts b/src/api/types/SchemaEnumListFieldDescriptor.ts new file mode 100644 index 0000000..ae0e235 --- /dev/null +++ b/src/api/types/SchemaEnumListFieldDescriptor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaEnumListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Allowed values for the field. */ + allowedValues: string[]; + /** Default value. */ + defaultValue?: string[]; +} diff --git a/src/api/types/SchemaFieldCreateViewUiMetadata.ts b/src/api/types/SchemaFieldCreateViewUiMetadata.ts new file mode 100644 index 0000000..452b910 --- /dev/null +++ b/src/api/types/SchemaFieldCreateViewUiMetadata.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Create view UI hint overrides. + */ +export interface SchemaFieldCreateViewUiMetadata { + /** Whether field is hidden in the UI create view. */ + isHidden?: boolean; +} diff --git a/src/api/types/SchemaFieldDescriptor.ts b/src/api/types/SchemaFieldDescriptor.ts new file mode 100644 index 0000000..09e3777 --- /dev/null +++ b/src/api/types/SchemaFieldDescriptor.ts @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Set of field attributes. + */ +export type SchemaFieldDescriptor = + | DevRev.SchemaFieldDescriptor.Array + | DevRev.SchemaFieldDescriptor.Bool + | DevRev.SchemaFieldDescriptor.Composite + | DevRev.SchemaFieldDescriptor.Date_ + | DevRev.SchemaFieldDescriptor.Double + | DevRev.SchemaFieldDescriptor.Enum + | DevRev.SchemaFieldDescriptor.Id + | DevRev.SchemaFieldDescriptor.Int + | DevRev.SchemaFieldDescriptor.RichText + | DevRev.SchemaFieldDescriptor.Struct + | DevRev.SchemaFieldDescriptor.Text + | DevRev.SchemaFieldDescriptor.Timestamp + | DevRev.SchemaFieldDescriptor.Tokens + | DevRev.SchemaFieldDescriptor.Uenum + | DevRev.SchemaFieldDescriptor.Unknown; + +export declare namespace SchemaFieldDescriptor { + interface Array { + fieldType: "array"; + value: DevRev.SchemaFieldDescriptorArrayType; + } + + interface Bool extends DevRev.SchemaBoolFieldDescriptor { + fieldType: "bool"; + } + + interface Composite extends DevRev.SchemaCompositeFieldDescriptor { + fieldType: "composite"; + } + + interface Date_ extends DevRev.SchemaDateFieldDescriptor { + fieldType: "date"; + } + + interface Double extends DevRev.SchemaDoubleFieldDescriptor { + fieldType: "double"; + } + + interface Enum extends DevRev.SchemaEnumFieldDescriptor { + fieldType: "enum"; + } + + interface Id extends DevRev.SchemaIdFieldDescriptor { + fieldType: "id"; + } + + interface Int extends DevRev.SchemaIntFieldDescriptor { + fieldType: "int"; + } + + interface RichText extends DevRev.SchemaRichTextFieldDescriptor { + fieldType: "rich_text"; + } + + interface Struct extends DevRev.SchemaStructFieldDescriptor { + fieldType: "struct"; + } + + interface Text extends DevRev.SchemaTextFieldDescriptor { + fieldType: "text"; + } + + interface Timestamp extends DevRev.SchemaTimestampFieldDescriptor { + fieldType: "timestamp"; + } + + interface Tokens extends DevRev.SchemaTokensFieldDescriptor { + fieldType: "tokens"; + } + + interface Uenum extends DevRev.SchemaUenumFieldDescriptor { + fieldType: "uenum"; + } + + interface Unknown extends DevRev.SchemaFieldDescriptorBase { + fieldType: "unknown"; + } +} diff --git a/src/api/types/SchemaFieldDescriptorArrayType.ts b/src/api/types/SchemaFieldDescriptorArrayType.ts new file mode 100644 index 0000000..d37f536 --- /dev/null +++ b/src/api/types/SchemaFieldDescriptorArrayType.ts @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SchemaFieldDescriptorArrayType = + | DevRev.SchemaFieldDescriptorArrayType.Bool + | DevRev.SchemaFieldDescriptorArrayType.Composite + | DevRev.SchemaFieldDescriptorArrayType.Date_ + | DevRev.SchemaFieldDescriptorArrayType.Double + | DevRev.SchemaFieldDescriptorArrayType.Enum + | DevRev.SchemaFieldDescriptorArrayType.Id + | DevRev.SchemaFieldDescriptorArrayType.Int + | DevRev.SchemaFieldDescriptorArrayType.RichText + | DevRev.SchemaFieldDescriptorArrayType.Struct + | DevRev.SchemaFieldDescriptorArrayType.Text + | DevRev.SchemaFieldDescriptorArrayType.Timestamp + | DevRev.SchemaFieldDescriptorArrayType.Tokens + | DevRev.SchemaFieldDescriptorArrayType.Uenum; + +export declare namespace SchemaFieldDescriptorArrayType { + interface Bool extends DevRev.SchemaBoolListFieldDescriptor, _Base { + baseType: "bool"; + } + + interface Composite extends DevRev.SchemaCompositeListFieldDescriptor, _Base { + baseType: "composite"; + } + + interface Date_ extends DevRev.SchemaDateListFieldDescriptor, _Base { + baseType: "date"; + } + + interface Double extends DevRev.SchemaDoubleListFieldDescriptor, _Base { + baseType: "double"; + } + + interface Enum extends DevRev.SchemaEnumListFieldDescriptor, _Base { + baseType: "enum"; + } + + interface Id extends DevRev.SchemaIdListFieldDescriptor, _Base { + baseType: "id"; + } + + interface Int extends DevRev.SchemaIntListFieldDescriptor, _Base { + baseType: "int"; + } + + interface RichText extends DevRev.SchemaRichTextListFieldDescriptor, _Base { + baseType: "rich_text"; + } + + interface Struct extends DevRev.SchemaStructListFieldDescriptor, _Base { + baseType: "struct"; + } + + interface Text extends DevRev.SchemaTextListFieldDescriptor, _Base { + baseType: "text"; + } + + interface Timestamp extends DevRev.SchemaTimestampListFieldDescriptor, _Base { + baseType: "timestamp"; + } + + interface Tokens extends DevRev.SchemaTokensListFieldDescriptor, _Base { + baseType: "tokens"; + } + + interface Uenum extends DevRev.SchemaUenumListFieldDescriptor, _Base { + baseType: "uenum"; + } + + interface _Base { + /** The exact array length. */ + eqItems?: number; + /** The maximum array length. */ + maxItems?: number; + /** The minimum array length. */ + minItems?: number; + } +} diff --git a/src/api/types/SchemaFieldDescriptorArrayTypeBaseType.ts b/src/api/types/SchemaFieldDescriptorArrayTypeBaseType.ts new file mode 100644 index 0000000..2906112 --- /dev/null +++ b/src/api/types/SchemaFieldDescriptorArrayTypeBaseType.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SchemaFieldDescriptorArrayTypeBaseType = + | "bool" + | "composite" + | "date" + | "double" + | "enum" + | "id" + | "int" + | "rich_text" + | "struct" + | "text" + | "timestamp" + | "tokens" + | "uenum"; + +export const SchemaFieldDescriptorArrayTypeBaseType = { + Bool: "bool", + Composite: "composite", + Date: "date", + Double: "double", + Enum: "enum", + Id: "id", + Int: "int", + RichText: "rich_text", + Struct: "struct", + Text: "text", + Timestamp: "timestamp", + Tokens: "tokens", + Uenum: "uenum", +} as const; diff --git a/src/api/types/SchemaFieldDescriptorBase.ts b/src/api/types/SchemaFieldDescriptorBase.ts new file mode 100644 index 0000000..e482832 --- /dev/null +++ b/src/api/types/SchemaFieldDescriptorBase.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaFieldDescriptorBase { + /** Description of the field. */ + description?: string; + /** Whether this field is filterable, groupable and sortable. */ + isFilterable?: boolean; + /** Whether this field is immutable or not. */ + isImmutable?: boolean; + /** + * Whether this field can hold Personally Identifiable Information + * (PII). + */ + isPii?: boolean; + /** Whether this field is required or not. */ + isRequired?: boolean; + mfz?: DevRev.SchemaFieldMfzMetadata; + /** Name of the field. */ + name: string; + oasis?: DevRev.SchemaFieldOasisMetadata; + /** Type this field is from. */ + origin?: string; + ui?: DevRev.SchemaFieldUiMetadata; +} diff --git a/src/api/types/SchemaFieldDescriptorFieldType.ts b/src/api/types/SchemaFieldDescriptorFieldType.ts new file mode 100644 index 0000000..c9694f8 --- /dev/null +++ b/src/api/types/SchemaFieldDescriptorFieldType.ts @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SchemaFieldDescriptorFieldType = + | "array" + | "bool" + | "composite" + | "date" + | "double" + | "enum" + | "id" + | "int" + | "rich_text" + | "struct" + | "text" + | "timestamp" + | "tokens" + | "uenum" + | "unknown"; + +export const SchemaFieldDescriptorFieldType = { + Array: "array", + Bool: "bool", + Composite: "composite", + Date: "date", + Double: "double", + Enum: "enum", + Id: "id", + Int: "int", + RichText: "rich_text", + Struct: "struct", + Text: "text", + Timestamp: "timestamp", + Tokens: "tokens", + Uenum: "uenum", + Unknown: "unknown", +} as const; diff --git a/src/api/types/SchemaFieldDetailViewUiMetadata.ts b/src/api/types/SchemaFieldDetailViewUiMetadata.ts new file mode 100644 index 0000000..acb71c7 --- /dev/null +++ b/src/api/types/SchemaFieldDetailViewUiMetadata.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Detail view UI hint overrides. + */ +export interface SchemaFieldDetailViewUiMetadata { + /** Whether the field is hidden in the UI detail view. */ + isHidden?: boolean; +} diff --git a/src/api/types/SchemaFieldFilterViewUiMetadata.ts b/src/api/types/SchemaFieldFilterViewUiMetadata.ts new file mode 100644 index 0000000..6f6ec36 --- /dev/null +++ b/src/api/types/SchemaFieldFilterViewUiMetadata.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Filter view UI hint overrides. + */ +export interface SchemaFieldFilterViewUiMetadata { + /** Whether field is hidden in the UI filter view. */ + isHidden?: boolean; +} diff --git a/src/api/types/SchemaFieldListViewUiMetadata.ts b/src/api/types/SchemaFieldListViewUiMetadata.ts new file mode 100644 index 0000000..2316d5f --- /dev/null +++ b/src/api/types/SchemaFieldListViewUiMetadata.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * List view UI hint overrides. + */ +export interface SchemaFieldListViewUiMetadata { + /** Whether the field is hidden in the UI list view. */ + isHidden?: boolean; +} diff --git a/src/api/types/SchemaFieldMfzMetadata.ts b/src/api/types/SchemaFieldMfzMetadata.ts new file mode 100644 index 0000000..61532f2 --- /dev/null +++ b/src/api/types/SchemaFieldMfzMetadata.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The schema of MFZ specific fields. + */ +export type SchemaFieldMfzMetadata = Record; diff --git a/src/api/types/SchemaFieldOasisMetadata.ts b/src/api/types/SchemaFieldOasisMetadata.ts new file mode 100644 index 0000000..eb7276b --- /dev/null +++ b/src/api/types/SchemaFieldOasisMetadata.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The schema of oasis specific fields. + */ +export type SchemaFieldOasisMetadata = Record; diff --git a/src/api/types/SchemaFieldSummaryViewUiMetadata.ts b/src/api/types/SchemaFieldSummaryViewUiMetadata.ts new file mode 100644 index 0000000..75f8f01 --- /dev/null +++ b/src/api/types/SchemaFieldSummaryViewUiMetadata.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Summary view UI hint overrides. + */ +export interface SchemaFieldSummaryViewUiMetadata { + /** Whether field is hidden in the UI summary view. */ + isHidden?: boolean; +} diff --git a/src/api/types/SchemaFieldUenumValue.ts b/src/api/types/SchemaFieldUenumValue.ts new file mode 100644 index 0000000..d6f95c6 --- /dev/null +++ b/src/api/types/SchemaFieldUenumValue.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * A unified enum value. + */ +export type SchemaFieldUenumValue = Record; diff --git a/src/api/types/SchemaFieldUiMetadata.ts b/src/api/types/SchemaFieldUiMetadata.ts new file mode 100644 index 0000000..738a25d --- /dev/null +++ b/src/api/types/SchemaFieldUiMetadata.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The schema of ui specific fields. + */ +export interface SchemaFieldUiMetadata { + createView?: DevRev.SchemaFieldCreateViewUiMetadata; + detailView?: DevRev.SchemaFieldDetailViewUiMetadata; + /** The display name of the field. */ + displayName?: string; + filterView?: DevRev.SchemaFieldFilterViewUiMetadata; + /** An optional group name for the field. */ + groupName?: string; + /** Whether the field is active in the UI detail view. */ + isActiveInDetailView?: boolean; + /** Whether the field supports bulk action. */ + isBulkActionEnabled?: boolean; + /** Whether the field is groupable in the UI. */ + isGroupable?: boolean; + /** Whether the field is hidden in the UI. */ + isHidden?: boolean; + /** Whether the field is hidden in the UI during creation. */ + isHiddenDuringCreate?: boolean; + /** Whether the field is read-only in the UI. */ + isReadOnly?: boolean; + /** Whether the field is mandatory in the UI. */ + isRequired?: boolean; + /** Whether the field is shown in the UI summary view. */ + isShownInSummary?: boolean; + /** Whether the field is sortable in the UI. */ + isSortable?: boolean; + listView?: DevRev.SchemaFieldListViewUiMetadata; + /** A placeholder for the field. */ + placeholder?: string; + summaryView?: DevRev.SchemaFieldSummaryViewUiMetadata; + /** Tooltip for the field. */ + tooltip?: string; +} diff --git a/src/api/types/SchemaIdFieldDescriptor.ts b/src/api/types/SchemaIdFieldDescriptor.ts new file mode 100644 index 0000000..e5f4220 --- /dev/null +++ b/src/api/types/SchemaIdFieldDescriptor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaIdFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: string; + /** Object ID types. Required when field type is ID. */ + idType?: string[]; +} diff --git a/src/api/types/SchemaIdListFieldDescriptor.ts b/src/api/types/SchemaIdListFieldDescriptor.ts new file mode 100644 index 0000000..c361b1a --- /dev/null +++ b/src/api/types/SchemaIdListFieldDescriptor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaIdListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: string[]; + /** Object ID types. Required when field type is ID. */ + idType?: string[]; +} diff --git a/src/api/types/SchemaIntFieldDescriptor.ts b/src/api/types/SchemaIntFieldDescriptor.ts new file mode 100644 index 0000000..a4534f8 --- /dev/null +++ b/src/api/types/SchemaIntFieldDescriptor.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaIntFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: number; + /** The minimum value for the integer (exclusive). */ + gt?: number; + /** The minimum value for the integer (inclusive). */ + gte?: number; + /** The maximum value for the integer (exclusive). */ + lt?: number; + /** The maximum value for the integer (inclusive). */ + lte?: number; +} diff --git a/src/api/types/SchemaIntListFieldDescriptor.ts b/src/api/types/SchemaIntListFieldDescriptor.ts new file mode 100644 index 0000000..f597a61 --- /dev/null +++ b/src/api/types/SchemaIntListFieldDescriptor.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaIntListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: number[]; + /** The minimum value for the integer (exclusive). */ + gt?: number; + /** The minimum value for the integer (inclusive). */ + gte?: number; + /** The maximum value for the integer (exclusive). */ + lt?: number; + /** The maximum value for the integer (inclusive). */ + lte?: number; +} diff --git a/src/api/types/SchemaRichTextFieldDescriptor.ts b/src/api/types/SchemaRichTextFieldDescriptor.ts new file mode 100644 index 0000000..c9c13fc --- /dev/null +++ b/src/api/types/SchemaRichTextFieldDescriptor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaRichTextFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** The contained substring. */ + contains?: string; + /** Default value. */ + defaultValue?: string; + /** The exact string length. */ + eqLen?: number; + /** The maximum string length. */ + maxLen?: number; + /** The minimum string length. */ + minLen?: number; + /** The string pattern (regular expression). */ + pattern?: string; + /** The string prefix. */ + prefix?: string; + /** The string suffix. */ + suffix?: string; +} diff --git a/src/api/types/SchemaRichTextListFieldDescriptor.ts b/src/api/types/SchemaRichTextListFieldDescriptor.ts new file mode 100644 index 0000000..490f005 --- /dev/null +++ b/src/api/types/SchemaRichTextListFieldDescriptor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaRichTextListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** The contained substring. */ + contains?: string; + /** Default value. */ + defaultValue?: string[]; + /** The exact string length. */ + eqLen?: number; + /** The maximum string length. */ + maxLen?: number; + /** The minimum string length. */ + minLen?: number; + /** The string pattern (regular expression). */ + pattern?: string; + /** The string prefix. */ + prefix?: string; + /** The string suffix. */ + suffix?: string; +} diff --git a/src/api/types/SchemaStructFieldDescriptor.ts b/src/api/types/SchemaStructFieldDescriptor.ts new file mode 100644 index 0000000..13297b5 --- /dev/null +++ b/src/api/types/SchemaStructFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaStructFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: Record; +} diff --git a/src/api/types/SchemaStructListFieldDescriptor.ts b/src/api/types/SchemaStructListFieldDescriptor.ts new file mode 100644 index 0000000..7bfd204 --- /dev/null +++ b/src/api/types/SchemaStructListFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaStructListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: Record[]; +} diff --git a/src/api/types/SchemaTextFieldDescriptor.ts b/src/api/types/SchemaTextFieldDescriptor.ts new file mode 100644 index 0000000..43cb6b3 --- /dev/null +++ b/src/api/types/SchemaTextFieldDescriptor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaTextFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** The contained substring. */ + contains?: string; + /** Default value. */ + defaultValue?: string; + /** The exact string length. */ + eqLen?: number; + /** The maximum string length. */ + maxLen?: number; + /** The minimum string length. */ + minLen?: number; + /** The string pattern (regular expression). */ + pattern?: string; + /** The string prefix. */ + prefix?: string; + /** The string suffix. */ + suffix?: string; +} diff --git a/src/api/types/SchemaTextListFieldDescriptor.ts b/src/api/types/SchemaTextListFieldDescriptor.ts new file mode 100644 index 0000000..7a0afb6 --- /dev/null +++ b/src/api/types/SchemaTextListFieldDescriptor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaTextListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** The contained substring. */ + contains?: string; + /** Default value. */ + defaultValue?: string[]; + /** The exact string length. */ + eqLen?: number; + /** The maximum string length. */ + maxLen?: number; + /** The minimum string length. */ + minLen?: number; + /** The string pattern (regular expression). */ + pattern?: string; + /** The string prefix. */ + prefix?: string; + /** The string suffix. */ + suffix?: string; +} diff --git a/src/api/types/SchemaTimestampFieldDescriptor.ts b/src/api/types/SchemaTimestampFieldDescriptor.ts new file mode 100644 index 0000000..7b9985e --- /dev/null +++ b/src/api/types/SchemaTimestampFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaTimestampFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: string; +} diff --git a/src/api/types/SchemaTimestampListFieldDescriptor.ts b/src/api/types/SchemaTimestampListFieldDescriptor.ts new file mode 100644 index 0000000..e1af927 --- /dev/null +++ b/src/api/types/SchemaTimestampListFieldDescriptor.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaTimestampListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Default value. */ + defaultValue?: string[]; +} diff --git a/src/api/types/SchemaTokensFieldDescriptor.ts b/src/api/types/SchemaTokensFieldDescriptor.ts new file mode 100644 index 0000000..77d6066 --- /dev/null +++ b/src/api/types/SchemaTokensFieldDescriptor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaTokensFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** The contained substring. */ + contains?: string; + /** Default value. */ + defaultValue?: string; + /** The exact string length. */ + eqLen?: number; + /** The maximum string length. */ + maxLen?: number; + /** The minimum string length. */ + minLen?: number; + /** The string pattern (regular expression). */ + pattern?: string; + /** The string prefix. */ + prefix?: string; + /** The string suffix. */ + suffix?: string; +} diff --git a/src/api/types/SchemaTokensListFieldDescriptor.ts b/src/api/types/SchemaTokensListFieldDescriptor.ts new file mode 100644 index 0000000..2b13a85 --- /dev/null +++ b/src/api/types/SchemaTokensListFieldDescriptor.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaTokensListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** The contained substring. */ + contains?: string; + /** Default value. */ + defaultValue?: string[]; + /** The exact string length. */ + eqLen?: number; + /** The maximum string length. */ + maxLen?: number; + /** The minimum string length. */ + minLen?: number; + /** The string pattern (regular expression). */ + pattern?: string; + /** The string prefix. */ + prefix?: string; + /** The string suffix. */ + suffix?: string; +} diff --git a/src/api/types/SchemaUenumFieldDescriptor.ts b/src/api/types/SchemaUenumFieldDescriptor.ts new file mode 100644 index 0000000..24aee01 --- /dev/null +++ b/src/api/types/SchemaUenumFieldDescriptor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaUenumFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Allowed values for the field. */ + allowedValues: DevRev.SchemaFieldUenumValue[]; + /** Default value. */ + defaultValue?: number; +} diff --git a/src/api/types/SchemaUenumListFieldDescriptor.ts b/src/api/types/SchemaUenumListFieldDescriptor.ts new file mode 100644 index 0000000..3d999a1 --- /dev/null +++ b/src/api/types/SchemaUenumListFieldDescriptor.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SchemaUenumListFieldDescriptor extends DevRev.SchemaFieldDescriptorBase { + /** Allowed values for the field. */ + allowedValues: DevRev.SchemaFieldUenumValue[]; + /** Default value. */ + defaultValue?: number[]; +} diff --git a/src/api/types/SchemaUnknownFieldDescriptor.ts b/src/api/types/SchemaUnknownFieldDescriptor.ts new file mode 100644 index 0000000..720e90d --- /dev/null +++ b/src/api/types/SchemaUnknownFieldDescriptor.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SchemaUnknownFieldDescriptor = DevRev.SchemaFieldDescriptorBase; diff --git a/src/api/types/SearchCoreResponse.ts b/src/api/types/SearchCoreResponse.ts new file mode 100644 index 0000000..7bf3c0e --- /dev/null +++ b/src/api/types/SearchCoreResponse.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Search response. + */ +export interface SearchCoreResponse { + /** + * The cursor from where to begin iteration. Start from beginning if + * not provided. + */ + cursor?: string; + /** The search results. */ + results: DevRev.SearchResult[]; +} diff --git a/src/api/types/SearchHybridNamespace.ts b/src/api/types/SearchHybridNamespace.ts new file mode 100644 index 0000000..dd97d52 --- /dev/null +++ b/src/api/types/SearchHybridNamespace.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The namespaces for hybrid search. + */ +export type SearchHybridNamespace = + | "article" + | "conversation" + | "dataset" + | "incident" + | "issue" + | "part" + | "question_answer" + | "ticket" + | "widget" + | "work"; + +export const SearchHybridNamespace = { + Article: "article", + Conversation: "conversation", + Dataset: "dataset", + Incident: "incident", + Issue: "issue", + Part: "part", + QuestionAnswer: "question_answer", + Ticket: "ticket", + Widget: "widget", + Work: "work", +} as const; diff --git a/src/api/types/SearchHybridResponse.ts b/src/api/types/SearchHybridResponse.ts new file mode 100644 index 0000000..6bf3db7 --- /dev/null +++ b/src/api/types/SearchHybridResponse.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Hybrid search response. + */ +export interface SearchHybridResponse { + /** The search results. */ + results: DevRev.SearchResult[]; +} diff --git a/src/api/types/SearchNamespace.ts b/src/api/types/SearchNamespace.ts new file mode 100644 index 0000000..e327a0b --- /dev/null +++ b/src/api/types/SearchNamespace.ts @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The namespaces to search in. + */ +export type SearchNamespace = + | "account" + | "article" + | "capability" + | "component" + | "conversation" + | "custom_object" + | "custom_part" + | "custom_work" + | "dashboard" + | "dev_user" + | "enhancement" + | "feature" + | "group" + | "issue" + | "linkable" + | "microservice" + | "object_member" + | "opportunity" + | "product" + | "project" + | "question_answer" + | "rev_org" + | "rev_user" + | "runnable" + | "service_account" + | "sys_user" + | "tag" + | "task" + | "ticket" + | "vista"; + +export const SearchNamespace = { + Account: "account", + Article: "article", + Capability: "capability", + Component: "component", + Conversation: "conversation", + CustomObject: "custom_object", + CustomPart: "custom_part", + CustomWork: "custom_work", + Dashboard: "dashboard", + DevUser: "dev_user", + Enhancement: "enhancement", + Feature: "feature", + Group: "group", + Issue: "issue", + Linkable: "linkable", + Microservice: "microservice", + ObjectMember: "object_member", + Opportunity: "opportunity", + Product: "product", + Project: "project", + QuestionAnswer: "question_answer", + RevOrg: "rev_org", + RevUser: "rev_user", + Runnable: "runnable", + ServiceAccount: "service_account", + SysUser: "sys_user", + Tag: "tag", + Task: "task", + Ticket: "ticket", + Vista: "vista", +} as const; diff --git a/src/api/types/SearchResult.ts b/src/api/types/SearchResult.ts new file mode 100644 index 0000000..9e210cf --- /dev/null +++ b/src/api/types/SearchResult.ts @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SearchResult = + | DevRev.SearchResult.Account + | DevRev.SearchResult.Article + | DevRev.SearchResult.Artifact + | DevRev.SearchResult.Conversation + | DevRev.SearchResult.CustomObject + | DevRev.SearchResult.Dashboard + | DevRev.SearchResult.Group + | DevRev.SearchResult.Link + | DevRev.SearchResult.ObjectMember + | DevRev.SearchResult.Org + | DevRev.SearchResult.Part + | DevRev.SearchResult.QuestionAnswer + | DevRev.SearchResult.Tag + | DevRev.SearchResult.User + | DevRev.SearchResult.Vista + | DevRev.SearchResult.Work; + +export declare namespace SearchResult { + interface Account extends DevRev.AccountSearchSummary { + type: "account"; + } + + interface Article extends DevRev.ArticleSearchSummary { + type: "article"; + } + + interface Artifact extends DevRev.ArtifactSearchSummary { + type: "artifact"; + } + + interface Conversation extends DevRev.ConversationSearchSummary { + type: "conversation"; + } + + interface CustomObject extends DevRev.CustomObjectSearchSummary { + type: "custom_object"; + } + + interface Dashboard extends DevRev.DashboardSearchSummary { + type: "dashboard"; + } + + interface Group extends DevRev.GroupSearchSummary { + type: "group"; + } + + interface Link extends DevRev.LinkSearchSummary { + type: "link"; + } + + interface ObjectMember extends DevRev.ObjectMemberSearchSummary { + type: "object_member"; + } + + interface Org extends DevRev.OrgSearchSummary { + type: "org"; + } + + interface Part extends DevRev.PartSearchSummary { + type: "part"; + } + + interface QuestionAnswer extends DevRev.QuestionAnswerSearchSummary { + type: "question_answer"; + } + + interface Tag extends DevRev.TagSearchSummary { + type: "tag"; + } + + interface User extends DevRev.UserSearchSummary { + type: "user"; + } + + interface Vista extends DevRev.VistaSearchSummary { + type: "vista"; + } + + interface Work extends DevRev.WorkSearchSummary { + type: "work"; + } +} diff --git a/src/api/types/SearchResultType.ts b/src/api/types/SearchResultType.ts new file mode 100644 index 0000000..015f5b5 --- /dev/null +++ b/src/api/types/SearchResultType.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SearchResultType = + | "account" + | "article" + | "artifact" + | "conversation" + | "custom_object" + | "dashboard" + | "group" + | "link" + | "object_member" + | "org" + | "part" + | "question_answer" + | "tag" + | "user" + | "vista" + | "work"; + +export const SearchResultType = { + Account: "account", + Article: "article", + Artifact: "artifact", + Conversation: "conversation", + CustomObject: "custom_object", + Dashboard: "dashboard", + Group: "group", + Link: "link", + ObjectMember: "object_member", + Org: "org", + Part: "part", + QuestionAnswer: "question_answer", + Tag: "tag", + User: "user", + Vista: "vista", + Work: "work", +} as const; diff --git a/src/api/types/SearchSortByParam.ts b/src/api/types/SearchSortByParam.ts new file mode 100644 index 0000000..ca3a8cd --- /dev/null +++ b/src/api/types/SearchSortByParam.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Search sort by parameters. + */ +export type SearchSortByParam = "created_date" | "modified_date" | "relevance"; + +export const SearchSortByParam = { + CreatedDate: "created_date", + ModifiedDate: "modified_date", + Relevance: "relevance", +} as const; diff --git a/src/api/types/SearchSortOrderParam.ts b/src/api/types/SearchSortOrderParam.ts new file mode 100644 index 0000000..852c4b2 --- /dev/null +++ b/src/api/types/SearchSortOrderParam.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Search sort order parameters. + */ +export type SearchSortOrderParam = "asc" | "desc"; + +export const SearchSortOrderParam = { + Asc: "asc", + Desc: "desc", +} as const; diff --git a/src/api/types/SearchSummaryBase.ts b/src/api/types/SearchSummaryBase.ts new file mode 100644 index 0000000..bc8484a --- /dev/null +++ b/src/api/types/SearchSummaryBase.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SearchSummaryBase { + /** Timestamp when the object was last modified. */ + modifiedDate?: Date; + /** Text snippet where the search hit occurred. */ + snippet?: string; +} diff --git a/src/api/types/ServiceAccount.ts b/src/api/types/ServiceAccount.ts new file mode 100644 index 0000000..4aac68d --- /dev/null +++ b/src/api/types/ServiceAccount.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type ServiceAccount = DevRev.UserBase; diff --git a/src/api/types/ServiceAccountSummary.ts b/src/api/types/ServiceAccountSummary.ts new file mode 100644 index 0000000..ea73432 --- /dev/null +++ b/src/api/types/ServiceAccountSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type ServiceAccountSummary = DevRev.UserBaseSummary; diff --git a/src/api/types/ServiceAccountsGetResponse.ts b/src/api/types/ServiceAccountsGetResponse.ts new file mode 100644 index 0000000..25e4f69 --- /dev/null +++ b/src/api/types/ServiceAccountsGetResponse.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response object that carries the service account's information + * corresponding to the request. + */ +export interface ServiceAccountsGetResponse { + serviceAccount: DevRev.ServiceAccount; +} diff --git a/src/api/types/SetIssueSelector.ts b/src/api/types/SetIssueSelector.ts new file mode 100644 index 0000000..e3e69f1 --- /dev/null +++ b/src/api/types/SetIssueSelector.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SetIssueSelector { + /** + * Custom fields on the issue with their fully qualified names and the + * associated with their exact allowed values. The SLA policy applies + * to issues where all named custom fields have exactly the specified + * values. + */ + customFields?: Record; + /** The SLA policy applies to the issues of these parts. */ + parts?: string[]; + /** The SLA policy applies to the issues of these revorgs. */ + revOrgs?: string[]; + /** The SLA policy applies to issues with these stages. */ + stageName?: string[]; + /** The issue subtype for which the SLA policy applies. */ + subtype?: string[]; + /** + * The SLA policy applies to issues with these tags. If empty, the tag + * filter isn't applied. + */ + tags?: string[]; +} diff --git a/src/api/types/SetOrgScheduleFragmentSummary.ts b/src/api/types/SetOrgScheduleFragmentSummary.ts new file mode 100644 index 0000000..b64bb3c --- /dev/null +++ b/src/api/types/SetOrgScheduleFragmentSummary.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SetOrgScheduleFragmentSummary { + /** Organization schedule fragment ID. */ + id: string; +} diff --git a/src/api/types/SetSharedWithMembership.ts b/src/api/types/SetSharedWithMembership.ts new file mode 100644 index 0000000..22bb642 --- /dev/null +++ b/src/api/types/SetSharedWithMembership.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Information about the role the member receives due to the share. + */ +export type SetSharedWithMembership = Record; diff --git a/src/api/types/SetSlaPolicy.ts b/src/api/types/SetSlaPolicy.ts new file mode 100644 index 0000000..d792f3a --- /dev/null +++ b/src/api/types/SetSlaPolicy.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SetSlaPolicy { + /** Metrics to apply to the selected items. */ + metrics?: DevRev.SetSupportMetricTarget[]; + /** Human-readable name. */ + name: string; + selector: DevRev.SetSlaSelector; +} diff --git a/src/api/types/SetSlaSelector.ts b/src/api/types/SetSlaSelector.ts new file mode 100644 index 0000000..feb32f0 --- /dev/null +++ b/src/api/types/SetSlaSelector.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SetSlaSelector { + appliesTo: DevRev.SlaSelectorAppliesTo; + /** + * Custom fields with their fully qualified names and associated with + * their exact allowed values. The SLA policy applies to records where + * all named custom fields have exactly the specified values. If the + * value is null, the field must have null value or not be present. + */ + customFields?: Record; + issueSelector?: DevRev.SetIssueSelector; + /** The SLA policy applies to the tickets of these parts. */ + parts?: string[]; + /** The SLA policy applies to conversations with these priorities. */ + priority?: DevRev.SlaSelectorPriority[]; + /** The SLA policy applies to tickets with these severities. */ + severity?: DevRev.SlaSelectorSeverity[]; + /** The SLA policy applies to conversations with these sources. */ + sourceChannel?: string[]; + /** The SLA policy applies to tickets with these subtypes. */ + subtype?: string[]; + /** The SLA policy applies to items with these tags. */ + tags?: string[]; +} diff --git a/src/api/types/SetSupportMetricTarget.ts b/src/api/types/SetSupportMetricTarget.ts new file mode 100644 index 0000000..557b1dc --- /dev/null +++ b/src/api/types/SetSupportMetricTarget.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SetSupportMetricTarget { + /** The metric to apply. */ + metric: string; + /** + * The organization schedule controlling this metrics calculation. + * Time based metrics don't consume time while their schedule is off. + */ + orgScheduleId?: string; + /** + * The percentage of instances for which this metric's target must not + * be breached, in order to avoid breaching the overall SLA policy. + */ + performance?: number; + /** + * The target value to be achieved, for example the time in which to + * do something, or the maximum allowed number of message pairs. The + * units and interpretation of the value is controlled by the + * properties of the referenced metric. + */ + target: number; + /** + * The threshold in the same units as target where the metric is + * considered to be 'at risk'. + */ + warningTarget?: number; +} diff --git a/src/api/types/SetTagWithValue.ts b/src/api/types/SetTagWithValue.ts new file mode 100644 index 0000000..b8d047a --- /dev/null +++ b/src/api/types/SetTagWithValue.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SetTagWithValue { + /** The ID of the tag. */ + id: string; + /** + * The value for the object's association with the tag. If specified, + * the value must be one that's specified in the tag's allowed values. + */ + value?: string; +} diff --git a/src/api/types/SetWeeklyOrgSchedule.ts b/src/api/types/SetWeeklyOrgSchedule.ts new file mode 100644 index 0000000..692f588 --- /dev/null +++ b/src/api/types/SetWeeklyOrgSchedule.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SetWeeklyOrgSchedule { + /** The 'on' intervals of the week. */ + intervals: DevRev.CreateWeeklyOrgScheduleInterval[]; + /** + * The name of the period during which the organization schedule + * applies. + */ + periodName: string; +} diff --git a/src/api/types/SharedWithMembershipFilter.ts b/src/api/types/SharedWithMembershipFilter.ts new file mode 100644 index 0000000..71ae71b --- /dev/null +++ b/src/api/types/SharedWithMembershipFilter.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Filter on target item based on intended audience. + */ +export type SharedWithMembershipFilter = Record; diff --git a/src/api/types/Sla.ts b/src/api/types/Sla.ts new file mode 100644 index 0000000..9cdd8bb --- /dev/null +++ b/src/api/types/Sla.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Sla extends DevRev.AtomBase { + compensation?: DevRev.SlaCompensation; + /** Description of the purpose and capabilities of the SLA. */ + description?: string; + evaluationPeriod?: DevRev.SlaEvaluationPeriod; + /** Human-readable name. */ + name: string; + /** + * The policies encompassed by this SLA, ordered in decreasing + * priority. + */ + policies?: DevRev.SlaPolicy[]; + slaType?: DevRev.SlaType; + status: DevRev.SlaStatus; +} diff --git a/src/api/types/SlaAppliesTo.ts b/src/api/types/SlaAppliesTo.ts new file mode 100644 index 0000000..6388843 --- /dev/null +++ b/src/api/types/SlaAppliesTo.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The object types on which the SLA applies. An external SLA can apply to + * multiple object types, but an internal SLA can apply to only one object + * type. + */ +export type SlaAppliesTo = "conversation" | "issue" | "ticket"; + +export const SlaAppliesTo = { + Conversation: "conversation", + Issue: "issue", + Ticket: "ticket", +} as const; diff --git a/src/api/types/SlaAssignResult.ts b/src/api/types/SlaAssignResult.ts new file mode 100644 index 0000000..f147092 --- /dev/null +++ b/src/api/types/SlaAssignResult.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlaAssignResult { + error?: DevRev.Error_; + revOrg: DevRev.RevOrgSummary; +} diff --git a/src/api/types/SlaCompensation.ts b/src/api/types/SlaCompensation.ts new file mode 100644 index 0000000..6fe8dfc --- /dev/null +++ b/src/api/types/SlaCompensation.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Describes the compensation to be provided in case of SLA breach. It is + * not 'self-executing', it is the responsibility of the organization + * providing the SLA to actually transfer the promised credit, resource or + * other payment. + */ +export type SlaCompensation = Record; diff --git a/src/api/types/SlaEvaluationPeriod.ts b/src/api/types/SlaEvaluationPeriod.ts new file mode 100644 index 0000000..28edaf7 --- /dev/null +++ b/src/api/types/SlaEvaluationPeriod.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Specifies the frequency of when the contractually-meaningful evaluation + * of the SLA happens. The organization for their own information might + * evaluate the various metrics contained in the policy as often as we can + * make it feasible for them, but only the evaluation at the end of the + * evaluation period triggers a compensation and needs to be shared with + * the customer. + */ +export type SlaEvaluationPeriod = "monthly" | "quarterly" | "weekly" | "yearly"; + +export const SlaEvaluationPeriod = { + Monthly: "monthly", + Quarterly: "quarterly", + Weekly: "weekly", + Yearly: "yearly", +} as const; diff --git a/src/api/types/SlaPolicy.ts b/src/api/types/SlaPolicy.ts new file mode 100644 index 0000000..30c2156 --- /dev/null +++ b/src/api/types/SlaPolicy.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * A policy that represents a promise to your revs. + */ +export type SlaPolicy = Record; diff --git a/src/api/types/SlaSelectorAppliesTo.ts b/src/api/types/SlaSelectorAppliesTo.ts new file mode 100644 index 0000000..1e5c98a --- /dev/null +++ b/src/api/types/SlaSelectorAppliesTo.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The item type for which the SLA policy applies. + */ +export type SlaSelectorAppliesTo = "conversation" | "issue" | "ticket"; + +export const SlaSelectorAppliesTo = { + Conversation: "conversation", + Issue: "issue", + Ticket: "ticket", +} as const; diff --git a/src/api/types/SlaSelectorPriority.ts b/src/api/types/SlaSelectorPriority.ts new file mode 100644 index 0000000..d472211 --- /dev/null +++ b/src/api/types/SlaSelectorPriority.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The SLA policy applies to conversations with these priorities. + */ +export type SlaSelectorPriority = "p0" | "p1" | "p2"; + +export const SlaSelectorPriority = { + P0: "p0", + P1: "p1", + P2: "p2", +} as const; diff --git a/src/api/types/SlaSelectorSeverity.ts b/src/api/types/SlaSelectorSeverity.ts new file mode 100644 index 0000000..0dad767 --- /dev/null +++ b/src/api/types/SlaSelectorSeverity.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The SLA policy applies to tickets with these severities. + */ +export type SlaSelectorSeverity = "blocker" | "high" | "low" | "medium"; + +export const SlaSelectorSeverity = { + Blocker: "blocker", + High: "high", + Low: "low", + Medium: "medium", +} as const; diff --git a/src/api/types/SlaStatus.ts b/src/api/types/SlaStatus.ts new file mode 100644 index 0000000..6a77734 --- /dev/null +++ b/src/api/types/SlaStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Status determines how an item can be used. In 'draft' status an item + * can be edited but can't be used. When 'published' the item can longer + * be edited but can be used. 'Archived' is read-only. + */ +export type SlaStatus = "archived" | "draft" | "published"; + +export const SlaStatus = { + Archived: "archived", + Draft: "draft", + Published: "published", +} as const; diff --git a/src/api/types/SlaSummary.ts b/src/api/types/SlaSummary.ts new file mode 100644 index 0000000..33f02ab --- /dev/null +++ b/src/api/types/SlaSummary.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlaSummary extends DevRev.AtomBaseSummary { + /** Human-readable name. */ + name: string; + slaType?: DevRev.SlaType; + status: DevRev.SlaStatus; +} diff --git a/src/api/types/SlaSummaryFilter.ts b/src/api/types/SlaSummaryFilter.ts new file mode 100644 index 0000000..ca5a05b --- /dev/null +++ b/src/api/types/SlaSummaryFilter.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The filter for SLA summary. + */ +export interface SlaSummaryFilter { + /** Filters for records with any of the provided SLA stages. */ + stage?: DevRev.SlaSummaryStage[]; + targetTime?: DevRev.DateFilter; +} diff --git a/src/api/types/SlaSummaryStage.ts b/src/api/types/SlaSummaryStage.ts new file mode 100644 index 0000000..9891c50 --- /dev/null +++ b/src/api/types/SlaSummaryStage.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The stage of the SLA. This is the metric stage which is closest to + * breach. + */ +export type SlaSummaryStage = "breached" | "completed" | "paused" | "running" | "warning"; + +export const SlaSummaryStage = { + Breached: "breached", + Completed: "completed", + Paused: "paused", + Running: "running", + Warning: "warning", +} as const; diff --git a/src/api/types/SlaTracker.ts b/src/api/types/SlaTracker.ts new file mode 100644 index 0000000..fad8f55 --- /dev/null +++ b/src/api/types/SlaTracker.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlaTracker extends DevRev.AtomBase { + /** Details of the object on which the SLA is being tracked. */ + appliesToId?: string; + /** Summary of the metrics target being tracked in the SLA tracker. */ + metricTargetSummaries: DevRev.ArchetypeMetricTarget[]; + sla?: DevRev.SlaSummary; + /** + * Details of the applicable SLA policy. Can be omitted if no sla + * applies, or if no policy of the sla applies at the moment. + */ + slaPolicyId?: string; + /** SLA stage of the object being tracked. */ + stage?: string; + /** + * It is an indicator of whether the SLA has ever been breached + * (missed). If not, it shows whether the SLA is completed, in + * progress, or nil - if no policy is applied. + */ + status?: string; +} diff --git a/src/api/types/SlaTrackerSummary.ts b/src/api/types/SlaTrackerSummary.ts new file mode 100644 index 0000000..93b2eea --- /dev/null +++ b/src/api/types/SlaTrackerSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SlaTrackerSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/SlaType.ts b/src/api/types/SlaType.ts new file mode 100644 index 0000000..bedda29 --- /dev/null +++ b/src/api/types/SlaType.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of the SLA. + */ +export type SlaType = "external" | "internal"; + +export const SlaType = { + External: "external", + Internal: "internal", +} as const; diff --git a/src/api/types/SlasAssignResponse.ts b/src/api/types/SlasAssignResponse.ts new file mode 100644 index 0000000..d2e8332 --- /dev/null +++ b/src/api/types/SlasAssignResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlasAssignResponse { + /** The list of outcomes for each Rev organization. */ + results: DevRev.SlaAssignResult[]; +} diff --git a/src/api/types/SlasCreateResponse.ts b/src/api/types/SlasCreateResponse.ts new file mode 100644 index 0000000..7b5cf80 --- /dev/null +++ b/src/api/types/SlasCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlasCreateResponse { + sla: DevRev.Sla; +} diff --git a/src/api/types/SlasFilterAppliesToOperatorType.ts b/src/api/types/SlasFilterAppliesToOperatorType.ts new file mode 100644 index 0000000..a87f952 --- /dev/null +++ b/src/api/types/SlasFilterAppliesToOperatorType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SlasFilterAppliesToOperatorType = "all" | "any"; + +export const SlasFilterAppliesToOperatorType = { + All: "all", + Any: "any", +} as const; diff --git a/src/api/types/SlasGetResponse.ts b/src/api/types/SlasGetResponse.ts new file mode 100644 index 0000000..e0389c2 --- /dev/null +++ b/src/api/types/SlasGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlasGetResponse { + sla: DevRev.Sla; +} diff --git a/src/api/types/SlasListResponse.ts b/src/api/types/SlasListResponse.ts new file mode 100644 index 0000000..8537c0e --- /dev/null +++ b/src/api/types/SlasListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlasListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The list of SLAs. */ + slas: DevRev.Sla[]; +} diff --git a/src/api/types/SlasTransitionResponse.ts b/src/api/types/SlasTransitionResponse.ts new file mode 100644 index 0000000..dfc6e95 --- /dev/null +++ b/src/api/types/SlasTransitionResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlasTransitionResponse { + sla: DevRev.Sla; +} diff --git a/src/api/types/SlasUpdateResponse.ts b/src/api/types/SlasUpdateResponse.ts new file mode 100644 index 0000000..d4417b4 --- /dev/null +++ b/src/api/types/SlasUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SlasUpdateResponse { + sla: DevRev.Sla; +} diff --git a/src/api/types/SnapInVersionSummary.ts b/src/api/types/SnapInVersionSummary.ts new file mode 100644 index 0000000..edcf801 --- /dev/null +++ b/src/api/types/SnapInVersionSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SnapInVersionSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/SnapInsResourcesResponse.ts b/src/api/types/SnapInsResourcesResponse.ts new file mode 100644 index 0000000..f801ee3 --- /dev/null +++ b/src/api/types/SnapInsResourcesResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SnapInsResourcesResponse { + /** The event sources for the snap-in. */ + eventSources?: Record; + /** The inputs for the snap-in. */ + inputs?: Record; + /** Map of keyring names and its data. */ + keyrings?: Record; + snapInVersion: DevRev.SnapInVersionSummary; +} diff --git a/src/api/types/SnapInsResourcesResponseKeyringData.ts b/src/api/types/SnapInsResourcesResponseKeyringData.ts new file mode 100644 index 0000000..e204c69 --- /dev/null +++ b/src/api/types/SnapInsResourcesResponseKeyringData.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SnapInsResourcesResponseKeyringData { + /** The ID of the keyring. */ + id: string; + /** The secret value of the keyring. This must be handled with caution. */ + secret: string; +} diff --git a/src/api/types/SnapWidget.ts b/src/api/types/SnapWidget.ts new file mode 100644 index 0000000..63dcd4e --- /dev/null +++ b/src/api/types/SnapWidget.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SnapWidget = DevRev.SnapWidget.EmailPreview; + +export declare namespace SnapWidget { + interface EmailPreview extends DevRev.EmailPreviewWidget { + type: "email_preview"; + } +} diff --git a/src/api/types/SnapWidgetBase.ts b/src/api/types/SnapWidgetBase.ts new file mode 100644 index 0000000..991e7da --- /dev/null +++ b/src/api/types/SnapWidgetBase.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SnapWidgetBase extends DevRev.AtomBase { + /** A human readable name for the snap widget. */ + name: string; + namespace?: DevRev.SnapWidgetNamespace; + status: DevRev.SnapWidgetStatus; +} diff --git a/src/api/types/SnapWidgetNamespace.ts b/src/api/types/SnapWidgetNamespace.ts new file mode 100644 index 0000000..37aa3d1 --- /dev/null +++ b/src/api/types/SnapWidgetNamespace.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Logical grouping of snap widgets. Useful for filtering. + */ +export type SnapWidgetNamespace = "comment_suggestion_replies" | "email_preview" | "link_preview" | "plug_nudge"; + +export const SnapWidgetNamespace = { + CommentSuggestionReplies: "comment_suggestion_replies", + EmailPreview: "email_preview", + LinkPreview: "link_preview", + PlugNudge: "plug_nudge", +} as const; diff --git a/src/api/types/SnapWidgetStatus.ts b/src/api/types/SnapWidgetStatus.ts new file mode 100644 index 0000000..0d0764d --- /dev/null +++ b/src/api/types/SnapWidgetStatus.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The status of the snap widget. + */ +export type SnapWidgetStatus = "draft" | "published"; + +export const SnapWidgetStatus = { + Draft: "draft", + Published: "published", +} as const; diff --git a/src/api/types/SnapWidgetType.ts b/src/api/types/SnapWidgetType.ts new file mode 100644 index 0000000..d6f0c1c --- /dev/null +++ b/src/api/types/SnapWidgetType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SnapWidgetType = "email_preview"; diff --git a/src/api/types/SnapWidgetsCreateRequest.ts b/src/api/types/SnapWidgetsCreateRequest.ts new file mode 100644 index 0000000..901caf7 --- /dev/null +++ b/src/api/types/SnapWidgetsCreateRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SnapWidgetsCreateRequest = DevRev.SnapWidgetsCreateRequest.EmailPreview; + +export declare namespace SnapWidgetsCreateRequest { + interface EmailPreview extends DevRev.CreateEmailPreviewWidget, _Base { + type: "email_preview"; + } + + interface _Base { + /** A human readable name for the snap widget. */ + name: string; + namespace?: DevRev.SnapWidgetNamespace; + status?: DevRev.SnapWidgetStatus; + } +} diff --git a/src/api/types/SnapWidgetsCreateRequestType.ts b/src/api/types/SnapWidgetsCreateRequestType.ts new file mode 100644 index 0000000..4a25031 --- /dev/null +++ b/src/api/types/SnapWidgetsCreateRequestType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SnapWidgetsCreateRequestType = "email_preview"; diff --git a/src/api/types/SnapWidgetsCreateResponse.ts b/src/api/types/SnapWidgetsCreateResponse.ts new file mode 100644 index 0000000..55ed9a6 --- /dev/null +++ b/src/api/types/SnapWidgetsCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SnapWidgetsCreateResponse { + snapWidget: DevRev.SnapWidget; +} diff --git a/src/api/types/StageDiagramSummary.ts b/src/api/types/StageDiagramSummary.ts new file mode 100644 index 0000000..01d9790 --- /dev/null +++ b/src/api/types/StageDiagramSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type StageDiagramSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/StageFilter.ts b/src/api/types/StageFilter.ts new file mode 100644 index 0000000..565f2f8 --- /dev/null +++ b/src/api/types/StageFilter.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The filter for stages. + */ +export interface StageFilter { + /** Filters for records in the provided stage(s) by name. */ + name?: string[]; +} diff --git a/src/api/types/StageInit.ts b/src/api/types/StageInit.ts new file mode 100644 index 0000000..588a5b9 --- /dev/null +++ b/src/api/types/StageInit.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Sets an object's initial stage. + */ +export interface StageInit { + /** + * The ID of the custom stage. If this is set, the name field is + * ignored. + */ + id?: string; + /** The name of the stage. */ + name?: string; +} diff --git a/src/api/types/StageUpdate.ts b/src/api/types/StageUpdate.ts new file mode 100644 index 0000000..af4d443 --- /dev/null +++ b/src/api/types/StageUpdate.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Updates an object's stage. + */ +export interface StageUpdate { + /** The updated name of the stage, otherwise unchanged if not set. */ + name?: string; + /** + * The ID of the updated custom stage, otherwise unchanged if not set. + * If this is set, the name field is ignored. + */ + stage?: string; +} diff --git a/src/api/types/StageValidationOptionForCreate.ts b/src/api/types/StageValidationOptionForCreate.ts new file mode 100644 index 0000000..214d1f1 --- /dev/null +++ b/src/api/types/StageValidationOptionForCreate.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of stage validation options when creating an object. + */ +export type StageValidationOptionForCreate = "allow_non_start"; diff --git a/src/api/types/StageValidationOptionForUpdate.ts b/src/api/types/StageValidationOptionForUpdate.ts new file mode 100644 index 0000000..fd5cbc0 --- /dev/null +++ b/src/api/types/StageValidationOptionForUpdate.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of state validation options when updating the stage of an object. + */ +export type StageValidationOptionForUpdate = "allow_invalid_transition"; diff --git a/src/api/types/StagedInfoFilter.ts b/src/api/types/StagedInfoFilter.ts new file mode 100644 index 0000000..ad52077 --- /dev/null +++ b/src/api/types/StagedInfoFilter.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface StagedInfoFilter { + /** Filters for issues that are staged. */ + isStaged?: boolean; +} diff --git a/src/api/types/StockFieldOverride.ts b/src/api/types/StockFieldOverride.ts new file mode 100644 index 0000000..87b90e9 --- /dev/null +++ b/src/api/types/StockFieldOverride.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * A stock field override. + */ +export type StockFieldOverride = Record; diff --git a/src/api/types/StockSchemaFragment.ts b/src/api/types/StockSchemaFragment.ts new file mode 100644 index 0000000..298c61c --- /dev/null +++ b/src/api/types/StockSchemaFragment.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface StockSchemaFragment extends DevRev.AtomBase { + /** Description of the schema. */ + description?: string; + /** List of all fields in this schema. */ + fields: DevRev.SchemaFieldDescriptor[]; + /** Leaf type this fragment applies to. */ + leafType?: string; + newFragmentRef?: DevRev.AtomSummary; + oldFragmentRef?: DevRev.AtomSummary; + /** Title of the schema. */ + title?: string; +} diff --git a/src/api/types/StockSchemaFragmentsGetResponse.ts b/src/api/types/StockSchemaFragmentsGetResponse.ts new file mode 100644 index 0000000..129d4d8 --- /dev/null +++ b/src/api/types/StockSchemaFragmentsGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface StockSchemaFragmentsGetResponse { + fragment: DevRev.StockSchemaFragment; +} diff --git a/src/api/types/StockSchemaFragmentsListRequestFilterPreset.ts b/src/api/types/StockSchemaFragmentsListRequestFilterPreset.ts new file mode 100644 index 0000000..e1f29a7 --- /dev/null +++ b/src/api/types/StockSchemaFragmentsListRequestFilterPreset.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type StockSchemaFragmentsListRequestFilterPreset = "customizable_types_preset" | "no_preset"; + +export const StockSchemaFragmentsListRequestFilterPreset = { + CustomizableTypesPreset: "customizable_types_preset", + NoPreset: "no_preset", +} as const; diff --git a/src/api/types/StockSchemaFragmentsListRequestPrune.ts b/src/api/types/StockSchemaFragmentsListRequestPrune.ts new file mode 100644 index 0000000..4222930 --- /dev/null +++ b/src/api/types/StockSchemaFragmentsListRequestPrune.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type StockSchemaFragmentsListRequestPrune = "composite_schemas" | "fields"; + +export const StockSchemaFragmentsListRequestPrune = { + CompositeSchemas: "composite_schemas", + Fields: "fields", +} as const; diff --git a/src/api/types/StockSchemaFragmentsListResponse.ts b/src/api/types/StockSchemaFragmentsListResponse.ts new file mode 100644 index 0000000..17e3454 --- /dev/null +++ b/src/api/types/StockSchemaFragmentsListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface StockSchemaFragmentsListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The stock schema fragments. */ + result: DevRev.StockSchemaFragment[]; +} diff --git a/src/api/types/Subtype.ts b/src/api/types/Subtype.ts new file mode 100644 index 0000000..e2c9f02 --- /dev/null +++ b/src/api/types/Subtype.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface Subtype { + /** Display name of the subtype. */ + displayName?: string; + /** DON of the custom type fragment this subtype belongs to. */ + fragmentId: string; + /** Leaf type for the subtype. */ + leafType: string; + /** Value of the subtype. */ + value: string; +} diff --git a/src/api/types/SubtypesListResponse.ts b/src/api/types/SubtypesListResponse.ts new file mode 100644 index 0000000..48cbeed --- /dev/null +++ b/src/api/types/SubtypesListResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SubtypesListResponse { + /** List of subtypes. */ + subtypes: DevRev.Subtype[]; +} diff --git a/src/api/types/Survey.ts b/src/api/types/Survey.ts new file mode 100644 index 0000000..ff5941f --- /dev/null +++ b/src/api/types/Survey.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Survey extends DevRev.AtomBase { + /** Description of the survey. */ + description?: string; + /** Text posted when introducing the survey to the responder. */ + introductoryText?: string; + /** + * Survey name associated with schema. This name would be unique per + * dev org. + */ + name?: string; + /** Text posted after the response is collected. */ + responseText?: string; + /** List of all fields in the schema. */ + schema?: DevRev.SchemaFieldDescriptor[]; + /** List of all the fields and their respective metadata in the schema. */ + schemaWithMetadata?: DevRev.SurveyFieldWithMetadata[]; +} diff --git a/src/api/types/SurveyAggregationFilter.ts b/src/api/types/SurveyAggregationFilter.ts new file mode 100644 index 0000000..d64d66a --- /dev/null +++ b/src/api/types/SurveyAggregationFilter.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The filter for survey aggregation. + */ +export type SurveyAggregationFilter = Record; diff --git a/src/api/types/SurveyFieldWithMetadata.ts b/src/api/types/SurveyFieldWithMetadata.ts new file mode 100644 index 0000000..a327216 --- /dev/null +++ b/src/api/types/SurveyFieldWithMetadata.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Field descriptors with additional metadata for surveys. + */ +export interface SurveyFieldWithMetadata { + field?: DevRev.SchemaFieldDescriptor; + /** Additional metadata for the input field. */ + metadata?: Record; + /** The question linked to the input field. */ + question?: string; +} diff --git a/src/api/types/SurveyResponse.ts b/src/api/types/SurveyResponse.ts new file mode 100644 index 0000000..065c9b1 --- /dev/null +++ b/src/api/types/SurveyResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SurveyResponse extends DevRev.AtomBase { + /** The unique ID associated with the dispatched survey. */ + dispatchId?: string; + /** Source channels on which the survey is sent. */ + dispatchedChannels?: DevRev.EnumValue[]; + /** The ID of the object for which survey is taken. */ + object?: string; + recipient?: DevRev.UserSummary; + /** Response for the survey. */ + response?: Record; + responseChannel?: DevRev.EnumValue; + stage?: DevRev.EnumValue; + /** The ID of the survey for which response is taken. */ + survey?: string; +} diff --git a/src/api/types/SurveysCreateResponse.ts b/src/api/types/SurveysCreateResponse.ts new file mode 100644 index 0000000..fc5049c --- /dev/null +++ b/src/api/types/SurveysCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SurveysCreateResponse { + survey: DevRev.Survey; +} diff --git a/src/api/types/SurveysDeleteResponse.ts b/src/api/types/SurveysDeleteResponse.ts new file mode 100644 index 0000000..712bb50 --- /dev/null +++ b/src/api/types/SurveysDeleteResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SurveysDeleteResponse = Record; diff --git a/src/api/types/SurveysListResponse.ts b/src/api/types/SurveysListResponse.ts new file mode 100644 index 0000000..8e8160b --- /dev/null +++ b/src/api/types/SurveysListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SurveysListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The list of the surveys. */ + surveys: DevRev.Survey[]; +} diff --git a/src/api/types/SurveysResponsesListResponse.ts b/src/api/types/SurveysResponsesListResponse.ts new file mode 100644 index 0000000..9f4816c --- /dev/null +++ b/src/api/types/SurveysResponsesListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SurveysResponsesListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The list of the survey responses. */ + surveyResponses: DevRev.SurveyResponse[]; +} diff --git a/src/api/types/SurveysSendRequestEmail.ts b/src/api/types/SurveysSendRequestEmail.ts new file mode 100644 index 0000000..ffa3299 --- /dev/null +++ b/src/api/types/SurveysSendRequestEmail.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SurveysSendRequestEmail { + /** Message body for a survey email. */ + body: string; + /** Recipients list for a survey email. */ + recipients: string[]; + /** Sender email address from which an email is sent. */ + sender: string; + /** Subject for an email where survey is sent. */ + subject: string; +} diff --git a/src/api/types/SurveysSendResponse.ts b/src/api/types/SurveysSendResponse.ts new file mode 100644 index 0000000..4fb1577 --- /dev/null +++ b/src/api/types/SurveysSendResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SurveysSendResponse = Record; diff --git a/src/api/types/SurveysSubmitResponse.ts b/src/api/types/SurveysSubmitResponse.ts new file mode 100644 index 0000000..ae7ff88 --- /dev/null +++ b/src/api/types/SurveysSubmitResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SurveysSubmitResponse = Record; diff --git a/src/api/types/SyncMetadataFilter.ts b/src/api/types/SyncMetadataFilter.ts new file mode 100644 index 0000000..1bf66b1 --- /dev/null +++ b/src/api/types/SyncMetadataFilter.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SyncMetadataFilter { + lastSyncIn?: DevRev.SyncMetadataFilterSyncInFilter; + lastSyncOut?: DevRev.SyncMetadataFilterSyncOutFilter; + /** Filters for issues synced from this specific origin system. */ + originSystem?: string[]; +} diff --git a/src/api/types/SyncMetadataFilterSyncInFilter.ts b/src/api/types/SyncMetadataFilterSyncInFilter.ts new file mode 100644 index 0000000..175413f --- /dev/null +++ b/src/api/types/SyncMetadataFilterSyncInFilter.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SyncMetadataFilterSyncInFilter { + /** Filters for works with selected sync statuses. */ + status?: DevRev.SyncMetadataFilterSyncInFilterStatus[]; + syncDate?: DevRev.DateFilter; + /** Filters for works modified with selected sync units. */ + syncUnit?: string[]; +} diff --git a/src/api/types/SyncMetadataFilterSyncInFilterStatus.ts b/src/api/types/SyncMetadataFilterSyncInFilterStatus.ts new file mode 100644 index 0000000..e8f2c58 --- /dev/null +++ b/src/api/types/SyncMetadataFilterSyncInFilterStatus.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SyncMetadataFilterSyncInFilterStatus = "failed" | "modified" | "staged" | "succeeded"; + +export const SyncMetadataFilterSyncInFilterStatus = { + Failed: "failed", + Modified: "modified", + Staged: "staged", + Succeeded: "succeeded", +} as const; diff --git a/src/api/types/SyncMetadataFilterSyncOutFilter.ts b/src/api/types/SyncMetadataFilterSyncOutFilter.ts new file mode 100644 index 0000000..ed6aa30 --- /dev/null +++ b/src/api/types/SyncMetadataFilterSyncOutFilter.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface SyncMetadataFilterSyncOutFilter { + /** Filters for works with selected sync statuses. */ + status?: DevRev.SyncMetadataFilterSyncOutFilterStatus[]; + syncDate?: DevRev.DateFilter; + /** Filters for works modified with selected sync units. */ + syncUnit?: string[]; +} diff --git a/src/api/types/SyncMetadataFilterSyncOutFilterStatus.ts b/src/api/types/SyncMetadataFilterSyncOutFilterStatus.ts new file mode 100644 index 0000000..b71e222 --- /dev/null +++ b/src/api/types/SyncMetadataFilterSyncOutFilterStatus.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SyncMetadataFilterSyncOutFilterStatus = "failed" | "succeeded"; + +export const SyncMetadataFilterSyncOutFilterStatus = { + Failed: "failed", + Succeeded: "succeeded", +} as const; diff --git a/src/api/types/SysUser.ts b/src/api/types/SysUser.ts new file mode 100644 index 0000000..b6748e8 --- /dev/null +++ b/src/api/types/SysUser.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SysUser = DevRev.UserBase; diff --git a/src/api/types/SysUserSummary.ts b/src/api/types/SysUserSummary.ts new file mode 100644 index 0000000..3806411 --- /dev/null +++ b/src/api/types/SysUserSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type SysUserSummary = DevRev.UserBaseSummary; diff --git a/src/api/types/SysUsersListResponse.ts b/src/api/types/SysUsersListResponse.ts new file mode 100644 index 0000000..0c565d1 --- /dev/null +++ b/src/api/types/SysUsersListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to listing the system users. + */ +export interface SysUsersListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The list of system users. */ + sysUsers: DevRev.SysUser[]; +} diff --git a/src/api/types/SysUsersUpdateResponse.ts b/src/api/types/SysUsersUpdateResponse.ts new file mode 100644 index 0000000..b9468ac --- /dev/null +++ b/src/api/types/SysUsersUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Updated Sys user object. + */ +export interface SysUsersUpdateResponse { + sysUser: DevRev.SysUser; +} diff --git a/src/api/types/Tag.ts b/src/api/types/Tag.ts new file mode 100644 index 0000000..d762fcb --- /dev/null +++ b/src/api/types/Tag.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Tag extends DevRev.AtomBase { + /** + * The allowed values for the tag, where a value is provided when a + * tag is associated with an object. If empty, then no value should be + * provided when the association is made. + */ + allowedValues?: string[]; + /** + * An informative description for the tag that should provide context + * on the tag's purpose and usage. + */ + description?: string; + /** + * The name of the tag, which denotes the logical concept by which all + * tagged objects will be associated. The name is guaranteed to be + * unique. + */ + name: string; +} diff --git a/src/api/types/TagSearchSummary.ts b/src/api/types/TagSearchSummary.ts new file mode 100644 index 0000000..6283dd0 --- /dev/null +++ b/src/api/types/TagSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TagSearchSummary extends DevRev.SearchSummaryBase { + tag: DevRev.TagSummary; +} diff --git a/src/api/types/TagSummary.ts b/src/api/types/TagSummary.ts new file mode 100644 index 0000000..a041c83 --- /dev/null +++ b/src/api/types/TagSummary.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TagSummary extends DevRev.AtomBaseSummary { + /** + * The name of the tag, which denotes the logical concept by which all + * tagged objects will be associated. The name is guaranteed to be + * unique. + */ + name: string; +} diff --git a/src/api/types/TagWithValue.ts b/src/api/types/TagWithValue.ts new file mode 100644 index 0000000..c0c0c9d --- /dev/null +++ b/src/api/types/TagWithValue.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TagWithValue { + tag: DevRev.TagSummary; + /** The value for the object's association with the tag. */ + value?: string; +} diff --git a/src/api/types/TagWithValueFilter.ts b/src/api/types/TagWithValueFilter.ts new file mode 100644 index 0000000..d4b47a1 --- /dev/null +++ b/src/api/types/TagWithValueFilter.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface TagWithValueFilter { + /** The ID of the tag. */ + id?: string; + /** + * The value for the object's association with the tag. If specified, + * the value must be one that's specified in the tag's allowed values. + */ + value?: string; +} diff --git a/src/api/types/Task.ts b/src/api/types/Task.ts new file mode 100644 index 0000000..2c05a85 --- /dev/null +++ b/src/api/types/Task.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Task = DevRev.WorkBase; diff --git a/src/api/types/TaskPriority.ts b/src/api/types/TaskPriority.ts new file mode 100644 index 0000000..9c73455 --- /dev/null +++ b/src/api/types/TaskPriority.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Priority of the work based upon impact and criticality. + */ +export type TaskPriority = "p0" | "p1" | "p2" | "p3"; + +export const TaskPriority = { + P0: "p0", + P1: "p1", + P2: "p2", + P3: "p3", +} as const; diff --git a/src/api/types/TaskSummary.ts b/src/api/types/TaskSummary.ts new file mode 100644 index 0000000..6ebb521 --- /dev/null +++ b/src/api/types/TaskSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type TaskSummary = DevRev.WorkBaseSummary; diff --git a/src/api/types/TenantFragment.ts b/src/api/types/TenantFragment.ts new file mode 100644 index 0000000..3b1b8f9 --- /dev/null +++ b/src/api/types/TenantFragment.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type TenantFragment = DevRev.CustomSchemaFragmentBase; diff --git a/src/api/types/TenantFragmentSummary.ts b/src/api/types/TenantFragmentSummary.ts new file mode 100644 index 0000000..e402d07 --- /dev/null +++ b/src/api/types/TenantFragmentSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type TenantFragmentSummary = DevRev.CustomSchemaFragmentBaseSummary; diff --git a/src/api/types/Ticket.ts b/src/api/types/Ticket.ts new file mode 100644 index 0000000..b81eb1c --- /dev/null +++ b/src/api/types/Ticket.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Ticket extends DevRev.WorkBase { + /** Channels of the ticket. */ + channels?: DevRev.TicketChannels[]; + group?: DevRev.GroupSummary; + /** Whether the ticket needs a response. */ + needsResponse?: boolean; + revOrg?: DevRev.OrgSummary; + sentiment?: DevRev.EnumValue; + severity?: DevRev.TicketSeverity; + slaTracker?: DevRev.SlaTrackerSummary; + /** Source channel of the ticket. */ + sourceChannel?: string; +} diff --git a/src/api/types/TicketChannels.ts b/src/api/types/TicketChannels.ts new file mode 100644 index 0000000..17e63a0 --- /dev/null +++ b/src/api/types/TicketChannels.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Channels of the ticket. + */ +export type TicketChannels = "email" | "plug" | "slack" | "twilio"; + +export const TicketChannels = { + Email: "email", + Plug: "plug", + Slack: "slack", + Twilio: "twilio", +} as const; diff --git a/src/api/types/TicketSeverity.ts b/src/api/types/TicketSeverity.ts new file mode 100644 index 0000000..6dcd135 --- /dev/null +++ b/src/api/types/TicketSeverity.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Severity of the ticket. + */ +export type TicketSeverity = "blocker" | "high" | "low" | "medium"; + +export const TicketSeverity = { + Blocker: "blocker", + High: "high", + Low: "low", + Medium: "medium", +} as const; diff --git a/src/api/types/TicketSummary.ts b/src/api/types/TicketSummary.ts new file mode 100644 index 0000000..3e358ee --- /dev/null +++ b/src/api/types/TicketSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TicketSummary extends DevRev.WorkBaseSummary { + revOrg?: DevRev.OrgSummary; + severity?: DevRev.TicketSeverity; +} diff --git a/src/api/types/TimelineComment.ts b/src/api/types/TimelineComment.ts new file mode 100644 index 0000000..a87a3fb --- /dev/null +++ b/src/api/types/TimelineComment.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TimelineComment extends DevRev.TimelineEntryBase { + /** The artifacts for the comment. */ + artifacts?: DevRev.ArtifactSummary[]; + /** + * The comment's body. If the comment has been deleted, then no body + * will appear in the response. + */ + body?: string; + bodyType?: DevRev.TimelineCommentBodyType; + snapKitBody?: DevRev.TimelineSnapKitBody; + /** The snap widget body of the comment. */ + snapWidgetBody?: DevRev.SnapWidget[]; +} diff --git a/src/api/types/TimelineCommentBodyType.ts b/src/api/types/TimelineCommentBodyType.ts new file mode 100644 index 0000000..fe3fd91 --- /dev/null +++ b/src/api/types/TimelineCommentBodyType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The type of the body to use for the comment. + */ +export type TimelineCommentBodyType = "snap_kit" | "snap_widget" | "text"; + +export const TimelineCommentBodyType = { + SnapKit: "snap_kit", + SnapWidget: "snap_widget", + Text: "text", +} as const; diff --git a/src/api/types/TimelineCommentSummary.ts b/src/api/types/TimelineCommentSummary.ts new file mode 100644 index 0000000..5c98b67 --- /dev/null +++ b/src/api/types/TimelineCommentSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type TimelineCommentSummary = DevRev.TimelineEntryBaseSummary; diff --git a/src/api/types/TimelineEntriesCollection.ts b/src/api/types/TimelineEntriesCollection.ts new file mode 100644 index 0000000..be06cef --- /dev/null +++ b/src/api/types/TimelineEntriesCollection.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Describes collections of timeline entries. + */ +export type TimelineEntriesCollection = "discussions" | "events"; + +export const TimelineEntriesCollection = { + Discussions: "discussions", + Events: "events", +} as const; diff --git a/src/api/types/TimelineEntriesCreateRequest.ts b/src/api/types/TimelineEntriesCreateRequest.ts new file mode 100644 index 0000000..3af1065 --- /dev/null +++ b/src/api/types/TimelineEntriesCreateRequest.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The request to create a timeline entry for an object. + */ +export type TimelineEntriesCreateRequest = DevRev.TimelineEntriesCreateRequest.TimelineComment; + +export declare namespace TimelineEntriesCreateRequest { + interface TimelineComment extends DevRev.TimelineEntriesCreateRequestTimelineComment, _Base { + type: "timeline_comment"; + } + + interface _Base { + /** + * The collection(s) that the entry belongs to, otherwise if not + * provided, then the entry's default collection is used. + */ + collections?: DevRev.TimelineEntriesCollection[]; + /** + * If set, then the entry is ephemeral and will be deleted after the + * provided time. The minimum value should be at least a minute more + * than the current timestamp. + */ + expiresAt?: Date; + /** The labels to be associated with the entry. */ + labels?: string[]; + /** The ID of the object to create the timeline entry for. */ + object: string; + /** + * If the visibility of the entry is private, this specifies the users + * that the entry is private to. Note the creator is always implicitly + * included in this list. + */ + privateTo?: string[]; + visibility?: DevRev.TimelineEntryVisibility; + } +} diff --git a/src/api/types/TimelineEntriesCreateRequestTimelineComment.ts b/src/api/types/TimelineEntriesCreateRequestTimelineComment.ts new file mode 100644 index 0000000..350e970 --- /dev/null +++ b/src/api/types/TimelineEntriesCreateRequestTimelineComment.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TimelineEntriesCreateRequestTimelineComment { + /** The IDs of the artifacts attached to the comment. */ + artifacts?: string[]; + /** The comment's body. */ + body?: string; + bodyType?: DevRev.TimelineCommentBodyType; + /** + * The external reference for the comment. This must be unique within + * the object's timeline. + */ + externalRef?: string; + /** The IDs of the previews of the links posted in the comment. */ + linkPreviews?: string[]; + snapKitBody?: DevRev.TimelineSnapKitBody; + /** The snap widget body of the comment. */ + snapWidgetBody?: string[]; +} diff --git a/src/api/types/TimelineEntriesCreateRequestType.ts b/src/api/types/TimelineEntriesCreateRequestType.ts new file mode 100644 index 0000000..63621fe --- /dev/null +++ b/src/api/types/TimelineEntriesCreateRequestType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type TimelineEntriesCreateRequestType = "timeline_comment"; diff --git a/src/api/types/TimelineEntriesCreateResponse.ts b/src/api/types/TimelineEntriesCreateResponse.ts new file mode 100644 index 0000000..063a086 --- /dev/null +++ b/src/api/types/TimelineEntriesCreateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to creating a timeline entry for an object. + */ +export interface TimelineEntriesCreateResponse { + timelineEntry: DevRev.TimelineEntry; +} diff --git a/src/api/types/TimelineEntriesListResponse.ts b/src/api/types/TimelineEntriesListResponse.ts new file mode 100644 index 0000000..8f2f43f --- /dev/null +++ b/src/api/types/TimelineEntriesListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to listing timeline entries for an object. + */ +export interface TimelineEntriesListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The timeline entries for the object. */ + timelineEntries: DevRev.TimelineEntry[]; +} diff --git a/src/api/types/TimelineEntriesUpdateRequest.ts b/src/api/types/TimelineEntriesUpdateRequest.ts new file mode 100644 index 0000000..861d281 --- /dev/null +++ b/src/api/types/TimelineEntriesUpdateRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The request to update a timeline entry. + */ +export type TimelineEntriesUpdateRequest = DevRev.TimelineEntriesUpdateRequest.TimelineComment; + +export declare namespace TimelineEntriesUpdateRequest { + interface TimelineComment extends DevRev.TimelineEntriesUpdateRequestTimelineComment, _Base { + type: "timeline_comment"; + } + + interface _Base { + /** The ID of the timeline entry to update. */ + id: string; + } +} diff --git a/src/api/types/TimelineEntriesUpdateRequestTimelineComment.ts b/src/api/types/TimelineEntriesUpdateRequestTimelineComment.ts new file mode 100644 index 0000000..3c3bb43 --- /dev/null +++ b/src/api/types/TimelineEntriesUpdateRequestTimelineComment.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TimelineEntriesUpdateRequestTimelineComment { + artifacts?: DevRev.TimelineEntriesUpdateRequestTimelineCommentArtifacts; + /** The updated comment's body. */ + body?: string; + bodyType?: DevRev.TimelineCommentBodyType; + linkPreviews?: DevRev.TimelineEntriesUpdateRequestTimelineCommentLinkPreviews; + snapKitBody?: DevRev.TimelineSnapKitBody; +} diff --git a/src/api/types/TimelineEntriesUpdateRequestTimelineCommentArtifacts.ts b/src/api/types/TimelineEntriesUpdateRequestTimelineCommentArtifacts.ts new file mode 100644 index 0000000..2d64b9c --- /dev/null +++ b/src/api/types/TimelineEntriesUpdateRequestTimelineCommentArtifacts.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface TimelineEntriesUpdateRequestTimelineCommentArtifacts { + /** + * Adds the provided artifacts to the comment. An artifact cannot be + * added more than once, i.e. nothing is done if the artifact is + * already attached. Mutually exclusive with `set`. + */ + add?: string[]; + /** + * Removes the provided artifacts from the comment. If an artifact is + * not present, then it's ignored. Mututally exclusive with `set`. + */ + remove?: string[]; + /** Sets the field to the provided artifacts. */ + set?: string[]; +} diff --git a/src/api/types/TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.ts b/src/api/types/TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.ts new file mode 100644 index 0000000..b8876d0 --- /dev/null +++ b/src/api/types/TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface TimelineEntriesUpdateRequestTimelineCommentLinkPreviews { + /** + * Adds the provided link previews to the comment. A link preview + * cannot be added more than once, i.e. nothing is done if the link + * preview is already present. Mutually exclusive with `set`. + */ + add?: string[]; + /** + * Removes the provided link previews from the comment. If a link + * preview is not present, then it's ignored. Mutually exclusive with + * `set`. + */ + remove?: string[]; + /** Set the link previews to the provided IDs. */ + set?: string[]; +} diff --git a/src/api/types/TimelineEntriesUpdateRequestType.ts b/src/api/types/TimelineEntriesUpdateRequestType.ts new file mode 100644 index 0000000..cdf2a6e --- /dev/null +++ b/src/api/types/TimelineEntriesUpdateRequestType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type TimelineEntriesUpdateRequestType = "timeline_comment"; diff --git a/src/api/types/TimelineEntriesUpdateResponse.ts b/src/api/types/TimelineEntriesUpdateResponse.ts new file mode 100644 index 0000000..fa975ad --- /dev/null +++ b/src/api/types/TimelineEntriesUpdateResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * The response to updating a timeline entry. + */ +export interface TimelineEntriesUpdateResponse { + timelineEntry: DevRev.TimelineEntry; +} diff --git a/src/api/types/TimelineEntry.ts b/src/api/types/TimelineEntry.ts new file mode 100644 index 0000000..344c50b --- /dev/null +++ b/src/api/types/TimelineEntry.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type TimelineEntry = DevRev.TimelineEntry.TimelineComment; + +export declare namespace TimelineEntry { + interface TimelineComment extends DevRev.TimelineComment { + type: "timeline_comment"; + } +} diff --git a/src/api/types/TimelineEntryBase.ts b/src/api/types/TimelineEntryBase.ts new file mode 100644 index 0000000..e024969 --- /dev/null +++ b/src/api/types/TimelineEntryBase.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TimelineEntryBase extends DevRev.AtomBase { + /** + * An external reference that's associated with the Timeline entry + * that's guaranteed to be unique among its siblings. + */ + externalRef?: string; + /** Labels that are associated with the Timeline entry. */ + labels?: string[]; + /** The object that the Timeline entry belongs to. */ + object: string; + /** The display ID of the object that the Timeline entry belongs to. */ + objectDisplayId: string; + objectType?: DevRev.TimelineEntryObjectType; + /** The reactions to the entry. */ + reactions?: DevRev.TimelineReaction[]; + thread?: DevRev.TimelineThread; + visibility?: DevRev.TimelineEntryVisibility; +} diff --git a/src/api/types/TimelineEntryBaseSummary.ts b/src/api/types/TimelineEntryBaseSummary.ts new file mode 100644 index 0000000..6a41d53 --- /dev/null +++ b/src/api/types/TimelineEntryBaseSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type TimelineEntryBaseSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/TimelineEntryObjectType.ts b/src/api/types/TimelineEntryObjectType.ts new file mode 100644 index 0000000..2df6eea --- /dev/null +++ b/src/api/types/TimelineEntryObjectType.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The type of object that the Timeline entry belongs to. + */ +export type TimelineEntryObjectType = + | "account" + | "capability" + | "conversation" + | "engagement" + | "enhancement" + | "feature" + | "issue" + | "meeting" + | "opportunity" + | "product" + | "rev_org" + | "rev_user" + | "task" + | "ticket" + | "timeline_comment"; + +export const TimelineEntryObjectType = { + Account: "account", + Capability: "capability", + Conversation: "conversation", + Engagement: "engagement", + Enhancement: "enhancement", + Feature: "feature", + Issue: "issue", + Meeting: "meeting", + Opportunity: "opportunity", + Product: "product", + RevOrg: "rev_org", + RevUser: "rev_user", + Task: "task", + Ticket: "ticket", + TimelineComment: "timeline_comment", +} as const; diff --git a/src/api/types/TimelineEntryType.ts b/src/api/types/TimelineEntryType.ts new file mode 100644 index 0000000..d45d0b0 --- /dev/null +++ b/src/api/types/TimelineEntryType.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type TimelineEntryType = "timeline_comment"; diff --git a/src/api/types/TimelineEntryVisibility.ts b/src/api/types/TimelineEntryVisibility.ts new file mode 100644 index 0000000..c910eff --- /dev/null +++ b/src/api/types/TimelineEntryVisibility.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The visibility of the entry. If 'private', then the entry is only + * visible to the creator, 'internal' is visible with the Dev + * organization, 'external' is visible to the Dev organzation and Rev + * users, and 'public' is visible to all. If not set, then the default + * visibility is 'external'. + */ +export type TimelineEntryVisibility = "external" | "internal" | "private" | "public"; + +export const TimelineEntryVisibility = { + External: "external", + Internal: "internal", + Private: "private", + Public: "public", +} as const; diff --git a/src/api/types/TimelineReaction.ts b/src/api/types/TimelineReaction.ts new file mode 100644 index 0000000..3350c9b --- /dev/null +++ b/src/api/types/TimelineReaction.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Reaction. + */ +export interface TimelineReaction { + /** The reaction emoji's unicode codepoint, e.g. "1f44d". */ + emoji?: string; + /** Whether the requesting user reacted. */ + reacted?: boolean; + /** The total number of users with this reaction. */ + totalUsers?: number; +} diff --git a/src/api/types/TimelineSnapKitBody.ts b/src/api/types/TimelineSnapKitBody.ts new file mode 100644 index 0000000..c91211b --- /dev/null +++ b/src/api/types/TimelineSnapKitBody.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Snap Kit Body of the comment. + */ +export interface TimelineSnapKitBody { + /** The JSON body of the SnapKit. */ + body?: Record; + /** + * The name of an action defined in the SnapIn. The combination of + * snap_in_id and snap_in_action_name uniquely identifies the + * interaction object which is to be called when actions on a snapkit + * element is taken. + */ + snapInActionName?: string; + /** ID of the snap-in which created the SnapKit. */ + snapInId?: string; +} diff --git a/src/api/types/TimelineThread.ts b/src/api/types/TimelineThread.ts new file mode 100644 index 0000000..69ec677 --- /dev/null +++ b/src/api/types/TimelineThread.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Thread. + */ +export interface TimelineThread { + /** The total number of replies in the thread. */ + totalReplies?: number; +} diff --git a/src/api/types/TrackEvent.ts b/src/api/types/TrackEvent.ts new file mode 100644 index 0000000..46c8994 --- /dev/null +++ b/src/api/types/TrackEvent.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface TrackEvent { + clientContext?: DevRev.ClientContext; + /** Unique ID for the event. */ + eventId?: string; + /** The timestamp at which the event occurred. */ + eventTime?: Date; + /** Name of the event. */ + name: string; + /** Payload of the event */ + payload: Record; +} diff --git a/src/api/types/TrackEventsPublishResponse.ts b/src/api/types/TrackEventsPublishResponse.ts new file mode 100644 index 0000000..6aded42 --- /dev/null +++ b/src/api/types/TrackEventsPublishResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type TrackEventsPublishResponse = Record; diff --git a/src/api/types/Unit.ts b/src/api/types/Unit.ts new file mode 100644 index 0000000..6b40e5c --- /dev/null +++ b/src/api/types/Unit.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Unit encapsulates the name of the unit and the type of the unit. For + * example, '#Number of API calls' where name is 'number_of_api_calls' and + * type is 'number'. + */ +export interface Unit { + type: DevRev.UnitType; + /** + * This represents human readable unit name of the UOM For example, + * number of API calls. + */ + name: string; +} diff --git a/src/api/types/UnitType.ts b/src/api/types/UnitType.ts new file mode 100644 index 0000000..0dbd7ae --- /dev/null +++ b/src/api/types/UnitType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * This defines the UOM unit type. For example, for 'number of video + * calls', unit type will be a number. + */ +export type UnitType = "boolean" | "number"; + +export const UnitType = { + Boolean: "boolean", + Number: "number", +} as const; diff --git a/src/api/types/UnlinkRevUserFromRevOrgResponse.ts b/src/api/types/UnlinkRevUserFromRevOrgResponse.ts new file mode 100644 index 0000000..3f419ba --- /dev/null +++ b/src/api/types/UnlinkRevUserFromRevOrgResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Response for unlinking/removing a Rev user from a Rev organization. + */ +export interface UnlinkRevUserFromRevOrgResponse { + revUser: DevRev.RevUser; +} diff --git a/src/api/types/Uom.ts b/src/api/types/Uom.ts new file mode 100644 index 0000000..f3eed8c --- /dev/null +++ b/src/api/types/Uom.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Uom extends DevRev.AtomBase { + aggregationDetails: DevRev.AggregationDetail; + /** Description of the UOM. */ + description?: string; + /** + * The list of dimensions that can be emitted along with the metering + * data. + */ + dimensions?: string[]; + /** + * If set to true, then the UOM can be configured as part of + * entitlements in skus and metering data only for the enabled uoms + * will be passed through the metering pipeline. + */ + isEnabled: boolean; + /** Human readable metric name of the UOM. */ + metricName: string; + metricScope: DevRev.UomMetricScope; + /** Human readable name of the UOM. */ + name: string; + part?: DevRev.PartSummary; + product: DevRev.PartSummary; + unit: DevRev.Unit; +} diff --git a/src/api/types/UomMetricScope.ts b/src/api/types/UomMetricScope.ts new file mode 100644 index 0000000..7ecccf4 --- /dev/null +++ b/src/api/types/UomMetricScope.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The granularity at which the metrics ingestion data is to be emitted + * for the UOM. + */ +export type UomMetricScope = "org" | "user"; + +export const UomMetricScope = { + Org: "org", + User: "user", +} as const; diff --git a/src/api/types/UomsCountResponse.ts b/src/api/types/UomsCountResponse.ts new file mode 100644 index 0000000..74b58c3 --- /dev/null +++ b/src/api/types/UomsCountResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface UomsCountResponse { + /** Count of Unit of Measurements matching the filter. */ + count: number; +} diff --git a/src/api/types/UomsCreateResponse.ts b/src/api/types/UomsCreateResponse.ts new file mode 100644 index 0000000..b3b5929 --- /dev/null +++ b/src/api/types/UomsCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface UomsCreateResponse { + uom: DevRev.Uom; +} diff --git a/src/api/types/UomsGetResponse.ts b/src/api/types/UomsGetResponse.ts new file mode 100644 index 0000000..efb8e05 --- /dev/null +++ b/src/api/types/UomsGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface UomsGetResponse { + uom: DevRev.Uom; +} diff --git a/src/api/types/UomsListResponse.ts b/src/api/types/UomsListResponse.ts new file mode 100644 index 0000000..5ba26b5 --- /dev/null +++ b/src/api/types/UomsListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface UomsListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The list of Unit of Measurement (UOM) objects. */ + uoms: DevRev.Uom[]; +} diff --git a/src/api/types/UomsUpdateRequestDimensions.ts b/src/api/types/UomsUpdateRequestDimensions.ts new file mode 100644 index 0000000..291fc36 --- /dev/null +++ b/src/api/types/UomsUpdateRequestDimensions.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface UomsUpdateRequestDimensions { + /** Adds the provided dimensions to the UOM. */ + add?: string[]; + /** Removes the provided dimensions from the UOM. */ + remove?: string[]; +} diff --git a/src/api/types/UomsUpdateResponse.ts b/src/api/types/UomsUpdateResponse.ts new file mode 100644 index 0000000..6db0815 --- /dev/null +++ b/src/api/types/UomsUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface UomsUpdateResponse { + uom: DevRev.Uom; +} diff --git a/src/api/types/UserBase.ts b/src/api/types/UserBase.ts new file mode 100644 index 0000000..f27c03d --- /dev/null +++ b/src/api/types/UserBase.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface UserBase extends DevRev.AtomBase { + /** The user's display name. The name is non-unique and mutable. */ + displayName?: string; + displayPicture?: DevRev.ArtifactSummary; + /** Email address of the user. */ + email?: string; + /** Full name of the user. */ + fullName?: string; + /** Phone numbers of the user. */ + phoneNumbers?: string[]; + state?: DevRev.UserState; +} diff --git a/src/api/types/UserBaseSummary.ts b/src/api/types/UserBaseSummary.ts new file mode 100644 index 0000000..394c3c6 --- /dev/null +++ b/src/api/types/UserBaseSummary.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface UserBaseSummary extends DevRev.AtomBaseSummary { + /** The user's display name. The name is non-unique and mutable. */ + displayName?: string; + displayPicture?: DevRev.ArtifactSummary; + /** Email address of the user. */ + email?: string; + /** Full name of the user. */ + fullName?: string; + state?: DevRev.UserState; +} diff --git a/src/api/types/UserSearchSummary.ts b/src/api/types/UserSearchSummary.ts new file mode 100644 index 0000000..03caa87 --- /dev/null +++ b/src/api/types/UserSearchSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface UserSearchSummary extends DevRev.SearchSummaryBase { + /** Comments on the work. */ + comments?: DevRev.CommentSearchSummary[]; + user: DevRev.UserSummary; +} diff --git a/src/api/types/UserSkill.ts b/src/api/types/UserSkill.ts new file mode 100644 index 0000000..ac5b844 --- /dev/null +++ b/src/api/types/UserSkill.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Skill associated with the user. + */ +export interface UserSkill { + /** Name of the skill. */ + name?: string; +} diff --git a/src/api/types/UserState.ts b/src/api/types/UserState.ts new file mode 100644 index 0000000..8a408c8 --- /dev/null +++ b/src/api/types/UserState.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * State of the user. + */ +export type UserState = "active" | "deactivated" | "deleted" | "locked" | "shadow" | "unassigned"; + +export const UserState = { + Active: "active", + Deactivated: "deactivated", + Deleted: "deleted", + Locked: "locked", + Shadow: "shadow", + Unassigned: "unassigned", +} as const; diff --git a/src/api/types/UserSummary.ts b/src/api/types/UserSummary.ts new file mode 100644 index 0000000..4cc93bd --- /dev/null +++ b/src/api/types/UserSummary.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type UserSummary = + | DevRev.UserSummary.DevUser + | DevRev.UserSummary.RevUser + | DevRev.UserSummary.ServiceAccount + | DevRev.UserSummary.SysUser; + +export declare namespace UserSummary { + interface DevUser extends DevRev.UserBaseSummary { + type: "dev_user"; + } + + interface RevUser extends DevRev.RevUserSummary { + type: "rev_user"; + } + + interface ServiceAccount extends DevRev.UserBaseSummary { + type: "service_account"; + } + + interface SysUser extends DevRev.UserBaseSummary { + type: "sys_user"; + } +} diff --git a/src/api/types/UserType.ts b/src/api/types/UserType.ts new file mode 100644 index 0000000..e3b52ba --- /dev/null +++ b/src/api/types/UserType.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type UserType = "dev_user" | "rev_user" | "service_account" | "sys_user"; + +export const UserType = { + DevUser: "dev_user", + RevUser: "rev_user", + ServiceAccount: "service_account", + SysUser: "sys_user", +} as const; diff --git a/src/api/types/VistaBaseSummary.ts b/src/api/types/VistaBaseSummary.ts new file mode 100644 index 0000000..545e832 --- /dev/null +++ b/src/api/types/VistaBaseSummary.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface VistaBaseSummary extends DevRev.AtomBaseSummary { + /** Name of the vista. */ + name: string; +} diff --git a/src/api/types/VistaGroupItemState.ts b/src/api/types/VistaGroupItemState.ts new file mode 100644 index 0000000..e688f4b --- /dev/null +++ b/src/api/types/VistaGroupItemState.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Defines the state of the group item. + */ +export type VistaGroupItemState = "active" | "completed" | "planned"; + +export const VistaGroupItemState = { + Active: "active", + Completed: "completed", + Planned: "planned", +} as const; diff --git a/src/api/types/VistaGroupItemSummary.ts b/src/api/types/VistaGroupItemSummary.ts new file mode 100644 index 0000000..7196a5a --- /dev/null +++ b/src/api/types/VistaGroupItemSummary.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Vista group item. + */ +export interface VistaGroupItemSummary { + type: DevRev.VistaGroupItemType; + /** Timestamp when the vista ends. */ + endDate?: Date; + /** ID of the group item in don v2 format. */ + id: string; + /** Name of the group. */ + name: string; + /** Timestamp when the vista starts. */ + startDate?: Date; + state?: DevRev.VistaGroupItemState; +} diff --git a/src/api/types/VistaGroupItemType.ts b/src/api/types/VistaGroupItemType.ts new file mode 100644 index 0000000..07f740a --- /dev/null +++ b/src/api/types/VistaGroupItemType.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of the group object. + */ +export type VistaGroupItemType = "curated" | "dynamic"; + +export const VistaGroupItemType = { + Curated: "curated", + Dynamic: "dynamic", +} as const; diff --git a/src/api/types/VistaSearchSummary.ts b/src/api/types/VistaSearchSummary.ts new file mode 100644 index 0000000..0d7af97 --- /dev/null +++ b/src/api/types/VistaSearchSummary.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface VistaSearchSummary extends DevRev.SearchSummaryBase { + vista: DevRev.VistaSummary; +} diff --git a/src/api/types/VistaSummary.ts b/src/api/types/VistaSummary.ts new file mode 100644 index 0000000..7255fc2 --- /dev/null +++ b/src/api/types/VistaSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +/** + * Represents a collection of DevRev objects. + */ +export type VistaSummary = DevRev.VistaSummary.Curated | DevRev.VistaSummary.Dynamic | DevRev.VistaSummary.Grouped; + +export declare namespace VistaSummary { + interface Curated extends DevRev.VistaBaseSummary { + type: "curated"; + } + + interface Dynamic extends DevRev.VistaBaseSummary { + type: "dynamic"; + } + + interface Grouped extends DevRev.GroupedVistaSummary { + type: "grouped"; + } +} diff --git a/src/api/types/VistaType.ts b/src/api/types/VistaType.ts new file mode 100644 index 0000000..f95918a --- /dev/null +++ b/src/api/types/VistaType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Type of vista object. + */ +export type VistaType = "curated" | "dynamic" | "grouped"; + +export const VistaType = { + Curated: "curated", + Dynamic: "dynamic", + Grouped: "grouped", +} as const; diff --git a/src/api/types/Webhook.ts b/src/api/types/Webhook.ts new file mode 100644 index 0000000..52bdef6 --- /dev/null +++ b/src/api/types/Webhook.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface Webhook extends DevRev.AtomBase { + /** The event types that the webhook will receive. */ + eventTypes?: DevRev.WebhookEventType[]; + /** The secret to use for verifying webhook events. */ + secret: string; + status: DevRev.WebhookStatus; + /** The URL of the webhook endpoint. */ + url: string; +} diff --git a/src/api/types/WebhookEventRequest.ts b/src/api/types/WebhookEventRequest.ts new file mode 100644 index 0000000..ccd0888 --- /dev/null +++ b/src/api/types/WebhookEventRequest.ts @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WebhookEventRequest { + type?: DevRev.WebhookEventType; + accountCreated?: DevRev.EventAccountCreated; + accountDeleted?: DevRev.EventAccountDeleted; + accountUpdated?: DevRev.EventAccountUpdated; + conversationCreated?: DevRev.EventConversationCreated; + conversationDeleted?: DevRev.EventConversationDeleted; + conversationUpdated?: DevRev.EventConversationUpdated; + devUserCreated?: DevRev.EventDevUserCreated; + devUserDeleted?: DevRev.EventDevUserDeleted; + devUserUpdated?: DevRev.EventDevUserUpdated; + groupCreated?: DevRev.EventGroupCreated; + groupDeleted?: DevRev.EventGroupDeleted; + groupUpdated?: DevRev.EventGroupUpdated; + /** The event's ID. */ + id: string; + partCreated?: DevRev.EventPartCreated; + partDeleted?: DevRev.EventPartDeleted; + partUpdated?: DevRev.EventPartUpdated; + revOrgCreated?: DevRev.EventRevOrgCreated; + revOrgDeleted?: DevRev.EventRevOrgDeleted; + revOrgUpdated?: DevRev.EventRevOrgUpdated; + revUserCreated?: DevRev.EventRevUserCreated; + revUserDeleted?: DevRev.EventRevUserDeleted; + revUserUpdated?: DevRev.EventRevUserUpdated; + slaTrackerCreated?: DevRev.EventSlaTrackerCreated; + slaTrackerDeleted?: DevRev.EventSlaTrackerDeleted; + slaTrackerUpdated?: DevRev.EventSlaTrackerUpdated; + surveyResponseCreated?: DevRev.EventSurveyResponseCreated; + surveyResponseDeleted?: DevRev.EventSurveyResponseDeleted; + surveyResponseUpdated?: DevRev.EventSurveyResponseUpdated; + tagCreated?: DevRev.EventTagCreated; + tagDeleted?: DevRev.EventTagDeleted; + tagUpdated?: DevRev.EventTagUpdated; + timelineEntryCreated?: DevRev.EventTimelineEntryCreated; + timelineEntryDeleted?: DevRev.EventTimelineEntryDeleted; + timelineEntryUpdated?: DevRev.EventTimelineEntryUpdated; + /** + * Timestamp of the webhook's invocation for the event. Note this + * should be used to protect against replay attacks, where the event + * should only be processed if the timestamp isn't stale by several + * seconds. + */ + timestamp?: Date; + verify?: DevRev.WebhookEventVerify; + webhookCreated?: DevRev.EventWebhookCreated; + webhookDeleted?: DevRev.EventWebhookDeleted; + /** ID of the webhook for the event. */ + webhookId: string; + webhookUpdated?: DevRev.EventWebhookUpdated; + workCreated?: DevRev.EventWorkCreated; + workDeleted?: DevRev.EventWorkDeleted; + workUpdated?: DevRev.EventWorkUpdated; +} diff --git a/src/api/types/WebhookEventResponse.ts b/src/api/types/WebhookEventResponse.ts new file mode 100644 index 0000000..e4646f0 --- /dev/null +++ b/src/api/types/WebhookEventResponse.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WebhookEventResponse { + /** + * The challenge from the "verify" request, otherwise this should not + * be set for other request types. + */ + challenge?: string; +} diff --git a/src/api/types/WebhookEventType.ts b/src/api/types/WebhookEventType.ts new file mode 100644 index 0000000..125f381 --- /dev/null +++ b/src/api/types/WebhookEventType.ts @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The event types that the webhook will receive. + */ +export type WebhookEventType = + | "account_created" + | "account_deleted" + | "account_updated" + | "conversation_created" + | "conversation_deleted" + | "conversation_updated" + | "dev_user_created" + | "dev_user_deleted" + | "dev_user_updated" + | "group_created" + | "group_deleted" + | "group_updated" + | "part_created" + | "part_deleted" + | "part_updated" + | "rev_org_created" + | "rev_org_deleted" + | "rev_org_updated" + | "rev_user_created" + | "rev_user_deleted" + | "rev_user_updated" + | "sla_tracker_created" + | "sla_tracker_deleted" + | "sla_tracker_updated" + | "tag_created" + | "tag_deleted" + | "tag_updated" + | "timeline_entry_created" + | "timeline_entry_deleted" + | "timeline_entry_updated" + | "verify" + | "webhook_created" + | "webhook_deleted" + | "webhook_updated" + | "work_created" + | "work_deleted" + | "work_updated"; + +export const WebhookEventType = { + AccountCreated: "account_created", + AccountDeleted: "account_deleted", + AccountUpdated: "account_updated", + ConversationCreated: "conversation_created", + ConversationDeleted: "conversation_deleted", + ConversationUpdated: "conversation_updated", + DevUserCreated: "dev_user_created", + DevUserDeleted: "dev_user_deleted", + DevUserUpdated: "dev_user_updated", + GroupCreated: "group_created", + GroupDeleted: "group_deleted", + GroupUpdated: "group_updated", + PartCreated: "part_created", + PartDeleted: "part_deleted", + PartUpdated: "part_updated", + RevOrgCreated: "rev_org_created", + RevOrgDeleted: "rev_org_deleted", + RevOrgUpdated: "rev_org_updated", + RevUserCreated: "rev_user_created", + RevUserDeleted: "rev_user_deleted", + RevUserUpdated: "rev_user_updated", + SlaTrackerCreated: "sla_tracker_created", + SlaTrackerDeleted: "sla_tracker_deleted", + SlaTrackerUpdated: "sla_tracker_updated", + TagCreated: "tag_created", + TagDeleted: "tag_deleted", + TagUpdated: "tag_updated", + TimelineEntryCreated: "timeline_entry_created", + TimelineEntryDeleted: "timeline_entry_deleted", + TimelineEntryUpdated: "timeline_entry_updated", + Verify: "verify", + WebhookCreated: "webhook_created", + WebhookDeleted: "webhook_deleted", + WebhookUpdated: "webhook_updated", + WorkCreated: "work_created", + WorkDeleted: "work_deleted", + WorkUpdated: "work_updated", +} as const; diff --git a/src/api/types/WebhookEventVerify.ts b/src/api/types/WebhookEventVerify.ts new file mode 100644 index 0000000..bed0c83 --- /dev/null +++ b/src/api/types/WebhookEventVerify.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WebhookEventVerify { + /** The challenge that must be echoed in the response. */ + challenge: string; +} diff --git a/src/api/types/WebhookStatus.ts b/src/api/types/WebhookStatus.ts new file mode 100644 index 0000000..e47dd4c --- /dev/null +++ b/src/api/types/WebhookStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The status of the webhook. + */ +export type WebhookStatus = "active" | "inactive" | "unverified"; + +export const WebhookStatus = { + Active: "active", + Inactive: "inactive", + Unverified: "unverified", +} as const; diff --git a/src/api/types/WebhookSummary.ts b/src/api/types/WebhookSummary.ts new file mode 100644 index 0000000..3cbfd81 --- /dev/null +++ b/src/api/types/WebhookSummary.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type WebhookSummary = DevRev.AtomBaseSummary; diff --git a/src/api/types/WeeklyOrgSchedule.ts b/src/api/types/WeeklyOrgSchedule.ts new file mode 100644 index 0000000..7b071c9 --- /dev/null +++ b/src/api/types/WeeklyOrgSchedule.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The schedule for each week. + */ +export type WeeklyOrgSchedule = Record; diff --git a/src/api/types/Work.ts b/src/api/types/Work.ts new file mode 100644 index 0000000..334f66a --- /dev/null +++ b/src/api/types/Work.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type Work = DevRev.Work.Issue | DevRev.Work.Opportunity | DevRev.Work.Task | DevRev.Work.Ticket; + +export declare namespace Work { + interface Issue extends DevRev.Issue { + type: "issue"; + } + + interface Opportunity extends DevRev.WorkBase { + type: "opportunity"; + } + + interface Task extends DevRev.WorkBase { + type: "task"; + } + + interface Ticket extends DevRev.Ticket { + type: "ticket"; + } +} diff --git a/src/api/types/WorkBase.ts b/src/api/types/WorkBase.ts new file mode 100644 index 0000000..8d8c898 --- /dev/null +++ b/src/api/types/WorkBase.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorkBase extends DevRev.AtomBase { + appliesToPart?: DevRev.PartSummary; + /** The artifacts attached to the work item. */ + artifacts?: DevRev.ArtifactSummary[]; + /** Body of the work object. */ + body?: string; + /** Custom fields. */ + customFields?: Record; + /** Custom schema fragments. */ + customSchemaFragments?: string[]; + /** The users that own the work. */ + ownedBy: DevRev.UserSummary[]; + /** Users that reported the work. */ + reportedBy?: DevRev.UserSummary[]; + stage?: DevRev.LegacyStage; + /** Stock schema fragment. */ + stockSchemaFragment?: string; + /** Subtype corresponding to the custom type fragment. */ + subtype?: string; + /** Tags associated with the object. */ + tags?: DevRev.TagWithValue[]; + /** Timestamp when the work is expected to be complete. */ + targetCloseDate?: Date; + /** Title of the work object. */ + title: string; +} diff --git a/src/api/types/WorkBaseSummary.ts b/src/api/types/WorkBaseSummary.ts new file mode 100644 index 0000000..0805aa4 --- /dev/null +++ b/src/api/types/WorkBaseSummary.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorkBaseSummary extends DevRev.AtomBaseSummary { + /** The users that own the work. */ + ownedBy: DevRev.UserSummary[]; + stage?: DevRev.LegacyStageSummary; + /** Title of the work object. */ + title: string; +} diff --git a/src/api/types/WorkSearchSummary.ts b/src/api/types/WorkSearchSummary.ts new file mode 100644 index 0000000..ca5a571 --- /dev/null +++ b/src/api/types/WorkSearchSummary.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorkSearchSummary extends DevRev.SearchSummaryBase { + /** Comments on the work. */ + comments?: DevRev.CommentSearchSummary[]; + work: DevRev.WorkSummary; +} diff --git a/src/api/types/WorkSummary.ts b/src/api/types/WorkSummary.ts new file mode 100644 index 0000000..a21ea7d --- /dev/null +++ b/src/api/types/WorkSummary.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type WorkSummary = + | DevRev.WorkSummary.Issue + | DevRev.WorkSummary.Opportunity + | DevRev.WorkSummary.Task + | DevRev.WorkSummary.Ticket; + +export declare namespace WorkSummary { + interface Issue extends DevRev.IssueSummary { + type: "issue"; + } + + interface Opportunity extends DevRev.WorkBaseSummary { + type: "opportunity"; + } + + interface Task extends DevRev.WorkBaseSummary { + type: "task"; + } + + interface Ticket extends DevRev.TicketSummary { + type: "ticket"; + } +} diff --git a/src/api/types/WorkType.ts b/src/api/types/WorkType.ts new file mode 100644 index 0000000..61d2e07 --- /dev/null +++ b/src/api/types/WorkType.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type WorkType = "issue" | "opportunity" | "task" | "ticket"; + +export const WorkType = { + Issue: "issue", + Opportunity: "opportunity", + Task: "task", + Ticket: "ticket", +} as const; diff --git a/src/api/types/WorksCreateRequest.ts b/src/api/types/WorksCreateRequest.ts new file mode 100644 index 0000000..42a2065 --- /dev/null +++ b/src/api/types/WorksCreateRequest.ts @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type WorksCreateRequest = + | DevRev.WorksCreateRequest.Issue + | DevRev.WorksCreateRequest.Opportunity + | DevRev.WorksCreateRequest.Task + | DevRev.WorksCreateRequest.Ticket; + +export declare namespace WorksCreateRequest { + interface Issue extends DevRev.WorksCreateRequestIssue, _Base { + type: "issue"; + } + + interface Opportunity extends DevRev.WorksCreateRequestOpportunity, _Base { + type: "opportunity"; + } + + interface Task extends DevRev.WorksCreateRequestTask, _Base { + type: "task"; + } + + interface Ticket extends DevRev.WorksCreateRequestTicket, _Base { + type: "ticket"; + } + + interface _Base { + /** + * The [part](https://devrev.ai/docs/product/parts) that the work + * applies to. Specifying a part is required when creating tickets and + * issues. + */ + appliesToPart: string; + /** The IDs of the artifacts to associate with the work item. */ + artifacts?: string[]; + /** Body of the work object. */ + body?: string; + /** Custom fields. */ + customFields?: Record; + /** The custom schema fragments to use. */ + customSchemaFragments?: string[]; + customSchemaSpec?: DevRev.CustomSchemaSpec; + /** The users that own the work. */ + ownedBy: string[]; + /** The users that reported the work. */ + reportedBy?: string[]; + stage?: DevRev.StageInit; + /** The type of stage validations options when creating a work item. */ + stageValidationOptions?: DevRev.StageValidationOptionForCreate[]; + /** Tags associated with the work item. */ + tags?: DevRev.SetTagWithValue[]; + /** Timestamp for when the work is expected to be complete. */ + targetCloseDate?: Date; + /** Title of the work object. */ + title: string; + } +} diff --git a/src/api/types/WorksCreateRequestIssue.ts b/src/api/types/WorksCreateRequestIssue.ts new file mode 100644 index 0000000..33ad120 --- /dev/null +++ b/src/api/types/WorksCreateRequestIssue.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksCreateRequestIssue { + /** The IDs of the parts associated with issue. */ + developedWith?: string[]; + priority?: DevRev.IssuePriority; + /** Priority enum id of the work based upon impact and criticality. */ + priorityV2?: number; + /** The sprint that the issue belongs to. */ + sprint?: string; + /** Timestamp for when the work is expected to start. */ + targetStartDate?: Date; +} diff --git a/src/api/types/WorksCreateRequestOpportunity.ts b/src/api/types/WorksCreateRequestOpportunity.ts new file mode 100644 index 0000000..fb0cadc --- /dev/null +++ b/src/api/types/WorksCreateRequestOpportunity.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksCreateRequestOpportunity { + /** The ID of the account that the opportunity is associated with. */ + account: string; + /** Total opportunity amount. */ + amount?: number; + /** Contacts involved in the opportunity. */ + contacts?: string[]; + /** Budget of the customer. */ + customerBudget?: number; + forecastCategory?: DevRev.OpportunityForecastCategory; + priority?: DevRev.OpportunityPriority; + /** The probability of winning the deal, lies between 0.0 and 1.0. */ + probability?: number; +} diff --git a/src/api/types/WorksCreateRequestTask.ts b/src/api/types/WorksCreateRequestTask.ts new file mode 100644 index 0000000..cfaba02 --- /dev/null +++ b/src/api/types/WorksCreateRequestTask.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksCreateRequestTask { + /** Whether the task is embedded in the work. */ + embedded?: boolean; + priority?: DevRev.TaskPriority; + /** Timestamp when the task was started. */ + startDate?: Date; +} diff --git a/src/api/types/WorksCreateRequestTicket.ts b/src/api/types/WorksCreateRequestTicket.ts new file mode 100644 index 0000000..036111a --- /dev/null +++ b/src/api/types/WorksCreateRequestTicket.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksCreateRequestTicket { + /** Channels of the ticket. */ + channels?: DevRev.TicketChannels[]; + /** The group that the ticket is associated with. */ + group?: string; + /** Whether the ticket is spam. */ + isSpam?: boolean; + /** Whether the ticket needs a response. */ + needsResponse?: boolean; + /** The Rev organization that the ticket is associated with. */ + revOrg?: string; + severity?: DevRev.TicketSeverity; + /** The source channel of the ticket. */ + sourceChannel?: string; +} diff --git a/src/api/types/WorksCreateResponse.ts b/src/api/types/WorksCreateResponse.ts new file mode 100644 index 0000000..4598022 --- /dev/null +++ b/src/api/types/WorksCreateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksCreateResponse { + work: DevRev.Work; +} diff --git a/src/api/types/WorksDeleteResponse.ts b/src/api/types/WorksDeleteResponse.ts new file mode 100644 index 0000000..f12efe8 --- /dev/null +++ b/src/api/types/WorksDeleteResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type WorksDeleteResponse = Record; diff --git a/src/api/types/WorksExportResponse.ts b/src/api/types/WorksExportResponse.ts new file mode 100644 index 0000000..8672bdd --- /dev/null +++ b/src/api/types/WorksExportResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksExportResponse { + /** The resulting collection of work items. */ + works: DevRev.Work[]; +} diff --git a/src/api/types/WorksFilterIssue.ts b/src/api/types/WorksFilterIssue.ts new file mode 100644 index 0000000..93c1a28 --- /dev/null +++ b/src/api/types/WorksFilterIssue.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksFilterIssue { + /** Filters for issues with any of the provided Accounts. */ + accounts?: string[]; + actualStartDate?: DevRev.DateFilter; + /** Filters for issues with any of the provided priorities. */ + priority?: DevRev.IssuePriority[]; + /** Filters for issues with any of the provided priority enum ids. */ + priorityV2?: number[]; + /** Filters for issues with any of the provided Rev organizations. */ + revOrgs?: string[]; + slaSummary?: DevRev.SlaSummaryFilter; + /** Filters for issues with any of the sprint. */ + sprint?: string[]; + /** Filters for issues with any of the provided subtypes. */ + subtype?: string[]; + targetStartDate?: DevRev.DateFilter; +} diff --git a/src/api/types/WorksFilterOpportunity.ts b/src/api/types/WorksFilterOpportunity.ts new file mode 100644 index 0000000..d0bfd40 --- /dev/null +++ b/src/api/types/WorksFilterOpportunity.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WorksFilterOpportunity { + /** + * Filters for opportunities belonging to any of the provided + * accounts. + */ + account?: string[]; + /** Filters for opportunities with any of the provided contacts. */ + contacts?: string[]; + /** Filters for opportunity with any of the provided subtypes. */ + subtype?: string[]; +} diff --git a/src/api/types/WorksFilterTicket.ts b/src/api/types/WorksFilterTicket.ts new file mode 100644 index 0000000..2a2d2e6 --- /dev/null +++ b/src/api/types/WorksFilterTicket.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksFilterTicket { + /** Filters for tickets with any of the provided channels. */ + channels?: DevRev.TicketChannels[]; + /** Filters for tickets belonging to specific groups. */ + group?: string[]; + /** Filters for tickets that are spam. */ + isSpam?: boolean; + /** Filters for tickets that need response. */ + needsResponse?: boolean; + /** + * Filters for tickets that are associated with any of the provided + * Rev organizations. + */ + revOrg?: string[]; + /** Filters for tickets with any of the provided severities. */ + severity?: DevRev.TicketSeverity[]; + slaSummary?: DevRev.SlaSummaryFilter; + /** Filters for tickets with any of the provided source channels. */ + sourceChannel?: string[]; + /** Filters for tickets with any of the provided subtypes. */ + subtype?: string[]; + surveys?: DevRev.SurveyAggregationFilter; +} diff --git a/src/api/types/WorksGetResponse.ts b/src/api/types/WorksGetResponse.ts new file mode 100644 index 0000000..dd24f4f --- /dev/null +++ b/src/api/types/WorksGetResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksGetResponse { + work: DevRev.Work; +} diff --git a/src/api/types/WorksListResponse.ts b/src/api/types/WorksListResponse.ts new file mode 100644 index 0000000..167dff0 --- /dev/null +++ b/src/api/types/WorksListResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksListResponse { + /** + * The cursor used to iterate subsequent results in accordance to the + * sort order. If not set, then no later elements exist. + */ + nextCursor?: string; + /** + * The cursor used to iterate preceding results in accordance to the + * sort order. If not set, then no prior elements exist. + */ + prevCursor?: string; + /** The list of works. */ + works: DevRev.Work[]; +} diff --git a/src/api/types/WorksUpdateRequest.ts b/src/api/types/WorksUpdateRequest.ts new file mode 100644 index 0000000..1fe9878 --- /dev/null +++ b/src/api/types/WorksUpdateRequest.ts @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export type WorksUpdateRequest = + | DevRev.WorksUpdateRequest.Issue + | DevRev.WorksUpdateRequest.None + | DevRev.WorksUpdateRequest.Opportunity + | DevRev.WorksUpdateRequest.Task + | DevRev.WorksUpdateRequest.Ticket; + +export declare namespace WorksUpdateRequest { + interface Issue extends DevRev.WorksUpdateRequestIssue, _Base { + type: "issue"; + } + + interface None extends _Base { + type: "none"; + value: DevRev.Empty; + } + + interface Opportunity extends DevRev.WorksUpdateRequestOpportunity, _Base { + type: "opportunity"; + } + + interface Task extends DevRev.WorksUpdateRequestTask, _Base { + type: "task"; + } + + interface Ticket extends DevRev.WorksUpdateRequestTicket, _Base { + type: "ticket"; + } + + interface _Base { + /** Updates the part that the work item applies to. */ + appliesToPart?: string; + artifacts?: DevRev.WorksUpdateRequestArtifacts; + /** Updated body of the work object, or unchanged if not provided. */ + body?: string; + /** Custom fields. */ + customFields?: Record; + /** The custom schema fragments to use. */ + customSchemaFragments?: string[]; + customSchemaSpec?: DevRev.CustomSchemaSpec; + /** The work's ID. */ + id: string; + ownedBy?: DevRev.WorksUpdateRequestOwnedBy; + reportedBy?: DevRev.WorksUpdateRequestReportedBy; + stage?: DevRev.StageUpdate; + /** + * The type of stage validations options when updating the stage of an + * object. + */ + stageValidationOptions?: DevRev.StageValidationOptionForUpdate[]; + stagedInfo?: DevRev.WorksUpdateRequestStagedInfoStagedInfoUpdate; + tags?: DevRev.WorksUpdateRequestTags; + /** Updates the timestamp for when the work is expected to be complete. */ + targetCloseDate?: Date; + /** Updated title of the work object, or unchanged if not provided. */ + title?: string; + } +} diff --git a/src/api/types/WorksUpdateRequestArtifacts.ts b/src/api/types/WorksUpdateRequestArtifacts.ts new file mode 100644 index 0000000..0d0ebe5 --- /dev/null +++ b/src/api/types/WorksUpdateRequestArtifacts.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WorksUpdateRequestArtifacts { + /** Adds the provided artifacts (if not already present) to the field. */ + add?: string[]; + /** Removes the provided artifacts (if they exist) from the field. */ + remove?: string[]; + /** Sets the field to the provided artifacts. */ + set?: string[]; +} diff --git a/src/api/types/WorksUpdateRequestIssue.ts b/src/api/types/WorksUpdateRequestIssue.ts new file mode 100644 index 0000000..7f71eeb --- /dev/null +++ b/src/api/types/WorksUpdateRequestIssue.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksUpdateRequestIssue { + developedWith?: DevRev.WorksUpdateRequestIssueDevelopedWith; + priority?: DevRev.IssuePriority; + /** Priority enum id of the work based upon impact and criticality. */ + priorityV2?: number; + /** Updates the sprint that the issue belongs to. */ + sprint?: string; + /** Updates the timestamp for when the work is expected to start. */ + targetStartDate?: Date; +} diff --git a/src/api/types/WorksUpdateRequestIssueDevelopedWith.ts b/src/api/types/WorksUpdateRequestIssueDevelopedWith.ts new file mode 100644 index 0000000..7724b0a --- /dev/null +++ b/src/api/types/WorksUpdateRequestIssueDevelopedWith.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WorksUpdateRequestIssueDevelopedWith { + /** Sets the IDs of the parts associated with issue. */ + set?: string[]; +} diff --git a/src/api/types/WorksUpdateRequestOpportunity.ts b/src/api/types/WorksUpdateRequestOpportunity.ts new file mode 100644 index 0000000..979a022 --- /dev/null +++ b/src/api/types/WorksUpdateRequestOpportunity.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksUpdateRequestOpportunity { + /** Updates the account that the opportunity is associated with. */ + account?: string; + /** Updates the total opportunity amount. */ + amount?: number; + contacts?: DevRev.WorksUpdateRequestOpportunityContacts; + /** Updates the customer budget. */ + customerBudget?: number; + /** + * Updates the probability of winning the deal, lies between 0.0 and + * 1.0. + */ + probability?: number; +} diff --git a/src/api/types/WorksUpdateRequestOpportunityContacts.ts b/src/api/types/WorksUpdateRequestOpportunityContacts.ts new file mode 100644 index 0000000..095092a --- /dev/null +++ b/src/api/types/WorksUpdateRequestOpportunityContacts.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WorksUpdateRequestOpportunityContacts { + /** Sets the contact IDs to the provided contact IDs. */ + set: string[]; +} diff --git a/src/api/types/WorksUpdateRequestOwnedBy.ts b/src/api/types/WorksUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..5a7973d --- /dev/null +++ b/src/api/types/WorksUpdateRequestOwnedBy.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WorksUpdateRequestOwnedBy { + /** + * Sets the owner IDs to the provided user IDs. This must not be + * empty. + */ + set?: string[]; +} diff --git a/src/api/types/WorksUpdateRequestReportedBy.ts b/src/api/types/WorksUpdateRequestReportedBy.ts new file mode 100644 index 0000000..42be237 --- /dev/null +++ b/src/api/types/WorksUpdateRequestReportedBy.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WorksUpdateRequestReportedBy { + /** Sets the users that reported the work to the provided user IDs. */ + set?: string[]; +} diff --git a/src/api/types/WorksUpdateRequestStagedInfoStagedInfoUpdate.ts b/src/api/types/WorksUpdateRequestStagedInfoStagedInfoUpdate.ts new file mode 100644 index 0000000..9c9ac39 --- /dev/null +++ b/src/api/types/WorksUpdateRequestStagedInfoStagedInfoUpdate.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WorksUpdateRequestStagedInfoStagedInfoUpdate { + /** Updates the unresolved fields of the staged work. */ + unresolvedFields: string[]; +} diff --git a/src/api/types/WorksUpdateRequestTags.ts b/src/api/types/WorksUpdateRequestTags.ts new file mode 100644 index 0000000..d8fcd1e --- /dev/null +++ b/src/api/types/WorksUpdateRequestTags.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksUpdateRequestTags { + /** Sets the provided tags on the work item. */ + set?: DevRev.SetTagWithValue[]; +} diff --git a/src/api/types/WorksUpdateRequestTask.ts b/src/api/types/WorksUpdateRequestTask.ts new file mode 100644 index 0000000..8609dae --- /dev/null +++ b/src/api/types/WorksUpdateRequestTask.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksUpdateRequestTask { + /** Whether the task is embedded in the work. */ + embedded?: boolean; + priority?: DevRev.TaskPriority; + /** Timestamp when the task was started. */ + startDate?: Date; +} diff --git a/src/api/types/WorksUpdateRequestTicket.ts b/src/api/types/WorksUpdateRequestTicket.ts new file mode 100644 index 0000000..32a5f07 --- /dev/null +++ b/src/api/types/WorksUpdateRequestTicket.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksUpdateRequestTicket { + channels?: DevRev.WorksUpdateRequestTicketChannels; + /** Updates the group that the ticket is associated with. */ + group?: string; + /** Updates whether the ticket is spam. */ + isSpam?: boolean; + /** Updates whether the ticket needs a response. */ + needsResponse?: boolean; + /** Updates the Rev organization that the ticket is associated with. */ + revOrg?: string; + severity?: DevRev.TicketSeverity; +} diff --git a/src/api/types/WorksUpdateRequestTicketChannels.ts b/src/api/types/WorksUpdateRequestTicketChannels.ts new file mode 100644 index 0000000..a50dcd4 --- /dev/null +++ b/src/api/types/WorksUpdateRequestTicketChannels.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksUpdateRequestTicketChannels { + /** Sets the channels to the provided channels. */ + set?: DevRev.TicketChannels[]; +} diff --git a/src/api/types/WorksUpdateResponse.ts b/src/api/types/WorksUpdateResponse.ts new file mode 100644 index 0000000..be2e12a --- /dev/null +++ b/src/api/types/WorksUpdateResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as DevRev from "../index"; + +export interface WorksUpdateResponse { + work: DevRev.Work; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts new file mode 100644 index 0000000..0217ab1 --- /dev/null +++ b/src/api/types/index.ts @@ -0,0 +1,633 @@ +export * from "./AccessLevel"; +export * from "./Account"; +export * from "./AccountSearchSummary"; +export * from "./SearchSummaryBase"; +export * from "./AccountSummary"; +export * from "./AccountsCreateResponse"; +export * from "./AccountsDeleteResponse"; +export * from "./AccountsExportResponse"; +export * from "./AccountsFilters"; +export * from "./AccountsGetResponse"; +export * from "./AccountsListResponse"; +export * from "./AccountsUpdateRequestArtifacts"; +export * from "./AccountsUpdateResponse"; +export * from "./AggregatedSchema"; +export * from "./AggregatedSchemaGetResponse"; +export * from "./AggregationDetail"; +export * from "./AggregationDetailAggregationType"; +export * from "./AppFragment"; +export * from "./CustomSchemaFragmentBase"; +export * from "./AtomBase"; +export * from "./AppFragmentSummary"; +export * from "./ArchetypeMetricTarget"; +export * from "./Article"; +export * from "./ArticleSearchSummary"; +export * from "./ArticleStatus"; +export * from "./ArticleSummary"; +export * from "./ArticleType"; +export * from "./ArticlesCountResponse"; +export * from "./ArticlesCreateRequestResource"; +export * from "./ArticlesCreateResponse"; +export * from "./ArticlesDeleteResponse"; +export * from "./ArticlesGetResponse"; +export * from "./ArticlesListResponse"; +export * from "./ArticlesUpdateRequestAppliesToParts"; +export * from "./ArticlesUpdateRequestArtifacts"; +export * from "./ArticlesUpdateRequestAuthoredBy"; +export * from "./ArticlesUpdateRequestExtractedContent"; +export * from "./ArticlesUpdateRequestOwnedBy"; +export * from "./ArticlesUpdateRequestReorder"; +export * from "./ArticlesUpdateRequestSharedWith"; +export * from "./ArticlesUpdateRequestTags"; +export * from "./ArticlesUpdateResponse"; +export * from "./ArtifactSearchSummary"; +export * from "./ArtifactSummary"; +export * from "./ArtifactsPrepareResponse"; +export * from "./ArtifactsPrepareResponseFormData"; +export * from "./ArtifactsVersionsPrepareResponse"; +export * from "./ArtifactsVersionsPrepareResponseFormData"; +export * from "./AtomBaseSummary"; +export * from "./AtomSummary"; +export * from "./AtomType"; +export * from "./BooleanExpression"; +export * from "./BooleanExpressionAndExpression"; +export * from "./BooleanExpressionNotExpression"; +export * from "./BooleanExpressionOrExpression"; +export * from "./BooleanExpressionPrimitiveExpression"; +export * from "./BooleanExpressionType"; +export * from "./Capability"; +export * from "./CapabilitySummary"; +export * from "./ClientContext"; +export * from "./ClientContextBrowser"; +export * from "./ClientContextCpu"; +export * from "./ClientContextDevice"; +export * from "./ClientContextEngine"; +export * from "./ClientContextOs"; +export * from "./ClientContextPage"; +export * from "./CodeChange"; +export * from "./CodeChangeSource"; +export * from "./CodeChangesCreateRequest"; +export * from "./CodeChangesCreateResponse"; +export * from "./CodeChangesDeleteResponse"; +export * from "./CodeChangesGetResponse"; +export * from "./CodeChangesListResponse"; +export * from "./CodeChangesUpdateResponse"; +export * from "./CommentSearchSummary"; +export * from "./Conversation"; +export * from "./ConversationMetadata"; +export * from "./ConversationSearchSummary"; +export * from "./ConversationSummary"; +export * from "./ConversationsCreateRequestMessage"; +export * from "./ConversationsCreateRequestMetadata"; +export * from "./ConversationsCreateRequestTypeValue"; +export * from "./ConversationsCreateResponse"; +export * from "./ConversationsDeleteResponse"; +export * from "./ConversationsExportResponse"; +export * from "./ConversationsGetResponse"; +export * from "./ConversationsListResponse"; +export * from "./ConversationsUpdateRequestAppliesToParts"; +export * from "./ConversationsUpdateRequestMetadata"; +export * from "./ConversationsUpdateRequestTags"; +export * from "./ConversationsUpdateRequestUserSessions"; +export * from "./ConversationsUpdateResponse"; +export * from "./CreateEmailInfo"; +export * from "./CreateEmailInlineAttachment"; +export * from "./CreateEmailPreviewWidget"; +export * from "./CreateOrgScheduleInterval"; +export * from "./CreateWeeklyOrgScheduleInterval"; +export * from "./CuratedVistaSummary"; +export * from "./CustomObjectSearchSummary"; +export * from "./CustomObjectSummary"; +export * from "./CustomSchemaFragment"; +export * from "./CustomSchemaFragmentBaseSummary"; +export * from "./CustomSchemaFragmentCondition"; +export * from "./CustomSchemaFragmentFragmentType"; +export * from "./CustomSchemaFragmentSummary"; +export * from "./CustomSchemaFragmentType"; +export * from "./CustomSchemaFragmentsGetResponse"; +export * from "./CustomSchemaFragmentsListRequestPrune"; +export * from "./CustomSchemaFragmentsListResponse"; +export * from "./CustomSchemaFragmentsSetRequest"; +export * from "./CustomSchemaFragmentsSetRequestAppFragment"; +export * from "./CustomSchemaFragmentsSetRequestCustomTypeFragment"; +export * from "./CustomSchemaFragmentsSetRequestTenantFragment"; +export * from "./CustomSchemaFragmentsSetRequestType"; +export * from "./CustomSchemaFragmentsSetResponse"; +export * from "./CustomSchemaSpec"; +export * from "./CustomStage"; +export * from "./CustomStageSummary"; +export * from "./CustomStagesCreateResponse"; +export * from "./CustomStagesGetResponse"; +export * from "./CustomStagesListResponse"; +export * from "./CustomStagesUpdateResponse"; +export * from "./CustomState"; +export * from "./CustomStatesCreateResponse"; +export * from "./CustomStatesGetResponse"; +export * from "./CustomStatesListResponse"; +export * from "./CustomStatesUpdateResponse"; +export * from "./CustomTypeFragment"; +export * from "./CustomTypeFragmentSummary"; +export * from "./CustomTypePathComponent"; +export * from "./DashboardSearchSummary"; +export * from "./DashboardSummary"; +export * from "./DateFilter"; +export * from "./DateFilterType"; +export * from "./DateTimeFilter"; +export * from "./DateTimePreset"; +export * from "./DateTimePresetLastNDays"; +export * from "./DateTimePresetNextNDays"; +export * from "./DateTimePresetType"; +export * from "./DevUser"; +export * from "./DevUserJobTitle"; +export * from "./DevUserSummary"; +export * from "./DevUsersIdentitiesLinkResponse"; +export * from "./DevUsersIdentitiesUnlinkResponse"; +export * from "./DevUsersUpdateResponse"; +export * from "./DirectorySummary"; +export * from "./DynamicGroupInfo"; +export * from "./DynamicVistaSummary"; +export * from "./EmailInfo"; +export * from "./EmailInlineAttachment"; +export * from "./EmailPreviewWidget"; +export * from "./SnapWidgetBase"; +export * from "./Empty"; +export * from "./Engagement"; +export * from "./EngagementSummary"; +export * from "./EngagementType"; +export * from "./EngagementsCountResponse"; +export * from "./EngagementsCreateRequestEngagementType"; +export * from "./EngagementsCreateResponse"; +export * from "./EngagementsDeleteResponse"; +export * from "./EngagementsGetResponse"; +export * from "./EngagementsListResponse"; +export * from "./EngagementsUpdateRequestArtifactIds"; +export * from "./EngagementsUpdateRequestMembers"; +export * from "./EngagementsUpdateRequestTags"; +export * from "./EngagementsUpdateResponse"; +export * from "./Enhancement"; +export * from "./EnhancementSummary"; +export * from "./EnumValue"; +export * from "./Error_"; +export * from "./ErrorBadRequest"; +export * from "./ErrorBadRequestArtifactAlreadyAttachedToAParent"; +export * from "./ErrorBadRequestBadRequest"; +export * from "./ErrorBadRequestInvalidApiVersion"; +export * from "./ErrorBadRequestInvalidEnumValue"; +export * from "./ErrorBadRequestInvalidField"; +export * from "./ErrorBadRequestInvalidId"; +export * from "./ErrorBadRequestMergeWorksError"; +export * from "./ErrorBadRequestMergeWorksErrorErrorSubtype"; +export * from "./ErrorBadRequestMergeWorksErrorError"; +export * from "./ErrorBadRequestMergeWorksErrorErrorAlreadyMerged"; +export * from "./ErrorBadRequestMergeWorksErrorErrorClosed"; +export * from "./ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace"; +export * from "./ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition"; +export * from "./ErrorBadRequestMissingDependency"; +export * from "./ErrorBadRequestMissingDependencyDependency"; +export * from "./ErrorBadRequestMissingRequiredField"; +export * from "./ErrorBadRequestParseError"; +export * from "./ErrorBadRequestStaleSchemaFragments"; +export * from "./ErrorBadRequestType"; +export * from "./ErrorBadRequestUnexpectedIdType"; +export * from "./ErrorBadRequestUnexpectedJsonType"; +export * from "./ErrorBadRequestUnexpectedJsonTypeType"; +export * from "./ErrorBadRequestValueNotPermitted"; +export * from "./ErrorBase"; +export * from "./ErrorConflict"; +export * from "./ErrorConflictConflict"; +export * from "./ErrorConflictType"; +export * from "./ErrorForbidden"; +export * from "./ErrorForbiddenForbidden"; +export * from "./ErrorForbiddenType"; +export * from "./ErrorInternalServerError"; +export * from "./ErrorInternalServerErrorInternalError"; +export * from "./ErrorInternalServerErrorType"; +export * from "./ErrorNotFound"; +export * from "./ErrorNotFoundNotFound"; +export * from "./ErrorNotFoundType"; +export * from "./ErrorServiceUnavailable"; +export * from "./ErrorServiceUnavailableServiceUnavailable"; +export * from "./ErrorServiceUnavailableType"; +export * from "./ErrorTooManyRequests"; +export * from "./ErrorTooManyRequestsTooManyRequests"; +export * from "./ErrorTooManyRequestsType"; +export * from "./ErrorUnauthorized"; +export * from "./ErrorUnauthorizedType"; +export * from "./ErrorUnauthorizedUnauthenticated"; +export * from "./EventAccountCreated"; +export * from "./EventAccountDeleted"; +export * from "./EventAccountUpdated"; +export * from "./EventConversationCreated"; +export * from "./EventConversationDeleted"; +export * from "./EventConversationUpdated"; +export * from "./EventDevUserCreated"; +export * from "./EventDevUserDeleted"; +export * from "./EventDevUserUpdated"; +export * from "./EventGroupCreated"; +export * from "./EventGroupDeleted"; +export * from "./EventGroupUpdated"; +export * from "./EventPartCreated"; +export * from "./EventPartDeleted"; +export * from "./EventPartUpdated"; +export * from "./EventRevOrgCreated"; +export * from "./EventRevOrgDeleted"; +export * from "./EventRevOrgUpdated"; +export * from "./EventRevUserCreated"; +export * from "./EventRevUserDeleted"; +export * from "./EventRevUserUpdated"; +export * from "./EventSlaTrackerCreated"; +export * from "./EventSlaTrackerDeleted"; +export * from "./EventSlaTrackerUpdated"; +export * from "./EventSource"; +export * from "./EventSourceGetResponse"; +export * from "./EventSourceSetupInstructions"; +export * from "./EventSourceStatus"; +export * from "./EventSourcesScheduleEventResponse"; +export * from "./EventSurveyResponseCreated"; +export * from "./EventSurveyResponseDeleted"; +export * from "./EventSurveyResponseUpdated"; +export * from "./EventTagCreated"; +export * from "./EventTagDeleted"; +export * from "./EventTagUpdated"; +export * from "./EventTimelineEntryCreated"; +export * from "./EventTimelineEntryDeleted"; +export * from "./EventTimelineEntryUpdated"; +export * from "./EventWebhookCreated"; +export * from "./EventWebhookDeleted"; +export * from "./EventWebhookUpdated"; +export * from "./EventWorkCreated"; +export * from "./EventWorkDeleted"; +export * from "./EventWorkUpdated"; +export * from "./ExternalIdentity"; +export * from "./Feature"; +export * from "./FeatureSummary"; +export * from "./FieldDescriptor"; +export * from "./Group"; +export * from "./GroupMemberType"; +export * from "./GroupMembersAddResponse"; +export * from "./GroupMembersListResponse"; +export * from "./GroupMembersListResponseMember"; +export * from "./GroupMembersRemoveResponse"; +export * from "./GroupSearchSummary"; +export * from "./GroupSummary"; +export * from "./GroupType"; +export * from "./GroupedVistaFlavor"; +export * from "./GroupedVistaSummary"; +export * from "./VistaBaseSummary"; +export * from "./GroupsCreateResponse"; +export * from "./GroupsGetResponse"; +export * from "./GroupsListResponse"; +export * from "./GroupsUpdateRequestDynamicGroupInfo"; +export * from "./GroupsUpdateResponse"; +export * from "./Issue"; +export * from "./WorkBase"; +export * from "./IssuePriority"; +export * from "./IssueSummary"; +export * from "./WorkBaseSummary"; +export * from "./JobHistoryItem"; +export * from "./LegacyStage"; +export * from "./LegacyStageSummary"; +export * from "./LinesOfCode"; +export * from "./Link"; +export * from "./LinkEndpointSummary"; +export * from "./LinkEndpointType"; +export * from "./LinkRevUserToRevOrgResponse"; +export * from "./LinkSearchSummary"; +export * from "./LinkSummary"; +export * from "./LinkType"; +export * from "./LinksCreateResponse"; +export * from "./LinksDeleteResponse"; +export * from "./LinksDirection"; +export * from "./LinksGetResponse"; +export * from "./LinksListResponse"; +export * from "./ListMode"; +export * from "./MeetingSummary"; +export * from "./MemberSummary"; +export * from "./MemberType"; +export * from "./MetricDataPoint"; +export * from "./MetricDataPointDimension"; +export * from "./MetricDefinition"; +export * from "./MetricDefinitionAppliesTo"; +export * from "./MetricDefinitionMetricType"; +export * from "./MetricDefinitionStatus"; +export * from "./MetricDefinitionSummary"; +export * from "./MetricDefinitionsListResponse"; +export * from "./MetricsData"; +export * from "./ObjectMemberSearchSummary"; +export * from "./ObjectMemberSummary"; +export * from "./Opportunity"; +export * from "./OpportunityForecastCategory"; +export * from "./OpportunityPriority"; +export * from "./OpportunitySummary"; +export * from "./OrgBase"; +export * from "./OrgBaseSummary"; +export * from "./OrgEnvironment"; +export * from "./OrgSchedule"; +export * from "./OrgScheduleFragment"; +export * from "./OrgScheduleFragmentOverview"; +export * from "./OrgScheduleFragmentStatus"; +export * from "./OrgScheduleFragmentsCreateResponse"; +export * from "./OrgScheduleFragmentsGetResponse"; +export * from "./OrgScheduleFragmentsTransitionResponse"; +export * from "./OrgScheduleInterval"; +export * from "./OrgScheduleStatus"; +export * from "./OrgScheduleSummary"; +export * from "./OrgSchedulesCreateResponse"; +export * from "./OrgSchedulesGetResponse"; +export * from "./OrgSchedulesListResponse"; +export * from "./OrgSchedulesSetFutureResponse"; +export * from "./OrgSchedulesTransitionResponse"; +export * from "./OrgSchedulesUpdateResponse"; +export * from "./OrgSearchSummary"; +export * from "./OrgSummary"; +export * from "./OrgType"; +export * from "./ParentPartFilter"; +export * from "./Part"; +export * from "./PartBase"; +export * from "./PartBaseSummary"; +export * from "./PartSearchSummary"; +export * from "./PartSummary"; +export * from "./PartType"; +export * from "./PartsCreateRequest"; +export * from "./PartsCreateRequestCapability"; +export * from "./PartsCreateRequestEnhancement"; +export * from "./PartsCreateRequestFeature"; +export * from "./PartsCreateRequestProduct"; +export * from "./PartsCreateResponse"; +export * from "./PartsDeleteResponse"; +export * from "./PartsGetResponse"; +export * from "./PartsListResponse"; +export * from "./PartsUpdateRequest"; +export * from "./PartsUpdateRequestArtifacts"; +export * from "./PartsUpdateRequestCapability"; +export * from "./PartsUpdateRequestEnhancement"; +export * from "./PartsUpdateRequestFeature"; +export * from "./PartsUpdateRequestOwnedBy"; +export * from "./PartsUpdateRequestProduct"; +export * from "./PartsUpdateResponse"; +export * from "./Product"; +export * from "./ProductSummary"; +export * from "./QuestionAnswer"; +export * from "./QuestionAnswerSearchSummary"; +export * from "./QuestionAnswerStatus"; +export * from "./QuestionAnswerSummary"; +export * from "./QuestionAnswersCreateResponse"; +export * from "./QuestionAnswersGetResponse"; +export * from "./QuestionAnswersListResponse"; +export * from "./QuestionAnswersUpdateRequestAppliesToArticles"; +export * from "./QuestionAnswersUpdateRequestAppliesToParts"; +export * from "./QuestionAnswersUpdateRequestOwnedBy"; +export * from "./QuestionAnswersUpdateRequestSharedWith"; +export * from "./QuestionAnswersUpdateRequestSources"; +export * from "./QuestionAnswersUpdateRequestTags"; +export * from "./QuestionAnswersUpdateResponse"; +export * from "./Resource"; +export * from "./ResourceSummary"; +export * from "./RevOrg"; +export * from "./RevOrgSummary"; +export * from "./RevOrgsCreateResponse"; +export * from "./RevOrgsGetResponse"; +export * from "./RevOrgsListResponse"; +export * from "./RevOrgsUpdateRequestArtifacts"; +export * from "./RevOrgsUpdateResponse"; +export * from "./RevUser"; +export * from "./RevUserSummary"; +export * from "./UserBaseSummary"; +export * from "./RevUsersCreateResponse"; +export * from "./RevUsersDeleteResponse"; +export * from "./RevUsersGetResponse"; +export * from "./RevUsersListResponse"; +export * from "./RevUsersUpdateRequestArtifacts"; +export * from "./RevUsersUpdateRequestCustomSchemaFragments"; +export * from "./RevUsersUpdateResponse"; +export * from "./SchemaBoolFieldDescriptor"; +export * from "./SchemaFieldDescriptorBase"; +export * from "./SchemaBoolListFieldDescriptor"; +export * from "./SchemaCompositeFieldDescriptor"; +export * from "./SchemaCompositeListFieldDescriptor"; +export * from "./SchemaDateFieldDescriptor"; +export * from "./SchemaDateListFieldDescriptor"; +export * from "./SchemaDoubleFieldDescriptor"; +export * from "./SchemaDoubleListFieldDescriptor"; +export * from "./SchemaEnumFieldDescriptor"; +export * from "./SchemaEnumListFieldDescriptor"; +export * from "./SchemaFieldCreateViewUiMetadata"; +export * from "./SchemaFieldDescriptor"; +export * from "./SchemaFieldDescriptorArrayType"; +export * from "./SchemaFieldDescriptorArrayTypeBaseType"; +export * from "./SchemaFieldDescriptorFieldType"; +export * from "./SchemaFieldDetailViewUiMetadata"; +export * from "./SchemaFieldFilterViewUiMetadata"; +export * from "./SchemaFieldListViewUiMetadata"; +export * from "./SchemaFieldMfzMetadata"; +export * from "./SchemaFieldOasisMetadata"; +export * from "./SchemaFieldSummaryViewUiMetadata"; +export * from "./SchemaFieldUenumValue"; +export * from "./SchemaFieldUiMetadata"; +export * from "./SchemaIdFieldDescriptor"; +export * from "./SchemaIdListFieldDescriptor"; +export * from "./SchemaIntFieldDescriptor"; +export * from "./SchemaIntListFieldDescriptor"; +export * from "./SchemaRichTextFieldDescriptor"; +export * from "./SchemaRichTextListFieldDescriptor"; +export * from "./SchemaStructFieldDescriptor"; +export * from "./SchemaStructListFieldDescriptor"; +export * from "./SchemaTextFieldDescriptor"; +export * from "./SchemaTextListFieldDescriptor"; +export * from "./SchemaTimestampFieldDescriptor"; +export * from "./SchemaTimestampListFieldDescriptor"; +export * from "./SchemaTokensFieldDescriptor"; +export * from "./SchemaTokensListFieldDescriptor"; +export * from "./SchemaUenumFieldDescriptor"; +export * from "./SchemaUenumListFieldDescriptor"; +export * from "./SchemaUnknownFieldDescriptor"; +export * from "./SearchCoreResponse"; +export * from "./SearchHybridNamespace"; +export * from "./SearchHybridResponse"; +export * from "./SearchNamespace"; +export * from "./SearchResult"; +export * from "./SearchResultType"; +export * from "./SearchSortByParam"; +export * from "./SearchSortOrderParam"; +export * from "./ServiceAccount"; +export * from "./ServiceAccountSummary"; +export * from "./ServiceAccountsGetResponse"; +export * from "./SetIssueSelector"; +export * from "./SetOrgScheduleFragmentSummary"; +export * from "./SetSharedWithMembership"; +export * from "./SetSlaPolicy"; +export * from "./SetSlaSelector"; +export * from "./SetSupportMetricTarget"; +export * from "./SetTagWithValue"; +export * from "./SetWeeklyOrgSchedule"; +export * from "./SharedWithMembershipFilter"; +export * from "./Sla"; +export * from "./SlaAppliesTo"; +export * from "./SlaAssignResult"; +export * from "./SlaCompensation"; +export * from "./SlaEvaluationPeriod"; +export * from "./SlaPolicy"; +export * from "./SlaSelectorAppliesTo"; +export * from "./SlaSelectorPriority"; +export * from "./SlaSelectorSeverity"; +export * from "./SlaStatus"; +export * from "./SlaSummary"; +export * from "./SlaSummaryFilter"; +export * from "./SlaSummaryStage"; +export * from "./SlaTracker"; +export * from "./SlaTrackerSummary"; +export * from "./SlaType"; +export * from "./SlasAssignResponse"; +export * from "./SlasCreateResponse"; +export * from "./SlasFilterAppliesToOperatorType"; +export * from "./SlasGetResponse"; +export * from "./SlasListResponse"; +export * from "./SlasTransitionResponse"; +export * from "./SlasUpdateResponse"; +export * from "./SnapInVersionSummary"; +export * from "./SnapInsResourcesResponse"; +export * from "./SnapInsResourcesResponseKeyringData"; +export * from "./SnapWidget"; +export * from "./SnapWidgetNamespace"; +export * from "./SnapWidgetStatus"; +export * from "./SnapWidgetType"; +export * from "./SnapWidgetsCreateRequest"; +export * from "./SnapWidgetsCreateRequestType"; +export * from "./SnapWidgetsCreateResponse"; +export * from "./StageDiagramSummary"; +export * from "./StageFilter"; +export * from "./StageInit"; +export * from "./StageUpdate"; +export * from "./StageValidationOptionForCreate"; +export * from "./StageValidationOptionForUpdate"; +export * from "./StagedInfoFilter"; +export * from "./StockFieldOverride"; +export * from "./StockSchemaFragment"; +export * from "./StockSchemaFragmentsGetResponse"; +export * from "./StockSchemaFragmentsListRequestFilterPreset"; +export * from "./StockSchemaFragmentsListRequestPrune"; +export * from "./StockSchemaFragmentsListResponse"; +export * from "./Subtype"; +export * from "./SubtypesListResponse"; +export * from "./Survey"; +export * from "./SurveyAggregationFilter"; +export * from "./SurveyFieldWithMetadata"; +export * from "./SurveyResponse"; +export * from "./SurveysCreateResponse"; +export * from "./SurveysDeleteResponse"; +export * from "./SurveysListResponse"; +export * from "./SurveysResponsesListResponse"; +export * from "./SurveysSendRequestEmail"; +export * from "./SurveysSendResponse"; +export * from "./SurveysSubmitResponse"; +export * from "./SyncMetadataFilter"; +export * from "./SyncMetadataFilterSyncInFilter"; +export * from "./SyncMetadataFilterSyncInFilterStatus"; +export * from "./SyncMetadataFilterSyncOutFilter"; +export * from "./SyncMetadataFilterSyncOutFilterStatus"; +export * from "./SysUser"; +export * from "./SysUserSummary"; +export * from "./SysUsersListResponse"; +export * from "./SysUsersUpdateResponse"; +export * from "./Tag"; +export * from "./TagSearchSummary"; +export * from "./TagSummary"; +export * from "./TagWithValue"; +export * from "./TagWithValueFilter"; +export * from "./Task"; +export * from "./TaskPriority"; +export * from "./TaskSummary"; +export * from "./TenantFragment"; +export * from "./TenantFragmentSummary"; +export * from "./Ticket"; +export * from "./TicketChannels"; +export * from "./TicketSeverity"; +export * from "./TicketSummary"; +export * from "./TimelineComment"; +export * from "./TimelineEntryBase"; +export * from "./TimelineCommentBodyType"; +export * from "./TimelineCommentSummary"; +export * from "./TimelineEntriesCollection"; +export * from "./TimelineEntriesCreateRequest"; +export * from "./TimelineEntriesCreateRequestTimelineComment"; +export * from "./TimelineEntriesCreateRequestType"; +export * from "./TimelineEntriesCreateResponse"; +export * from "./TimelineEntriesListResponse"; +export * from "./TimelineEntriesUpdateRequest"; +export * from "./TimelineEntriesUpdateRequestTimelineComment"; +export * from "./TimelineEntriesUpdateRequestTimelineCommentArtifacts"; +export * from "./TimelineEntriesUpdateRequestTimelineCommentLinkPreviews"; +export * from "./TimelineEntriesUpdateRequestType"; +export * from "./TimelineEntriesUpdateResponse"; +export * from "./TimelineEntry"; +export * from "./TimelineEntryBaseSummary"; +export * from "./TimelineEntryObjectType"; +export * from "./TimelineEntryType"; +export * from "./TimelineEntryVisibility"; +export * from "./TimelineReaction"; +export * from "./TimelineSnapKitBody"; +export * from "./TimelineThread"; +export * from "./TrackEvent"; +export * from "./TrackEventsPublishResponse"; +export * from "./Unit"; +export * from "./UnitType"; +export * from "./UnlinkRevUserFromRevOrgResponse"; +export * from "./Uom"; +export * from "./UomMetricScope"; +export * from "./UomsCountResponse"; +export * from "./UomsCreateResponse"; +export * from "./UomsGetResponse"; +export * from "./UomsListResponse"; +export * from "./UomsUpdateRequestDimensions"; +export * from "./UomsUpdateResponse"; +export * from "./UserBase"; +export * from "./UserSearchSummary"; +export * from "./UserSkill"; +export * from "./UserState"; +export * from "./UserSummary"; +export * from "./UserType"; +export * from "./VistaGroupItemState"; +export * from "./VistaGroupItemSummary"; +export * from "./VistaGroupItemType"; +export * from "./VistaSearchSummary"; +export * from "./VistaSummary"; +export * from "./VistaType"; +export * from "./Webhook"; +export * from "./WebhookEventRequest"; +export * from "./WebhookEventResponse"; +export * from "./WebhookEventType"; +export * from "./WebhookEventVerify"; +export * from "./WebhookStatus"; +export * from "./WebhookSummary"; +export * from "./WeeklyOrgSchedule"; +export * from "./Work"; +export * from "./WorkSearchSummary"; +export * from "./WorkSummary"; +export * from "./WorkType"; +export * from "./WorksCreateRequest"; +export * from "./WorksCreateRequestIssue"; +export * from "./WorksCreateRequestOpportunity"; +export * from "./WorksCreateRequestTask"; +export * from "./WorksCreateRequestTicket"; +export * from "./WorksCreateResponse"; +export * from "./WorksDeleteResponse"; +export * from "./WorksExportResponse"; +export * from "./WorksFilterIssue"; +export * from "./WorksFilterOpportunity"; +export * from "./WorksFilterTicket"; +export * from "./WorksGetResponse"; +export * from "./WorksListResponse"; +export * from "./WorksUpdateRequest"; +export * from "./WorksUpdateRequestArtifacts"; +export * from "./WorksUpdateRequestIssue"; +export * from "./WorksUpdateRequestIssueDevelopedWith"; +export * from "./WorksUpdateRequestOpportunity"; +export * from "./WorksUpdateRequestOpportunityContacts"; +export * from "./WorksUpdateRequestOwnedBy"; +export * from "./WorksUpdateRequestReportedBy"; +export * from "./WorksUpdateRequestStagedInfoStagedInfoUpdate"; +export * from "./WorksUpdateRequestTags"; +export * from "./WorksUpdateRequestTask"; +export * from "./WorksUpdateRequestTicket"; +export * from "./WorksUpdateRequestTicketChannels"; +export * from "./WorksUpdateResponse"; diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts new file mode 100644 index 0000000..146df21 --- /dev/null +++ b/src/core/auth/BasicAuth.ts @@ -0,0 +1,31 @@ +import { Base64 } from "js-base64"; + +export interface BasicAuth { + username: string; + password: string; +} + +const BASIC_AUTH_HEADER_PREFIX = /^Basic /i; + +export const BasicAuth = { + toAuthorizationHeader: (basicAuth: BasicAuth | undefined): string | undefined => { + if (basicAuth == null) { + return undefined; + } + const token = Base64.encode(`${basicAuth.username}:${basicAuth.password}`); + return `Basic ${token}`; + }, + fromAuthorizationHeader: (header: string): BasicAuth => { + const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); + const decoded = Base64.decode(credentials); + const [username, password] = decoded.split(":", 2); + + if (username == null || password == null) { + throw new Error("Invalid basic auth"); + } + return { + username, + password, + }; + }, +}; diff --git a/src/core/auth/BearerToken.ts b/src/core/auth/BearerToken.ts new file mode 100644 index 0000000..fe987fc --- /dev/null +++ b/src/core/auth/BearerToken.ts @@ -0,0 +1,15 @@ +export type BearerToken = string; + +const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i; + +export const BearerToken = { + toAuthorizationHeader: (token: BearerToken | undefined): string | undefined => { + if (token == null) { + return undefined; + } + return `Bearer ${token}`; + }, + fromAuthorizationHeader: (header: string): BearerToken => { + return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim() as BearerToken; + }, +}; diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts new file mode 100644 index 0000000..ee293b3 --- /dev/null +++ b/src/core/auth/index.ts @@ -0,0 +1,2 @@ +export { BasicAuth } from "./BasicAuth"; +export { BearerToken } from "./BearerToken"; diff --git a/src/core/fetcher/APIResponse.ts b/src/core/fetcher/APIResponse.ts new file mode 100644 index 0000000..3664d09 --- /dev/null +++ b/src/core/fetcher/APIResponse.ts @@ -0,0 +1,12 @@ +export type APIResponse = SuccessfulResponse | FailedResponse; + +export interface SuccessfulResponse { + ok: true; + body: T; + headers?: Record; +} + +export interface FailedResponse { + ok: false; + error: T; +} diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts new file mode 100644 index 0000000..02af7dc --- /dev/null +++ b/src/core/fetcher/Fetcher.ts @@ -0,0 +1,147 @@ +import { APIResponse } from "./APIResponse"; +import { createRequestUrl } from "./createRequestUrl"; +import { getFetchFn } from "./getFetchFn"; +import { getRequestBody } from "./getRequestBody"; +import { getResponseBody } from "./getResponseBody"; +import { makeRequest } from "./makeRequest"; +import { requestWithRetries } from "./requestWithRetries"; + +export type FetchFunction = (args: Fetcher.Args) => Promise>; + +export declare namespace Fetcher { + export interface Args { + url: string; + method: string; + contentType?: string; + headers?: Record; + queryParameters?: Record; + body?: unknown; + timeoutMs?: number; + maxRetries?: number; + withCredentials?: boolean; + abortSignal?: AbortSignal; + requestType?: "json" | "file" | "bytes"; + responseType?: "json" | "blob" | "streaming" | "text"; + duplex?: "half"; + } + + export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; + + export interface FailedStatusCodeError { + reason: "status-code"; + statusCode: number; + body: unknown; + } + + export interface NonJsonError { + reason: "non-json"; + statusCode: number; + rawBody: string; + } + + export interface TimeoutError { + reason: "timeout"; + } + + export interface UnknownError { + reason: "unknown"; + errorMessage: string; + } +} + +export async function fetcherImpl(args: Fetcher.Args): Promise> { + const headers: Record = {}; + if (args.body !== undefined && args.contentType != null) { + headers["Content-Type"] = args.contentType; + } + + if (args.headers != null) { + for (const [key, value] of Object.entries(args.headers)) { + if (value != null) { + headers[key] = value; + } + } + } + + const url = createRequestUrl(args.url, args.queryParameters); + let requestBody: BodyInit | undefined = await getRequestBody({ + body: args.body, + type: args.requestType === "json" ? "json" : "other", + }); + const fetchFn = await getFetchFn(); + + try { + const response = await requestWithRetries( + async () => + makeRequest( + fetchFn, + url, + args.method, + headers, + requestBody, + args.timeoutMs, + args.abortSignal, + args.withCredentials, + args.duplex + ), + args.maxRetries + ); + let responseBody = await getResponseBody(response, args.responseType); + + if (response.status >= 200 && response.status < 400) { + if (args.duplex && args.responseType === "streaming") { + responseBody = (await import("stream")).Readable.from(responseBody as any); + } + + return { + ok: true, + body: responseBody as R, + headers: response.headers, + }; + } else { + return { + ok: false, + error: { + reason: "status-code", + statusCode: response.status, + body: responseBody, + }, + }; + } + } catch (error) { + if (args.abortSignal != null && args.abortSignal.aborted) { + return { + ok: false, + error: { + reason: "unknown", + errorMessage: "The user aborted a request", + }, + }; + } else if (error instanceof Error && error.name === "AbortError") { + return { + ok: false, + error: { + reason: "timeout", + }, + }; + } else if (error instanceof Error) { + return { + ok: false, + error: { + reason: "unknown", + errorMessage: error.message, + }, + }; + } + + return { + ok: false, + error: { + reason: "unknown", + errorMessage: JSON.stringify(error), + }, + }; + } +} + +export const fetcher: FetchFunction = fetcherImpl; diff --git a/src/core/fetcher/Supplier.ts b/src/core/fetcher/Supplier.ts new file mode 100644 index 0000000..867c931 --- /dev/null +++ b/src/core/fetcher/Supplier.ts @@ -0,0 +1,11 @@ +export type Supplier = T | Promise | (() => T | Promise); + +export const Supplier = { + get: async (supplier: Supplier): Promise => { + if (typeof supplier === "function") { + return (supplier as () => T)(); + } else { + return supplier; + } + }, +}; diff --git a/src/core/fetcher/createRequestUrl.ts b/src/core/fetcher/createRequestUrl.ts new file mode 100644 index 0000000..9288a99 --- /dev/null +++ b/src/core/fetcher/createRequestUrl.ts @@ -0,0 +1,10 @@ +import qs from "qs"; + +export function createRequestUrl( + baseUrl: string, + queryParameters?: Record +): string { + return Object.keys(queryParameters ?? {}).length > 0 + ? `${baseUrl}?${qs.stringify(queryParameters, { arrayFormat: "repeat" })}` + : baseUrl; +} diff --git a/src/core/fetcher/getFetchFn.ts b/src/core/fetcher/getFetchFn.ts new file mode 100644 index 0000000..9fd9bfc --- /dev/null +++ b/src/core/fetcher/getFetchFn.ts @@ -0,0 +1,25 @@ +import { RUNTIME } from "../runtime"; + +/** + * Returns a fetch function based on the runtime + */ +export async function getFetchFn(): Promise { + // In Node.js 18+ environments, use native fetch + if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { + return fetch; + } + + // In Node.js 18 or lower environments, the SDK always uses`node-fetch`. + if (RUNTIME.type === "node") { + return (await import("node-fetch")).default as any; + } + + // Otherwise the SDK uses global fetch if available, + // and falls back to node-fetch. + if (typeof fetch == "function") { + return fetch; + } + + // Defaults to node `node-fetch` if global fetch isn't available + return (await import("node-fetch")).default as any; +} diff --git a/src/core/fetcher/getHeader.ts b/src/core/fetcher/getHeader.ts new file mode 100644 index 0000000..50f922b --- /dev/null +++ b/src/core/fetcher/getHeader.ts @@ -0,0 +1,8 @@ +export function getHeader(headers: Record, header: string): string | undefined { + for (const [headerKey, headerValue] of Object.entries(headers)) { + if (headerKey.toLowerCase() === header.toLowerCase()) { + return headerValue; + } + } + return undefined; +} diff --git a/src/core/fetcher/getRequestBody.ts b/src/core/fetcher/getRequestBody.ts new file mode 100644 index 0000000..1138414 --- /dev/null +++ b/src/core/fetcher/getRequestBody.ts @@ -0,0 +1,14 @@ +export declare namespace GetRequestBody { + interface Args { + body: unknown; + type: "json" | "file" | "bytes" | "other"; + } +} + +export async function getRequestBody({ body, type }: GetRequestBody.Args): Promise { + if (type.includes("json")) { + return JSON.stringify(body); + } else { + return body as BodyInit; + } +} diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts new file mode 100644 index 0000000..2015356 --- /dev/null +++ b/src/core/fetcher/getResponseBody.ts @@ -0,0 +1,28 @@ +export async function getResponseBody(response: Response, responseType?: string): Promise { + if (response.body != null && responseType === "blob") { + return await response.blob(); + } else if (response.body != null && responseType === "streaming") { + return response.body; + } else if (response.body != null && responseType === "text") { + return await response.text(); + } else { + const text = await response.text(); + if (text.length > 0) { + try { + let responseBody = JSON.parse(text); + return responseBody; + } catch (err) { + return { + ok: false, + error: { + reason: "non-json", + statusCode: response.status, + rawBody: text, + }, + }; + } + } else { + return undefined; + } + } +} diff --git a/src/core/fetcher/index.ts b/src/core/fetcher/index.ts new file mode 100644 index 0000000..2d658ca --- /dev/null +++ b/src/core/fetcher/index.ts @@ -0,0 +1,5 @@ +export type { APIResponse } from "./APIResponse"; +export { fetcher } from "./Fetcher"; +export type { Fetcher, FetchFunction } from "./Fetcher"; +export { getHeader } from "./getHeader"; +export { Supplier } from "./Supplier"; diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts new file mode 100644 index 0000000..8fb4bac --- /dev/null +++ b/src/core/fetcher/makeRequest.ts @@ -0,0 +1,44 @@ +import { anySignal, getTimeoutSignal } from "./signals"; + +export const makeRequest = async ( + fetchFn: (url: string, init: RequestInit) => Promise, + url: string, + method: string, + headers: Record, + requestBody: BodyInit | undefined, + timeoutMs?: number, + abortSignal?: AbortSignal, + withCredentials?: boolean, + duplex?: "half" +): Promise => { + const signals: AbortSignal[] = []; + + // Add timeout signal + let timeoutAbortId: NodeJS.Timeout | undefined = undefined; + if (timeoutMs != null) { + const { signal, abortId } = getTimeoutSignal(timeoutMs); + timeoutAbortId = abortId; + signals.push(signal); + } + + // Add arbitrary signal + if (abortSignal != null) { + signals.push(abortSignal); + } + let newSignals = anySignal(signals); + const response = await fetchFn(url, { + method: method, + headers, + body: requestBody, + signal: newSignals, + credentials: withCredentials ? "include" : undefined, + // @ts-ignore + duplex, + }); + + if (timeoutAbortId != null) { + clearTimeout(timeoutAbortId); + } + + return response; +}; diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts new file mode 100644 index 0000000..ff5dc3b --- /dev/null +++ b/src/core/fetcher/requestWithRetries.ts @@ -0,0 +1,21 @@ +const INITIAL_RETRY_DELAY = 1; +const MAX_RETRY_DELAY = 60; +const DEFAULT_MAX_RETRIES = 2; + +export async function requestWithRetries( + requestFn: () => Promise, + maxRetries: number = DEFAULT_MAX_RETRIES +): Promise { + let response: Response = await requestFn(); + + for (let i = 0; i < maxRetries; ++i) { + if ([408, 409, 429].includes(response.status) || response.status >= 500) { + const delay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); + await new Promise((resolve) => setTimeout(resolve, delay)); + response = await requestFn(); + } else { + break; + } + } + return response!; +} diff --git a/src/core/fetcher/signals.ts b/src/core/fetcher/signals.ts new file mode 100644 index 0000000..6c124ff --- /dev/null +++ b/src/core/fetcher/signals.ts @@ -0,0 +1,38 @@ +const TIMEOUT = "timeout"; + +export function getTimeoutSignal(timeoutMs: number): { signal: AbortSignal; abortId: NodeJS.Timeout } { + const controller = new AbortController(); + const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs); + return { signal: controller.signal, abortId }; +} + +/** + * Returns an abort signal that is getting aborted when + * at least one of the specified abort signals is aborted. + * + * Requires at least node.js 18. + */ +export function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal { + // Allowing signals to be passed either as array + // of signals or as multiple arguments. + const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args); + + const controller = new AbortController(); + + for (const signal of signals) { + if (signal.aborted) { + // Exiting early if one of the signals + // is already aborted. + controller.abort((signal as any)?.reason); + break; + } + + // Listening for signals and removing the listeners + // when at least one symbol is aborted. + signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), { + signal: controller.signal, + }); + } + + return controller.signal; +} diff --git a/src/core/index.ts b/src/core/index.ts new file mode 100644 index 0000000..2d20c46 --- /dev/null +++ b/src/core/index.ts @@ -0,0 +1,4 @@ +export * from "./fetcher"; +export * from "./auth"; +export * from "./runtime"; +export * as serialization from "./schemas"; diff --git a/src/core/runtime/index.ts b/src/core/runtime/index.ts new file mode 100644 index 0000000..5c76dbb --- /dev/null +++ b/src/core/runtime/index.ts @@ -0,0 +1 @@ +export { RUNTIME } from "./runtime"; diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts new file mode 100644 index 0000000..4d0687e --- /dev/null +++ b/src/core/runtime/runtime.ts @@ -0,0 +1,126 @@ +interface DenoGlobal { + version: { + deno: string; + }; +} + +interface BunGlobal { + version: string; +} + +declare const Deno: DenoGlobal; +declare const Bun: BunGlobal; + +/** + * A constant that indicates whether the environment the code is running is a Web Browser. + */ +const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + +/** + * A constant that indicates whether the environment the code is running is a Web Worker. + */ +const isWebWorker = + typeof self === "object" && + // @ts-ignore + typeof self?.importScripts === "function" && + (self.constructor?.name === "DedicatedWorkerGlobalScope" || + self.constructor?.name === "ServiceWorkerGlobalScope" || + self.constructor?.name === "SharedWorkerGlobalScope"); + +/** + * A constant that indicates whether the environment the code is running is Deno. + */ +const isDeno = + typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; + +/** + * A constant that indicates whether the environment the code is running is Bun.sh. + */ +const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; + +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +const isNode = + typeof process !== "undefined" && + Boolean(process.version) && + Boolean(process.versions?.node) && + // Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions + !isDeno && + !isBun; + +/** + * A constant that indicates whether the environment the code is running is in React-Native. + * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js + */ +const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; + +/** + * A constant that indicates whether the environment the code is running is Cloudflare. + * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent + */ +const isCloudflare = typeof globalThis !== "undefined" && globalThis?.navigator?.userAgent === "Cloudflare-Workers"; + +/** + * A constant that indicates which environment and version the SDK is running in. + */ +export const RUNTIME: Runtime = evaluateRuntime(); + +export interface Runtime { + type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd"; + version?: string; + parsedVersion?: number; +} + +function evaluateRuntime(): Runtime { + if (isBrowser) { + return { + type: "browser", + version: window.navigator.userAgent, + }; + } + + if (isCloudflare) { + return { + type: "workerd", + }; + } + + if (isWebWorker) { + return { + type: "web-worker", + }; + } + + if (isDeno) { + return { + type: "deno", + version: Deno.version.deno, + }; + } + + if (isBun) { + return { + type: "bun", + version: Bun.version, + }; + } + + if (isNode) { + return { + type: "node", + version: process.versions.node, + parsedVersion: Number(process.versions.node.split(".")[0]), + }; + } + + if (isReactNative) { + return { + type: "react-native", + }; + } + + return { + type: "unknown", + }; +} diff --git a/src/core/schemas/Schema.ts b/src/core/schemas/Schema.ts new file mode 100644 index 0000000..19acc5d --- /dev/null +++ b/src/core/schemas/Schema.ts @@ -0,0 +1,98 @@ +import { SchemaUtils } from "./builders"; + +export type Schema = BaseSchema & SchemaUtils; + +export type inferRaw = S extends Schema ? Raw : never; +export type inferParsed = S extends Schema ? Parsed : never; + +export interface BaseSchema { + parse: (raw: unknown, opts?: SchemaOptions) => MaybeValid; + json: (parsed: unknown, opts?: SchemaOptions) => MaybeValid; + getType: () => SchemaType | SchemaType; +} + +export const SchemaType = { + DATE: "date", + ENUM: "enum", + LIST: "list", + STRING_LITERAL: "stringLiteral", + BOOLEAN_LITERAL: "booleanLiteral", + OBJECT: "object", + ANY: "any", + BOOLEAN: "boolean", + NUMBER: "number", + STRING: "string", + UNKNOWN: "unknown", + RECORD: "record", + SET: "set", + UNION: "union", + UNDISCRIMINATED_UNION: "undiscriminatedUnion", + OPTIONAL: "optional", +} as const; +export type SchemaType = typeof SchemaType[keyof typeof SchemaType]; + +export type MaybeValid = Valid | Invalid; + +export interface Valid { + ok: true; + value: T; +} + +export interface Invalid { + ok: false; + errors: ValidationError[]; +} + +export interface ValidationError { + path: string[]; + message: string; +} + +export interface SchemaOptions { + /** + * how to handle unrecognized keys in objects + * + * @default "fail" + */ + unrecognizedObjectKeys?: "fail" | "passthrough" | "strip"; + + /** + * whether to fail when an unrecognized discriminant value is + * encountered in a union + * + * @default false + */ + allowUnrecognizedUnionMembers?: boolean; + + /** + * whether to fail when an unrecognized enum value is encountered + * + * @default false + */ + allowUnrecognizedEnumValues?: boolean; + + /** + * whether to allow data that doesn't conform to the schema. + * invalid data is passed through without transformation. + * + * when this is enabled, .parse() and .json() will always + * return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()` + * will never fail. + * + * @default false + */ + skipValidation?: boolean; + + /** + * each validation failure contains a "path" property, which is + * the breadcrumbs to the offending node in the JSON. you can supply + * a prefix that is prepended to all the errors' paths. this can be + * helpful for zurg's internal debug logging. + */ + breadcrumbsPrefix?: string[]; + + /** + * whether to send 'null' for optional properties explicitly set to 'undefined'. + */ + omitUndefined?: boolean; +} diff --git a/src/core/schemas/builders/date/date.ts b/src/core/schemas/builders/date/date.ts new file mode 100644 index 0000000..b70f24b --- /dev/null +++ b/src/core/schemas/builders/date/date.ts @@ -0,0 +1,65 @@ +import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; + +// https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime +const ISO_8601_REGEX = + /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; + +export function date(): Schema { + const baseSchema: BaseSchema = { + parse: (raw, { breadcrumbsPrefix = [] } = {}) => { + if (typeof raw !== "string") { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(raw, "string"), + }, + ], + }; + } + if (!ISO_8601_REGEX.test(raw)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(raw, "ISO 8601 date string"), + }, + ], + }; + } + return { + ok: true, + value: new Date(raw), + }; + }, + json: (date, { breadcrumbsPrefix = [] } = {}) => { + if (date instanceof Date) { + return { + ok: true, + value: date.toISOString(), + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(date, "Date object"), + }, + ], + }; + } + }, + getType: () => SchemaType.DATE, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} diff --git a/src/core/schemas/builders/date/index.ts b/src/core/schemas/builders/date/index.ts new file mode 100644 index 0000000..187b290 --- /dev/null +++ b/src/core/schemas/builders/date/index.ts @@ -0,0 +1 @@ +export { date } from "./date"; diff --git a/src/core/schemas/builders/enum/enum.ts b/src/core/schemas/builders/enum/enum.ts new file mode 100644 index 0000000..c1e24d6 --- /dev/null +++ b/src/core/schemas/builders/enum/enum.ts @@ -0,0 +1,43 @@ +import { Schema, SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export function enum_(values: E): Schema { + const validValues = new Set(values); + + const schemaCreator = createIdentitySchemaCreator( + SchemaType.ENUM, + (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => { + if (typeof value !== "string") { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "string"), + }, + ], + }; + } + + if (!validValues.has(value) && !allowUnrecognizedEnumValues) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "enum"), + }, + ], + }; + } + + return { + ok: true, + value: value as U, + }; + } + ); + + return schemaCreator(); +} diff --git a/src/core/schemas/builders/enum/index.ts b/src/core/schemas/builders/enum/index.ts new file mode 100644 index 0000000..fe6faed --- /dev/null +++ b/src/core/schemas/builders/enum/index.ts @@ -0,0 +1 @@ +export { enum_ } from "./enum"; diff --git a/src/core/schemas/builders/index.ts b/src/core/schemas/builders/index.ts new file mode 100644 index 0000000..050cd2c --- /dev/null +++ b/src/core/schemas/builders/index.ts @@ -0,0 +1,13 @@ +export * from "./date"; +export * from "./enum"; +export * from "./lazy"; +export * from "./list"; +export * from "./literals"; +export * from "./object"; +export * from "./object-like"; +export * from "./primitives"; +export * from "./record"; +export * from "./schema-utils"; +export * from "./set"; +export * from "./undiscriminated-union"; +export * from "./union"; diff --git a/src/core/schemas/builders/lazy/index.ts b/src/core/schemas/builders/lazy/index.ts new file mode 100644 index 0000000..77420fb --- /dev/null +++ b/src/core/schemas/builders/lazy/index.ts @@ -0,0 +1,3 @@ +export { lazy } from "./lazy"; +export type { SchemaGetter } from "./lazy"; +export { lazyObject } from "./lazyObject"; diff --git a/src/core/schemas/builders/lazy/lazy.ts b/src/core/schemas/builders/lazy/lazy.ts new file mode 100644 index 0000000..835c61f --- /dev/null +++ b/src/core/schemas/builders/lazy/lazy.ts @@ -0,0 +1,32 @@ +import { BaseSchema, Schema } from "../../Schema"; +import { getSchemaUtils } from "../schema-utils"; + +export type SchemaGetter> = () => SchemaType; + +export function lazy(getter: SchemaGetter>): Schema { + const baseSchema = constructLazyBaseSchema(getter); + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + }; +} + +export function constructLazyBaseSchema( + getter: SchemaGetter> +): BaseSchema { + return { + parse: (raw, opts) => getMemoizedSchema(getter).parse(raw, opts), + json: (parsed, opts) => getMemoizedSchema(getter).json(parsed, opts), + getType: () => getMemoizedSchema(getter).getType(), + }; +} + +type MemoizedGetter> = SchemaGetter & { __zurg_memoized?: SchemaType }; + +export function getMemoizedSchema>(getter: SchemaGetter): SchemaType { + const castedGetter = getter as MemoizedGetter; + if (castedGetter.__zurg_memoized == null) { + castedGetter.__zurg_memoized = getter(); + } + return castedGetter.__zurg_memoized; +} diff --git a/src/core/schemas/builders/lazy/lazyObject.ts b/src/core/schemas/builders/lazy/lazyObject.ts new file mode 100644 index 0000000..38c9e28 --- /dev/null +++ b/src/core/schemas/builders/lazy/lazyObject.ts @@ -0,0 +1,20 @@ +import { getObjectUtils } from "../object"; +import { getObjectLikeUtils } from "../object-like"; +import { BaseObjectSchema, ObjectSchema } from "../object/types"; +import { getSchemaUtils } from "../schema-utils"; +import { constructLazyBaseSchema, getMemoizedSchema, SchemaGetter } from "./lazy"; + +export function lazyObject(getter: SchemaGetter>): ObjectSchema { + const baseSchema: BaseObjectSchema = { + ...constructLazyBaseSchema(getter), + _getRawProperties: () => getMemoizedSchema(getter)._getRawProperties(), + _getParsedProperties: () => getMemoizedSchema(getter)._getParsedProperties(), + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + ...getObjectUtils(baseSchema), + }; +} diff --git a/src/core/schemas/builders/list/index.ts b/src/core/schemas/builders/list/index.ts new file mode 100644 index 0000000..25f4bcc --- /dev/null +++ b/src/core/schemas/builders/list/index.ts @@ -0,0 +1 @@ +export { list } from "./list"; diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts new file mode 100644 index 0000000..e4c5c4a --- /dev/null +++ b/src/core/schemas/builders/list/list.ts @@ -0,0 +1,73 @@ +import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; + +export function list(schema: Schema): Schema { + const baseSchema: BaseSchema = { + parse: (raw, opts) => + validateAndTransformArray(raw, (item, index) => + schema.parse(item, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], + }) + ), + json: (parsed, opts) => + validateAndTransformArray(parsed, (item, index) => + schema.json(item, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], + }) + ), + getType: () => SchemaType.LIST, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + +function validateAndTransformArray( + value: unknown, + transformItem: (item: Raw, index: number) => MaybeValid +): MaybeValid { + if (!Array.isArray(value)) { + return { + ok: false, + errors: [ + { + message: getErrorMessageForIncorrectType(value, "list"), + path: [], + }, + ], + }; + } + + const maybeValidItems = value.map((item, index) => transformItem(item, index)); + + return maybeValidItems.reduce>( + (acc, item) => { + if (acc.ok && item.ok) { + return { + ok: true, + value: [...acc.value, item.value], + }; + } + + const errors: ValidationError[] = []; + if (!acc.ok) { + errors.push(...acc.errors); + } + if (!item.ok) { + errors.push(...item.errors); + } + + return { + ok: false, + errors, + }; + }, + { ok: true, value: [] } + ); +} diff --git a/src/core/schemas/builders/literals/booleanLiteral.ts b/src/core/schemas/builders/literals/booleanLiteral.ts new file mode 100644 index 0000000..a83d22c --- /dev/null +++ b/src/core/schemas/builders/literals/booleanLiteral.ts @@ -0,0 +1,29 @@ +import { Schema, SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export function booleanLiteral(literal: V): Schema { + const schemaCreator = createIdentitySchemaCreator( + SchemaType.BOOLEAN_LITERAL, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (value === literal) { + return { + ok: true, + value: literal, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, `${literal.toString()}`), + }, + ], + }; + } + } + ); + + return schemaCreator(); +} diff --git a/src/core/schemas/builders/literals/index.ts b/src/core/schemas/builders/literals/index.ts new file mode 100644 index 0000000..d2bf08f --- /dev/null +++ b/src/core/schemas/builders/literals/index.ts @@ -0,0 +1,2 @@ +export { stringLiteral } from "./stringLiteral"; +export { booleanLiteral } from "./booleanLiteral"; diff --git a/src/core/schemas/builders/literals/stringLiteral.ts b/src/core/schemas/builders/literals/stringLiteral.ts new file mode 100644 index 0000000..3939b76 --- /dev/null +++ b/src/core/schemas/builders/literals/stringLiteral.ts @@ -0,0 +1,29 @@ +import { Schema, SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export function stringLiteral(literal: V): Schema { + const schemaCreator = createIdentitySchemaCreator( + SchemaType.STRING_LITERAL, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (value === literal) { + return { + ok: true, + value: literal, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, `"${literal}"`), + }, + ], + }; + } + } + ); + + return schemaCreator(); +} diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts new file mode 100644 index 0000000..8331d08 --- /dev/null +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -0,0 +1,79 @@ +import { BaseSchema } from "../../Schema"; +import { filterObject } from "../../utils/filterObject"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { getSchemaUtils } from "../schema-utils"; +import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; + +export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { + return { + withParsedProperties: (properties) => withParsedProperties(schema, properties), + }; +} + +/** + * object-like utils are defined in one file to resolve issues with circular imports + */ + +export function withParsedProperties( + objectLike: BaseSchema, + properties: { [K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]) } +): ObjectLikeSchema { + const objectSchema: BaseSchema = { + parse: (raw, opts) => { + const parsedObject = objectLike.parse(raw, opts); + if (!parsedObject.ok) { + return parsedObject; + } + + const additionalProperties = Object.entries(properties).reduce>( + (processed, [key, value]) => { + return { + ...processed, + [key]: typeof value === "function" ? value(parsedObject.value) : value, + }; + }, + {} + ); + + return { + ok: true, + value: { + ...parsedObject.value, + ...(additionalProperties as Properties), + }, + }; + }, + + json: (parsed, opts) => { + if (!isPlainObject(parsed)) { + return { + ok: false, + errors: [ + { + path: opts?.breadcrumbsPrefix ?? [], + message: getErrorMessageForIncorrectType(parsed, "object"), + }, + ], + }; + } + + // strip out added properties + const addedPropertyKeys = new Set(Object.keys(properties)); + const parsedWithoutAddedProperties = filterObject( + parsed, + Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key)) + ); + + return objectLike.json(parsedWithoutAddedProperties as ParsedObjectShape, opts); + }, + + getType: () => objectLike.getType(), + }; + + return { + ...objectSchema, + ...getSchemaUtils(objectSchema), + ...getObjectLikeUtils(objectSchema), + }; +} diff --git a/src/core/schemas/builders/object-like/index.ts b/src/core/schemas/builders/object-like/index.ts new file mode 100644 index 0000000..c342e72 --- /dev/null +++ b/src/core/schemas/builders/object-like/index.ts @@ -0,0 +1,2 @@ +export { getObjectLikeUtils, withParsedProperties } from "./getObjectLikeUtils"; +export type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; diff --git a/src/core/schemas/builders/object-like/types.ts b/src/core/schemas/builders/object-like/types.ts new file mode 100644 index 0000000..75b3698 --- /dev/null +++ b/src/core/schemas/builders/object-like/types.ts @@ -0,0 +1,11 @@ +import { BaseSchema, Schema } from "../../Schema"; + +export type ObjectLikeSchema = Schema & + BaseSchema & + ObjectLikeUtils; + +export interface ObjectLikeUtils { + withParsedProperties: >(properties: { + [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); + }) => ObjectLikeSchema; +} diff --git a/src/core/schemas/builders/object/index.ts b/src/core/schemas/builders/object/index.ts new file mode 100644 index 0000000..e3f4388 --- /dev/null +++ b/src/core/schemas/builders/object/index.ts @@ -0,0 +1,22 @@ +export { getObjectUtils, object } from "./object"; +export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; +export type { + inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, + inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, +} from "./objectWithoutOptionalProperties"; +export { isProperty, property } from "./property"; +export type { Property } from "./property"; +export type { + BaseObjectSchema, + inferObjectSchemaFromPropertySchemas, + inferParsedObject, + inferParsedObjectFromPropertySchemas, + inferParsedPropertySchema, + inferRawKey, + inferRawObject, + inferRawObjectFromPropertySchemas, + inferRawPropertySchema, + ObjectSchema, + ObjectUtils, + PropertySchemas, +} from "./types"; diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts new file mode 100644 index 0000000..e00136d --- /dev/null +++ b/src/core/schemas/builders/object/object.ts @@ -0,0 +1,324 @@ +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { entries } from "../../utils/entries"; +import { filterObject } from "../../utils/filterObject"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { keys } from "../../utils/keys"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { partition } from "../../utils/partition"; +import { getObjectLikeUtils } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; +import { isProperty } from "./property"; +import { + BaseObjectSchema, + inferObjectSchemaFromPropertySchemas, + inferParsedObjectFromPropertySchemas, + inferRawObjectFromPropertySchemas, + ObjectSchema, + ObjectUtils, + PropertySchemas, +} from "./types"; + +interface ObjectPropertyWithRawKey { + rawKey: string; + parsedKey: string; + valueSchema: Schema; +} + +export function object>( + schemas: T +): inferObjectSchemaFromPropertySchemas { + const baseSchema: BaseObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectFromPropertySchemas + > = { + _getRawProperties: () => + Object.entries(schemas).map(([parsedKey, propertySchema]) => + isProperty(propertySchema) ? propertySchema.rawKey : parsedKey + ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], + _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], + + parse: (raw, opts) => { + const rawKeyToProperty: Record = {}; + const requiredKeys: string[] = []; + + for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { + const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; + const valueSchema: Schema = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.valueSchema + : schemaOrObjectProperty; + + const property: ObjectPropertyWithRawKey = { + rawKey, + parsedKey: parsedKey as string, + valueSchema, + }; + + rawKeyToProperty[rawKey] = property; + + if (isSchemaRequired(valueSchema)) { + requiredKeys.push(rawKey); + } + } + + return validateAndTransformObject({ + value: raw, + requiredKeys, + getProperty: (rawKey) => { + const property = rawKeyToProperty[rawKey]; + if (property == null) { + return undefined; + } + return { + transformedKey: property.parsedKey, + transform: (propertyValue) => + property.valueSchema.parse(propertyValue, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], + }), + }; + }, + unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, + skipValidation: opts?.skipValidation, + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + omitUndefined: opts?.omitUndefined, + }); + }, + + json: (parsed, opts) => { + const requiredKeys: string[] = []; + + for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { + const valueSchema: Schema = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.valueSchema + : schemaOrObjectProperty; + + if (isSchemaRequired(valueSchema)) { + requiredKeys.push(parsedKey as string); + } + } + + return validateAndTransformObject({ + value: parsed, + requiredKeys, + getProperty: ( + parsedKey + ): { transformedKey: string; transform: (propertyValue: unknown) => MaybeValid } | undefined => { + const property = schemas[parsedKey as keyof T]; + + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (property == null) { + return undefined; + } + + if (isProperty(property)) { + return { + transformedKey: property.rawKey, + transform: (propertyValue) => + property.valueSchema.json(propertyValue, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], + }), + }; + } else { + return { + transformedKey: parsedKey, + transform: (propertyValue) => + property.json(propertyValue, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], + }), + }; + } + }, + unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, + skipValidation: opts?.skipValidation, + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + omitUndefined: opts?.omitUndefined, + }); + }, + + getType: () => SchemaType.OBJECT, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + ...getObjectUtils(baseSchema), + }; +} + +function validateAndTransformObject({ + value, + requiredKeys, + getProperty, + unrecognizedObjectKeys = "fail", + skipValidation = false, + breadcrumbsPrefix = [], +}: { + value: unknown; + requiredKeys: string[]; + getProperty: ( + preTransformedKey: string + ) => { transformedKey: string; transform: (propertyValue: unknown) => MaybeValid } | undefined; + unrecognizedObjectKeys: "fail" | "passthrough" | "strip" | undefined; + skipValidation: boolean | undefined; + breadcrumbsPrefix: string[] | undefined; + omitUndefined: boolean | undefined; +}): MaybeValid { + if (!isPlainObject(value)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "object"), + }, + ], + }; + } + + const missingRequiredKeys = new Set(requiredKeys); + const errors: ValidationError[] = []; + const transformed: Record = {}; + + for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { + const property = getProperty(preTransformedKey); + + if (property != null) { + missingRequiredKeys.delete(preTransformedKey); + + const value = property.transform(preTransformedItemValue); + if (value.ok) { + transformed[property.transformedKey] = value.value; + } else { + transformed[preTransformedKey] = preTransformedItemValue; + errors.push(...value.errors); + } + } else { + switch (unrecognizedObjectKeys) { + case "fail": + errors.push({ + path: [...breadcrumbsPrefix, preTransformedKey], + message: `Unexpected key "${preTransformedKey}"`, + }); + break; + case "strip": + break; + case "passthrough": + transformed[preTransformedKey] = preTransformedItemValue; + break; + } + } + } + + errors.push( + ...requiredKeys + .filter((key) => missingRequiredKeys.has(key)) + .map((key) => ({ + path: breadcrumbsPrefix, + message: `Missing required key "${key}"`, + })) + ); + + if (errors.length === 0 || skipValidation) { + return { + ok: true, + value: transformed as Transformed, + }; + } else { + return { + ok: false, + errors, + }; + } +} + +export function getObjectUtils(schema: BaseObjectSchema): ObjectUtils { + return { + extend: (extension: ObjectSchema) => { + const baseSchema: BaseObjectSchema = { + _getParsedProperties: () => [...schema._getParsedProperties(), ...extension._getParsedProperties()], + _getRawProperties: () => [...schema._getRawProperties(), ...extension._getRawProperties()], + parse: (raw, opts) => { + return validateAndTransformExtendedObject({ + extensionKeys: extension._getRawProperties(), + value: raw, + transformBase: (rawBase) => schema.parse(rawBase, opts), + transformExtension: (rawExtension) => extension.parse(rawExtension, opts), + }); + }, + json: (parsed, opts) => { + return validateAndTransformExtendedObject({ + extensionKeys: extension._getParsedProperties(), + value: parsed, + transformBase: (parsedBase) => schema.json(parsedBase, opts), + transformExtension: (parsedExtension) => extension.json(parsedExtension, opts), + }); + }, + getType: () => SchemaType.OBJECT, + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + ...getObjectUtils(baseSchema), + }; + }, + }; +} + +function validateAndTransformExtendedObject({ + extensionKeys, + value, + transformBase, + transformExtension, +}: { + extensionKeys: (keyof PreTransformedExtension)[]; + value: unknown; + transformBase: (value: unknown) => MaybeValid; + transformExtension: (value: unknown) => MaybeValid; +}): MaybeValid { + const extensionPropertiesSet = new Set(extensionKeys); + const [extensionProperties, baseProperties] = partition(keys(value), (key) => + extensionPropertiesSet.has(key as keyof PreTransformedExtension) + ); + + const transformedBase = transformBase(filterObject(value, baseProperties)); + const transformedExtension = transformExtension(filterObject(value, extensionProperties)); + + if (transformedBase.ok && transformedExtension.ok) { + return { + ok: true, + value: { + ...transformedBase.value, + ...transformedExtension.value, + }, + }; + } else { + return { + ok: false, + errors: [ + ...(transformedBase.ok ? [] : transformedBase.errors), + ...(transformedExtension.ok ? [] : transformedExtension.errors), + ], + }; + } +} + +function isSchemaRequired(schema: Schema): boolean { + return !isSchemaOptional(schema); +} + +function isSchemaOptional(schema: Schema): boolean { + switch (schema.getType()) { + case SchemaType.ANY: + case SchemaType.UNKNOWN: + case SchemaType.OPTIONAL: + return true; + default: + return false; + } +} diff --git a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts new file mode 100644 index 0000000..a0951f4 --- /dev/null +++ b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts @@ -0,0 +1,18 @@ +import { object } from "./object"; +import { inferParsedPropertySchema, inferRawObjectFromPropertySchemas, ObjectSchema, PropertySchemas } from "./types"; + +export function objectWithoutOptionalProperties>( + schemas: T +): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas { + return object(schemas) as unknown as inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas; +} + +export type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas> = + ObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas + >; + +export type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas> = { + [K in keyof T]: inferParsedPropertySchema; +}; diff --git a/src/core/schemas/builders/object/property.ts b/src/core/schemas/builders/object/property.ts new file mode 100644 index 0000000..d245c4b --- /dev/null +++ b/src/core/schemas/builders/object/property.ts @@ -0,0 +1,23 @@ +import { Schema } from "../../Schema"; + +export function property( + rawKey: RawKey, + valueSchema: Schema +): Property { + return { + rawKey, + valueSchema, + isProperty: true, + }; +} + +export interface Property { + rawKey: RawKey; + valueSchema: Schema; + isProperty: true; +} + +export function isProperty>(maybeProperty: unknown): maybeProperty is O { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + return (maybeProperty as O).isProperty; +} diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts new file mode 100644 index 0000000..de9bb40 --- /dev/null +++ b/src/core/schemas/builders/object/types.ts @@ -0,0 +1,72 @@ +import { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; +import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; +import { ObjectLikeUtils } from "../object-like"; +import { SchemaUtils } from "../schema-utils"; +import { Property } from "./property"; + +export type ObjectSchema = BaseObjectSchema & + ObjectLikeUtils & + ObjectUtils & + SchemaUtils; + +export interface BaseObjectSchema extends BaseSchema { + _getRawProperties: () => (keyof Raw)[]; + _getParsedProperties: () => (keyof Parsed)[]; +} + +export interface ObjectUtils { + extend: ( + schemas: ObjectSchema + ) => ObjectSchema; +} + +export type inferRawObject> = O extends ObjectSchema ? Raw : never; + +export type inferParsedObject> = O extends ObjectSchema + ? Parsed + : never; + +export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectFromPropertySchemas +>; + +export type inferRawObjectFromPropertySchemas> = + addQuestionMarksToNullableProperties<{ + [ParsedKey in keyof T as inferRawKey]: inferRawPropertySchema; + }>; + +export type inferParsedObjectFromPropertySchemas> = + addQuestionMarksToNullableProperties<{ + [K in keyof T]: inferParsedPropertySchema; + }>; + +export type PropertySchemas = Record< + ParsedKeys, + Property | Schema +>; + +export type inferRawPropertySchema

| Schema> = P extends Property< + any, + infer Raw, + any +> + ? Raw + : P extends Schema + ? inferRaw

+ : never; + +export type inferParsedPropertySchema

| Schema> = P extends Property< + any, + any, + infer Parsed +> + ? Parsed + : P extends Schema + ? inferParsed

+ : never; + +export type inferRawKey< + ParsedKey extends string | number | symbol, + P extends Property | Schema +> = P extends Property ? Raw : ParsedKey; diff --git a/src/core/schemas/builders/primitives/any.ts b/src/core/schemas/builders/primitives/any.ts new file mode 100644 index 0000000..fcaeb04 --- /dev/null +++ b/src/core/schemas/builders/primitives/any.ts @@ -0,0 +1,4 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; + +export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); diff --git a/src/core/schemas/builders/primitives/boolean.ts b/src/core/schemas/builders/primitives/boolean.ts new file mode 100644 index 0000000..fad6056 --- /dev/null +++ b/src/core/schemas/builders/primitives/boolean.ts @@ -0,0 +1,25 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export const boolean = createIdentitySchemaCreator( + SchemaType.BOOLEAN, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (typeof value === "boolean") { + return { + ok: true, + value, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "boolean"), + }, + ], + }; + } + } +); diff --git a/src/core/schemas/builders/primitives/index.ts b/src/core/schemas/builders/primitives/index.ts new file mode 100644 index 0000000..788f941 --- /dev/null +++ b/src/core/schemas/builders/primitives/index.ts @@ -0,0 +1,5 @@ +export { any } from "./any"; +export { boolean } from "./boolean"; +export { number } from "./number"; +export { string } from "./string"; +export { unknown } from "./unknown"; diff --git a/src/core/schemas/builders/primitives/number.ts b/src/core/schemas/builders/primitives/number.ts new file mode 100644 index 0000000..c268945 --- /dev/null +++ b/src/core/schemas/builders/primitives/number.ts @@ -0,0 +1,25 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export const number = createIdentitySchemaCreator( + SchemaType.NUMBER, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (typeof value === "number") { + return { + ok: true, + value, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "number"), + }, + ], + }; + } + } +); diff --git a/src/core/schemas/builders/primitives/string.ts b/src/core/schemas/builders/primitives/string.ts new file mode 100644 index 0000000..949f1f2 --- /dev/null +++ b/src/core/schemas/builders/primitives/string.ts @@ -0,0 +1,25 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export const string = createIdentitySchemaCreator( + SchemaType.STRING, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (typeof value === "string") { + return { + ok: true, + value, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "string"), + }, + ], + }; + } + } +); diff --git a/src/core/schemas/builders/primitives/unknown.ts b/src/core/schemas/builders/primitives/unknown.ts new file mode 100644 index 0000000..4d52495 --- /dev/null +++ b/src/core/schemas/builders/primitives/unknown.ts @@ -0,0 +1,4 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; + +export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); diff --git a/src/core/schemas/builders/record/index.ts b/src/core/schemas/builders/record/index.ts new file mode 100644 index 0000000..82e25c5 --- /dev/null +++ b/src/core/schemas/builders/record/index.ts @@ -0,0 +1,2 @@ +export { record } from "./record"; +export type { BaseRecordSchema, RecordSchema } from "./types"; diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts new file mode 100644 index 0000000..6683ac3 --- /dev/null +++ b/src/core/schemas/builders/record/record.ts @@ -0,0 +1,130 @@ +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { entries } from "../../utils/entries"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; +import { BaseRecordSchema, RecordSchema } from "./types"; + +export function record( + keySchema: Schema, + valueSchema: Schema +): RecordSchema { + const baseSchema: BaseRecordSchema = { + parse: (raw, opts) => { + return validateAndTransformRecord({ + value: raw, + isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, + transformKey: (key) => + keySchema.parse(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.parse(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + json: (parsed, opts) => { + return validateAndTransformRecord({ + value: parsed, + isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, + transformKey: (key) => + keySchema.json(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.json(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + getType: () => SchemaType.RECORD, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + +function validateAndTransformRecord({ + value, + isKeyNumeric, + transformKey, + transformValue, + breadcrumbsPrefix = [], +}: { + value: unknown; + isKeyNumeric: boolean; + transformKey: (key: string | number) => MaybeValid; + transformValue: (value: unknown, key: string | number) => MaybeValid; + breadcrumbsPrefix: string[] | undefined; +}): MaybeValid> { + if (!isPlainObject(value)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "object"), + }, + ], + }; + } + + return entries(value).reduce>>( + (accPromise, [stringKey, value]) => { + // skip nullish keys + if (value == null) { + return accPromise; + } + + const acc = accPromise; + + let key: string | number = stringKey; + if (isKeyNumeric) { + const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; + if (!isNaN(numberKey)) { + key = numberKey; + } + } + const transformedKey = transformKey(key); + + const transformedValue = transformValue(value, key); + + if (acc.ok && transformedKey.ok && transformedValue.ok) { + return { + ok: true, + value: { + ...acc.value, + [transformedKey.value]: transformedValue.value, + }, + }; + } + + const errors: ValidationError[] = []; + if (!acc.ok) { + errors.push(...acc.errors); + } + if (!transformedKey.ok) { + errors.push(...transformedKey.errors); + } + if (!transformedValue.ok) { + errors.push(...transformedValue.errors); + } + + return { + ok: false, + errors, + }; + }, + { ok: true, value: {} as Record } + ); +} diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts new file mode 100644 index 0000000..eb82cc7 --- /dev/null +++ b/src/core/schemas/builders/record/types.ts @@ -0,0 +1,17 @@ +import { BaseSchema } from "../../Schema"; +import { SchemaUtils } from "../schema-utils"; + +export type RecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue +> = BaseRecordSchema & + SchemaUtils, Record>; + +export type BaseRecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue +> = BaseSchema, Record>; diff --git a/src/core/schemas/builders/schema-utils/JsonError.ts b/src/core/schemas/builders/schema-utils/JsonError.ts new file mode 100644 index 0000000..2b89ca0 --- /dev/null +++ b/src/core/schemas/builders/schema-utils/JsonError.ts @@ -0,0 +1,9 @@ +import { ValidationError } from "../../Schema"; +import { stringifyValidationError } from "./stringifyValidationErrors"; + +export class JsonError extends Error { + constructor(public readonly errors: ValidationError[]) { + super(errors.map(stringifyValidationError).join("; ")); + Object.setPrototypeOf(this, JsonError.prototype); + } +} diff --git a/src/core/schemas/builders/schema-utils/ParseError.ts b/src/core/schemas/builders/schema-utils/ParseError.ts new file mode 100644 index 0000000..d056eb4 --- /dev/null +++ b/src/core/schemas/builders/schema-utils/ParseError.ts @@ -0,0 +1,9 @@ +import { ValidationError } from "../../Schema"; +import { stringifyValidationError } from "./stringifyValidationErrors"; + +export class ParseError extends Error { + constructor(public readonly errors: ValidationError[]) { + super(errors.map(stringifyValidationError).join("; ")); + Object.setPrototypeOf(this, ParseError.prototype); + } +} diff --git a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts new file mode 100644 index 0000000..79ecad9 --- /dev/null +++ b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts @@ -0,0 +1,105 @@ +import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; +import { JsonError } from "./JsonError"; +import { ParseError } from "./ParseError"; + +export interface SchemaUtils { + optional: () => Schema; + transform: (transformer: SchemaTransformer) => Schema; + parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed; + jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw; +} + +export interface SchemaTransformer { + transform: (parsed: Parsed) => Transformed; + untransform: (transformed: any) => Parsed; +} + +export function getSchemaUtils(schema: BaseSchema): SchemaUtils { + return { + optional: () => optional(schema), + transform: (transformer) => transform(schema, transformer), + parseOrThrow: (raw, opts) => { + const parsed = schema.parse(raw, opts); + if (parsed.ok) { + return parsed.value; + } + throw new ParseError(parsed.errors); + }, + jsonOrThrow: (parsed, opts) => { + const raw = schema.json(parsed, opts); + if (raw.ok) { + return raw.value; + } + throw new JsonError(raw.errors); + }, + }; +} + +/** + * schema utils are defined in one file to resolve issues with circular imports + */ + +export function optional( + schema: BaseSchema +): Schema { + const baseSchema: BaseSchema = { + parse: (raw, opts) => { + if (raw == null) { + return { + ok: true, + value: undefined, + }; + } + return schema.parse(raw, opts); + }, + json: (parsed, opts) => { + if (opts?.omitUndefined && parsed === undefined) { + return { + ok: true, + value: undefined, + }; + } + if (parsed == null) { + return { + ok: true, + value: null, + }; + } + return schema.json(parsed, opts); + }, + getType: () => SchemaType.OPTIONAL, + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + }; +} + +export function transform( + schema: BaseSchema, + transformer: SchemaTransformer +): Schema { + const baseSchema: BaseSchema = { + parse: (raw, opts) => { + const parsed = schema.parse(raw, opts); + if (!parsed.ok) { + return parsed; + } + return { + ok: true, + value: transformer.transform(parsed.value), + }; + }, + json: (transformed, opts) => { + const parsed = transformer.untransform(transformed); + return schema.json(parsed, opts); + }, + getType: () => schema.getType(), + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + }; +} diff --git a/src/core/schemas/builders/schema-utils/index.ts b/src/core/schemas/builders/schema-utils/index.ts new file mode 100644 index 0000000..aa04e05 --- /dev/null +++ b/src/core/schemas/builders/schema-utils/index.ts @@ -0,0 +1,4 @@ +export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; +export type { SchemaUtils } from "./getSchemaUtils"; +export { JsonError } from "./JsonError"; +export { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts new file mode 100644 index 0000000..4160f0a --- /dev/null +++ b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts @@ -0,0 +1,8 @@ +import { ValidationError } from "../../Schema"; + +export function stringifyValidationError(error: ValidationError): string { + if (error.path.length === 0) { + return error.message; + } + return `${error.path.join(" -> ")}: ${error.message}`; +} diff --git a/src/core/schemas/builders/set/index.ts b/src/core/schemas/builders/set/index.ts new file mode 100644 index 0000000..f3310e8 --- /dev/null +++ b/src/core/schemas/builders/set/index.ts @@ -0,0 +1 @@ +export { set } from "./set"; diff --git a/src/core/schemas/builders/set/set.ts b/src/core/schemas/builders/set/set.ts new file mode 100644 index 0000000..e9e6bb7 --- /dev/null +++ b/src/core/schemas/builders/set/set.ts @@ -0,0 +1,43 @@ +import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { list } from "../list"; +import { getSchemaUtils } from "../schema-utils"; + +export function set(schema: Schema): Schema> { + const listSchema = list(schema); + const baseSchema: BaseSchema> = { + parse: (raw, opts) => { + const parsedList = listSchema.parse(raw, opts); + if (parsedList.ok) { + return { + ok: true, + value: new Set(parsedList.value), + }; + } else { + return parsedList; + } + }, + json: (parsed, opts) => { + if (!(parsed instanceof Set)) { + return { + ok: false, + errors: [ + { + path: opts?.breadcrumbsPrefix ?? [], + message: getErrorMessageForIncorrectType(parsed, "Set"), + }, + ], + }; + } + const jsonList = listSchema.json([...parsed], opts); + return jsonList; + }, + getType: () => SchemaType.SET, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} diff --git a/src/core/schemas/builders/undiscriminated-union/index.ts b/src/core/schemas/builders/undiscriminated-union/index.ts new file mode 100644 index 0000000..75b71cb --- /dev/null +++ b/src/core/schemas/builders/undiscriminated-union/index.ts @@ -0,0 +1,6 @@ +export type { + inferParsedUnidiscriminatedUnionSchema, + inferRawUnidiscriminatedUnionSchema, + UndiscriminatedUnionSchema, +} from "./types"; +export { undiscriminatedUnion } from "./undiscriminatedUnion"; diff --git a/src/core/schemas/builders/undiscriminated-union/types.ts b/src/core/schemas/builders/undiscriminated-union/types.ts new file mode 100644 index 0000000..43e7108 --- /dev/null +++ b/src/core/schemas/builders/undiscriminated-union/types.ts @@ -0,0 +1,10 @@ +import { inferParsed, inferRaw, Schema } from "../../Schema"; + +export type UndiscriminatedUnionSchema = Schema< + inferRawUnidiscriminatedUnionSchema, + inferParsedUnidiscriminatedUnionSchema +>; + +export type inferRawUnidiscriminatedUnionSchema = inferRaw; + +export type inferParsedUnidiscriminatedUnionSchema = inferParsed; diff --git a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts new file mode 100644 index 0000000..21ed3df --- /dev/null +++ b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts @@ -0,0 +1,60 @@ +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; +import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; + +export function undiscriminatedUnion, ...Schema[]]>( + schemas: Schemas +): Schema, inferParsedUnidiscriminatedUnionSchema> { + const baseSchema: BaseSchema< + inferRawUnidiscriminatedUnionSchema, + inferParsedUnidiscriminatedUnionSchema + > = { + parse: (raw, opts) => { + return validateAndTransformUndiscriminatedUnion>( + (schema, opts) => schema.parse(raw, opts), + schemas, + opts + ); + }, + json: (parsed, opts) => { + return validateAndTransformUndiscriminatedUnion>( + (schema, opts) => schema.json(parsed, opts), + schemas, + opts + ); + }, + getType: () => SchemaType.UNDISCRIMINATED_UNION, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + +function validateAndTransformUndiscriminatedUnion( + transform: (schema: Schema, opts: SchemaOptions) => MaybeValid, + schemas: Schema[], + opts: SchemaOptions | undefined +): MaybeValid { + const errors: ValidationError[] = []; + for (const [index, schema] of schemas.entries()) { + const transformed = transform(schema, { ...opts, skipValidation: false }); + if (transformed.ok) { + return transformed; + } else { + for (const error of transformed.errors) { + errors.push({ + path: error.path, + message: `[Variant ${index}] ${error.message}`, + }); + } + } + } + + return { + ok: false, + errors, + }; +} diff --git a/src/core/schemas/builders/union/discriminant.ts b/src/core/schemas/builders/union/discriminant.ts new file mode 100644 index 0000000..55065bc --- /dev/null +++ b/src/core/schemas/builders/union/discriminant.ts @@ -0,0 +1,14 @@ +export function discriminant( + parsedDiscriminant: ParsedDiscriminant, + rawDiscriminant: RawDiscriminant +): Discriminant { + return { + parsedDiscriminant, + rawDiscriminant, + }; +} + +export interface Discriminant { + parsedDiscriminant: ParsedDiscriminant; + rawDiscriminant: RawDiscriminant; +} diff --git a/src/core/schemas/builders/union/index.ts b/src/core/schemas/builders/union/index.ts new file mode 100644 index 0000000..85fc008 --- /dev/null +++ b/src/core/schemas/builders/union/index.ts @@ -0,0 +1,10 @@ +export { discriminant } from "./discriminant"; +export type { Discriminant } from "./discriminant"; +export type { + inferParsedDiscriminant, + inferParsedUnion, + inferRawDiscriminant, + inferRawUnion, + UnionSubtypes, +} from "./types"; +export { union } from "./union"; diff --git a/src/core/schemas/builders/union/types.ts b/src/core/schemas/builders/union/types.ts new file mode 100644 index 0000000..6f82c86 --- /dev/null +++ b/src/core/schemas/builders/union/types.ts @@ -0,0 +1,26 @@ +import { inferParsedObject, inferRawObject, ObjectSchema } from "../object"; +import { Discriminant } from "./discriminant"; + +export type UnionSubtypes = { + [K in DiscriminantValues]: ObjectSchema; +}; + +export type inferRawUnion, U extends UnionSubtypes> = { + [K in keyof U]: Record, K> & inferRawObject; +}[keyof U]; + +export type inferParsedUnion, U extends UnionSubtypes> = { + [K in keyof U]: Record, K> & inferParsedObject; +}[keyof U]; + +export type inferRawDiscriminant> = D extends string + ? D + : D extends Discriminant + ? Raw + : never; + +export type inferParsedDiscriminant> = D extends string + ? D + : D extends Discriminant + ? Parsed + : never; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts new file mode 100644 index 0000000..ab61475 --- /dev/null +++ b/src/core/schemas/builders/union/union.ts @@ -0,0 +1,170 @@ +import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { keys } from "../../utils/keys"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { enum_ } from "../enum"; +import { ObjectSchema } from "../object"; +import { getObjectLikeUtils, ObjectLikeSchema } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; +import { Discriminant } from "./discriminant"; +import { inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion, UnionSubtypes } from "./types"; + +export function union, U extends UnionSubtypes>( + discriminant: D, + union: U +): ObjectLikeSchema, inferParsedUnion> { + const rawDiscriminant = + typeof discriminant === "string" ? discriminant : (discriminant.rawDiscriminant as inferRawDiscriminant); + const parsedDiscriminant = + typeof discriminant === "string" + ? discriminant + : (discriminant.parsedDiscriminant as inferParsedDiscriminant); + + const discriminantValueSchema = enum_(keys(union) as string[]); + + const baseSchema: BaseSchema, inferParsedUnion> = { + parse: (raw, opts) => { + return transformAndValidateUnion({ + value: raw, + discriminant: rawDiscriminant, + transformedDiscriminant: parsedDiscriminant, + transformDiscriminantValue: (discriminantValue) => + discriminantValueSchema.parse(discriminantValue, { + allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawDiscriminant], + }), + getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], + allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, + transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => + additionalPropertiesSchema.parse(additionalProperties, opts), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + json: (parsed, opts) => { + return transformAndValidateUnion({ + value: parsed, + discriminant: parsedDiscriminant, + transformedDiscriminant: rawDiscriminant, + transformDiscriminantValue: (discriminantValue) => + discriminantValueSchema.json(discriminantValue, { + allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedDiscriminant], + }), + getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], + allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, + transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => + additionalPropertiesSchema.json(additionalProperties, opts), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + getType: () => SchemaType.UNION, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + }; +} + +function transformAndValidateUnion< + TransformedDiscriminant extends string, + TransformedDiscriminantValue extends string, + TransformedAdditionalProperties +>({ + value, + discriminant, + transformedDiscriminant, + transformDiscriminantValue, + getAdditionalPropertiesSchema, + allowUnrecognizedUnionMembers = false, + transformAdditionalProperties, + breadcrumbsPrefix = [], +}: { + value: unknown; + discriminant: string; + transformedDiscriminant: TransformedDiscriminant; + transformDiscriminantValue: (discriminantValue: unknown) => MaybeValid; + getAdditionalPropertiesSchema: (discriminantValue: string) => ObjectSchema | undefined; + allowUnrecognizedUnionMembers: boolean | undefined; + transformAdditionalProperties: ( + additionalProperties: unknown, + additionalPropertiesSchema: ObjectSchema + ) => MaybeValid; + breadcrumbsPrefix: string[] | undefined; +}): MaybeValid & TransformedAdditionalProperties> { + if (!isPlainObject(value)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "object"), + }, + ], + }; + } + + const { [discriminant]: discriminantValue, ...additionalProperties } = value; + + if (discriminantValue == null) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: `Missing discriminant ("${discriminant}")`, + }, + ], + }; + } + + const transformedDiscriminantValue = transformDiscriminantValue(discriminantValue); + if (!transformedDiscriminantValue.ok) { + return { + ok: false, + errors: transformedDiscriminantValue.errors, + }; + } + + const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value); + + if (additionalPropertiesSchema == null) { + if (allowUnrecognizedUnionMembers) { + return { + ok: true, + value: { + [transformedDiscriminant]: transformedDiscriminantValue.value, + ...additionalProperties, + } as Record & TransformedAdditionalProperties, + }; + } else { + return { + ok: false, + errors: [ + { + path: [...breadcrumbsPrefix, discriminant], + message: "Unexpected discriminant value", + }, + ], + }; + } + } + + const transformedAdditionalProperties = transformAdditionalProperties( + additionalProperties, + additionalPropertiesSchema + ); + if (!transformedAdditionalProperties.ok) { + return transformedAdditionalProperties; + } + + return { + ok: true, + value: { + [transformedDiscriminant]: discriminantValue, + ...transformedAdditionalProperties.value, + } as Record & TransformedAdditionalProperties, + }; +} diff --git a/src/core/schemas/index.ts b/src/core/schemas/index.ts new file mode 100644 index 0000000..5429d8b --- /dev/null +++ b/src/core/schemas/index.ts @@ -0,0 +1,2 @@ +export * from "./builders"; +export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/src/core/schemas/utils/MaybePromise.ts b/src/core/schemas/utils/MaybePromise.ts new file mode 100644 index 0000000..9cd354b --- /dev/null +++ b/src/core/schemas/utils/MaybePromise.ts @@ -0,0 +1 @@ +export type MaybePromise = T | Promise; diff --git a/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts b/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts new file mode 100644 index 0000000..4111d70 --- /dev/null +++ b/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts @@ -0,0 +1,15 @@ +export type addQuestionMarksToNullableProperties = { + [K in OptionalKeys]?: T[K]; +} & Pick>; + +export type OptionalKeys = { + [K in keyof T]-?: undefined extends T[K] + ? K + : null extends T[K] + ? K + : 1 extends (any extends T[K] ? 0 : 1) + ? never + : K; +}[keyof T]; + +export type RequiredKeys = Exclude>; diff --git a/src/core/schemas/utils/createIdentitySchemaCreator.ts b/src/core/schemas/utils/createIdentitySchemaCreator.ts new file mode 100644 index 0000000..de107cf --- /dev/null +++ b/src/core/schemas/utils/createIdentitySchemaCreator.ts @@ -0,0 +1,21 @@ +import { getSchemaUtils } from "../builders/schema-utils"; +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; +import { maybeSkipValidation } from "./maybeSkipValidation"; + +export function createIdentitySchemaCreator( + schemaType: SchemaType, + validate: (value: unknown, opts?: SchemaOptions) => MaybeValid +): () => Schema { + return () => { + const baseSchema: BaseSchema = { + parse: validate, + json: validate, + getType: () => schemaType, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; + }; +} diff --git a/src/core/schemas/utils/entries.ts b/src/core/schemas/utils/entries.ts new file mode 100644 index 0000000..e122952 --- /dev/null +++ b/src/core/schemas/utils/entries.ts @@ -0,0 +1,3 @@ +export function entries(object: T): [keyof T, T[keyof T]][] { + return Object.entries(object) as [keyof T, T[keyof T]][]; +} diff --git a/src/core/schemas/utils/filterObject.ts b/src/core/schemas/utils/filterObject.ts new file mode 100644 index 0000000..2c25a34 --- /dev/null +++ b/src/core/schemas/utils/filterObject.ts @@ -0,0 +1,10 @@ +export function filterObject(obj: T, keysToInclude: K[]): Pick { + const keysToIncludeSet = new Set(keysToInclude); + return Object.entries(obj).reduce((acc, [key, value]) => { + if (keysToIncludeSet.has(key as K)) { + acc[key as K] = value; + } + return acc; + // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter + }, {} as Pick); +} diff --git a/src/core/schemas/utils/getErrorMessageForIncorrectType.ts b/src/core/schemas/utils/getErrorMessageForIncorrectType.ts new file mode 100644 index 0000000..438012d --- /dev/null +++ b/src/core/schemas/utils/getErrorMessageForIncorrectType.ts @@ -0,0 +1,21 @@ +export function getErrorMessageForIncorrectType(value: unknown, expectedType: string): string { + return `Expected ${expectedType}. Received ${getTypeAsString(value)}.`; +} + +function getTypeAsString(value: unknown): string { + if (Array.isArray(value)) { + return "list"; + } + if (value === null) { + return "null"; + } + switch (typeof value) { + case "string": + return `"${value}"`; + case "number": + case "boolean": + case "undefined": + return `${value}`; + } + return typeof value; +} diff --git a/src/core/schemas/utils/isPlainObject.ts b/src/core/schemas/utils/isPlainObject.ts new file mode 100644 index 0000000..db82a72 --- /dev/null +++ b/src/core/schemas/utils/isPlainObject.ts @@ -0,0 +1,17 @@ +// borrowed from https://github.com/lodash/lodash/blob/master/isPlainObject.js +export function isPlainObject(value: unknown): value is Record { + if (typeof value !== "object" || value === null) { + return false; + } + + if (Object.getPrototypeOf(value) === null) { + return true; + } + + let proto = value; + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + + return Object.getPrototypeOf(value) === proto; +} diff --git a/src/core/schemas/utils/keys.ts b/src/core/schemas/utils/keys.ts new file mode 100644 index 0000000..0186709 --- /dev/null +++ b/src/core/schemas/utils/keys.ts @@ -0,0 +1,3 @@ +export function keys(object: T): (keyof T)[] { + return Object.keys(object) as (keyof T)[]; +} diff --git a/src/core/schemas/utils/maybeSkipValidation.ts b/src/core/schemas/utils/maybeSkipValidation.ts new file mode 100644 index 0000000..86c07ab --- /dev/null +++ b/src/core/schemas/utils/maybeSkipValidation.ts @@ -0,0 +1,38 @@ +import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; + +export function maybeSkipValidation, Raw, Parsed>(schema: S): S { + return { + ...schema, + json: transformAndMaybeSkipValidation(schema.json), + parse: transformAndMaybeSkipValidation(schema.parse), + }; +} + +function transformAndMaybeSkipValidation( + transform: (value: unknown, opts?: SchemaOptions) => MaybeValid +): (value: unknown, opts?: SchemaOptions) => MaybeValid { + return (value, opts): MaybeValid => { + const transformed = transform(value, opts); + const { skipValidation = false } = opts ?? {}; + if (!transformed.ok && skipValidation) { + // eslint-disable-next-line no-console + console.warn( + [ + "Failed to validate.", + ...transformed.errors.map( + (error) => + " - " + + (error.path.length > 0 ? `${error.path.join(".")}: ${error.message}` : error.message) + ), + ].join("\n") + ); + + return { + ok: true, + value: value as T, + }; + } else { + return transformed; + } + }; +} diff --git a/src/core/schemas/utils/partition.ts b/src/core/schemas/utils/partition.ts new file mode 100644 index 0000000..f58d6f3 --- /dev/null +++ b/src/core/schemas/utils/partition.ts @@ -0,0 +1,12 @@ +export function partition(items: readonly T[], predicate: (item: T) => boolean): [T[], T[]] { + const trueItems: T[] = [], + falseItems: T[] = []; + for (const item of items) { + if (predicate(item)) { + trueItems.push(item); + } else { + falseItems.push(item); + } + } + return [trueItems, falseItems]; +} diff --git a/src/environments.ts b/src/environments.ts new file mode 100644 index 0000000..0d52d44 --- /dev/null +++ b/src/environments.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export const DevRevEnvironment = { + Default: "https://api.devrev.ai", +} as const; + +export type DevRevEnvironment = typeof DevRevEnvironment.Default; diff --git a/src/errors/DevRevError.ts b/src/errors/DevRevError.ts new file mode 100644 index 0000000..c8900d3 --- /dev/null +++ b/src/errors/DevRevError.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export class DevRevError extends Error { + readonly statusCode?: number; + readonly body?: unknown; + + constructor({ message, statusCode, body }: { message?: string; statusCode?: number; body?: unknown }) { + super(buildMessage({ message, statusCode, body })); + Object.setPrototypeOf(this, DevRevError.prototype); + if (statusCode != null) { + this.statusCode = statusCode; + } + + if (body !== undefined) { + this.body = body; + } + } +} + +function buildMessage({ + message, + statusCode, + body, +}: { + message: string | undefined; + statusCode: number | undefined; + body: unknown | undefined; +}): string { + let lines: string[] = []; + if (message != null) { + lines.push(message); + } + + if (statusCode != null) { + lines.push(`Status code: ${statusCode.toString()}`); + } + + if (body != null) { + lines.push(`Body: ${JSON.stringify(body, undefined, 2)}`); + } + + return lines.join("\n"); +} diff --git a/src/errors/DevRevTimeoutError.ts b/src/errors/DevRevTimeoutError.ts new file mode 100644 index 0000000..473d0c2 --- /dev/null +++ b/src/errors/DevRevTimeoutError.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export class DevRevTimeoutError extends Error { + constructor() { + super("Timeout"); + Object.setPrototypeOf(this, DevRevTimeoutError.prototype); + } +} diff --git a/src/errors/index.ts b/src/errors/index.ts new file mode 100644 index 0000000..199eaa1 --- /dev/null +++ b/src/errors/index.ts @@ -0,0 +1,2 @@ +export { DevRevError } from "./DevRevError"; +export { DevRevTimeoutError } from "./DevRevTimeoutError"; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..89712b0 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,4 @@ +export * as DevRev from "./api"; +export { DevRevClient } from "./Client"; +export { DevRevEnvironment } from "./environments"; +export { DevRevError, DevRevTimeoutError } from "./errors"; diff --git a/src/serialization/index.ts b/src/serialization/index.ts new file mode 100644 index 0000000..3ce0a3e --- /dev/null +++ b/src/serialization/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./resources"; diff --git a/src/serialization/resources/accounts/client/index.ts b/src/serialization/resources/accounts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/accounts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/accounts/client/requests/AccountsCreateRequest.ts b/src/serialization/resources/accounts/client/requests/AccountsCreateRequest.ts new file mode 100644 index 0000000..a3808a8 --- /dev/null +++ b/src/serialization/resources/accounts/client/requests/AccountsCreateRequest.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const AccountsCreateRequest: core.serialization.Schema< + serializers.AccountsCreateRequest.Raw, + DevRev.AccountsCreateRequest +> = core.serialization.object({ + artifacts: core.serialization.list(core.serialization.string()).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + description: core.serialization.string().optional(), + displayName: core.serialization.property("display_name", core.serialization.string()), + domains: core.serialization.list(core.serialization.string()).optional(), + externalRefs: core.serialization.property( + "external_refs", + core.serialization.list(core.serialization.string()).optional() + ), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + schemaFragmentIds: core.serialization.property( + "schema_fragment_ids", + core.serialization.list(core.serialization.string()).optional() + ), + tags: core.serialization.list(SetTagWithValue).optional(), + tier: core.serialization.string().optional(), + websites: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace AccountsCreateRequest { + interface Raw { + artifacts?: string[] | null; + custom_fields?: Record | null; + description?: string | null; + display_name: string; + domains?: string[] | null; + external_refs?: string[] | null; + owned_by?: string[] | null; + schema_fragment_ids?: string[] | null; + tags?: SetTagWithValue.Raw[] | null; + tier?: string | null; + websites?: string[] | null; + } +} diff --git a/src/serialization/resources/accounts/client/requests/AccountsDeleteRequest.ts b/src/serialization/resources/accounts/client/requests/AccountsDeleteRequest.ts new file mode 100644 index 0000000..597bebc --- /dev/null +++ b/src/serialization/resources/accounts/client/requests/AccountsDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const AccountsDeleteRequest: core.serialization.Schema< + serializers.AccountsDeleteRequest.Raw, + DevRev.AccountsDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace AccountsDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/accounts/client/requests/AccountsExportRequest.ts b/src/serialization/resources/accounts/client/requests/AccountsExportRequest.ts new file mode 100644 index 0000000..4cef46d --- /dev/null +++ b/src/serialization/resources/accounts/client/requests/AccountsExportRequest.ts @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DateTimeFilter } from "../../../../types/DateTimeFilter"; + +export const AccountsExportRequest: core.serialization.Schema< + serializers.AccountsExportRequest.Raw, + DevRev.AccountsExportRequest +> = core.serialization.object({ + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateTimeFilter.optional()), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + displayName: core.serialization.property( + "display_name", + core.serialization.list(core.serialization.string()).optional() + ), + domains: core.serialization.list(core.serialization.string()).optional(), + externalRefs: core.serialization.property( + "external_refs", + core.serialization.list(core.serialization.string()).optional() + ), + first: core.serialization.number().optional(), + modifiedDate: core.serialization.property("modified_date", DateTimeFilter.optional()), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + stage: core.serialization.list(core.serialization.string()).optional(), + tags: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace AccountsExportRequest { + interface Raw { + created_by?: string[] | null; + created_date?: DateTimeFilter.Raw | null; + custom_fields?: Record | null; + display_name?: string[] | null; + domains?: string[] | null; + external_refs?: string[] | null; + first?: number | null; + modified_date?: DateTimeFilter.Raw | null; + owned_by?: string[] | null; + sort_by?: string[] | null; + stage?: string[] | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/resources/accounts/client/requests/AccountsGetRequest.ts b/src/serialization/resources/accounts/client/requests/AccountsGetRequest.ts new file mode 100644 index 0000000..bb60fbb --- /dev/null +++ b/src/serialization/resources/accounts/client/requests/AccountsGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const AccountsGetRequest: core.serialization.Schema< + serializers.AccountsGetRequest.Raw, + DevRev.AccountsGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace AccountsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/accounts/client/requests/AccountsListRequest.ts b/src/serialization/resources/accounts/client/requests/AccountsListRequest.ts new file mode 100644 index 0000000..6642693 --- /dev/null +++ b/src/serialization/resources/accounts/client/requests/AccountsListRequest.ts @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DateTimeFilter } from "../../../../types/DateTimeFilter"; +import { ListMode } from "../../../../types/ListMode"; + +export const AccountsListRequest: core.serialization.Schema< + serializers.AccountsListRequest.Raw, + DevRev.AccountsListRequest +> = core.serialization.object({ + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateTimeFilter.optional()), + cursor: core.serialization.string().optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + displayName: core.serialization.property( + "display_name", + core.serialization.list(core.serialization.string()).optional() + ), + domains: core.serialization.list(core.serialization.string()).optional(), + externalRefs: core.serialization.property( + "external_refs", + core.serialization.list(core.serialization.string()).optional() + ), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedDate: core.serialization.property("modified_date", DateTimeFilter.optional()), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + stage: core.serialization.list(core.serialization.string()).optional(), + tags: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace AccountsListRequest { + interface Raw { + created_by?: string[] | null; + created_date?: DateTimeFilter.Raw | null; + cursor?: string | null; + custom_fields?: Record | null; + display_name?: string[] | null; + domains?: string[] | null; + external_refs?: string[] | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_date?: DateTimeFilter.Raw | null; + owned_by?: string[] | null; + sort_by?: string[] | null; + stage?: string[] | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/resources/accounts/client/requests/AccountsUpdateRequest.ts b/src/serialization/resources/accounts/client/requests/AccountsUpdateRequest.ts new file mode 100644 index 0000000..e1f2d25 --- /dev/null +++ b/src/serialization/resources/accounts/client/requests/AccountsUpdateRequest.ts @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AccountsUpdateRequestArtifacts } from "../../../../types/AccountsUpdateRequestArtifacts"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const AccountsUpdateRequest: core.serialization.Schema< + serializers.AccountsUpdateRequest.Raw, + DevRev.AccountsUpdateRequest +> = core.serialization.object({ + artifacts: AccountsUpdateRequestArtifacts.optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + description: core.serialization.string().optional(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + domains: core.serialization.list(core.serialization.string()).optional(), + externalRefs: core.serialization.property( + "external_refs", + core.serialization.list(core.serialization.string()).optional() + ), + id: core.serialization.string(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + schemaFragmentIds: core.serialization.property( + "schema_fragment_ids", + core.serialization.list(core.serialization.string()).optional() + ), + tags: core.serialization.list(SetTagWithValue).optional(), + tier: core.serialization.string().optional(), +}); + +export declare namespace AccountsUpdateRequest { + interface Raw { + artifacts?: AccountsUpdateRequestArtifacts.Raw | null; + custom_fields?: Record | null; + description?: string | null; + display_name?: string | null; + domains?: string[] | null; + external_refs?: string[] | null; + id: string; + owned_by?: string[] | null; + schema_fragment_ids?: string[] | null; + tags?: SetTagWithValue.Raw[] | null; + tier?: string | null; + } +} diff --git a/src/serialization/resources/accounts/client/requests/index.ts b/src/serialization/resources/accounts/client/requests/index.ts new file mode 100644 index 0000000..1cf4f6d --- /dev/null +++ b/src/serialization/resources/accounts/client/requests/index.ts @@ -0,0 +1,6 @@ +export { AccountsCreateRequest } from "./AccountsCreateRequest"; +export { AccountsDeleteRequest } from "./AccountsDeleteRequest"; +export { AccountsExportRequest } from "./AccountsExportRequest"; +export { AccountsGetRequest } from "./AccountsGetRequest"; +export { AccountsListRequest } from "./AccountsListRequest"; +export { AccountsUpdateRequest } from "./AccountsUpdateRequest"; diff --git a/src/serialization/resources/accounts/index.ts b/src/serialization/resources/accounts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/accounts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/articles/client/index.ts b/src/serialization/resources/articles/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/articles/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/articles/client/requests/ArticlesCountRequest.ts b/src/serialization/resources/articles/client/requests/ArticlesCountRequest.ts new file mode 100644 index 0000000..d12fab6 --- /dev/null +++ b/src/serialization/resources/articles/client/requests/ArticlesCountRequest.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ArticleType } from "../../../../types/ArticleType"; +import { SharedWithMembershipFilter } from "../../../../types/SharedWithMembershipFilter"; + +export const ArticlesCountRequest: core.serialization.Schema< + serializers.ArticlesCountRequest.Raw, + DevRev.ArticlesCountRequest +> = core.serialization.object({ + ancestor: core.serialization.string().optional(), + appliesToParts: core.serialization.property( + "applies_to_parts", + core.serialization.list(core.serialization.string()).optional() + ), + articleType: core.serialization.property("article_type", core.serialization.list(ArticleType).optional()), + authoredBy: core.serialization.property( + "authored_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + modifiedBy: core.serialization.property( + "modified_by", + core.serialization.list(core.serialization.string()).optional() + ), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + scope: core.serialization.list(core.serialization.number()).optional(), + sharedWith: core.serialization.property( + "shared_with", + core.serialization.list(SharedWithMembershipFilter).optional() + ), +}); + +export declare namespace ArticlesCountRequest { + interface Raw { + ancestor?: string | null; + applies_to_parts?: string[] | null; + article_type?: ArticleType.Raw[] | null; + authored_by?: string[] | null; + created_by?: string[] | null; + modified_by?: string[] | null; + owned_by?: string[] | null; + scope?: number[] | null; + shared_with?: SharedWithMembershipFilter.Raw[] | null; + } +} diff --git a/src/serialization/resources/articles/client/requests/ArticlesCreateRequest.ts b/src/serialization/resources/articles/client/requests/ArticlesCreateRequest.ts new file mode 100644 index 0000000..ab2228e --- /dev/null +++ b/src/serialization/resources/articles/client/requests/ArticlesCreateRequest.ts @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AccessLevel } from "../../../../types/AccessLevel"; +import { ArticleType } from "../../../../types/ArticleType"; +import { ArticlesCreateRequestResource } from "../../../../types/ArticlesCreateRequestResource"; +import { SetSharedWithMembership } from "../../../../types/SetSharedWithMembership"; +import { ArticleStatus } from "../../../../types/ArticleStatus"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const ArticlesCreateRequest: core.serialization.Schema< + serializers.ArticlesCreateRequest.Raw, + DevRev.ArticlesCreateRequest +> = core.serialization.object({ + accessLevel: core.serialization.property("access_level", AccessLevel.optional()), + appliesToParts: core.serialization.property( + "applies_to_parts", + core.serialization.list(core.serialization.string()) + ), + articleType: core.serialization.property("article_type", ArticleType.optional()), + authoredBy: core.serialization.property( + "authored_by", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + extractedContent: core.serialization.property( + "extracted_content", + core.serialization.list(core.serialization.string()).optional() + ), + language: core.serialization.string().optional(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string())), + parent: core.serialization.string().optional(), + publishedAt: core.serialization.property("published_at", core.serialization.date().optional()), + resource: ArticlesCreateRequestResource, + scope: core.serialization.number().optional(), + sharedWith: core.serialization.property("shared_with", core.serialization.list(SetSharedWithMembership).optional()), + status: ArticleStatus.optional(), + tags: core.serialization.list(SetTagWithValue).optional(), + title: core.serialization.string(), +}); + +export declare namespace ArticlesCreateRequest { + interface Raw { + access_level?: AccessLevel.Raw | null; + applies_to_parts: string[]; + article_type?: ArticleType.Raw | null; + authored_by?: string[] | null; + description?: string | null; + extracted_content?: string[] | null; + language?: string | null; + owned_by: string[]; + parent?: string | null; + published_at?: string | null; + resource: ArticlesCreateRequestResource.Raw; + scope?: number | null; + shared_with?: SetSharedWithMembership.Raw[] | null; + status?: ArticleStatus.Raw | null; + tags?: SetTagWithValue.Raw[] | null; + title: string; + } +} diff --git a/src/serialization/resources/articles/client/requests/ArticlesDeleteRequest.ts b/src/serialization/resources/articles/client/requests/ArticlesDeleteRequest.ts new file mode 100644 index 0000000..b86bd10 --- /dev/null +++ b/src/serialization/resources/articles/client/requests/ArticlesDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ArticlesDeleteRequest: core.serialization.Schema< + serializers.ArticlesDeleteRequest.Raw, + DevRev.ArticlesDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace ArticlesDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/articles/client/requests/ArticlesGetRequest.ts b/src/serialization/resources/articles/client/requests/ArticlesGetRequest.ts new file mode 100644 index 0000000..d95e5ef --- /dev/null +++ b/src/serialization/resources/articles/client/requests/ArticlesGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ArticlesGetRequest: core.serialization.Schema< + serializers.ArticlesGetRequest.Raw, + DevRev.ArticlesGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace ArticlesGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/articles/client/requests/ArticlesListRequest.ts b/src/serialization/resources/articles/client/requests/ArticlesListRequest.ts new file mode 100644 index 0000000..3d11bdd --- /dev/null +++ b/src/serialization/resources/articles/client/requests/ArticlesListRequest.ts @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ArticleType } from "../../../../types/ArticleType"; +import { ListMode } from "../../../../types/ListMode"; +import { SharedWithMembershipFilter } from "../../../../types/SharedWithMembershipFilter"; + +export const ArticlesListRequest: core.serialization.Schema< + serializers.ArticlesListRequest.Raw, + DevRev.ArticlesListRequest +> = core.serialization.object({ + appliesToParts: core.serialization.property( + "applies_to_parts", + core.serialization.list(core.serialization.string()).optional() + ), + articleType: core.serialization.property("article_type", core.serialization.list(ArticleType).optional()), + authoredBy: core.serialization.property( + "authored_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedBy: core.serialization.property( + "modified_by", + core.serialization.list(core.serialization.string()).optional() + ), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + scope: core.serialization.list(core.serialization.number()).optional(), + sharedWith: core.serialization.property( + "shared_with", + core.serialization.list(SharedWithMembershipFilter).optional() + ), +}); + +export declare namespace ArticlesListRequest { + interface Raw { + applies_to_parts?: string[] | null; + article_type?: ArticleType.Raw[] | null; + authored_by?: string[] | null; + created_by?: string[] | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_by?: string[] | null; + owned_by?: string[] | null; + scope?: number[] | null; + shared_with?: SharedWithMembershipFilter.Raw[] | null; + } +} diff --git a/src/serialization/resources/articles/client/requests/ArticlesUpdateRequest.ts b/src/serialization/resources/articles/client/requests/ArticlesUpdateRequest.ts new file mode 100644 index 0000000..1d7c343 --- /dev/null +++ b/src/serialization/resources/articles/client/requests/ArticlesUpdateRequest.ts @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AccessLevel } from "../../../../types/AccessLevel"; +import { ArticlesUpdateRequestAppliesToParts } from "../../../../types/ArticlesUpdateRequestAppliesToParts"; +import { ArticlesUpdateRequestArtifacts } from "../../../../types/ArticlesUpdateRequestArtifacts"; +import { ArticlesUpdateRequestAuthoredBy } from "../../../../types/ArticlesUpdateRequestAuthoredBy"; +import { ArticlesUpdateRequestExtractedContent } from "../../../../types/ArticlesUpdateRequestExtractedContent"; +import { ArticlesUpdateRequestOwnedBy } from "../../../../types/ArticlesUpdateRequestOwnedBy"; +import { ArticlesUpdateRequestReorder } from "../../../../types/ArticlesUpdateRequestReorder"; +import { ArticlesUpdateRequestSharedWith } from "../../../../types/ArticlesUpdateRequestSharedWith"; +import { ArticleStatus } from "../../../../types/ArticleStatus"; +import { ArticlesUpdateRequestTags } from "../../../../types/ArticlesUpdateRequestTags"; + +export const ArticlesUpdateRequest: core.serialization.Schema< + serializers.ArticlesUpdateRequest.Raw, + DevRev.ArticlesUpdateRequest +> = core.serialization.object({ + accessLevel: core.serialization.property("access_level", AccessLevel.optional()), + appliesToParts: core.serialization.property("applies_to_parts", ArticlesUpdateRequestAppliesToParts.optional()), + artifacts: ArticlesUpdateRequestArtifacts.optional(), + authoredBy: core.serialization.property("authored_by", ArticlesUpdateRequestAuthoredBy.optional()), + description: core.serialization.string().optional(), + extractedContent: core.serialization.property( + "extracted_content", + ArticlesUpdateRequestExtractedContent.optional() + ), + id: core.serialization.string(), + language: core.serialization.string().optional(), + ownedBy: core.serialization.property("owned_by", ArticlesUpdateRequestOwnedBy.optional()), + parent: core.serialization.string().optional(), + publishedVersion: core.serialization.property("published_version", core.serialization.string().optional()), + reorder: ArticlesUpdateRequestReorder.optional(), + sharedWith: core.serialization.property("shared_with", ArticlesUpdateRequestSharedWith.optional()), + status: ArticleStatus.optional(), + tags: ArticlesUpdateRequestTags.optional(), + title: core.serialization.string().optional(), + url: core.serialization.string().optional(), +}); + +export declare namespace ArticlesUpdateRequest { + interface Raw { + access_level?: AccessLevel.Raw | null; + applies_to_parts?: ArticlesUpdateRequestAppliesToParts.Raw | null; + artifacts?: ArticlesUpdateRequestArtifacts.Raw | null; + authored_by?: ArticlesUpdateRequestAuthoredBy.Raw | null; + description?: string | null; + extracted_content?: ArticlesUpdateRequestExtractedContent.Raw | null; + id: string; + language?: string | null; + owned_by?: ArticlesUpdateRequestOwnedBy.Raw | null; + parent?: string | null; + published_version?: string | null; + reorder?: ArticlesUpdateRequestReorder.Raw | null; + shared_with?: ArticlesUpdateRequestSharedWith.Raw | null; + status?: ArticleStatus.Raw | null; + tags?: ArticlesUpdateRequestTags.Raw | null; + title?: string | null; + url?: string | null; + } +} diff --git a/src/serialization/resources/articles/client/requests/index.ts b/src/serialization/resources/articles/client/requests/index.ts new file mode 100644 index 0000000..940f354 --- /dev/null +++ b/src/serialization/resources/articles/client/requests/index.ts @@ -0,0 +1,6 @@ +export { ArticlesCountRequest } from "./ArticlesCountRequest"; +export { ArticlesCreateRequest } from "./ArticlesCreateRequest"; +export { ArticlesDeleteRequest } from "./ArticlesDeleteRequest"; +export { ArticlesGetRequest } from "./ArticlesGetRequest"; +export { ArticlesListRequest } from "./ArticlesListRequest"; +export { ArticlesUpdateRequest } from "./ArticlesUpdateRequest"; diff --git a/src/serialization/resources/articles/index.ts b/src/serialization/resources/articles/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/articles/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/artifacts/client/index.ts b/src/serialization/resources/artifacts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/artifacts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/artifacts/client/requests/ArtifactsPrepareRequest.ts b/src/serialization/resources/artifacts/client/requests/ArtifactsPrepareRequest.ts new file mode 100644 index 0000000..9814b1b --- /dev/null +++ b/src/serialization/resources/artifacts/client/requests/ArtifactsPrepareRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ArtifactsPrepareRequest: core.serialization.Schema< + serializers.ArtifactsPrepareRequest.Raw, + DevRev.ArtifactsPrepareRequest +> = core.serialization.object({ + fileName: core.serialization.property("file_name", core.serialization.string()), + fileType: core.serialization.property("file_type", core.serialization.string().optional()), +}); + +export declare namespace ArtifactsPrepareRequest { + interface Raw { + file_name: string; + file_type?: string | null; + } +} diff --git a/src/serialization/resources/artifacts/client/requests/ArtifactsVersionsPrepareRequest.ts b/src/serialization/resources/artifacts/client/requests/ArtifactsVersionsPrepareRequest.ts new file mode 100644 index 0000000..0d3c5d6 --- /dev/null +++ b/src/serialization/resources/artifacts/client/requests/ArtifactsVersionsPrepareRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ArtifactsVersionsPrepareRequest: core.serialization.Schema< + serializers.ArtifactsVersionsPrepareRequest.Raw, + DevRev.ArtifactsVersionsPrepareRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace ArtifactsVersionsPrepareRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/artifacts/client/requests/index.ts b/src/serialization/resources/artifacts/client/requests/index.ts new file mode 100644 index 0000000..7b0ab45 --- /dev/null +++ b/src/serialization/resources/artifacts/client/requests/index.ts @@ -0,0 +1,2 @@ +export { ArtifactsPrepareRequest } from "./ArtifactsPrepareRequest"; +export { ArtifactsVersionsPrepareRequest } from "./ArtifactsVersionsPrepareRequest"; diff --git a/src/serialization/resources/artifacts/index.ts b/src/serialization/resources/artifacts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/artifacts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/codeChanges/client/index.ts b/src/serialization/resources/codeChanges/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/codeChanges/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/codeChanges/client/requests/CodeChangesDeleteRequest.ts b/src/serialization/resources/codeChanges/client/requests/CodeChangesDeleteRequest.ts new file mode 100644 index 0000000..e73a1ba --- /dev/null +++ b/src/serialization/resources/codeChanges/client/requests/CodeChangesDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CodeChangesDeleteRequest: core.serialization.Schema< + serializers.CodeChangesDeleteRequest.Raw, + DevRev.CodeChangesDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace CodeChangesDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/codeChanges/client/requests/CodeChangesGetRequest.ts b/src/serialization/resources/codeChanges/client/requests/CodeChangesGetRequest.ts new file mode 100644 index 0000000..b39c852 --- /dev/null +++ b/src/serialization/resources/codeChanges/client/requests/CodeChangesGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CodeChangesGetRequest: core.serialization.Schema< + serializers.CodeChangesGetRequest.Raw, + DevRev.CodeChangesGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace CodeChangesGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/codeChanges/client/requests/CodeChangesListRequest.ts b/src/serialization/resources/codeChanges/client/requests/CodeChangesListRequest.ts new file mode 100644 index 0000000..1fd25ab --- /dev/null +++ b/src/serialization/resources/codeChanges/client/requests/CodeChangesListRequest.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DateFilter } from "../../../../types/DateFilter"; +import { ListMode } from "../../../../types/ListMode"; + +export const CodeChangesListRequest: core.serialization.Schema< + serializers.CodeChangesListRequest.Raw, + DevRev.CodeChangesListRequest +> = core.serialization.object({ + createdDate: core.serialization.property("created_date", DateFilter.optional()), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedDate: core.serialization.property("modified_date", DateFilter.optional()), +}); + +export declare namespace CodeChangesListRequest { + interface Raw { + created_date?: DateFilter.Raw | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_date?: DateFilter.Raw | null; + } +} diff --git a/src/serialization/resources/codeChanges/client/requests/CodeChangesUpdateRequest.ts b/src/serialization/resources/codeChanges/client/requests/CodeChangesUpdateRequest.ts new file mode 100644 index 0000000..01b4cca --- /dev/null +++ b/src/serialization/resources/codeChanges/client/requests/CodeChangesUpdateRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CodeChangesUpdateRequest: core.serialization.Schema< + serializers.CodeChangesUpdateRequest.Raw, + DevRev.CodeChangesUpdateRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace CodeChangesUpdateRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/codeChanges/client/requests/index.ts b/src/serialization/resources/codeChanges/client/requests/index.ts new file mode 100644 index 0000000..a9223c9 --- /dev/null +++ b/src/serialization/resources/codeChanges/client/requests/index.ts @@ -0,0 +1,4 @@ +export { CodeChangesDeleteRequest } from "./CodeChangesDeleteRequest"; +export { CodeChangesGetRequest } from "./CodeChangesGetRequest"; +export { CodeChangesListRequest } from "./CodeChangesListRequest"; +export { CodeChangesUpdateRequest } from "./CodeChangesUpdateRequest"; diff --git a/src/serialization/resources/codeChanges/index.ts b/src/serialization/resources/codeChanges/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/codeChanges/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/conversations/client/index.ts b/src/serialization/resources/conversations/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/conversations/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/conversations/client/requests/ConversationsCreateRequest.ts b/src/serialization/resources/conversations/client/requests/ConversationsCreateRequest.ts new file mode 100644 index 0000000..63ec3af --- /dev/null +++ b/src/serialization/resources/conversations/client/requests/ConversationsCreateRequest.ts @@ -0,0 +1,47 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ConversationsCreateRequestMessage } from "../../../../types/ConversationsCreateRequestMessage"; +import { ConversationsCreateRequestMetadata } from "../../../../types/ConversationsCreateRequestMetadata"; +import { StageInit } from "../../../../types/StageInit"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const ConversationsCreateRequest: core.serialization.Schema< + serializers.ConversationsCreateRequest.Raw, + DevRev.ConversationsCreateRequest +> = core.serialization.object({ + description: core.serialization.string().optional(), + group: core.serialization.string().optional(), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + members: core.serialization.list(core.serialization.string()).optional(), + messages: core.serialization.list(ConversationsCreateRequestMessage).optional(), + metadata: ConversationsCreateRequestMetadata.optional(), + sourceChannel: core.serialization.property("source_channel", core.serialization.string().optional()), + stage: StageInit.optional(), + tags: core.serialization.list(SetTagWithValue).optional(), + title: core.serialization.string().optional(), + userSessions: core.serialization.property( + "user_sessions", + core.serialization.list(core.serialization.string()).optional() + ), +}); + +export declare namespace ConversationsCreateRequest { + interface Raw { + description?: string | null; + group?: string | null; + is_spam?: boolean | null; + members?: string[] | null; + messages?: ConversationsCreateRequestMessage.Raw[] | null; + metadata?: ConversationsCreateRequestMetadata.Raw | null; + source_channel?: string | null; + stage?: StageInit.Raw | null; + tags?: SetTagWithValue.Raw[] | null; + title?: string | null; + user_sessions?: string[] | null; + } +} diff --git a/src/serialization/resources/conversations/client/requests/ConversationsDeleteRequest.ts b/src/serialization/resources/conversations/client/requests/ConversationsDeleteRequest.ts new file mode 100644 index 0000000..34723cb --- /dev/null +++ b/src/serialization/resources/conversations/client/requests/ConversationsDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ConversationsDeleteRequest: core.serialization.Schema< + serializers.ConversationsDeleteRequest.Raw, + DevRev.ConversationsDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace ConversationsDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/conversations/client/requests/ConversationsExportRequest.ts b/src/serialization/resources/conversations/client/requests/ConversationsExportRequest.ts new file mode 100644 index 0000000..8b0dcec --- /dev/null +++ b/src/serialization/resources/conversations/client/requests/ConversationsExportRequest.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SlaSummaryFilter } from "../../../../types/SlaSummaryFilter"; +import { StageFilter } from "../../../../types/StageFilter"; +import { TagWithValueFilter } from "../../../../types/TagWithValueFilter"; + +export const ConversationsExportRequest: core.serialization.Schema< + serializers.ConversationsExportRequest.Raw, + DevRev.ConversationsExportRequest +> = core.serialization.object({ + appliesToParts: core.serialization.property( + "applies_to_parts", + core.serialization.list(core.serialization.string()).optional() + ), + first: core.serialization.number().optional(), + group: core.serialization.list(core.serialization.string()).optional(), + isCreatorVerified: core.serialization.property("is_creator_verified", core.serialization.boolean().optional()), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + members: core.serialization.list(core.serialization.string()).optional(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + revOrg: core.serialization.property("rev_org", core.serialization.list(core.serialization.string()).optional()), + slaSummary: core.serialization.property("sla_summary", SlaSummaryFilter.optional()), + sourceChannels: core.serialization.property( + "source_channels", + core.serialization.list(core.serialization.string()).optional() + ), + stage: StageFilter.optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + tagsV2: core.serialization.property("tags_v2", core.serialization.list(TagWithValueFilter).optional()), +}); + +export declare namespace ConversationsExportRequest { + interface Raw { + applies_to_parts?: string[] | null; + first?: number | null; + group?: string[] | null; + is_creator_verified?: boolean | null; + is_spam?: boolean | null; + members?: string[] | null; + owned_by?: string[] | null; + rev_org?: string[] | null; + sla_summary?: SlaSummaryFilter.Raw | null; + source_channels?: string[] | null; + stage?: StageFilter.Raw | null; + tags?: string[] | null; + tags_v2?: TagWithValueFilter.Raw[] | null; + } +} diff --git a/src/serialization/resources/conversations/client/requests/ConversationsGetRequest.ts b/src/serialization/resources/conversations/client/requests/ConversationsGetRequest.ts new file mode 100644 index 0000000..4350754 --- /dev/null +++ b/src/serialization/resources/conversations/client/requests/ConversationsGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ConversationsGetRequest: core.serialization.Schema< + serializers.ConversationsGetRequest.Raw, + DevRev.ConversationsGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace ConversationsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/conversations/client/requests/ConversationsListRequest.ts b/src/serialization/resources/conversations/client/requests/ConversationsListRequest.ts new file mode 100644 index 0000000..9fe5772 --- /dev/null +++ b/src/serialization/resources/conversations/client/requests/ConversationsListRequest.ts @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ListMode } from "../../../../types/ListMode"; +import { SlaSummaryFilter } from "../../../../types/SlaSummaryFilter"; +import { StageFilter } from "../../../../types/StageFilter"; +import { TagWithValueFilter } from "../../../../types/TagWithValueFilter"; + +export const ConversationsListRequest: core.serialization.Schema< + serializers.ConversationsListRequest.Raw, + DevRev.ConversationsListRequest +> = core.serialization.object({ + appliesToParts: core.serialization.property( + "applies_to_parts", + core.serialization.list(core.serialization.string()).optional() + ), + cursor: core.serialization.string().optional(), + group: core.serialization.list(core.serialization.string()).optional(), + isCreatorVerified: core.serialization.property("is_creator_verified", core.serialization.boolean().optional()), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + limit: core.serialization.number().optional(), + members: core.serialization.list(core.serialization.string()).optional(), + mode: ListMode.optional(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + revOrg: core.serialization.property("rev_org", core.serialization.list(core.serialization.string()).optional()), + slaSummary: core.serialization.property("sla_summary", SlaSummaryFilter.optional()), + sourceChannels: core.serialization.property( + "source_channels", + core.serialization.list(core.serialization.string()).optional() + ), + stage: StageFilter.optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + tagsV2: core.serialization.property("tags_v2", core.serialization.list(TagWithValueFilter).optional()), +}); + +export declare namespace ConversationsListRequest { + interface Raw { + applies_to_parts?: string[] | null; + cursor?: string | null; + group?: string[] | null; + is_creator_verified?: boolean | null; + is_spam?: boolean | null; + limit?: number | null; + members?: string[] | null; + mode?: ListMode.Raw | null; + owned_by?: string[] | null; + rev_org?: string[] | null; + sla_summary?: SlaSummaryFilter.Raw | null; + source_channels?: string[] | null; + stage?: StageFilter.Raw | null; + tags?: string[] | null; + tags_v2?: TagWithValueFilter.Raw[] | null; + } +} diff --git a/src/serialization/resources/conversations/client/requests/ConversationsUpdateRequest.ts b/src/serialization/resources/conversations/client/requests/ConversationsUpdateRequest.ts new file mode 100644 index 0000000..b75740e --- /dev/null +++ b/src/serialization/resources/conversations/client/requests/ConversationsUpdateRequest.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ConversationsUpdateRequestAppliesToParts } from "../../../../types/ConversationsUpdateRequestAppliesToParts"; +import { ConversationsUpdateRequestMetadata } from "../../../../types/ConversationsUpdateRequestMetadata"; +import { StageUpdate } from "../../../../types/StageUpdate"; +import { ConversationsUpdateRequestTags } from "../../../../types/ConversationsUpdateRequestTags"; +import { ConversationsUpdateRequestUserSessions } from "../../../../types/ConversationsUpdateRequestUserSessions"; + +export const ConversationsUpdateRequest: core.serialization.Schema< + serializers.ConversationsUpdateRequest.Raw, + DevRev.ConversationsUpdateRequest +> = core.serialization.object({ + appliesToParts: core.serialization.property( + "applies_to_parts", + ConversationsUpdateRequestAppliesToParts.optional() + ), + description: core.serialization.string().optional(), + group: core.serialization.string().optional(), + id: core.serialization.string(), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + metadata: ConversationsUpdateRequestMetadata.optional(), + stage: StageUpdate.optional(), + status: core.serialization.string().optional(), + tags: ConversationsUpdateRequestTags.optional(), + title: core.serialization.string().optional(), + userSessions: core.serialization.property("user_sessions", ConversationsUpdateRequestUserSessions.optional()), +}); + +export declare namespace ConversationsUpdateRequest { + interface Raw { + applies_to_parts?: ConversationsUpdateRequestAppliesToParts.Raw | null; + description?: string | null; + group?: string | null; + id: string; + is_spam?: boolean | null; + metadata?: ConversationsUpdateRequestMetadata.Raw | null; + stage?: StageUpdate.Raw | null; + status?: string | null; + tags?: ConversationsUpdateRequestTags.Raw | null; + title?: string | null; + user_sessions?: ConversationsUpdateRequestUserSessions.Raw | null; + } +} diff --git a/src/serialization/resources/conversations/client/requests/index.ts b/src/serialization/resources/conversations/client/requests/index.ts new file mode 100644 index 0000000..a06ebd4 --- /dev/null +++ b/src/serialization/resources/conversations/client/requests/index.ts @@ -0,0 +1,6 @@ +export { ConversationsCreateRequest } from "./ConversationsCreateRequest"; +export { ConversationsDeleteRequest } from "./ConversationsDeleteRequest"; +export { ConversationsExportRequest } from "./ConversationsExportRequest"; +export { ConversationsGetRequest } from "./ConversationsGetRequest"; +export { ConversationsListRequest } from "./ConversationsListRequest"; +export { ConversationsUpdateRequest } from "./ConversationsUpdateRequest"; diff --git a/src/serialization/resources/conversations/index.ts b/src/serialization/resources/conversations/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/conversations/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/customization/client/index.ts b/src/serialization/resources/customization/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/customization/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/customization/client/requests/AggregatedSchemaGetRequest.ts b/src/serialization/resources/customization/client/requests/AggregatedSchemaGetRequest.ts new file mode 100644 index 0000000..73ef34b --- /dev/null +++ b/src/serialization/resources/customization/client/requests/AggregatedSchemaGetRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { FieldDescriptor } from "../../../../types/FieldDescriptor"; + +export const AggregatedSchemaGetRequest: core.serialization.Schema< + serializers.AggregatedSchemaGetRequest.Raw, + DevRev.AggregatedSchemaGetRequest +> = core.serialization.object({ + customSchemaFragmentIds: core.serialization.property( + "custom_schema_fragment_ids", + core.serialization.list(core.serialization.string()) + ), + leafType: core.serialization.property("leaf_type", core.serialization.string().optional()), + perObjectSchema: core.serialization.property( + "per_object_schema", + core.serialization.list(FieldDescriptor).optional() + ), + stockSchemaFragmentId: core.serialization.property( + "stock_schema_fragment_id", + core.serialization.string().optional() + ), +}); + +export declare namespace AggregatedSchemaGetRequest { + interface Raw { + custom_schema_fragment_ids: string[]; + leaf_type?: string | null; + per_object_schema?: FieldDescriptor.Raw[] | null; + stock_schema_fragment_id?: string | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomSchemaFragmentsGetRequest.ts b/src/serialization/resources/customization/client/requests/CustomSchemaFragmentsGetRequest.ts new file mode 100644 index 0000000..5efee97 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomSchemaFragmentsGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomSchemaFragmentsGetRequest: core.serialization.Schema< + serializers.CustomSchemaFragmentsGetRequest.Raw, + DevRev.CustomSchemaFragmentsGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace CustomSchemaFragmentsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomSchemaFragmentsListRequest.ts b/src/serialization/resources/customization/client/requests/CustomSchemaFragmentsListRequest.ts new file mode 100644 index 0000000..2d25106 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomSchemaFragmentsListRequest.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ListMode } from "../../../../types/ListMode"; +import { CustomSchemaFragmentsListRequestPrune } from "../../../../types/CustomSchemaFragmentsListRequestPrune"; +import { CustomSchemaFragmentType } from "../../../../types/CustomSchemaFragmentType"; + +export const CustomSchemaFragmentsListRequest: core.serialization.Schema< + serializers.CustomSchemaFragmentsListRequest.Raw, + DevRev.CustomSchemaFragmentsListRequest +> = core.serialization.object({ + app: core.serialization.list(core.serialization.string()).optional(), + cursor: core.serialization.string().optional(), + deprecated: core.serialization.boolean().optional(), + leafType: core.serialization.property("leaf_type", core.serialization.list(core.serialization.string()).optional()), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + prune: core.serialization.list(CustomSchemaFragmentsListRequestPrune).optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + subtype: core.serialization.list(core.serialization.string()).optional(), + types: core.serialization.list(CustomSchemaFragmentType).optional(), +}); + +export declare namespace CustomSchemaFragmentsListRequest { + interface Raw { + app?: string[] | null; + cursor?: string | null; + deprecated?: boolean | null; + leaf_type?: string[] | null; + limit?: number | null; + mode?: ListMode.Raw | null; + prune?: CustomSchemaFragmentsListRequestPrune.Raw[] | null; + sort_by?: string[] | null; + subtype?: string[] | null; + types?: CustomSchemaFragmentType.Raw[] | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStagesCreateRequest.ts b/src/serialization/resources/customization/client/requests/CustomStagesCreateRequest.ts new file mode 100644 index 0000000..1798d32 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStagesCreateRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStagesCreateRequest: core.serialization.Schema< + serializers.CustomStagesCreateRequest.Raw, + DevRev.CustomStagesCreateRequest +> = core.serialization.object({ + marketplaceRef: core.serialization.property("marketplace_ref", core.serialization.string().optional()), + name: core.serialization.string(), + ordinal: core.serialization.number(), + state: core.serialization.string(), +}); + +export declare namespace CustomStagesCreateRequest { + interface Raw { + marketplace_ref?: string | null; + name: string; + ordinal: number; + state: string; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStagesGetRequest.ts b/src/serialization/resources/customization/client/requests/CustomStagesGetRequest.ts new file mode 100644 index 0000000..2022989 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStagesGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStagesGetRequest: core.serialization.Schema< + serializers.CustomStagesGetRequest.Raw, + DevRev.CustomStagesGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace CustomStagesGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStagesListRequest.ts b/src/serialization/resources/customization/client/requests/CustomStagesListRequest.ts new file mode 100644 index 0000000..70be7b7 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStagesListRequest.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStagesListRequest: core.serialization.Schema< + serializers.CustomStagesListRequest.Raw, + DevRev.CustomStagesListRequest +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + name: core.serialization.list(core.serialization.string()).optional(), + ordinal: core.serialization.list(core.serialization.number()).optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace CustomStagesListRequest { + interface Raw { + cursor?: string | null; + limit?: number | null; + name?: string[] | null; + ordinal?: number[] | null; + sort_by?: string[] | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStagesUpdateRequest.ts b/src/serialization/resources/customization/client/requests/CustomStagesUpdateRequest.ts new file mode 100644 index 0000000..fb6bed6 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStagesUpdateRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStagesUpdateRequest: core.serialization.Schema< + serializers.CustomStagesUpdateRequest.Raw, + DevRev.CustomStagesUpdateRequest +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string().optional(), + ordinal: core.serialization.number().optional(), + stateId: core.serialization.property("state_id", core.serialization.string().optional()), +}); + +export declare namespace CustomStagesUpdateRequest { + interface Raw { + id: string; + name?: string | null; + ordinal?: number | null; + state_id?: string | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStatesCreateRequest.ts b/src/serialization/resources/customization/client/requests/CustomStatesCreateRequest.ts new file mode 100644 index 0000000..713b89b --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStatesCreateRequest.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStatesCreateRequest: core.serialization.Schema< + serializers.CustomStatesCreateRequest.Raw, + DevRev.CustomStatesCreateRequest +> = core.serialization.object({ + isFinal: core.serialization.property("is_final", core.serialization.boolean().optional()), + name: core.serialization.string(), + ordinal: core.serialization.number(), +}); + +export declare namespace CustomStatesCreateRequest { + interface Raw { + is_final?: boolean | null; + name: string; + ordinal: number; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStatesGetRequest.ts b/src/serialization/resources/customization/client/requests/CustomStatesGetRequest.ts new file mode 100644 index 0000000..6d806fa --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStatesGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStatesGetRequest: core.serialization.Schema< + serializers.CustomStatesGetRequest.Raw, + DevRev.CustomStatesGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace CustomStatesGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStatesListRequest.ts b/src/serialization/resources/customization/client/requests/CustomStatesListRequest.ts new file mode 100644 index 0000000..b780144 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStatesListRequest.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStatesListRequest: core.serialization.Schema< + serializers.CustomStatesListRequest.Raw, + DevRev.CustomStatesListRequest +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + isFinal: core.serialization.property("is_final", core.serialization.boolean().optional()), + limit: core.serialization.number().optional(), + name: core.serialization.list(core.serialization.string()).optional(), + ordinal: core.serialization.list(core.serialization.number()).optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace CustomStatesListRequest { + interface Raw { + cursor?: string | null; + is_final?: boolean | null; + limit?: number | null; + name?: string[] | null; + ordinal?: number[] | null; + sort_by?: string[] | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/CustomStatesUpdateRequest.ts b/src/serialization/resources/customization/client/requests/CustomStatesUpdateRequest.ts new file mode 100644 index 0000000..5d4171f --- /dev/null +++ b/src/serialization/resources/customization/client/requests/CustomStatesUpdateRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CustomStatesUpdateRequest: core.serialization.Schema< + serializers.CustomStatesUpdateRequest.Raw, + DevRev.CustomStatesUpdateRequest +> = core.serialization.object({ + id: core.serialization.string(), + isFinal: core.serialization.property("is_final", core.serialization.boolean().optional()), + name: core.serialization.string().optional(), + ordinal: core.serialization.number().optional(), +}); + +export declare namespace CustomStatesUpdateRequest { + interface Raw { + id: string; + is_final?: boolean | null; + name?: string | null; + ordinal?: number | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/StockSchemaFragmentsGetRequest.ts b/src/serialization/resources/customization/client/requests/StockSchemaFragmentsGetRequest.ts new file mode 100644 index 0000000..ba1471a --- /dev/null +++ b/src/serialization/resources/customization/client/requests/StockSchemaFragmentsGetRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const StockSchemaFragmentsGetRequest: core.serialization.Schema< + serializers.StockSchemaFragmentsGetRequest.Raw, + DevRev.StockSchemaFragmentsGetRequest +> = core.serialization.object({ + id: core.serialization.string().optional(), + leafType: core.serialization.property("leaf_type", core.serialization.string().optional()), +}); + +export declare namespace StockSchemaFragmentsGetRequest { + interface Raw { + id?: string | null; + leaf_type?: string | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/StockSchemaFragmentsListRequest.ts b/src/serialization/resources/customization/client/requests/StockSchemaFragmentsListRequest.ts new file mode 100644 index 0000000..c61e5b5 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/StockSchemaFragmentsListRequest.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { StockSchemaFragmentsListRequestFilterPreset } from "../../../../types/StockSchemaFragmentsListRequestFilterPreset"; +import { ListMode } from "../../../../types/ListMode"; +import { StockSchemaFragmentsListRequestPrune } from "../../../../types/StockSchemaFragmentsListRequestPrune"; + +export const StockSchemaFragmentsListRequest: core.serialization.Schema< + serializers.StockSchemaFragmentsListRequest.Raw, + DevRev.StockSchemaFragmentsListRequest +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + filterPreset: core.serialization.property("filter_preset", StockSchemaFragmentsListRequestFilterPreset.optional()), + leafType: core.serialization.property("leaf_type", core.serialization.list(core.serialization.string()).optional()), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + prune: core.serialization.list(StockSchemaFragmentsListRequestPrune).optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace StockSchemaFragmentsListRequest { + interface Raw { + cursor?: string | null; + filter_preset?: StockSchemaFragmentsListRequestFilterPreset.Raw | null; + leaf_type?: string[] | null; + limit?: number | null; + mode?: ListMode.Raw | null; + prune?: StockSchemaFragmentsListRequestPrune.Raw[] | null; + sort_by?: string[] | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/SubtypesListRequest.ts b/src/serialization/resources/customization/client/requests/SubtypesListRequest.ts new file mode 100644 index 0000000..9dd896a --- /dev/null +++ b/src/serialization/resources/customization/client/requests/SubtypesListRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SubtypesListRequest: core.serialization.Schema< + serializers.SubtypesListRequest.Raw, + DevRev.SubtypesListRequest +> = core.serialization.object({ + leafType: core.serialization.property("leaf_type", core.serialization.string().optional()), + leafTypes: core.serialization.property( + "leaf_types", + core.serialization.list(core.serialization.string()).optional() + ), +}); + +export declare namespace SubtypesListRequest { + interface Raw { + leaf_type?: string | null; + leaf_types?: string[] | null; + } +} diff --git a/src/serialization/resources/customization/client/requests/index.ts b/src/serialization/resources/customization/client/requests/index.ts new file mode 100644 index 0000000..9886537 --- /dev/null +++ b/src/serialization/resources/customization/client/requests/index.ts @@ -0,0 +1,14 @@ +export { AggregatedSchemaGetRequest } from "./AggregatedSchemaGetRequest"; +export { CustomSchemaFragmentsGetRequest } from "./CustomSchemaFragmentsGetRequest"; +export { CustomSchemaFragmentsListRequest } from "./CustomSchemaFragmentsListRequest"; +export { StockSchemaFragmentsGetRequest } from "./StockSchemaFragmentsGetRequest"; +export { StockSchemaFragmentsListRequest } from "./StockSchemaFragmentsListRequest"; +export { SubtypesListRequest } from "./SubtypesListRequest"; +export { CustomStagesCreateRequest } from "./CustomStagesCreateRequest"; +export { CustomStagesGetRequest } from "./CustomStagesGetRequest"; +export { CustomStagesListRequest } from "./CustomStagesListRequest"; +export { CustomStagesUpdateRequest } from "./CustomStagesUpdateRequest"; +export { CustomStatesCreateRequest } from "./CustomStatesCreateRequest"; +export { CustomStatesGetRequest } from "./CustomStatesGetRequest"; +export { CustomStatesListRequest } from "./CustomStatesListRequest"; +export { CustomStatesUpdateRequest } from "./CustomStatesUpdateRequest"; diff --git a/src/serialization/resources/customization/index.ts b/src/serialization/resources/customization/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/customization/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/devUsers/client/index.ts b/src/serialization/resources/devUsers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/devUsers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/devUsers/client/requests/DevUsersIdentitiesLinkRequest.ts b/src/serialization/resources/devUsers/client/requests/DevUsersIdentitiesLinkRequest.ts new file mode 100644 index 0000000..f707c31 --- /dev/null +++ b/src/serialization/resources/devUsers/client/requests/DevUsersIdentitiesLinkRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const DevUsersIdentitiesLinkRequest: core.serialization.Schema< + serializers.DevUsersIdentitiesLinkRequest.Raw, + DevRev.DevUsersIdentitiesLinkRequest +> = core.serialization.object({ + devUser: core.serialization.property("dev_user", core.serialization.string()), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + id: core.serialization.string(), + issuer: core.serialization.string(), +}); + +export declare namespace DevUsersIdentitiesLinkRequest { + interface Raw { + dev_user: string; + display_name?: string | null; + id: string; + issuer: string; + } +} diff --git a/src/serialization/resources/devUsers/client/requests/DevUsersIdentitiesUnlinkRequest.ts b/src/serialization/resources/devUsers/client/requests/DevUsersIdentitiesUnlinkRequest.ts new file mode 100644 index 0000000..ea34771 --- /dev/null +++ b/src/serialization/resources/devUsers/client/requests/DevUsersIdentitiesUnlinkRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const DevUsersIdentitiesUnlinkRequest: core.serialization.Schema< + serializers.DevUsersIdentitiesUnlinkRequest.Raw, + DevRev.DevUsersIdentitiesUnlinkRequest +> = core.serialization.object({ + devUser: core.serialization.property("dev_user", core.serialization.string()), + issuer: core.serialization.string(), +}); + +export declare namespace DevUsersIdentitiesUnlinkRequest { + interface Raw { + dev_user: string; + issuer: string; + } +} diff --git a/src/serialization/resources/devUsers/client/requests/DevUsersSelfUpdateRequest.ts b/src/serialization/resources/devUsers/client/requests/DevUsersSelfUpdateRequest.ts new file mode 100644 index 0000000..b5f0a5a --- /dev/null +++ b/src/serialization/resources/devUsers/client/requests/DevUsersSelfUpdateRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DevUserJobTitle } from "../../../../types/DevUserJobTitle"; + +export const DevUsersSelfUpdateRequest: core.serialization.Schema< + serializers.DevUsersSelfUpdateRequest.Raw, + DevRev.DevUsersSelfUpdateRequest +> = core.serialization.object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + fullName: core.serialization.property("full_name", core.serialization.string().optional()), + jobTitle: core.serialization.property("job_title", DevUserJobTitle.optional()), +}); + +export declare namespace DevUsersSelfUpdateRequest { + interface Raw { + display_name?: string | null; + full_name?: string | null; + job_title?: DevUserJobTitle.Raw | null; + } +} diff --git a/src/serialization/resources/devUsers/client/requests/DevUsersUpdateRequest.ts b/src/serialization/resources/devUsers/client/requests/DevUsersUpdateRequest.ts new file mode 100644 index 0000000..88ffafa --- /dev/null +++ b/src/serialization/resources/devUsers/client/requests/DevUsersUpdateRequest.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DevUserJobTitle } from "../../../../types/DevUserJobTitle"; + +export const DevUsersUpdateRequest: core.serialization.Schema< + serializers.DevUsersUpdateRequest.Raw, + DevRev.DevUsersUpdateRequest +> = core.serialization.object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + fullName: core.serialization.property("full_name", core.serialization.string().optional()), + id: core.serialization.string(), + jobTitle: core.serialization.property("job_title", DevUserJobTitle.optional()), +}); + +export declare namespace DevUsersUpdateRequest { + interface Raw { + display_name?: string | null; + full_name?: string | null; + id: string; + job_title?: DevUserJobTitle.Raw | null; + } +} diff --git a/src/serialization/resources/devUsers/client/requests/index.ts b/src/serialization/resources/devUsers/client/requests/index.ts new file mode 100644 index 0000000..05ffb3b --- /dev/null +++ b/src/serialization/resources/devUsers/client/requests/index.ts @@ -0,0 +1,4 @@ +export { DevUsersIdentitiesLinkRequest } from "./DevUsersIdentitiesLinkRequest"; +export { DevUsersIdentitiesUnlinkRequest } from "./DevUsersIdentitiesUnlinkRequest"; +export { DevUsersSelfUpdateRequest } from "./DevUsersSelfUpdateRequest"; +export { DevUsersUpdateRequest } from "./DevUsersUpdateRequest"; diff --git a/src/serialization/resources/devUsers/index.ts b/src/serialization/resources/devUsers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/devUsers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/engagements/client/index.ts b/src/serialization/resources/engagements/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/engagements/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/engagements/client/requests/EngagementsCountRequest.ts b/src/serialization/resources/engagements/client/requests/EngagementsCountRequest.ts new file mode 100644 index 0000000..b5c3c03 --- /dev/null +++ b/src/serialization/resources/engagements/client/requests/EngagementsCountRequest.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { EngagementType } from "../../../../types/EngagementType"; + +export const EngagementsCountRequest: core.serialization.Schema< + serializers.EngagementsCountRequest.Raw, + DevRev.EngagementsCountRequest +> = core.serialization.object({ + type: core.serialization.list(EngagementType).optional(), + externalRef: core.serialization.property( + "external_ref", + core.serialization.list(core.serialization.string()).optional() + ), + members: core.serialization.list(core.serialization.string()).optional(), + parent: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace EngagementsCountRequest { + interface Raw { + type?: EngagementType.Raw[] | null; + external_ref?: string[] | null; + members?: string[] | null; + parent?: string[] | null; + } +} diff --git a/src/serialization/resources/engagements/client/requests/EngagementsCreateRequest.ts b/src/serialization/resources/engagements/client/requests/EngagementsCreateRequest.ts new file mode 100644 index 0000000..3e9e88c --- /dev/null +++ b/src/serialization/resources/engagements/client/requests/EngagementsCreateRequest.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { EngagementsCreateRequestEngagementType } from "../../../../types/EngagementsCreateRequestEngagementType"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const EngagementsCreateRequest: core.serialization.Schema< + serializers.EngagementsCreateRequest.Raw, + DevRev.EngagementsCreateRequest +> = core.serialization.object({ + artifacts: core.serialization.list(core.serialization.string()).optional(), + description: core.serialization.string().optional(), + engagementType: core.serialization.property("engagement_type", EngagementsCreateRequestEngagementType.optional()), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + externalUrl: core.serialization.property("external_url", core.serialization.string().optional()), + members: core.serialization.list(core.serialization.string()), + parent: core.serialization.string(), + scheduledDate: core.serialization.property("scheduled_date", core.serialization.date()), + tags: core.serialization.list(SetTagWithValue).optional(), + title: core.serialization.string(), +}); + +export declare namespace EngagementsCreateRequest { + interface Raw { + artifacts?: string[] | null; + description?: string | null; + engagement_type?: EngagementsCreateRequestEngagementType.Raw | null; + external_ref?: string | null; + external_url?: string | null; + members: string[]; + parent: string; + scheduled_date: string; + tags?: SetTagWithValue.Raw[] | null; + title: string; + } +} diff --git a/src/serialization/resources/engagements/client/requests/EngagementsDeleteRequest.ts b/src/serialization/resources/engagements/client/requests/EngagementsDeleteRequest.ts new file mode 100644 index 0000000..20d7da6 --- /dev/null +++ b/src/serialization/resources/engagements/client/requests/EngagementsDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const EngagementsDeleteRequest: core.serialization.Schema< + serializers.EngagementsDeleteRequest.Raw, + DevRev.EngagementsDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EngagementsDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/engagements/client/requests/EngagementsGetRequest.ts b/src/serialization/resources/engagements/client/requests/EngagementsGetRequest.ts new file mode 100644 index 0000000..b5970bf --- /dev/null +++ b/src/serialization/resources/engagements/client/requests/EngagementsGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const EngagementsGetRequest: core.serialization.Schema< + serializers.EngagementsGetRequest.Raw, + DevRev.EngagementsGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EngagementsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/engagements/client/requests/EngagementsListRequest.ts b/src/serialization/resources/engagements/client/requests/EngagementsListRequest.ts new file mode 100644 index 0000000..c71f91e --- /dev/null +++ b/src/serialization/resources/engagements/client/requests/EngagementsListRequest.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { EngagementType } from "../../../../types/EngagementType"; +import { ListMode } from "../../../../types/ListMode"; + +export const EngagementsListRequest: core.serialization.Schema< + serializers.EngagementsListRequest.Raw, + DevRev.EngagementsListRequest +> = core.serialization.object({ + type: core.serialization.list(EngagementType).optional(), + cursor: core.serialization.string().optional(), + externalRef: core.serialization.property( + "external_ref", + core.serialization.list(core.serialization.string()).optional() + ), + limit: core.serialization.number().optional(), + members: core.serialization.list(core.serialization.string()).optional(), + mode: ListMode.optional(), + parent: core.serialization.list(core.serialization.string()).optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace EngagementsListRequest { + interface Raw { + type?: EngagementType.Raw[] | null; + cursor?: string | null; + external_ref?: string[] | null; + limit?: number | null; + members?: string[] | null; + mode?: ListMode.Raw | null; + parent?: string[] | null; + sort_by?: string[] | null; + } +} diff --git a/src/serialization/resources/engagements/client/requests/EngagementsUpdateRequest.ts b/src/serialization/resources/engagements/client/requests/EngagementsUpdateRequest.ts new file mode 100644 index 0000000..1d48397 --- /dev/null +++ b/src/serialization/resources/engagements/client/requests/EngagementsUpdateRequest.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { EngagementsUpdateRequestArtifactIds } from "../../../../types/EngagementsUpdateRequestArtifactIds"; +import { EngagementsUpdateRequestMembers } from "../../../../types/EngagementsUpdateRequestMembers"; +import { EngagementsUpdateRequestTags } from "../../../../types/EngagementsUpdateRequestTags"; + +export const EngagementsUpdateRequest: core.serialization.Schema< + serializers.EngagementsUpdateRequest.Raw, + DevRev.EngagementsUpdateRequest +> = core.serialization.object({ + artifacts: EngagementsUpdateRequestArtifactIds.optional(), + description: core.serialization.string().optional(), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + externalUrl: core.serialization.property("external_url", core.serialization.string().optional()), + id: core.serialization.string(), + members: EngagementsUpdateRequestMembers.optional(), + scheduledDate: core.serialization.property("scheduled_date", core.serialization.date().optional()), + tags: EngagementsUpdateRequestTags.optional(), + title: core.serialization.string().optional(), +}); + +export declare namespace EngagementsUpdateRequest { + interface Raw { + artifacts?: EngagementsUpdateRequestArtifactIds.Raw | null; + description?: string | null; + external_ref?: string | null; + external_url?: string | null; + id: string; + members?: EngagementsUpdateRequestMembers.Raw | null; + scheduled_date?: string | null; + tags?: EngagementsUpdateRequestTags.Raw | null; + title?: string | null; + } +} diff --git a/src/serialization/resources/engagements/client/requests/index.ts b/src/serialization/resources/engagements/client/requests/index.ts new file mode 100644 index 0000000..e05b4f2 --- /dev/null +++ b/src/serialization/resources/engagements/client/requests/index.ts @@ -0,0 +1,6 @@ +export { EngagementsCountRequest } from "./EngagementsCountRequest"; +export { EngagementsCreateRequest } from "./EngagementsCreateRequest"; +export { EngagementsDeleteRequest } from "./EngagementsDeleteRequest"; +export { EngagementsGetRequest } from "./EngagementsGetRequest"; +export { EngagementsListRequest } from "./EngagementsListRequest"; +export { EngagementsUpdateRequest } from "./EngagementsUpdateRequest"; diff --git a/src/serialization/resources/engagements/index.ts b/src/serialization/resources/engagements/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/engagements/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/eventSource/client/index.ts b/src/serialization/resources/eventSource/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/eventSource/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/eventSource/client/requests/EventSourceGetRequest.ts b/src/serialization/resources/eventSource/client/requests/EventSourceGetRequest.ts new file mode 100644 index 0000000..3d3345f --- /dev/null +++ b/src/serialization/resources/eventSource/client/requests/EventSourceGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const EventSourceGetRequest: core.serialization.Schema< + serializers.EventSourceGetRequest.Raw, + DevRev.EventSourceGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EventSourceGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/eventSource/client/requests/EventSourcesDeleteScheduledEventRequest.ts b/src/serialization/resources/eventSource/client/requests/EventSourcesDeleteScheduledEventRequest.ts new file mode 100644 index 0000000..ece3b89 --- /dev/null +++ b/src/serialization/resources/eventSource/client/requests/EventSourcesDeleteScheduledEventRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const EventSourcesDeleteScheduledEventRequest: core.serialization.Schema< + serializers.EventSourcesDeleteScheduledEventRequest.Raw, + DevRev.EventSourcesDeleteScheduledEventRequest +> = core.serialization.object({ + eventKey: core.serialization.property("event_key", core.serialization.string()), + id: core.serialization.string(), +}); + +export declare namespace EventSourcesDeleteScheduledEventRequest { + interface Raw { + event_key: string; + id: string; + } +} diff --git a/src/serialization/resources/eventSource/client/requests/EventSourcesScheduleEventRequest.ts b/src/serialization/resources/eventSource/client/requests/EventSourcesScheduleEventRequest.ts new file mode 100644 index 0000000..9d008ff --- /dev/null +++ b/src/serialization/resources/eventSource/client/requests/EventSourcesScheduleEventRequest.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const EventSourcesScheduleEventRequest: core.serialization.Schema< + serializers.EventSourcesScheduleEventRequest.Raw, + DevRev.EventSourcesScheduleEventRequest +> = core.serialization.object({ + eventKey: core.serialization.property("event_key", core.serialization.string().optional()), + eventType: core.serialization.property("event_type", core.serialization.string()), + id: core.serialization.string(), + payload: core.serialization.string(), + publishAt: core.serialization.property("publish_at", core.serialization.date().optional()), + updateIfExists: core.serialization.property("update_if_exists", core.serialization.boolean().optional()), +}); + +export declare namespace EventSourcesScheduleEventRequest { + interface Raw { + event_key?: string | null; + event_type: string; + id: string; + payload: string; + publish_at?: string | null; + update_if_exists?: boolean | null; + } +} diff --git a/src/serialization/resources/eventSource/client/requests/TrackEventsPublishRequest.ts b/src/serialization/resources/eventSource/client/requests/TrackEventsPublishRequest.ts new file mode 100644 index 0000000..71876d4 --- /dev/null +++ b/src/serialization/resources/eventSource/client/requests/TrackEventsPublishRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { TrackEvent } from "../../../../types/TrackEvent"; + +export const TrackEventsPublishRequest: core.serialization.Schema< + serializers.TrackEventsPublishRequest.Raw, + DevRev.TrackEventsPublishRequest +> = core.serialization.object({ + eventsList: core.serialization.property("events_list", core.serialization.list(TrackEvent)), +}); + +export declare namespace TrackEventsPublishRequest { + interface Raw { + events_list: TrackEvent.Raw[]; + } +} diff --git a/src/serialization/resources/eventSource/client/requests/index.ts b/src/serialization/resources/eventSource/client/requests/index.ts new file mode 100644 index 0000000..87e8ad1 --- /dev/null +++ b/src/serialization/resources/eventSource/client/requests/index.ts @@ -0,0 +1,4 @@ +export { EventSourceGetRequest } from "./EventSourceGetRequest"; +export { EventSourcesScheduleEventRequest } from "./EventSourcesScheduleEventRequest"; +export { EventSourcesDeleteScheduledEventRequest } from "./EventSourcesDeleteScheduledEventRequest"; +export { TrackEventsPublishRequest } from "./TrackEventsPublishRequest"; diff --git a/src/serialization/resources/eventSource/index.ts b/src/serialization/resources/eventSource/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/eventSource/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/groups/client/index.ts b/src/serialization/resources/groups/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/groups/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/groups/client/requests/GroupMembersAddRequest.ts b/src/serialization/resources/groups/client/requests/GroupMembersAddRequest.ts new file mode 100644 index 0000000..7ed6935 --- /dev/null +++ b/src/serialization/resources/groups/client/requests/GroupMembersAddRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const GroupMembersAddRequest: core.serialization.Schema< + serializers.GroupMembersAddRequest.Raw, + DevRev.GroupMembersAddRequest +> = core.serialization.object({ + group: core.serialization.string(), + member: core.serialization.string(), +}); + +export declare namespace GroupMembersAddRequest { + interface Raw { + group: string; + member: string; + } +} diff --git a/src/serialization/resources/groups/client/requests/GroupMembersListRequest.ts b/src/serialization/resources/groups/client/requests/GroupMembersListRequest.ts new file mode 100644 index 0000000..7e6b0bb --- /dev/null +++ b/src/serialization/resources/groups/client/requests/GroupMembersListRequest.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ListMode } from "../../../../types/ListMode"; + +export const GroupMembersListRequest: core.serialization.Schema< + serializers.GroupMembersListRequest.Raw, + DevRev.GroupMembersListRequest +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + group: core.serialization.string(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), +}); + +export declare namespace GroupMembersListRequest { + interface Raw { + cursor?: string | null; + group: string; + limit?: number | null; + mode?: ListMode.Raw | null; + } +} diff --git a/src/serialization/resources/groups/client/requests/GroupMembersRemoveRequest.ts b/src/serialization/resources/groups/client/requests/GroupMembersRemoveRequest.ts new file mode 100644 index 0000000..2ad97a1 --- /dev/null +++ b/src/serialization/resources/groups/client/requests/GroupMembersRemoveRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const GroupMembersRemoveRequest: core.serialization.Schema< + serializers.GroupMembersRemoveRequest.Raw, + DevRev.GroupMembersRemoveRequest +> = core.serialization.object({ + group: core.serialization.string(), + member: core.serialization.string(), +}); + +export declare namespace GroupMembersRemoveRequest { + interface Raw { + group: string; + member: string; + } +} diff --git a/src/serialization/resources/groups/client/requests/GroupsCreateRequest.ts b/src/serialization/resources/groups/client/requests/GroupsCreateRequest.ts new file mode 100644 index 0000000..147e093 --- /dev/null +++ b/src/serialization/resources/groups/client/requests/GroupsCreateRequest.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { GroupType } from "../../../../types/GroupType"; +import { DynamicGroupInfo } from "../../../../types/DynamicGroupInfo"; +import { GroupMemberType } from "../../../../types/GroupMemberType"; + +export const GroupsCreateRequest: core.serialization.Schema< + serializers.GroupsCreateRequest.Raw, + DevRev.GroupsCreateRequest +> = core.serialization.object({ + type: GroupType.optional(), + description: core.serialization.string(), + dynamicGroupInfo: core.serialization.property("dynamic_group_info", DynamicGroupInfo.optional()), + memberType: core.serialization.property("member_type", GroupMemberType.optional()), + name: core.serialization.string(), + owner: core.serialization.string().optional(), +}); + +export declare namespace GroupsCreateRequest { + interface Raw { + type?: GroupType.Raw | null; + description: string; + dynamic_group_info?: DynamicGroupInfo.Raw | null; + member_type?: GroupMemberType.Raw | null; + name: string; + owner?: string | null; + } +} diff --git a/src/serialization/resources/groups/client/requests/GroupsGetRequest.ts b/src/serialization/resources/groups/client/requests/GroupsGetRequest.ts new file mode 100644 index 0000000..cdbf8ef --- /dev/null +++ b/src/serialization/resources/groups/client/requests/GroupsGetRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const GroupsGetRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace GroupsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/groups/client/requests/GroupsListRequest.ts b/src/serialization/resources/groups/client/requests/GroupsListRequest.ts new file mode 100644 index 0000000..38f1c9b --- /dev/null +++ b/src/serialization/resources/groups/client/requests/GroupsListRequest.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { GroupType } from "../../../../types/GroupType"; +import { GroupMemberType } from "../../../../types/GroupMemberType"; +import { ListMode } from "../../../../types/ListMode"; + +export const GroupsListRequest: core.serialization.Schema = + core.serialization.object({ + cursor: core.serialization.string().optional(), + groupType: core.serialization.property("group_type", core.serialization.list(GroupType).optional()), + isDefault: core.serialization.property("is_default", core.serialization.boolean().optional()), + limit: core.serialization.number().optional(), + memberType: core.serialization.property("member_type", core.serialization.list(GroupMemberType).optional()), + mode: ListMode.optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + }); + +export declare namespace GroupsListRequest { + interface Raw { + cursor?: string | null; + group_type?: GroupType.Raw[] | null; + is_default?: boolean | null; + limit?: number | null; + member_type?: GroupMemberType.Raw[] | null; + mode?: ListMode.Raw | null; + sort_by?: string[] | null; + } +} diff --git a/src/serialization/resources/groups/client/requests/GroupsUpdateRequest.ts b/src/serialization/resources/groups/client/requests/GroupsUpdateRequest.ts new file mode 100644 index 0000000..f14c4e6 --- /dev/null +++ b/src/serialization/resources/groups/client/requests/GroupsUpdateRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { GroupsUpdateRequestDynamicGroupInfo } from "../../../../types/GroupsUpdateRequestDynamicGroupInfo"; + +export const GroupsUpdateRequest: core.serialization.Schema< + serializers.GroupsUpdateRequest.Raw, + DevRev.GroupsUpdateRequest +> = core.serialization.object({ + description: core.serialization.string().optional(), + dynamicGroupInfo: core.serialization.property("dynamic_group_info", GroupsUpdateRequestDynamicGroupInfo.optional()), + id: core.serialization.string(), + name: core.serialization.string().optional(), + owner: core.serialization.string().optional(), +}); + +export declare namespace GroupsUpdateRequest { + interface Raw { + description?: string | null; + dynamic_group_info?: GroupsUpdateRequestDynamicGroupInfo.Raw | null; + id: string; + name?: string | null; + owner?: string | null; + } +} diff --git a/src/serialization/resources/groups/client/requests/index.ts b/src/serialization/resources/groups/client/requests/index.ts new file mode 100644 index 0000000..df8e2b5 --- /dev/null +++ b/src/serialization/resources/groups/client/requests/index.ts @@ -0,0 +1,7 @@ +export { GroupsCreateRequest } from "./GroupsCreateRequest"; +export { GroupsGetRequest } from "./GroupsGetRequest"; +export { GroupsListRequest } from "./GroupsListRequest"; +export { GroupMembersAddRequest } from "./GroupMembersAddRequest"; +export { GroupMembersListRequest } from "./GroupMembersListRequest"; +export { GroupMembersRemoveRequest } from "./GroupMembersRemoveRequest"; +export { GroupsUpdateRequest } from "./GroupsUpdateRequest"; diff --git a/src/serialization/resources/groups/index.ts b/src/serialization/resources/groups/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/groups/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts new file mode 100644 index 0000000..c3f6f58 --- /dev/null +++ b/src/serialization/resources/index.ts @@ -0,0 +1,50 @@ +export * as accounts from "./accounts"; +export * from "./accounts/client/requests"; +export * as articles from "./articles"; +export * from "./articles/client/requests"; +export * as artifacts from "./artifacts"; +export * from "./artifacts/client/requests"; +export * as codeChanges from "./codeChanges"; +export * from "./codeChanges/client/requests"; +export * as conversations from "./conversations"; +export * from "./conversations/client/requests"; +export * as devUsers from "./devUsers"; +export * from "./devUsers/client/requests"; +export * as engagements from "./engagements"; +export * from "./engagements/client/requests"; +export * as eventSource from "./eventSource"; +export * from "./eventSource/client/requests"; +export * as groups from "./groups"; +export * from "./groups/client/requests"; +export * as links from "./links"; +export * from "./links/client/requests"; +export * as slas from "./slas"; +export * from "./slas/client/requests"; +export * as productUsage from "./productUsage"; +export * from "./productUsage/client/requests"; +export * as schedules from "./schedules"; +export * from "./schedules/client/requests"; +export * as parts from "./parts"; +export * from "./parts/client/requests"; +export * as questionAnswers from "./questionAnswers"; +export * from "./questionAnswers/client/requests"; +export * as revOrgs from "./revOrgs"; +export * from "./revOrgs/client/requests"; +export * as revUsers from "./revUsers"; +export * from "./revUsers/client/requests"; +export * as customization from "./customization"; +export * from "./customization/client/requests"; +export * as search from "./search"; +export * from "./search/client/requests"; +export * as serviceAccounts from "./serviceAccounts"; +export * from "./serviceAccounts/client/requests"; +export * as snapIns from "./snapIns"; +export * from "./snapIns/client/requests"; +export * as surveys from "./surveys"; +export * from "./surveys/client/requests"; +export * as sysUsers from "./sysUsers"; +export * from "./sysUsers/client/requests"; +export * as timelineEntries from "./timelineEntries"; +export * from "./timelineEntries/client/requests"; +export * as works from "./works"; +export * from "./works/client/requests"; diff --git a/src/serialization/resources/links/client/index.ts b/src/serialization/resources/links/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/links/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/links/client/requests/LinksCreateRequest.ts b/src/serialization/resources/links/client/requests/LinksCreateRequest.ts new file mode 100644 index 0000000..f5ca8a9 --- /dev/null +++ b/src/serialization/resources/links/client/requests/LinksCreateRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { LinkType } from "../../../../types/LinkType"; + +export const LinksCreateRequest: core.serialization.Schema< + serializers.LinksCreateRequest.Raw, + DevRev.LinksCreateRequest +> = core.serialization.object({ + linkType: core.serialization.property("link_type", LinkType), + source: core.serialization.string(), + target: core.serialization.string(), +}); + +export declare namespace LinksCreateRequest { + interface Raw { + link_type: LinkType.Raw; + source: string; + target: string; + } +} diff --git a/src/serialization/resources/links/client/requests/LinksDeleteRequest.ts b/src/serialization/resources/links/client/requests/LinksDeleteRequest.ts new file mode 100644 index 0000000..f784552 --- /dev/null +++ b/src/serialization/resources/links/client/requests/LinksDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const LinksDeleteRequest: core.serialization.Schema< + serializers.LinksDeleteRequest.Raw, + DevRev.LinksDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace LinksDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/links/client/requests/LinksGetRequest.ts b/src/serialization/resources/links/client/requests/LinksGetRequest.ts new file mode 100644 index 0000000..485f78b --- /dev/null +++ b/src/serialization/resources/links/client/requests/LinksGetRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const LinksGetRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace LinksGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/links/client/requests/LinksListRequest.ts b/src/serialization/resources/links/client/requests/LinksListRequest.ts new file mode 100644 index 0000000..1abb2f1 --- /dev/null +++ b/src/serialization/resources/links/client/requests/LinksListRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { LinksDirection } from "../../../../types/LinksDirection"; +import { LinkType } from "../../../../types/LinkType"; +import { ListMode } from "../../../../types/ListMode"; +import { LinkEndpointType } from "../../../../types/LinkEndpointType"; + +export const LinksListRequest: core.serialization.Schema = + core.serialization.object({ + cursor: core.serialization.string().optional(), + direction: LinksDirection.optional(), + limit: core.serialization.number().optional(), + linkType: core.serialization.property("link_type", core.serialization.list(LinkType).optional()), + mode: ListMode.optional(), + object: core.serialization.string(), + objectTypes: core.serialization.property("object_types", core.serialization.list(LinkEndpointType).optional()), + types: core.serialization.list(LinkType).optional(), + }); + +export declare namespace LinksListRequest { + interface Raw { + cursor?: string | null; + direction?: LinksDirection.Raw | null; + limit?: number | null; + link_type?: LinkType.Raw[] | null; + mode?: ListMode.Raw | null; + object: string; + object_types?: LinkEndpointType.Raw[] | null; + types?: LinkType.Raw[] | null; + } +} diff --git a/src/serialization/resources/links/client/requests/index.ts b/src/serialization/resources/links/client/requests/index.ts new file mode 100644 index 0000000..d2e8ac6 --- /dev/null +++ b/src/serialization/resources/links/client/requests/index.ts @@ -0,0 +1,4 @@ +export { LinksCreateRequest } from "./LinksCreateRequest"; +export { LinksDeleteRequest } from "./LinksDeleteRequest"; +export { LinksGetRequest } from "./LinksGetRequest"; +export { LinksListRequest } from "./LinksListRequest"; diff --git a/src/serialization/resources/links/index.ts b/src/serialization/resources/links/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/links/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/parts/client/index.ts b/src/serialization/resources/parts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/parts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/parts/client/requests/PartsDeleteRequest.ts b/src/serialization/resources/parts/client/requests/PartsDeleteRequest.ts new file mode 100644 index 0000000..2b92a88 --- /dev/null +++ b/src/serialization/resources/parts/client/requests/PartsDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const PartsDeleteRequest: core.serialization.Schema< + serializers.PartsDeleteRequest.Raw, + DevRev.PartsDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace PartsDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/parts/client/requests/PartsGetRequest.ts b/src/serialization/resources/parts/client/requests/PartsGetRequest.ts new file mode 100644 index 0000000..d0d5a74 --- /dev/null +++ b/src/serialization/resources/parts/client/requests/PartsGetRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const PartsGetRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace PartsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/parts/client/requests/PartsListRequest.ts b/src/serialization/resources/parts/client/requests/PartsListRequest.ts new file mode 100644 index 0000000..44fbeeb --- /dev/null +++ b/src/serialization/resources/parts/client/requests/PartsListRequest.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { PartType } from "../../../../types/PartType"; +import { ListMode } from "../../../../types/ListMode"; +import { ParentPartFilter } from "../../../../types/ParentPartFilter"; + +export const PartsListRequest: core.serialization.Schema = + core.serialization.object({ + type: core.serialization.list(PartType).optional(), + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + name: core.serialization.list(core.serialization.string()).optional(), + ownedBy: core.serialization.property( + "owned_by", + core.serialization.list(core.serialization.string()).optional() + ), + parentPart: core.serialization.property("parent_part", ParentPartFilter.optional()), + }); + +export declare namespace PartsListRequest { + interface Raw { + type?: PartType.Raw[] | null; + created_by?: string[] | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + name?: string[] | null; + owned_by?: string[] | null; + parent_part?: ParentPartFilter.Raw | null; + } +} diff --git a/src/serialization/resources/parts/client/requests/index.ts b/src/serialization/resources/parts/client/requests/index.ts new file mode 100644 index 0000000..77ff902 --- /dev/null +++ b/src/serialization/resources/parts/client/requests/index.ts @@ -0,0 +1,3 @@ +export { PartsDeleteRequest } from "./PartsDeleteRequest"; +export { PartsGetRequest } from "./PartsGetRequest"; +export { PartsListRequest } from "./PartsListRequest"; diff --git a/src/serialization/resources/parts/index.ts b/src/serialization/resources/parts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/parts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/productUsage/client/index.ts b/src/serialization/resources/productUsage/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/productUsage/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/productUsage/client/requests/MetricsDataIngestRequest.ts b/src/serialization/resources/productUsage/client/requests/MetricsDataIngestRequest.ts new file mode 100644 index 0000000..560420f --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/MetricsDataIngestRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { MetricsData } from "../../../../types/MetricsData"; + +export const MetricsDataIngestRequest: core.serialization.Schema< + serializers.MetricsDataIngestRequest.Raw, + DevRev.MetricsDataIngestRequest +> = core.serialization.object({ + metrics: core.serialization.list(MetricsData), +}); + +export declare namespace MetricsDataIngestRequest { + interface Raw { + metrics: MetricsData.Raw[]; + } +} diff --git a/src/serialization/resources/productUsage/client/requests/UomsCountRequest.ts b/src/serialization/resources/productUsage/client/requests/UomsCountRequest.ts new file mode 100644 index 0000000..952defe --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/UomsCountRequest.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AggregationDetailAggregationType } from "../../../../types/AggregationDetailAggregationType"; +import { UnitType } from "../../../../types/UnitType"; + +export const UomsCountRequest: core.serialization.Schema = + core.serialization.object({ + aggregationTypes: core.serialization.property( + "aggregation_types", + core.serialization.list(AggregationDetailAggregationType).optional() + ), + ids: core.serialization.list(core.serialization.string()).optional(), + metricNames: core.serialization.property( + "metric_names", + core.serialization.list(core.serialization.string()).optional() + ), + partIds: core.serialization.property( + "part_ids", + core.serialization.list(core.serialization.string()).optional() + ), + productIds: core.serialization.property( + "product_ids", + core.serialization.list(core.serialization.string()).optional() + ), + unitTypes: core.serialization.property("unit_types", core.serialization.list(UnitType).optional()), + }); + +export declare namespace UomsCountRequest { + interface Raw { + aggregation_types?: AggregationDetailAggregationType.Raw[] | null; + ids?: string[] | null; + metric_names?: string[] | null; + part_ids?: string[] | null; + product_ids?: string[] | null; + unit_types?: UnitType.Raw[] | null; + } +} diff --git a/src/serialization/resources/productUsage/client/requests/UomsCreateRequest.ts b/src/serialization/resources/productUsage/client/requests/UomsCreateRequest.ts new file mode 100644 index 0000000..6b136f1 --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/UomsCreateRequest.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AggregationDetail } from "../../../../types/AggregationDetail"; +import { Unit } from "../../../../types/Unit"; + +export const UomsCreateRequest: core.serialization.Schema = + core.serialization.object({ + aggregationDetail: core.serialization.property("aggregation_detail", AggregationDetail), + description: core.serialization.string().optional(), + dimensions: core.serialization.list(core.serialization.string()).optional(), + metricName: core.serialization.property("metric_name", core.serialization.string()), + name: core.serialization.string(), + partId: core.serialization.property("part_id", core.serialization.string().optional()), + productId: core.serialization.property("product_id", core.serialization.string()), + unit: Unit, + }); + +export declare namespace UomsCreateRequest { + interface Raw { + aggregation_detail: AggregationDetail.Raw; + description?: string | null; + dimensions?: string[] | null; + metric_name: string; + name: string; + part_id?: string | null; + product_id: string; + unit: Unit.Raw; + } +} diff --git a/src/serialization/resources/productUsage/client/requests/UomsDeleteRequest.ts b/src/serialization/resources/productUsage/client/requests/UomsDeleteRequest.ts new file mode 100644 index 0000000..b1c38ff --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/UomsDeleteRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const UomsDeleteRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace UomsDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/productUsage/client/requests/UomsGetRequest.ts b/src/serialization/resources/productUsage/client/requests/UomsGetRequest.ts new file mode 100644 index 0000000..23246cb --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/UomsGetRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const UomsGetRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace UomsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/productUsage/client/requests/UomsListRequest.ts b/src/serialization/resources/productUsage/client/requests/UomsListRequest.ts new file mode 100644 index 0000000..9c023dc --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/UomsListRequest.ts @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AggregationDetailAggregationType } from "../../../../types/AggregationDetailAggregationType"; +import { ListMode } from "../../../../types/ListMode"; +import { UnitType } from "../../../../types/UnitType"; + +export const UomsListRequest: core.serialization.Schema = + core.serialization.object({ + aggregationTypes: core.serialization.property( + "aggregation_types", + core.serialization.list(AggregationDetailAggregationType).optional() + ), + cursor: core.serialization.string().optional(), + ids: core.serialization.list(core.serialization.string()).optional(), + limit: core.serialization.number().optional(), + metricNames: core.serialization.property( + "metric_names", + core.serialization.list(core.serialization.string()).optional() + ), + mode: ListMode.optional(), + partIds: core.serialization.property( + "part_ids", + core.serialization.list(core.serialization.string()).optional() + ), + productIds: core.serialization.property( + "product_ids", + core.serialization.list(core.serialization.string()).optional() + ), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + unitTypes: core.serialization.property("unit_types", core.serialization.list(UnitType).optional()), + }); + +export declare namespace UomsListRequest { + interface Raw { + aggregation_types?: AggregationDetailAggregationType.Raw[] | null; + cursor?: string | null; + ids?: string[] | null; + limit?: number | null; + metric_names?: string[] | null; + mode?: ListMode.Raw | null; + part_ids?: string[] | null; + product_ids?: string[] | null; + sort_by?: string[] | null; + unit_types?: UnitType.Raw[] | null; + } +} diff --git a/src/serialization/resources/productUsage/client/requests/UomsUpdateRequest.ts b/src/serialization/resources/productUsage/client/requests/UomsUpdateRequest.ts new file mode 100644 index 0000000..35b025f --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/UomsUpdateRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AggregationDetailAggregationType } from "../../../../types/AggregationDetailAggregationType"; +import { UomsUpdateRequestDimensions } from "../../../../types/UomsUpdateRequestDimensions"; + +export const UomsUpdateRequest: core.serialization.Schema = + core.serialization.object({ + aggregationType: core.serialization.property("aggregation_type", AggregationDetailAggregationType.optional()), + description: core.serialization.string().optional(), + dimensions: UomsUpdateRequestDimensions.optional(), + id: core.serialization.string(), + isEnabled: core.serialization.property("is_enabled", core.serialization.boolean().optional()), + name: core.serialization.string().optional(), + partId: core.serialization.property("part_id", core.serialization.string().optional()), + productId: core.serialization.property("product_id", core.serialization.string().optional()), + unit: core.serialization.string().optional(), + }); + +export declare namespace UomsUpdateRequest { + interface Raw { + aggregation_type?: AggregationDetailAggregationType.Raw | null; + description?: string | null; + dimensions?: UomsUpdateRequestDimensions.Raw | null; + id: string; + is_enabled?: boolean | null; + name?: string | null; + part_id?: string | null; + product_id?: string | null; + unit?: string | null; + } +} diff --git a/src/serialization/resources/productUsage/client/requests/index.ts b/src/serialization/resources/productUsage/client/requests/index.ts new file mode 100644 index 0000000..3958454 --- /dev/null +++ b/src/serialization/resources/productUsage/client/requests/index.ts @@ -0,0 +1,7 @@ +export { MetricsDataIngestRequest } from "./MetricsDataIngestRequest"; +export { UomsCountRequest } from "./UomsCountRequest"; +export { UomsCreateRequest } from "./UomsCreateRequest"; +export { UomsDeleteRequest } from "./UomsDeleteRequest"; +export { UomsGetRequest } from "./UomsGetRequest"; +export { UomsListRequest } from "./UomsListRequest"; +export { UomsUpdateRequest } from "./UomsUpdateRequest"; diff --git a/src/serialization/resources/productUsage/index.ts b/src/serialization/resources/productUsage/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/productUsage/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/questionAnswers/client/index.ts b/src/serialization/resources/questionAnswers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/questionAnswers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersCreateRequest.ts b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersCreateRequest.ts new file mode 100644 index 0000000..ba3ed28 --- /dev/null +++ b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersCreateRequest.ts @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AccessLevel } from "../../../../types/AccessLevel"; +import { SetSharedWithMembership } from "../../../../types/SetSharedWithMembership"; +import { QuestionAnswerStatus } from "../../../../types/QuestionAnswerStatus"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const QuestionAnswersCreateRequest: core.serialization.Schema< + serializers.QuestionAnswersCreateRequest.Raw, + DevRev.QuestionAnswersCreateRequest +> = core.serialization.object({ + accessLevel: core.serialization.property("access_level", AccessLevel.optional()), + answer: core.serialization.string(), + appliesToArticles: core.serialization.property( + "applies_to_articles", + core.serialization.list(core.serialization.string()).optional() + ), + appliesToParts: core.serialization.property( + "applies_to_parts", + core.serialization.list(core.serialization.string()) + ), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string())), + question: core.serialization.string(), + sharedWith: core.serialization.property("shared_with", core.serialization.list(SetSharedWithMembership).optional()), + sources: core.serialization.list(core.serialization.string()).optional(), + status: QuestionAnswerStatus, + suggestedAnswer: core.serialization.property("suggested_answer", core.serialization.string().optional()), + suggestedForDeletion: core.serialization.property( + "suggested_for_deletion", + core.serialization.boolean().optional() + ), + tags: core.serialization.list(SetTagWithValue).optional(), + topic: core.serialization.string().optional(), + verified: core.serialization.boolean().optional(), +}); + +export declare namespace QuestionAnswersCreateRequest { + interface Raw { + access_level?: AccessLevel.Raw | null; + answer: string; + applies_to_articles?: string[] | null; + applies_to_parts: string[]; + owned_by: string[]; + question: string; + shared_with?: SetSharedWithMembership.Raw[] | null; + sources?: string[] | null; + status: QuestionAnswerStatus.Raw; + suggested_answer?: string | null; + suggested_for_deletion?: boolean | null; + tags?: SetTagWithValue.Raw[] | null; + topic?: string | null; + verified?: boolean | null; + } +} diff --git a/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersDeleteRequest.ts b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersDeleteRequest.ts new file mode 100644 index 0000000..b683d88 --- /dev/null +++ b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersDeleteRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const QuestionAnswersDeleteRequest: core.serialization.Schema< + serializers.QuestionAnswersDeleteRequest.Raw, + DevRev.QuestionAnswersDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), + questionAnswerId: core.serialization.property("question_answer_id", core.serialization.string().optional()), +}); + +export declare namespace QuestionAnswersDeleteRequest { + interface Raw { + id: string; + question_answer_id?: string | null; + } +} diff --git a/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersGetRequest.ts b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersGetRequest.ts new file mode 100644 index 0000000..6bfdd0f --- /dev/null +++ b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const QuestionAnswersGetRequest: core.serialization.Schema< + serializers.QuestionAnswersGetRequest.Raw, + DevRev.QuestionAnswersGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace QuestionAnswersGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersListRequest.ts b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersListRequest.ts new file mode 100644 index 0000000..c9bd621 --- /dev/null +++ b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersListRequest.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ListMode } from "../../../../types/ListMode"; + +export const QuestionAnswersListRequest: core.serialization.Schema< + serializers.QuestionAnswersListRequest.Raw, + DevRev.QuestionAnswersListRequest +> = core.serialization.object({ + appliesToArticles: core.serialization.property( + "applies_to_articles", + core.serialization.list(core.serialization.string()).optional() + ), + appliesToParts: core.serialization.property( + "applies_to_parts", + core.serialization.list(core.serialization.string()).optional() + ), + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace QuestionAnswersListRequest { + interface Raw { + applies_to_articles?: string[] | null; + applies_to_parts?: string[] | null; + created_by?: string[] | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + owned_by?: string[] | null; + } +} diff --git a/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersUpdateRequest.ts b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersUpdateRequest.ts new file mode 100644 index 0000000..0704121 --- /dev/null +++ b/src/serialization/resources/questionAnswers/client/requests/QuestionAnswersUpdateRequest.ts @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AccessLevel } from "../../../../types/AccessLevel"; +import { QuestionAnswersUpdateRequestAppliesToArticles } from "../../../../types/QuestionAnswersUpdateRequestAppliesToArticles"; +import { QuestionAnswersUpdateRequestAppliesToParts } from "../../../../types/QuestionAnswersUpdateRequestAppliesToParts"; +import { QuestionAnswersUpdateRequestOwnedBy } from "../../../../types/QuestionAnswersUpdateRequestOwnedBy"; +import { QuestionAnswersUpdateRequestSharedWith } from "../../../../types/QuestionAnswersUpdateRequestSharedWith"; +import { QuestionAnswersUpdateRequestSources } from "../../../../types/QuestionAnswersUpdateRequestSources"; +import { QuestionAnswerStatus } from "../../../../types/QuestionAnswerStatus"; +import { QuestionAnswersUpdateRequestTags } from "../../../../types/QuestionAnswersUpdateRequestTags"; + +export const QuestionAnswersUpdateRequest: core.serialization.Schema< + serializers.QuestionAnswersUpdateRequest.Raw, + DevRev.QuestionAnswersUpdateRequest +> = core.serialization.object({ + accessLevel: core.serialization.property("access_level", AccessLevel.optional()), + answer: core.serialization.string().optional(), + appliesToArticles: core.serialization.property( + "applies_to_articles", + QuestionAnswersUpdateRequestAppliesToArticles.optional() + ), + appliesToParts: core.serialization.property( + "applies_to_parts", + QuestionAnswersUpdateRequestAppliesToParts.optional() + ), + id: core.serialization.string(), + ownedBy: core.serialization.property("owned_by", QuestionAnswersUpdateRequestOwnedBy.optional()), + question: core.serialization.string().optional(), + sharedWith: core.serialization.property("shared_with", QuestionAnswersUpdateRequestSharedWith.optional()), + sources: QuestionAnswersUpdateRequestSources.optional(), + status: QuestionAnswerStatus.optional(), + suggestedAnswer: core.serialization.property("suggested_answer", core.serialization.string().optional()), + suggestedForDeletion: core.serialization.property( + "suggested_for_deletion", + core.serialization.boolean().optional() + ), + tags: QuestionAnswersUpdateRequestTags.optional(), + topic: core.serialization.string().optional(), + verified: core.serialization.boolean().optional(), +}); + +export declare namespace QuestionAnswersUpdateRequest { + interface Raw { + access_level?: AccessLevel.Raw | null; + answer?: string | null; + applies_to_articles?: QuestionAnswersUpdateRequestAppliesToArticles.Raw | null; + applies_to_parts?: QuestionAnswersUpdateRequestAppliesToParts.Raw | null; + id: string; + owned_by?: QuestionAnswersUpdateRequestOwnedBy.Raw | null; + question?: string | null; + shared_with?: QuestionAnswersUpdateRequestSharedWith.Raw | null; + sources?: QuestionAnswersUpdateRequestSources.Raw | null; + status?: QuestionAnswerStatus.Raw | null; + suggested_answer?: string | null; + suggested_for_deletion?: boolean | null; + tags?: QuestionAnswersUpdateRequestTags.Raw | null; + topic?: string | null; + verified?: boolean | null; + } +} diff --git a/src/serialization/resources/questionAnswers/client/requests/index.ts b/src/serialization/resources/questionAnswers/client/requests/index.ts new file mode 100644 index 0000000..2a4c1b8 --- /dev/null +++ b/src/serialization/resources/questionAnswers/client/requests/index.ts @@ -0,0 +1,5 @@ +export { QuestionAnswersCreateRequest } from "./QuestionAnswersCreateRequest"; +export { QuestionAnswersDeleteRequest } from "./QuestionAnswersDeleteRequest"; +export { QuestionAnswersGetRequest } from "./QuestionAnswersGetRequest"; +export { QuestionAnswersListRequest } from "./QuestionAnswersListRequest"; +export { QuestionAnswersUpdateRequest } from "./QuestionAnswersUpdateRequest"; diff --git a/src/serialization/resources/questionAnswers/index.ts b/src/serialization/resources/questionAnswers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/questionAnswers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/revOrgs/client/index.ts b/src/serialization/resources/revOrgs/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/revOrgs/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/revOrgs/client/requests/RevOrgsCreateRequest.ts b/src/serialization/resources/revOrgs/client/requests/RevOrgsCreateRequest.ts new file mode 100644 index 0000000..b582720 --- /dev/null +++ b/src/serialization/resources/revOrgs/client/requests/RevOrgsCreateRequest.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { OrgEnvironment } from "../../../../types/OrgEnvironment"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const RevOrgsCreateRequest: core.serialization.Schema< + serializers.RevOrgsCreateRequest.Raw, + DevRev.RevOrgsCreateRequest +> = core.serialization.object({ + account: core.serialization.string().optional(), + artifacts: core.serialization.list(core.serialization.string()).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + displayName: core.serialization.property("display_name", core.serialization.string()), + domain: core.serialization.string().optional(), + environment: OrgEnvironment.optional(), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + tags: core.serialization.list(SetTagWithValue).optional(), + tier: core.serialization.string().optional(), +}); + +export declare namespace RevOrgsCreateRequest { + interface Raw { + account?: string | null; + artifacts?: string[] | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + display_name: string; + domain?: string | null; + environment?: OrgEnvironment.Raw | null; + external_ref?: string | null; + tags?: SetTagWithValue.Raw[] | null; + tier?: string | null; + } +} diff --git a/src/serialization/resources/revOrgs/client/requests/RevOrgsGetRequest.ts b/src/serialization/resources/revOrgs/client/requests/RevOrgsGetRequest.ts new file mode 100644 index 0000000..d5916f7 --- /dev/null +++ b/src/serialization/resources/revOrgs/client/requests/RevOrgsGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const RevOrgsGetRequest: core.serialization.Schema = + core.serialization.object({ + account: core.serialization.string().optional(), + id: core.serialization.string().optional(), + }); + +export declare namespace RevOrgsGetRequest { + interface Raw { + account?: string | null; + id?: string | null; + } +} diff --git a/src/serialization/resources/revOrgs/client/requests/RevOrgsListRequest.ts b/src/serialization/resources/revOrgs/client/requests/RevOrgsListRequest.ts new file mode 100644 index 0000000..b5454d4 --- /dev/null +++ b/src/serialization/resources/revOrgs/client/requests/RevOrgsListRequest.ts @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DateTimeFilter } from "../../../../types/DateTimeFilter"; +import { ListMode } from "../../../../types/ListMode"; + +export const RevOrgsListRequest: core.serialization.Schema< + serializers.RevOrgsListRequest.Raw, + DevRev.RevOrgsListRequest +> = core.serialization.object({ + account: core.serialization.list(core.serialization.string()).optional(), + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateTimeFilter.optional()), + cursor: core.serialization.string().optional(), + customFieldFilter: core.serialization.property( + "custom_field_filter", + core.serialization.list(core.serialization.string()).optional() + ), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + displayName: core.serialization.property( + "display_name", + core.serialization.list(core.serialization.string()).optional() + ), + externalRef: core.serialization.property( + "external_ref", + core.serialization.list(core.serialization.string()).optional() + ), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedDate: core.serialization.property("modified_date", DateTimeFilter.optional()), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + tags: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace RevOrgsListRequest { + interface Raw { + account?: string[] | null; + created_by?: string[] | null; + created_date?: DateTimeFilter.Raw | null; + cursor?: string | null; + custom_field_filter?: string[] | null; + custom_fields?: Record | null; + display_name?: string[] | null; + external_ref?: string[] | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_date?: DateTimeFilter.Raw | null; + sort_by?: string[] | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/resources/revOrgs/client/requests/RevOrgsUpdateRequest.ts b/src/serialization/resources/revOrgs/client/requests/RevOrgsUpdateRequest.ts new file mode 100644 index 0000000..842045e --- /dev/null +++ b/src/serialization/resources/revOrgs/client/requests/RevOrgsUpdateRequest.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { RevOrgsUpdateRequestArtifacts } from "../../../../types/RevOrgsUpdateRequestArtifacts"; +import { OrgEnvironment } from "../../../../types/OrgEnvironment"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const RevOrgsUpdateRequest: core.serialization.Schema< + serializers.RevOrgsUpdateRequest.Raw, + DevRev.RevOrgsUpdateRequest +> = core.serialization.object({ + account: core.serialization.string().optional(), + artifacts: RevOrgsUpdateRequestArtifacts.optional(), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + domain: core.serialization.string().optional(), + environment: OrgEnvironment.optional(), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + id: core.serialization.string(), + tags: core.serialization.list(SetTagWithValue).optional(), + tier: core.serialization.string().optional(), +}); + +export declare namespace RevOrgsUpdateRequest { + interface Raw { + account?: string | null; + artifacts?: RevOrgsUpdateRequestArtifacts.Raw | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + display_name?: string | null; + domain?: string | null; + environment?: OrgEnvironment.Raw | null; + external_ref?: string | null; + id: string; + tags?: SetTagWithValue.Raw[] | null; + tier?: string | null; + } +} diff --git a/src/serialization/resources/revOrgs/client/requests/index.ts b/src/serialization/resources/revOrgs/client/requests/index.ts new file mode 100644 index 0000000..1314bcd --- /dev/null +++ b/src/serialization/resources/revOrgs/client/requests/index.ts @@ -0,0 +1,4 @@ +export { RevOrgsCreateRequest } from "./RevOrgsCreateRequest"; +export { RevOrgsGetRequest } from "./RevOrgsGetRequest"; +export { RevOrgsListRequest } from "./RevOrgsListRequest"; +export { RevOrgsUpdateRequest } from "./RevOrgsUpdateRequest"; diff --git a/src/serialization/resources/revOrgs/index.ts b/src/serialization/resources/revOrgs/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/revOrgs/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/revUsers/client/index.ts b/src/serialization/resources/revUsers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/revUsers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/revUsers/client/requests/LinkRevUserToRevOrgRequest.ts b/src/serialization/resources/revUsers/client/requests/LinkRevUserToRevOrgRequest.ts new file mode 100644 index 0000000..361b89c --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/LinkRevUserToRevOrgRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const LinkRevUserToRevOrgRequest: core.serialization.Schema< + serializers.LinkRevUserToRevOrgRequest.Raw, + DevRev.LinkRevUserToRevOrgRequest +> = core.serialization.object({ + id: core.serialization.string().optional(), + revOrg: core.serialization.property("rev_org", core.serialization.string().optional()), + revOrgDon: core.serialization.property("rev_org_don", core.serialization.string().optional()), + userDon: core.serialization.property("user_don", core.serialization.string().optional()), +}); + +export declare namespace LinkRevUserToRevOrgRequest { + interface Raw { + id?: string | null; + rev_org?: string | null; + rev_org_don?: string | null; + user_don?: string | null; + } +} diff --git a/src/serialization/resources/revUsers/client/requests/RevUsersCreateRequest.ts b/src/serialization/resources/revUsers/client/requests/RevUsersCreateRequest.ts new file mode 100644 index 0000000..319c3b3 --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/RevUsersCreateRequest.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const RevUsersCreateRequest: core.serialization.Schema< + serializers.RevUsersCreateRequest.Raw, + DevRev.RevUsersCreateRequest +> = core.serialization.object({ + account: core.serialization.string().optional(), + artifacts: core.serialization.list(core.serialization.string()).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + email: core.serialization.string().optional(), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + phoneNumbers: core.serialization.property( + "phone_numbers", + core.serialization.list(core.serialization.string()).optional() + ), + revOrg: core.serialization.property("rev_org", core.serialization.string().optional()), + tags: core.serialization.list(SetTagWithValue).optional(), +}); + +export declare namespace RevUsersCreateRequest { + interface Raw { + account?: string | null; + artifacts?: string[] | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + display_name?: string | null; + email?: string | null; + external_ref?: string | null; + phone_numbers?: string[] | null; + rev_org?: string | null; + tags?: SetTagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/resources/revUsers/client/requests/RevUsersDeleteRequest.ts b/src/serialization/resources/revUsers/client/requests/RevUsersDeleteRequest.ts new file mode 100644 index 0000000..e6def4c --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/RevUsersDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const RevUsersDeleteRequest: core.serialization.Schema< + serializers.RevUsersDeleteRequest.Raw, + DevRev.RevUsersDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace RevUsersDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/revUsers/client/requests/RevUsersGetRequest.ts b/src/serialization/resources/revUsers/client/requests/RevUsersGetRequest.ts new file mode 100644 index 0000000..c13adb7 --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/RevUsersGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const RevUsersGetRequest: core.serialization.Schema< + serializers.RevUsersGetRequest.Raw, + DevRev.RevUsersGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace RevUsersGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/revUsers/client/requests/RevUsersListRequest.ts b/src/serialization/resources/revUsers/client/requests/RevUsersListRequest.ts new file mode 100644 index 0000000..3224640 --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/RevUsersListRequest.ts @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DateTimeFilter } from "../../../../types/DateTimeFilter"; +import { ListMode } from "../../../../types/ListMode"; + +export const RevUsersListRequest: core.serialization.Schema< + serializers.RevUsersListRequest.Raw, + DevRev.RevUsersListRequest +> = core.serialization.object({ + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateTimeFilter.optional()), + cursor: core.serialization.string().optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + email: core.serialization.list(core.serialization.string()).optional(), + externalRef: core.serialization.property( + "external_ref", + core.serialization.list(core.serialization.string()).optional() + ), + isVerified: core.serialization.property("is_verified", core.serialization.boolean().optional()), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedDate: core.serialization.property("modified_date", DateTimeFilter.optional()), + phoneNumbers: core.serialization.property( + "phone_numbers", + core.serialization.list(core.serialization.string()).optional() + ), + revOrg: core.serialization.property("rev_org", core.serialization.list(core.serialization.string()).optional()), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + tags: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace RevUsersListRequest { + interface Raw { + created_by?: string[] | null; + created_date?: DateTimeFilter.Raw | null; + cursor?: string | null; + custom_fields?: Record | null; + email?: string[] | null; + external_ref?: string[] | null; + is_verified?: boolean | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_date?: DateTimeFilter.Raw | null; + phone_numbers?: string[] | null; + rev_org?: string[] | null; + sort_by?: string[] | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/resources/revUsers/client/requests/RevUsersUpdateRequest.ts b/src/serialization/resources/revUsers/client/requests/RevUsersUpdateRequest.ts new file mode 100644 index 0000000..3de7a0d --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/RevUsersUpdateRequest.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { RevUsersUpdateRequestArtifacts } from "../../../../types/RevUsersUpdateRequestArtifacts"; +import { RevUsersUpdateRequestCustomSchemaFragments } from "../../../../types/RevUsersUpdateRequestCustomSchemaFragments"; +import { SetTagWithValue } from "../../../../types/SetTagWithValue"; + +export const RevUsersUpdateRequest: core.serialization.Schema< + serializers.RevUsersUpdateRequest.Raw, + DevRev.RevUsersUpdateRequest +> = core.serialization.object({ + artifacts: RevUsersUpdateRequestArtifacts.optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + RevUsersUpdateRequestCustomSchemaFragments.optional() + ), + description: core.serialization.string().optional(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + email: core.serialization.string().optional(), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + id: core.serialization.string(), + phoneNumbers: core.serialization.property( + "phone_numbers", + core.serialization.list(core.serialization.string()).optional() + ), + tags: core.serialization.list(SetTagWithValue).optional(), +}); + +export declare namespace RevUsersUpdateRequest { + interface Raw { + artifacts?: RevUsersUpdateRequestArtifacts.Raw | null; + custom_fields?: Record | null; + custom_schema_fragments?: RevUsersUpdateRequestCustomSchemaFragments.Raw | null; + description?: string | null; + display_name?: string | null; + email?: string | null; + external_ref?: string | null; + id: string; + phone_numbers?: string[] | null; + tags?: SetTagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/resources/revUsers/client/requests/UnlinkRevUserFromRevOrgRequest.ts b/src/serialization/resources/revUsers/client/requests/UnlinkRevUserFromRevOrgRequest.ts new file mode 100644 index 0000000..78da649 --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/UnlinkRevUserFromRevOrgRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const UnlinkRevUserFromRevOrgRequest: core.serialization.Schema< + serializers.UnlinkRevUserFromRevOrgRequest.Raw, + DevRev.UnlinkRevUserFromRevOrgRequest +> = core.serialization.object({ + id: core.serialization.string().optional(), + revOrg: core.serialization.property("rev_org", core.serialization.string().optional()), + revOrgDon: core.serialization.property("rev_org_don", core.serialization.string().optional()), + userDon: core.serialization.property("user_don", core.serialization.string().optional()), +}); + +export declare namespace UnlinkRevUserFromRevOrgRequest { + interface Raw { + id?: string | null; + rev_org?: string | null; + rev_org_don?: string | null; + user_don?: string | null; + } +} diff --git a/src/serialization/resources/revUsers/client/requests/index.ts b/src/serialization/resources/revUsers/client/requests/index.ts new file mode 100644 index 0000000..d8d0a1d --- /dev/null +++ b/src/serialization/resources/revUsers/client/requests/index.ts @@ -0,0 +1,7 @@ +export { RevUsersCreateRequest } from "./RevUsersCreateRequest"; +export { RevUsersDeleteRequest } from "./RevUsersDeleteRequest"; +export { RevUsersGetRequest } from "./RevUsersGetRequest"; +export { LinkRevUserToRevOrgRequest } from "./LinkRevUserToRevOrgRequest"; +export { RevUsersListRequest } from "./RevUsersListRequest"; +export { UnlinkRevUserFromRevOrgRequest } from "./UnlinkRevUserFromRevOrgRequest"; +export { RevUsersUpdateRequest } from "./RevUsersUpdateRequest"; diff --git a/src/serialization/resources/revUsers/index.ts b/src/serialization/resources/revUsers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/revUsers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/schedules/client/index.ts b/src/serialization/resources/schedules/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/schedules/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsCreateRequest.ts b/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsCreateRequest.ts new file mode 100644 index 0000000..c37c074 --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsCreateRequest.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { CreateOrgScheduleInterval } from "../../../../types/CreateOrgScheduleInterval"; + +export const OrgScheduleFragmentsCreateRequest: core.serialization.Schema< + serializers.OrgScheduleFragmentsCreateRequest.Raw, + DevRev.OrgScheduleFragmentsCreateRequest +> = core.serialization.object({ + from: core.serialization.date(), + intervals: core.serialization.list(CreateOrgScheduleInterval), + name: core.serialization.string(), + regionCodes: core.serialization.property( + "region_codes", + core.serialization.list(core.serialization.string()).optional() + ), + to: core.serialization.date(), +}); + +export declare namespace OrgScheduleFragmentsCreateRequest { + interface Raw { + from: string; + intervals: CreateOrgScheduleInterval.Raw[]; + name: string; + region_codes?: string[] | null; + to: string; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsGetRequest.ts b/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsGetRequest.ts new file mode 100644 index 0000000..f52899e --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const OrgScheduleFragmentsGetRequest: core.serialization.Schema< + serializers.OrgScheduleFragmentsGetRequest.Raw, + DevRev.OrgScheduleFragmentsGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace OrgScheduleFragmentsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsTransitionRequest.ts b/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsTransitionRequest.ts new file mode 100644 index 0000000..25366f0 --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgScheduleFragmentsTransitionRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { OrgScheduleFragmentStatus } from "../../../../types/OrgScheduleFragmentStatus"; + +export const OrgScheduleFragmentsTransitionRequest: core.serialization.Schema< + serializers.OrgScheduleFragmentsTransitionRequest.Raw, + DevRev.OrgScheduleFragmentsTransitionRequest +> = core.serialization.object({ + id: core.serialization.string(), + status: OrgScheduleFragmentStatus, +}); + +export declare namespace OrgScheduleFragmentsTransitionRequest { + interface Raw { + id: string; + status: OrgScheduleFragmentStatus.Raw; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgSchedulesCreateRequest.ts b/src/serialization/resources/schedules/client/requests/OrgSchedulesCreateRequest.ts new file mode 100644 index 0000000..7d9a4dd --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgSchedulesCreateRequest.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SetWeeklyOrgSchedule } from "../../../../types/SetWeeklyOrgSchedule"; +import { SetOrgScheduleFragmentSummary } from "../../../../types/SetOrgScheduleFragmentSummary"; + +export const OrgSchedulesCreateRequest: core.serialization.Schema< + serializers.OrgSchedulesCreateRequest.Raw, + DevRev.OrgSchedulesCreateRequest +> = core.serialization.object({ + defaultWeeklyOrgSchedule: core.serialization.property( + "default_weekly_org_schedule", + SetWeeklyOrgSchedule.optional() + ), + minValidDays: core.serialization.property("min_valid_days", core.serialization.number().optional()), + name: core.serialization.string(), + orgScheduleFragments: core.serialization.property( + "org_schedule_fragments", + core.serialization.list(SetOrgScheduleFragmentSummary).optional() + ), + timezone: core.serialization.string(), + weeklyOrgSchedules: core.serialization.property( + "weekly_org_schedules", + core.serialization.list(SetWeeklyOrgSchedule).optional() + ), +}); + +export declare namespace OrgSchedulesCreateRequest { + interface Raw { + default_weekly_org_schedule?: SetWeeklyOrgSchedule.Raw | null; + min_valid_days?: number | null; + name: string; + org_schedule_fragments?: SetOrgScheduleFragmentSummary.Raw[] | null; + timezone: string; + weekly_org_schedules?: SetWeeklyOrgSchedule.Raw[] | null; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgSchedulesGetRequest.ts b/src/serialization/resources/schedules/client/requests/OrgSchedulesGetRequest.ts new file mode 100644 index 0000000..9c07b59 --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgSchedulesGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const OrgSchedulesGetRequest: core.serialization.Schema< + serializers.OrgSchedulesGetRequest.Raw, + DevRev.OrgSchedulesGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace OrgSchedulesGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgSchedulesListRequest.ts b/src/serialization/resources/schedules/client/requests/OrgSchedulesListRequest.ts new file mode 100644 index 0000000..cdf4e2e --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgSchedulesListRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ListMode } from "../../../../types/ListMode"; +import { OrgScheduleStatus } from "../../../../types/OrgScheduleStatus"; +import { DateFilter } from "../../../../types/DateFilter"; + +export const OrgSchedulesListRequest: core.serialization.Schema< + serializers.OrgSchedulesListRequest.Raw, + DevRev.OrgSchedulesListRequest +> = core.serialization.object({ + createdById: core.serialization.property( + "created_by_id", + core.serialization.list(core.serialization.string()).optional() + ), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + status: core.serialization.list(OrgScheduleStatus).optional(), + validUntil: core.serialization.property("valid_until", DateFilter.optional()), +}); + +export declare namespace OrgSchedulesListRequest { + interface Raw { + created_by_id?: string[] | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + status?: OrgScheduleStatus.Raw[] | null; + valid_until?: DateFilter.Raw | null; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgSchedulesSetFutureRequest.ts b/src/serialization/resources/schedules/client/requests/OrgSchedulesSetFutureRequest.ts new file mode 100644 index 0000000..6df9b92 --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgSchedulesSetFutureRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const OrgSchedulesSetFutureRequest: core.serialization.Schema< + serializers.OrgSchedulesSetFutureRequest.Raw, + DevRev.OrgSchedulesSetFutureRequest +> = core.serialization.object({ + id: core.serialization.string(), + orgScheduleFragmentId: core.serialization.property("org_schedule_fragment_id", core.serialization.string()), +}); + +export declare namespace OrgSchedulesSetFutureRequest { + interface Raw { + id: string; + org_schedule_fragment_id: string; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgSchedulesTransitionRequest.ts b/src/serialization/resources/schedules/client/requests/OrgSchedulesTransitionRequest.ts new file mode 100644 index 0000000..67e126a --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgSchedulesTransitionRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { OrgScheduleStatus } from "../../../../types/OrgScheduleStatus"; + +export const OrgSchedulesTransitionRequest: core.serialization.Schema< + serializers.OrgSchedulesTransitionRequest.Raw, + DevRev.OrgSchedulesTransitionRequest +> = core.serialization.object({ + id: core.serialization.string(), + status: OrgScheduleStatus, +}); + +export declare namespace OrgSchedulesTransitionRequest { + interface Raw { + id: string; + status: OrgScheduleStatus.Raw; + } +} diff --git a/src/serialization/resources/schedules/client/requests/OrgSchedulesUpdateRequest.ts b/src/serialization/resources/schedules/client/requests/OrgSchedulesUpdateRequest.ts new file mode 100644 index 0000000..89b50e5 --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/OrgSchedulesUpdateRequest.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SetWeeklyOrgSchedule } from "../../../../types/SetWeeklyOrgSchedule"; +import { SetOrgScheduleFragmentSummary } from "../../../../types/SetOrgScheduleFragmentSummary"; + +export const OrgSchedulesUpdateRequest: core.serialization.Schema< + serializers.OrgSchedulesUpdateRequest.Raw, + DevRev.OrgSchedulesUpdateRequest +> = core.serialization.object({ + defaultWeeklyOrgSchedule: core.serialization.property( + "default_weekly_org_schedule", + SetWeeklyOrgSchedule.optional() + ), + id: core.serialization.string(), + minValidDays: core.serialization.property("min_valid_days", core.serialization.number().optional()), + name: core.serialization.string().optional(), + orgScheduleFragments: core.serialization.property( + "org_schedule_fragments", + core.serialization.list(SetOrgScheduleFragmentSummary).optional() + ), + timezone: core.serialization.string().optional(), + weeklyOrgSchedules: core.serialization.property( + "weekly_org_schedules", + core.serialization.list(SetWeeklyOrgSchedule).optional() + ), +}); + +export declare namespace OrgSchedulesUpdateRequest { + interface Raw { + default_weekly_org_schedule?: SetWeeklyOrgSchedule.Raw | null; + id: string; + min_valid_days?: number | null; + name?: string | null; + org_schedule_fragments?: SetOrgScheduleFragmentSummary.Raw[] | null; + timezone?: string | null; + weekly_org_schedules?: SetWeeklyOrgSchedule.Raw[] | null; + } +} diff --git a/src/serialization/resources/schedules/client/requests/index.ts b/src/serialization/resources/schedules/client/requests/index.ts new file mode 100644 index 0000000..b21e334 --- /dev/null +++ b/src/serialization/resources/schedules/client/requests/index.ts @@ -0,0 +1,9 @@ +export { OrgScheduleFragmentsCreateRequest } from "./OrgScheduleFragmentsCreateRequest"; +export { OrgScheduleFragmentsGetRequest } from "./OrgScheduleFragmentsGetRequest"; +export { OrgScheduleFragmentsTransitionRequest } from "./OrgScheduleFragmentsTransitionRequest"; +export { OrgSchedulesCreateRequest } from "./OrgSchedulesCreateRequest"; +export { OrgSchedulesGetRequest } from "./OrgSchedulesGetRequest"; +export { OrgSchedulesListRequest } from "./OrgSchedulesListRequest"; +export { OrgSchedulesSetFutureRequest } from "./OrgSchedulesSetFutureRequest"; +export { OrgSchedulesTransitionRequest } from "./OrgSchedulesTransitionRequest"; +export { OrgSchedulesUpdateRequest } from "./OrgSchedulesUpdateRequest"; diff --git a/src/serialization/resources/schedules/index.ts b/src/serialization/resources/schedules/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/schedules/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/search/client/index.ts b/src/serialization/resources/search/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/search/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/search/client/requests/SearchCoreRequest.ts b/src/serialization/resources/search/client/requests/SearchCoreRequest.ts new file mode 100644 index 0000000..1b2b1d4 --- /dev/null +++ b/src/serialization/resources/search/client/requests/SearchCoreRequest.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SearchNamespace } from "../../../../types/SearchNamespace"; +import { SearchSortByParam } from "../../../../types/SearchSortByParam"; +import { SearchSortOrderParam } from "../../../../types/SearchSortOrderParam"; + +export const SearchCoreRequest: core.serialization.Schema = + core.serialization.object({ + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + namespaces: core.serialization.list(SearchNamespace).optional(), + query: core.serialization.string(), + sortBy: core.serialization.property("sort_by", SearchSortByParam.optional()), + sortOrder: core.serialization.property("sort_order", SearchSortOrderParam.optional()), + }); + +export declare namespace SearchCoreRequest { + interface Raw { + cursor?: string | null; + limit?: number | null; + namespaces?: SearchNamespace.Raw[] | null; + query: string; + sort_by?: SearchSortByParam.Raw | null; + sort_order?: SearchSortOrderParam.Raw | null; + } +} diff --git a/src/serialization/resources/search/client/requests/SearchHybridRequest.ts b/src/serialization/resources/search/client/requests/SearchHybridRequest.ts new file mode 100644 index 0000000..6469480 --- /dev/null +++ b/src/serialization/resources/search/client/requests/SearchHybridRequest.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SearchHybridNamespace } from "../../../../types/SearchHybridNamespace"; + +export const SearchHybridRequest: core.serialization.Schema< + serializers.SearchHybridRequest.Raw, + DevRev.SearchHybridRequest +> = core.serialization.object({ + limit: core.serialization.number().optional(), + namespace: SearchHybridNamespace, + query: core.serialization.string(), + semanticWeight: core.serialization.property("semantic_weight", core.serialization.number().optional()), +}); + +export declare namespace SearchHybridRequest { + interface Raw { + limit?: number | null; + namespace: SearchHybridNamespace.Raw; + query: string; + semantic_weight?: number | null; + } +} diff --git a/src/serialization/resources/search/client/requests/index.ts b/src/serialization/resources/search/client/requests/index.ts new file mode 100644 index 0000000..d4a0fb5 --- /dev/null +++ b/src/serialization/resources/search/client/requests/index.ts @@ -0,0 +1,2 @@ +export { SearchCoreRequest } from "./SearchCoreRequest"; +export { SearchHybridRequest } from "./SearchHybridRequest"; diff --git a/src/serialization/resources/search/index.ts b/src/serialization/resources/search/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/search/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/serviceAccounts/client/index.ts b/src/serialization/resources/serviceAccounts/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/serviceAccounts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/serviceAccounts/client/requests/ServiceAccountsGetRequest.ts b/src/serialization/resources/serviceAccounts/client/requests/ServiceAccountsGetRequest.ts new file mode 100644 index 0000000..6a074d9 --- /dev/null +++ b/src/serialization/resources/serviceAccounts/client/requests/ServiceAccountsGetRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ServiceAccountsGetRequest: core.serialization.Schema< + serializers.ServiceAccountsGetRequest.Raw, + DevRev.ServiceAccountsGetRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace ServiceAccountsGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/serviceAccounts/client/requests/index.ts b/src/serialization/resources/serviceAccounts/client/requests/index.ts new file mode 100644 index 0000000..03f8475 --- /dev/null +++ b/src/serialization/resources/serviceAccounts/client/requests/index.ts @@ -0,0 +1 @@ +export { ServiceAccountsGetRequest } from "./ServiceAccountsGetRequest"; diff --git a/src/serialization/resources/serviceAccounts/index.ts b/src/serialization/resources/serviceAccounts/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/serviceAccounts/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/slas/client/index.ts b/src/serialization/resources/slas/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/slas/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/slas/client/requests/MetricDefinitionsListRequest.ts b/src/serialization/resources/slas/client/requests/MetricDefinitionsListRequest.ts new file mode 100644 index 0000000..f3ba21d --- /dev/null +++ b/src/serialization/resources/slas/client/requests/MetricDefinitionsListRequest.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { MetricDefinitionMetricType } from "../../../../types/MetricDefinitionMetricType"; +import { MetricDefinitionAppliesTo } from "../../../../types/MetricDefinitionAppliesTo"; +import { ListMode } from "../../../../types/ListMode"; +import { MetricDefinitionStatus } from "../../../../types/MetricDefinitionStatus"; + +export const MetricDefinitionsListRequest: core.serialization.Schema< + serializers.MetricDefinitionsListRequest.Raw, + DevRev.MetricDefinitionsListRequest +> = core.serialization.object({ + type: core.serialization.list(MetricDefinitionMetricType).optional(), + appliesToType: core.serialization.property( + "applies_to_type", + core.serialization.list(MetricDefinitionAppliesTo).optional() + ), + cursor: core.serialization.string().optional(), + includeCustomMetrics: core.serialization.property( + "include_custom_metrics", + core.serialization.boolean().optional() + ), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + status: core.serialization.list(MetricDefinitionStatus).optional(), +}); + +export declare namespace MetricDefinitionsListRequest { + interface Raw { + type?: MetricDefinitionMetricType.Raw[] | null; + applies_to_type?: MetricDefinitionAppliesTo.Raw[] | null; + cursor?: string | null; + include_custom_metrics?: boolean | null; + limit?: number | null; + mode?: ListMode.Raw | null; + status?: MetricDefinitionStatus.Raw[] | null; + } +} diff --git a/src/serialization/resources/slas/client/requests/SlasAssignRequest.ts b/src/serialization/resources/slas/client/requests/SlasAssignRequest.ts new file mode 100644 index 0000000..10eb673 --- /dev/null +++ b/src/serialization/resources/slas/client/requests/SlasAssignRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SlasAssignRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string().optional(), + revOrgs: core.serialization.property("rev_orgs", core.serialization.list(core.serialization.string())), + }); + +export declare namespace SlasAssignRequest { + interface Raw { + id?: string | null; + rev_orgs: string[]; + } +} diff --git a/src/serialization/resources/slas/client/requests/SlasCreateRequest.ts b/src/serialization/resources/slas/client/requests/SlasCreateRequest.ts new file mode 100644 index 0000000..c4e9dc1 --- /dev/null +++ b/src/serialization/resources/slas/client/requests/SlasCreateRequest.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AccountsFilters } from "../../../../types/AccountsFilters"; +import { SlaAppliesTo } from "../../../../types/SlaAppliesTo"; +import { SlaEvaluationPeriod } from "../../../../types/SlaEvaluationPeriod"; +import { SetSlaPolicy } from "../../../../types/SetSlaPolicy"; +import { SlaType } from "../../../../types/SlaType"; + +export const SlasCreateRequest: core.serialization.Schema = + core.serialization.object({ + accountSelector: core.serialization.property("account_selector", AccountsFilters.optional()), + appliesTo: core.serialization.property("applies_to", core.serialization.list(SlaAppliesTo).optional()), + description: core.serialization.string().optional(), + evaluationPeriod: core.serialization.property("evaluation_period", SlaEvaluationPeriod.optional()), + name: core.serialization.string(), + policies: core.serialization.list(SetSlaPolicy).optional(), + slaType: core.serialization.property("sla_type", SlaType.optional()), + }); + +export declare namespace SlasCreateRequest { + interface Raw { + account_selector?: AccountsFilters.Raw | null; + applies_to?: SlaAppliesTo.Raw[] | null; + description?: string | null; + evaluation_period?: SlaEvaluationPeriod.Raw | null; + name: string; + policies?: SetSlaPolicy.Raw[] | null; + sla_type?: SlaType.Raw | null; + } +} diff --git a/src/serialization/resources/slas/client/requests/SlasGetRequest.ts b/src/serialization/resources/slas/client/requests/SlasGetRequest.ts new file mode 100644 index 0000000..2ba91ca --- /dev/null +++ b/src/serialization/resources/slas/client/requests/SlasGetRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SlasGetRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace SlasGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/slas/client/requests/SlasListRequest.ts b/src/serialization/resources/slas/client/requests/SlasListRequest.ts new file mode 100644 index 0000000..3e0b3bf --- /dev/null +++ b/src/serialization/resources/slas/client/requests/SlasListRequest.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SlaAppliesTo } from "../../../../types/SlaAppliesTo"; +import { SlasFilterAppliesToOperatorType } from "../../../../types/SlasFilterAppliesToOperatorType"; +import { ListMode } from "../../../../types/ListMode"; +import { SlaType } from "../../../../types/SlaType"; +import { SlaStatus } from "../../../../types/SlaStatus"; + +export const SlasListRequest: core.serialization.Schema = + core.serialization.object({ + appliesTo: core.serialization.property("applies_to", core.serialization.list(SlaAppliesTo).optional()), + appliesToOp: core.serialization.property("applies_to_op", SlasFilterAppliesToOperatorType.optional()), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + slaType: core.serialization.property("sla_type", core.serialization.list(SlaType).optional()), + status: core.serialization.list(SlaStatus).optional(), + }); + +export declare namespace SlasListRequest { + interface Raw { + applies_to?: SlaAppliesTo.Raw[] | null; + applies_to_op?: SlasFilterAppliesToOperatorType.Raw | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + sla_type?: SlaType.Raw[] | null; + status?: SlaStatus.Raw[] | null; + } +} diff --git a/src/serialization/resources/slas/client/requests/SlasTransitionRequest.ts b/src/serialization/resources/slas/client/requests/SlasTransitionRequest.ts new file mode 100644 index 0000000..37bcfe7 --- /dev/null +++ b/src/serialization/resources/slas/client/requests/SlasTransitionRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SlaStatus } from "../../../../types/SlaStatus"; + +export const SlasTransitionRequest: core.serialization.Schema< + serializers.SlasTransitionRequest.Raw, + DevRev.SlasTransitionRequest +> = core.serialization.object({ + id: core.serialization.string(), + status: SlaStatus, +}); + +export declare namespace SlasTransitionRequest { + interface Raw { + id: string; + status: SlaStatus.Raw; + } +} diff --git a/src/serialization/resources/slas/client/requests/SlasUpdateRequest.ts b/src/serialization/resources/slas/client/requests/SlasUpdateRequest.ts new file mode 100644 index 0000000..f62e373 --- /dev/null +++ b/src/serialization/resources/slas/client/requests/SlasUpdateRequest.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { AccountsFilters } from "../../../../types/AccountsFilters"; +import { SlaEvaluationPeriod } from "../../../../types/SlaEvaluationPeriod"; +import { SetSlaPolicy } from "../../../../types/SetSlaPolicy"; + +export const SlasUpdateRequest: core.serialization.Schema = + core.serialization.object({ + accountSelector: core.serialization.property("account_selector", AccountsFilters.optional()), + description: core.serialization.string().optional(), + evaluationPeriod: core.serialization.property("evaluation_period", SlaEvaluationPeriod.optional()), + id: core.serialization.string(), + name: core.serialization.string().optional(), + policies: core.serialization.list(SetSlaPolicy).optional(), + }); + +export declare namespace SlasUpdateRequest { + interface Raw { + account_selector?: AccountsFilters.Raw | null; + description?: string | null; + evaluation_period?: SlaEvaluationPeriod.Raw | null; + id: string; + name?: string | null; + policies?: SetSlaPolicy.Raw[] | null; + } +} diff --git a/src/serialization/resources/slas/client/requests/index.ts b/src/serialization/resources/slas/client/requests/index.ts new file mode 100644 index 0000000..3258c95 --- /dev/null +++ b/src/serialization/resources/slas/client/requests/index.ts @@ -0,0 +1,7 @@ +export { MetricDefinitionsListRequest } from "./MetricDefinitionsListRequest"; +export { SlasAssignRequest } from "./SlasAssignRequest"; +export { SlasCreateRequest } from "./SlasCreateRequest"; +export { SlasGetRequest } from "./SlasGetRequest"; +export { SlasListRequest } from "./SlasListRequest"; +export { SlasTransitionRequest } from "./SlasTransitionRequest"; +export { SlasUpdateRequest } from "./SlasUpdateRequest"; diff --git a/src/serialization/resources/slas/index.ts b/src/serialization/resources/slas/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/slas/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/snapIns/client/index.ts b/src/serialization/resources/snapIns/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/snapIns/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/snapIns/client/requests/SnapInsResourcesRequest.ts b/src/serialization/resources/snapIns/client/requests/SnapInsResourcesRequest.ts new file mode 100644 index 0000000..4f2b339 --- /dev/null +++ b/src/serialization/resources/snapIns/client/requests/SnapInsResourcesRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SnapInsResourcesRequest: core.serialization.Schema< + serializers.SnapInsResourcesRequest.Raw, + DevRev.SnapInsResourcesRequest +> = core.serialization.object({ + id: core.serialization.string(), + user: core.serialization.string(), +}); + +export declare namespace SnapInsResourcesRequest { + interface Raw { + id: string; + user: string; + } +} diff --git a/src/serialization/resources/snapIns/client/requests/index.ts b/src/serialization/resources/snapIns/client/requests/index.ts new file mode 100644 index 0000000..baadb23 --- /dev/null +++ b/src/serialization/resources/snapIns/client/requests/index.ts @@ -0,0 +1 @@ +export { SnapInsResourcesRequest } from "./SnapInsResourcesRequest"; diff --git a/src/serialization/resources/snapIns/index.ts b/src/serialization/resources/snapIns/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/snapIns/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/surveys/client/index.ts b/src/serialization/resources/surveys/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/surveys/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/surveys/client/requests/SurveysCreateRequest.ts b/src/serialization/resources/surveys/client/requests/SurveysCreateRequest.ts new file mode 100644 index 0000000..0dbcdae --- /dev/null +++ b/src/serialization/resources/surveys/client/requests/SurveysCreateRequest.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { FieldDescriptor } from "../../../../types/FieldDescriptor"; +import { SurveyFieldWithMetadata } from "../../../../types/SurveyFieldWithMetadata"; + +export const SurveysCreateRequest: core.serialization.Schema< + serializers.SurveysCreateRequest.Raw, + DevRev.SurveysCreateRequest +> = core.serialization.object({ + description: core.serialization.string().optional(), + introductoryText: core.serialization.property("introductory_text", core.serialization.string().optional()), + name: core.serialization.string(), + responseText: core.serialization.property("response_text", core.serialization.string().optional()), + schema: core.serialization.list(FieldDescriptor).optional(), + schemaWithMetadata: core.serialization.property( + "schema_with_metadata", + core.serialization.list(SurveyFieldWithMetadata).optional() + ), +}); + +export declare namespace SurveysCreateRequest { + interface Raw { + description?: string | null; + introductory_text?: string | null; + name: string; + response_text?: string | null; + schema?: FieldDescriptor.Raw[] | null; + schema_with_metadata?: SurveyFieldWithMetadata.Raw[] | null; + } +} diff --git a/src/serialization/resources/surveys/client/requests/SurveysDeleteRequest.ts b/src/serialization/resources/surveys/client/requests/SurveysDeleteRequest.ts new file mode 100644 index 0000000..8e949ba --- /dev/null +++ b/src/serialization/resources/surveys/client/requests/SurveysDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SurveysDeleteRequest: core.serialization.Schema< + serializers.SurveysDeleteRequest.Raw, + DevRev.SurveysDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace SurveysDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/surveys/client/requests/SurveysListRequest.ts b/src/serialization/resources/surveys/client/requests/SurveysListRequest.ts new file mode 100644 index 0000000..56ff009 --- /dev/null +++ b/src/serialization/resources/surveys/client/requests/SurveysListRequest.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DateFilter } from "../../../../types/DateFilter"; +import { ListMode } from "../../../../types/ListMode"; + +export const SurveysListRequest: core.serialization.Schema< + serializers.SurveysListRequest.Raw, + DevRev.SurveysListRequest +> = core.serialization.object({ + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateFilter.optional()), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedDate: core.serialization.property("modified_date", DateFilter.optional()), + name: core.serialization.list(core.serialization.string()).optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace SurveysListRequest { + interface Raw { + created_by?: string[] | null; + created_date?: DateFilter.Raw | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_date?: DateFilter.Raw | null; + name?: string[] | null; + sort_by?: string[] | null; + } +} diff --git a/src/serialization/resources/surveys/client/requests/SurveysResponsesListRequest.ts b/src/serialization/resources/surveys/client/requests/SurveysResponsesListRequest.ts new file mode 100644 index 0000000..1b2b2bb --- /dev/null +++ b/src/serialization/resources/surveys/client/requests/SurveysResponsesListRequest.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { DateFilter } from "../../../../types/DateFilter"; +import { ListMode } from "../../../../types/ListMode"; + +export const SurveysResponsesListRequest: core.serialization.Schema< + serializers.SurveysResponsesListRequest.Raw, + DevRev.SurveysResponsesListRequest +> = core.serialization.object({ + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateFilter.optional()), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedDate: core.serialization.property("modified_date", DateFilter.optional()), + objects: core.serialization.list(core.serialization.string()).optional(), + recipient: core.serialization.list(core.serialization.string()).optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + stages: core.serialization.list(core.serialization.number()).optional(), + surveys: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace SurveysResponsesListRequest { + interface Raw { + created_by?: string[] | null; + created_date?: DateFilter.Raw | null; + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_date?: DateFilter.Raw | null; + objects?: string[] | null; + recipient?: string[] | null; + sort_by?: string[] | null; + stages?: number[] | null; + surveys?: string[] | null; + } +} diff --git a/src/serialization/resources/surveys/client/requests/SurveysSendRequest.ts b/src/serialization/resources/surveys/client/requests/SurveysSendRequest.ts new file mode 100644 index 0000000..aecbfd5 --- /dev/null +++ b/src/serialization/resources/surveys/client/requests/SurveysSendRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { SurveysSendRequestEmail } from "../../../../types/SurveysSendRequestEmail"; + +export const SurveysSendRequest: core.serialization.Schema< + serializers.SurveysSendRequest.Raw, + DevRev.SurveysSendRequest +> = core.serialization.object({ + email: SurveysSendRequestEmail, +}); + +export declare namespace SurveysSendRequest { + interface Raw { + email: SurveysSendRequestEmail.Raw; + } +} diff --git a/src/serialization/resources/surveys/client/requests/SurveysSubmitRequest.ts b/src/serialization/resources/surveys/client/requests/SurveysSubmitRequest.ts new file mode 100644 index 0000000..d18bcf9 --- /dev/null +++ b/src/serialization/resources/surveys/client/requests/SurveysSubmitRequest.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SurveysSubmitRequest: core.serialization.Schema< + serializers.SurveysSubmitRequest.Raw, + DevRev.SurveysSubmitRequest +> = core.serialization.object({ + dispatchId: core.serialization.property("dispatch_id", core.serialization.string().optional()), + dispatchedChannels: core.serialization.property( + "dispatched_channels", + core.serialization.list(core.serialization.number()).optional() + ), + object: core.serialization.string(), + recipient: core.serialization.string().optional(), + response: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + responseScore: core.serialization.property("response_score", core.serialization.number().optional()), + sourceChannel: core.serialization.property("source_channel", core.serialization.string().optional()), + stage: core.serialization.number().optional(), + survey: core.serialization.string(), +}); + +export declare namespace SurveysSubmitRequest { + interface Raw { + dispatch_id?: string | null; + dispatched_channels?: number[] | null; + object: string; + recipient?: string | null; + response?: Record | null; + response_score?: number | null; + source_channel?: string | null; + stage?: number | null; + survey: string; + } +} diff --git a/src/serialization/resources/surveys/client/requests/index.ts b/src/serialization/resources/surveys/client/requests/index.ts new file mode 100644 index 0000000..64b7e67 --- /dev/null +++ b/src/serialization/resources/surveys/client/requests/index.ts @@ -0,0 +1,6 @@ +export { SurveysCreateRequest } from "./SurveysCreateRequest"; +export { SurveysDeleteRequest } from "./SurveysDeleteRequest"; +export { SurveysListRequest } from "./SurveysListRequest"; +export { SurveysResponsesListRequest } from "./SurveysResponsesListRequest"; +export { SurveysSendRequest } from "./SurveysSendRequest"; +export { SurveysSubmitRequest } from "./SurveysSubmitRequest"; diff --git a/src/serialization/resources/surveys/index.ts b/src/serialization/resources/surveys/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/surveys/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/sysUsers/client/index.ts b/src/serialization/resources/sysUsers/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/sysUsers/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/sysUsers/client/requests/SysUsersListRequest.ts b/src/serialization/resources/sysUsers/client/requests/SysUsersListRequest.ts new file mode 100644 index 0000000..d8bde1c --- /dev/null +++ b/src/serialization/resources/sysUsers/client/requests/SysUsersListRequest.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ListMode } from "../../../../types/ListMode"; + +export const SysUsersListRequest: core.serialization.Schema< + serializers.SysUsersListRequest.Raw, + DevRev.SysUsersListRequest +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace SysUsersListRequest { + interface Raw { + cursor?: string | null; + limit?: number | null; + mode?: ListMode.Raw | null; + sort_by?: string[] | null; + } +} diff --git a/src/serialization/resources/sysUsers/client/requests/SysUsersUpdateRequest.ts b/src/serialization/resources/sysUsers/client/requests/SysUsersUpdateRequest.ts new file mode 100644 index 0000000..69952b1 --- /dev/null +++ b/src/serialization/resources/sysUsers/client/requests/SysUsersUpdateRequest.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SysUsersUpdateRequest: core.serialization.Schema< + serializers.SysUsersUpdateRequest.Raw, + DevRev.SysUsersUpdateRequest +> = core.serialization.object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + displayPicture: core.serialization.property("display_picture", core.serialization.string().optional()), + fullName: core.serialization.property("full_name", core.serialization.string().optional()), + id: core.serialization.string(), +}); + +export declare namespace SysUsersUpdateRequest { + interface Raw { + display_name?: string | null; + display_picture?: string | null; + full_name?: string | null; + id: string; + } +} diff --git a/src/serialization/resources/sysUsers/client/requests/index.ts b/src/serialization/resources/sysUsers/client/requests/index.ts new file mode 100644 index 0000000..557a8b4 --- /dev/null +++ b/src/serialization/resources/sysUsers/client/requests/index.ts @@ -0,0 +1,2 @@ +export { SysUsersListRequest } from "./SysUsersListRequest"; +export { SysUsersUpdateRequest } from "./SysUsersUpdateRequest"; diff --git a/src/serialization/resources/sysUsers/index.ts b/src/serialization/resources/sysUsers/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/sysUsers/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/timelineEntries/client/index.ts b/src/serialization/resources/timelineEntries/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/timelineEntries/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/timelineEntries/client/requests/TimelineEntriesListRequest.ts b/src/serialization/resources/timelineEntries/client/requests/TimelineEntriesListRequest.ts new file mode 100644 index 0000000..6ce0a38 --- /dev/null +++ b/src/serialization/resources/timelineEntries/client/requests/TimelineEntriesListRequest.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { TimelineEntriesCollection } from "../../../../types/TimelineEntriesCollection"; +import { ListMode } from "../../../../types/ListMode"; +import { TimelineEntryVisibility } from "../../../../types/TimelineEntryVisibility"; + +export const TimelineEntriesListRequest: core.serialization.Schema< + serializers.TimelineEntriesListRequest.Raw, + DevRev.TimelineEntriesListRequest +> = core.serialization.object({ + collections: core.serialization.list(TimelineEntriesCollection).optional(), + cursor: core.serialization.string().optional(), + labels: core.serialization.list(core.serialization.string()).optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + object: core.serialization.string(), + visibility: core.serialization.list(TimelineEntryVisibility).optional(), +}); + +export declare namespace TimelineEntriesListRequest { + interface Raw { + collections?: TimelineEntriesCollection.Raw[] | null; + cursor?: string | null; + labels?: string[] | null; + limit?: number | null; + mode?: ListMode.Raw | null; + object: string; + visibility?: TimelineEntryVisibility.Raw[] | null; + } +} diff --git a/src/serialization/resources/timelineEntries/client/requests/index.ts b/src/serialization/resources/timelineEntries/client/requests/index.ts new file mode 100644 index 0000000..0cda9d5 --- /dev/null +++ b/src/serialization/resources/timelineEntries/client/requests/index.ts @@ -0,0 +1 @@ +export { TimelineEntriesListRequest } from "./TimelineEntriesListRequest"; diff --git a/src/serialization/resources/timelineEntries/index.ts b/src/serialization/resources/timelineEntries/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/timelineEntries/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/works/client/index.ts b/src/serialization/resources/works/client/index.ts new file mode 100644 index 0000000..415726b --- /dev/null +++ b/src/serialization/resources/works/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/works/client/requests/WorksDeleteRequest.ts b/src/serialization/resources/works/client/requests/WorksDeleteRequest.ts new file mode 100644 index 0000000..ad5a10b --- /dev/null +++ b/src/serialization/resources/works/client/requests/WorksDeleteRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const WorksDeleteRequest: core.serialization.Schema< + serializers.WorksDeleteRequest.Raw, + DevRev.WorksDeleteRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace WorksDeleteRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/works/client/requests/WorksExportRequest.ts b/src/serialization/resources/works/client/requests/WorksExportRequest.ts new file mode 100644 index 0000000..6247fbb --- /dev/null +++ b/src/serialization/resources/works/client/requests/WorksExportRequest.ts @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { WorkType } from "../../../../types/WorkType"; +import { DateFilter } from "../../../../types/DateFilter"; +import { WorksFilterIssue } from "../../../../types/WorksFilterIssue"; +import { WorksFilterOpportunity } from "../../../../types/WorksFilterOpportunity"; +import { StageFilter } from "../../../../types/StageFilter"; +import { StagedInfoFilter } from "../../../../types/StagedInfoFilter"; +import { SyncMetadataFilter } from "../../../../types/SyncMetadataFilter"; +import { WorksFilterTicket } from "../../../../types/WorksFilterTicket"; + +export const WorksExportRequest: core.serialization.Schema< + serializers.WorksExportRequest.Raw, + DevRev.WorksExportRequest +> = core.serialization.object({ + type: core.serialization.list(WorkType).optional(), + actualCloseDate: core.serialization.property("actual_close_date", DateFilter.optional()), + appliesToPart: core.serialization.property( + "applies_to_part", + core.serialization.list(core.serialization.string()).optional() + ), + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateFilter.optional()), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + first: core.serialization.number().optional(), + issue: WorksFilterIssue.optional(), + modifiedDate: core.serialization.property("modified_date", DateFilter.optional()), + opportunity: WorksFilterOpportunity.optional(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string()).optional()), + reportedBy: core.serialization.property( + "reported_by", + core.serialization.list(core.serialization.string()).optional() + ), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + stage: StageFilter.optional(), + stagedInfo: core.serialization.property("staged_info", StagedInfoFilter.optional()), + syncMetadata: core.serialization.property("sync_metadata", SyncMetadataFilter.optional()), + tags: core.serialization.list(core.serialization.string()).optional(), + targetCloseDate: core.serialization.property("target_close_date", DateFilter.optional()), + ticket: WorksFilterTicket.optional(), +}); + +export declare namespace WorksExportRequest { + interface Raw { + type?: WorkType.Raw[] | null; + actual_close_date?: DateFilter.Raw | null; + applies_to_part?: string[] | null; + created_by?: string[] | null; + created_date?: DateFilter.Raw | null; + custom_fields?: Record | null; + first?: number | null; + issue?: WorksFilterIssue.Raw | null; + modified_date?: DateFilter.Raw | null; + opportunity?: WorksFilterOpportunity.Raw | null; + owned_by?: string[] | null; + reported_by?: string[] | null; + sort_by?: string[] | null; + stage?: StageFilter.Raw | null; + staged_info?: StagedInfoFilter.Raw | null; + sync_metadata?: SyncMetadataFilter.Raw | null; + tags?: string[] | null; + target_close_date?: DateFilter.Raw | null; + ticket?: WorksFilterTicket.Raw | null; + } +} diff --git a/src/serialization/resources/works/client/requests/WorksGetRequest.ts b/src/serialization/resources/works/client/requests/WorksGetRequest.ts new file mode 100644 index 0000000..14c46db --- /dev/null +++ b/src/serialization/resources/works/client/requests/WorksGetRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const WorksGetRequest: core.serialization.Schema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace WorksGetRequest { + interface Raw { + id: string; + } +} diff --git a/src/serialization/resources/works/client/requests/WorksListRequest.ts b/src/serialization/resources/works/client/requests/WorksListRequest.ts new file mode 100644 index 0000000..1869cee --- /dev/null +++ b/src/serialization/resources/works/client/requests/WorksListRequest.ts @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as DevRev from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { WorkType } from "../../../../types/WorkType"; +import { DateFilter } from "../../../../types/DateFilter"; +import { WorksFilterIssue } from "../../../../types/WorksFilterIssue"; +import { ListMode } from "../../../../types/ListMode"; +import { WorksFilterOpportunity } from "../../../../types/WorksFilterOpportunity"; +import { StageFilter } from "../../../../types/StageFilter"; +import { StagedInfoFilter } from "../../../../types/StagedInfoFilter"; +import { SyncMetadataFilter } from "../../../../types/SyncMetadataFilter"; +import { WorksFilterTicket } from "../../../../types/WorksFilterTicket"; + +export const WorksListRequest: core.serialization.Schema = + core.serialization.object({ + type: core.serialization.list(WorkType).optional(), + actualCloseDate: core.serialization.property("actual_close_date", DateFilter.optional()), + appliesToPart: core.serialization.property( + "applies_to_part", + core.serialization.list(core.serialization.string()).optional() + ), + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateFilter.optional()), + cursor: core.serialization.string().optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + issue: WorksFilterIssue.optional(), + limit: core.serialization.number().optional(), + mode: ListMode.optional(), + modifiedDate: core.serialization.property("modified_date", DateFilter.optional()), + opportunity: WorksFilterOpportunity.optional(), + ownedBy: core.serialization.property( + "owned_by", + core.serialization.list(core.serialization.string()).optional() + ), + reportedBy: core.serialization.property( + "reported_by", + core.serialization.list(core.serialization.string()).optional() + ), + sortBy: core.serialization.property("sort_by", core.serialization.list(core.serialization.string()).optional()), + stage: StageFilter.optional(), + stagedInfo: core.serialization.property("staged_info", StagedInfoFilter.optional()), + syncMetadata: core.serialization.property("sync_metadata", SyncMetadataFilter.optional()), + tags: core.serialization.list(core.serialization.string()).optional(), + targetCloseDate: core.serialization.property("target_close_date", DateFilter.optional()), + ticket: WorksFilterTicket.optional(), + }); + +export declare namespace WorksListRequest { + interface Raw { + type?: WorkType.Raw[] | null; + actual_close_date?: DateFilter.Raw | null; + applies_to_part?: string[] | null; + created_by?: string[] | null; + created_date?: DateFilter.Raw | null; + cursor?: string | null; + custom_fields?: Record | null; + issue?: WorksFilterIssue.Raw | null; + limit?: number | null; + mode?: ListMode.Raw | null; + modified_date?: DateFilter.Raw | null; + opportunity?: WorksFilterOpportunity.Raw | null; + owned_by?: string[] | null; + reported_by?: string[] | null; + sort_by?: string[] | null; + stage?: StageFilter.Raw | null; + staged_info?: StagedInfoFilter.Raw | null; + sync_metadata?: SyncMetadataFilter.Raw | null; + tags?: string[] | null; + target_close_date?: DateFilter.Raw | null; + ticket?: WorksFilterTicket.Raw | null; + } +} diff --git a/src/serialization/resources/works/client/requests/index.ts b/src/serialization/resources/works/client/requests/index.ts new file mode 100644 index 0000000..0abb44e --- /dev/null +++ b/src/serialization/resources/works/client/requests/index.ts @@ -0,0 +1,4 @@ +export { WorksDeleteRequest } from "./WorksDeleteRequest"; +export { WorksExportRequest } from "./WorksExportRequest"; +export { WorksGetRequest } from "./WorksGetRequest"; +export { WorksListRequest } from "./WorksListRequest"; diff --git a/src/serialization/resources/works/index.ts b/src/serialization/resources/works/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/serialization/resources/works/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/types/AccessLevel.ts b/src/serialization/types/AccessLevel.ts new file mode 100644 index 0000000..c4e619e --- /dev/null +++ b/src/serialization/types/AccessLevel.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const AccessLevel: core.serialization.Schema = + core.serialization.enum_(["external", "internal", "private", "public", "restricted"]); + +export declare namespace AccessLevel { + type Raw = "external" | "internal" | "private" | "public" | "restricted"; +} diff --git a/src/serialization/types/Account.ts b/src/serialization/types/Account.ts new file mode 100644 index 0000000..21925c7 --- /dev/null +++ b/src/serialization/types/Account.ts @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { UserSummary } from "./UserSummary"; +import { TagWithValue } from "./TagWithValue"; +import { OrgBase } from "./OrgBase"; + +export const Account: core.serialization.ObjectSchema = core.serialization + .object({ + artifacts: core.serialization.list(ArtifactSummary).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + domains: core.serialization.list(core.serialization.string()).optional(), + externalRefs: core.serialization.property( + "external_refs", + core.serialization.list(core.serialization.string()) + ), + ownedBy: core.serialization.property("owned_by", core.serialization.list(UserSummary)), + stockSchemaFragment: core.serialization.property( + "stock_schema_fragment", + core.serialization.string().optional() + ), + subtype: core.serialization.string().optional(), + tags: core.serialization.list(TagWithValue).optional(), + tier: core.serialization.string().optional(), + }) + .extend(OrgBase); + +export declare namespace Account { + interface Raw extends OrgBase.Raw { + artifacts?: ArtifactSummary.Raw[] | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + domains?: string[] | null; + external_refs: string[]; + owned_by: UserSummary.Raw[]; + stock_schema_fragment?: string | null; + subtype?: string | null; + tags?: TagWithValue.Raw[] | null; + tier?: string | null; + } +} diff --git a/src/serialization/types/AccountSearchSummary.ts b/src/serialization/types/AccountSearchSummary.ts new file mode 100644 index 0000000..f084316 --- /dev/null +++ b/src/serialization/types/AccountSearchSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AccountSummary } from "./AccountSummary"; +import { CommentSearchSummary } from "./CommentSearchSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const AccountSearchSummary: core.serialization.ObjectSchema< + serializers.AccountSearchSummary.Raw, + DevRev.AccountSearchSummary +> = core.serialization + .object({ + account: AccountSummary, + comments: core.serialization.list(CommentSearchSummary).optional(), + }) + .extend(SearchSummaryBase); + +export declare namespace AccountSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + account: AccountSummary.Raw; + comments?: CommentSearchSummary.Raw[] | null; + } +} diff --git a/src/serialization/types/AccountSummary.ts b/src/serialization/types/AccountSummary.ts new file mode 100644 index 0000000..bd52954 --- /dev/null +++ b/src/serialization/types/AccountSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgBaseSummary } from "./OrgBaseSummary"; + +export const AccountSummary: core.serialization.ObjectSchema = + OrgBaseSummary; + +export declare namespace AccountSummary { + type Raw = OrgBaseSummary.Raw; +} diff --git a/src/serialization/types/AccountsCreateResponse.ts b/src/serialization/types/AccountsCreateResponse.ts new file mode 100644 index 0000000..27d5cd5 --- /dev/null +++ b/src/serialization/types/AccountsCreateResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; +import { RevOrg } from "./RevOrg"; + +export const AccountsCreateResponse: core.serialization.ObjectSchema< + serializers.AccountsCreateResponse.Raw, + DevRev.AccountsCreateResponse +> = core.serialization.object({ + account: Account, + defaultRevOrg: core.serialization.property("default_rev_org", RevOrg), +}); + +export declare namespace AccountsCreateResponse { + interface Raw { + account: Account.Raw; + default_rev_org: RevOrg.Raw; + } +} diff --git a/src/serialization/types/AccountsDeleteResponse.ts b/src/serialization/types/AccountsDeleteResponse.ts new file mode 100644 index 0000000..59d0a25 --- /dev/null +++ b/src/serialization/types/AccountsDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const AccountsDeleteResponse: core.serialization.Schema< + serializers.AccountsDeleteResponse.Raw, + DevRev.AccountsDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace AccountsDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/AccountsExportResponse.ts b/src/serialization/types/AccountsExportResponse.ts new file mode 100644 index 0000000..94ff979 --- /dev/null +++ b/src/serialization/types/AccountsExportResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; + +export const AccountsExportResponse: core.serialization.ObjectSchema< + serializers.AccountsExportResponse.Raw, + DevRev.AccountsExportResponse +> = core.serialization.object({ + accounts: core.serialization.list(Account), +}); + +export declare namespace AccountsExportResponse { + interface Raw { + accounts: Account.Raw[]; + } +} diff --git a/src/serialization/types/AccountsFilters.ts b/src/serialization/types/AccountsFilters.ts new file mode 100644 index 0000000..f3f12cd --- /dev/null +++ b/src/serialization/types/AccountsFilters.ts @@ -0,0 +1,52 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DateTimeFilter } from "./DateTimeFilter"; + +export const AccountsFilters: core.serialization.ObjectSchema = + core.serialization.object({ + createdBy: core.serialization.property( + "created_by", + core.serialization.list(core.serialization.string()).optional() + ), + createdDate: core.serialization.property("created_date", DateTimeFilter.optional()), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + displayName: core.serialization.property( + "display_name", + core.serialization.list(core.serialization.string()).optional() + ), + domains: core.serialization.list(core.serialization.string()).optional(), + externalRefs: core.serialization.property( + "external_refs", + core.serialization.list(core.serialization.string()).optional() + ), + modifiedDate: core.serialization.property("modified_date", DateTimeFilter.optional()), + ownedBy: core.serialization.property( + "owned_by", + core.serialization.list(core.serialization.string()).optional() + ), + stage: core.serialization.list(core.serialization.string()).optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + }); + +export declare namespace AccountsFilters { + interface Raw { + created_by?: string[] | null; + created_date?: DateTimeFilter.Raw | null; + custom_fields?: Record | null; + display_name?: string[] | null; + domains?: string[] | null; + external_refs?: string[] | null; + modified_date?: DateTimeFilter.Raw | null; + owned_by?: string[] | null; + stage?: string[] | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/types/AccountsGetResponse.ts b/src/serialization/types/AccountsGetResponse.ts new file mode 100644 index 0000000..5c1ea8d --- /dev/null +++ b/src/serialization/types/AccountsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; + +export const AccountsGetResponse: core.serialization.ObjectSchema< + serializers.AccountsGetResponse.Raw, + DevRev.AccountsGetResponse +> = core.serialization.object({ + account: Account, +}); + +export declare namespace AccountsGetResponse { + interface Raw { + account: Account.Raw; + } +} diff --git a/src/serialization/types/AccountsListResponse.ts b/src/serialization/types/AccountsListResponse.ts new file mode 100644 index 0000000..20cd75c --- /dev/null +++ b/src/serialization/types/AccountsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; + +export const AccountsListResponse: core.serialization.ObjectSchema< + serializers.AccountsListResponse.Raw, + DevRev.AccountsListResponse +> = core.serialization.object({ + accounts: core.serialization.list(Account), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace AccountsListResponse { + interface Raw { + accounts: Account.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/AccountsUpdateRequestArtifacts.ts b/src/serialization/types/AccountsUpdateRequestArtifacts.ts new file mode 100644 index 0000000..8323bd4 --- /dev/null +++ b/src/serialization/types/AccountsUpdateRequestArtifacts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const AccountsUpdateRequestArtifacts: core.serialization.ObjectSchema< + serializers.AccountsUpdateRequestArtifacts.Raw, + DevRev.AccountsUpdateRequestArtifacts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace AccountsUpdateRequestArtifacts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/AccountsUpdateResponse.ts b/src/serialization/types/AccountsUpdateResponse.ts new file mode 100644 index 0000000..4bb04b9 --- /dev/null +++ b/src/serialization/types/AccountsUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; + +export const AccountsUpdateResponse: core.serialization.ObjectSchema< + serializers.AccountsUpdateResponse.Raw, + DevRev.AccountsUpdateResponse +> = core.serialization.object({ + account: Account, +}); + +export declare namespace AccountsUpdateResponse { + interface Raw { + account: Account.Raw; + } +} diff --git a/src/serialization/types/AggregatedSchema.ts b/src/serialization/types/AggregatedSchema.ts new file mode 100644 index 0000000..1ac3449 --- /dev/null +++ b/src/serialization/types/AggregatedSchema.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const AggregatedSchema: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace AggregatedSchema { + type Raw = Record; +} diff --git a/src/serialization/types/AggregatedSchemaGetResponse.ts b/src/serialization/types/AggregatedSchemaGetResponse.ts new file mode 100644 index 0000000..092d86e --- /dev/null +++ b/src/serialization/types/AggregatedSchemaGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AggregatedSchema } from "./AggregatedSchema"; + +export const AggregatedSchemaGetResponse: core.serialization.ObjectSchema< + serializers.AggregatedSchemaGetResponse.Raw, + DevRev.AggregatedSchemaGetResponse +> = core.serialization.object({ + schema: AggregatedSchema, +}); + +export declare namespace AggregatedSchemaGetResponse { + interface Raw { + schema: AggregatedSchema.Raw; + } +} diff --git a/src/serialization/types/AggregationDetail.ts b/src/serialization/types/AggregationDetail.ts new file mode 100644 index 0000000..f8063fb --- /dev/null +++ b/src/serialization/types/AggregationDetail.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AggregationDetailAggregationType } from "./AggregationDetailAggregationType"; + +export const AggregationDetail: core.serialization.ObjectSchema< + serializers.AggregationDetail.Raw, + DevRev.AggregationDetail +> = core.serialization.object({ + aggregationType: core.serialization.property("aggregation_type", AggregationDetailAggregationType), + uniqueDimension: core.serialization.property("unique_dimension", core.serialization.string().optional()), +}); + +export declare namespace AggregationDetail { + interface Raw { + aggregation_type: AggregationDetailAggregationType.Raw; + unique_dimension?: string | null; + } +} diff --git a/src/serialization/types/AggregationDetailAggregationType.ts b/src/serialization/types/AggregationDetailAggregationType.ts new file mode 100644 index 0000000..56da49c --- /dev/null +++ b/src/serialization/types/AggregationDetailAggregationType.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const AggregationDetailAggregationType: core.serialization.Schema< + serializers.AggregationDetailAggregationType.Raw, + DevRev.AggregationDetailAggregationType +> = core.serialization.enum_([ + "duration", + "latest", + "maximum", + "minimum", + "oldest", + "running_total", + "sum", + "unique_count", +]); + +export declare namespace AggregationDetailAggregationType { + type Raw = "duration" | "latest" | "maximum" | "minimum" | "oldest" | "running_total" | "sum" | "unique_count"; +} diff --git a/src/serialization/types/AppFragment.ts b/src/serialization/types/AppFragment.ts new file mode 100644 index 0000000..5870a59 --- /dev/null +++ b/src/serialization/types/AppFragment.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragmentBase } from "./CustomSchemaFragmentBase"; + +export const AppFragment: core.serialization.ObjectSchema = + core.serialization + .object({ + app: core.serialization.string().optional(), + }) + .extend(CustomSchemaFragmentBase); + +export declare namespace AppFragment { + interface Raw extends CustomSchemaFragmentBase.Raw { + app?: string | null; + } +} diff --git a/src/serialization/types/AppFragmentSummary.ts b/src/serialization/types/AppFragmentSummary.ts new file mode 100644 index 0000000..96a2733 --- /dev/null +++ b/src/serialization/types/AppFragmentSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragmentBaseSummary } from "./CustomSchemaFragmentBaseSummary"; + +export const AppFragmentSummary: core.serialization.ObjectSchema< + serializers.AppFragmentSummary.Raw, + DevRev.AppFragmentSummary +> = CustomSchemaFragmentBaseSummary; + +export declare namespace AppFragmentSummary { + type Raw = CustomSchemaFragmentBaseSummary.Raw; +} diff --git a/src/serialization/types/ArchetypeMetricTarget.ts b/src/serialization/types/ArchetypeMetricTarget.ts new file mode 100644 index 0000000..fcd4beb --- /dev/null +++ b/src/serialization/types/ArchetypeMetricTarget.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { MetricDefinitionSummary } from "./MetricDefinitionSummary"; +import { OrgScheduleSummary } from "./OrgScheduleSummary"; + +export const ArchetypeMetricTarget: core.serialization.ObjectSchema< + serializers.ArchetypeMetricTarget.Raw, + DevRev.ArchetypeMetricTarget +> = core.serialization.object({ + isOutOfSchedule: core.serialization.property("is_out_of_schedule", core.serialization.boolean().optional()), + metricDefinition: core.serialization.property("metric_definition", MetricDefinitionSummary), + orgSchedule: core.serialization.property("org_schedule", OrgScheduleSummary.optional()), + remainingTime: core.serialization.property("remaining_time", core.serialization.number().optional()), + targetTime: core.serialization.property("target_time", core.serialization.date().optional()), + warningTargetTime: core.serialization.property("warning_target_time", core.serialization.date().optional()), +}); + +export declare namespace ArchetypeMetricTarget { + interface Raw { + is_out_of_schedule?: boolean | null; + metric_definition: MetricDefinitionSummary.Raw; + org_schedule?: OrgScheduleSummary.Raw | null; + remaining_time?: number | null; + target_time?: string | null; + warning_target_time?: string | null; + } +} diff --git a/src/serialization/types/Article.ts b/src/serialization/types/Article.ts new file mode 100644 index 0000000..106f8d4 --- /dev/null +++ b/src/serialization/types/Article.ts @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartSummary } from "./PartSummary"; +import { ArticleType } from "./ArticleType"; +import { UserSummary } from "./UserSummary"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { DirectorySummary } from "./DirectorySummary"; +import { Resource } from "./Resource"; +import { EnumValue } from "./EnumValue"; +import { AtomBase } from "./AtomBase"; + +export const Article: core.serialization.ObjectSchema = core.serialization + .object({ + appliesToParts: core.serialization.property("applies_to_parts", core.serialization.list(PartSummary)), + articleType: core.serialization.property("article_type", ArticleType.optional()), + authoredBy: core.serialization.property("authored_by", core.serialization.list(UserSummary).optional()), + description: core.serialization.string().optional(), + extractedContent: core.serialization.property( + "extracted_content", + core.serialization.list(ArtifactSummary).optional() + ), + numDownvotes: core.serialization.property("num_downvotes", core.serialization.number().optional()), + numUpvotes: core.serialization.property("num_upvotes", core.serialization.number().optional()), + ownedBy: core.serialization.property("owned_by", core.serialization.list(UserSummary)), + parent: DirectorySummary.optional(), + rank: core.serialization.string().optional(), + resource: Resource.optional(), + scope: EnumValue.optional(), + title: core.serialization.string().optional(), + }) + .extend(AtomBase); + +export declare namespace Article { + interface Raw extends AtomBase.Raw { + applies_to_parts: PartSummary.Raw[]; + article_type?: ArticleType.Raw | null; + authored_by?: UserSummary.Raw[] | null; + description?: string | null; + extracted_content?: ArtifactSummary.Raw[] | null; + num_downvotes?: number | null; + num_upvotes?: number | null; + owned_by: UserSummary.Raw[]; + parent?: DirectorySummary.Raw | null; + rank?: string | null; + resource?: Resource.Raw | null; + scope?: EnumValue.Raw | null; + title?: string | null; + } +} diff --git a/src/serialization/types/ArticleSearchSummary.ts b/src/serialization/types/ArticleSearchSummary.ts new file mode 100644 index 0000000..3d6c9e6 --- /dev/null +++ b/src/serialization/types/ArticleSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArticleSummary } from "./ArticleSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const ArticleSearchSummary: core.serialization.ObjectSchema< + serializers.ArticleSearchSummary.Raw, + DevRev.ArticleSearchSummary +> = core.serialization + .object({ + article: ArticleSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace ArticleSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + article: ArticleSummary.Raw; + } +} diff --git a/src/serialization/types/ArticleStatus.ts b/src/serialization/types/ArticleStatus.ts new file mode 100644 index 0000000..8715a88 --- /dev/null +++ b/src/serialization/types/ArticleStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticleStatus: core.serialization.Schema = + core.serialization.enum_(["archived", "draft", "published", "review_needed"]); + +export declare namespace ArticleStatus { + type Raw = "archived" | "draft" | "published" | "review_needed"; +} diff --git a/src/serialization/types/ArticleSummary.ts b/src/serialization/types/ArticleSummary.ts new file mode 100644 index 0000000..09354e1 --- /dev/null +++ b/src/serialization/types/ArticleSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ResourceSummary } from "./ResourceSummary"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const ArticleSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + resource: ResourceSummary.optional(), + title: core.serialization.string().optional(), + }) + .extend(AtomBaseSummary); + +export declare namespace ArticleSummary { + interface Raw extends AtomBaseSummary.Raw { + resource?: ResourceSummary.Raw | null; + title?: string | null; + } +} diff --git a/src/serialization/types/ArticleType.ts b/src/serialization/types/ArticleType.ts new file mode 100644 index 0000000..41bba37 --- /dev/null +++ b/src/serialization/types/ArticleType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticleType: core.serialization.Schema = + core.serialization.enum_(["article", "content_block"]); + +export declare namespace ArticleType { + type Raw = "article" | "content_block"; +} diff --git a/src/serialization/types/ArticlesCountResponse.ts b/src/serialization/types/ArticlesCountResponse.ts new file mode 100644 index 0000000..8755e19 --- /dev/null +++ b/src/serialization/types/ArticlesCountResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesCountResponse: core.serialization.ObjectSchema< + serializers.ArticlesCountResponse.Raw, + DevRev.ArticlesCountResponse +> = core.serialization.object({ + count: core.serialization.number(), +}); + +export declare namespace ArticlesCountResponse { + interface Raw { + count: number; + } +} diff --git a/src/serialization/types/ArticlesCreateRequestResource.ts b/src/serialization/types/ArticlesCreateRequestResource.ts new file mode 100644 index 0000000..f82e89c --- /dev/null +++ b/src/serialization/types/ArticlesCreateRequestResource.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesCreateRequestResource: core.serialization.ObjectSchema< + serializers.ArticlesCreateRequestResource.Raw, + DevRev.ArticlesCreateRequestResource +> = core.serialization.object({ + artifacts: core.serialization.list(core.serialization.string()).optional(), + publishedVersion: core.serialization.property("published_version", core.serialization.string().optional()), + url: core.serialization.string().optional(), +}); + +export declare namespace ArticlesCreateRequestResource { + interface Raw { + artifacts?: string[] | null; + published_version?: string | null; + url?: string | null; + } +} diff --git a/src/serialization/types/ArticlesCreateResponse.ts b/src/serialization/types/ArticlesCreateResponse.ts new file mode 100644 index 0000000..d31f816 --- /dev/null +++ b/src/serialization/types/ArticlesCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Article } from "./Article"; + +export const ArticlesCreateResponse: core.serialization.ObjectSchema< + serializers.ArticlesCreateResponse.Raw, + DevRev.ArticlesCreateResponse +> = core.serialization.object({ + article: Article, +}); + +export declare namespace ArticlesCreateResponse { + interface Raw { + article: Article.Raw; + } +} diff --git a/src/serialization/types/ArticlesDeleteResponse.ts b/src/serialization/types/ArticlesDeleteResponse.ts new file mode 100644 index 0000000..487ddcb --- /dev/null +++ b/src/serialization/types/ArticlesDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesDeleteResponse: core.serialization.Schema< + serializers.ArticlesDeleteResponse.Raw, + DevRev.ArticlesDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ArticlesDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/ArticlesGetResponse.ts b/src/serialization/types/ArticlesGetResponse.ts new file mode 100644 index 0000000..890f5f9 --- /dev/null +++ b/src/serialization/types/ArticlesGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Article } from "./Article"; + +export const ArticlesGetResponse: core.serialization.ObjectSchema< + serializers.ArticlesGetResponse.Raw, + DevRev.ArticlesGetResponse +> = core.serialization.object({ + article: Article, +}); + +export declare namespace ArticlesGetResponse { + interface Raw { + article: Article.Raw; + } +} diff --git a/src/serialization/types/ArticlesListResponse.ts b/src/serialization/types/ArticlesListResponse.ts new file mode 100644 index 0000000..4afbed9 --- /dev/null +++ b/src/serialization/types/ArticlesListResponse.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Article } from "./Article"; + +export const ArticlesListResponse: core.serialization.ObjectSchema< + serializers.ArticlesListResponse.Raw, + DevRev.ArticlesListResponse +> = core.serialization.object({ + articles: core.serialization.list(Article), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + total: core.serialization.number(), +}); + +export declare namespace ArticlesListResponse { + interface Raw { + articles: Article.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + total: number; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestAppliesToParts.ts b/src/serialization/types/ArticlesUpdateRequestAppliesToParts.ts new file mode 100644 index 0000000..4b26dfe --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestAppliesToParts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesUpdateRequestAppliesToParts: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestAppliesToParts.Raw, + DevRev.ArticlesUpdateRequestAppliesToParts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ArticlesUpdateRequestAppliesToParts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestArtifacts.ts b/src/serialization/types/ArticlesUpdateRequestArtifacts.ts new file mode 100644 index 0000000..9cbdc06 --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestArtifacts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesUpdateRequestArtifacts: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestArtifacts.Raw, + DevRev.ArticlesUpdateRequestArtifacts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ArticlesUpdateRequestArtifacts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestAuthoredBy.ts b/src/serialization/types/ArticlesUpdateRequestAuthoredBy.ts new file mode 100644 index 0000000..7dffdc0 --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestAuthoredBy.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesUpdateRequestAuthoredBy: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestAuthoredBy.Raw, + DevRev.ArticlesUpdateRequestAuthoredBy +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ArticlesUpdateRequestAuthoredBy { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestExtractedContent.ts b/src/serialization/types/ArticlesUpdateRequestExtractedContent.ts new file mode 100644 index 0000000..609cdf5 --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestExtractedContent.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesUpdateRequestExtractedContent: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestExtractedContent.Raw, + DevRev.ArticlesUpdateRequestExtractedContent +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ArticlesUpdateRequestExtractedContent { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestOwnedBy.ts b/src/serialization/types/ArticlesUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..13d9c3c --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestOwnedBy.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesUpdateRequestOwnedBy: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestOwnedBy.Raw, + DevRev.ArticlesUpdateRequestOwnedBy +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ArticlesUpdateRequestOwnedBy { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestReorder.ts b/src/serialization/types/ArticlesUpdateRequestReorder.ts new file mode 100644 index 0000000..16af929 --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestReorder.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArticlesUpdateRequestReorder: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestReorder.Raw, + DevRev.ArticlesUpdateRequestReorder +> = core.serialization.object({ + after: core.serialization.string().optional(), + before: core.serialization.string().optional(), +}); + +export declare namespace ArticlesUpdateRequestReorder { + interface Raw { + after?: string | null; + before?: string | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestSharedWith.ts b/src/serialization/types/ArticlesUpdateRequestSharedWith.ts new file mode 100644 index 0000000..f21540c --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestSharedWith.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetSharedWithMembership } from "./SetSharedWithMembership"; + +export const ArticlesUpdateRequestSharedWith: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestSharedWith.Raw, + DevRev.ArticlesUpdateRequestSharedWith +> = core.serialization.object({ + set: core.serialization.list(SetSharedWithMembership).optional(), +}); + +export declare namespace ArticlesUpdateRequestSharedWith { + interface Raw { + set?: SetSharedWithMembership.Raw[] | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateRequestTags.ts b/src/serialization/types/ArticlesUpdateRequestTags.ts new file mode 100644 index 0000000..2259c91 --- /dev/null +++ b/src/serialization/types/ArticlesUpdateRequestTags.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetTagWithValue } from "./SetTagWithValue"; + +export const ArticlesUpdateRequestTags: core.serialization.ObjectSchema< + serializers.ArticlesUpdateRequestTags.Raw, + DevRev.ArticlesUpdateRequestTags +> = core.serialization.object({ + set: core.serialization.list(SetTagWithValue).optional(), +}); + +export declare namespace ArticlesUpdateRequestTags { + interface Raw { + set?: SetTagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/ArticlesUpdateResponse.ts b/src/serialization/types/ArticlesUpdateResponse.ts new file mode 100644 index 0000000..1ce3cf8 --- /dev/null +++ b/src/serialization/types/ArticlesUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Article } from "./Article"; + +export const ArticlesUpdateResponse: core.serialization.ObjectSchema< + serializers.ArticlesUpdateResponse.Raw, + DevRev.ArticlesUpdateResponse +> = core.serialization.object({ + article: Article, +}); + +export declare namespace ArticlesUpdateResponse { + interface Raw { + article: Article.Raw; + } +} diff --git a/src/serialization/types/ArtifactSearchSummary.ts b/src/serialization/types/ArtifactSearchSummary.ts new file mode 100644 index 0000000..3380998 --- /dev/null +++ b/src/serialization/types/ArtifactSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const ArtifactSearchSummary: core.serialization.ObjectSchema< + serializers.ArtifactSearchSummary.Raw, + DevRev.ArtifactSearchSummary +> = core.serialization + .object({ + artifact: ArtifactSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace ArtifactSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + artifact: ArtifactSummary.Raw; + } +} diff --git a/src/serialization/types/ArtifactSummary.ts b/src/serialization/types/ArtifactSummary.ts new file mode 100644 index 0000000..9d5f82a --- /dev/null +++ b/src/serialization/types/ArtifactSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const ArtifactSummary: core.serialization.ObjectSchema = + AtomBaseSummary; + +export declare namespace ArtifactSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/ArtifactsPrepareResponse.ts b/src/serialization/types/ArtifactsPrepareResponse.ts new file mode 100644 index 0000000..4822397 --- /dev/null +++ b/src/serialization/types/ArtifactsPrepareResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactsPrepareResponseFormData } from "./ArtifactsPrepareResponseFormData"; + +export const ArtifactsPrepareResponse: core.serialization.ObjectSchema< + serializers.ArtifactsPrepareResponse.Raw, + DevRev.ArtifactsPrepareResponse +> = core.serialization.object({ + formData: core.serialization.property("form_data", core.serialization.list(ArtifactsPrepareResponseFormData)), + id: core.serialization.string(), + url: core.serialization.string(), +}); + +export declare namespace ArtifactsPrepareResponse { + interface Raw { + form_data: ArtifactsPrepareResponseFormData.Raw[]; + id: string; + url: string; + } +} diff --git a/src/serialization/types/ArtifactsPrepareResponseFormData.ts b/src/serialization/types/ArtifactsPrepareResponseFormData.ts new file mode 100644 index 0000000..e55e699 --- /dev/null +++ b/src/serialization/types/ArtifactsPrepareResponseFormData.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArtifactsPrepareResponseFormData: core.serialization.ObjectSchema< + serializers.ArtifactsPrepareResponseFormData.Raw, + DevRev.ArtifactsPrepareResponseFormData +> = core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), +}); + +export declare namespace ArtifactsPrepareResponseFormData { + interface Raw { + key: string; + value: string; + } +} diff --git a/src/serialization/types/ArtifactsVersionsPrepareResponse.ts b/src/serialization/types/ArtifactsVersionsPrepareResponse.ts new file mode 100644 index 0000000..f1f474f --- /dev/null +++ b/src/serialization/types/ArtifactsVersionsPrepareResponse.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactsVersionsPrepareResponseFormData } from "./ArtifactsVersionsPrepareResponseFormData"; + +export const ArtifactsVersionsPrepareResponse: core.serialization.ObjectSchema< + serializers.ArtifactsVersionsPrepareResponse.Raw, + DevRev.ArtifactsVersionsPrepareResponse +> = core.serialization.object({ + formData: core.serialization.property( + "form_data", + core.serialization.list(ArtifactsVersionsPrepareResponseFormData) + ), + url: core.serialization.string(), +}); + +export declare namespace ArtifactsVersionsPrepareResponse { + interface Raw { + form_data: ArtifactsVersionsPrepareResponseFormData.Raw[]; + url: string; + } +} diff --git a/src/serialization/types/ArtifactsVersionsPrepareResponseFormData.ts b/src/serialization/types/ArtifactsVersionsPrepareResponseFormData.ts new file mode 100644 index 0000000..1cb1c36 --- /dev/null +++ b/src/serialization/types/ArtifactsVersionsPrepareResponseFormData.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ArtifactsVersionsPrepareResponseFormData: core.serialization.ObjectSchema< + serializers.ArtifactsVersionsPrepareResponseFormData.Raw, + DevRev.ArtifactsVersionsPrepareResponseFormData +> = core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), +}); + +export declare namespace ArtifactsVersionsPrepareResponseFormData { + interface Raw { + key: string; + value: string; + } +} diff --git a/src/serialization/types/AtomBase.ts b/src/serialization/types/AtomBase.ts new file mode 100644 index 0000000..cb053dd --- /dev/null +++ b/src/serialization/types/AtomBase.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserSummary } from "./UserSummary"; + +export const AtomBase: core.serialization.ObjectSchema = + core.serialization.object({ + createdBy: core.serialization.property("created_by", UserSummary.optional()), + createdDate: core.serialization.property("created_date", core.serialization.date().optional()), + displayId: core.serialization.property("display_id", core.serialization.string().optional()), + id: core.serialization.string(), + modifiedBy: core.serialization.property("modified_by", UserSummary.optional()), + modifiedDate: core.serialization.property("modified_date", core.serialization.date().optional()), + }); + +export declare namespace AtomBase { + interface Raw { + created_by?: UserSummary.Raw | null; + created_date?: string | null; + display_id?: string | null; + id: string; + modified_by?: UserSummary.Raw | null; + modified_date?: string | null; + } +} diff --git a/src/serialization/types/AtomBaseSummary.ts b/src/serialization/types/AtomBaseSummary.ts new file mode 100644 index 0000000..46bc424 --- /dev/null +++ b/src/serialization/types/AtomBaseSummary.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const AtomBaseSummary: core.serialization.ObjectSchema = + core.serialization.object({ + displayId: core.serialization.property("display_id", core.serialization.string().optional()), + id: core.serialization.string(), + }); + +export declare namespace AtomBaseSummary { + interface Raw { + display_id?: string | null; + id: string; + } +} diff --git a/src/serialization/types/AtomSummary.ts b/src/serialization/types/AtomSummary.ts new file mode 100644 index 0000000..0813d8d --- /dev/null +++ b/src/serialization/types/AtomSummary.ts @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgBaseSummary } from "./OrgBaseSummary"; +import { AtomBaseSummary } from "./AtomBaseSummary"; +import { PartBaseSummary } from "./PartBaseSummary"; +import { ConversationSummary } from "./ConversationSummary"; +import { UserBaseSummary } from "./UserBaseSummary"; +import { IssueSummary } from "./IssueSummary"; +import { WorkBaseSummary } from "./WorkBaseSummary"; +import { RevUserSummary } from "./RevUserSummary"; +import { TagSummary } from "./TagSummary"; +import { TicketSummary } from "./TicketSummary"; + +export const AtomSummary: core.serialization.Schema = + core.serialization + .union("type", { + account: OrgBaseSummary, + app_fragment: AtomBaseSummary, + capability: PartBaseSummary, + conversation: ConversationSummary, + custom_type_fragment: AtomBaseSummary, + dev_user: UserBaseSummary, + engagement: AtomBaseSummary, + enhancement: PartBaseSummary, + feature: PartBaseSummary, + issue: IssueSummary, + meeting: AtomBaseSummary, + opportunity: WorkBaseSummary, + product: PartBaseSummary, + rev_org: OrgBaseSummary, + rev_user: RevUserSummary, + service_account: UserBaseSummary, + sys_user: UserBaseSummary, + tag: TagSummary, + task: WorkBaseSummary, + tenant_fragment: AtomBaseSummary, + ticket: TicketSummary, + timeline_comment: AtomBaseSummary, + webhook: AtomBaseSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace AtomSummary { + type Raw = + | AtomSummary.Account + | AtomSummary.AppFragment + | AtomSummary.Capability + | AtomSummary.Conversation + | AtomSummary.CustomTypeFragment + | AtomSummary.DevUser + | AtomSummary.Engagement + | AtomSummary.Enhancement + | AtomSummary.Feature + | AtomSummary.Issue + | AtomSummary.Meeting + | AtomSummary.Opportunity + | AtomSummary.Product + | AtomSummary.RevOrg + | AtomSummary.RevUser + | AtomSummary.ServiceAccount + | AtomSummary.SysUser + | AtomSummary.Tag + | AtomSummary.Task + | AtomSummary.TenantFragment + | AtomSummary.Ticket + | AtomSummary.TimelineComment + | AtomSummary.Webhook; + + interface Account extends OrgBaseSummary.Raw { + type: "account"; + } + + interface AppFragment extends AtomBaseSummary.Raw { + type: "app_fragment"; + } + + interface Capability extends PartBaseSummary.Raw { + type: "capability"; + } + + interface Conversation extends ConversationSummary.Raw { + type: "conversation"; + } + + interface CustomTypeFragment extends AtomBaseSummary.Raw { + type: "custom_type_fragment"; + } + + interface DevUser extends UserBaseSummary.Raw { + type: "dev_user"; + } + + interface Engagement extends AtomBaseSummary.Raw { + type: "engagement"; + } + + interface Enhancement extends PartBaseSummary.Raw { + type: "enhancement"; + } + + interface Feature extends PartBaseSummary.Raw { + type: "feature"; + } + + interface Issue extends IssueSummary.Raw { + type: "issue"; + } + + interface Meeting extends AtomBaseSummary.Raw { + type: "meeting"; + } + + interface Opportunity extends WorkBaseSummary.Raw { + type: "opportunity"; + } + + interface Product extends PartBaseSummary.Raw { + type: "product"; + } + + interface RevOrg extends OrgBaseSummary.Raw { + type: "rev_org"; + } + + interface RevUser extends RevUserSummary.Raw { + type: "rev_user"; + } + + interface ServiceAccount extends UserBaseSummary.Raw { + type: "service_account"; + } + + interface SysUser extends UserBaseSummary.Raw { + type: "sys_user"; + } + + interface Tag extends TagSummary.Raw { + type: "tag"; + } + + interface Task extends WorkBaseSummary.Raw { + type: "task"; + } + + interface TenantFragment extends AtomBaseSummary.Raw { + type: "tenant_fragment"; + } + + interface Ticket extends TicketSummary.Raw { + type: "ticket"; + } + + interface TimelineComment extends AtomBaseSummary.Raw { + type: "timeline_comment"; + } + + interface Webhook extends AtomBaseSummary.Raw { + type: "webhook"; + } +} diff --git a/src/serialization/types/AtomType.ts b/src/serialization/types/AtomType.ts new file mode 100644 index 0000000..2ba48de --- /dev/null +++ b/src/serialization/types/AtomType.ts @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const AtomType: core.serialization.Schema = core.serialization.enum_([ + "account", + "app_fragment", + "capability", + "conversation", + "custom_type_fragment", + "dev_user", + "engagement", + "enhancement", + "feature", + "issue", + "meeting", + "opportunity", + "product", + "rev_org", + "rev_user", + "service_account", + "sys_user", + "tag", + "task", + "tenant_fragment", + "ticket", + "timeline_comment", + "webhook", +]); + +export declare namespace AtomType { + type Raw = + | "account" + | "app_fragment" + | "capability" + | "conversation" + | "custom_type_fragment" + | "dev_user" + | "engagement" + | "enhancement" + | "feature" + | "issue" + | "meeting" + | "opportunity" + | "product" + | "rev_org" + | "rev_user" + | "service_account" + | "sys_user" + | "tag" + | "task" + | "tenant_fragment" + | "ticket" + | "timeline_comment" + | "webhook"; +} diff --git a/src/serialization/types/BooleanExpression.ts b/src/serialization/types/BooleanExpression.ts new file mode 100644 index 0000000..44d77cb --- /dev/null +++ b/src/serialization/types/BooleanExpression.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { BooleanExpressionPrimitiveExpression } from "./BooleanExpressionPrimitiveExpression"; + +export const BooleanExpression: core.serialization.Schema = + core.serialization + .union("type", { + and: core.serialization.lazyObject(() => serializers.BooleanExpressionAndExpression), + not: core.serialization.lazyObject(() => serializers.BooleanExpressionNotExpression), + or: core.serialization.lazyObject(() => serializers.BooleanExpressionOrExpression), + primitive: core.serialization.object({ + value: BooleanExpressionPrimitiveExpression, + }), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace BooleanExpression { + type Raw = BooleanExpression.And | BooleanExpression.Not | BooleanExpression.Or | BooleanExpression.Primitive; + + interface And extends serializers.BooleanExpressionAndExpression.Raw { + type: "and"; + } + + interface Not extends serializers.BooleanExpressionNotExpression.Raw { + type: "not"; + } + + interface Or extends serializers.BooleanExpressionOrExpression.Raw { + type: "or"; + } + + interface Primitive { + type: "primitive"; + value: BooleanExpressionPrimitiveExpression.Raw; + } +} diff --git a/src/serialization/types/BooleanExpressionAndExpression.ts b/src/serialization/types/BooleanExpressionAndExpression.ts new file mode 100644 index 0000000..fc47195 --- /dev/null +++ b/src/serialization/types/BooleanExpressionAndExpression.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const BooleanExpressionAndExpression: core.serialization.ObjectSchema< + serializers.BooleanExpressionAndExpression.Raw, + DevRev.BooleanExpressionAndExpression +> = core.serialization.object({ + expressions: core.serialization.list(core.serialization.lazy(() => serializers.BooleanExpression)), +}); + +export declare namespace BooleanExpressionAndExpression { + interface Raw { + expressions: serializers.BooleanExpression.Raw[]; + } +} diff --git a/src/serialization/types/BooleanExpressionNotExpression.ts b/src/serialization/types/BooleanExpressionNotExpression.ts new file mode 100644 index 0000000..f1b32d3 --- /dev/null +++ b/src/serialization/types/BooleanExpressionNotExpression.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const BooleanExpressionNotExpression: core.serialization.ObjectSchema< + serializers.BooleanExpressionNotExpression.Raw, + DevRev.BooleanExpressionNotExpression +> = core.serialization.object({ + expression: core.serialization.lazy(() => serializers.BooleanExpression), +}); + +export declare namespace BooleanExpressionNotExpression { + interface Raw { + expression: serializers.BooleanExpression.Raw; + } +} diff --git a/src/serialization/types/BooleanExpressionOrExpression.ts b/src/serialization/types/BooleanExpressionOrExpression.ts new file mode 100644 index 0000000..6e614c7 --- /dev/null +++ b/src/serialization/types/BooleanExpressionOrExpression.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const BooleanExpressionOrExpression: core.serialization.ObjectSchema< + serializers.BooleanExpressionOrExpression.Raw, + DevRev.BooleanExpressionOrExpression +> = core.serialization.object({ + expressions: core.serialization.list(core.serialization.lazy(() => serializers.BooleanExpression)), +}); + +export declare namespace BooleanExpressionOrExpression { + interface Raw { + expressions: serializers.BooleanExpression.Raw[]; + } +} diff --git a/src/serialization/types/BooleanExpressionPrimitiveExpression.ts b/src/serialization/types/BooleanExpressionPrimitiveExpression.ts new file mode 100644 index 0000000..f435480 --- /dev/null +++ b/src/serialization/types/BooleanExpressionPrimitiveExpression.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const BooleanExpressionPrimitiveExpression: core.serialization.Schema< + serializers.BooleanExpressionPrimitiveExpression.Raw, + DevRev.BooleanExpressionPrimitiveExpression +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace BooleanExpressionPrimitiveExpression { + type Raw = Record; +} diff --git a/src/serialization/types/BooleanExpressionType.ts b/src/serialization/types/BooleanExpressionType.ts new file mode 100644 index 0000000..7a85e57 --- /dev/null +++ b/src/serialization/types/BooleanExpressionType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const BooleanExpressionType: core.serialization.Schema< + serializers.BooleanExpressionType.Raw, + DevRev.BooleanExpressionType +> = core.serialization.enum_(["and", "not", "or", "primitive"]); + +export declare namespace BooleanExpressionType { + type Raw = "and" | "not" | "or" | "primitive"; +} diff --git a/src/serialization/types/Capability.ts b/src/serialization/types/Capability.ts new file mode 100644 index 0000000..12320f5 --- /dev/null +++ b/src/serialization/types/Capability.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBase } from "./PartBase"; + +export const Capability: core.serialization.ObjectSchema = PartBase; + +export declare namespace Capability { + type Raw = PartBase.Raw; +} diff --git a/src/serialization/types/CapabilitySummary.ts b/src/serialization/types/CapabilitySummary.ts new file mode 100644 index 0000000..b807aa6 --- /dev/null +++ b/src/serialization/types/CapabilitySummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBaseSummary } from "./PartBaseSummary"; + +export const CapabilitySummary: core.serialization.ObjectSchema< + serializers.CapabilitySummary.Raw, + DevRev.CapabilitySummary +> = PartBaseSummary; + +export declare namespace CapabilitySummary { + type Raw = PartBaseSummary.Raw; +} diff --git a/src/serialization/types/ClientContext.ts b/src/serialization/types/ClientContext.ts new file mode 100644 index 0000000..c72e0d4 --- /dev/null +++ b/src/serialization/types/ClientContext.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ClientContextBrowser } from "./ClientContextBrowser"; +import { ClientContextCpu } from "./ClientContextCpu"; +import { ClientContextDevice } from "./ClientContextDevice"; +import { ClientContextEngine } from "./ClientContextEngine"; +import { ClientContextOs } from "./ClientContextOs"; +import { ClientContextPage } from "./ClientContextPage"; + +export const ClientContext: core.serialization.ObjectSchema = + core.serialization.object({ + browser: ClientContextBrowser.optional(), + cpu: ClientContextCpu.optional(), + device: ClientContextDevice.optional(), + engine: ClientContextEngine.optional(), + ip: core.serialization.string().optional(), + locale: core.serialization.string().optional(), + os: ClientContextOs.optional(), + page: ClientContextPage.optional(), + timezone: core.serialization.string().optional(), + userAgent: core.serialization.property("user_agent", core.serialization.string().optional()), + }); + +export declare namespace ClientContext { + interface Raw { + browser?: ClientContextBrowser.Raw | null; + cpu?: ClientContextCpu.Raw | null; + device?: ClientContextDevice.Raw | null; + engine?: ClientContextEngine.Raw | null; + ip?: string | null; + locale?: string | null; + os?: ClientContextOs.Raw | null; + page?: ClientContextPage.Raw | null; + timezone?: string | null; + user_agent?: string | null; + } +} diff --git a/src/serialization/types/ClientContextBrowser.ts b/src/serialization/types/ClientContextBrowser.ts new file mode 100644 index 0000000..bf9aa9f --- /dev/null +++ b/src/serialization/types/ClientContextBrowser.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ClientContextBrowser: core.serialization.ObjectSchema< + serializers.ClientContextBrowser.Raw, + DevRev.ClientContextBrowser +> = core.serialization.object({ + name: core.serialization.string().optional(), + version: core.serialization.string().optional(), +}); + +export declare namespace ClientContextBrowser { + interface Raw { + name?: string | null; + version?: string | null; + } +} diff --git a/src/serialization/types/ClientContextCpu.ts b/src/serialization/types/ClientContextCpu.ts new file mode 100644 index 0000000..1092237 --- /dev/null +++ b/src/serialization/types/ClientContextCpu.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ClientContextCpu: core.serialization.ObjectSchema< + serializers.ClientContextCpu.Raw, + DevRev.ClientContextCpu +> = core.serialization.object({ + architecture: core.serialization.string().optional(), +}); + +export declare namespace ClientContextCpu { + interface Raw { + architecture?: string | null; + } +} diff --git a/src/serialization/types/ClientContextDevice.ts b/src/serialization/types/ClientContextDevice.ts new file mode 100644 index 0000000..7bddf1c --- /dev/null +++ b/src/serialization/types/ClientContextDevice.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ClientContextDevice: core.serialization.ObjectSchema< + serializers.ClientContextDevice.Raw, + DevRev.ClientContextDevice +> = core.serialization.object({ + type: core.serialization.string().optional(), + manufacturer: core.serialization.string().optional(), + model: core.serialization.string().optional(), +}); + +export declare namespace ClientContextDevice { + interface Raw { + type?: string | null; + manufacturer?: string | null; + model?: string | null; + } +} diff --git a/src/serialization/types/ClientContextEngine.ts b/src/serialization/types/ClientContextEngine.ts new file mode 100644 index 0000000..1485e2b --- /dev/null +++ b/src/serialization/types/ClientContextEngine.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ClientContextEngine: core.serialization.ObjectSchema< + serializers.ClientContextEngine.Raw, + DevRev.ClientContextEngine +> = core.serialization.object({ + name: core.serialization.string().optional(), + version: core.serialization.string().optional(), +}); + +export declare namespace ClientContextEngine { + interface Raw { + name?: string | null; + version?: string | null; + } +} diff --git a/src/serialization/types/ClientContextOs.ts b/src/serialization/types/ClientContextOs.ts new file mode 100644 index 0000000..eb2b8ff --- /dev/null +++ b/src/serialization/types/ClientContextOs.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ClientContextOs: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string().optional(), + version: core.serialization.string().optional(), + }); + +export declare namespace ClientContextOs { + interface Raw { + name?: string | null; + version?: string | null; + } +} diff --git a/src/serialization/types/ClientContextPage.ts b/src/serialization/types/ClientContextPage.ts new file mode 100644 index 0000000..8bc040f --- /dev/null +++ b/src/serialization/types/ClientContextPage.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ClientContextPage: core.serialization.ObjectSchema< + serializers.ClientContextPage.Raw, + DevRev.ClientContextPage +> = core.serialization.object({ + domain: core.serialization.string().optional(), + path: core.serialization.string().optional(), + referrer: core.serialization.string().optional(), + title: core.serialization.string().optional(), + url: core.serialization.string().optional(), +}); + +export declare namespace ClientContextPage { + interface Raw { + domain?: string | null; + path?: string | null; + referrer?: string | null; + title?: string | null; + url?: string | null; + } +} diff --git a/src/serialization/types/CodeChange.ts b/src/serialization/types/CodeChange.ts new file mode 100644 index 0000000..c21f6f3 --- /dev/null +++ b/src/serialization/types/CodeChange.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { LinesOfCode } from "./LinesOfCode"; +import { CodeChangeSource } from "./CodeChangeSource"; +import { AtomBase } from "./AtomBase"; + +export const CodeChange: core.serialization.ObjectSchema = + core.serialization + .object({ + branch: core.serialization.string().optional(), + closedDate: core.serialization.property("closed_date", core.serialization.date().optional()), + commitId: core.serialization.property("commit_id", core.serialization.string().optional()), + description: core.serialization.string().optional(), + externalIdentifier: core.serialization.property( + "external_identifier", + core.serialization.string().optional() + ), + filteredLoc: core.serialization.property("filtered_loc", LinesOfCode.optional()), + repoUrl: core.serialization.property("repo_url", core.serialization.string().optional()), + source: CodeChangeSource.optional(), + targetBranch: core.serialization.property("target_branch", core.serialization.string().optional()), + title: core.serialization.string().optional(), + totalLoc: core.serialization.property("total_loc", LinesOfCode.optional()), + }) + .extend(AtomBase); + +export declare namespace CodeChange { + interface Raw extends AtomBase.Raw { + branch?: string | null; + closed_date?: string | null; + commit_id?: string | null; + description?: string | null; + external_identifier?: string | null; + filtered_loc?: LinesOfCode.Raw | null; + repo_url?: string | null; + source?: CodeChangeSource.Raw | null; + target_branch?: string | null; + title?: string | null; + total_loc?: LinesOfCode.Raw | null; + } +} diff --git a/src/serialization/types/CodeChangeSource.ts b/src/serialization/types/CodeChangeSource.ts new file mode 100644 index 0000000..969bc6f --- /dev/null +++ b/src/serialization/types/CodeChangeSource.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CodeChangeSource: core.serialization.Schema = + core.serialization.enum_(["bitbucket", "github"]); + +export declare namespace CodeChangeSource { + type Raw = "bitbucket" | "github"; +} diff --git a/src/serialization/types/CodeChangesCreateRequest.ts b/src/serialization/types/CodeChangesCreateRequest.ts new file mode 100644 index 0000000..551f881 --- /dev/null +++ b/src/serialization/types/CodeChangesCreateRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CodeChangesCreateRequest: core.serialization.Schema< + serializers.CodeChangesCreateRequest.Raw, + DevRev.CodeChangesCreateRequest +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace CodeChangesCreateRequest { + type Raw = Record; +} diff --git a/src/serialization/types/CodeChangesCreateResponse.ts b/src/serialization/types/CodeChangesCreateResponse.ts new file mode 100644 index 0000000..7d6d3ff --- /dev/null +++ b/src/serialization/types/CodeChangesCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CodeChange } from "./CodeChange"; + +export const CodeChangesCreateResponse: core.serialization.ObjectSchema< + serializers.CodeChangesCreateResponse.Raw, + DevRev.CodeChangesCreateResponse +> = core.serialization.object({ + codeChange: core.serialization.property("code_change", CodeChange), +}); + +export declare namespace CodeChangesCreateResponse { + interface Raw { + code_change: CodeChange.Raw; + } +} diff --git a/src/serialization/types/CodeChangesDeleteResponse.ts b/src/serialization/types/CodeChangesDeleteResponse.ts new file mode 100644 index 0000000..4605c23 --- /dev/null +++ b/src/serialization/types/CodeChangesDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CodeChangesDeleteResponse: core.serialization.Schema< + serializers.CodeChangesDeleteResponse.Raw, + DevRev.CodeChangesDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace CodeChangesDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/CodeChangesGetResponse.ts b/src/serialization/types/CodeChangesGetResponse.ts new file mode 100644 index 0000000..cf8c193 --- /dev/null +++ b/src/serialization/types/CodeChangesGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CodeChange } from "./CodeChange"; + +export const CodeChangesGetResponse: core.serialization.ObjectSchema< + serializers.CodeChangesGetResponse.Raw, + DevRev.CodeChangesGetResponse +> = core.serialization.object({ + codeChange: core.serialization.property("code_change", CodeChange), +}); + +export declare namespace CodeChangesGetResponse { + interface Raw { + code_change: CodeChange.Raw; + } +} diff --git a/src/serialization/types/CodeChangesListResponse.ts b/src/serialization/types/CodeChangesListResponse.ts new file mode 100644 index 0000000..aa39d07 --- /dev/null +++ b/src/serialization/types/CodeChangesListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CodeChange } from "./CodeChange"; + +export const CodeChangesListResponse: core.serialization.ObjectSchema< + serializers.CodeChangesListResponse.Raw, + DevRev.CodeChangesListResponse +> = core.serialization.object({ + codeChanges: core.serialization.property("code_changes", core.serialization.list(CodeChange)), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace CodeChangesListResponse { + interface Raw { + code_changes: CodeChange.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/CodeChangesUpdateResponse.ts b/src/serialization/types/CodeChangesUpdateResponse.ts new file mode 100644 index 0000000..0cd5b0b --- /dev/null +++ b/src/serialization/types/CodeChangesUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CodeChange } from "./CodeChange"; + +export const CodeChangesUpdateResponse: core.serialization.ObjectSchema< + serializers.CodeChangesUpdateResponse.Raw, + DevRev.CodeChangesUpdateResponse +> = core.serialization.object({ + codeChange: core.serialization.property("code_change", CodeChange), +}); + +export declare namespace CodeChangesUpdateResponse { + interface Raw { + code_change: CodeChange.Raw; + } +} diff --git a/src/serialization/types/CommentSearchSummary.ts b/src/serialization/types/CommentSearchSummary.ts new file mode 100644 index 0000000..7c8b289 --- /dev/null +++ b/src/serialization/types/CommentSearchSummary.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineCommentSummary } from "./TimelineCommentSummary"; +import { UserSummary } from "./UserSummary"; + +export const CommentSearchSummary: core.serialization.ObjectSchema< + serializers.CommentSearchSummary.Raw, + DevRev.CommentSearchSummary +> = core.serialization.object({ + comment: TimelineCommentSummary.optional(), + createdBy: core.serialization.property("created_by", UserSummary.optional()), + createdDate: core.serialization.property("created_date", core.serialization.date().optional()), + snippet: core.serialization.string().optional(), +}); + +export declare namespace CommentSearchSummary { + interface Raw { + comment?: TimelineCommentSummary.Raw | null; + created_by?: UserSummary.Raw | null; + created_date?: string | null; + snippet?: string | null; + } +} diff --git a/src/serialization/types/Conversation.ts b/src/serialization/types/Conversation.ts new file mode 100644 index 0000000..769628d --- /dev/null +++ b/src/serialization/types/Conversation.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { GroupSummary } from "./GroupSummary"; +import { UserSummary } from "./UserSummary"; +import { TimelineEntry } from "./TimelineEntry"; +import { ConversationMetadata } from "./ConversationMetadata"; +import { SlaTrackerSummary } from "./SlaTrackerSummary"; +import { LegacyStage } from "./LegacyStage"; +import { TagWithValue } from "./TagWithValue"; +import { AtomBase } from "./AtomBase"; + +export const Conversation: core.serialization.ObjectSchema = + core.serialization + .object({ + description: core.serialization.string().optional(), + group: GroupSummary.optional(), + members: core.serialization.list(UserSummary), + messages: core.serialization.list(TimelineEntry).optional(), + metadata: ConversationMetadata.optional(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(UserSummary).optional()), + slaTracker: core.serialization.property("sla_tracker", SlaTrackerSummary.optional()), + stage: LegacyStage.optional(), + tags: core.serialization.list(TagWithValue).optional(), + title: core.serialization.string().optional(), + }) + .extend(AtomBase); + +export declare namespace Conversation { + interface Raw extends AtomBase.Raw { + description?: string | null; + group?: GroupSummary.Raw | null; + members: UserSummary.Raw[]; + messages?: TimelineEntry.Raw[] | null; + metadata?: ConversationMetadata.Raw | null; + owned_by?: UserSummary.Raw[] | null; + sla_tracker?: SlaTrackerSummary.Raw | null; + stage?: LegacyStage.Raw | null; + tags?: TagWithValue.Raw[] | null; + title?: string | null; + } +} diff --git a/src/serialization/types/ConversationMetadata.ts b/src/serialization/types/ConversationMetadata.ts new file mode 100644 index 0000000..b0fec92 --- /dev/null +++ b/src/serialization/types/ConversationMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationMetadata: core.serialization.ObjectSchema< + serializers.ConversationMetadata.Raw, + DevRev.ConversationMetadata +> = core.serialization.object({ + urlContext: core.serialization.property("url_context", core.serialization.string().optional()), +}); + +export declare namespace ConversationMetadata { + interface Raw { + url_context?: string | null; + } +} diff --git a/src/serialization/types/ConversationSearchSummary.ts b/src/serialization/types/ConversationSearchSummary.ts new file mode 100644 index 0000000..790d071 --- /dev/null +++ b/src/serialization/types/ConversationSearchSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CommentSearchSummary } from "./CommentSearchSummary"; +import { ConversationSummary } from "./ConversationSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const ConversationSearchSummary: core.serialization.ObjectSchema< + serializers.ConversationSearchSummary.Raw, + DevRev.ConversationSearchSummary +> = core.serialization + .object({ + comments: core.serialization.list(CommentSearchSummary).optional(), + conversation: ConversationSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace ConversationSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + comments?: CommentSearchSummary.Raw[] | null; + conversation: ConversationSummary.Raw; + } +} diff --git a/src/serialization/types/ConversationSummary.ts b/src/serialization/types/ConversationSummary.ts new file mode 100644 index 0000000..033d1ce --- /dev/null +++ b/src/serialization/types/ConversationSummary.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const ConversationSummary: core.serialization.ObjectSchema< + serializers.ConversationSummary.Raw, + DevRev.ConversationSummary +> = core.serialization + .object({ + title: core.serialization.string().optional(), + }) + .extend(AtomBaseSummary); + +export declare namespace ConversationSummary { + interface Raw extends AtomBaseSummary.Raw { + title?: string | null; + } +} diff --git a/src/serialization/types/ConversationsCreateRequestMessage.ts b/src/serialization/types/ConversationsCreateRequestMessage.ts new file mode 100644 index 0000000..9555f7e --- /dev/null +++ b/src/serialization/types/ConversationsCreateRequestMessage.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationsCreateRequestMessage: core.serialization.ObjectSchema< + serializers.ConversationsCreateRequestMessage.Raw, + DevRev.ConversationsCreateRequestMessage +> = core.serialization.object({ + artifacts: core.serialization.list(core.serialization.string()).optional(), + body: core.serialization.string().optional(), +}); + +export declare namespace ConversationsCreateRequestMessage { + interface Raw { + artifacts?: string[] | null; + body?: string | null; + } +} diff --git a/src/serialization/types/ConversationsCreateRequestMetadata.ts b/src/serialization/types/ConversationsCreateRequestMetadata.ts new file mode 100644 index 0000000..2c7655c --- /dev/null +++ b/src/serialization/types/ConversationsCreateRequestMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationsCreateRequestMetadata: core.serialization.ObjectSchema< + serializers.ConversationsCreateRequestMetadata.Raw, + DevRev.ConversationsCreateRequestMetadata +> = core.serialization.object({ + urlContext: core.serialization.property("url_context", core.serialization.string().optional()), +}); + +export declare namespace ConversationsCreateRequestMetadata { + interface Raw { + url_context?: string | null; + } +} diff --git a/src/serialization/types/ConversationsCreateRequestTypeValue.ts b/src/serialization/types/ConversationsCreateRequestTypeValue.ts new file mode 100644 index 0000000..2848b24 --- /dev/null +++ b/src/serialization/types/ConversationsCreateRequestTypeValue.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationsCreateRequestTypeValue: core.serialization.Schema< + serializers.ConversationsCreateRequestTypeValue.Raw, + DevRev.ConversationsCreateRequestTypeValue +> = core.serialization.stringLiteral("support"); + +export declare namespace ConversationsCreateRequestTypeValue { + type Raw = "support"; +} diff --git a/src/serialization/types/ConversationsCreateResponse.ts b/src/serialization/types/ConversationsCreateResponse.ts new file mode 100644 index 0000000..4b25094 --- /dev/null +++ b/src/serialization/types/ConversationsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Conversation } from "./Conversation"; + +export const ConversationsCreateResponse: core.serialization.ObjectSchema< + serializers.ConversationsCreateResponse.Raw, + DevRev.ConversationsCreateResponse +> = core.serialization.object({ + conversation: Conversation, +}); + +export declare namespace ConversationsCreateResponse { + interface Raw { + conversation: Conversation.Raw; + } +} diff --git a/src/serialization/types/ConversationsDeleteResponse.ts b/src/serialization/types/ConversationsDeleteResponse.ts new file mode 100644 index 0000000..4aa8cc0 --- /dev/null +++ b/src/serialization/types/ConversationsDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationsDeleteResponse: core.serialization.Schema< + serializers.ConversationsDeleteResponse.Raw, + DevRev.ConversationsDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ConversationsDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/ConversationsExportResponse.ts b/src/serialization/types/ConversationsExportResponse.ts new file mode 100644 index 0000000..55b44ab --- /dev/null +++ b/src/serialization/types/ConversationsExportResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Conversation } from "./Conversation"; + +export const ConversationsExportResponse: core.serialization.ObjectSchema< + serializers.ConversationsExportResponse.Raw, + DevRev.ConversationsExportResponse +> = core.serialization.object({ + conversations: core.serialization.list(Conversation), +}); + +export declare namespace ConversationsExportResponse { + interface Raw { + conversations: Conversation.Raw[]; + } +} diff --git a/src/serialization/types/ConversationsGetResponse.ts b/src/serialization/types/ConversationsGetResponse.ts new file mode 100644 index 0000000..b19056b --- /dev/null +++ b/src/serialization/types/ConversationsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Conversation } from "./Conversation"; + +export const ConversationsGetResponse: core.serialization.ObjectSchema< + serializers.ConversationsGetResponse.Raw, + DevRev.ConversationsGetResponse +> = core.serialization.object({ + conversation: Conversation, +}); + +export declare namespace ConversationsGetResponse { + interface Raw { + conversation: Conversation.Raw; + } +} diff --git a/src/serialization/types/ConversationsListResponse.ts b/src/serialization/types/ConversationsListResponse.ts new file mode 100644 index 0000000..69c89f0 --- /dev/null +++ b/src/serialization/types/ConversationsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Conversation } from "./Conversation"; + +export const ConversationsListResponse: core.serialization.ObjectSchema< + serializers.ConversationsListResponse.Raw, + DevRev.ConversationsListResponse +> = core.serialization.object({ + conversations: core.serialization.list(Conversation), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace ConversationsListResponse { + interface Raw { + conversations: Conversation.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/ConversationsUpdateRequestAppliesToParts.ts b/src/serialization/types/ConversationsUpdateRequestAppliesToParts.ts new file mode 100644 index 0000000..26cf3e6 --- /dev/null +++ b/src/serialization/types/ConversationsUpdateRequestAppliesToParts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationsUpdateRequestAppliesToParts: core.serialization.ObjectSchema< + serializers.ConversationsUpdateRequestAppliesToParts.Raw, + DevRev.ConversationsUpdateRequestAppliesToParts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ConversationsUpdateRequestAppliesToParts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/ConversationsUpdateRequestMetadata.ts b/src/serialization/types/ConversationsUpdateRequestMetadata.ts new file mode 100644 index 0000000..db42fd2 --- /dev/null +++ b/src/serialization/types/ConversationsUpdateRequestMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationsUpdateRequestMetadata: core.serialization.ObjectSchema< + serializers.ConversationsUpdateRequestMetadata.Raw, + DevRev.ConversationsUpdateRequestMetadata +> = core.serialization.object({ + urlContext: core.serialization.property("url_context", core.serialization.string().optional()), +}); + +export declare namespace ConversationsUpdateRequestMetadata { + interface Raw { + url_context?: string | null; + } +} diff --git a/src/serialization/types/ConversationsUpdateRequestTags.ts b/src/serialization/types/ConversationsUpdateRequestTags.ts new file mode 100644 index 0000000..6545e66 --- /dev/null +++ b/src/serialization/types/ConversationsUpdateRequestTags.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetTagWithValue } from "./SetTagWithValue"; + +export const ConversationsUpdateRequestTags: core.serialization.ObjectSchema< + serializers.ConversationsUpdateRequestTags.Raw, + DevRev.ConversationsUpdateRequestTags +> = core.serialization.object({ + set: core.serialization.list(SetTagWithValue).optional(), +}); + +export declare namespace ConversationsUpdateRequestTags { + interface Raw { + set?: SetTagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/ConversationsUpdateRequestUserSessions.ts b/src/serialization/types/ConversationsUpdateRequestUserSessions.ts new file mode 100644 index 0000000..23207ef --- /dev/null +++ b/src/serialization/types/ConversationsUpdateRequestUserSessions.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ConversationsUpdateRequestUserSessions: core.serialization.ObjectSchema< + serializers.ConversationsUpdateRequestUserSessions.Raw, + DevRev.ConversationsUpdateRequestUserSessions +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace ConversationsUpdateRequestUserSessions { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/ConversationsUpdateResponse.ts b/src/serialization/types/ConversationsUpdateResponse.ts new file mode 100644 index 0000000..29b7676 --- /dev/null +++ b/src/serialization/types/ConversationsUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Conversation } from "./Conversation"; + +export const ConversationsUpdateResponse: core.serialization.ObjectSchema< + serializers.ConversationsUpdateResponse.Raw, + DevRev.ConversationsUpdateResponse +> = core.serialization.object({ + conversation: Conversation, +}); + +export declare namespace ConversationsUpdateResponse { + interface Raw { + conversation: Conversation.Raw; + } +} diff --git a/src/serialization/types/CreateEmailInfo.ts b/src/serialization/types/CreateEmailInfo.ts new file mode 100644 index 0000000..da1ee22 --- /dev/null +++ b/src/serialization/types/CreateEmailInfo.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CreateEmailInfo: core.serialization.ObjectSchema = + core.serialization.object({ + address: core.serialization.string(), + name: core.serialization.string().optional(), + user: core.serialization.string().optional(), + }); + +export declare namespace CreateEmailInfo { + interface Raw { + address: string; + name?: string | null; + user?: string | null; + } +} diff --git a/src/serialization/types/CreateEmailInlineAttachment.ts b/src/serialization/types/CreateEmailInlineAttachment.ts new file mode 100644 index 0000000..0a3e9dc --- /dev/null +++ b/src/serialization/types/CreateEmailInlineAttachment.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CreateEmailInlineAttachment: core.serialization.ObjectSchema< + serializers.CreateEmailInlineAttachment.Raw, + DevRev.CreateEmailInlineAttachment +> = core.serialization.object({ + artifact: core.serialization.string().optional(), + contentId: core.serialization.property("content_id", core.serialization.string().optional()), +}); + +export declare namespace CreateEmailInlineAttachment { + interface Raw { + artifact?: string | null; + content_id?: string | null; + } +} diff --git a/src/serialization/types/CreateEmailPreviewWidget.ts b/src/serialization/types/CreateEmailPreviewWidget.ts new file mode 100644 index 0000000..fd6913f --- /dev/null +++ b/src/serialization/types/CreateEmailPreviewWidget.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CreateEmailInfo } from "./CreateEmailInfo"; +import { CreateEmailInlineAttachment } from "./CreateEmailInlineAttachment"; + +export const CreateEmailPreviewWidget: core.serialization.ObjectSchema< + serializers.CreateEmailPreviewWidget.Raw, + DevRev.CreateEmailPreviewWidget +> = core.serialization.object({ + bcc: core.serialization.list(CreateEmailInfo).optional(), + cc: core.serialization.list(CreateEmailInfo).optional(), + from: core.serialization.list(CreateEmailInfo).optional(), + htmlBody: core.serialization.property("html_body", core.serialization.string().optional()), + inReplyTo: core.serialization.property("in_reply_to", core.serialization.string().optional()), + inlines: core.serialization.list(CreateEmailInlineAttachment).optional(), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + messageId: core.serialization.property("message_id", core.serialization.string().optional()), + rawEmailArtifact: core.serialization.property("raw_email_artifact", core.serialization.string().optional()), + references: core.serialization.list(core.serialization.string()).optional(), + replyTo: core.serialization.property("reply_to", core.serialization.list(CreateEmailInfo).optional()), + sentTimestamp: core.serialization.property("sent_timestamp", core.serialization.date().optional()), + subject: core.serialization.string().optional(), + textBody: core.serialization.property("text_body", core.serialization.string().optional()), + to: core.serialization.list(CreateEmailInfo).optional(), +}); + +export declare namespace CreateEmailPreviewWidget { + interface Raw { + bcc?: CreateEmailInfo.Raw[] | null; + cc?: CreateEmailInfo.Raw[] | null; + from?: CreateEmailInfo.Raw[] | null; + html_body?: string | null; + in_reply_to?: string | null; + inlines?: CreateEmailInlineAttachment.Raw[] | null; + is_spam?: boolean | null; + message_id?: string | null; + raw_email_artifact?: string | null; + references?: string[] | null; + reply_to?: CreateEmailInfo.Raw[] | null; + sent_timestamp?: string | null; + subject?: string | null; + text_body?: string | null; + to?: CreateEmailInfo.Raw[] | null; + } +} diff --git a/src/serialization/types/CreateOrgScheduleInterval.ts b/src/serialization/types/CreateOrgScheduleInterval.ts new file mode 100644 index 0000000..5881077 --- /dev/null +++ b/src/serialization/types/CreateOrgScheduleInterval.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CreateOrgScheduleInterval: core.serialization.ObjectSchema< + serializers.CreateOrgScheduleInterval.Raw, + DevRev.CreateOrgScheduleInterval +> = core.serialization.object({ + from: core.serialization.date(), + isExcluded: core.serialization.property("is_excluded", core.serialization.boolean().optional()), + name: core.serialization.string(), + to: core.serialization.date().optional(), +}); + +export declare namespace CreateOrgScheduleInterval { + interface Raw { + from: string; + is_excluded?: boolean | null; + name: string; + to?: string | null; + } +} diff --git a/src/serialization/types/CreateWeeklyOrgScheduleInterval.ts b/src/serialization/types/CreateWeeklyOrgScheduleInterval.ts new file mode 100644 index 0000000..4fac504 --- /dev/null +++ b/src/serialization/types/CreateWeeklyOrgScheduleInterval.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CreateWeeklyOrgScheduleInterval: core.serialization.ObjectSchema< + serializers.CreateWeeklyOrgScheduleInterval.Raw, + DevRev.CreateWeeklyOrgScheduleInterval +> = core.serialization.object({ + from: core.serialization.number(), + to: core.serialization.number(), +}); + +export declare namespace CreateWeeklyOrgScheduleInterval { + interface Raw { + from: number; + to: number; + } +} diff --git a/src/serialization/types/CuratedVistaSummary.ts b/src/serialization/types/CuratedVistaSummary.ts new file mode 100644 index 0000000..9cf846a --- /dev/null +++ b/src/serialization/types/CuratedVistaSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { VistaBaseSummary } from "./VistaBaseSummary"; + +export const CuratedVistaSummary: core.serialization.ObjectSchema< + serializers.CuratedVistaSummary.Raw, + DevRev.CuratedVistaSummary +> = VistaBaseSummary; + +export declare namespace CuratedVistaSummary { + type Raw = VistaBaseSummary.Raw; +} diff --git a/src/serialization/types/CustomObjectSearchSummary.ts b/src/serialization/types/CustomObjectSearchSummary.ts new file mode 100644 index 0000000..19291b6 --- /dev/null +++ b/src/serialization/types/CustomObjectSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomObjectSummary } from "./CustomObjectSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const CustomObjectSearchSummary: core.serialization.ObjectSchema< + serializers.CustomObjectSearchSummary.Raw, + DevRev.CustomObjectSearchSummary +> = core.serialization + .object({ + customObject: core.serialization.property("custom_object", CustomObjectSummary), + }) + .extend(SearchSummaryBase); + +export declare namespace CustomObjectSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + custom_object: CustomObjectSummary.Raw; + } +} diff --git a/src/serialization/types/CustomObjectSummary.ts b/src/serialization/types/CustomObjectSummary.ts new file mode 100644 index 0000000..1a310ad --- /dev/null +++ b/src/serialization/types/CustomObjectSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const CustomObjectSummary: core.serialization.ObjectSchema< + serializers.CustomObjectSummary.Raw, + DevRev.CustomObjectSummary +> = AtomBaseSummary; + +export declare namespace CustomObjectSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/CustomSchemaFragment.ts b/src/serialization/types/CustomSchemaFragment.ts new file mode 100644 index 0000000..b0d97bd --- /dev/null +++ b/src/serialization/types/CustomSchemaFragment.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AppFragment } from "./AppFragment"; +import { CustomTypeFragment } from "./CustomTypeFragment"; +import { CustomSchemaFragmentBase } from "./CustomSchemaFragmentBase"; + +export const CustomSchemaFragment: core.serialization.Schema< + serializers.CustomSchemaFragment.Raw, + DevRev.CustomSchemaFragment +> = core.serialization + .union("type", { + app_fragment: AppFragment, + custom_type_fragment: CustomTypeFragment, + tenant_fragment: CustomSchemaFragmentBase, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace CustomSchemaFragment { + type Raw = + | CustomSchemaFragment.AppFragment + | CustomSchemaFragment.CustomTypeFragment + | CustomSchemaFragment.TenantFragment; + + interface AppFragment extends AppFragment.Raw { + type: "app_fragment"; + } + + interface CustomTypeFragment extends CustomTypeFragment.Raw { + type: "custom_type_fragment"; + } + + interface TenantFragment extends CustomSchemaFragmentBase.Raw { + type: "tenant_fragment"; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentBase.ts b/src/serialization/types/CustomSchemaFragmentBase.ts new file mode 100644 index 0000000..82a9097 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentBase.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragmentCondition } from "./CustomSchemaFragmentCondition"; +import { SchemaFieldDescriptor } from "./SchemaFieldDescriptor"; +import { CustomSchemaFragmentFragmentType } from "./CustomSchemaFragmentFragmentType"; +import { CustomSchemaFragmentSummary } from "./CustomSchemaFragmentSummary"; +import { AtomBase } from "./AtomBase"; + +export const CustomSchemaFragmentBase: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentBase.Raw, + DevRev.CustomSchemaFragmentBase +> = core.serialization + .object({ + conditions: core.serialization.list(CustomSchemaFragmentCondition).optional(), + deprecated: core.serialization.boolean().optional(), + description: core.serialization.string().optional(), + fields: core.serialization.list(SchemaFieldDescriptor).optional(), + fragmentType: core.serialization.property("fragment_type", CustomSchemaFragmentFragmentType.optional()), + leafType: core.serialization.property("leaf_type", core.serialization.string().optional()), + newFragmentRef: core.serialization.property("new_fragment_ref", CustomSchemaFragmentSummary.optional()), + oldFragmentRef: core.serialization.property("old_fragment_ref", CustomSchemaFragmentSummary.optional()), + }) + .extend(AtomBase); + +export declare namespace CustomSchemaFragmentBase { + interface Raw extends AtomBase.Raw { + conditions?: CustomSchemaFragmentCondition.Raw[] | null; + deprecated?: boolean | null; + description?: string | null; + fields?: SchemaFieldDescriptor.Raw[] | null; + fragment_type?: CustomSchemaFragmentFragmentType.Raw | null; + leaf_type?: string | null; + new_fragment_ref?: CustomSchemaFragmentSummary.Raw | null; + old_fragment_ref?: CustomSchemaFragmentSummary.Raw | null; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentBaseSummary.ts b/src/serialization/types/CustomSchemaFragmentBaseSummary.ts new file mode 100644 index 0000000..e5ef4de --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentBaseSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const CustomSchemaFragmentBaseSummary: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentBaseSummary.Raw, + DevRev.CustomSchemaFragmentBaseSummary +> = AtomBaseSummary; + +export declare namespace CustomSchemaFragmentBaseSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/CustomSchemaFragmentCondition.ts b/src/serialization/types/CustomSchemaFragmentCondition.ts new file mode 100644 index 0000000..9615f76 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentCondition.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaFragmentCondition: core.serialization.Schema< + serializers.CustomSchemaFragmentCondition.Raw, + DevRev.CustomSchemaFragmentCondition +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace CustomSchemaFragmentCondition { + type Raw = Record; +} diff --git a/src/serialization/types/CustomSchemaFragmentFragmentType.ts b/src/serialization/types/CustomSchemaFragmentFragmentType.ts new file mode 100644 index 0000000..1582a8f --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentFragmentType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaFragmentFragmentType: core.serialization.Schema< + serializers.CustomSchemaFragmentFragmentType.Raw, + DevRev.CustomSchemaFragmentFragmentType +> = core.serialization.enum_(["app", "custom_type", "tenant"]); + +export declare namespace CustomSchemaFragmentFragmentType { + type Raw = "app" | "custom_type" | "tenant"; +} diff --git a/src/serialization/types/CustomSchemaFragmentSummary.ts b/src/serialization/types/CustomSchemaFragmentSummary.ts new file mode 100644 index 0000000..7de81c6 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentSummary.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const CustomSchemaFragmentSummary: core.serialization.Schema< + serializers.CustomSchemaFragmentSummary.Raw, + DevRev.CustomSchemaFragmentSummary +> = core.serialization + .union("type", { + app_fragment: AtomBaseSummary, + custom_type_fragment: AtomBaseSummary, + tenant_fragment: AtomBaseSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace CustomSchemaFragmentSummary { + type Raw = + | CustomSchemaFragmentSummary.AppFragment + | CustomSchemaFragmentSummary.CustomTypeFragment + | CustomSchemaFragmentSummary.TenantFragment; + + interface AppFragment extends AtomBaseSummary.Raw { + type: "app_fragment"; + } + + interface CustomTypeFragment extends AtomBaseSummary.Raw { + type: "custom_type_fragment"; + } + + interface TenantFragment extends AtomBaseSummary.Raw { + type: "tenant_fragment"; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentType.ts b/src/serialization/types/CustomSchemaFragmentType.ts new file mode 100644 index 0000000..93a9ca1 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaFragmentType: core.serialization.Schema< + serializers.CustomSchemaFragmentType.Raw, + DevRev.CustomSchemaFragmentType +> = core.serialization.enum_(["app_fragment", "custom_type_fragment", "tenant_fragment"]); + +export declare namespace CustomSchemaFragmentType { + type Raw = "app_fragment" | "custom_type_fragment" | "tenant_fragment"; +} diff --git a/src/serialization/types/CustomSchemaFragmentsGetResponse.ts b/src/serialization/types/CustomSchemaFragmentsGetResponse.ts new file mode 100644 index 0000000..beda08f --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragment } from "./CustomSchemaFragment"; + +export const CustomSchemaFragmentsGetResponse: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentsGetResponse.Raw, + DevRev.CustomSchemaFragmentsGetResponse +> = core.serialization.object({ + fragment: CustomSchemaFragment, +}); + +export declare namespace CustomSchemaFragmentsGetResponse { + interface Raw { + fragment: CustomSchemaFragment.Raw; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentsListRequestPrune.ts b/src/serialization/types/CustomSchemaFragmentsListRequestPrune.ts new file mode 100644 index 0000000..e574577 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsListRequestPrune.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaFragmentsListRequestPrune: core.serialization.Schema< + serializers.CustomSchemaFragmentsListRequestPrune.Raw, + DevRev.CustomSchemaFragmentsListRequestPrune +> = core.serialization.stringLiteral("fields"); + +export declare namespace CustomSchemaFragmentsListRequestPrune { + type Raw = "fields"; +} diff --git a/src/serialization/types/CustomSchemaFragmentsListResponse.ts b/src/serialization/types/CustomSchemaFragmentsListResponse.ts new file mode 100644 index 0000000..3389d12 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragment } from "./CustomSchemaFragment"; + +export const CustomSchemaFragmentsListResponse: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentsListResponse.Raw, + DevRev.CustomSchemaFragmentsListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + result: core.serialization.list(CustomSchemaFragment), +}); + +export declare namespace CustomSchemaFragmentsListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + result: CustomSchemaFragment.Raw[]; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentsSetRequest.ts b/src/serialization/types/CustomSchemaFragmentsSetRequest.ts new file mode 100644 index 0000000..99f6ccc --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsSetRequest.ts @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { CustomSchemaFragmentCondition } from "./CustomSchemaFragmentCondition"; +import { SchemaFieldDescriptor } from "./SchemaFieldDescriptor"; +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { CustomSchemaFragmentsSetRequestAppFragment } from "./CustomSchemaFragmentsSetRequestAppFragment"; +import { CustomSchemaFragmentsSetRequestCustomTypeFragment } from "./CustomSchemaFragmentsSetRequestCustomTypeFragment"; +import { CustomSchemaFragmentsSetRequestTenantFragment } from "./CustomSchemaFragmentsSetRequestTenantFragment"; + +const _Base = core.serialization.object({ + conditions: core.serialization.list(CustomSchemaFragmentCondition).optional(), + deletedFields: core.serialization.property( + "deleted_fields", + core.serialization.list(core.serialization.string()).optional() + ), + deprecated: core.serialization.boolean().optional(), + description: core.serialization.string(), + fields: core.serialization.list(SchemaFieldDescriptor).optional(), + isCustomLeafType: core.serialization.property("is_custom_leaf_type", core.serialization.boolean().optional()), + leafType: core.serialization.property("leaf_type", core.serialization.string()), +}); +export const CustomSchemaFragmentsSetRequest: core.serialization.Schema< + serializers.CustomSchemaFragmentsSetRequest.Raw, + DevRev.CustomSchemaFragmentsSetRequest +> = core.serialization + .union("type", { + app_fragment: CustomSchemaFragmentsSetRequestAppFragment.extend(_Base), + custom_type_fragment: CustomSchemaFragmentsSetRequestCustomTypeFragment.extend(_Base), + tenant_fragment: CustomSchemaFragmentsSetRequestTenantFragment.extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace CustomSchemaFragmentsSetRequest { + type Raw = + | CustomSchemaFragmentsSetRequest.AppFragment + | CustomSchemaFragmentsSetRequest.CustomTypeFragment + | CustomSchemaFragmentsSetRequest.TenantFragment; + + interface AppFragment extends _Base, CustomSchemaFragmentsSetRequestAppFragment.Raw { + type: "app_fragment"; + } + + interface CustomTypeFragment extends _Base, CustomSchemaFragmentsSetRequestCustomTypeFragment.Raw { + type: "custom_type_fragment"; + } + + interface TenantFragment extends _Base, CustomSchemaFragmentsSetRequestTenantFragment.Raw { + type: "tenant_fragment"; + } + + interface _Base { + conditions?: CustomSchemaFragmentCondition.Raw[] | null; + deleted_fields?: string[] | null; + deprecated?: boolean | null; + description: string; + fields?: SchemaFieldDescriptor.Raw[] | null; + is_custom_leaf_type?: boolean | null; + leaf_type: string; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentsSetRequestAppFragment.ts b/src/serialization/types/CustomSchemaFragmentsSetRequestAppFragment.ts new file mode 100644 index 0000000..19417a5 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsSetRequestAppFragment.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaFragmentsSetRequestAppFragment: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentsSetRequestAppFragment.Raw, + DevRev.CustomSchemaFragmentsSetRequestAppFragment +> = core.serialization.object({ + app: core.serialization.string(), +}); + +export declare namespace CustomSchemaFragmentsSetRequestAppFragment { + interface Raw { + app: string; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentsSetRequestCustomTypeFragment.ts b/src/serialization/types/CustomSchemaFragmentsSetRequestCustomTypeFragment.ts new file mode 100644 index 0000000..314693e --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsSetRequestCustomTypeFragment.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomTypePathComponent } from "./CustomTypePathComponent"; +import { StockFieldOverride } from "./StockFieldOverride"; + +export const CustomSchemaFragmentsSetRequestCustomTypeFragment: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentsSetRequestCustomTypeFragment.Raw, + DevRev.CustomSchemaFragmentsSetRequestCustomTypeFragment +> = core.serialization.object({ + path: core.serialization.list(CustomTypePathComponent).optional(), + stageDiagram: core.serialization.property("stage_diagram", core.serialization.string().optional()), + stockFieldOverrides: core.serialization.property( + "stock_field_overrides", + core.serialization.list(StockFieldOverride).optional() + ), + subtype: core.serialization.string(), + subtypeDisplayName: core.serialization.property("subtype_display_name", core.serialization.string().optional()), +}); + +export declare namespace CustomSchemaFragmentsSetRequestCustomTypeFragment { + interface Raw { + path?: CustomTypePathComponent.Raw[] | null; + stage_diagram?: string | null; + stock_field_overrides?: StockFieldOverride.Raw[] | null; + subtype: string; + subtype_display_name?: string | null; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentsSetRequestTenantFragment.ts b/src/serialization/types/CustomSchemaFragmentsSetRequestTenantFragment.ts new file mode 100644 index 0000000..edeb1bb --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsSetRequestTenantFragment.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { StockFieldOverride } from "./StockFieldOverride"; + +export const CustomSchemaFragmentsSetRequestTenantFragment: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentsSetRequestTenantFragment.Raw, + DevRev.CustomSchemaFragmentsSetRequestTenantFragment +> = core.serialization.object({ + idPrefix: core.serialization.property("id_prefix", core.serialization.string().optional()), + stockFieldOverrides: core.serialization.property( + "stock_field_overrides", + core.serialization.list(StockFieldOverride).optional() + ), +}); + +export declare namespace CustomSchemaFragmentsSetRequestTenantFragment { + interface Raw { + id_prefix?: string | null; + stock_field_overrides?: StockFieldOverride.Raw[] | null; + } +} diff --git a/src/serialization/types/CustomSchemaFragmentsSetRequestType.ts b/src/serialization/types/CustomSchemaFragmentsSetRequestType.ts new file mode 100644 index 0000000..79c0a74 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsSetRequestType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaFragmentsSetRequestType: core.serialization.Schema< + serializers.CustomSchemaFragmentsSetRequestType.Raw, + DevRev.CustomSchemaFragmentsSetRequestType +> = core.serialization.enum_(["app_fragment", "custom_type_fragment", "tenant_fragment"]); + +export declare namespace CustomSchemaFragmentsSetRequestType { + type Raw = "app_fragment" | "custom_type_fragment" | "tenant_fragment"; +} diff --git a/src/serialization/types/CustomSchemaFragmentsSetResponse.ts b/src/serialization/types/CustomSchemaFragmentsSetResponse.ts new file mode 100644 index 0000000..d39fb80 --- /dev/null +++ b/src/serialization/types/CustomSchemaFragmentsSetResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaFragmentsSetResponse: core.serialization.ObjectSchema< + serializers.CustomSchemaFragmentsSetResponse.Raw, + DevRev.CustomSchemaFragmentsSetResponse +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace CustomSchemaFragmentsSetResponse { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/CustomSchemaSpec.ts b/src/serialization/types/CustomSchemaSpec.ts new file mode 100644 index 0000000..b30adc3 --- /dev/null +++ b/src/serialization/types/CustomSchemaSpec.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomSchemaSpec: core.serialization.ObjectSchema< + serializers.CustomSchemaSpec.Raw, + DevRev.CustomSchemaSpec +> = core.serialization.object({ + apps: core.serialization.list(core.serialization.string()).optional(), + subtype: core.serialization.string().optional(), + tenantFragment: core.serialization.property("tenant_fragment", core.serialization.boolean().optional()), + validateRequiredFields: core.serialization.property( + "validate_required_fields", + core.serialization.boolean().optional() + ), +}); + +export declare namespace CustomSchemaSpec { + interface Raw { + apps?: string[] | null; + subtype?: string | null; + tenant_fragment?: boolean | null; + validate_required_fields?: boolean | null; + } +} diff --git a/src/serialization/types/CustomStage.ts b/src/serialization/types/CustomStage.ts new file mode 100644 index 0000000..bc82bc4 --- /dev/null +++ b/src/serialization/types/CustomStage.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBase } from "./AtomBase"; + +export const CustomStage: core.serialization.ObjectSchema = AtomBase; + +export declare namespace CustomStage { + type Raw = AtomBase.Raw; +} diff --git a/src/serialization/types/CustomStageSummary.ts b/src/serialization/types/CustomStageSummary.ts new file mode 100644 index 0000000..6d8b97a --- /dev/null +++ b/src/serialization/types/CustomStageSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const CustomStageSummary: core.serialization.ObjectSchema< + serializers.CustomStageSummary.Raw, + DevRev.CustomStageSummary +> = AtomBaseSummary; + +export declare namespace CustomStageSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/CustomStagesCreateResponse.ts b/src/serialization/types/CustomStagesCreateResponse.ts new file mode 100644 index 0000000..e61b9c6 --- /dev/null +++ b/src/serialization/types/CustomStagesCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomStage } from "./CustomStage"; + +export const CustomStagesCreateResponse: core.serialization.ObjectSchema< + serializers.CustomStagesCreateResponse.Raw, + DevRev.CustomStagesCreateResponse +> = core.serialization.object({ + customStage: core.serialization.property("custom_stage", CustomStage), +}); + +export declare namespace CustomStagesCreateResponse { + interface Raw { + custom_stage: CustomStage.Raw; + } +} diff --git a/src/serialization/types/CustomStagesGetResponse.ts b/src/serialization/types/CustomStagesGetResponse.ts new file mode 100644 index 0000000..e0f4f55 --- /dev/null +++ b/src/serialization/types/CustomStagesGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomStage } from "./CustomStage"; + +export const CustomStagesGetResponse: core.serialization.ObjectSchema< + serializers.CustomStagesGetResponse.Raw, + DevRev.CustomStagesGetResponse +> = core.serialization.object({ + customStage: core.serialization.property("custom_stage", CustomStage), +}); + +export declare namespace CustomStagesGetResponse { + interface Raw { + custom_stage: CustomStage.Raw; + } +} diff --git a/src/serialization/types/CustomStagesListResponse.ts b/src/serialization/types/CustomStagesListResponse.ts new file mode 100644 index 0000000..a0995ba --- /dev/null +++ b/src/serialization/types/CustomStagesListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomStage } from "./CustomStage"; + +export const CustomStagesListResponse: core.serialization.ObjectSchema< + serializers.CustomStagesListResponse.Raw, + DevRev.CustomStagesListResponse +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + result: core.serialization.list(CustomStage), +}); + +export declare namespace CustomStagesListResponse { + interface Raw { + cursor?: string | null; + result: CustomStage.Raw[]; + } +} diff --git a/src/serialization/types/CustomStagesUpdateResponse.ts b/src/serialization/types/CustomStagesUpdateResponse.ts new file mode 100644 index 0000000..138f6eb --- /dev/null +++ b/src/serialization/types/CustomStagesUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomStage } from "./CustomStage"; + +export const CustomStagesUpdateResponse: core.serialization.ObjectSchema< + serializers.CustomStagesUpdateResponse.Raw, + DevRev.CustomStagesUpdateResponse +> = core.serialization.object({ + customStage: core.serialization.property("custom_stage", CustomStage), +}); + +export declare namespace CustomStagesUpdateResponse { + interface Raw { + custom_stage: CustomStage.Raw; + } +} diff --git a/src/serialization/types/CustomState.ts b/src/serialization/types/CustomState.ts new file mode 100644 index 0000000..41de644 --- /dev/null +++ b/src/serialization/types/CustomState.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBase } from "./AtomBase"; + +export const CustomState: core.serialization.ObjectSchema = AtomBase; + +export declare namespace CustomState { + type Raw = AtomBase.Raw; +} diff --git a/src/serialization/types/CustomStatesCreateResponse.ts b/src/serialization/types/CustomStatesCreateResponse.ts new file mode 100644 index 0000000..d2062d8 --- /dev/null +++ b/src/serialization/types/CustomStatesCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomState } from "./CustomState"; + +export const CustomStatesCreateResponse: core.serialization.ObjectSchema< + serializers.CustomStatesCreateResponse.Raw, + DevRev.CustomStatesCreateResponse +> = core.serialization.object({ + customState: core.serialization.property("custom_state", CustomState), +}); + +export declare namespace CustomStatesCreateResponse { + interface Raw { + custom_state: CustomState.Raw; + } +} diff --git a/src/serialization/types/CustomStatesGetResponse.ts b/src/serialization/types/CustomStatesGetResponse.ts new file mode 100644 index 0000000..97815fa --- /dev/null +++ b/src/serialization/types/CustomStatesGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomState } from "./CustomState"; + +export const CustomStatesGetResponse: core.serialization.ObjectSchema< + serializers.CustomStatesGetResponse.Raw, + DevRev.CustomStatesGetResponse +> = core.serialization.object({ + customState: core.serialization.property("custom_state", CustomState), +}); + +export declare namespace CustomStatesGetResponse { + interface Raw { + custom_state: CustomState.Raw; + } +} diff --git a/src/serialization/types/CustomStatesListResponse.ts b/src/serialization/types/CustomStatesListResponse.ts new file mode 100644 index 0000000..4c85b44 --- /dev/null +++ b/src/serialization/types/CustomStatesListResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomState } from "./CustomState"; + +export const CustomStatesListResponse: core.serialization.ObjectSchema< + serializers.CustomStatesListResponse.Raw, + DevRev.CustomStatesListResponse +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + result: core.serialization.list(CustomState), +}); + +export declare namespace CustomStatesListResponse { + interface Raw { + cursor?: string | null; + result: CustomState.Raw[]; + } +} diff --git a/src/serialization/types/CustomStatesUpdateResponse.ts b/src/serialization/types/CustomStatesUpdateResponse.ts new file mode 100644 index 0000000..fec9a21 --- /dev/null +++ b/src/serialization/types/CustomStatesUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomState } from "./CustomState"; + +export const CustomStatesUpdateResponse: core.serialization.ObjectSchema< + serializers.CustomStatesUpdateResponse.Raw, + DevRev.CustomStatesUpdateResponse +> = core.serialization.object({ + customState: core.serialization.property("custom_state", CustomState), +}); + +export declare namespace CustomStatesUpdateResponse { + interface Raw { + custom_state: CustomState.Raw; + } +} diff --git a/src/serialization/types/CustomTypeFragment.ts b/src/serialization/types/CustomTypeFragment.ts new file mode 100644 index 0000000..d2b3450 --- /dev/null +++ b/src/serialization/types/CustomTypeFragment.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { StageDiagramSummary } from "./StageDiagramSummary"; +import { CustomSchemaFragmentBase } from "./CustomSchemaFragmentBase"; + +export const CustomTypeFragment: core.serialization.ObjectSchema< + serializers.CustomTypeFragment.Raw, + DevRev.CustomTypeFragment +> = core.serialization + .object({ + stageDiagram: core.serialization.property("stage_diagram", StageDiagramSummary.optional()), + subtype: core.serialization.string().optional(), + subtypeDisplayName: core.serialization.property("subtype_display_name", core.serialization.string().optional()), + }) + .extend(CustomSchemaFragmentBase); + +export declare namespace CustomTypeFragment { + interface Raw extends CustomSchemaFragmentBase.Raw { + stage_diagram?: StageDiagramSummary.Raw | null; + subtype?: string | null; + subtype_display_name?: string | null; + } +} diff --git a/src/serialization/types/CustomTypeFragmentSummary.ts b/src/serialization/types/CustomTypeFragmentSummary.ts new file mode 100644 index 0000000..ce2cf70 --- /dev/null +++ b/src/serialization/types/CustomTypeFragmentSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragmentBaseSummary } from "./CustomSchemaFragmentBaseSummary"; + +export const CustomTypeFragmentSummary: core.serialization.ObjectSchema< + serializers.CustomTypeFragmentSummary.Raw, + DevRev.CustomTypeFragmentSummary +> = CustomSchemaFragmentBaseSummary; + +export declare namespace CustomTypeFragmentSummary { + type Raw = CustomSchemaFragmentBaseSummary.Raw; +} diff --git a/src/serialization/types/CustomTypePathComponent.ts b/src/serialization/types/CustomTypePathComponent.ts new file mode 100644 index 0000000..6d4d338 --- /dev/null +++ b/src/serialization/types/CustomTypePathComponent.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const CustomTypePathComponent: core.serialization.Schema< + serializers.CustomTypePathComponent.Raw, + DevRev.CustomTypePathComponent +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace CustomTypePathComponent { + type Raw = Record; +} diff --git a/src/serialization/types/DashboardSearchSummary.ts b/src/serialization/types/DashboardSearchSummary.ts new file mode 100644 index 0000000..72d959b --- /dev/null +++ b/src/serialization/types/DashboardSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DashboardSummary } from "./DashboardSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const DashboardSearchSummary: core.serialization.ObjectSchema< + serializers.DashboardSearchSummary.Raw, + DevRev.DashboardSearchSummary +> = core.serialization + .object({ + dashboard: DashboardSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace DashboardSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + dashboard: DashboardSummary.Raw; + } +} diff --git a/src/serialization/types/DashboardSummary.ts b/src/serialization/types/DashboardSummary.ts new file mode 100644 index 0000000..0291ef2 --- /dev/null +++ b/src/serialization/types/DashboardSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const DashboardSummary: core.serialization.ObjectSchema< + serializers.DashboardSummary.Raw, + DevRev.DashboardSummary +> = AtomBaseSummary; + +export declare namespace DashboardSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/DateFilter.ts b/src/serialization/types/DateFilter.ts new file mode 100644 index 0000000..1d8e927 --- /dev/null +++ b/src/serialization/types/DateFilter.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DateTimePreset } from "./DateTimePreset"; +import { DateTimeFilter } from "./DateTimeFilter"; + +export const DateFilter: core.serialization.Schema = core.serialization + .union("type", { + preset: core.serialization.object({ + value: DateTimePreset, + }), + range: DateTimeFilter, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace DateFilter { + type Raw = DateFilter.Preset | DateFilter.Range; + + interface Preset { + type: "preset"; + value: DateTimePreset.Raw; + } + + interface Range extends DateTimeFilter.Raw { + type: "range"; + } +} diff --git a/src/serialization/types/DateFilterType.ts b/src/serialization/types/DateFilterType.ts new file mode 100644 index 0000000..3a0513d --- /dev/null +++ b/src/serialization/types/DateFilterType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const DateFilterType: core.serialization.Schema = + core.serialization.enum_(["preset", "range"]); + +export declare namespace DateFilterType { + type Raw = "preset" | "range"; +} diff --git a/src/serialization/types/DateTimeFilter.ts b/src/serialization/types/DateTimeFilter.ts new file mode 100644 index 0000000..e90f3d1 --- /dev/null +++ b/src/serialization/types/DateTimeFilter.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const DateTimeFilter: core.serialization.ObjectSchema = + core.serialization.object({ + after: core.serialization.date().optional(), + before: core.serialization.date().optional(), + }); + +export declare namespace DateTimeFilter { + interface Raw { + after?: string | null; + before?: string | null; + } +} diff --git a/src/serialization/types/DateTimePreset.ts b/src/serialization/types/DateTimePreset.ts new file mode 100644 index 0000000..2932bf9 --- /dev/null +++ b/src/serialization/types/DateTimePreset.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DateTimePresetLastNDays } from "./DateTimePresetLastNDays"; +import { DateTimePresetNextNDays } from "./DateTimePresetNextNDays"; + +export const DateTimePreset: core.serialization.Schema = + core.serialization + .union(core.serialization.discriminant("presetType", "preset_type"), { + last_n_days: DateTimePresetLastNDays, + next_n_days: DateTimePresetNextNDays, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace DateTimePreset { + type Raw = DateTimePreset.LastNDays | DateTimePreset.NextNDays; + + interface LastNDays extends DateTimePresetLastNDays.Raw { + preset_type: "last_n_days"; + } + + interface NextNDays extends DateTimePresetNextNDays.Raw { + preset_type: "next_n_days"; + } +} diff --git a/src/serialization/types/DateTimePresetLastNDays.ts b/src/serialization/types/DateTimePresetLastNDays.ts new file mode 100644 index 0000000..a25a5aa --- /dev/null +++ b/src/serialization/types/DateTimePresetLastNDays.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const DateTimePresetLastNDays: core.serialization.ObjectSchema< + serializers.DateTimePresetLastNDays.Raw, + DevRev.DateTimePresetLastNDays +> = core.serialization.object({ + days: core.serialization.number(), +}); + +export declare namespace DateTimePresetLastNDays { + interface Raw { + days: number; + } +} diff --git a/src/serialization/types/DateTimePresetNextNDays.ts b/src/serialization/types/DateTimePresetNextNDays.ts new file mode 100644 index 0000000..f8e57be --- /dev/null +++ b/src/serialization/types/DateTimePresetNextNDays.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const DateTimePresetNextNDays: core.serialization.ObjectSchema< + serializers.DateTimePresetNextNDays.Raw, + DevRev.DateTimePresetNextNDays +> = core.serialization.object({ + days: core.serialization.number(), +}); + +export declare namespace DateTimePresetNextNDays { + interface Raw { + days: number; + } +} diff --git a/src/serialization/types/DateTimePresetType.ts b/src/serialization/types/DateTimePresetType.ts new file mode 100644 index 0000000..a9ba950 --- /dev/null +++ b/src/serialization/types/DateTimePresetType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const DateTimePresetType: core.serialization.Schema< + serializers.DateTimePresetType.Raw, + DevRev.DateTimePresetType +> = core.serialization.enum_(["last_n_days", "next_n_days"]); + +export declare namespace DateTimePresetType { + type Raw = "last_n_days" | "next_n_days"; +} diff --git a/src/serialization/types/DevUser.ts b/src/serialization/types/DevUser.ts new file mode 100644 index 0000000..e7edf98 --- /dev/null +++ b/src/serialization/types/DevUser.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ExternalIdentity } from "./ExternalIdentity"; +import { JobHistoryItem } from "./JobHistoryItem"; +import { UserSkill } from "./UserSkill"; +import { UserBase } from "./UserBase"; + +export const DevUser: core.serialization.ObjectSchema = core.serialization + .object({ + experienceStartDate: core.serialization.property("experience_start_date", core.serialization.date().optional()), + externalIdentities: core.serialization.property( + "external_identities", + core.serialization.list(ExternalIdentity).optional() + ), + jobHistory: core.serialization.property("job_history", core.serialization.list(JobHistoryItem).optional()), + skills: core.serialization.list(UserSkill).optional(), + }) + .extend(UserBase); + +export declare namespace DevUser { + interface Raw extends UserBase.Raw { + experience_start_date?: string | null; + external_identities?: ExternalIdentity.Raw[] | null; + job_history?: JobHistoryItem.Raw[] | null; + skills?: UserSkill.Raw[] | null; + } +} diff --git a/src/serialization/types/DevUserJobTitle.ts b/src/serialization/types/DevUserJobTitle.ts new file mode 100644 index 0000000..7a039ff --- /dev/null +++ b/src/serialization/types/DevUserJobTitle.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const DevUserJobTitle: core.serialization.Schema = + core.serialization.enum_([ + "customer_success_manager", + "cxo", + "designer", + "developer", + "head_of_support", + "operations", + "others", + "product_manager", + "qa", + "revenue_leader", + "support", + "tech_lead", + ]); + +export declare namespace DevUserJobTitle { + type Raw = + | "customer_success_manager" + | "cxo" + | "designer" + | "developer" + | "head_of_support" + | "operations" + | "others" + | "product_manager" + | "qa" + | "revenue_leader" + | "support" + | "tech_lead"; +} diff --git a/src/serialization/types/DevUserSummary.ts b/src/serialization/types/DevUserSummary.ts new file mode 100644 index 0000000..81681fa --- /dev/null +++ b/src/serialization/types/DevUserSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserBaseSummary } from "./UserBaseSummary"; + +export const DevUserSummary: core.serialization.ObjectSchema = + UserBaseSummary; + +export declare namespace DevUserSummary { + type Raw = UserBaseSummary.Raw; +} diff --git a/src/serialization/types/DevUsersIdentitiesLinkResponse.ts b/src/serialization/types/DevUsersIdentitiesLinkResponse.ts new file mode 100644 index 0000000..103abcc --- /dev/null +++ b/src/serialization/types/DevUsersIdentitiesLinkResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DevUser } from "./DevUser"; + +export const DevUsersIdentitiesLinkResponse: core.serialization.ObjectSchema< + serializers.DevUsersIdentitiesLinkResponse.Raw, + DevRev.DevUsersIdentitiesLinkResponse +> = core.serialization.object({ + devUser: core.serialization.property("dev_user", DevUser), +}); + +export declare namespace DevUsersIdentitiesLinkResponse { + interface Raw { + dev_user: DevUser.Raw; + } +} diff --git a/src/serialization/types/DevUsersIdentitiesUnlinkResponse.ts b/src/serialization/types/DevUsersIdentitiesUnlinkResponse.ts new file mode 100644 index 0000000..ac2d2a7 --- /dev/null +++ b/src/serialization/types/DevUsersIdentitiesUnlinkResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DevUser } from "./DevUser"; + +export const DevUsersIdentitiesUnlinkResponse: core.serialization.ObjectSchema< + serializers.DevUsersIdentitiesUnlinkResponse.Raw, + DevRev.DevUsersIdentitiesUnlinkResponse +> = core.serialization.object({ + devUser: core.serialization.property("dev_user", DevUser), +}); + +export declare namespace DevUsersIdentitiesUnlinkResponse { + interface Raw { + dev_user: DevUser.Raw; + } +} diff --git a/src/serialization/types/DevUsersUpdateResponse.ts b/src/serialization/types/DevUsersUpdateResponse.ts new file mode 100644 index 0000000..29ddcee --- /dev/null +++ b/src/serialization/types/DevUsersUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DevUser } from "./DevUser"; + +export const DevUsersUpdateResponse: core.serialization.ObjectSchema< + serializers.DevUsersUpdateResponse.Raw, + DevRev.DevUsersUpdateResponse +> = core.serialization.object({ + devUser: core.serialization.property("dev_user", DevUser), +}); + +export declare namespace DevUsersUpdateResponse { + interface Raw { + dev_user: DevUser.Raw; + } +} diff --git a/src/serialization/types/DirectorySummary.ts b/src/serialization/types/DirectorySummary.ts new file mode 100644 index 0000000..0c4793e --- /dev/null +++ b/src/serialization/types/DirectorySummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const DirectorySummary: core.serialization.ObjectSchema< + serializers.DirectorySummary.Raw, + DevRev.DirectorySummary +> = AtomBaseSummary; + +export declare namespace DirectorySummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/DynamicGroupInfo.ts b/src/serialization/types/DynamicGroupInfo.ts new file mode 100644 index 0000000..83e0495 --- /dev/null +++ b/src/serialization/types/DynamicGroupInfo.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const DynamicGroupInfo: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace DynamicGroupInfo { + type Raw = Record; +} diff --git a/src/serialization/types/DynamicVistaSummary.ts b/src/serialization/types/DynamicVistaSummary.ts new file mode 100644 index 0000000..78ef82f --- /dev/null +++ b/src/serialization/types/DynamicVistaSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { VistaBaseSummary } from "./VistaBaseSummary"; + +export const DynamicVistaSummary: core.serialization.ObjectSchema< + serializers.DynamicVistaSummary.Raw, + DevRev.DynamicVistaSummary +> = VistaBaseSummary; + +export declare namespace DynamicVistaSummary { + type Raw = VistaBaseSummary.Raw; +} diff --git a/src/serialization/types/EmailInfo.ts b/src/serialization/types/EmailInfo.ts new file mode 100644 index 0000000..56c8c51 --- /dev/null +++ b/src/serialization/types/EmailInfo.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserSummary } from "./UserSummary"; + +export const EmailInfo: core.serialization.ObjectSchema = + core.serialization.object({ + address: core.serialization.string(), + name: core.serialization.string().optional(), + user: UserSummary.optional(), + }); + +export declare namespace EmailInfo { + interface Raw { + address: string; + name?: string | null; + user?: UserSummary.Raw | null; + } +} diff --git a/src/serialization/types/EmailInlineAttachment.ts b/src/serialization/types/EmailInlineAttachment.ts new file mode 100644 index 0000000..f3b02f0 --- /dev/null +++ b/src/serialization/types/EmailInlineAttachment.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; + +export const EmailInlineAttachment: core.serialization.ObjectSchema< + serializers.EmailInlineAttachment.Raw, + DevRev.EmailInlineAttachment +> = core.serialization.object({ + artifact: ArtifactSummary.optional(), + contentId: core.serialization.property("content_id", core.serialization.string().optional()), +}); + +export declare namespace EmailInlineAttachment { + interface Raw { + artifact?: ArtifactSummary.Raw | null; + content_id?: string | null; + } +} diff --git a/src/serialization/types/EmailPreviewWidget.ts b/src/serialization/types/EmailPreviewWidget.ts new file mode 100644 index 0000000..8b0d7fe --- /dev/null +++ b/src/serialization/types/EmailPreviewWidget.ts @@ -0,0 +1,54 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { EmailInfo } from "./EmailInfo"; +import { EmailInlineAttachment } from "./EmailInlineAttachment"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { SnapWidgetBase } from "./SnapWidgetBase"; + +export const EmailPreviewWidget: core.serialization.ObjectSchema< + serializers.EmailPreviewWidget.Raw, + DevRev.EmailPreviewWidget +> = core.serialization + .object({ + bcc: core.serialization.list(EmailInfo), + cc: core.serialization.list(EmailInfo), + from: core.serialization.list(EmailInfo), + htmlBody: core.serialization.property("html_body", core.serialization.string().optional()), + inReplyTo: core.serialization.property("in_reply_to", core.serialization.string().optional()), + inlines: core.serialization.list(EmailInlineAttachment), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + messageId: core.serialization.property("message_id", core.serialization.string().optional()), + rawEmailArtifact: core.serialization.property("raw_email_artifact", ArtifactSummary.optional()), + references: core.serialization.list(core.serialization.string()), + replyTo: core.serialization.property("reply_to", core.serialization.list(EmailInfo)), + sentTimestamp: core.serialization.property("sent_timestamp", core.serialization.date().optional()), + subject: core.serialization.string().optional(), + textBody: core.serialization.property("text_body", core.serialization.string().optional()), + to: core.serialization.list(EmailInfo), + }) + .extend(SnapWidgetBase); + +export declare namespace EmailPreviewWidget { + interface Raw extends SnapWidgetBase.Raw { + bcc: EmailInfo.Raw[]; + cc: EmailInfo.Raw[]; + from: EmailInfo.Raw[]; + html_body?: string | null; + in_reply_to?: string | null; + inlines: EmailInlineAttachment.Raw[]; + is_spam?: boolean | null; + message_id?: string | null; + raw_email_artifact?: ArtifactSummary.Raw | null; + references: string[]; + reply_to: EmailInfo.Raw[]; + sent_timestamp?: string | null; + subject?: string | null; + text_body?: string | null; + to: EmailInfo.Raw[]; + } +} diff --git a/src/serialization/types/Empty.ts b/src/serialization/types/Empty.ts new file mode 100644 index 0000000..97a436a --- /dev/null +++ b/src/serialization/types/Empty.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const Empty: core.serialization.Schema = core.serialization.record( + core.serialization.string(), + core.serialization.unknown() +); + +export declare namespace Empty { + type Raw = Record; +} diff --git a/src/serialization/types/Engagement.ts b/src/serialization/types/Engagement.ts new file mode 100644 index 0000000..adf0c60 --- /dev/null +++ b/src/serialization/types/Engagement.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBase } from "./AtomBase"; + +export const Engagement: core.serialization.ObjectSchema = + core.serialization + .object({ + description: core.serialization.string().optional(), + }) + .extend(AtomBase); + +export declare namespace Engagement { + interface Raw extends AtomBase.Raw { + description?: string | null; + } +} diff --git a/src/serialization/types/EngagementSummary.ts b/src/serialization/types/EngagementSummary.ts new file mode 100644 index 0000000..70a5b6d --- /dev/null +++ b/src/serialization/types/EngagementSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const EngagementSummary: core.serialization.ObjectSchema< + serializers.EngagementSummary.Raw, + DevRev.EngagementSummary +> = AtomBaseSummary; + +export declare namespace EngagementSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/EngagementType.ts b/src/serialization/types/EngagementType.ts new file mode 100644 index 0000000..54eee1a --- /dev/null +++ b/src/serialization/types/EngagementType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EngagementType: core.serialization.Schema = + core.serialization.enum_(["call", "default", "email", "linked_in", "meeting", "offline", "survey"]); + +export declare namespace EngagementType { + type Raw = "call" | "default" | "email" | "linked_in" | "meeting" | "offline" | "survey"; +} diff --git a/src/serialization/types/EngagementsCountResponse.ts b/src/serialization/types/EngagementsCountResponse.ts new file mode 100644 index 0000000..e5eeb2b --- /dev/null +++ b/src/serialization/types/EngagementsCountResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EngagementsCountResponse: core.serialization.ObjectSchema< + serializers.EngagementsCountResponse.Raw, + DevRev.EngagementsCountResponse +> = core.serialization.object({ + count: core.serialization.number(), +}); + +export declare namespace EngagementsCountResponse { + interface Raw { + count: number; + } +} diff --git a/src/serialization/types/EngagementsCreateRequestEngagementType.ts b/src/serialization/types/EngagementsCreateRequestEngagementType.ts new file mode 100644 index 0000000..d8c4826 --- /dev/null +++ b/src/serialization/types/EngagementsCreateRequestEngagementType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EngagementsCreateRequestEngagementType: core.serialization.Schema< + serializers.EngagementsCreateRequestEngagementType.Raw, + DevRev.EngagementsCreateRequestEngagementType +> = core.serialization.enum_(["call", "default", "email", "linked_in", "offline"]); + +export declare namespace EngagementsCreateRequestEngagementType { + type Raw = "call" | "default" | "email" | "linked_in" | "offline"; +} diff --git a/src/serialization/types/EngagementsCreateResponse.ts b/src/serialization/types/EngagementsCreateResponse.ts new file mode 100644 index 0000000..d06ecce --- /dev/null +++ b/src/serialization/types/EngagementsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Engagement } from "./Engagement"; + +export const EngagementsCreateResponse: core.serialization.ObjectSchema< + serializers.EngagementsCreateResponse.Raw, + DevRev.EngagementsCreateResponse +> = core.serialization.object({ + engagement: Engagement, +}); + +export declare namespace EngagementsCreateResponse { + interface Raw { + engagement: Engagement.Raw; + } +} diff --git a/src/serialization/types/EngagementsDeleteResponse.ts b/src/serialization/types/EngagementsDeleteResponse.ts new file mode 100644 index 0000000..8843663 --- /dev/null +++ b/src/serialization/types/EngagementsDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EngagementsDeleteResponse: core.serialization.Schema< + serializers.EngagementsDeleteResponse.Raw, + DevRev.EngagementsDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace EngagementsDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/EngagementsGetResponse.ts b/src/serialization/types/EngagementsGetResponse.ts new file mode 100644 index 0000000..7876aaa --- /dev/null +++ b/src/serialization/types/EngagementsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Engagement } from "./Engagement"; + +export const EngagementsGetResponse: core.serialization.ObjectSchema< + serializers.EngagementsGetResponse.Raw, + DevRev.EngagementsGetResponse +> = core.serialization.object({ + engagement: Engagement, +}); + +export declare namespace EngagementsGetResponse { + interface Raw { + engagement: Engagement.Raw; + } +} diff --git a/src/serialization/types/EngagementsListResponse.ts b/src/serialization/types/EngagementsListResponse.ts new file mode 100644 index 0000000..30980ea --- /dev/null +++ b/src/serialization/types/EngagementsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Engagement } from "./Engagement"; + +export const EngagementsListResponse: core.serialization.ObjectSchema< + serializers.EngagementsListResponse.Raw, + DevRev.EngagementsListResponse +> = core.serialization.object({ + engagements: core.serialization.list(Engagement), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace EngagementsListResponse { + interface Raw { + engagements: Engagement.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/EngagementsUpdateRequestArtifactIds.ts b/src/serialization/types/EngagementsUpdateRequestArtifactIds.ts new file mode 100644 index 0000000..7bd58c7 --- /dev/null +++ b/src/serialization/types/EngagementsUpdateRequestArtifactIds.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EngagementsUpdateRequestArtifactIds: core.serialization.ObjectSchema< + serializers.EngagementsUpdateRequestArtifactIds.Raw, + DevRev.EngagementsUpdateRequestArtifactIds +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace EngagementsUpdateRequestArtifactIds { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/EngagementsUpdateRequestMembers.ts b/src/serialization/types/EngagementsUpdateRequestMembers.ts new file mode 100644 index 0000000..f1d0cba --- /dev/null +++ b/src/serialization/types/EngagementsUpdateRequestMembers.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EngagementsUpdateRequestMembers: core.serialization.ObjectSchema< + serializers.EngagementsUpdateRequestMembers.Raw, + DevRev.EngagementsUpdateRequestMembers +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace EngagementsUpdateRequestMembers { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/EngagementsUpdateRequestTags.ts b/src/serialization/types/EngagementsUpdateRequestTags.ts new file mode 100644 index 0000000..782a074 --- /dev/null +++ b/src/serialization/types/EngagementsUpdateRequestTags.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetTagWithValue } from "./SetTagWithValue"; + +export const EngagementsUpdateRequestTags: core.serialization.ObjectSchema< + serializers.EngagementsUpdateRequestTags.Raw, + DevRev.EngagementsUpdateRequestTags +> = core.serialization.object({ + set: core.serialization.list(SetTagWithValue).optional(), +}); + +export declare namespace EngagementsUpdateRequestTags { + interface Raw { + set?: SetTagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/EngagementsUpdateResponse.ts b/src/serialization/types/EngagementsUpdateResponse.ts new file mode 100644 index 0000000..b7a4848 --- /dev/null +++ b/src/serialization/types/EngagementsUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Engagement } from "./Engagement"; + +export const EngagementsUpdateResponse: core.serialization.ObjectSchema< + serializers.EngagementsUpdateResponse.Raw, + DevRev.EngagementsUpdateResponse +> = core.serialization.object({ + engagement: Engagement, +}); + +export declare namespace EngagementsUpdateResponse { + interface Raw { + engagement: Engagement.Raw; + } +} diff --git a/src/serialization/types/Enhancement.ts b/src/serialization/types/Enhancement.ts new file mode 100644 index 0000000..7a65217 --- /dev/null +++ b/src/serialization/types/Enhancement.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBase } from "./PartBase"; + +export const Enhancement: core.serialization.ObjectSchema = PartBase; + +export declare namespace Enhancement { + type Raw = PartBase.Raw; +} diff --git a/src/serialization/types/EnhancementSummary.ts b/src/serialization/types/EnhancementSummary.ts new file mode 100644 index 0000000..1af7b30 --- /dev/null +++ b/src/serialization/types/EnhancementSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBaseSummary } from "./PartBaseSummary"; + +export const EnhancementSummary: core.serialization.ObjectSchema< + serializers.EnhancementSummary.Raw, + DevRev.EnhancementSummary +> = PartBaseSummary; + +export declare namespace EnhancementSummary { + type Raw = PartBaseSummary.Raw; +} diff --git a/src/serialization/types/EnumValue.ts b/src/serialization/types/EnumValue.ts new file mode 100644 index 0000000..51239aa --- /dev/null +++ b/src/serialization/types/EnumValue.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EnumValue: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.number(), + label: core.serialization.string(), + ordinal: core.serialization.number(), + }); + +export declare namespace EnumValue { + interface Raw { + id: number; + label: string; + ordinal: number; + } +} diff --git a/src/serialization/types/ErrorBadRequest.ts b/src/serialization/types/ErrorBadRequest.ts new file mode 100644 index 0000000..cf7542a --- /dev/null +++ b/src/serialization/types/ErrorBadRequest.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorBadRequest: core.serialization.ObjectSchema = + core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorBadRequest { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorBadRequestArtifactAlreadyAttachedToAParent.ts b/src/serialization/types/ErrorBadRequestArtifactAlreadyAttachedToAParent.ts new file mode 100644 index 0000000..4b4f321 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestArtifactAlreadyAttachedToAParent.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestArtifactAlreadyAttachedToAParent: core.serialization.ObjectSchema< + serializers.ErrorBadRequestArtifactAlreadyAttachedToAParent.Raw, + DevRev.ErrorBadRequestArtifactAlreadyAttachedToAParent +> = core.serialization.object({ + existingParent: core.serialization.property("existing_parent", core.serialization.string()), + isSame: core.serialization.property("is_same", core.serialization.boolean()), +}); + +export declare namespace ErrorBadRequestArtifactAlreadyAttachedToAParent { + interface Raw { + existing_parent: string; + is_same: boolean; + } +} diff --git a/src/serialization/types/ErrorBadRequestBadRequest.ts b/src/serialization/types/ErrorBadRequestBadRequest.ts new file mode 100644 index 0000000..2cd07f5 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestBadRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestBadRequest: core.serialization.Schema< + serializers.ErrorBadRequestBadRequest.Raw, + DevRev.ErrorBadRequestBadRequest +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorBadRequestBadRequest { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorBadRequestInvalidApiVersion.ts b/src/serialization/types/ErrorBadRequestInvalidApiVersion.ts new file mode 100644 index 0000000..8b2c84f --- /dev/null +++ b/src/serialization/types/ErrorBadRequestInvalidApiVersion.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestInvalidApiVersion: core.serialization.ObjectSchema< + serializers.ErrorBadRequestInvalidApiVersion.Raw, + DevRev.ErrorBadRequestInvalidApiVersion +> = core.serialization.object({ + value: core.serialization.string(), +}); + +export declare namespace ErrorBadRequestInvalidApiVersion { + interface Raw { + value: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestInvalidEnumValue.ts b/src/serialization/types/ErrorBadRequestInvalidEnumValue.ts new file mode 100644 index 0000000..f0a6dda --- /dev/null +++ b/src/serialization/types/ErrorBadRequestInvalidEnumValue.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestInvalidEnumValue: core.serialization.ObjectSchema< + serializers.ErrorBadRequestInvalidEnumValue.Raw, + DevRev.ErrorBadRequestInvalidEnumValue +> = core.serialization.object({ + allowedValues: core.serialization.property("allowed_values", core.serialization.list(core.serialization.string())), + fieldName: core.serialization.property("field_name", core.serialization.string()), + value: core.serialization.string(), +}); + +export declare namespace ErrorBadRequestInvalidEnumValue { + interface Raw { + allowed_values: string[]; + field_name: string; + value: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestInvalidField.ts b/src/serialization/types/ErrorBadRequestInvalidField.ts new file mode 100644 index 0000000..aa7ac7f --- /dev/null +++ b/src/serialization/types/ErrorBadRequestInvalidField.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestInvalidField: core.serialization.ObjectSchema< + serializers.ErrorBadRequestInvalidField.Raw, + DevRev.ErrorBadRequestInvalidField +> = core.serialization.object({ + fieldName: core.serialization.property("field_name", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestInvalidField { + interface Raw { + field_name: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestInvalidId.ts b/src/serialization/types/ErrorBadRequestInvalidId.ts new file mode 100644 index 0000000..3cc4d70 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestInvalidId.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestInvalidId: core.serialization.ObjectSchema< + serializers.ErrorBadRequestInvalidId.Raw, + DevRev.ErrorBadRequestInvalidId +> = core.serialization.object({ + fieldName: core.serialization.property("field_name", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestInvalidId { + interface Raw { + field_name: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestMergeWorksError.ts b/src/serialization/types/ErrorBadRequestMergeWorksError.ts new file mode 100644 index 0000000..a9a1300 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMergeWorksError.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBadRequestMergeWorksErrorError } from "./ErrorBadRequestMergeWorksErrorError"; + +export const ErrorBadRequestMergeWorksError: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMergeWorksError.Raw, + DevRev.ErrorBadRequestMergeWorksError +> = core.serialization.object({ + errors: core.serialization.list(ErrorBadRequestMergeWorksErrorError).optional(), +}); + +export declare namespace ErrorBadRequestMergeWorksError { + interface Raw { + errors?: ErrorBadRequestMergeWorksErrorError.Raw[] | null; + } +} diff --git a/src/serialization/types/ErrorBadRequestMergeWorksErrorError.ts b/src/serialization/types/ErrorBadRequestMergeWorksErrorError.ts new file mode 100644 index 0000000..c69e7ff --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMergeWorksErrorError.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBadRequestMergeWorksErrorErrorAlreadyMerged } from "./ErrorBadRequestMergeWorksErrorErrorAlreadyMerged"; +import { ErrorBadRequestMergeWorksErrorErrorClosed } from "./ErrorBadRequestMergeWorksErrorErrorClosed"; +import { ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace } from "./ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace"; +import { ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition } from "./ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition"; +import { ErrorBadRequestMergeWorksErrorErrorSubtype } from "./ErrorBadRequestMergeWorksErrorErrorSubtype"; + +export const ErrorBadRequestMergeWorksErrorError: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMergeWorksErrorError.Raw, + DevRev.ErrorBadRequestMergeWorksErrorError +> = core.serialization.object({ + alreadyMerged: core.serialization.property( + "already_merged", + ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.optional() + ), + closed: ErrorBadRequestMergeWorksErrorErrorClosed.optional(), + details: core.serialization.string(), + differentWorkspace: core.serialization.property( + "different_workspace", + ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.optional() + ), + invalidStageTransition: core.serialization.property( + "invalid_stage_transition", + ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.optional() + ), + subtype: ErrorBadRequestMergeWorksErrorErrorSubtype.optional(), + work: core.serialization.string(), +}); + +export declare namespace ErrorBadRequestMergeWorksErrorError { + interface Raw { + already_merged?: ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.Raw | null; + closed?: ErrorBadRequestMergeWorksErrorErrorClosed.Raw | null; + details: string; + different_workspace?: ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.Raw | null; + invalid_stage_transition?: ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.Raw | null; + subtype?: ErrorBadRequestMergeWorksErrorErrorSubtype.Raw | null; + work: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.ts b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.ts new file mode 100644 index 0000000..2e7be16 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestMergeWorksErrorErrorAlreadyMerged: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMergeWorksErrorErrorAlreadyMerged.Raw, + DevRev.ErrorBadRequestMergeWorksErrorErrorAlreadyMerged +> = core.serialization.object({ + mergedInto: core.serialization.property("merged_into", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestMergeWorksErrorErrorAlreadyMerged { + interface Raw { + merged_into: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorClosed.ts b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorClosed.ts new file mode 100644 index 0000000..b8b258b --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorClosed.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestMergeWorksErrorErrorClosed: core.serialization.Schema< + serializers.ErrorBadRequestMergeWorksErrorErrorClosed.Raw, + DevRev.ErrorBadRequestMergeWorksErrorErrorClosed +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorBadRequestMergeWorksErrorErrorClosed { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.ts b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.ts new file mode 100644 index 0000000..b8dfdef --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace.Raw, + DevRev.ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace +> = core.serialization.object({ + primaryWorkspace: core.serialization.property("primary_workspace", core.serialization.string()), + secondaryWorkspace: core.serialization.property("secondary_workspace", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace { + interface Raw { + primary_workspace: string; + secondary_workspace: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.ts b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.ts new file mode 100644 index 0000000..f1c5840 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition.Raw, + DevRev.ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition +> = core.serialization.object({ + currentStage: core.serialization.property("current_stage", core.serialization.string()), + requestedStage: core.serialization.property("requested_stage", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition { + interface Raw { + current_stage: string; + requested_stage: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorSubtype.ts b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorSubtype.ts new file mode 100644 index 0000000..65f4f7a --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMergeWorksErrorErrorSubtype.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestMergeWorksErrorErrorSubtype: core.serialization.Schema< + serializers.ErrorBadRequestMergeWorksErrorErrorSubtype.Raw, + DevRev.ErrorBadRequestMergeWorksErrorErrorSubtype +> = core.serialization.enum_(["already_merged", "closed", "different_workspace", "invalid_stage_transition"]); + +export declare namespace ErrorBadRequestMergeWorksErrorErrorSubtype { + type Raw = "already_merged" | "closed" | "different_workspace" | "invalid_stage_transition"; +} diff --git a/src/serialization/types/ErrorBadRequestMissingDependency.ts b/src/serialization/types/ErrorBadRequestMissingDependency.ts new file mode 100644 index 0000000..c657d5d --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMissingDependency.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBadRequestMissingDependencyDependency } from "./ErrorBadRequestMissingDependencyDependency"; + +export const ErrorBadRequestMissingDependency: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMissingDependency.Raw, + DevRev.ErrorBadRequestMissingDependency +> = core.serialization.object({ + dependencies: core.serialization.list(ErrorBadRequestMissingDependencyDependency).optional(), + dependentFieldName: core.serialization.property("dependent_field_name", core.serialization.string().optional()), + dependentFieldValue: core.serialization.property("dependent_field_value", core.serialization.string().optional()), + providedFieldName: core.serialization.property("provided_field_name", core.serialization.string().optional()), + providedFieldValue: core.serialization.property("provided_field_value", core.serialization.string().optional()), +}); + +export declare namespace ErrorBadRequestMissingDependency { + interface Raw { + dependencies?: ErrorBadRequestMissingDependencyDependency.Raw[] | null; + dependent_field_name?: string | null; + dependent_field_value?: string | null; + provided_field_name?: string | null; + provided_field_value?: string | null; + } +} diff --git a/src/serialization/types/ErrorBadRequestMissingDependencyDependency.ts b/src/serialization/types/ErrorBadRequestMissingDependencyDependency.ts new file mode 100644 index 0000000..09d72de --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMissingDependencyDependency.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestMissingDependencyDependency: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMissingDependencyDependency.Raw, + DevRev.ErrorBadRequestMissingDependencyDependency +> = core.serialization.object({ + fieldName: core.serialization.property("field_name", core.serialization.string()), + fieldValue: core.serialization.property("field_value", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestMissingDependencyDependency { + interface Raw { + field_name: string; + field_value: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestMissingRequiredField.ts b/src/serialization/types/ErrorBadRequestMissingRequiredField.ts new file mode 100644 index 0000000..66e32f6 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestMissingRequiredField.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestMissingRequiredField: core.serialization.ObjectSchema< + serializers.ErrorBadRequestMissingRequiredField.Raw, + DevRev.ErrorBadRequestMissingRequiredField +> = core.serialization.object({ + fieldName: core.serialization.property("field_name", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestMissingRequiredField { + interface Raw { + field_name: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestParseError.ts b/src/serialization/types/ErrorBadRequestParseError.ts new file mode 100644 index 0000000..ae7b09c --- /dev/null +++ b/src/serialization/types/ErrorBadRequestParseError.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestParseError: core.serialization.Schema< + serializers.ErrorBadRequestParseError.Raw, + DevRev.ErrorBadRequestParseError +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorBadRequestParseError { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorBadRequestStaleSchemaFragments.ts b/src/serialization/types/ErrorBadRequestStaleSchemaFragments.ts new file mode 100644 index 0000000..e5c4568 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestStaleSchemaFragments.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestStaleSchemaFragments: core.serialization.Schema< + serializers.ErrorBadRequestStaleSchemaFragments.Raw, + DevRev.ErrorBadRequestStaleSchemaFragments +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorBadRequestStaleSchemaFragments { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorBadRequestType.ts b/src/serialization/types/ErrorBadRequestType.ts new file mode 100644 index 0000000..6f47f7a --- /dev/null +++ b/src/serialization/types/ErrorBadRequestType.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestType: core.serialization.Schema< + serializers.ErrorBadRequestType.Raw, + DevRev.ErrorBadRequestType +> = core.serialization.enum_([ + "artifact_already_attached_to_a_parent", + "bad_request", + "invalid_api_version", + "invalid_enum_value", + "invalid_field", + "invalid_id", + "merge_works_error", + "missing_dependency", + "missing_required_field", + "parse_error", + "stale_schema_fragments", + "unexpected_id_type", + "unexpected_json_type", + "value_not_permitted", +]); + +export declare namespace ErrorBadRequestType { + type Raw = + | "artifact_already_attached_to_a_parent" + | "bad_request" + | "invalid_api_version" + | "invalid_enum_value" + | "invalid_field" + | "invalid_id" + | "merge_works_error" + | "missing_dependency" + | "missing_required_field" + | "parse_error" + | "stale_schema_fragments" + | "unexpected_id_type" + | "unexpected_json_type" + | "value_not_permitted"; +} diff --git a/src/serialization/types/ErrorBadRequestUnexpectedIdType.ts b/src/serialization/types/ErrorBadRequestUnexpectedIdType.ts new file mode 100644 index 0000000..4677668 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestUnexpectedIdType.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestUnexpectedIdType: core.serialization.ObjectSchema< + serializers.ErrorBadRequestUnexpectedIdType.Raw, + DevRev.ErrorBadRequestUnexpectedIdType +> = core.serialization.object({ + fieldName: core.serialization.property("field_name", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestUnexpectedIdType { + interface Raw { + field_name: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestUnexpectedJsonType.ts b/src/serialization/types/ErrorBadRequestUnexpectedJsonType.ts new file mode 100644 index 0000000..dcd5cf0 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestUnexpectedJsonType.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBadRequestUnexpectedJsonTypeType } from "./ErrorBadRequestUnexpectedJsonTypeType"; + +export const ErrorBadRequestUnexpectedJsonType: core.serialization.ObjectSchema< + serializers.ErrorBadRequestUnexpectedJsonType.Raw, + DevRev.ErrorBadRequestUnexpectedJsonType +> = core.serialization.object({ + actual: ErrorBadRequestUnexpectedJsonTypeType, + expected: ErrorBadRequestUnexpectedJsonTypeType, + fieldName: core.serialization.property("field_name", core.serialization.string()), +}); + +export declare namespace ErrorBadRequestUnexpectedJsonType { + interface Raw { + actual: ErrorBadRequestUnexpectedJsonTypeType.Raw; + expected: ErrorBadRequestUnexpectedJsonTypeType.Raw; + field_name: string; + } +} diff --git a/src/serialization/types/ErrorBadRequestUnexpectedJsonTypeType.ts b/src/serialization/types/ErrorBadRequestUnexpectedJsonTypeType.ts new file mode 100644 index 0000000..814c1ac --- /dev/null +++ b/src/serialization/types/ErrorBadRequestUnexpectedJsonTypeType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestUnexpectedJsonTypeType: core.serialization.Schema< + serializers.ErrorBadRequestUnexpectedJsonTypeType.Raw, + DevRev.ErrorBadRequestUnexpectedJsonTypeType +> = core.serialization.enum_(["array", "bool", "null", "number", "object", "string"]); + +export declare namespace ErrorBadRequestUnexpectedJsonTypeType { + type Raw = "array" | "bool" | "null" | "number" | "object" | "string"; +} diff --git a/src/serialization/types/ErrorBadRequestValueNotPermitted.ts b/src/serialization/types/ErrorBadRequestValueNotPermitted.ts new file mode 100644 index 0000000..60bcd24 --- /dev/null +++ b/src/serialization/types/ErrorBadRequestValueNotPermitted.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBadRequestValueNotPermitted: core.serialization.ObjectSchema< + serializers.ErrorBadRequestValueNotPermitted.Raw, + DevRev.ErrorBadRequestValueNotPermitted +> = core.serialization.object({ + allowedValues: core.serialization.property( + "allowed_values", + core.serialization.list(core.serialization.string()).optional() + ), + fieldName: core.serialization.property("field_name", core.serialization.string()), + reason: core.serialization.string().optional(), +}); + +export declare namespace ErrorBadRequestValueNotPermitted { + interface Raw { + allowed_values?: string[] | null; + field_name: string; + reason?: string | null; + } +} diff --git a/src/serialization/types/ErrorBase.ts b/src/serialization/types/ErrorBase.ts new file mode 100644 index 0000000..cf16a0d --- /dev/null +++ b/src/serialization/types/ErrorBase.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorBase: core.serialization.ObjectSchema = + core.serialization.object({ + detail: core.serialization.string().optional(), + message: core.serialization.string().optional(), + }); + +export declare namespace ErrorBase { + interface Raw { + detail?: string | null; + message?: string | null; + } +} diff --git a/src/serialization/types/ErrorConflict.ts b/src/serialization/types/ErrorConflict.ts new file mode 100644 index 0000000..4cb316d --- /dev/null +++ b/src/serialization/types/ErrorConflict.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorConflict: core.serialization.ObjectSchema = + core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorConflict { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorConflictConflict.ts b/src/serialization/types/ErrorConflictConflict.ts new file mode 100644 index 0000000..1575ac9 --- /dev/null +++ b/src/serialization/types/ErrorConflictConflict.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorConflictConflict: core.serialization.Schema< + serializers.ErrorConflictConflict.Raw, + DevRev.ErrorConflictConflict +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorConflictConflict { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorConflictType.ts b/src/serialization/types/ErrorConflictType.ts new file mode 100644 index 0000000..8921a42 --- /dev/null +++ b/src/serialization/types/ErrorConflictType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorConflictType: core.serialization.Schema = + core.serialization.stringLiteral("conflict"); + +export declare namespace ErrorConflictType { + type Raw = "conflict"; +} diff --git a/src/serialization/types/ErrorForbidden.ts b/src/serialization/types/ErrorForbidden.ts new file mode 100644 index 0000000..9c57257 --- /dev/null +++ b/src/serialization/types/ErrorForbidden.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorForbidden: core.serialization.ObjectSchema = + core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorForbidden { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorForbiddenForbidden.ts b/src/serialization/types/ErrorForbiddenForbidden.ts new file mode 100644 index 0000000..51a9c84 --- /dev/null +++ b/src/serialization/types/ErrorForbiddenForbidden.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorForbiddenForbidden: core.serialization.Schema< + serializers.ErrorForbiddenForbidden.Raw, + DevRev.ErrorForbiddenForbidden +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorForbiddenForbidden { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorForbiddenType.ts b/src/serialization/types/ErrorForbiddenType.ts new file mode 100644 index 0000000..bf8cef1 --- /dev/null +++ b/src/serialization/types/ErrorForbiddenType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorForbiddenType: core.serialization.Schema< + serializers.ErrorForbiddenType.Raw, + DevRev.ErrorForbiddenType +> = core.serialization.stringLiteral("forbidden"); + +export declare namespace ErrorForbiddenType { + type Raw = "forbidden"; +} diff --git a/src/serialization/types/ErrorInternalServerError.ts b/src/serialization/types/ErrorInternalServerError.ts new file mode 100644 index 0000000..40bf621 --- /dev/null +++ b/src/serialization/types/ErrorInternalServerError.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorInternalServerError: core.serialization.ObjectSchema< + serializers.ErrorInternalServerError.Raw, + DevRev.ErrorInternalServerError +> = core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorInternalServerError { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorInternalServerErrorInternalError.ts b/src/serialization/types/ErrorInternalServerErrorInternalError.ts new file mode 100644 index 0000000..b559af8 --- /dev/null +++ b/src/serialization/types/ErrorInternalServerErrorInternalError.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorInternalServerErrorInternalError: core.serialization.Schema< + serializers.ErrorInternalServerErrorInternalError.Raw, + DevRev.ErrorInternalServerErrorInternalError +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorInternalServerErrorInternalError { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorInternalServerErrorType.ts b/src/serialization/types/ErrorInternalServerErrorType.ts new file mode 100644 index 0000000..0e7a59f --- /dev/null +++ b/src/serialization/types/ErrorInternalServerErrorType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorInternalServerErrorType: core.serialization.Schema< + serializers.ErrorInternalServerErrorType.Raw, + DevRev.ErrorInternalServerErrorType +> = core.serialization.stringLiteral("internal_error"); + +export declare namespace ErrorInternalServerErrorType { + type Raw = "internal_error"; +} diff --git a/src/serialization/types/ErrorNotFound.ts b/src/serialization/types/ErrorNotFound.ts new file mode 100644 index 0000000..b31678e --- /dev/null +++ b/src/serialization/types/ErrorNotFound.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorNotFound: core.serialization.ObjectSchema = + core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorNotFound { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorNotFoundNotFound.ts b/src/serialization/types/ErrorNotFoundNotFound.ts new file mode 100644 index 0000000..72d3632 --- /dev/null +++ b/src/serialization/types/ErrorNotFoundNotFound.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorNotFoundNotFound: core.serialization.Schema< + serializers.ErrorNotFoundNotFound.Raw, + DevRev.ErrorNotFoundNotFound +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorNotFoundNotFound { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorNotFoundType.ts b/src/serialization/types/ErrorNotFoundType.ts new file mode 100644 index 0000000..8d8d017 --- /dev/null +++ b/src/serialization/types/ErrorNotFoundType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorNotFoundType: core.serialization.Schema = + core.serialization.stringLiteral("not_found"); + +export declare namespace ErrorNotFoundType { + type Raw = "not_found"; +} diff --git a/src/serialization/types/ErrorServiceUnavailable.ts b/src/serialization/types/ErrorServiceUnavailable.ts new file mode 100644 index 0000000..5af4e57 --- /dev/null +++ b/src/serialization/types/ErrorServiceUnavailable.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorServiceUnavailable: core.serialization.ObjectSchema< + serializers.ErrorServiceUnavailable.Raw, + DevRev.ErrorServiceUnavailable +> = core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorServiceUnavailable { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorServiceUnavailableServiceUnavailable.ts b/src/serialization/types/ErrorServiceUnavailableServiceUnavailable.ts new file mode 100644 index 0000000..058b891 --- /dev/null +++ b/src/serialization/types/ErrorServiceUnavailableServiceUnavailable.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorServiceUnavailableServiceUnavailable: core.serialization.Schema< + serializers.ErrorServiceUnavailableServiceUnavailable.Raw, + DevRev.ErrorServiceUnavailableServiceUnavailable +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorServiceUnavailableServiceUnavailable { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorServiceUnavailableType.ts b/src/serialization/types/ErrorServiceUnavailableType.ts new file mode 100644 index 0000000..a5b39b0 --- /dev/null +++ b/src/serialization/types/ErrorServiceUnavailableType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorServiceUnavailableType: core.serialization.Schema< + serializers.ErrorServiceUnavailableType.Raw, + DevRev.ErrorServiceUnavailableType +> = core.serialization.stringLiteral("service_unavailable"); + +export declare namespace ErrorServiceUnavailableType { + type Raw = "service_unavailable"; +} diff --git a/src/serialization/types/ErrorTooManyRequests.ts b/src/serialization/types/ErrorTooManyRequests.ts new file mode 100644 index 0000000..bb519b1 --- /dev/null +++ b/src/serialization/types/ErrorTooManyRequests.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorTooManyRequests: core.serialization.ObjectSchema< + serializers.ErrorTooManyRequests.Raw, + DevRev.ErrorTooManyRequests +> = core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorTooManyRequests { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorTooManyRequestsTooManyRequests.ts b/src/serialization/types/ErrorTooManyRequestsTooManyRequests.ts new file mode 100644 index 0000000..a263e19 --- /dev/null +++ b/src/serialization/types/ErrorTooManyRequestsTooManyRequests.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorTooManyRequestsTooManyRequests: core.serialization.Schema< + serializers.ErrorTooManyRequestsTooManyRequests.Raw, + DevRev.ErrorTooManyRequestsTooManyRequests +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorTooManyRequestsTooManyRequests { + type Raw = Record; +} diff --git a/src/serialization/types/ErrorTooManyRequestsType.ts b/src/serialization/types/ErrorTooManyRequestsType.ts new file mode 100644 index 0000000..55741f1 --- /dev/null +++ b/src/serialization/types/ErrorTooManyRequestsType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorTooManyRequestsType: core.serialization.Schema< + serializers.ErrorTooManyRequestsType.Raw, + DevRev.ErrorTooManyRequestsType +> = core.serialization.stringLiteral("too_many_requests"); + +export declare namespace ErrorTooManyRequestsType { + type Raw = "too_many_requests"; +} diff --git a/src/serialization/types/ErrorUnauthorized.ts b/src/serialization/types/ErrorUnauthorized.ts new file mode 100644 index 0000000..39cdbe7 --- /dev/null +++ b/src/serialization/types/ErrorUnauthorized.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ErrorBase } from "./ErrorBase"; + +export const ErrorUnauthorized: core.serialization.ObjectSchema< + serializers.ErrorUnauthorized.Raw, + DevRev.ErrorUnauthorized +> = core.serialization.object({}).extend(ErrorBase); + +export declare namespace ErrorUnauthorized { + interface Raw extends ErrorBase.Raw {} +} diff --git a/src/serialization/types/ErrorUnauthorizedType.ts b/src/serialization/types/ErrorUnauthorizedType.ts new file mode 100644 index 0000000..abce846 --- /dev/null +++ b/src/serialization/types/ErrorUnauthorizedType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorUnauthorizedType: core.serialization.Schema< + serializers.ErrorUnauthorizedType.Raw, + DevRev.ErrorUnauthorizedType +> = core.serialization.stringLiteral("unauthenticated"); + +export declare namespace ErrorUnauthorizedType { + type Raw = "unauthenticated"; +} diff --git a/src/serialization/types/ErrorUnauthorizedUnauthenticated.ts b/src/serialization/types/ErrorUnauthorizedUnauthenticated.ts new file mode 100644 index 0000000..1cddf64 --- /dev/null +++ b/src/serialization/types/ErrorUnauthorizedUnauthenticated.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ErrorUnauthorizedUnauthenticated: core.serialization.Schema< + serializers.ErrorUnauthorizedUnauthenticated.Raw, + DevRev.ErrorUnauthorizedUnauthenticated +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace ErrorUnauthorizedUnauthenticated { + type Raw = Record; +} diff --git a/src/serialization/types/Error_.ts b/src/serialization/types/Error_.ts new file mode 100644 index 0000000..d942feb --- /dev/null +++ b/src/serialization/types/Error_.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const Error_: core.serialization.ObjectSchema = core.serialization.object( + { + type: core.serialization.string().optional(), + message: core.serialization.string(), + status: core.serialization.number(), + } +); + +export declare namespace Error_ { + interface Raw { + type?: string | null; + message: string; + status: number; + } +} diff --git a/src/serialization/types/EventAccountCreated.ts b/src/serialization/types/EventAccountCreated.ts new file mode 100644 index 0000000..02b6cc5 --- /dev/null +++ b/src/serialization/types/EventAccountCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; + +export const EventAccountCreated: core.serialization.ObjectSchema< + serializers.EventAccountCreated.Raw, + DevRev.EventAccountCreated +> = core.serialization.object({ + account: Account, +}); + +export declare namespace EventAccountCreated { + interface Raw { + account: Account.Raw; + } +} diff --git a/src/serialization/types/EventAccountDeleted.ts b/src/serialization/types/EventAccountDeleted.ts new file mode 100644 index 0000000..f43d33f --- /dev/null +++ b/src/serialization/types/EventAccountDeleted.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; + +export const EventAccountDeleted: core.serialization.ObjectSchema< + serializers.EventAccountDeleted.Raw, + DevRev.EventAccountDeleted +> = core.serialization.object({ + id: core.serialization.string(), + oldAccount: core.serialization.property("old_account", Account.optional()), +}); + +export declare namespace EventAccountDeleted { + interface Raw { + id: string; + old_account?: Account.Raw | null; + } +} diff --git a/src/serialization/types/EventAccountUpdated.ts b/src/serialization/types/EventAccountUpdated.ts new file mode 100644 index 0000000..7b2d5b8 --- /dev/null +++ b/src/serialization/types/EventAccountUpdated.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Account } from "./Account"; + +export const EventAccountUpdated: core.serialization.ObjectSchema< + serializers.EventAccountUpdated.Raw, + DevRev.EventAccountUpdated +> = core.serialization.object({ + account: Account, + oldAccount: core.serialization.property("old_account", Account.optional()), +}); + +export declare namespace EventAccountUpdated { + interface Raw { + account: Account.Raw; + old_account?: Account.Raw | null; + } +} diff --git a/src/serialization/types/EventConversationCreated.ts b/src/serialization/types/EventConversationCreated.ts new file mode 100644 index 0000000..0e27a13 --- /dev/null +++ b/src/serialization/types/EventConversationCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Conversation } from "./Conversation"; + +export const EventConversationCreated: core.serialization.ObjectSchema< + serializers.EventConversationCreated.Raw, + DevRev.EventConversationCreated +> = core.serialization.object({ + conversation: Conversation, +}); + +export declare namespace EventConversationCreated { + interface Raw { + conversation: Conversation.Raw; + } +} diff --git a/src/serialization/types/EventConversationDeleted.ts b/src/serialization/types/EventConversationDeleted.ts new file mode 100644 index 0000000..d958368 --- /dev/null +++ b/src/serialization/types/EventConversationDeleted.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventConversationDeleted: core.serialization.ObjectSchema< + serializers.EventConversationDeleted.Raw, + DevRev.EventConversationDeleted +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EventConversationDeleted { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/EventConversationUpdated.ts b/src/serialization/types/EventConversationUpdated.ts new file mode 100644 index 0000000..9adb7fc --- /dev/null +++ b/src/serialization/types/EventConversationUpdated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Conversation } from "./Conversation"; + +export const EventConversationUpdated: core.serialization.ObjectSchema< + serializers.EventConversationUpdated.Raw, + DevRev.EventConversationUpdated +> = core.serialization.object({ + conversation: Conversation, +}); + +export declare namespace EventConversationUpdated { + interface Raw { + conversation: Conversation.Raw; + } +} diff --git a/src/serialization/types/EventDevUserCreated.ts b/src/serialization/types/EventDevUserCreated.ts new file mode 100644 index 0000000..ec12800 --- /dev/null +++ b/src/serialization/types/EventDevUserCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DevUser } from "./DevUser"; + +export const EventDevUserCreated: core.serialization.ObjectSchema< + serializers.EventDevUserCreated.Raw, + DevRev.EventDevUserCreated +> = core.serialization.object({ + devUser: core.serialization.property("dev_user", DevUser), +}); + +export declare namespace EventDevUserCreated { + interface Raw { + dev_user: DevUser.Raw; + } +} diff --git a/src/serialization/types/EventDevUserDeleted.ts b/src/serialization/types/EventDevUserDeleted.ts new file mode 100644 index 0000000..1868390 --- /dev/null +++ b/src/serialization/types/EventDevUserDeleted.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DevUser } from "./DevUser"; + +export const EventDevUserDeleted: core.serialization.ObjectSchema< + serializers.EventDevUserDeleted.Raw, + DevRev.EventDevUserDeleted +> = core.serialization.object({ + id: core.serialization.string(), + oldDevUser: core.serialization.property("old_dev_user", DevUser.optional()), +}); + +export declare namespace EventDevUserDeleted { + interface Raw { + id: string; + old_dev_user?: DevUser.Raw | null; + } +} diff --git a/src/serialization/types/EventDevUserUpdated.ts b/src/serialization/types/EventDevUserUpdated.ts new file mode 100644 index 0000000..3750261 --- /dev/null +++ b/src/serialization/types/EventDevUserUpdated.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DevUser } from "./DevUser"; + +export const EventDevUserUpdated: core.serialization.ObjectSchema< + serializers.EventDevUserUpdated.Raw, + DevRev.EventDevUserUpdated +> = core.serialization.object({ + devUser: core.serialization.property("dev_user", DevUser), + oldDevUser: core.serialization.property("old_dev_user", DevUser.optional()), +}); + +export declare namespace EventDevUserUpdated { + interface Raw { + dev_user: DevUser.Raw; + old_dev_user?: DevUser.Raw | null; + } +} diff --git a/src/serialization/types/EventGroupCreated.ts b/src/serialization/types/EventGroupCreated.ts new file mode 100644 index 0000000..8e51ce0 --- /dev/null +++ b/src/serialization/types/EventGroupCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Group } from "./Group"; + +export const EventGroupCreated: core.serialization.ObjectSchema< + serializers.EventGroupCreated.Raw, + DevRev.EventGroupCreated +> = core.serialization.object({ + group: Group, +}); + +export declare namespace EventGroupCreated { + interface Raw { + group: Group.Raw; + } +} diff --git a/src/serialization/types/EventGroupDeleted.ts b/src/serialization/types/EventGroupDeleted.ts new file mode 100644 index 0000000..a2acd18 --- /dev/null +++ b/src/serialization/types/EventGroupDeleted.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventGroupDeleted: core.serialization.ObjectSchema< + serializers.EventGroupDeleted.Raw, + DevRev.EventGroupDeleted +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EventGroupDeleted { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/EventGroupUpdated.ts b/src/serialization/types/EventGroupUpdated.ts new file mode 100644 index 0000000..dfe8883 --- /dev/null +++ b/src/serialization/types/EventGroupUpdated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Group } from "./Group"; + +export const EventGroupUpdated: core.serialization.ObjectSchema< + serializers.EventGroupUpdated.Raw, + DevRev.EventGroupUpdated +> = core.serialization.object({ + group: Group, +}); + +export declare namespace EventGroupUpdated { + interface Raw { + group: Group.Raw; + } +} diff --git a/src/serialization/types/EventPartCreated.ts b/src/serialization/types/EventPartCreated.ts new file mode 100644 index 0000000..5e77cc2 --- /dev/null +++ b/src/serialization/types/EventPartCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Part } from "./Part"; + +export const EventPartCreated: core.serialization.ObjectSchema< + serializers.EventPartCreated.Raw, + DevRev.EventPartCreated +> = core.serialization.object({ + part: Part, +}); + +export declare namespace EventPartCreated { + interface Raw { + part: Part.Raw; + } +} diff --git a/src/serialization/types/EventPartDeleted.ts b/src/serialization/types/EventPartDeleted.ts new file mode 100644 index 0000000..806b307 --- /dev/null +++ b/src/serialization/types/EventPartDeleted.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Part } from "./Part"; + +export const EventPartDeleted: core.serialization.ObjectSchema< + serializers.EventPartDeleted.Raw, + DevRev.EventPartDeleted +> = core.serialization.object({ + id: core.serialization.string(), + oldPart: core.serialization.property("old_part", Part.optional()), +}); + +export declare namespace EventPartDeleted { + interface Raw { + id: string; + old_part?: Part.Raw | null; + } +} diff --git a/src/serialization/types/EventPartUpdated.ts b/src/serialization/types/EventPartUpdated.ts new file mode 100644 index 0000000..41b5aaf --- /dev/null +++ b/src/serialization/types/EventPartUpdated.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Part } from "./Part"; + +export const EventPartUpdated: core.serialization.ObjectSchema< + serializers.EventPartUpdated.Raw, + DevRev.EventPartUpdated +> = core.serialization.object({ + oldPart: core.serialization.property("old_part", Part.optional()), + part: Part, +}); + +export declare namespace EventPartUpdated { + interface Raw { + old_part?: Part.Raw | null; + part: Part.Raw; + } +} diff --git a/src/serialization/types/EventRevOrgCreated.ts b/src/serialization/types/EventRevOrgCreated.ts new file mode 100644 index 0000000..82fc64f --- /dev/null +++ b/src/serialization/types/EventRevOrgCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevOrg } from "./RevOrg"; + +export const EventRevOrgCreated: core.serialization.ObjectSchema< + serializers.EventRevOrgCreated.Raw, + DevRev.EventRevOrgCreated +> = core.serialization.object({ + revOrg: core.serialization.property("rev_org", RevOrg), +}); + +export declare namespace EventRevOrgCreated { + interface Raw { + rev_org: RevOrg.Raw; + } +} diff --git a/src/serialization/types/EventRevOrgDeleted.ts b/src/serialization/types/EventRevOrgDeleted.ts new file mode 100644 index 0000000..1f3c287 --- /dev/null +++ b/src/serialization/types/EventRevOrgDeleted.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevOrg } from "./RevOrg"; + +export const EventRevOrgDeleted: core.serialization.ObjectSchema< + serializers.EventRevOrgDeleted.Raw, + DevRev.EventRevOrgDeleted +> = core.serialization.object({ + id: core.serialization.string(), + oldRevOrg: core.serialization.property("old_rev_org", RevOrg.optional()), +}); + +export declare namespace EventRevOrgDeleted { + interface Raw { + id: string; + old_rev_org?: RevOrg.Raw | null; + } +} diff --git a/src/serialization/types/EventRevOrgUpdated.ts b/src/serialization/types/EventRevOrgUpdated.ts new file mode 100644 index 0000000..c176ad3 --- /dev/null +++ b/src/serialization/types/EventRevOrgUpdated.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevOrg } from "./RevOrg"; + +export const EventRevOrgUpdated: core.serialization.ObjectSchema< + serializers.EventRevOrgUpdated.Raw, + DevRev.EventRevOrgUpdated +> = core.serialization.object({ + oldRevOrg: core.serialization.property("old_rev_org", RevOrg.optional()), + revOrg: core.serialization.property("rev_org", RevOrg), +}); + +export declare namespace EventRevOrgUpdated { + interface Raw { + old_rev_org?: RevOrg.Raw | null; + rev_org: RevOrg.Raw; + } +} diff --git a/src/serialization/types/EventRevUserCreated.ts b/src/serialization/types/EventRevUserCreated.ts new file mode 100644 index 0000000..a83d3be --- /dev/null +++ b/src/serialization/types/EventRevUserCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const EventRevUserCreated: core.serialization.ObjectSchema< + serializers.EventRevUserCreated.Raw, + DevRev.EventRevUserCreated +> = core.serialization.object({ + revUser: core.serialization.property("rev_user", RevUser), +}); + +export declare namespace EventRevUserCreated { + interface Raw { + rev_user: RevUser.Raw; + } +} diff --git a/src/serialization/types/EventRevUserDeleted.ts b/src/serialization/types/EventRevUserDeleted.ts new file mode 100644 index 0000000..a085ef2 --- /dev/null +++ b/src/serialization/types/EventRevUserDeleted.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const EventRevUserDeleted: core.serialization.ObjectSchema< + serializers.EventRevUserDeleted.Raw, + DevRev.EventRevUserDeleted +> = core.serialization.object({ + id: core.serialization.string(), + oldRevUser: core.serialization.property("old_rev_user", RevUser.optional()), +}); + +export declare namespace EventRevUserDeleted { + interface Raw { + id: string; + old_rev_user?: RevUser.Raw | null; + } +} diff --git a/src/serialization/types/EventRevUserUpdated.ts b/src/serialization/types/EventRevUserUpdated.ts new file mode 100644 index 0000000..75227d8 --- /dev/null +++ b/src/serialization/types/EventRevUserUpdated.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const EventRevUserUpdated: core.serialization.ObjectSchema< + serializers.EventRevUserUpdated.Raw, + DevRev.EventRevUserUpdated +> = core.serialization.object({ + oldRevUser: core.serialization.property("old_rev_user", RevUser.optional()), + revUser: core.serialization.property("rev_user", RevUser), +}); + +export declare namespace EventRevUserUpdated { + interface Raw { + old_rev_user?: RevUser.Raw | null; + rev_user: RevUser.Raw; + } +} diff --git a/src/serialization/types/EventSlaTrackerCreated.ts b/src/serialization/types/EventSlaTrackerCreated.ts new file mode 100644 index 0000000..1c0046a --- /dev/null +++ b/src/serialization/types/EventSlaTrackerCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SlaTracker } from "./SlaTracker"; + +export const EventSlaTrackerCreated: core.serialization.ObjectSchema< + serializers.EventSlaTrackerCreated.Raw, + DevRev.EventSlaTrackerCreated +> = core.serialization.object({ + slaTracker: core.serialization.property("sla_tracker", SlaTracker), +}); + +export declare namespace EventSlaTrackerCreated { + interface Raw { + sla_tracker: SlaTracker.Raw; + } +} diff --git a/src/serialization/types/EventSlaTrackerDeleted.ts b/src/serialization/types/EventSlaTrackerDeleted.ts new file mode 100644 index 0000000..53d671b --- /dev/null +++ b/src/serialization/types/EventSlaTrackerDeleted.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventSlaTrackerDeleted: core.serialization.ObjectSchema< + serializers.EventSlaTrackerDeleted.Raw, + DevRev.EventSlaTrackerDeleted +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EventSlaTrackerDeleted { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/EventSlaTrackerUpdated.ts b/src/serialization/types/EventSlaTrackerUpdated.ts new file mode 100644 index 0000000..3a76f0a --- /dev/null +++ b/src/serialization/types/EventSlaTrackerUpdated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SlaTracker } from "./SlaTracker"; + +export const EventSlaTrackerUpdated: core.serialization.ObjectSchema< + serializers.EventSlaTrackerUpdated.Raw, + DevRev.EventSlaTrackerUpdated +> = core.serialization.object({ + slaTracker: core.serialization.property("sla_tracker", SlaTracker), +}); + +export declare namespace EventSlaTrackerUpdated { + interface Raw { + sla_tracker: SlaTracker.Raw; + } +} diff --git a/src/serialization/types/EventSource.ts b/src/serialization/types/EventSource.ts new file mode 100644 index 0000000..f7eba5a --- /dev/null +++ b/src/serialization/types/EventSource.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { EventSourceSetupInstructions } from "./EventSourceSetupInstructions"; +import { EventSourceStatus } from "./EventSourceStatus"; +import { AtomBase } from "./AtomBase"; + +export const EventSource: core.serialization.ObjectSchema = + core.serialization + .object({ + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + name: core.serialization.string().optional(), + setupInstructions: core.serialization.property( + "setup_instructions", + EventSourceSetupInstructions.optional() + ), + status: EventSourceStatus.optional(), + triggerUrl: core.serialization.property("trigger_url", core.serialization.string().optional()), + }) + .extend(AtomBase); + +export declare namespace EventSource { + interface Raw extends AtomBase.Raw { + config?: Record | null; + name?: string | null; + setup_instructions?: EventSourceSetupInstructions.Raw | null; + status?: EventSourceStatus.Raw | null; + trigger_url?: string | null; + } +} diff --git a/src/serialization/types/EventSourceGetResponse.ts b/src/serialization/types/EventSourceGetResponse.ts new file mode 100644 index 0000000..3acae78 --- /dev/null +++ b/src/serialization/types/EventSourceGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { EventSource } from "./EventSource"; + +export const EventSourceGetResponse: core.serialization.ObjectSchema< + serializers.EventSourceGetResponse.Raw, + DevRev.EventSourceGetResponse +> = core.serialization.object({ + eventSource: core.serialization.property("event_source", EventSource), +}); + +export declare namespace EventSourceGetResponse { + interface Raw { + event_source: EventSource.Raw; + } +} diff --git a/src/serialization/types/EventSourceSetupInstructions.ts b/src/serialization/types/EventSourceSetupInstructions.ts new file mode 100644 index 0000000..2195e96 --- /dev/null +++ b/src/serialization/types/EventSourceSetupInstructions.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventSourceSetupInstructions: core.serialization.ObjectSchema< + serializers.EventSourceSetupInstructions.Raw, + DevRev.EventSourceSetupInstructions +> = core.serialization.object({ + content: core.serialization.string().optional(), +}); + +export declare namespace EventSourceSetupInstructions { + interface Raw { + content?: string | null; + } +} diff --git a/src/serialization/types/EventSourceStatus.ts b/src/serialization/types/EventSourceStatus.ts new file mode 100644 index 0000000..01b3112 --- /dev/null +++ b/src/serialization/types/EventSourceStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventSourceStatus: core.serialization.Schema = + core.serialization.enum_(["active", "blocked", "paused"]); + +export declare namespace EventSourceStatus { + type Raw = "active" | "blocked" | "paused"; +} diff --git a/src/serialization/types/EventSourcesScheduleEventResponse.ts b/src/serialization/types/EventSourcesScheduleEventResponse.ts new file mode 100644 index 0000000..22479e7 --- /dev/null +++ b/src/serialization/types/EventSourcesScheduleEventResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventSourcesScheduleEventResponse: core.serialization.ObjectSchema< + serializers.EventSourcesScheduleEventResponse.Raw, + DevRev.EventSourcesScheduleEventResponse +> = core.serialization.object({ + eventKey: core.serialization.property("event_key", core.serialization.string().optional()), +}); + +export declare namespace EventSourcesScheduleEventResponse { + interface Raw { + event_key?: string | null; + } +} diff --git a/src/serialization/types/EventSurveyResponseCreated.ts b/src/serialization/types/EventSurveyResponseCreated.ts new file mode 100644 index 0000000..f7dda48 --- /dev/null +++ b/src/serialization/types/EventSurveyResponseCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SurveyResponse } from "./SurveyResponse"; + +export const EventSurveyResponseCreated: core.serialization.ObjectSchema< + serializers.EventSurveyResponseCreated.Raw, + DevRev.EventSurveyResponseCreated +> = core.serialization.object({ + surveyResponse: core.serialization.property("survey_response", SurveyResponse), +}); + +export declare namespace EventSurveyResponseCreated { + interface Raw { + survey_response: SurveyResponse.Raw; + } +} diff --git a/src/serialization/types/EventSurveyResponseDeleted.ts b/src/serialization/types/EventSurveyResponseDeleted.ts new file mode 100644 index 0000000..9158dfd --- /dev/null +++ b/src/serialization/types/EventSurveyResponseDeleted.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventSurveyResponseDeleted: core.serialization.ObjectSchema< + serializers.EventSurveyResponseDeleted.Raw, + DevRev.EventSurveyResponseDeleted +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EventSurveyResponseDeleted { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/EventSurveyResponseUpdated.ts b/src/serialization/types/EventSurveyResponseUpdated.ts new file mode 100644 index 0000000..c4c76b8 --- /dev/null +++ b/src/serialization/types/EventSurveyResponseUpdated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SurveyResponse } from "./SurveyResponse"; + +export const EventSurveyResponseUpdated: core.serialization.ObjectSchema< + serializers.EventSurveyResponseUpdated.Raw, + DevRev.EventSurveyResponseUpdated +> = core.serialization.object({ + surveyResponse: core.serialization.property("survey_response", SurveyResponse), +}); + +export declare namespace EventSurveyResponseUpdated { + interface Raw { + survey_response: SurveyResponse.Raw; + } +} diff --git a/src/serialization/types/EventTagCreated.ts b/src/serialization/types/EventTagCreated.ts new file mode 100644 index 0000000..09d30d5 --- /dev/null +++ b/src/serialization/types/EventTagCreated.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Tag } from "./Tag"; + +export const EventTagCreated: core.serialization.ObjectSchema = + core.serialization.object({ + tag: Tag, + }); + +export declare namespace EventTagCreated { + interface Raw { + tag: Tag.Raw; + } +} diff --git a/src/serialization/types/EventTagDeleted.ts b/src/serialization/types/EventTagDeleted.ts new file mode 100644 index 0000000..b89c89c --- /dev/null +++ b/src/serialization/types/EventTagDeleted.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventTagDeleted: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + }); + +export declare namespace EventTagDeleted { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/EventTagUpdated.ts b/src/serialization/types/EventTagUpdated.ts new file mode 100644 index 0000000..0034212 --- /dev/null +++ b/src/serialization/types/EventTagUpdated.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Tag } from "./Tag"; + +export const EventTagUpdated: core.serialization.ObjectSchema = + core.serialization.object({ + tag: Tag, + }); + +export declare namespace EventTagUpdated { + interface Raw { + tag: Tag.Raw; + } +} diff --git a/src/serialization/types/EventTimelineEntryCreated.ts b/src/serialization/types/EventTimelineEntryCreated.ts new file mode 100644 index 0000000..2c022b3 --- /dev/null +++ b/src/serialization/types/EventTimelineEntryCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntry } from "./TimelineEntry"; + +export const EventTimelineEntryCreated: core.serialization.ObjectSchema< + serializers.EventTimelineEntryCreated.Raw, + DevRev.EventTimelineEntryCreated +> = core.serialization.object({ + entry: TimelineEntry, +}); + +export declare namespace EventTimelineEntryCreated { + interface Raw { + entry: TimelineEntry.Raw; + } +} diff --git a/src/serialization/types/EventTimelineEntryDeleted.ts b/src/serialization/types/EventTimelineEntryDeleted.ts new file mode 100644 index 0000000..f26b966 --- /dev/null +++ b/src/serialization/types/EventTimelineEntryDeleted.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventTimelineEntryDeleted: core.serialization.ObjectSchema< + serializers.EventTimelineEntryDeleted.Raw, + DevRev.EventTimelineEntryDeleted +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EventTimelineEntryDeleted { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/EventTimelineEntryUpdated.ts b/src/serialization/types/EventTimelineEntryUpdated.ts new file mode 100644 index 0000000..3e755d1 --- /dev/null +++ b/src/serialization/types/EventTimelineEntryUpdated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntry } from "./TimelineEntry"; + +export const EventTimelineEntryUpdated: core.serialization.ObjectSchema< + serializers.EventTimelineEntryUpdated.Raw, + DevRev.EventTimelineEntryUpdated +> = core.serialization.object({ + entry: TimelineEntry, +}); + +export declare namespace EventTimelineEntryUpdated { + interface Raw { + entry: TimelineEntry.Raw; + } +} diff --git a/src/serialization/types/EventWebhookCreated.ts b/src/serialization/types/EventWebhookCreated.ts new file mode 100644 index 0000000..6d2ebd7 --- /dev/null +++ b/src/serialization/types/EventWebhookCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Webhook } from "./Webhook"; + +export const EventWebhookCreated: core.serialization.ObjectSchema< + serializers.EventWebhookCreated.Raw, + DevRev.EventWebhookCreated +> = core.serialization.object({ + webhook: Webhook, +}); + +export declare namespace EventWebhookCreated { + interface Raw { + webhook: Webhook.Raw; + } +} diff --git a/src/serialization/types/EventWebhookDeleted.ts b/src/serialization/types/EventWebhookDeleted.ts new file mode 100644 index 0000000..fdf52f5 --- /dev/null +++ b/src/serialization/types/EventWebhookDeleted.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const EventWebhookDeleted: core.serialization.ObjectSchema< + serializers.EventWebhookDeleted.Raw, + DevRev.EventWebhookDeleted +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace EventWebhookDeleted { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/EventWebhookUpdated.ts b/src/serialization/types/EventWebhookUpdated.ts new file mode 100644 index 0000000..2f95c53 --- /dev/null +++ b/src/serialization/types/EventWebhookUpdated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Webhook } from "./Webhook"; + +export const EventWebhookUpdated: core.serialization.ObjectSchema< + serializers.EventWebhookUpdated.Raw, + DevRev.EventWebhookUpdated +> = core.serialization.object({ + webhook: Webhook, +}); + +export declare namespace EventWebhookUpdated { + interface Raw { + webhook: Webhook.Raw; + } +} diff --git a/src/serialization/types/EventWorkCreated.ts b/src/serialization/types/EventWorkCreated.ts new file mode 100644 index 0000000..29ec090 --- /dev/null +++ b/src/serialization/types/EventWorkCreated.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const EventWorkCreated: core.serialization.ObjectSchema< + serializers.EventWorkCreated.Raw, + DevRev.EventWorkCreated +> = core.serialization.object({ + work: Work, +}); + +export declare namespace EventWorkCreated { + interface Raw { + work: Work.Raw; + } +} diff --git a/src/serialization/types/EventWorkDeleted.ts b/src/serialization/types/EventWorkDeleted.ts new file mode 100644 index 0000000..47473ac --- /dev/null +++ b/src/serialization/types/EventWorkDeleted.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const EventWorkDeleted: core.serialization.ObjectSchema< + serializers.EventWorkDeleted.Raw, + DevRev.EventWorkDeleted +> = core.serialization.object({ + id: core.serialization.string(), + oldWork: core.serialization.property("old_work", Work.optional()), +}); + +export declare namespace EventWorkDeleted { + interface Raw { + id: string; + old_work?: Work.Raw | null; + } +} diff --git a/src/serialization/types/EventWorkUpdated.ts b/src/serialization/types/EventWorkUpdated.ts new file mode 100644 index 0000000..2b05e47 --- /dev/null +++ b/src/serialization/types/EventWorkUpdated.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const EventWorkUpdated: core.serialization.ObjectSchema< + serializers.EventWorkUpdated.Raw, + DevRev.EventWorkUpdated +> = core.serialization.object({ + oldWork: core.serialization.property("old_work", Work.optional()), + work: Work, +}); + +export declare namespace EventWorkUpdated { + interface Raw { + old_work?: Work.Raw | null; + work: Work.Raw; + } +} diff --git a/src/serialization/types/ExternalIdentity.ts b/src/serialization/types/ExternalIdentity.ts new file mode 100644 index 0000000..fc7bb0f --- /dev/null +++ b/src/serialization/types/ExternalIdentity.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ExternalIdentity: core.serialization.ObjectSchema< + serializers.ExternalIdentity.Raw, + DevRev.ExternalIdentity +> = core.serialization.object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + id: core.serialization.string().optional(), + isVerified: core.serialization.property("is_verified", core.serialization.boolean().optional()), + issuer: core.serialization.string().optional(), +}); + +export declare namespace ExternalIdentity { + interface Raw { + display_name?: string | null; + id?: string | null; + is_verified?: boolean | null; + issuer?: string | null; + } +} diff --git a/src/serialization/types/Feature.ts b/src/serialization/types/Feature.ts new file mode 100644 index 0000000..a701746 --- /dev/null +++ b/src/serialization/types/Feature.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBase } from "./PartBase"; + +export const Feature: core.serialization.ObjectSchema = PartBase; + +export declare namespace Feature { + type Raw = PartBase.Raw; +} diff --git a/src/serialization/types/FeatureSummary.ts b/src/serialization/types/FeatureSummary.ts new file mode 100644 index 0000000..1707565 --- /dev/null +++ b/src/serialization/types/FeatureSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBaseSummary } from "./PartBaseSummary"; + +export const FeatureSummary: core.serialization.ObjectSchema = + PartBaseSummary; + +export declare namespace FeatureSummary { + type Raw = PartBaseSummary.Raw; +} diff --git a/src/serialization/types/FieldDescriptor.ts b/src/serialization/types/FieldDescriptor.ts new file mode 100644 index 0000000..0ef7d30 --- /dev/null +++ b/src/serialization/types/FieldDescriptor.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const FieldDescriptor: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace FieldDescriptor { + type Raw = Record; +} diff --git a/src/serialization/types/Group.ts b/src/serialization/types/Group.ts new file mode 100644 index 0000000..dcc659c --- /dev/null +++ b/src/serialization/types/Group.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { GroupMemberType } from "./GroupMemberType"; +import { UserSummary } from "./UserSummary"; +import { AtomBase } from "./AtomBase"; + +export const Group: core.serialization.ObjectSchema = core.serialization + .object({ + description: core.serialization.string().optional(), + isDefault: core.serialization.property("is_default", core.serialization.boolean()), + memberType: core.serialization.property("member_type", GroupMemberType.optional()), + name: core.serialization.string().optional(), + owner: UserSummary.optional(), + }) + .extend(AtomBase); + +export declare namespace Group { + interface Raw extends AtomBase.Raw { + description?: string | null; + is_default: boolean; + member_type?: GroupMemberType.Raw | null; + name?: string | null; + owner?: UserSummary.Raw | null; + } +} diff --git a/src/serialization/types/GroupMemberType.ts b/src/serialization/types/GroupMemberType.ts new file mode 100644 index 0000000..4ea3806 --- /dev/null +++ b/src/serialization/types/GroupMemberType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const GroupMemberType: core.serialization.Schema = + core.serialization.enum_(["dev_user", "rev_user"]); + +export declare namespace GroupMemberType { + type Raw = "dev_user" | "rev_user"; +} diff --git a/src/serialization/types/GroupMembersAddResponse.ts b/src/serialization/types/GroupMembersAddResponse.ts new file mode 100644 index 0000000..bf46d69 --- /dev/null +++ b/src/serialization/types/GroupMembersAddResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const GroupMembersAddResponse: core.serialization.Schema< + serializers.GroupMembersAddResponse.Raw, + DevRev.GroupMembersAddResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace GroupMembersAddResponse { + type Raw = Record; +} diff --git a/src/serialization/types/GroupMembersListResponse.ts b/src/serialization/types/GroupMembersListResponse.ts new file mode 100644 index 0000000..283643b --- /dev/null +++ b/src/serialization/types/GroupMembersListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { GroupMembersListResponseMember } from "./GroupMembersListResponseMember"; + +export const GroupMembersListResponse: core.serialization.ObjectSchema< + serializers.GroupMembersListResponse.Raw, + DevRev.GroupMembersListResponse +> = core.serialization.object({ + members: core.serialization.list(GroupMembersListResponseMember), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace GroupMembersListResponse { + interface Raw { + members: GroupMembersListResponseMember.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/GroupMembersListResponseMember.ts b/src/serialization/types/GroupMembersListResponseMember.ts new file mode 100644 index 0000000..7037e18 --- /dev/null +++ b/src/serialization/types/GroupMembersListResponseMember.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { MemberSummary } from "./MemberSummary"; + +export const GroupMembersListResponseMember: core.serialization.ObjectSchema< + serializers.GroupMembersListResponseMember.Raw, + DevRev.GroupMembersListResponseMember +> = core.serialization.object({ + member: MemberSummary, +}); + +export declare namespace GroupMembersListResponseMember { + interface Raw { + member: MemberSummary.Raw; + } +} diff --git a/src/serialization/types/GroupMembersRemoveResponse.ts b/src/serialization/types/GroupMembersRemoveResponse.ts new file mode 100644 index 0000000..135f34a --- /dev/null +++ b/src/serialization/types/GroupMembersRemoveResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const GroupMembersRemoveResponse: core.serialization.Schema< + serializers.GroupMembersRemoveResponse.Raw, + DevRev.GroupMembersRemoveResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace GroupMembersRemoveResponse { + type Raw = Record; +} diff --git a/src/serialization/types/GroupSearchSummary.ts b/src/serialization/types/GroupSearchSummary.ts new file mode 100644 index 0000000..0bb1be8 --- /dev/null +++ b/src/serialization/types/GroupSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { GroupSummary } from "./GroupSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const GroupSearchSummary: core.serialization.ObjectSchema< + serializers.GroupSearchSummary.Raw, + DevRev.GroupSearchSummary +> = core.serialization + .object({ + group: GroupSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace GroupSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + group: GroupSummary.Raw; + } +} diff --git a/src/serialization/types/GroupSummary.ts b/src/serialization/types/GroupSummary.ts new file mode 100644 index 0000000..ff34305 --- /dev/null +++ b/src/serialization/types/GroupSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { GroupMemberType } from "./GroupMemberType"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const GroupSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + memberType: core.serialization.property("member_type", GroupMemberType.optional()), + name: core.serialization.string().optional(), + }) + .extend(AtomBaseSummary); + +export declare namespace GroupSummary { + interface Raw extends AtomBaseSummary.Raw { + member_type?: GroupMemberType.Raw | null; + name?: string | null; + } +} diff --git a/src/serialization/types/GroupType.ts b/src/serialization/types/GroupType.ts new file mode 100644 index 0000000..08260eb --- /dev/null +++ b/src/serialization/types/GroupType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const GroupType: core.serialization.Schema = + core.serialization.enum_(["dynamic", "static"]); + +export declare namespace GroupType { + type Raw = "dynamic" | "static"; +} diff --git a/src/serialization/types/GroupedVistaFlavor.ts b/src/serialization/types/GroupedVistaFlavor.ts new file mode 100644 index 0000000..147cdce --- /dev/null +++ b/src/serialization/types/GroupedVistaFlavor.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const GroupedVistaFlavor: core.serialization.Schema< + serializers.GroupedVistaFlavor.Raw, + DevRev.GroupedVistaFlavor +> = core.serialization.enum_(["nnl", "sprint_board", "support_inbox"]); + +export declare namespace GroupedVistaFlavor { + type Raw = "nnl" | "sprint_board" | "support_inbox"; +} diff --git a/src/serialization/types/GroupedVistaSummary.ts b/src/serialization/types/GroupedVistaSummary.ts new file mode 100644 index 0000000..73c50f0 --- /dev/null +++ b/src/serialization/types/GroupedVistaSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { GroupedVistaFlavor } from "./GroupedVistaFlavor"; +import { VistaBaseSummary } from "./VistaBaseSummary"; + +export const GroupedVistaSummary: core.serialization.ObjectSchema< + serializers.GroupedVistaSummary.Raw, + DevRev.GroupedVistaSummary +> = core.serialization + .object({ + flavor: GroupedVistaFlavor.optional(), + }) + .extend(VistaBaseSummary); + +export declare namespace GroupedVistaSummary { + interface Raw extends VistaBaseSummary.Raw { + flavor?: GroupedVistaFlavor.Raw | null; + } +} diff --git a/src/serialization/types/GroupsCreateResponse.ts b/src/serialization/types/GroupsCreateResponse.ts new file mode 100644 index 0000000..8f84cf0 --- /dev/null +++ b/src/serialization/types/GroupsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Group } from "./Group"; + +export const GroupsCreateResponse: core.serialization.ObjectSchema< + serializers.GroupsCreateResponse.Raw, + DevRev.GroupsCreateResponse +> = core.serialization.object({ + group: Group, +}); + +export declare namespace GroupsCreateResponse { + interface Raw { + group: Group.Raw; + } +} diff --git a/src/serialization/types/GroupsGetResponse.ts b/src/serialization/types/GroupsGetResponse.ts new file mode 100644 index 0000000..60c5c5f --- /dev/null +++ b/src/serialization/types/GroupsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Group } from "./Group"; + +export const GroupsGetResponse: core.serialization.ObjectSchema< + serializers.GroupsGetResponse.Raw, + DevRev.GroupsGetResponse +> = core.serialization.object({ + group: Group, +}); + +export declare namespace GroupsGetResponse { + interface Raw { + group: Group.Raw; + } +} diff --git a/src/serialization/types/GroupsListResponse.ts b/src/serialization/types/GroupsListResponse.ts new file mode 100644 index 0000000..0388f1f --- /dev/null +++ b/src/serialization/types/GroupsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Group } from "./Group"; + +export const GroupsListResponse: core.serialization.ObjectSchema< + serializers.GroupsListResponse.Raw, + DevRev.GroupsListResponse +> = core.serialization.object({ + groups: core.serialization.list(Group), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace GroupsListResponse { + interface Raw { + groups: Group.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/GroupsUpdateRequestDynamicGroupInfo.ts b/src/serialization/types/GroupsUpdateRequestDynamicGroupInfo.ts new file mode 100644 index 0000000..cecded4 --- /dev/null +++ b/src/serialization/types/GroupsUpdateRequestDynamicGroupInfo.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const GroupsUpdateRequestDynamicGroupInfo: core.serialization.ObjectSchema< + serializers.GroupsUpdateRequestDynamicGroupInfo.Raw, + DevRev.GroupsUpdateRequestDynamicGroupInfo +> = core.serialization.object({ + membershipExpression: core.serialization.property( + "membership_expression", + core.serialization.lazy(() => serializers.BooleanExpression) + ), +}); + +export declare namespace GroupsUpdateRequestDynamicGroupInfo { + interface Raw { + membership_expression: serializers.BooleanExpression.Raw; + } +} diff --git a/src/serialization/types/GroupsUpdateResponse.ts b/src/serialization/types/GroupsUpdateResponse.ts new file mode 100644 index 0000000..453ddfa --- /dev/null +++ b/src/serialization/types/GroupsUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Group } from "./Group"; + +export const GroupsUpdateResponse: core.serialization.ObjectSchema< + serializers.GroupsUpdateResponse.Raw, + DevRev.GroupsUpdateResponse +> = core.serialization.object({ + group: Group, +}); + +export declare namespace GroupsUpdateResponse { + interface Raw { + group: Group.Raw; + } +} diff --git a/src/serialization/types/Issue.ts b/src/serialization/types/Issue.ts new file mode 100644 index 0000000..31c8a46 --- /dev/null +++ b/src/serialization/types/Issue.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartSummary } from "./PartSummary"; +import { IssuePriority } from "./IssuePriority"; +import { SlaTrackerSummary } from "./SlaTrackerSummary"; +import { VistaGroupItemSummary } from "./VistaGroupItemSummary"; +import { WorkBase } from "./WorkBase"; + +export const Issue: core.serialization.ObjectSchema = core.serialization + .object({ + developedWith: core.serialization.property("developed_with", core.serialization.list(PartSummary).optional()), + priority: IssuePriority.optional(), + slaTracker: core.serialization.property("sla_tracker", SlaTrackerSummary.optional()), + sprint: VistaGroupItemSummary.optional(), + targetStartDate: core.serialization.property("target_start_date", core.serialization.date().optional()), + }) + .extend(WorkBase); + +export declare namespace Issue { + interface Raw extends WorkBase.Raw { + developed_with?: PartSummary.Raw[] | null; + priority?: IssuePriority.Raw | null; + sla_tracker?: SlaTrackerSummary.Raw | null; + sprint?: VistaGroupItemSummary.Raw | null; + target_start_date?: string | null; + } +} diff --git a/src/serialization/types/IssuePriority.ts b/src/serialization/types/IssuePriority.ts new file mode 100644 index 0000000..7568537 --- /dev/null +++ b/src/serialization/types/IssuePriority.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const IssuePriority: core.serialization.Schema = + core.serialization.enum_(["p0", "p1", "p2", "p3"]); + +export declare namespace IssuePriority { + type Raw = "p0" | "p1" | "p2" | "p3"; +} diff --git a/src/serialization/types/IssueSummary.ts b/src/serialization/types/IssueSummary.ts new file mode 100644 index 0000000..9762754 --- /dev/null +++ b/src/serialization/types/IssueSummary.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { IssuePriority } from "./IssuePriority"; +import { WorkBaseSummary } from "./WorkBaseSummary"; + +export const IssueSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + priority: IssuePriority.optional(), + }) + .extend(WorkBaseSummary); + +export declare namespace IssueSummary { + interface Raw extends WorkBaseSummary.Raw { + priority?: IssuePriority.Raw | null; + } +} diff --git a/src/serialization/types/JobHistoryItem.ts b/src/serialization/types/JobHistoryItem.ts new file mode 100644 index 0000000..6629717 --- /dev/null +++ b/src/serialization/types/JobHistoryItem.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { EnumValue } from "./EnumValue"; + +export const JobHistoryItem: core.serialization.ObjectSchema = + core.serialization.object({ + employmentStatus: core.serialization.property("employment_status", EnumValue.optional()), + endDate: core.serialization.property("end_date", core.serialization.date().optional()), + isCurrent: core.serialization.property("is_current", core.serialization.boolean().optional()), + location: core.serialization.string().optional(), + startDate: core.serialization.property("start_date", core.serialization.date().optional()), + title: core.serialization.string().optional(), + }); + +export declare namespace JobHistoryItem { + interface Raw { + employment_status?: EnumValue.Raw | null; + end_date?: string | null; + is_current?: boolean | null; + location?: string | null; + start_date?: string | null; + title?: string | null; + } +} diff --git a/src/serialization/types/LegacyStage.ts b/src/serialization/types/LegacyStage.ts new file mode 100644 index 0000000..ba875e1 --- /dev/null +++ b/src/serialization/types/LegacyStage.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomStageSummary } from "./CustomStageSummary"; + +export const LegacyStage: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + stage: CustomStageSummary.optional(), + }); + +export declare namespace LegacyStage { + interface Raw { + name: string; + stage?: CustomStageSummary.Raw | null; + } +} diff --git a/src/serialization/types/LegacyStageSummary.ts b/src/serialization/types/LegacyStageSummary.ts new file mode 100644 index 0000000..d3d1a7b --- /dev/null +++ b/src/serialization/types/LegacyStageSummary.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const LegacyStageSummary: core.serialization.ObjectSchema< + serializers.LegacyStageSummary.Raw, + DevRev.LegacyStageSummary +> = core.serialization.object({ + name: core.serialization.string(), +}); + +export declare namespace LegacyStageSummary { + interface Raw { + name: string; + } +} diff --git a/src/serialization/types/LinesOfCode.ts b/src/serialization/types/LinesOfCode.ts new file mode 100644 index 0000000..831cadf --- /dev/null +++ b/src/serialization/types/LinesOfCode.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const LinesOfCode: core.serialization.ObjectSchema = + core.serialization.object({ + fileCount: core.serialization.property("file_count", core.serialization.number().optional()), + linesAdded: core.serialization.property("lines_added", core.serialization.number().optional()), + linesDeleted: core.serialization.property("lines_deleted", core.serialization.number().optional()), + linesModified: core.serialization.property("lines_modified", core.serialization.number().optional()), + }); + +export declare namespace LinesOfCode { + interface Raw { + file_count?: number | null; + lines_added?: number | null; + lines_deleted?: number | null; + lines_modified?: number | null; + } +} diff --git a/src/serialization/types/Link.ts b/src/serialization/types/Link.ts new file mode 100644 index 0000000..f70f362 --- /dev/null +++ b/src/serialization/types/Link.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { LinkType } from "./LinkType"; +import { LinkEndpointSummary } from "./LinkEndpointSummary"; +import { AtomBase } from "./AtomBase"; + +export const Link: core.serialization.ObjectSchema = core.serialization + .object({ + linkType: core.serialization.property("link_type", LinkType), + source: LinkEndpointSummary, + target: LinkEndpointSummary, + }) + .extend(AtomBase); + +export declare namespace Link { + interface Raw extends AtomBase.Raw { + link_type: LinkType.Raw; + source: LinkEndpointSummary.Raw; + target: LinkEndpointSummary.Raw; + } +} diff --git a/src/serialization/types/LinkEndpointSummary.ts b/src/serialization/types/LinkEndpointSummary.ts new file mode 100644 index 0000000..73170e8 --- /dev/null +++ b/src/serialization/types/LinkEndpointSummary.ts @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBaseSummary } from "./PartBaseSummary"; +import { ConversationSummary } from "./ConversationSummary"; +import { IssueSummary } from "./IssueSummary"; +import { WorkBaseSummary } from "./WorkBaseSummary"; +import { TicketSummary } from "./TicketSummary"; + +export const LinkEndpointSummary: core.serialization.Schema< + serializers.LinkEndpointSummary.Raw, + DevRev.LinkEndpointSummary +> = core.serialization + .union("type", { + capability: PartBaseSummary, + conversation: ConversationSummary, + enhancement: PartBaseSummary, + feature: PartBaseSummary, + issue: IssueSummary, + opportunity: WorkBaseSummary, + product: PartBaseSummary, + task: WorkBaseSummary, + ticket: TicketSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace LinkEndpointSummary { + type Raw = + | LinkEndpointSummary.Capability + | LinkEndpointSummary.Conversation + | LinkEndpointSummary.Enhancement + | LinkEndpointSummary.Feature + | LinkEndpointSummary.Issue + | LinkEndpointSummary.Opportunity + | LinkEndpointSummary.Product + | LinkEndpointSummary.Task + | LinkEndpointSummary.Ticket; + + interface Capability extends PartBaseSummary.Raw { + type: "capability"; + } + + interface Conversation extends ConversationSummary.Raw { + type: "conversation"; + } + + interface Enhancement extends PartBaseSummary.Raw { + type: "enhancement"; + } + + interface Feature extends PartBaseSummary.Raw { + type: "feature"; + } + + interface Issue extends IssueSummary.Raw { + type: "issue"; + } + + interface Opportunity extends WorkBaseSummary.Raw { + type: "opportunity"; + } + + interface Product extends PartBaseSummary.Raw { + type: "product"; + } + + interface Task extends WorkBaseSummary.Raw { + type: "task"; + } + + interface Ticket extends TicketSummary.Raw { + type: "ticket"; + } +} diff --git a/src/serialization/types/LinkEndpointType.ts b/src/serialization/types/LinkEndpointType.ts new file mode 100644 index 0000000..2f4178f --- /dev/null +++ b/src/serialization/types/LinkEndpointType.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const LinkEndpointType: core.serialization.Schema = + core.serialization.enum_([ + "capability", + "conversation", + "enhancement", + "feature", + "issue", + "opportunity", + "product", + "task", + "ticket", + ]); + +export declare namespace LinkEndpointType { + type Raw = + | "capability" + | "conversation" + | "enhancement" + | "feature" + | "issue" + | "opportunity" + | "product" + | "task" + | "ticket"; +} diff --git a/src/serialization/types/LinkRevUserToRevOrgResponse.ts b/src/serialization/types/LinkRevUserToRevOrgResponse.ts new file mode 100644 index 0000000..cd8b799 --- /dev/null +++ b/src/serialization/types/LinkRevUserToRevOrgResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const LinkRevUserToRevOrgResponse: core.serialization.ObjectSchema< + serializers.LinkRevUserToRevOrgResponse.Raw, + DevRev.LinkRevUserToRevOrgResponse +> = core.serialization.object({ + revUser: core.serialization.property("rev_user", RevUser), +}); + +export declare namespace LinkRevUserToRevOrgResponse { + interface Raw { + rev_user: RevUser.Raw; + } +} diff --git a/src/serialization/types/LinkSearchSummary.ts b/src/serialization/types/LinkSearchSummary.ts new file mode 100644 index 0000000..046523c --- /dev/null +++ b/src/serialization/types/LinkSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { LinkSummary } from "./LinkSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const LinkSearchSummary: core.serialization.ObjectSchema< + serializers.LinkSearchSummary.Raw, + DevRev.LinkSearchSummary +> = core.serialization + .object({ + link: LinkSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace LinkSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + link: LinkSummary.Raw; + } +} diff --git a/src/serialization/types/LinkSummary.ts b/src/serialization/types/LinkSummary.ts new file mode 100644 index 0000000..19359fb --- /dev/null +++ b/src/serialization/types/LinkSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { LinkType } from "./LinkType"; +import { LinkEndpointSummary } from "./LinkEndpointSummary"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const LinkSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + linkType: core.serialization.property("link_type", LinkType), + source: LinkEndpointSummary, + target: LinkEndpointSummary, + }) + .extend(AtomBaseSummary); + +export declare namespace LinkSummary { + interface Raw extends AtomBaseSummary.Raw { + link_type: LinkType.Raw; + source: LinkEndpointSummary.Raw; + target: LinkEndpointSummary.Raw; + } +} diff --git a/src/serialization/types/LinkType.ts b/src/serialization/types/LinkType.ts new file mode 100644 index 0000000..19ef1b2 --- /dev/null +++ b/src/serialization/types/LinkType.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const LinkType: core.serialization.Schema = core.serialization.enum_([ + "custom_link", + "developed_with", + "imports", + "is_dependent_on", + "is_duplicate_of", + "is_merged_into", + "is_parent_of", + "is_part_of", + "is_related_to", + "serves", +]); + +export declare namespace LinkType { + type Raw = + | "custom_link" + | "developed_with" + | "imports" + | "is_dependent_on" + | "is_duplicate_of" + | "is_merged_into" + | "is_parent_of" + | "is_part_of" + | "is_related_to" + | "serves"; +} diff --git a/src/serialization/types/LinksCreateResponse.ts b/src/serialization/types/LinksCreateResponse.ts new file mode 100644 index 0000000..72bd225 --- /dev/null +++ b/src/serialization/types/LinksCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Link } from "./Link"; + +export const LinksCreateResponse: core.serialization.ObjectSchema< + serializers.LinksCreateResponse.Raw, + DevRev.LinksCreateResponse +> = core.serialization.object({ + link: Link, +}); + +export declare namespace LinksCreateResponse { + interface Raw { + link: Link.Raw; + } +} diff --git a/src/serialization/types/LinksDeleteResponse.ts b/src/serialization/types/LinksDeleteResponse.ts new file mode 100644 index 0000000..bcd1785 --- /dev/null +++ b/src/serialization/types/LinksDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const LinksDeleteResponse: core.serialization.Schema< + serializers.LinksDeleteResponse.Raw, + DevRev.LinksDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace LinksDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/LinksDirection.ts b/src/serialization/types/LinksDirection.ts new file mode 100644 index 0000000..859c18e --- /dev/null +++ b/src/serialization/types/LinksDirection.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const LinksDirection: core.serialization.Schema = + core.serialization.enum_(["is_source", "is_target"]); + +export declare namespace LinksDirection { + type Raw = "is_source" | "is_target"; +} diff --git a/src/serialization/types/LinksGetResponse.ts b/src/serialization/types/LinksGetResponse.ts new file mode 100644 index 0000000..ec124b1 --- /dev/null +++ b/src/serialization/types/LinksGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Link } from "./Link"; + +export const LinksGetResponse: core.serialization.ObjectSchema< + serializers.LinksGetResponse.Raw, + DevRev.LinksGetResponse +> = core.serialization.object({ + link: Link, +}); + +export declare namespace LinksGetResponse { + interface Raw { + link: Link.Raw; + } +} diff --git a/src/serialization/types/LinksListResponse.ts b/src/serialization/types/LinksListResponse.ts new file mode 100644 index 0000000..4b93c82 --- /dev/null +++ b/src/serialization/types/LinksListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Link } from "./Link"; + +export const LinksListResponse: core.serialization.ObjectSchema< + serializers.LinksListResponse.Raw, + DevRev.LinksListResponse +> = core.serialization.object({ + links: core.serialization.list(Link), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace LinksListResponse { + interface Raw { + links: Link.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/ListMode.ts b/src/serialization/types/ListMode.ts new file mode 100644 index 0000000..7ac9091 --- /dev/null +++ b/src/serialization/types/ListMode.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ListMode: core.serialization.Schema = core.serialization.enum_([ + "after", + "before", +]); + +export declare namespace ListMode { + type Raw = "after" | "before"; +} diff --git a/src/serialization/types/MeetingSummary.ts b/src/serialization/types/MeetingSummary.ts new file mode 100644 index 0000000..300fd96 --- /dev/null +++ b/src/serialization/types/MeetingSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const MeetingSummary: core.serialization.ObjectSchema = + AtomBaseSummary; + +export declare namespace MeetingSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/MemberSummary.ts b/src/serialization/types/MemberSummary.ts new file mode 100644 index 0000000..a9d4958 --- /dev/null +++ b/src/serialization/types/MemberSummary.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserBaseSummary } from "./UserBaseSummary"; +import { RevUserSummary } from "./RevUserSummary"; + +export const MemberSummary: core.serialization.Schema = + core.serialization + .union("type", { + dev_user: UserBaseSummary, + rev_user: RevUserSummary, + sys_user: UserBaseSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace MemberSummary { + type Raw = MemberSummary.DevUser | MemberSummary.RevUser | MemberSummary.SysUser; + + interface DevUser extends UserBaseSummary.Raw { + type: "dev_user"; + } + + interface RevUser extends RevUserSummary.Raw { + type: "rev_user"; + } + + interface SysUser extends UserBaseSummary.Raw { + type: "sys_user"; + } +} diff --git a/src/serialization/types/MemberType.ts b/src/serialization/types/MemberType.ts new file mode 100644 index 0000000..131495e --- /dev/null +++ b/src/serialization/types/MemberType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const MemberType: core.serialization.Schema = + core.serialization.enum_(["dev_user", "rev_user", "sys_user"]); + +export declare namespace MemberType { + type Raw = "dev_user" | "rev_user" | "sys_user"; +} diff --git a/src/serialization/types/MetricDataPoint.ts b/src/serialization/types/MetricDataPoint.ts new file mode 100644 index 0000000..9d2d8b2 --- /dev/null +++ b/src/serialization/types/MetricDataPoint.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { MetricDataPointDimension } from "./MetricDataPointDimension"; + +export const MetricDataPoint: core.serialization.ObjectSchema = + core.serialization.object({ + dimensions: core.serialization.list(MetricDataPointDimension).optional(), + id: core.serialization.string().optional(), + timestamp: core.serialization.date(), + value: core.serialization.number(), + }); + +export declare namespace MetricDataPoint { + interface Raw { + dimensions?: MetricDataPointDimension.Raw[] | null; + id?: string | null; + timestamp: string; + value: number; + } +} diff --git a/src/serialization/types/MetricDataPointDimension.ts b/src/serialization/types/MetricDataPointDimension.ts new file mode 100644 index 0000000..c1b3aa0 --- /dev/null +++ b/src/serialization/types/MetricDataPointDimension.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const MetricDataPointDimension: core.serialization.ObjectSchema< + serializers.MetricDataPointDimension.Raw, + DevRev.MetricDataPointDimension +> = core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), +}); + +export declare namespace MetricDataPointDimension { + interface Raw { + key: string; + value: string; + } +} diff --git a/src/serialization/types/MetricDefinition.ts b/src/serialization/types/MetricDefinition.ts new file mode 100644 index 0000000..d925dbd --- /dev/null +++ b/src/serialization/types/MetricDefinition.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBase } from "./AtomBase"; + +export const MetricDefinition: core.serialization.ObjectSchema< + serializers.MetricDefinition.Raw, + DevRev.MetricDefinition +> = core.serialization + .object({ + name: core.serialization.string().optional(), + }) + .extend(AtomBase); + +export declare namespace MetricDefinition { + interface Raw extends AtomBase.Raw { + name?: string | null; + } +} diff --git a/src/serialization/types/MetricDefinitionAppliesTo.ts b/src/serialization/types/MetricDefinitionAppliesTo.ts new file mode 100644 index 0000000..6b83aca --- /dev/null +++ b/src/serialization/types/MetricDefinitionAppliesTo.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const MetricDefinitionAppliesTo: core.serialization.Schema< + serializers.MetricDefinitionAppliesTo.Raw, + DevRev.MetricDefinitionAppliesTo +> = core.serialization.enum_(["conversation", "issue", "ticket"]); + +export declare namespace MetricDefinitionAppliesTo { + type Raw = "conversation" | "issue" | "ticket"; +} diff --git a/src/serialization/types/MetricDefinitionMetricType.ts b/src/serialization/types/MetricDefinitionMetricType.ts new file mode 100644 index 0000000..0014ed1 --- /dev/null +++ b/src/serialization/types/MetricDefinitionMetricType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const MetricDefinitionMetricType: core.serialization.Schema< + serializers.MetricDefinitionMetricType.Raw, + DevRev.MetricDefinitionMetricType +> = core.serialization.enum_(["time", "value"]); + +export declare namespace MetricDefinitionMetricType { + type Raw = "time" | "value"; +} diff --git a/src/serialization/types/MetricDefinitionStatus.ts b/src/serialization/types/MetricDefinitionStatus.ts new file mode 100644 index 0000000..c88102d --- /dev/null +++ b/src/serialization/types/MetricDefinitionStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const MetricDefinitionStatus: core.serialization.Schema< + serializers.MetricDefinitionStatus.Raw, + DevRev.MetricDefinitionStatus +> = core.serialization.enum_(["active", "inactive"]); + +export declare namespace MetricDefinitionStatus { + type Raw = "active" | "inactive"; +} diff --git a/src/serialization/types/MetricDefinitionSummary.ts b/src/serialization/types/MetricDefinitionSummary.ts new file mode 100644 index 0000000..fef74a6 --- /dev/null +++ b/src/serialization/types/MetricDefinitionSummary.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const MetricDefinitionSummary: core.serialization.ObjectSchema< + serializers.MetricDefinitionSummary.Raw, + DevRev.MetricDefinitionSummary +> = core.serialization + .object({ + name: core.serialization.string().optional(), + }) + .extend(AtomBaseSummary); + +export declare namespace MetricDefinitionSummary { + interface Raw extends AtomBaseSummary.Raw { + name?: string | null; + } +} diff --git a/src/serialization/types/MetricDefinitionsListResponse.ts b/src/serialization/types/MetricDefinitionsListResponse.ts new file mode 100644 index 0000000..2d467c3 --- /dev/null +++ b/src/serialization/types/MetricDefinitionsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { MetricDefinition } from "./MetricDefinition"; + +export const MetricDefinitionsListResponse: core.serialization.ObjectSchema< + serializers.MetricDefinitionsListResponse.Raw, + DevRev.MetricDefinitionsListResponse +> = core.serialization.object({ + metricDefinitions: core.serialization.property("metric_definitions", core.serialization.list(MetricDefinition)), + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace MetricDefinitionsListResponse { + interface Raw { + metric_definitions: MetricDefinition.Raw[]; + next_cursor?: string | null; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/MetricsData.ts b/src/serialization/types/MetricsData.ts new file mode 100644 index 0000000..b55cbdd --- /dev/null +++ b/src/serialization/types/MetricsData.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { MetricDataPoint } from "./MetricDataPoint"; + +export const MetricsData: core.serialization.ObjectSchema = + core.serialization.object({ + accountRef: core.serialization.property("account_ref", core.serialization.string()), + dataPoints: core.serialization.property("data_points", core.serialization.list(MetricDataPoint)), + name: core.serialization.string(), + orgRef: core.serialization.property("org_ref", core.serialization.string().optional()), + userRef: core.serialization.property("user_ref", core.serialization.string().optional()), + }); + +export declare namespace MetricsData { + interface Raw { + account_ref: string; + data_points: MetricDataPoint.Raw[]; + name: string; + org_ref?: string | null; + user_ref?: string | null; + } +} diff --git a/src/serialization/types/ObjectMemberSearchSummary.ts b/src/serialization/types/ObjectMemberSearchSummary.ts new file mode 100644 index 0000000..3ad2f48 --- /dev/null +++ b/src/serialization/types/ObjectMemberSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ObjectMemberSummary } from "./ObjectMemberSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const ObjectMemberSearchSummary: core.serialization.ObjectSchema< + serializers.ObjectMemberSearchSummary.Raw, + DevRev.ObjectMemberSearchSummary +> = core.serialization + .object({ + objectMember: core.serialization.property("object_member", ObjectMemberSummary), + }) + .extend(SearchSummaryBase); + +export declare namespace ObjectMemberSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + object_member: ObjectMemberSummary.Raw; + } +} diff --git a/src/serialization/types/ObjectMemberSummary.ts b/src/serialization/types/ObjectMemberSummary.ts new file mode 100644 index 0000000..3b984d5 --- /dev/null +++ b/src/serialization/types/ObjectMemberSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const ObjectMemberSummary: core.serialization.ObjectSchema< + serializers.ObjectMemberSummary.Raw, + DevRev.ObjectMemberSummary +> = AtomBaseSummary; + +export declare namespace ObjectMemberSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/Opportunity.ts b/src/serialization/types/Opportunity.ts new file mode 100644 index 0000000..a89ef60 --- /dev/null +++ b/src/serialization/types/Opportunity.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WorkBase } from "./WorkBase"; + +export const Opportunity: core.serialization.ObjectSchema = WorkBase; + +export declare namespace Opportunity { + type Raw = WorkBase.Raw; +} diff --git a/src/serialization/types/OpportunityForecastCategory.ts b/src/serialization/types/OpportunityForecastCategory.ts new file mode 100644 index 0000000..8e089e0 --- /dev/null +++ b/src/serialization/types/OpportunityForecastCategory.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OpportunityForecastCategory: core.serialization.Schema< + serializers.OpportunityForecastCategory.Raw, + DevRev.OpportunityForecastCategory +> = core.serialization.enum_(["commit", "omitted", "pipeline", "strong_upside", "upside", "won"]); + +export declare namespace OpportunityForecastCategory { + type Raw = "commit" | "omitted" | "pipeline" | "strong_upside" | "upside" | "won"; +} diff --git a/src/serialization/types/OpportunityPriority.ts b/src/serialization/types/OpportunityPriority.ts new file mode 100644 index 0000000..7e7b373 --- /dev/null +++ b/src/serialization/types/OpportunityPriority.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OpportunityPriority: core.serialization.Schema< + serializers.OpportunityPriority.Raw, + DevRev.OpportunityPriority +> = core.serialization.enum_(["p0", "p1", "p2", "p3"]); + +export declare namespace OpportunityPriority { + type Raw = "p0" | "p1" | "p2" | "p3"; +} diff --git a/src/serialization/types/OpportunitySummary.ts b/src/serialization/types/OpportunitySummary.ts new file mode 100644 index 0000000..7b0ea66 --- /dev/null +++ b/src/serialization/types/OpportunitySummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WorkBaseSummary } from "./WorkBaseSummary"; + +export const OpportunitySummary: core.serialization.ObjectSchema< + serializers.OpportunitySummary.Raw, + DevRev.OpportunitySummary +> = WorkBaseSummary; + +export declare namespace OpportunitySummary { + type Raw = WorkBaseSummary.Raw; +} diff --git a/src/serialization/types/OrgBase.ts b/src/serialization/types/OrgBase.ts new file mode 100644 index 0000000..edb3e7e --- /dev/null +++ b/src/serialization/types/OrgBase.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBase } from "./AtomBase"; + +export const OrgBase: core.serialization.ObjectSchema = core.serialization + .object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + }) + .extend(AtomBase); + +export declare namespace OrgBase { + interface Raw extends AtomBase.Raw { + display_name?: string | null; + } +} diff --git a/src/serialization/types/OrgBaseSummary.ts b/src/serialization/types/OrgBaseSummary.ts new file mode 100644 index 0000000..eb78452 --- /dev/null +++ b/src/serialization/types/OrgBaseSummary.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const OrgBaseSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + }) + .extend(AtomBaseSummary); + +export declare namespace OrgBaseSummary { + interface Raw extends AtomBaseSummary.Raw { + display_name?: string | null; + } +} diff --git a/src/serialization/types/OrgEnvironment.ts b/src/serialization/types/OrgEnvironment.ts new file mode 100644 index 0000000..0236ea3 --- /dev/null +++ b/src/serialization/types/OrgEnvironment.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OrgEnvironment: core.serialization.Schema = + core.serialization.enum_(["production", "staging", "test"]); + +export declare namespace OrgEnvironment { + type Raw = "production" | "staging" | "test"; +} diff --git a/src/serialization/types/OrgSchedule.ts b/src/serialization/types/OrgSchedule.ts new file mode 100644 index 0000000..431d17e --- /dev/null +++ b/src/serialization/types/OrgSchedule.ts @@ -0,0 +1,47 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WeeklyOrgSchedule } from "./WeeklyOrgSchedule"; +import { OrgScheduleFragmentOverview } from "./OrgScheduleFragmentOverview"; +import { OrgScheduleStatus } from "./OrgScheduleStatus"; +import { AtomBase } from "./AtomBase"; + +export const OrgSchedule: core.serialization.ObjectSchema = + core.serialization + .object({ + defaultWeeklyOrgSchedule: core.serialization.property( + "default_weekly_org_schedule", + WeeklyOrgSchedule.optional() + ), + minValidDays: core.serialization.property("min_valid_days", core.serialization.number().optional()), + name: core.serialization.string().optional(), + orgScheduleFragments: core.serialization.property( + "org_schedule_fragments", + core.serialization.list(OrgScheduleFragmentOverview).optional() + ), + status: OrgScheduleStatus, + timezone: core.serialization.string().optional(), + validUntil: core.serialization.property("valid_until", core.serialization.date().optional()), + weeklyOrgSchedules: core.serialization.property( + "weekly_org_schedules", + core.serialization.list(WeeklyOrgSchedule).optional() + ), + }) + .extend(AtomBase); + +export declare namespace OrgSchedule { + interface Raw extends AtomBase.Raw { + default_weekly_org_schedule?: WeeklyOrgSchedule.Raw | null; + min_valid_days?: number | null; + name?: string | null; + org_schedule_fragments?: OrgScheduleFragmentOverview.Raw[] | null; + status: OrgScheduleStatus.Raw; + timezone?: string | null; + valid_until?: string | null; + weekly_org_schedules?: WeeklyOrgSchedule.Raw[] | null; + } +} diff --git a/src/serialization/types/OrgScheduleFragment.ts b/src/serialization/types/OrgScheduleFragment.ts new file mode 100644 index 0000000..f9cc9d2 --- /dev/null +++ b/src/serialization/types/OrgScheduleFragment.ts @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgScheduleInterval } from "./OrgScheduleInterval"; +import { OrgScheduleFragmentStatus } from "./OrgScheduleFragmentStatus"; +import { AtomBase } from "./AtomBase"; + +export const OrgScheduleFragment: core.serialization.ObjectSchema< + serializers.OrgScheduleFragment.Raw, + DevRev.OrgScheduleFragment +> = core.serialization + .object({ + from: core.serialization.date().optional(), + intervals: core.serialization.list(OrgScheduleInterval).optional(), + name: core.serialization.string().optional(), + regionCodes: core.serialization.property( + "region_codes", + core.serialization.list(core.serialization.string()).optional() + ), + status: OrgScheduleFragmentStatus, + to: core.serialization.date().optional(), + }) + .extend(AtomBase); + +export declare namespace OrgScheduleFragment { + interface Raw extends AtomBase.Raw { + from?: string | null; + intervals?: OrgScheduleInterval.Raw[] | null; + name?: string | null; + region_codes?: string[] | null; + status: OrgScheduleFragmentStatus.Raw; + to?: string | null; + } +} diff --git a/src/serialization/types/OrgScheduleFragmentOverview.ts b/src/serialization/types/OrgScheduleFragmentOverview.ts new file mode 100644 index 0000000..5ed524b --- /dev/null +++ b/src/serialization/types/OrgScheduleFragmentOverview.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OrgScheduleFragmentOverview: core.serialization.Schema< + serializers.OrgScheduleFragmentOverview.Raw, + DevRev.OrgScheduleFragmentOverview +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace OrgScheduleFragmentOverview { + type Raw = Record; +} diff --git a/src/serialization/types/OrgScheduleFragmentStatus.ts b/src/serialization/types/OrgScheduleFragmentStatus.ts new file mode 100644 index 0000000..b9531fb --- /dev/null +++ b/src/serialization/types/OrgScheduleFragmentStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OrgScheduleFragmentStatus: core.serialization.Schema< + serializers.OrgScheduleFragmentStatus.Raw, + DevRev.OrgScheduleFragmentStatus +> = core.serialization.enum_(["archived", "draft", "published"]); + +export declare namespace OrgScheduleFragmentStatus { + type Raw = "archived" | "draft" | "published"; +} diff --git a/src/serialization/types/OrgScheduleFragmentsCreateResponse.ts b/src/serialization/types/OrgScheduleFragmentsCreateResponse.ts new file mode 100644 index 0000000..063a8c3 --- /dev/null +++ b/src/serialization/types/OrgScheduleFragmentsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgScheduleFragment } from "./OrgScheduleFragment"; + +export const OrgScheduleFragmentsCreateResponse: core.serialization.ObjectSchema< + serializers.OrgScheduleFragmentsCreateResponse.Raw, + DevRev.OrgScheduleFragmentsCreateResponse +> = core.serialization.object({ + orgScheduleFragment: core.serialization.property("org_schedule_fragment", OrgScheduleFragment), +}); + +export declare namespace OrgScheduleFragmentsCreateResponse { + interface Raw { + org_schedule_fragment: OrgScheduleFragment.Raw; + } +} diff --git a/src/serialization/types/OrgScheduleFragmentsGetResponse.ts b/src/serialization/types/OrgScheduleFragmentsGetResponse.ts new file mode 100644 index 0000000..eae99ca --- /dev/null +++ b/src/serialization/types/OrgScheduleFragmentsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgScheduleFragment } from "./OrgScheduleFragment"; + +export const OrgScheduleFragmentsGetResponse: core.serialization.ObjectSchema< + serializers.OrgScheduleFragmentsGetResponse.Raw, + DevRev.OrgScheduleFragmentsGetResponse +> = core.serialization.object({ + orgScheduleFragment: core.serialization.property("org_schedule_fragment", OrgScheduleFragment), +}); + +export declare namespace OrgScheduleFragmentsGetResponse { + interface Raw { + org_schedule_fragment: OrgScheduleFragment.Raw; + } +} diff --git a/src/serialization/types/OrgScheduleFragmentsTransitionResponse.ts b/src/serialization/types/OrgScheduleFragmentsTransitionResponse.ts new file mode 100644 index 0000000..065d733 --- /dev/null +++ b/src/serialization/types/OrgScheduleFragmentsTransitionResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgScheduleFragment } from "./OrgScheduleFragment"; + +export const OrgScheduleFragmentsTransitionResponse: core.serialization.ObjectSchema< + serializers.OrgScheduleFragmentsTransitionResponse.Raw, + DevRev.OrgScheduleFragmentsTransitionResponse +> = core.serialization.object({ + orgScheduleFragment: core.serialization.property("org_schedule_fragment", OrgScheduleFragment), +}); + +export declare namespace OrgScheduleFragmentsTransitionResponse { + interface Raw { + org_schedule_fragment: OrgScheduleFragment.Raw; + } +} diff --git a/src/serialization/types/OrgScheduleInterval.ts b/src/serialization/types/OrgScheduleInterval.ts new file mode 100644 index 0000000..f4a4ec9 --- /dev/null +++ b/src/serialization/types/OrgScheduleInterval.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OrgScheduleInterval: core.serialization.Schema< + serializers.OrgScheduleInterval.Raw, + DevRev.OrgScheduleInterval +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace OrgScheduleInterval { + type Raw = Record; +} diff --git a/src/serialization/types/OrgScheduleStatus.ts b/src/serialization/types/OrgScheduleStatus.ts new file mode 100644 index 0000000..dbbed3c --- /dev/null +++ b/src/serialization/types/OrgScheduleStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OrgScheduleStatus: core.serialization.Schema = + core.serialization.enum_(["archived", "draft", "published"]); + +export declare namespace OrgScheduleStatus { + type Raw = "archived" | "draft" | "published"; +} diff --git a/src/serialization/types/OrgScheduleSummary.ts b/src/serialization/types/OrgScheduleSummary.ts new file mode 100644 index 0000000..0312844 --- /dev/null +++ b/src/serialization/types/OrgScheduleSummary.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgScheduleStatus } from "./OrgScheduleStatus"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const OrgScheduleSummary: core.serialization.ObjectSchema< + serializers.OrgScheduleSummary.Raw, + DevRev.OrgScheduleSummary +> = core.serialization + .object({ + name: core.serialization.string().optional(), + status: OrgScheduleStatus, + timezone: core.serialization.string().optional(), + validUntil: core.serialization.property("valid_until", core.serialization.date().optional()), + }) + .extend(AtomBaseSummary); + +export declare namespace OrgScheduleSummary { + interface Raw extends AtomBaseSummary.Raw { + name?: string | null; + status: OrgScheduleStatus.Raw; + timezone?: string | null; + valid_until?: string | null; + } +} diff --git a/src/serialization/types/OrgSchedulesCreateResponse.ts b/src/serialization/types/OrgSchedulesCreateResponse.ts new file mode 100644 index 0000000..0ea5685 --- /dev/null +++ b/src/serialization/types/OrgSchedulesCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSchedule } from "./OrgSchedule"; + +export const OrgSchedulesCreateResponse: core.serialization.ObjectSchema< + serializers.OrgSchedulesCreateResponse.Raw, + DevRev.OrgSchedulesCreateResponse +> = core.serialization.object({ + orgSchedule: core.serialization.property("org_schedule", OrgSchedule), +}); + +export declare namespace OrgSchedulesCreateResponse { + interface Raw { + org_schedule: OrgSchedule.Raw; + } +} diff --git a/src/serialization/types/OrgSchedulesGetResponse.ts b/src/serialization/types/OrgSchedulesGetResponse.ts new file mode 100644 index 0000000..73fa250 --- /dev/null +++ b/src/serialization/types/OrgSchedulesGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSchedule } from "./OrgSchedule"; + +export const OrgSchedulesGetResponse: core.serialization.ObjectSchema< + serializers.OrgSchedulesGetResponse.Raw, + DevRev.OrgSchedulesGetResponse +> = core.serialization.object({ + orgSchedule: core.serialization.property("org_schedule", OrgSchedule), +}); + +export declare namespace OrgSchedulesGetResponse { + interface Raw { + org_schedule: OrgSchedule.Raw; + } +} diff --git a/src/serialization/types/OrgSchedulesListResponse.ts b/src/serialization/types/OrgSchedulesListResponse.ts new file mode 100644 index 0000000..c8b6234 --- /dev/null +++ b/src/serialization/types/OrgSchedulesListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSchedule } from "./OrgSchedule"; + +export const OrgSchedulesListResponse: core.serialization.ObjectSchema< + serializers.OrgSchedulesListResponse.Raw, + DevRev.OrgSchedulesListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + orgSchedules: core.serialization.property("org_schedules", core.serialization.list(OrgSchedule)), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace OrgSchedulesListResponse { + interface Raw { + next_cursor?: string | null; + org_schedules: OrgSchedule.Raw[]; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/OrgSchedulesSetFutureResponse.ts b/src/serialization/types/OrgSchedulesSetFutureResponse.ts new file mode 100644 index 0000000..8c55ad9 --- /dev/null +++ b/src/serialization/types/OrgSchedulesSetFutureResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSchedule } from "./OrgSchedule"; + +export const OrgSchedulesSetFutureResponse: core.serialization.ObjectSchema< + serializers.OrgSchedulesSetFutureResponse.Raw, + DevRev.OrgSchedulesSetFutureResponse +> = core.serialization.object({ + orgSchedule: core.serialization.property("org_schedule", OrgSchedule), +}); + +export declare namespace OrgSchedulesSetFutureResponse { + interface Raw { + org_schedule: OrgSchedule.Raw; + } +} diff --git a/src/serialization/types/OrgSchedulesTransitionResponse.ts b/src/serialization/types/OrgSchedulesTransitionResponse.ts new file mode 100644 index 0000000..6951682 --- /dev/null +++ b/src/serialization/types/OrgSchedulesTransitionResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSchedule } from "./OrgSchedule"; + +export const OrgSchedulesTransitionResponse: core.serialization.ObjectSchema< + serializers.OrgSchedulesTransitionResponse.Raw, + DevRev.OrgSchedulesTransitionResponse +> = core.serialization.object({ + orgSchedule: core.serialization.property("org_schedule", OrgSchedule), +}); + +export declare namespace OrgSchedulesTransitionResponse { + interface Raw { + org_schedule: OrgSchedule.Raw; + } +} diff --git a/src/serialization/types/OrgSchedulesUpdateResponse.ts b/src/serialization/types/OrgSchedulesUpdateResponse.ts new file mode 100644 index 0000000..e5ac01c --- /dev/null +++ b/src/serialization/types/OrgSchedulesUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSchedule } from "./OrgSchedule"; + +export const OrgSchedulesUpdateResponse: core.serialization.ObjectSchema< + serializers.OrgSchedulesUpdateResponse.Raw, + DevRev.OrgSchedulesUpdateResponse +> = core.serialization.object({ + orgSchedule: core.serialization.property("org_schedule", OrgSchedule), +}); + +export declare namespace OrgSchedulesUpdateResponse { + interface Raw { + org_schedule: OrgSchedule.Raw; + } +} diff --git a/src/serialization/types/OrgSearchSummary.ts b/src/serialization/types/OrgSearchSummary.ts new file mode 100644 index 0000000..074f2a2 --- /dev/null +++ b/src/serialization/types/OrgSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSummary } from "./OrgSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const OrgSearchSummary: core.serialization.ObjectSchema< + serializers.OrgSearchSummary.Raw, + DevRev.OrgSearchSummary +> = core.serialization + .object({ + org: OrgSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace OrgSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + org: OrgSummary.Raw; + } +} diff --git a/src/serialization/types/OrgSummary.ts b/src/serialization/types/OrgSummary.ts new file mode 100644 index 0000000..42aad42 --- /dev/null +++ b/src/serialization/types/OrgSummary.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgBaseSummary } from "./OrgBaseSummary"; + +export const OrgSummary: core.serialization.Schema = core.serialization + .union("type", { + account: OrgBaseSummary, + rev_org: OrgBaseSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace OrgSummary { + type Raw = OrgSummary.Account | OrgSummary.RevOrg; + + interface Account extends OrgBaseSummary.Raw { + type: "account"; + } + + interface RevOrg extends OrgBaseSummary.Raw { + type: "rev_org"; + } +} diff --git a/src/serialization/types/OrgType.ts b/src/serialization/types/OrgType.ts new file mode 100644 index 0000000..b5db3e1 --- /dev/null +++ b/src/serialization/types/OrgType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const OrgType: core.serialization.Schema = core.serialization.enum_([ + "account", + "rev_org", +]); + +export declare namespace OrgType { + type Raw = "account" | "rev_org"; +} diff --git a/src/serialization/types/ParentPartFilter.ts b/src/serialization/types/ParentPartFilter.ts new file mode 100644 index 0000000..d448334 --- /dev/null +++ b/src/serialization/types/ParentPartFilter.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const ParentPartFilter: core.serialization.ObjectSchema< + serializers.ParentPartFilter.Raw, + DevRev.ParentPartFilter +> = core.serialization.object({ + level: core.serialization.number().optional(), + parts: core.serialization.list(core.serialization.string()), +}); + +export declare namespace ParentPartFilter { + interface Raw { + level?: number | null; + parts: string[]; + } +} diff --git a/src/serialization/types/Part.ts b/src/serialization/types/Part.ts new file mode 100644 index 0000000..4954d47 --- /dev/null +++ b/src/serialization/types/Part.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBase } from "./PartBase"; + +export const Part: core.serialization.Schema = core.serialization + .union("type", { + capability: PartBase, + enhancement: PartBase, + feature: PartBase, + product: PartBase, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace Part { + type Raw = Part.Capability | Part.Enhancement | Part.Feature | Part.Product; + + interface Capability extends PartBase.Raw { + type: "capability"; + } + + interface Enhancement extends PartBase.Raw { + type: "enhancement"; + } + + interface Feature extends PartBase.Raw { + type: "feature"; + } + + interface Product extends PartBase.Raw { + type: "product"; + } +} diff --git a/src/serialization/types/PartBase.ts b/src/serialization/types/PartBase.ts new file mode 100644 index 0000000..4bc173e --- /dev/null +++ b/src/serialization/types/PartBase.ts @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { UserSummary } from "./UserSummary"; +import { TagWithValue } from "./TagWithValue"; +import { AtomBase } from "./AtomBase"; + +export const PartBase: core.serialization.ObjectSchema = core.serialization + .object({ + artifacts: core.serialization.list(ArtifactSummary).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + name: core.serialization.string(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(UserSummary)), + stockSchemaFragment: core.serialization.property( + "stock_schema_fragment", + core.serialization.string().optional() + ), + subtype: core.serialization.string().optional(), + tags: core.serialization.list(TagWithValue).optional(), + }) + .extend(AtomBase); + +export declare namespace PartBase { + interface Raw extends AtomBase.Raw { + artifacts?: ArtifactSummary.Raw[] | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + name: string; + owned_by: UserSummary.Raw[]; + stock_schema_fragment?: string | null; + subtype?: string | null; + tags?: TagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/PartBaseSummary.ts b/src/serialization/types/PartBaseSummary.ts new file mode 100644 index 0000000..40a648a --- /dev/null +++ b/src/serialization/types/PartBaseSummary.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const PartBaseSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + name: core.serialization.string(), + }) + .extend(AtomBaseSummary); + +export declare namespace PartBaseSummary { + interface Raw extends AtomBaseSummary.Raw { + name: string; + } +} diff --git a/src/serialization/types/PartSearchSummary.ts b/src/serialization/types/PartSearchSummary.ts new file mode 100644 index 0000000..2e79a0e --- /dev/null +++ b/src/serialization/types/PartSearchSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CommentSearchSummary } from "./CommentSearchSummary"; +import { PartSummary } from "./PartSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const PartSearchSummary: core.serialization.ObjectSchema< + serializers.PartSearchSummary.Raw, + DevRev.PartSearchSummary +> = core.serialization + .object({ + comments: core.serialization.list(CommentSearchSummary).optional(), + part: PartSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace PartSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + comments?: CommentSearchSummary.Raw[] | null; + part: PartSummary.Raw; + } +} diff --git a/src/serialization/types/PartSummary.ts b/src/serialization/types/PartSummary.ts new file mode 100644 index 0000000..edc3abe --- /dev/null +++ b/src/serialization/types/PartSummary.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBaseSummary } from "./PartBaseSummary"; + +export const PartSummary: core.serialization.Schema = + core.serialization + .union("type", { + capability: PartBaseSummary, + enhancement: PartBaseSummary, + feature: PartBaseSummary, + product: PartBaseSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace PartSummary { + type Raw = PartSummary.Capability | PartSummary.Enhancement | PartSummary.Feature | PartSummary.Product; + + interface Capability extends PartBaseSummary.Raw { + type: "capability"; + } + + interface Enhancement extends PartBaseSummary.Raw { + type: "enhancement"; + } + + interface Feature extends PartBaseSummary.Raw { + type: "feature"; + } + + interface Product extends PartBaseSummary.Raw { + type: "product"; + } +} diff --git a/src/serialization/types/PartType.ts b/src/serialization/types/PartType.ts new file mode 100644 index 0000000..0fa2d43 --- /dev/null +++ b/src/serialization/types/PartType.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartType: core.serialization.Schema = core.serialization.enum_([ + "capability", + "enhancement", + "feature", + "product", +]); + +export declare namespace PartType { + type Raw = "capability" | "enhancement" | "feature" | "product"; +} diff --git a/src/serialization/types/PartsCreateRequest.ts b/src/serialization/types/PartsCreateRequest.ts new file mode 100644 index 0000000..3c358dd --- /dev/null +++ b/src/serialization/types/PartsCreateRequest.ts @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { PartsCreateRequestCapability } from "./PartsCreateRequestCapability"; +import { PartsCreateRequestEnhancement } from "./PartsCreateRequestEnhancement"; +import { PartsCreateRequestFeature } from "./PartsCreateRequestFeature"; +import { PartsCreateRequestProduct } from "./PartsCreateRequestProduct"; + +const _Base = core.serialization.object({ + artifacts: core.serialization.list(core.serialization.string()).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + name: core.serialization.string(), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string())), +}); +export const PartsCreateRequest: core.serialization.Schema< + serializers.PartsCreateRequest.Raw, + DevRev.PartsCreateRequest +> = core.serialization + .union("type", { + capability: PartsCreateRequestCapability.extend(_Base), + enhancement: PartsCreateRequestEnhancement.extend(_Base), + feature: PartsCreateRequestFeature.extend(_Base), + product: core.serialization + .object({ + value: PartsCreateRequestProduct, + }) + .extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace PartsCreateRequest { + type Raw = + | PartsCreateRequest.Capability + | PartsCreateRequest.Enhancement + | PartsCreateRequest.Feature + | PartsCreateRequest.Product; + + interface Capability extends _Base, PartsCreateRequestCapability.Raw { + type: "capability"; + } + + interface Enhancement extends _Base, PartsCreateRequestEnhancement.Raw { + type: "enhancement"; + } + + interface Feature extends _Base, PartsCreateRequestFeature.Raw { + type: "feature"; + } + + interface Product extends _Base { + type: "product"; + value: PartsCreateRequestProduct.Raw; + } + + interface _Base { + artifacts?: string[] | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + name: string; + owned_by: string[]; + } +} diff --git a/src/serialization/types/PartsCreateRequestCapability.ts b/src/serialization/types/PartsCreateRequestCapability.ts new file mode 100644 index 0000000..f0a8d82 --- /dev/null +++ b/src/serialization/types/PartsCreateRequestCapability.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsCreateRequestCapability: core.serialization.ObjectSchema< + serializers.PartsCreateRequestCapability.Raw, + DevRev.PartsCreateRequestCapability +> = core.serialization.object({ + parentPart: core.serialization.property("parent_part", core.serialization.list(core.serialization.string())), +}); + +export declare namespace PartsCreateRequestCapability { + interface Raw { + parent_part: string[]; + } +} diff --git a/src/serialization/types/PartsCreateRequestEnhancement.ts b/src/serialization/types/PartsCreateRequestEnhancement.ts new file mode 100644 index 0000000..10fd637 --- /dev/null +++ b/src/serialization/types/PartsCreateRequestEnhancement.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsCreateRequestEnhancement: core.serialization.ObjectSchema< + serializers.PartsCreateRequestEnhancement.Raw, + DevRev.PartsCreateRequestEnhancement +> = core.serialization.object({ + parentPart: core.serialization.property("parent_part", core.serialization.list(core.serialization.string())), + targetCloseDate: core.serialization.property("target_close_date", core.serialization.date().optional()), + targetStartDate: core.serialization.property("target_start_date", core.serialization.date().optional()), +}); + +export declare namespace PartsCreateRequestEnhancement { + interface Raw { + parent_part: string[]; + target_close_date?: string | null; + target_start_date?: string | null; + } +} diff --git a/src/serialization/types/PartsCreateRequestFeature.ts b/src/serialization/types/PartsCreateRequestFeature.ts new file mode 100644 index 0000000..e3d38b5 --- /dev/null +++ b/src/serialization/types/PartsCreateRequestFeature.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsCreateRequestFeature: core.serialization.ObjectSchema< + serializers.PartsCreateRequestFeature.Raw, + DevRev.PartsCreateRequestFeature +> = core.serialization.object({ + parentPart: core.serialization.property("parent_part", core.serialization.list(core.serialization.string())), +}); + +export declare namespace PartsCreateRequestFeature { + interface Raw { + parent_part: string[]; + } +} diff --git a/src/serialization/types/PartsCreateRequestProduct.ts b/src/serialization/types/PartsCreateRequestProduct.ts new file mode 100644 index 0000000..2bd4cca --- /dev/null +++ b/src/serialization/types/PartsCreateRequestProduct.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsCreateRequestProduct: core.serialization.Schema< + serializers.PartsCreateRequestProduct.Raw, + DevRev.PartsCreateRequestProduct +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace PartsCreateRequestProduct { + type Raw = Record; +} diff --git a/src/serialization/types/PartsCreateResponse.ts b/src/serialization/types/PartsCreateResponse.ts new file mode 100644 index 0000000..e4512b0 --- /dev/null +++ b/src/serialization/types/PartsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Part } from "./Part"; + +export const PartsCreateResponse: core.serialization.ObjectSchema< + serializers.PartsCreateResponse.Raw, + DevRev.PartsCreateResponse +> = core.serialization.object({ + part: Part, +}); + +export declare namespace PartsCreateResponse { + interface Raw { + part: Part.Raw; + } +} diff --git a/src/serialization/types/PartsDeleteResponse.ts b/src/serialization/types/PartsDeleteResponse.ts new file mode 100644 index 0000000..6bdbb80 --- /dev/null +++ b/src/serialization/types/PartsDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsDeleteResponse: core.serialization.Schema< + serializers.PartsDeleteResponse.Raw, + DevRev.PartsDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace PartsDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/PartsGetResponse.ts b/src/serialization/types/PartsGetResponse.ts new file mode 100644 index 0000000..316cc77 --- /dev/null +++ b/src/serialization/types/PartsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Part } from "./Part"; + +export const PartsGetResponse: core.serialization.ObjectSchema< + serializers.PartsGetResponse.Raw, + DevRev.PartsGetResponse +> = core.serialization.object({ + part: Part, +}); + +export declare namespace PartsGetResponse { + interface Raw { + part: Part.Raw; + } +} diff --git a/src/serialization/types/PartsListResponse.ts b/src/serialization/types/PartsListResponse.ts new file mode 100644 index 0000000..155409f --- /dev/null +++ b/src/serialization/types/PartsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Part } from "./Part"; + +export const PartsListResponse: core.serialization.ObjectSchema< + serializers.PartsListResponse.Raw, + DevRev.PartsListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + parts: core.serialization.list(Part), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), +}); + +export declare namespace PartsListResponse { + interface Raw { + next_cursor?: string | null; + parts: Part.Raw[]; + prev_cursor?: string | null; + } +} diff --git a/src/serialization/types/PartsUpdateRequest.ts b/src/serialization/types/PartsUpdateRequest.ts new file mode 100644 index 0000000..17b2a5b --- /dev/null +++ b/src/serialization/types/PartsUpdateRequest.ts @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { PartsUpdateRequestArtifacts } from "./PartsUpdateRequestArtifacts"; +import { PartsUpdateRequestOwnedBy } from "./PartsUpdateRequestOwnedBy"; +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { PartsUpdateRequestCapability } from "./PartsUpdateRequestCapability"; +import { PartsUpdateRequestEnhancement } from "./PartsUpdateRequestEnhancement"; +import { PartsUpdateRequestFeature } from "./PartsUpdateRequestFeature"; +import { Empty } from "./Empty"; +import { PartsUpdateRequestProduct } from "./PartsUpdateRequestProduct"; + +const _Base = core.serialization.object({ + artifacts: PartsUpdateRequestArtifacts.optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + id: core.serialization.string(), + name: core.serialization.string().optional(), + ownedBy: core.serialization.property("owned_by", PartsUpdateRequestOwnedBy.optional()), +}); +export const PartsUpdateRequest: core.serialization.Schema< + serializers.PartsUpdateRequest.Raw, + DevRev.PartsUpdateRequest +> = core.serialization + .union("type", { + capability: core.serialization + .object({ + value: PartsUpdateRequestCapability, + }) + .extend(_Base), + enhancement: PartsUpdateRequestEnhancement.extend(_Base), + feature: core.serialization + .object({ + value: PartsUpdateRequestFeature, + }) + .extend(_Base), + none: core.serialization + .object({ + value: Empty, + }) + .extend(_Base), + product: core.serialization + .object({ + value: PartsUpdateRequestProduct, + }) + .extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace PartsUpdateRequest { + type Raw = + | PartsUpdateRequest.Capability + | PartsUpdateRequest.Enhancement + | PartsUpdateRequest.Feature + | PartsUpdateRequest.None + | PartsUpdateRequest.Product; + + interface Capability extends _Base { + type: "capability"; + value: PartsUpdateRequestCapability.Raw; + } + + interface Enhancement extends _Base, PartsUpdateRequestEnhancement.Raw { + type: "enhancement"; + } + + interface Feature extends _Base { + type: "feature"; + value: PartsUpdateRequestFeature.Raw; + } + + interface None extends _Base { + type: "none"; + value: Empty.Raw; + } + + interface Product extends _Base { + type: "product"; + value: PartsUpdateRequestProduct.Raw; + } + + interface _Base { + artifacts?: PartsUpdateRequestArtifacts.Raw | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + id: string; + name?: string | null; + owned_by?: PartsUpdateRequestOwnedBy.Raw | null; + } +} diff --git a/src/serialization/types/PartsUpdateRequestArtifacts.ts b/src/serialization/types/PartsUpdateRequestArtifacts.ts new file mode 100644 index 0000000..cbe8ec3 --- /dev/null +++ b/src/serialization/types/PartsUpdateRequestArtifacts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsUpdateRequestArtifacts: core.serialization.ObjectSchema< + serializers.PartsUpdateRequestArtifacts.Raw, + DevRev.PartsUpdateRequestArtifacts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace PartsUpdateRequestArtifacts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/PartsUpdateRequestCapability.ts b/src/serialization/types/PartsUpdateRequestCapability.ts new file mode 100644 index 0000000..9548024 --- /dev/null +++ b/src/serialization/types/PartsUpdateRequestCapability.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsUpdateRequestCapability: core.serialization.Schema< + serializers.PartsUpdateRequestCapability.Raw, + DevRev.PartsUpdateRequestCapability +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace PartsUpdateRequestCapability { + type Raw = Record; +} diff --git a/src/serialization/types/PartsUpdateRequestEnhancement.ts b/src/serialization/types/PartsUpdateRequestEnhancement.ts new file mode 100644 index 0000000..e796e8b --- /dev/null +++ b/src/serialization/types/PartsUpdateRequestEnhancement.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsUpdateRequestEnhancement: core.serialization.ObjectSchema< + serializers.PartsUpdateRequestEnhancement.Raw, + DevRev.PartsUpdateRequestEnhancement +> = core.serialization.object({ + targetCloseDate: core.serialization.property("target_close_date", core.serialization.date().optional()), + targetStartDate: core.serialization.property("target_start_date", core.serialization.date().optional()), +}); + +export declare namespace PartsUpdateRequestEnhancement { + interface Raw { + target_close_date?: string | null; + target_start_date?: string | null; + } +} diff --git a/src/serialization/types/PartsUpdateRequestFeature.ts b/src/serialization/types/PartsUpdateRequestFeature.ts new file mode 100644 index 0000000..b316bf8 --- /dev/null +++ b/src/serialization/types/PartsUpdateRequestFeature.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsUpdateRequestFeature: core.serialization.Schema< + serializers.PartsUpdateRequestFeature.Raw, + DevRev.PartsUpdateRequestFeature +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace PartsUpdateRequestFeature { + type Raw = Record; +} diff --git a/src/serialization/types/PartsUpdateRequestOwnedBy.ts b/src/serialization/types/PartsUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..0249a8d --- /dev/null +++ b/src/serialization/types/PartsUpdateRequestOwnedBy.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsUpdateRequestOwnedBy: core.serialization.ObjectSchema< + serializers.PartsUpdateRequestOwnedBy.Raw, + DevRev.PartsUpdateRequestOwnedBy +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace PartsUpdateRequestOwnedBy { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/PartsUpdateRequestProduct.ts b/src/serialization/types/PartsUpdateRequestProduct.ts new file mode 100644 index 0000000..afb8ba3 --- /dev/null +++ b/src/serialization/types/PartsUpdateRequestProduct.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const PartsUpdateRequestProduct: core.serialization.Schema< + serializers.PartsUpdateRequestProduct.Raw, + DevRev.PartsUpdateRequestProduct +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace PartsUpdateRequestProduct { + type Raw = Record; +} diff --git a/src/serialization/types/PartsUpdateResponse.ts b/src/serialization/types/PartsUpdateResponse.ts new file mode 100644 index 0000000..89b64b5 --- /dev/null +++ b/src/serialization/types/PartsUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Part } from "./Part"; + +export const PartsUpdateResponse: core.serialization.ObjectSchema< + serializers.PartsUpdateResponse.Raw, + DevRev.PartsUpdateResponse +> = core.serialization.object({ + part: Part, +}); + +export declare namespace PartsUpdateResponse { + interface Raw { + part: Part.Raw; + } +} diff --git a/src/serialization/types/Product.ts b/src/serialization/types/Product.ts new file mode 100644 index 0000000..14407ca --- /dev/null +++ b/src/serialization/types/Product.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBase } from "./PartBase"; + +export const Product: core.serialization.ObjectSchema = PartBase; + +export declare namespace Product { + type Raw = PartBase.Raw; +} diff --git a/src/serialization/types/ProductSummary.ts b/src/serialization/types/ProductSummary.ts new file mode 100644 index 0000000..c08353c --- /dev/null +++ b/src/serialization/types/ProductSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartBaseSummary } from "./PartBaseSummary"; + +export const ProductSummary: core.serialization.ObjectSchema = + PartBaseSummary; + +export declare namespace ProductSummary { + type Raw = PartBaseSummary.Raw; +} diff --git a/src/serialization/types/QuestionAnswer.ts b/src/serialization/types/QuestionAnswer.ts new file mode 100644 index 0000000..a90bed1 --- /dev/null +++ b/src/serialization/types/QuestionAnswer.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBase } from "./AtomBase"; + +export const QuestionAnswer: core.serialization.ObjectSchema = + core.serialization + .object({ + answer: core.serialization.string().optional(), + question: core.serialization.string().optional(), + suggestedAnswer: core.serialization.property("suggested_answer", core.serialization.string().optional()), + suggestedForDeletion: core.serialization.property( + "suggested_for_deletion", + core.serialization.boolean().optional() + ), + topic: core.serialization.string().optional(), + verified: core.serialization.boolean().optional(), + }) + .extend(AtomBase); + +export declare namespace QuestionAnswer { + interface Raw extends AtomBase.Raw { + answer?: string | null; + question?: string | null; + suggested_answer?: string | null; + suggested_for_deletion?: boolean | null; + topic?: string | null; + verified?: boolean | null; + } +} diff --git a/src/serialization/types/QuestionAnswerSearchSummary.ts b/src/serialization/types/QuestionAnswerSearchSummary.ts new file mode 100644 index 0000000..b68b8b7 --- /dev/null +++ b/src/serialization/types/QuestionAnswerSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { QuestionAnswerSummary } from "./QuestionAnswerSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const QuestionAnswerSearchSummary: core.serialization.ObjectSchema< + serializers.QuestionAnswerSearchSummary.Raw, + DevRev.QuestionAnswerSearchSummary +> = core.serialization + .object({ + questionAnswer: core.serialization.property("question_answer", QuestionAnswerSummary), + }) + .extend(SearchSummaryBase); + +export declare namespace QuestionAnswerSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + question_answer: QuestionAnswerSummary.Raw; + } +} diff --git a/src/serialization/types/QuestionAnswerStatus.ts b/src/serialization/types/QuestionAnswerStatus.ts new file mode 100644 index 0000000..89a0733 --- /dev/null +++ b/src/serialization/types/QuestionAnswerStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const QuestionAnswerStatus: core.serialization.Schema< + serializers.QuestionAnswerStatus.Raw, + DevRev.QuestionAnswerStatus +> = core.serialization.enum_(["archived", "discarded", "draft", "published", "review_needed"]); + +export declare namespace QuestionAnswerStatus { + type Raw = "archived" | "discarded" | "draft" | "published" | "review_needed"; +} diff --git a/src/serialization/types/QuestionAnswerSummary.ts b/src/serialization/types/QuestionAnswerSummary.ts new file mode 100644 index 0000000..f8a5f09 --- /dev/null +++ b/src/serialization/types/QuestionAnswerSummary.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const QuestionAnswerSummary: core.serialization.ObjectSchema< + serializers.QuestionAnswerSummary.Raw, + DevRev.QuestionAnswerSummary +> = core.serialization + .object({ + question: core.serialization.string().optional(), + }) + .extend(AtomBaseSummary); + +export declare namespace QuestionAnswerSummary { + interface Raw extends AtomBaseSummary.Raw { + question?: string | null; + } +} diff --git a/src/serialization/types/QuestionAnswersCreateResponse.ts b/src/serialization/types/QuestionAnswersCreateResponse.ts new file mode 100644 index 0000000..d94c239 --- /dev/null +++ b/src/serialization/types/QuestionAnswersCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { QuestionAnswer } from "./QuestionAnswer"; + +export const QuestionAnswersCreateResponse: core.serialization.ObjectSchema< + serializers.QuestionAnswersCreateResponse.Raw, + DevRev.QuestionAnswersCreateResponse +> = core.serialization.object({ + questionAnswer: core.serialization.property("question_answer", QuestionAnswer), +}); + +export declare namespace QuestionAnswersCreateResponse { + interface Raw { + question_answer: QuestionAnswer.Raw; + } +} diff --git a/src/serialization/types/QuestionAnswersGetResponse.ts b/src/serialization/types/QuestionAnswersGetResponse.ts new file mode 100644 index 0000000..7b682b8 --- /dev/null +++ b/src/serialization/types/QuestionAnswersGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { QuestionAnswer } from "./QuestionAnswer"; + +export const QuestionAnswersGetResponse: core.serialization.ObjectSchema< + serializers.QuestionAnswersGetResponse.Raw, + DevRev.QuestionAnswersGetResponse +> = core.serialization.object({ + questionAnswer: core.serialization.property("question_answer", QuestionAnswer), +}); + +export declare namespace QuestionAnswersGetResponse { + interface Raw { + question_answer: QuestionAnswer.Raw; + } +} diff --git a/src/serialization/types/QuestionAnswersListResponse.ts b/src/serialization/types/QuestionAnswersListResponse.ts new file mode 100644 index 0000000..b8d94d7 --- /dev/null +++ b/src/serialization/types/QuestionAnswersListResponse.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { QuestionAnswer } from "./QuestionAnswer"; + +export const QuestionAnswersListResponse: core.serialization.ObjectSchema< + serializers.QuestionAnswersListResponse.Raw, + DevRev.QuestionAnswersListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + questionAnswers: core.serialization.property("question_answers", core.serialization.list(QuestionAnswer)), + total: core.serialization.number(), +}); + +export declare namespace QuestionAnswersListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + question_answers: QuestionAnswer.Raw[]; + total: number; + } +} diff --git a/src/serialization/types/QuestionAnswersUpdateRequestAppliesToArticles.ts b/src/serialization/types/QuestionAnswersUpdateRequestAppliesToArticles.ts new file mode 100644 index 0000000..ec1d59b --- /dev/null +++ b/src/serialization/types/QuestionAnswersUpdateRequestAppliesToArticles.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const QuestionAnswersUpdateRequestAppliesToArticles: core.serialization.ObjectSchema< + serializers.QuestionAnswersUpdateRequestAppliesToArticles.Raw, + DevRev.QuestionAnswersUpdateRequestAppliesToArticles +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace QuestionAnswersUpdateRequestAppliesToArticles { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/QuestionAnswersUpdateRequestAppliesToParts.ts b/src/serialization/types/QuestionAnswersUpdateRequestAppliesToParts.ts new file mode 100644 index 0000000..a77d269 --- /dev/null +++ b/src/serialization/types/QuestionAnswersUpdateRequestAppliesToParts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const QuestionAnswersUpdateRequestAppliesToParts: core.serialization.ObjectSchema< + serializers.QuestionAnswersUpdateRequestAppliesToParts.Raw, + DevRev.QuestionAnswersUpdateRequestAppliesToParts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace QuestionAnswersUpdateRequestAppliesToParts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/QuestionAnswersUpdateRequestOwnedBy.ts b/src/serialization/types/QuestionAnswersUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..3313a8a --- /dev/null +++ b/src/serialization/types/QuestionAnswersUpdateRequestOwnedBy.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const QuestionAnswersUpdateRequestOwnedBy: core.serialization.ObjectSchema< + serializers.QuestionAnswersUpdateRequestOwnedBy.Raw, + DevRev.QuestionAnswersUpdateRequestOwnedBy +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace QuestionAnswersUpdateRequestOwnedBy { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/QuestionAnswersUpdateRequestSharedWith.ts b/src/serialization/types/QuestionAnswersUpdateRequestSharedWith.ts new file mode 100644 index 0000000..c095428 --- /dev/null +++ b/src/serialization/types/QuestionAnswersUpdateRequestSharedWith.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetSharedWithMembership } from "./SetSharedWithMembership"; + +export const QuestionAnswersUpdateRequestSharedWith: core.serialization.ObjectSchema< + serializers.QuestionAnswersUpdateRequestSharedWith.Raw, + DevRev.QuestionAnswersUpdateRequestSharedWith +> = core.serialization.object({ + set: core.serialization.list(SetSharedWithMembership).optional(), +}); + +export declare namespace QuestionAnswersUpdateRequestSharedWith { + interface Raw { + set?: SetSharedWithMembership.Raw[] | null; + } +} diff --git a/src/serialization/types/QuestionAnswersUpdateRequestSources.ts b/src/serialization/types/QuestionAnswersUpdateRequestSources.ts new file mode 100644 index 0000000..7ab04ba --- /dev/null +++ b/src/serialization/types/QuestionAnswersUpdateRequestSources.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const QuestionAnswersUpdateRequestSources: core.serialization.ObjectSchema< + serializers.QuestionAnswersUpdateRequestSources.Raw, + DevRev.QuestionAnswersUpdateRequestSources +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace QuestionAnswersUpdateRequestSources { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/QuestionAnswersUpdateRequestTags.ts b/src/serialization/types/QuestionAnswersUpdateRequestTags.ts new file mode 100644 index 0000000..be777ad --- /dev/null +++ b/src/serialization/types/QuestionAnswersUpdateRequestTags.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetTagWithValue } from "./SetTagWithValue"; + +export const QuestionAnswersUpdateRequestTags: core.serialization.ObjectSchema< + serializers.QuestionAnswersUpdateRequestTags.Raw, + DevRev.QuestionAnswersUpdateRequestTags +> = core.serialization.object({ + set: core.serialization.list(SetTagWithValue).optional(), +}); + +export declare namespace QuestionAnswersUpdateRequestTags { + interface Raw { + set?: SetTagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/QuestionAnswersUpdateResponse.ts b/src/serialization/types/QuestionAnswersUpdateResponse.ts new file mode 100644 index 0000000..9c0032e --- /dev/null +++ b/src/serialization/types/QuestionAnswersUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { QuestionAnswer } from "./QuestionAnswer"; + +export const QuestionAnswersUpdateResponse: core.serialization.ObjectSchema< + serializers.QuestionAnswersUpdateResponse.Raw, + DevRev.QuestionAnswersUpdateResponse +> = core.serialization.object({ + questionAnswer: core.serialization.property("question_answer", QuestionAnswer), +}); + +export declare namespace QuestionAnswersUpdateResponse { + interface Raw { + question_answer: QuestionAnswer.Raw; + } +} diff --git a/src/serialization/types/Resource.ts b/src/serialization/types/Resource.ts new file mode 100644 index 0000000..fc93fe8 --- /dev/null +++ b/src/serialization/types/Resource.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; + +export const Resource: core.serialization.ObjectSchema = + core.serialization.object({ + artifacts: core.serialization.list(ArtifactSummary).optional(), + url: core.serialization.string().optional(), + }); + +export declare namespace Resource { + interface Raw { + artifacts?: ArtifactSummary.Raw[] | null; + url?: string | null; + } +} diff --git a/src/serialization/types/ResourceSummary.ts b/src/serialization/types/ResourceSummary.ts new file mode 100644 index 0000000..e973a30 --- /dev/null +++ b/src/serialization/types/ResourceSummary.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; + +export const ResourceSummary: core.serialization.ObjectSchema = + core.serialization.object({ + artifacts: core.serialization.list(ArtifactSummary).optional(), + url: core.serialization.string().optional(), + }); + +export declare namespace ResourceSummary { + interface Raw { + artifacts?: ArtifactSummary.Raw[] | null; + url?: string | null; + } +} diff --git a/src/serialization/types/RevOrg.ts b/src/serialization/types/RevOrg.ts new file mode 100644 index 0000000..2ec0f56 --- /dev/null +++ b/src/serialization/types/RevOrg.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AccountSummary } from "./AccountSummary"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { TagWithValue } from "./TagWithValue"; +import { OrgBase } from "./OrgBase"; + +export const RevOrg: core.serialization.ObjectSchema = core.serialization + .object({ + account: AccountSummary.optional(), + artifacts: core.serialization.list(ArtifactSummary).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + domain: core.serialization.string().optional(), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + stockSchemaFragment: core.serialization.property( + "stock_schema_fragment", + core.serialization.string().optional() + ), + subtype: core.serialization.string().optional(), + tags: core.serialization.list(TagWithValue).optional(), + }) + .extend(OrgBase); + +export declare namespace RevOrg { + interface Raw extends OrgBase.Raw { + account?: AccountSummary.Raw | null; + artifacts?: ArtifactSummary.Raw[] | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + domain?: string | null; + external_ref?: string | null; + stock_schema_fragment?: string | null; + subtype?: string | null; + tags?: TagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/RevOrgSummary.ts b/src/serialization/types/RevOrgSummary.ts new file mode 100644 index 0000000..12ed0a8 --- /dev/null +++ b/src/serialization/types/RevOrgSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgBaseSummary } from "./OrgBaseSummary"; + +export const RevOrgSummary: core.serialization.ObjectSchema = + OrgBaseSummary; + +export declare namespace RevOrgSummary { + type Raw = OrgBaseSummary.Raw; +} diff --git a/src/serialization/types/RevOrgsCreateResponse.ts b/src/serialization/types/RevOrgsCreateResponse.ts new file mode 100644 index 0000000..33ea105 --- /dev/null +++ b/src/serialization/types/RevOrgsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevOrg } from "./RevOrg"; + +export const RevOrgsCreateResponse: core.serialization.ObjectSchema< + serializers.RevOrgsCreateResponse.Raw, + DevRev.RevOrgsCreateResponse +> = core.serialization.object({ + revOrg: core.serialization.property("rev_org", RevOrg), +}); + +export declare namespace RevOrgsCreateResponse { + interface Raw { + rev_org: RevOrg.Raw; + } +} diff --git a/src/serialization/types/RevOrgsGetResponse.ts b/src/serialization/types/RevOrgsGetResponse.ts new file mode 100644 index 0000000..0810d8b --- /dev/null +++ b/src/serialization/types/RevOrgsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevOrg } from "./RevOrg"; + +export const RevOrgsGetResponse: core.serialization.ObjectSchema< + serializers.RevOrgsGetResponse.Raw, + DevRev.RevOrgsGetResponse +> = core.serialization.object({ + revOrg: core.serialization.property("rev_org", RevOrg), +}); + +export declare namespace RevOrgsGetResponse { + interface Raw { + rev_org: RevOrg.Raw; + } +} diff --git a/src/serialization/types/RevOrgsListResponse.ts b/src/serialization/types/RevOrgsListResponse.ts new file mode 100644 index 0000000..57133f8 --- /dev/null +++ b/src/serialization/types/RevOrgsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevOrg } from "./RevOrg"; + +export const RevOrgsListResponse: core.serialization.ObjectSchema< + serializers.RevOrgsListResponse.Raw, + DevRev.RevOrgsListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + revOrgs: core.serialization.property("rev_orgs", core.serialization.list(RevOrg)), +}); + +export declare namespace RevOrgsListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + rev_orgs: RevOrg.Raw[]; + } +} diff --git a/src/serialization/types/RevOrgsUpdateRequestArtifacts.ts b/src/serialization/types/RevOrgsUpdateRequestArtifacts.ts new file mode 100644 index 0000000..8b1062d --- /dev/null +++ b/src/serialization/types/RevOrgsUpdateRequestArtifacts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const RevOrgsUpdateRequestArtifacts: core.serialization.ObjectSchema< + serializers.RevOrgsUpdateRequestArtifacts.Raw, + DevRev.RevOrgsUpdateRequestArtifacts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace RevOrgsUpdateRequestArtifacts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/RevOrgsUpdateResponse.ts b/src/serialization/types/RevOrgsUpdateResponse.ts new file mode 100644 index 0000000..e829682 --- /dev/null +++ b/src/serialization/types/RevOrgsUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevOrg } from "./RevOrg"; + +export const RevOrgsUpdateResponse: core.serialization.ObjectSchema< + serializers.RevOrgsUpdateResponse.Raw, + DevRev.RevOrgsUpdateResponse +> = core.serialization.object({ + revOrg: core.serialization.property("rev_org", RevOrg), +}); + +export declare namespace RevOrgsUpdateResponse { + interface Raw { + rev_org: RevOrg.Raw; + } +} diff --git a/src/serialization/types/RevUser.ts b/src/serialization/types/RevUser.ts new file mode 100644 index 0000000..d40fd72 --- /dev/null +++ b/src/serialization/types/RevUser.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { OrgSummary } from "./OrgSummary"; +import { TagWithValue } from "./TagWithValue"; +import { UserBase } from "./UserBase"; + +export const RevUser: core.serialization.ObjectSchema = core.serialization + .object({ + artifacts: core.serialization.list(ArtifactSummary).optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + isVerified: core.serialization.property("is_verified", core.serialization.boolean().optional()), + revOrg: core.serialization.property("rev_org", OrgSummary.optional()), + stockSchemaFragment: core.serialization.property( + "stock_schema_fragment", + core.serialization.string().optional() + ), + subtype: core.serialization.string().optional(), + tags: core.serialization.list(TagWithValue).optional(), + }) + .extend(UserBase); + +export declare namespace RevUser { + interface Raw extends UserBase.Raw { + artifacts?: ArtifactSummary.Raw[] | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + description?: string | null; + external_ref?: string | null; + is_verified?: boolean | null; + rev_org?: OrgSummary.Raw | null; + stock_schema_fragment?: string | null; + subtype?: string | null; + tags?: TagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/RevUserSummary.ts b/src/serialization/types/RevUserSummary.ts new file mode 100644 index 0000000..31b1515 --- /dev/null +++ b/src/serialization/types/RevUserSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSummary } from "./OrgSummary"; +import { UserBaseSummary } from "./UserBaseSummary"; + +export const RevUserSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + revOrg: core.serialization.property("rev_org", OrgSummary.optional()), + }) + .extend(UserBaseSummary); + +export declare namespace RevUserSummary { + interface Raw extends UserBaseSummary.Raw { + external_ref?: string | null; + rev_org?: OrgSummary.Raw | null; + } +} diff --git a/src/serialization/types/RevUsersCreateResponse.ts b/src/serialization/types/RevUsersCreateResponse.ts new file mode 100644 index 0000000..6477fd5 --- /dev/null +++ b/src/serialization/types/RevUsersCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const RevUsersCreateResponse: core.serialization.ObjectSchema< + serializers.RevUsersCreateResponse.Raw, + DevRev.RevUsersCreateResponse +> = core.serialization.object({ + revUser: core.serialization.property("rev_user", RevUser), +}); + +export declare namespace RevUsersCreateResponse { + interface Raw { + rev_user: RevUser.Raw; + } +} diff --git a/src/serialization/types/RevUsersDeleteResponse.ts b/src/serialization/types/RevUsersDeleteResponse.ts new file mode 100644 index 0000000..151c294 --- /dev/null +++ b/src/serialization/types/RevUsersDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const RevUsersDeleteResponse: core.serialization.Schema< + serializers.RevUsersDeleteResponse.Raw, + DevRev.RevUsersDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace RevUsersDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/RevUsersGetResponse.ts b/src/serialization/types/RevUsersGetResponse.ts new file mode 100644 index 0000000..df580b1 --- /dev/null +++ b/src/serialization/types/RevUsersGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const RevUsersGetResponse: core.serialization.ObjectSchema< + serializers.RevUsersGetResponse.Raw, + DevRev.RevUsersGetResponse +> = core.serialization.object({ + revUser: core.serialization.property("rev_user", RevUser), +}); + +export declare namespace RevUsersGetResponse { + interface Raw { + rev_user: RevUser.Raw; + } +} diff --git a/src/serialization/types/RevUsersListResponse.ts b/src/serialization/types/RevUsersListResponse.ts new file mode 100644 index 0000000..2efad89 --- /dev/null +++ b/src/serialization/types/RevUsersListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const RevUsersListResponse: core.serialization.ObjectSchema< + serializers.RevUsersListResponse.Raw, + DevRev.RevUsersListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + revUsers: core.serialization.property("rev_users", core.serialization.list(RevUser)), +}); + +export declare namespace RevUsersListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + rev_users: RevUser.Raw[]; + } +} diff --git a/src/serialization/types/RevUsersUpdateRequestArtifacts.ts b/src/serialization/types/RevUsersUpdateRequestArtifacts.ts new file mode 100644 index 0000000..3e63006 --- /dev/null +++ b/src/serialization/types/RevUsersUpdateRequestArtifacts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const RevUsersUpdateRequestArtifacts: core.serialization.ObjectSchema< + serializers.RevUsersUpdateRequestArtifacts.Raw, + DevRev.RevUsersUpdateRequestArtifacts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace RevUsersUpdateRequestArtifacts { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/RevUsersUpdateRequestCustomSchemaFragments.ts b/src/serialization/types/RevUsersUpdateRequestCustomSchemaFragments.ts new file mode 100644 index 0000000..46347c0 --- /dev/null +++ b/src/serialization/types/RevUsersUpdateRequestCustomSchemaFragments.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const RevUsersUpdateRequestCustomSchemaFragments: core.serialization.ObjectSchema< + serializers.RevUsersUpdateRequestCustomSchemaFragments.Raw, + DevRev.RevUsersUpdateRequestCustomSchemaFragments +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace RevUsersUpdateRequestCustomSchemaFragments { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/RevUsersUpdateResponse.ts b/src/serialization/types/RevUsersUpdateResponse.ts new file mode 100644 index 0000000..429d8af --- /dev/null +++ b/src/serialization/types/RevUsersUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const RevUsersUpdateResponse: core.serialization.ObjectSchema< + serializers.RevUsersUpdateResponse.Raw, + DevRev.RevUsersUpdateResponse +> = core.serialization.object({ + revUser: core.serialization.property("rev_user", RevUser), +}); + +export declare namespace RevUsersUpdateResponse { + interface Raw { + rev_user: RevUser.Raw; + } +} diff --git a/src/serialization/types/SchemaBoolFieldDescriptor.ts b/src/serialization/types/SchemaBoolFieldDescriptor.ts new file mode 100644 index 0000000..171b1b5 --- /dev/null +++ b/src/serialization/types/SchemaBoolFieldDescriptor.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaBoolFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaBoolFieldDescriptor.Raw, + DevRev.SchemaBoolFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property("default_value", core.serialization.boolean().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaBoolFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: boolean | null; + } +} diff --git a/src/serialization/types/SchemaBoolListFieldDescriptor.ts b/src/serialization/types/SchemaBoolListFieldDescriptor.ts new file mode 100644 index 0000000..76acbd0 --- /dev/null +++ b/src/serialization/types/SchemaBoolListFieldDescriptor.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaBoolListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaBoolListFieldDescriptor.Raw, + DevRev.SchemaBoolListFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.boolean()).optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaBoolListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: boolean[] | null; + } +} diff --git a/src/serialization/types/SchemaCompositeFieldDescriptor.ts b/src/serialization/types/SchemaCompositeFieldDescriptor.ts new file mode 100644 index 0000000..7d8daef --- /dev/null +++ b/src/serialization/types/SchemaCompositeFieldDescriptor.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaCompositeFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaCompositeFieldDescriptor.Raw, + DevRev.SchemaCompositeFieldDescriptor +> = core.serialization + .object({ + compositeType: core.serialization.property("composite_type", core.serialization.string().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaCompositeFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + composite_type?: string | null; + } +} diff --git a/src/serialization/types/SchemaCompositeListFieldDescriptor.ts b/src/serialization/types/SchemaCompositeListFieldDescriptor.ts new file mode 100644 index 0000000..71604e0 --- /dev/null +++ b/src/serialization/types/SchemaCompositeListFieldDescriptor.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaCompositeListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaCompositeListFieldDescriptor.Raw, + DevRev.SchemaCompositeListFieldDescriptor +> = core.serialization + .object({ + compositeType: core.serialization.property("composite_type", core.serialization.string().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaCompositeListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + composite_type?: string | null; + } +} diff --git a/src/serialization/types/SchemaDateFieldDescriptor.ts b/src/serialization/types/SchemaDateFieldDescriptor.ts new file mode 100644 index 0000000..ee110d9 --- /dev/null +++ b/src/serialization/types/SchemaDateFieldDescriptor.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaDateFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaDateFieldDescriptor.Raw, + DevRev.SchemaDateFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaDateFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: string | null; + } +} diff --git a/src/serialization/types/SchemaDateListFieldDescriptor.ts b/src/serialization/types/SchemaDateListFieldDescriptor.ts new file mode 100644 index 0000000..d6110a5 --- /dev/null +++ b/src/serialization/types/SchemaDateListFieldDescriptor.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaDateListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaDateListFieldDescriptor.Raw, + DevRev.SchemaDateListFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.string()).optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaDateListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: string[] | null; + } +} diff --git a/src/serialization/types/SchemaDoubleFieldDescriptor.ts b/src/serialization/types/SchemaDoubleFieldDescriptor.ts new file mode 100644 index 0000000..0f17405 --- /dev/null +++ b/src/serialization/types/SchemaDoubleFieldDescriptor.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaDoubleFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaDoubleFieldDescriptor.Raw, + DevRev.SchemaDoubleFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property("default_value", core.serialization.number().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaDoubleFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: number | null; + } +} diff --git a/src/serialization/types/SchemaDoubleListFieldDescriptor.ts b/src/serialization/types/SchemaDoubleListFieldDescriptor.ts new file mode 100644 index 0000000..7554482 --- /dev/null +++ b/src/serialization/types/SchemaDoubleListFieldDescriptor.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaDoubleListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaDoubleListFieldDescriptor.Raw, + DevRev.SchemaDoubleListFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.number()).optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaDoubleListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: number[] | null; + } +} diff --git a/src/serialization/types/SchemaEnumFieldDescriptor.ts b/src/serialization/types/SchemaEnumFieldDescriptor.ts new file mode 100644 index 0000000..5493300 --- /dev/null +++ b/src/serialization/types/SchemaEnumFieldDescriptor.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaEnumFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaEnumFieldDescriptor.Raw, + DevRev.SchemaEnumFieldDescriptor +> = core.serialization + .object({ + allowedValues: core.serialization.property( + "allowed_values", + core.serialization.list(core.serialization.string()) + ), + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaEnumFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + allowed_values: string[]; + default_value?: string | null; + } +} diff --git a/src/serialization/types/SchemaEnumListFieldDescriptor.ts b/src/serialization/types/SchemaEnumListFieldDescriptor.ts new file mode 100644 index 0000000..0ca0f1f --- /dev/null +++ b/src/serialization/types/SchemaEnumListFieldDescriptor.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaEnumListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaEnumListFieldDescriptor.Raw, + DevRev.SchemaEnumListFieldDescriptor +> = core.serialization + .object({ + allowedValues: core.serialization.property( + "allowed_values", + core.serialization.list(core.serialization.string()) + ), + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.string()).optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaEnumListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + allowed_values: string[]; + default_value?: string[] | null; + } +} diff --git a/src/serialization/types/SchemaFieldCreateViewUiMetadata.ts b/src/serialization/types/SchemaFieldCreateViewUiMetadata.ts new file mode 100644 index 0000000..bd639a7 --- /dev/null +++ b/src/serialization/types/SchemaFieldCreateViewUiMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldCreateViewUiMetadata: core.serialization.ObjectSchema< + serializers.SchemaFieldCreateViewUiMetadata.Raw, + DevRev.SchemaFieldCreateViewUiMetadata +> = core.serialization.object({ + isHidden: core.serialization.property("is_hidden", core.serialization.boolean().optional()), +}); + +export declare namespace SchemaFieldCreateViewUiMetadata { + interface Raw { + is_hidden?: boolean | null; + } +} diff --git a/src/serialization/types/SchemaFieldDescriptor.ts b/src/serialization/types/SchemaFieldDescriptor.ts new file mode 100644 index 0000000..9189b4b --- /dev/null +++ b/src/serialization/types/SchemaFieldDescriptor.ts @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorArrayType } from "./SchemaFieldDescriptorArrayType"; +import { SchemaBoolFieldDescriptor } from "./SchemaBoolFieldDescriptor"; +import { SchemaCompositeFieldDescriptor } from "./SchemaCompositeFieldDescriptor"; +import { SchemaDateFieldDescriptor } from "./SchemaDateFieldDescriptor"; +import { SchemaDoubleFieldDescriptor } from "./SchemaDoubleFieldDescriptor"; +import { SchemaEnumFieldDescriptor } from "./SchemaEnumFieldDescriptor"; +import { SchemaIdFieldDescriptor } from "./SchemaIdFieldDescriptor"; +import { SchemaIntFieldDescriptor } from "./SchemaIntFieldDescriptor"; +import { SchemaRichTextFieldDescriptor } from "./SchemaRichTextFieldDescriptor"; +import { SchemaStructFieldDescriptor } from "./SchemaStructFieldDescriptor"; +import { SchemaTextFieldDescriptor } from "./SchemaTextFieldDescriptor"; +import { SchemaTimestampFieldDescriptor } from "./SchemaTimestampFieldDescriptor"; +import { SchemaTokensFieldDescriptor } from "./SchemaTokensFieldDescriptor"; +import { SchemaUenumFieldDescriptor } from "./SchemaUenumFieldDescriptor"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaFieldDescriptor: core.serialization.Schema< + serializers.SchemaFieldDescriptor.Raw, + DevRev.SchemaFieldDescriptor +> = core.serialization + .union(core.serialization.discriminant("fieldType", "field_type"), { + array: core.serialization.object({ + value: SchemaFieldDescriptorArrayType, + }), + bool: SchemaBoolFieldDescriptor, + composite: SchemaCompositeFieldDescriptor, + date: SchemaDateFieldDescriptor, + double: SchemaDoubleFieldDescriptor, + enum: SchemaEnumFieldDescriptor, + id: SchemaIdFieldDescriptor, + int: SchemaIntFieldDescriptor, + rich_text: SchemaRichTextFieldDescriptor, + struct: SchemaStructFieldDescriptor, + text: SchemaTextFieldDescriptor, + timestamp: SchemaTimestampFieldDescriptor, + tokens: SchemaTokensFieldDescriptor, + uenum: SchemaUenumFieldDescriptor, + unknown: SchemaFieldDescriptorBase, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace SchemaFieldDescriptor { + type Raw = + | SchemaFieldDescriptor.Array + | SchemaFieldDescriptor.Bool + | SchemaFieldDescriptor.Composite + | SchemaFieldDescriptor.Date + | SchemaFieldDescriptor.Double + | SchemaFieldDescriptor.Enum + | SchemaFieldDescriptor.Id + | SchemaFieldDescriptor.Int + | SchemaFieldDescriptor.RichText + | SchemaFieldDescriptor.Struct + | SchemaFieldDescriptor.Text + | SchemaFieldDescriptor.Timestamp + | SchemaFieldDescriptor.Tokens + | SchemaFieldDescriptor.Uenum + | SchemaFieldDescriptor.Unknown; + + interface Array { + field_type: "array"; + value: SchemaFieldDescriptorArrayType.Raw; + } + + interface Bool extends SchemaBoolFieldDescriptor.Raw { + field_type: "bool"; + } + + interface Composite extends SchemaCompositeFieldDescriptor.Raw { + field_type: "composite"; + } + + interface Date extends SchemaDateFieldDescriptor.Raw { + field_type: "date"; + } + + interface Double extends SchemaDoubleFieldDescriptor.Raw { + field_type: "double"; + } + + interface Enum extends SchemaEnumFieldDescriptor.Raw { + field_type: "enum"; + } + + interface Id extends SchemaIdFieldDescriptor.Raw { + field_type: "id"; + } + + interface Int extends SchemaIntFieldDescriptor.Raw { + field_type: "int"; + } + + interface RichText extends SchemaRichTextFieldDescriptor.Raw { + field_type: "rich_text"; + } + + interface Struct extends SchemaStructFieldDescriptor.Raw { + field_type: "struct"; + } + + interface Text extends SchemaTextFieldDescriptor.Raw { + field_type: "text"; + } + + interface Timestamp extends SchemaTimestampFieldDescriptor.Raw { + field_type: "timestamp"; + } + + interface Tokens extends SchemaTokensFieldDescriptor.Raw { + field_type: "tokens"; + } + + interface Uenum extends SchemaUenumFieldDescriptor.Raw { + field_type: "uenum"; + } + + interface Unknown extends SchemaFieldDescriptorBase.Raw { + field_type: "unknown"; + } +} diff --git a/src/serialization/types/SchemaFieldDescriptorArrayType.ts b/src/serialization/types/SchemaFieldDescriptorArrayType.ts new file mode 100644 index 0000000..b7dbefa --- /dev/null +++ b/src/serialization/types/SchemaFieldDescriptorArrayType.ts @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { SchemaBoolListFieldDescriptor } from "./SchemaBoolListFieldDescriptor"; +import { SchemaCompositeListFieldDescriptor } from "./SchemaCompositeListFieldDescriptor"; +import { SchemaDateListFieldDescriptor } from "./SchemaDateListFieldDescriptor"; +import { SchemaDoubleListFieldDescriptor } from "./SchemaDoubleListFieldDescriptor"; +import { SchemaEnumListFieldDescriptor } from "./SchemaEnumListFieldDescriptor"; +import { SchemaIdListFieldDescriptor } from "./SchemaIdListFieldDescriptor"; +import { SchemaIntListFieldDescriptor } from "./SchemaIntListFieldDescriptor"; +import { SchemaRichTextListFieldDescriptor } from "./SchemaRichTextListFieldDescriptor"; +import { SchemaStructListFieldDescriptor } from "./SchemaStructListFieldDescriptor"; +import { SchemaTextListFieldDescriptor } from "./SchemaTextListFieldDescriptor"; +import { SchemaTimestampListFieldDescriptor } from "./SchemaTimestampListFieldDescriptor"; +import { SchemaTokensListFieldDescriptor } from "./SchemaTokensListFieldDescriptor"; +import { SchemaUenumListFieldDescriptor } from "./SchemaUenumListFieldDescriptor"; + +const _Base = core.serialization.object({ + eqItems: core.serialization.property("eq_items", core.serialization.number().optional()), + maxItems: core.serialization.property("max_items", core.serialization.number().optional()), + minItems: core.serialization.property("min_items", core.serialization.number().optional()), +}); +export const SchemaFieldDescriptorArrayType: core.serialization.Schema< + serializers.SchemaFieldDescriptorArrayType.Raw, + DevRev.SchemaFieldDescriptorArrayType +> = core.serialization + .union(core.serialization.discriminant("baseType", "base_type"), { + bool: SchemaBoolListFieldDescriptor.extend(_Base), + composite: SchemaCompositeListFieldDescriptor.extend(_Base), + date: SchemaDateListFieldDescriptor.extend(_Base), + double: SchemaDoubleListFieldDescriptor.extend(_Base), + enum: SchemaEnumListFieldDescriptor.extend(_Base), + id: SchemaIdListFieldDescriptor.extend(_Base), + int: SchemaIntListFieldDescriptor.extend(_Base), + rich_text: SchemaRichTextListFieldDescriptor.extend(_Base), + struct: SchemaStructListFieldDescriptor.extend(_Base), + text: SchemaTextListFieldDescriptor.extend(_Base), + timestamp: SchemaTimestampListFieldDescriptor.extend(_Base), + tokens: SchemaTokensListFieldDescriptor.extend(_Base), + uenum: SchemaUenumListFieldDescriptor.extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace SchemaFieldDescriptorArrayType { + type Raw = + | SchemaFieldDescriptorArrayType.Bool + | SchemaFieldDescriptorArrayType.Composite + | SchemaFieldDescriptorArrayType.Date + | SchemaFieldDescriptorArrayType.Double + | SchemaFieldDescriptorArrayType.Enum + | SchemaFieldDescriptorArrayType.Id + | SchemaFieldDescriptorArrayType.Int + | SchemaFieldDescriptorArrayType.RichText + | SchemaFieldDescriptorArrayType.Struct + | SchemaFieldDescriptorArrayType.Text + | SchemaFieldDescriptorArrayType.Timestamp + | SchemaFieldDescriptorArrayType.Tokens + | SchemaFieldDescriptorArrayType.Uenum; + + interface Bool extends _Base, SchemaBoolListFieldDescriptor.Raw { + base_type: "bool"; + } + + interface Composite extends _Base, SchemaCompositeListFieldDescriptor.Raw { + base_type: "composite"; + } + + interface Date extends _Base, SchemaDateListFieldDescriptor.Raw { + base_type: "date"; + } + + interface Double extends _Base, SchemaDoubleListFieldDescriptor.Raw { + base_type: "double"; + } + + interface Enum extends _Base, SchemaEnumListFieldDescriptor.Raw { + base_type: "enum"; + } + + interface Id extends _Base, SchemaIdListFieldDescriptor.Raw { + base_type: "id"; + } + + interface Int extends _Base, SchemaIntListFieldDescriptor.Raw { + base_type: "int"; + } + + interface RichText extends _Base, SchemaRichTextListFieldDescriptor.Raw { + base_type: "rich_text"; + } + + interface Struct extends _Base, SchemaStructListFieldDescriptor.Raw { + base_type: "struct"; + } + + interface Text extends _Base, SchemaTextListFieldDescriptor.Raw { + base_type: "text"; + } + + interface Timestamp extends _Base, SchemaTimestampListFieldDescriptor.Raw { + base_type: "timestamp"; + } + + interface Tokens extends _Base, SchemaTokensListFieldDescriptor.Raw { + base_type: "tokens"; + } + + interface Uenum extends _Base, SchemaUenumListFieldDescriptor.Raw { + base_type: "uenum"; + } + + interface _Base { + eq_items?: number | null; + max_items?: number | null; + min_items?: number | null; + } +} diff --git a/src/serialization/types/SchemaFieldDescriptorArrayTypeBaseType.ts b/src/serialization/types/SchemaFieldDescriptorArrayTypeBaseType.ts new file mode 100644 index 0000000..6400ef4 --- /dev/null +++ b/src/serialization/types/SchemaFieldDescriptorArrayTypeBaseType.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldDescriptorArrayTypeBaseType: core.serialization.Schema< + serializers.SchemaFieldDescriptorArrayTypeBaseType.Raw, + DevRev.SchemaFieldDescriptorArrayTypeBaseType +> = core.serialization.enum_([ + "bool", + "composite", + "date", + "double", + "enum", + "id", + "int", + "rich_text", + "struct", + "text", + "timestamp", + "tokens", + "uenum", +]); + +export declare namespace SchemaFieldDescriptorArrayTypeBaseType { + type Raw = + | "bool" + | "composite" + | "date" + | "double" + | "enum" + | "id" + | "int" + | "rich_text" + | "struct" + | "text" + | "timestamp" + | "tokens" + | "uenum"; +} diff --git a/src/serialization/types/SchemaFieldDescriptorBase.ts b/src/serialization/types/SchemaFieldDescriptorBase.ts new file mode 100644 index 0000000..1459e58 --- /dev/null +++ b/src/serialization/types/SchemaFieldDescriptorBase.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldMfzMetadata } from "./SchemaFieldMfzMetadata"; +import { SchemaFieldOasisMetadata } from "./SchemaFieldOasisMetadata"; +import { SchemaFieldUiMetadata } from "./SchemaFieldUiMetadata"; + +export const SchemaFieldDescriptorBase: core.serialization.ObjectSchema< + serializers.SchemaFieldDescriptorBase.Raw, + DevRev.SchemaFieldDescriptorBase +> = core.serialization.object({ + description: core.serialization.string().optional(), + isFilterable: core.serialization.property("is_filterable", core.serialization.boolean().optional()), + isImmutable: core.serialization.property("is_immutable", core.serialization.boolean().optional()), + isPii: core.serialization.property("is_pii", core.serialization.boolean().optional()), + isRequired: core.serialization.property("is_required", core.serialization.boolean().optional()), + mfz: SchemaFieldMfzMetadata.optional(), + name: core.serialization.string(), + oasis: SchemaFieldOasisMetadata.optional(), + origin: core.serialization.string().optional(), + ui: SchemaFieldUiMetadata.optional(), +}); + +export declare namespace SchemaFieldDescriptorBase { + interface Raw { + description?: string | null; + is_filterable?: boolean | null; + is_immutable?: boolean | null; + is_pii?: boolean | null; + is_required?: boolean | null; + mfz?: SchemaFieldMfzMetadata.Raw | null; + name: string; + oasis?: SchemaFieldOasisMetadata.Raw | null; + origin?: string | null; + ui?: SchemaFieldUiMetadata.Raw | null; + } +} diff --git a/src/serialization/types/SchemaFieldDescriptorFieldType.ts b/src/serialization/types/SchemaFieldDescriptorFieldType.ts new file mode 100644 index 0000000..02dc7d2 --- /dev/null +++ b/src/serialization/types/SchemaFieldDescriptorFieldType.ts @@ -0,0 +1,47 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldDescriptorFieldType: core.serialization.Schema< + serializers.SchemaFieldDescriptorFieldType.Raw, + DevRev.SchemaFieldDescriptorFieldType +> = core.serialization.enum_([ + "array", + "bool", + "composite", + "date", + "double", + "enum", + "id", + "int", + "rich_text", + "struct", + "text", + "timestamp", + "tokens", + "uenum", + "unknown", +]); + +export declare namespace SchemaFieldDescriptorFieldType { + type Raw = + | "array" + | "bool" + | "composite" + | "date" + | "double" + | "enum" + | "id" + | "int" + | "rich_text" + | "struct" + | "text" + | "timestamp" + | "tokens" + | "uenum" + | "unknown"; +} diff --git a/src/serialization/types/SchemaFieldDetailViewUiMetadata.ts b/src/serialization/types/SchemaFieldDetailViewUiMetadata.ts new file mode 100644 index 0000000..61db018 --- /dev/null +++ b/src/serialization/types/SchemaFieldDetailViewUiMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldDetailViewUiMetadata: core.serialization.ObjectSchema< + serializers.SchemaFieldDetailViewUiMetadata.Raw, + DevRev.SchemaFieldDetailViewUiMetadata +> = core.serialization.object({ + isHidden: core.serialization.property("is_hidden", core.serialization.boolean().optional()), +}); + +export declare namespace SchemaFieldDetailViewUiMetadata { + interface Raw { + is_hidden?: boolean | null; + } +} diff --git a/src/serialization/types/SchemaFieldFilterViewUiMetadata.ts b/src/serialization/types/SchemaFieldFilterViewUiMetadata.ts new file mode 100644 index 0000000..af71a05 --- /dev/null +++ b/src/serialization/types/SchemaFieldFilterViewUiMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldFilterViewUiMetadata: core.serialization.ObjectSchema< + serializers.SchemaFieldFilterViewUiMetadata.Raw, + DevRev.SchemaFieldFilterViewUiMetadata +> = core.serialization.object({ + isHidden: core.serialization.property("is_hidden", core.serialization.boolean().optional()), +}); + +export declare namespace SchemaFieldFilterViewUiMetadata { + interface Raw { + is_hidden?: boolean | null; + } +} diff --git a/src/serialization/types/SchemaFieldListViewUiMetadata.ts b/src/serialization/types/SchemaFieldListViewUiMetadata.ts new file mode 100644 index 0000000..115d569 --- /dev/null +++ b/src/serialization/types/SchemaFieldListViewUiMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldListViewUiMetadata: core.serialization.ObjectSchema< + serializers.SchemaFieldListViewUiMetadata.Raw, + DevRev.SchemaFieldListViewUiMetadata +> = core.serialization.object({ + isHidden: core.serialization.property("is_hidden", core.serialization.boolean().optional()), +}); + +export declare namespace SchemaFieldListViewUiMetadata { + interface Raw { + is_hidden?: boolean | null; + } +} diff --git a/src/serialization/types/SchemaFieldMfzMetadata.ts b/src/serialization/types/SchemaFieldMfzMetadata.ts new file mode 100644 index 0000000..333df72 --- /dev/null +++ b/src/serialization/types/SchemaFieldMfzMetadata.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldMfzMetadata: core.serialization.Schema< + serializers.SchemaFieldMfzMetadata.Raw, + DevRev.SchemaFieldMfzMetadata +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SchemaFieldMfzMetadata { + type Raw = Record; +} diff --git a/src/serialization/types/SchemaFieldOasisMetadata.ts b/src/serialization/types/SchemaFieldOasisMetadata.ts new file mode 100644 index 0000000..1b9b9b2 --- /dev/null +++ b/src/serialization/types/SchemaFieldOasisMetadata.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldOasisMetadata: core.serialization.Schema< + serializers.SchemaFieldOasisMetadata.Raw, + DevRev.SchemaFieldOasisMetadata +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SchemaFieldOasisMetadata { + type Raw = Record; +} diff --git a/src/serialization/types/SchemaFieldSummaryViewUiMetadata.ts b/src/serialization/types/SchemaFieldSummaryViewUiMetadata.ts new file mode 100644 index 0000000..9e0bcf6 --- /dev/null +++ b/src/serialization/types/SchemaFieldSummaryViewUiMetadata.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldSummaryViewUiMetadata: core.serialization.ObjectSchema< + serializers.SchemaFieldSummaryViewUiMetadata.Raw, + DevRev.SchemaFieldSummaryViewUiMetadata +> = core.serialization.object({ + isHidden: core.serialization.property("is_hidden", core.serialization.boolean().optional()), +}); + +export declare namespace SchemaFieldSummaryViewUiMetadata { + interface Raw { + is_hidden?: boolean | null; + } +} diff --git a/src/serialization/types/SchemaFieldUenumValue.ts b/src/serialization/types/SchemaFieldUenumValue.ts new file mode 100644 index 0000000..5e9572c --- /dev/null +++ b/src/serialization/types/SchemaFieldUenumValue.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SchemaFieldUenumValue: core.serialization.Schema< + serializers.SchemaFieldUenumValue.Raw, + DevRev.SchemaFieldUenumValue +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SchemaFieldUenumValue { + type Raw = Record; +} diff --git a/src/serialization/types/SchemaFieldUiMetadata.ts b/src/serialization/types/SchemaFieldUiMetadata.ts new file mode 100644 index 0000000..4c4afc3 --- /dev/null +++ b/src/serialization/types/SchemaFieldUiMetadata.ts @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldCreateViewUiMetadata } from "./SchemaFieldCreateViewUiMetadata"; +import { SchemaFieldDetailViewUiMetadata } from "./SchemaFieldDetailViewUiMetadata"; +import { SchemaFieldFilterViewUiMetadata } from "./SchemaFieldFilterViewUiMetadata"; +import { SchemaFieldListViewUiMetadata } from "./SchemaFieldListViewUiMetadata"; +import { SchemaFieldSummaryViewUiMetadata } from "./SchemaFieldSummaryViewUiMetadata"; + +export const SchemaFieldUiMetadata: core.serialization.ObjectSchema< + serializers.SchemaFieldUiMetadata.Raw, + DevRev.SchemaFieldUiMetadata +> = core.serialization.object({ + createView: core.serialization.property("create_view", SchemaFieldCreateViewUiMetadata.optional()), + detailView: core.serialization.property("detail_view", SchemaFieldDetailViewUiMetadata.optional()), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + filterView: core.serialization.property("filter_view", SchemaFieldFilterViewUiMetadata.optional()), + groupName: core.serialization.property("group_name", core.serialization.string().optional()), + isActiveInDetailView: core.serialization.property( + "is_active_in_detail_view", + core.serialization.boolean().optional() + ), + isBulkActionEnabled: core.serialization.property("is_bulk_action_enabled", core.serialization.boolean().optional()), + isGroupable: core.serialization.property("is_groupable", core.serialization.boolean().optional()), + isHidden: core.serialization.property("is_hidden", core.serialization.boolean().optional()), + isHiddenDuringCreate: core.serialization.property( + "is_hidden_during_create", + core.serialization.boolean().optional() + ), + isReadOnly: core.serialization.property("is_read_only", core.serialization.boolean().optional()), + isRequired: core.serialization.property("is_required", core.serialization.boolean().optional()), + isShownInSummary: core.serialization.property("is_shown_in_summary", core.serialization.boolean().optional()), + isSortable: core.serialization.property("is_sortable", core.serialization.boolean().optional()), + listView: core.serialization.property("list_view", SchemaFieldListViewUiMetadata.optional()), + placeholder: core.serialization.string().optional(), + summaryView: core.serialization.property("summary_view", SchemaFieldSummaryViewUiMetadata.optional()), + tooltip: core.serialization.string().optional(), +}); + +export declare namespace SchemaFieldUiMetadata { + interface Raw { + create_view?: SchemaFieldCreateViewUiMetadata.Raw | null; + detail_view?: SchemaFieldDetailViewUiMetadata.Raw | null; + display_name?: string | null; + filter_view?: SchemaFieldFilterViewUiMetadata.Raw | null; + group_name?: string | null; + is_active_in_detail_view?: boolean | null; + is_bulk_action_enabled?: boolean | null; + is_groupable?: boolean | null; + is_hidden?: boolean | null; + is_hidden_during_create?: boolean | null; + is_read_only?: boolean | null; + is_required?: boolean | null; + is_shown_in_summary?: boolean | null; + is_sortable?: boolean | null; + list_view?: SchemaFieldListViewUiMetadata.Raw | null; + placeholder?: string | null; + summary_view?: SchemaFieldSummaryViewUiMetadata.Raw | null; + tooltip?: string | null; + } +} diff --git a/src/serialization/types/SchemaIdFieldDescriptor.ts b/src/serialization/types/SchemaIdFieldDescriptor.ts new file mode 100644 index 0000000..aa487c4 --- /dev/null +++ b/src/serialization/types/SchemaIdFieldDescriptor.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaIdFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaIdFieldDescriptor.Raw, + DevRev.SchemaIdFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + idType: core.serialization.property("id_type", core.serialization.list(core.serialization.string()).optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaIdFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: string | null; + id_type?: string[] | null; + } +} diff --git a/src/serialization/types/SchemaIdListFieldDescriptor.ts b/src/serialization/types/SchemaIdListFieldDescriptor.ts new file mode 100644 index 0000000..39b75c7 --- /dev/null +++ b/src/serialization/types/SchemaIdListFieldDescriptor.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaIdListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaIdListFieldDescriptor.Raw, + DevRev.SchemaIdListFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.string()).optional() + ), + idType: core.serialization.property("id_type", core.serialization.list(core.serialization.string()).optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaIdListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: string[] | null; + id_type?: string[] | null; + } +} diff --git a/src/serialization/types/SchemaIntFieldDescriptor.ts b/src/serialization/types/SchemaIntFieldDescriptor.ts new file mode 100644 index 0000000..d03506d --- /dev/null +++ b/src/serialization/types/SchemaIntFieldDescriptor.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaIntFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaIntFieldDescriptor.Raw, + DevRev.SchemaIntFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property("default_value", core.serialization.number().optional()), + gt: core.serialization.number().optional(), + gte: core.serialization.number().optional(), + lt: core.serialization.number().optional(), + lte: core.serialization.number().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaIntFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: number | null; + gt?: number | null; + gte?: number | null; + lt?: number | null; + lte?: number | null; + } +} diff --git a/src/serialization/types/SchemaIntListFieldDescriptor.ts b/src/serialization/types/SchemaIntListFieldDescriptor.ts new file mode 100644 index 0000000..0a12a4e --- /dev/null +++ b/src/serialization/types/SchemaIntListFieldDescriptor.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaIntListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaIntListFieldDescriptor.Raw, + DevRev.SchemaIntListFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.number()).optional() + ), + gt: core.serialization.number().optional(), + gte: core.serialization.number().optional(), + lt: core.serialization.number().optional(), + lte: core.serialization.number().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaIntListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: number[] | null; + gt?: number | null; + gte?: number | null; + lt?: number | null; + lte?: number | null; + } +} diff --git a/src/serialization/types/SchemaRichTextFieldDescriptor.ts b/src/serialization/types/SchemaRichTextFieldDescriptor.ts new file mode 100644 index 0000000..f84913b --- /dev/null +++ b/src/serialization/types/SchemaRichTextFieldDescriptor.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaRichTextFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaRichTextFieldDescriptor.Raw, + DevRev.SchemaRichTextFieldDescriptor +> = core.serialization + .object({ + contains: core.serialization.string().optional(), + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + eqLen: core.serialization.property("eq_len", core.serialization.number().optional()), + maxLen: core.serialization.property("max_len", core.serialization.number().optional()), + minLen: core.serialization.property("min_len", core.serialization.number().optional()), + pattern: core.serialization.string().optional(), + prefix: core.serialization.string().optional(), + suffix: core.serialization.string().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaRichTextFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + contains?: string | null; + default_value?: string | null; + eq_len?: number | null; + max_len?: number | null; + min_len?: number | null; + pattern?: string | null; + prefix?: string | null; + suffix?: string | null; + } +} diff --git a/src/serialization/types/SchemaRichTextListFieldDescriptor.ts b/src/serialization/types/SchemaRichTextListFieldDescriptor.ts new file mode 100644 index 0000000..6dfe64c --- /dev/null +++ b/src/serialization/types/SchemaRichTextListFieldDescriptor.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaRichTextListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaRichTextListFieldDescriptor.Raw, + DevRev.SchemaRichTextListFieldDescriptor +> = core.serialization + .object({ + contains: core.serialization.string().optional(), + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.string()).optional() + ), + eqLen: core.serialization.property("eq_len", core.serialization.number().optional()), + maxLen: core.serialization.property("max_len", core.serialization.number().optional()), + minLen: core.serialization.property("min_len", core.serialization.number().optional()), + pattern: core.serialization.string().optional(), + prefix: core.serialization.string().optional(), + suffix: core.serialization.string().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaRichTextListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + contains?: string | null; + default_value?: string[] | null; + eq_len?: number | null; + max_len?: number | null; + min_len?: number | null; + pattern?: string | null; + prefix?: string | null; + suffix?: string | null; + } +} diff --git a/src/serialization/types/SchemaStructFieldDescriptor.ts b/src/serialization/types/SchemaStructFieldDescriptor.ts new file mode 100644 index 0000000..900826d --- /dev/null +++ b/src/serialization/types/SchemaStructFieldDescriptor.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaStructFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaStructFieldDescriptor.Raw, + DevRev.SchemaStructFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaStructFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: Record | null; + } +} diff --git a/src/serialization/types/SchemaStructListFieldDescriptor.ts b/src/serialization/types/SchemaStructListFieldDescriptor.ts new file mode 100644 index 0000000..aad668a --- /dev/null +++ b/src/serialization/types/SchemaStructListFieldDescriptor.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaStructListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaStructListFieldDescriptor.Raw, + DevRev.SchemaStructListFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaStructListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: Record[] | null; + } +} diff --git a/src/serialization/types/SchemaTextFieldDescriptor.ts b/src/serialization/types/SchemaTextFieldDescriptor.ts new file mode 100644 index 0000000..40723e9 --- /dev/null +++ b/src/serialization/types/SchemaTextFieldDescriptor.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaTextFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaTextFieldDescriptor.Raw, + DevRev.SchemaTextFieldDescriptor +> = core.serialization + .object({ + contains: core.serialization.string().optional(), + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + eqLen: core.serialization.property("eq_len", core.serialization.number().optional()), + maxLen: core.serialization.property("max_len", core.serialization.number().optional()), + minLen: core.serialization.property("min_len", core.serialization.number().optional()), + pattern: core.serialization.string().optional(), + prefix: core.serialization.string().optional(), + suffix: core.serialization.string().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaTextFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + contains?: string | null; + default_value?: string | null; + eq_len?: number | null; + max_len?: number | null; + min_len?: number | null; + pattern?: string | null; + prefix?: string | null; + suffix?: string | null; + } +} diff --git a/src/serialization/types/SchemaTextListFieldDescriptor.ts b/src/serialization/types/SchemaTextListFieldDescriptor.ts new file mode 100644 index 0000000..3d754ef --- /dev/null +++ b/src/serialization/types/SchemaTextListFieldDescriptor.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaTextListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaTextListFieldDescriptor.Raw, + DevRev.SchemaTextListFieldDescriptor +> = core.serialization + .object({ + contains: core.serialization.string().optional(), + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.string()).optional() + ), + eqLen: core.serialization.property("eq_len", core.serialization.number().optional()), + maxLen: core.serialization.property("max_len", core.serialization.number().optional()), + minLen: core.serialization.property("min_len", core.serialization.number().optional()), + pattern: core.serialization.string().optional(), + prefix: core.serialization.string().optional(), + suffix: core.serialization.string().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaTextListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + contains?: string | null; + default_value?: string[] | null; + eq_len?: number | null; + max_len?: number | null; + min_len?: number | null; + pattern?: string | null; + prefix?: string | null; + suffix?: string | null; + } +} diff --git a/src/serialization/types/SchemaTimestampFieldDescriptor.ts b/src/serialization/types/SchemaTimestampFieldDescriptor.ts new file mode 100644 index 0000000..a13f230 --- /dev/null +++ b/src/serialization/types/SchemaTimestampFieldDescriptor.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaTimestampFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaTimestampFieldDescriptor.Raw, + DevRev.SchemaTimestampFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaTimestampFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: string | null; + } +} diff --git a/src/serialization/types/SchemaTimestampListFieldDescriptor.ts b/src/serialization/types/SchemaTimestampListFieldDescriptor.ts new file mode 100644 index 0000000..59ec19e --- /dev/null +++ b/src/serialization/types/SchemaTimestampListFieldDescriptor.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaTimestampListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaTimestampListFieldDescriptor.Raw, + DevRev.SchemaTimestampListFieldDescriptor +> = core.serialization + .object({ + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.string()).optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaTimestampListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + default_value?: string[] | null; + } +} diff --git a/src/serialization/types/SchemaTokensFieldDescriptor.ts b/src/serialization/types/SchemaTokensFieldDescriptor.ts new file mode 100644 index 0000000..fc0f0b3 --- /dev/null +++ b/src/serialization/types/SchemaTokensFieldDescriptor.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaTokensFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaTokensFieldDescriptor.Raw, + DevRev.SchemaTokensFieldDescriptor +> = core.serialization + .object({ + contains: core.serialization.string().optional(), + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + eqLen: core.serialization.property("eq_len", core.serialization.number().optional()), + maxLen: core.serialization.property("max_len", core.serialization.number().optional()), + minLen: core.serialization.property("min_len", core.serialization.number().optional()), + pattern: core.serialization.string().optional(), + prefix: core.serialization.string().optional(), + suffix: core.serialization.string().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaTokensFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + contains?: string | null; + default_value?: string | null; + eq_len?: number | null; + max_len?: number | null; + min_len?: number | null; + pattern?: string | null; + prefix?: string | null; + suffix?: string | null; + } +} diff --git a/src/serialization/types/SchemaTokensListFieldDescriptor.ts b/src/serialization/types/SchemaTokensListFieldDescriptor.ts new file mode 100644 index 0000000..f6f17e7 --- /dev/null +++ b/src/serialization/types/SchemaTokensListFieldDescriptor.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaTokensListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaTokensListFieldDescriptor.Raw, + DevRev.SchemaTokensListFieldDescriptor +> = core.serialization + .object({ + contains: core.serialization.string().optional(), + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.string()).optional() + ), + eqLen: core.serialization.property("eq_len", core.serialization.number().optional()), + maxLen: core.serialization.property("max_len", core.serialization.number().optional()), + minLen: core.serialization.property("min_len", core.serialization.number().optional()), + pattern: core.serialization.string().optional(), + prefix: core.serialization.string().optional(), + suffix: core.serialization.string().optional(), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaTokensListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + contains?: string | null; + default_value?: string[] | null; + eq_len?: number | null; + max_len?: number | null; + min_len?: number | null; + pattern?: string | null; + prefix?: string | null; + suffix?: string | null; + } +} diff --git a/src/serialization/types/SchemaUenumFieldDescriptor.ts b/src/serialization/types/SchemaUenumFieldDescriptor.ts new file mode 100644 index 0000000..5e985cb --- /dev/null +++ b/src/serialization/types/SchemaUenumFieldDescriptor.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldUenumValue } from "./SchemaFieldUenumValue"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaUenumFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaUenumFieldDescriptor.Raw, + DevRev.SchemaUenumFieldDescriptor +> = core.serialization + .object({ + allowedValues: core.serialization.property("allowed_values", core.serialization.list(SchemaFieldUenumValue)), + defaultValue: core.serialization.property("default_value", core.serialization.number().optional()), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaUenumFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + allowed_values: SchemaFieldUenumValue.Raw[]; + default_value?: number | null; + } +} diff --git a/src/serialization/types/SchemaUenumListFieldDescriptor.ts b/src/serialization/types/SchemaUenumListFieldDescriptor.ts new file mode 100644 index 0000000..ece1813 --- /dev/null +++ b/src/serialization/types/SchemaUenumListFieldDescriptor.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldUenumValue } from "./SchemaFieldUenumValue"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaUenumListFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaUenumListFieldDescriptor.Raw, + DevRev.SchemaUenumListFieldDescriptor +> = core.serialization + .object({ + allowedValues: core.serialization.property("allowed_values", core.serialization.list(SchemaFieldUenumValue)), + defaultValue: core.serialization.property( + "default_value", + core.serialization.list(core.serialization.number()).optional() + ), + }) + .extend(SchemaFieldDescriptorBase); + +export declare namespace SchemaUenumListFieldDescriptor { + interface Raw extends SchemaFieldDescriptorBase.Raw { + allowed_values: SchemaFieldUenumValue.Raw[]; + default_value?: number[] | null; + } +} diff --git a/src/serialization/types/SchemaUnknownFieldDescriptor.ts b/src/serialization/types/SchemaUnknownFieldDescriptor.ts new file mode 100644 index 0000000..7480deb --- /dev/null +++ b/src/serialization/types/SchemaUnknownFieldDescriptor.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptorBase } from "./SchemaFieldDescriptorBase"; + +export const SchemaUnknownFieldDescriptor: core.serialization.ObjectSchema< + serializers.SchemaUnknownFieldDescriptor.Raw, + DevRev.SchemaUnknownFieldDescriptor +> = SchemaFieldDescriptorBase; + +export declare namespace SchemaUnknownFieldDescriptor { + type Raw = SchemaFieldDescriptorBase.Raw; +} diff --git a/src/serialization/types/SearchCoreResponse.ts b/src/serialization/types/SearchCoreResponse.ts new file mode 100644 index 0000000..1a6c245 --- /dev/null +++ b/src/serialization/types/SearchCoreResponse.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SearchResult } from "./SearchResult"; + +export const SearchCoreResponse: core.serialization.ObjectSchema< + serializers.SearchCoreResponse.Raw, + DevRev.SearchCoreResponse +> = core.serialization.object({ + cursor: core.serialization.string().optional(), + results: core.serialization.list(SearchResult), +}); + +export declare namespace SearchCoreResponse { + interface Raw { + cursor?: string | null; + results: SearchResult.Raw[]; + } +} diff --git a/src/serialization/types/SearchHybridNamespace.ts b/src/serialization/types/SearchHybridNamespace.ts new file mode 100644 index 0000000..1001aa4 --- /dev/null +++ b/src/serialization/types/SearchHybridNamespace.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SearchHybridNamespace: core.serialization.Schema< + serializers.SearchHybridNamespace.Raw, + DevRev.SearchHybridNamespace +> = core.serialization.enum_([ + "article", + "conversation", + "dataset", + "incident", + "issue", + "part", + "question_answer", + "ticket", + "widget", + "work", +]); + +export declare namespace SearchHybridNamespace { + type Raw = + | "article" + | "conversation" + | "dataset" + | "incident" + | "issue" + | "part" + | "question_answer" + | "ticket" + | "widget" + | "work"; +} diff --git a/src/serialization/types/SearchHybridResponse.ts b/src/serialization/types/SearchHybridResponse.ts new file mode 100644 index 0000000..976406e --- /dev/null +++ b/src/serialization/types/SearchHybridResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SearchResult } from "./SearchResult"; + +export const SearchHybridResponse: core.serialization.ObjectSchema< + serializers.SearchHybridResponse.Raw, + DevRev.SearchHybridResponse +> = core.serialization.object({ + results: core.serialization.list(SearchResult), +}); + +export declare namespace SearchHybridResponse { + interface Raw { + results: SearchResult.Raw[]; + } +} diff --git a/src/serialization/types/SearchNamespace.ts b/src/serialization/types/SearchNamespace.ts new file mode 100644 index 0000000..ebe5aef --- /dev/null +++ b/src/serialization/types/SearchNamespace.ts @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SearchNamespace: core.serialization.Schema = + core.serialization.enum_([ + "account", + "article", + "capability", + "component", + "conversation", + "custom_object", + "custom_part", + "custom_work", + "dashboard", + "dev_user", + "enhancement", + "feature", + "group", + "issue", + "linkable", + "microservice", + "object_member", + "opportunity", + "product", + "project", + "question_answer", + "rev_org", + "rev_user", + "runnable", + "service_account", + "sys_user", + "tag", + "task", + "ticket", + "vista", + ]); + +export declare namespace SearchNamespace { + type Raw = + | "account" + | "article" + | "capability" + | "component" + | "conversation" + | "custom_object" + | "custom_part" + | "custom_work" + | "dashboard" + | "dev_user" + | "enhancement" + | "feature" + | "group" + | "issue" + | "linkable" + | "microservice" + | "object_member" + | "opportunity" + | "product" + | "project" + | "question_answer" + | "rev_org" + | "rev_user" + | "runnable" + | "service_account" + | "sys_user" + | "tag" + | "task" + | "ticket" + | "vista"; +} diff --git a/src/serialization/types/SearchResult.ts b/src/serialization/types/SearchResult.ts new file mode 100644 index 0000000..17d2c71 --- /dev/null +++ b/src/serialization/types/SearchResult.ts @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AccountSearchSummary } from "./AccountSearchSummary"; +import { ArticleSearchSummary } from "./ArticleSearchSummary"; +import { ArtifactSearchSummary } from "./ArtifactSearchSummary"; +import { ConversationSearchSummary } from "./ConversationSearchSummary"; +import { CustomObjectSearchSummary } from "./CustomObjectSearchSummary"; +import { DashboardSearchSummary } from "./DashboardSearchSummary"; +import { GroupSearchSummary } from "./GroupSearchSummary"; +import { LinkSearchSummary } from "./LinkSearchSummary"; +import { ObjectMemberSearchSummary } from "./ObjectMemberSearchSummary"; +import { OrgSearchSummary } from "./OrgSearchSummary"; +import { PartSearchSummary } from "./PartSearchSummary"; +import { QuestionAnswerSearchSummary } from "./QuestionAnswerSearchSummary"; +import { TagSearchSummary } from "./TagSearchSummary"; +import { UserSearchSummary } from "./UserSearchSummary"; +import { VistaSearchSummary } from "./VistaSearchSummary"; +import { WorkSearchSummary } from "./WorkSearchSummary"; + +export const SearchResult: core.serialization.Schema = + core.serialization + .union("type", { + account: AccountSearchSummary, + article: ArticleSearchSummary, + artifact: ArtifactSearchSummary, + conversation: ConversationSearchSummary, + custom_object: CustomObjectSearchSummary, + dashboard: DashboardSearchSummary, + group: GroupSearchSummary, + link: LinkSearchSummary, + object_member: ObjectMemberSearchSummary, + org: OrgSearchSummary, + part: PartSearchSummary, + question_answer: QuestionAnswerSearchSummary, + tag: TagSearchSummary, + user: UserSearchSummary, + vista: VistaSearchSummary, + work: WorkSearchSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace SearchResult { + type Raw = + | SearchResult.Account + | SearchResult.Article + | SearchResult.Artifact + | SearchResult.Conversation + | SearchResult.CustomObject + | SearchResult.Dashboard + | SearchResult.Group + | SearchResult.Link + | SearchResult.ObjectMember + | SearchResult.Org + | SearchResult.Part + | SearchResult.QuestionAnswer + | SearchResult.Tag + | SearchResult.User + | SearchResult.Vista + | SearchResult.Work; + + interface Account extends AccountSearchSummary.Raw { + type: "account"; + } + + interface Article extends ArticleSearchSummary.Raw { + type: "article"; + } + + interface Artifact extends ArtifactSearchSummary.Raw { + type: "artifact"; + } + + interface Conversation extends ConversationSearchSummary.Raw { + type: "conversation"; + } + + interface CustomObject extends CustomObjectSearchSummary.Raw { + type: "custom_object"; + } + + interface Dashboard extends DashboardSearchSummary.Raw { + type: "dashboard"; + } + + interface Group extends GroupSearchSummary.Raw { + type: "group"; + } + + interface Link extends LinkSearchSummary.Raw { + type: "link"; + } + + interface ObjectMember extends ObjectMemberSearchSummary.Raw { + type: "object_member"; + } + + interface Org extends OrgSearchSummary.Raw { + type: "org"; + } + + interface Part extends PartSearchSummary.Raw { + type: "part"; + } + + interface QuestionAnswer extends QuestionAnswerSearchSummary.Raw { + type: "question_answer"; + } + + interface Tag extends TagSearchSummary.Raw { + type: "tag"; + } + + interface User extends UserSearchSummary.Raw { + type: "user"; + } + + interface Vista extends VistaSearchSummary.Raw { + type: "vista"; + } + + interface Work extends WorkSearchSummary.Raw { + type: "work"; + } +} diff --git a/src/serialization/types/SearchResultType.ts b/src/serialization/types/SearchResultType.ts new file mode 100644 index 0000000..8e2016f --- /dev/null +++ b/src/serialization/types/SearchResultType.ts @@ -0,0 +1,47 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SearchResultType: core.serialization.Schema = + core.serialization.enum_([ + "account", + "article", + "artifact", + "conversation", + "custom_object", + "dashboard", + "group", + "link", + "object_member", + "org", + "part", + "question_answer", + "tag", + "user", + "vista", + "work", + ]); + +export declare namespace SearchResultType { + type Raw = + | "account" + | "article" + | "artifact" + | "conversation" + | "custom_object" + | "dashboard" + | "group" + | "link" + | "object_member" + | "org" + | "part" + | "question_answer" + | "tag" + | "user" + | "vista" + | "work"; +} diff --git a/src/serialization/types/SearchSortByParam.ts b/src/serialization/types/SearchSortByParam.ts new file mode 100644 index 0000000..31b9197 --- /dev/null +++ b/src/serialization/types/SearchSortByParam.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SearchSortByParam: core.serialization.Schema = + core.serialization.enum_(["created_date", "modified_date", "relevance"]); + +export declare namespace SearchSortByParam { + type Raw = "created_date" | "modified_date" | "relevance"; +} diff --git a/src/serialization/types/SearchSortOrderParam.ts b/src/serialization/types/SearchSortOrderParam.ts new file mode 100644 index 0000000..8f8ec07 --- /dev/null +++ b/src/serialization/types/SearchSortOrderParam.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SearchSortOrderParam: core.serialization.Schema< + serializers.SearchSortOrderParam.Raw, + DevRev.SearchSortOrderParam +> = core.serialization.enum_(["asc", "desc"]); + +export declare namespace SearchSortOrderParam { + type Raw = "asc" | "desc"; +} diff --git a/src/serialization/types/SearchSummaryBase.ts b/src/serialization/types/SearchSummaryBase.ts new file mode 100644 index 0000000..8d581a2 --- /dev/null +++ b/src/serialization/types/SearchSummaryBase.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SearchSummaryBase: core.serialization.ObjectSchema< + serializers.SearchSummaryBase.Raw, + DevRev.SearchSummaryBase +> = core.serialization.object({ + modifiedDate: core.serialization.property("modified_date", core.serialization.date().optional()), + snippet: core.serialization.string().optional(), +}); + +export declare namespace SearchSummaryBase { + interface Raw { + modified_date?: string | null; + snippet?: string | null; + } +} diff --git a/src/serialization/types/ServiceAccount.ts b/src/serialization/types/ServiceAccount.ts new file mode 100644 index 0000000..e6213b1 --- /dev/null +++ b/src/serialization/types/ServiceAccount.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserBase } from "./UserBase"; + +export const ServiceAccount: core.serialization.ObjectSchema = + UserBase; + +export declare namespace ServiceAccount { + type Raw = UserBase.Raw; +} diff --git a/src/serialization/types/ServiceAccountSummary.ts b/src/serialization/types/ServiceAccountSummary.ts new file mode 100644 index 0000000..525ccb5 --- /dev/null +++ b/src/serialization/types/ServiceAccountSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserBaseSummary } from "./UserBaseSummary"; + +export const ServiceAccountSummary: core.serialization.ObjectSchema< + serializers.ServiceAccountSummary.Raw, + DevRev.ServiceAccountSummary +> = UserBaseSummary; + +export declare namespace ServiceAccountSummary { + type Raw = UserBaseSummary.Raw; +} diff --git a/src/serialization/types/ServiceAccountsGetResponse.ts b/src/serialization/types/ServiceAccountsGetResponse.ts new file mode 100644 index 0000000..f191e1f --- /dev/null +++ b/src/serialization/types/ServiceAccountsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ServiceAccount } from "./ServiceAccount"; + +export const ServiceAccountsGetResponse: core.serialization.ObjectSchema< + serializers.ServiceAccountsGetResponse.Raw, + DevRev.ServiceAccountsGetResponse +> = core.serialization.object({ + serviceAccount: core.serialization.property("service_account", ServiceAccount), +}); + +export declare namespace ServiceAccountsGetResponse { + interface Raw { + service_account: ServiceAccount.Raw; + } +} diff --git a/src/serialization/types/SetIssueSelector.ts b/src/serialization/types/SetIssueSelector.ts new file mode 100644 index 0000000..da2657f --- /dev/null +++ b/src/serialization/types/SetIssueSelector.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SetIssueSelector: core.serialization.ObjectSchema< + serializers.SetIssueSelector.Raw, + DevRev.SetIssueSelector +> = core.serialization.object({ + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + parts: core.serialization.list(core.serialization.string()).optional(), + revOrgs: core.serialization.property("rev_orgs", core.serialization.list(core.serialization.string()).optional()), + stageName: core.serialization.property( + "stage_name", + core.serialization.list(core.serialization.string()).optional() + ), + subtype: core.serialization.list(core.serialization.string()).optional(), + tags: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace SetIssueSelector { + interface Raw { + custom_fields?: Record | null; + parts?: string[] | null; + rev_orgs?: string[] | null; + stage_name?: string[] | null; + subtype?: string[] | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/types/SetOrgScheduleFragmentSummary.ts b/src/serialization/types/SetOrgScheduleFragmentSummary.ts new file mode 100644 index 0000000..d04dbaa --- /dev/null +++ b/src/serialization/types/SetOrgScheduleFragmentSummary.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SetOrgScheduleFragmentSummary: core.serialization.ObjectSchema< + serializers.SetOrgScheduleFragmentSummary.Raw, + DevRev.SetOrgScheduleFragmentSummary +> = core.serialization.object({ + id: core.serialization.string(), +}); + +export declare namespace SetOrgScheduleFragmentSummary { + interface Raw { + id: string; + } +} diff --git a/src/serialization/types/SetSharedWithMembership.ts b/src/serialization/types/SetSharedWithMembership.ts new file mode 100644 index 0000000..1536b39 --- /dev/null +++ b/src/serialization/types/SetSharedWithMembership.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SetSharedWithMembership: core.serialization.Schema< + serializers.SetSharedWithMembership.Raw, + DevRev.SetSharedWithMembership +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SetSharedWithMembership { + type Raw = Record; +} diff --git a/src/serialization/types/SetSlaPolicy.ts b/src/serialization/types/SetSlaPolicy.ts new file mode 100644 index 0000000..9d58fed --- /dev/null +++ b/src/serialization/types/SetSlaPolicy.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetSupportMetricTarget } from "./SetSupportMetricTarget"; +import { SetSlaSelector } from "./SetSlaSelector"; + +export const SetSlaPolicy: core.serialization.ObjectSchema = + core.serialization.object({ + metrics: core.serialization.list(SetSupportMetricTarget).optional(), + name: core.serialization.string(), + selector: SetSlaSelector, + }); + +export declare namespace SetSlaPolicy { + interface Raw { + metrics?: SetSupportMetricTarget.Raw[] | null; + name: string; + selector: SetSlaSelector.Raw; + } +} diff --git a/src/serialization/types/SetSlaSelector.ts b/src/serialization/types/SetSlaSelector.ts new file mode 100644 index 0000000..0c2b184 --- /dev/null +++ b/src/serialization/types/SetSlaSelector.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SlaSelectorAppliesTo } from "./SlaSelectorAppliesTo"; +import { SetIssueSelector } from "./SetIssueSelector"; +import { SlaSelectorPriority } from "./SlaSelectorPriority"; +import { SlaSelectorSeverity } from "./SlaSelectorSeverity"; + +export const SetSlaSelector: core.serialization.ObjectSchema = + core.serialization.object({ + appliesTo: core.serialization.property("applies_to", SlaSelectorAppliesTo), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + issueSelector: core.serialization.property("issue_selector", SetIssueSelector.optional()), + parts: core.serialization.list(core.serialization.string()).optional(), + priority: core.serialization.list(SlaSelectorPriority).optional(), + severity: core.serialization.list(SlaSelectorSeverity).optional(), + sourceChannel: core.serialization.property( + "source_channel", + core.serialization.list(core.serialization.string()).optional() + ), + subtype: core.serialization.list(core.serialization.string()).optional(), + tags: core.serialization.list(core.serialization.string()).optional(), + }); + +export declare namespace SetSlaSelector { + interface Raw { + applies_to: SlaSelectorAppliesTo.Raw; + custom_fields?: Record | null; + issue_selector?: SetIssueSelector.Raw | null; + parts?: string[] | null; + priority?: SlaSelectorPriority.Raw[] | null; + severity?: SlaSelectorSeverity.Raw[] | null; + source_channel?: string[] | null; + subtype?: string[] | null; + tags?: string[] | null; + } +} diff --git a/src/serialization/types/SetSupportMetricTarget.ts b/src/serialization/types/SetSupportMetricTarget.ts new file mode 100644 index 0000000..68bffd6 --- /dev/null +++ b/src/serialization/types/SetSupportMetricTarget.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SetSupportMetricTarget: core.serialization.ObjectSchema< + serializers.SetSupportMetricTarget.Raw, + DevRev.SetSupportMetricTarget +> = core.serialization.object({ + metric: core.serialization.string(), + orgScheduleId: core.serialization.property("org_schedule_id", core.serialization.string().optional()), + performance: core.serialization.number().optional(), + target: core.serialization.number(), + warningTarget: core.serialization.property("warning_target", core.serialization.number().optional()), +}); + +export declare namespace SetSupportMetricTarget { + interface Raw { + metric: string; + org_schedule_id?: string | null; + performance?: number | null; + target: number; + warning_target?: number | null; + } +} diff --git a/src/serialization/types/SetTagWithValue.ts b/src/serialization/types/SetTagWithValue.ts new file mode 100644 index 0000000..6eb91c0 --- /dev/null +++ b/src/serialization/types/SetTagWithValue.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SetTagWithValue: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + value: core.serialization.string().optional(), + }); + +export declare namespace SetTagWithValue { + interface Raw { + id: string; + value?: string | null; + } +} diff --git a/src/serialization/types/SetWeeklyOrgSchedule.ts b/src/serialization/types/SetWeeklyOrgSchedule.ts new file mode 100644 index 0000000..55584c3 --- /dev/null +++ b/src/serialization/types/SetWeeklyOrgSchedule.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CreateWeeklyOrgScheduleInterval } from "./CreateWeeklyOrgScheduleInterval"; + +export const SetWeeklyOrgSchedule: core.serialization.ObjectSchema< + serializers.SetWeeklyOrgSchedule.Raw, + DevRev.SetWeeklyOrgSchedule +> = core.serialization.object({ + intervals: core.serialization.list(CreateWeeklyOrgScheduleInterval), + periodName: core.serialization.property("period_name", core.serialization.string()), +}); + +export declare namespace SetWeeklyOrgSchedule { + interface Raw { + intervals: CreateWeeklyOrgScheduleInterval.Raw[]; + period_name: string; + } +} diff --git a/src/serialization/types/SharedWithMembershipFilter.ts b/src/serialization/types/SharedWithMembershipFilter.ts new file mode 100644 index 0000000..1447605 --- /dev/null +++ b/src/serialization/types/SharedWithMembershipFilter.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SharedWithMembershipFilter: core.serialization.Schema< + serializers.SharedWithMembershipFilter.Raw, + DevRev.SharedWithMembershipFilter +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SharedWithMembershipFilter { + type Raw = Record; +} diff --git a/src/serialization/types/Sla.ts b/src/serialization/types/Sla.ts new file mode 100644 index 0000000..368b6b7 --- /dev/null +++ b/src/serialization/types/Sla.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SlaCompensation } from "./SlaCompensation"; +import { SlaEvaluationPeriod } from "./SlaEvaluationPeriod"; +import { SlaPolicy } from "./SlaPolicy"; +import { SlaType } from "./SlaType"; +import { SlaStatus } from "./SlaStatus"; +import { AtomBase } from "./AtomBase"; + +export const Sla: core.serialization.ObjectSchema = core.serialization + .object({ + compensation: SlaCompensation.optional(), + description: core.serialization.string().optional(), + evaluationPeriod: core.serialization.property("evaluation_period", SlaEvaluationPeriod.optional()), + name: core.serialization.string(), + policies: core.serialization.list(SlaPolicy).optional(), + slaType: core.serialization.property("sla_type", SlaType.optional()), + status: SlaStatus, + }) + .extend(AtomBase); + +export declare namespace Sla { + interface Raw extends AtomBase.Raw { + compensation?: SlaCompensation.Raw | null; + description?: string | null; + evaluation_period?: SlaEvaluationPeriod.Raw | null; + name: string; + policies?: SlaPolicy.Raw[] | null; + sla_type?: SlaType.Raw | null; + status: SlaStatus.Raw; + } +} diff --git a/src/serialization/types/SlaAppliesTo.ts b/src/serialization/types/SlaAppliesTo.ts new file mode 100644 index 0000000..1ed624d --- /dev/null +++ b/src/serialization/types/SlaAppliesTo.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaAppliesTo: core.serialization.Schema = + core.serialization.enum_(["conversation", "issue", "ticket"]); + +export declare namespace SlaAppliesTo { + type Raw = "conversation" | "issue" | "ticket"; +} diff --git a/src/serialization/types/SlaAssignResult.ts b/src/serialization/types/SlaAssignResult.ts new file mode 100644 index 0000000..486781b --- /dev/null +++ b/src/serialization/types/SlaAssignResult.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Error_ } from "./Error_"; +import { RevOrgSummary } from "./RevOrgSummary"; + +export const SlaAssignResult: core.serialization.ObjectSchema = + core.serialization.object({ + error: Error_.optional(), + revOrg: core.serialization.property("rev_org", RevOrgSummary), + }); + +export declare namespace SlaAssignResult { + interface Raw { + error?: Error_.Raw | null; + rev_org: RevOrgSummary.Raw; + } +} diff --git a/src/serialization/types/SlaCompensation.ts b/src/serialization/types/SlaCompensation.ts new file mode 100644 index 0000000..c5f5495 --- /dev/null +++ b/src/serialization/types/SlaCompensation.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaCompensation: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SlaCompensation { + type Raw = Record; +} diff --git a/src/serialization/types/SlaEvaluationPeriod.ts b/src/serialization/types/SlaEvaluationPeriod.ts new file mode 100644 index 0000000..4182211 --- /dev/null +++ b/src/serialization/types/SlaEvaluationPeriod.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaEvaluationPeriod: core.serialization.Schema< + serializers.SlaEvaluationPeriod.Raw, + DevRev.SlaEvaluationPeriod +> = core.serialization.enum_(["monthly", "quarterly", "weekly", "yearly"]); + +export declare namespace SlaEvaluationPeriod { + type Raw = "monthly" | "quarterly" | "weekly" | "yearly"; +} diff --git a/src/serialization/types/SlaPolicy.ts b/src/serialization/types/SlaPolicy.ts new file mode 100644 index 0000000..66a7ff4 --- /dev/null +++ b/src/serialization/types/SlaPolicy.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaPolicy: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SlaPolicy { + type Raw = Record; +} diff --git a/src/serialization/types/SlaSelectorAppliesTo.ts b/src/serialization/types/SlaSelectorAppliesTo.ts new file mode 100644 index 0000000..6de71fd --- /dev/null +++ b/src/serialization/types/SlaSelectorAppliesTo.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaSelectorAppliesTo: core.serialization.Schema< + serializers.SlaSelectorAppliesTo.Raw, + DevRev.SlaSelectorAppliesTo +> = core.serialization.enum_(["conversation", "issue", "ticket"]); + +export declare namespace SlaSelectorAppliesTo { + type Raw = "conversation" | "issue" | "ticket"; +} diff --git a/src/serialization/types/SlaSelectorPriority.ts b/src/serialization/types/SlaSelectorPriority.ts new file mode 100644 index 0000000..73be5f2 --- /dev/null +++ b/src/serialization/types/SlaSelectorPriority.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaSelectorPriority: core.serialization.Schema< + serializers.SlaSelectorPriority.Raw, + DevRev.SlaSelectorPriority +> = core.serialization.enum_(["p0", "p1", "p2"]); + +export declare namespace SlaSelectorPriority { + type Raw = "p0" | "p1" | "p2"; +} diff --git a/src/serialization/types/SlaSelectorSeverity.ts b/src/serialization/types/SlaSelectorSeverity.ts new file mode 100644 index 0000000..26f2cb5 --- /dev/null +++ b/src/serialization/types/SlaSelectorSeverity.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaSelectorSeverity: core.serialization.Schema< + serializers.SlaSelectorSeverity.Raw, + DevRev.SlaSelectorSeverity +> = core.serialization.enum_(["blocker", "high", "low", "medium"]); + +export declare namespace SlaSelectorSeverity { + type Raw = "blocker" | "high" | "low" | "medium"; +} diff --git a/src/serialization/types/SlaStatus.ts b/src/serialization/types/SlaStatus.ts new file mode 100644 index 0000000..6998a65 --- /dev/null +++ b/src/serialization/types/SlaStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaStatus: core.serialization.Schema = + core.serialization.enum_(["archived", "draft", "published"]); + +export declare namespace SlaStatus { + type Raw = "archived" | "draft" | "published"; +} diff --git a/src/serialization/types/SlaSummary.ts b/src/serialization/types/SlaSummary.ts new file mode 100644 index 0000000..976f627 --- /dev/null +++ b/src/serialization/types/SlaSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SlaType } from "./SlaType"; +import { SlaStatus } from "./SlaStatus"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const SlaSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + name: core.serialization.string(), + slaType: core.serialization.property("sla_type", SlaType.optional()), + status: SlaStatus, + }) + .extend(AtomBaseSummary); + +export declare namespace SlaSummary { + interface Raw extends AtomBaseSummary.Raw { + name: string; + sla_type?: SlaType.Raw | null; + status: SlaStatus.Raw; + } +} diff --git a/src/serialization/types/SlaSummaryFilter.ts b/src/serialization/types/SlaSummaryFilter.ts new file mode 100644 index 0000000..5518e99 --- /dev/null +++ b/src/serialization/types/SlaSummaryFilter.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SlaSummaryStage } from "./SlaSummaryStage"; +import { DateFilter } from "./DateFilter"; + +export const SlaSummaryFilter: core.serialization.ObjectSchema< + serializers.SlaSummaryFilter.Raw, + DevRev.SlaSummaryFilter +> = core.serialization.object({ + stage: core.serialization.list(SlaSummaryStage).optional(), + targetTime: core.serialization.property("target_time", DateFilter.optional()), +}); + +export declare namespace SlaSummaryFilter { + interface Raw { + stage?: SlaSummaryStage.Raw[] | null; + target_time?: DateFilter.Raw | null; + } +} diff --git a/src/serialization/types/SlaSummaryStage.ts b/src/serialization/types/SlaSummaryStage.ts new file mode 100644 index 0000000..14f2ee1 --- /dev/null +++ b/src/serialization/types/SlaSummaryStage.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaSummaryStage: core.serialization.Schema = + core.serialization.enum_(["breached", "completed", "paused", "running", "warning"]); + +export declare namespace SlaSummaryStage { + type Raw = "breached" | "completed" | "paused" | "running" | "warning"; +} diff --git a/src/serialization/types/SlaTracker.ts b/src/serialization/types/SlaTracker.ts new file mode 100644 index 0000000..c106b06 --- /dev/null +++ b/src/serialization/types/SlaTracker.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArchetypeMetricTarget } from "./ArchetypeMetricTarget"; +import { SlaSummary } from "./SlaSummary"; +import { AtomBase } from "./AtomBase"; + +export const SlaTracker: core.serialization.ObjectSchema = + core.serialization + .object({ + appliesToId: core.serialization.property("applies_to_id", core.serialization.string().optional()), + metricTargetSummaries: core.serialization.property( + "metric_target_summaries", + core.serialization.list(ArchetypeMetricTarget) + ), + sla: SlaSummary.optional(), + slaPolicyId: core.serialization.property("sla_policy_id", core.serialization.string().optional()), + stage: core.serialization.string().optional(), + status: core.serialization.string().optional(), + }) + .extend(AtomBase); + +export declare namespace SlaTracker { + interface Raw extends AtomBase.Raw { + applies_to_id?: string | null; + metric_target_summaries: ArchetypeMetricTarget.Raw[]; + sla?: SlaSummary.Raw | null; + sla_policy_id?: string | null; + stage?: string | null; + status?: string | null; + } +} diff --git a/src/serialization/types/SlaTrackerSummary.ts b/src/serialization/types/SlaTrackerSummary.ts new file mode 100644 index 0000000..bceaac1 --- /dev/null +++ b/src/serialization/types/SlaTrackerSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const SlaTrackerSummary: core.serialization.ObjectSchema< + serializers.SlaTrackerSummary.Raw, + DevRev.SlaTrackerSummary +> = AtomBaseSummary; + +export declare namespace SlaTrackerSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/SlaType.ts b/src/serialization/types/SlaType.ts new file mode 100644 index 0000000..e8331b8 --- /dev/null +++ b/src/serialization/types/SlaType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlaType: core.serialization.Schema = core.serialization.enum_([ + "external", + "internal", +]); + +export declare namespace SlaType { + type Raw = "external" | "internal"; +} diff --git a/src/serialization/types/SlasAssignResponse.ts b/src/serialization/types/SlasAssignResponse.ts new file mode 100644 index 0000000..54b3e03 --- /dev/null +++ b/src/serialization/types/SlasAssignResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SlaAssignResult } from "./SlaAssignResult"; + +export const SlasAssignResponse: core.serialization.ObjectSchema< + serializers.SlasAssignResponse.Raw, + DevRev.SlasAssignResponse +> = core.serialization.object({ + results: core.serialization.list(SlaAssignResult), +}); + +export declare namespace SlasAssignResponse { + interface Raw { + results: SlaAssignResult.Raw[]; + } +} diff --git a/src/serialization/types/SlasCreateResponse.ts b/src/serialization/types/SlasCreateResponse.ts new file mode 100644 index 0000000..d9ba322 --- /dev/null +++ b/src/serialization/types/SlasCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Sla } from "./Sla"; + +export const SlasCreateResponse: core.serialization.ObjectSchema< + serializers.SlasCreateResponse.Raw, + DevRev.SlasCreateResponse +> = core.serialization.object({ + sla: Sla, +}); + +export declare namespace SlasCreateResponse { + interface Raw { + sla: Sla.Raw; + } +} diff --git a/src/serialization/types/SlasFilterAppliesToOperatorType.ts b/src/serialization/types/SlasFilterAppliesToOperatorType.ts new file mode 100644 index 0000000..2f7a272 --- /dev/null +++ b/src/serialization/types/SlasFilterAppliesToOperatorType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SlasFilterAppliesToOperatorType: core.serialization.Schema< + serializers.SlasFilterAppliesToOperatorType.Raw, + DevRev.SlasFilterAppliesToOperatorType +> = core.serialization.enum_(["all", "any"]); + +export declare namespace SlasFilterAppliesToOperatorType { + type Raw = "all" | "any"; +} diff --git a/src/serialization/types/SlasGetResponse.ts b/src/serialization/types/SlasGetResponse.ts new file mode 100644 index 0000000..00e8cee --- /dev/null +++ b/src/serialization/types/SlasGetResponse.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Sla } from "./Sla"; + +export const SlasGetResponse: core.serialization.ObjectSchema = + core.serialization.object({ + sla: Sla, + }); + +export declare namespace SlasGetResponse { + interface Raw { + sla: Sla.Raw; + } +} diff --git a/src/serialization/types/SlasListResponse.ts b/src/serialization/types/SlasListResponse.ts new file mode 100644 index 0000000..5a597ab --- /dev/null +++ b/src/serialization/types/SlasListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Sla } from "./Sla"; + +export const SlasListResponse: core.serialization.ObjectSchema< + serializers.SlasListResponse.Raw, + DevRev.SlasListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + slas: core.serialization.list(Sla), +}); + +export declare namespace SlasListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + slas: Sla.Raw[]; + } +} diff --git a/src/serialization/types/SlasTransitionResponse.ts b/src/serialization/types/SlasTransitionResponse.ts new file mode 100644 index 0000000..6b079b8 --- /dev/null +++ b/src/serialization/types/SlasTransitionResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Sla } from "./Sla"; + +export const SlasTransitionResponse: core.serialization.ObjectSchema< + serializers.SlasTransitionResponse.Raw, + DevRev.SlasTransitionResponse +> = core.serialization.object({ + sla: Sla, +}); + +export declare namespace SlasTransitionResponse { + interface Raw { + sla: Sla.Raw; + } +} diff --git a/src/serialization/types/SlasUpdateResponse.ts b/src/serialization/types/SlasUpdateResponse.ts new file mode 100644 index 0000000..6f51141 --- /dev/null +++ b/src/serialization/types/SlasUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Sla } from "./Sla"; + +export const SlasUpdateResponse: core.serialization.ObjectSchema< + serializers.SlasUpdateResponse.Raw, + DevRev.SlasUpdateResponse +> = core.serialization.object({ + sla: Sla, +}); + +export declare namespace SlasUpdateResponse { + interface Raw { + sla: Sla.Raw; + } +} diff --git a/src/serialization/types/SnapInVersionSummary.ts b/src/serialization/types/SnapInVersionSummary.ts new file mode 100644 index 0000000..0b6b6d8 --- /dev/null +++ b/src/serialization/types/SnapInVersionSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const SnapInVersionSummary: core.serialization.ObjectSchema< + serializers.SnapInVersionSummary.Raw, + DevRev.SnapInVersionSummary +> = AtomBaseSummary; + +export declare namespace SnapInVersionSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/SnapInsResourcesResponse.ts b/src/serialization/types/SnapInsResourcesResponse.ts new file mode 100644 index 0000000..a4bb2cc --- /dev/null +++ b/src/serialization/types/SnapInsResourcesResponse.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SnapInsResourcesResponseKeyringData } from "./SnapInsResourcesResponseKeyringData"; +import { SnapInVersionSummary } from "./SnapInVersionSummary"; + +export const SnapInsResourcesResponse: core.serialization.ObjectSchema< + serializers.SnapInsResourcesResponse.Raw, + DevRev.SnapInsResourcesResponse +> = core.serialization.object({ + eventSources: core.serialization.property( + "event_sources", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional() + ), + inputs: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + keyrings: core.serialization.record(core.serialization.string(), SnapInsResourcesResponseKeyringData).optional(), + snapInVersion: core.serialization.property("snap_in_version", SnapInVersionSummary), +}); + +export declare namespace SnapInsResourcesResponse { + interface Raw { + event_sources?: Record | null; + inputs?: Record | null; + keyrings?: Record | null; + snap_in_version: SnapInVersionSummary.Raw; + } +} diff --git a/src/serialization/types/SnapInsResourcesResponseKeyringData.ts b/src/serialization/types/SnapInsResourcesResponseKeyringData.ts new file mode 100644 index 0000000..71b2468 --- /dev/null +++ b/src/serialization/types/SnapInsResourcesResponseKeyringData.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SnapInsResourcesResponseKeyringData: core.serialization.ObjectSchema< + serializers.SnapInsResourcesResponseKeyringData.Raw, + DevRev.SnapInsResourcesResponseKeyringData +> = core.serialization.object({ + id: core.serialization.string(), + secret: core.serialization.string(), +}); + +export declare namespace SnapInsResourcesResponseKeyringData { + interface Raw { + id: string; + secret: string; + } +} diff --git a/src/serialization/types/SnapWidget.ts b/src/serialization/types/SnapWidget.ts new file mode 100644 index 0000000..155ca54 --- /dev/null +++ b/src/serialization/types/SnapWidget.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { EmailPreviewWidget } from "./EmailPreviewWidget"; + +export const SnapWidget: core.serialization.Schema = core.serialization + .union("type", { + email_preview: EmailPreviewWidget, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace SnapWidget { + type Raw = SnapWidget.EmailPreview; + + interface EmailPreview extends EmailPreviewWidget.Raw { + type: "email_preview"; + } +} diff --git a/src/serialization/types/SnapWidgetBase.ts b/src/serialization/types/SnapWidgetBase.ts new file mode 100644 index 0000000..712eac8 --- /dev/null +++ b/src/serialization/types/SnapWidgetBase.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SnapWidgetNamespace } from "./SnapWidgetNamespace"; +import { SnapWidgetStatus } from "./SnapWidgetStatus"; +import { AtomBase } from "./AtomBase"; + +export const SnapWidgetBase: core.serialization.ObjectSchema = + core.serialization + .object({ + name: core.serialization.string(), + namespace: SnapWidgetNamespace.optional(), + status: SnapWidgetStatus, + }) + .extend(AtomBase); + +export declare namespace SnapWidgetBase { + interface Raw extends AtomBase.Raw { + name: string; + namespace?: SnapWidgetNamespace.Raw | null; + status: SnapWidgetStatus.Raw; + } +} diff --git a/src/serialization/types/SnapWidgetNamespace.ts b/src/serialization/types/SnapWidgetNamespace.ts new file mode 100644 index 0000000..e60b33a --- /dev/null +++ b/src/serialization/types/SnapWidgetNamespace.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SnapWidgetNamespace: core.serialization.Schema< + serializers.SnapWidgetNamespace.Raw, + DevRev.SnapWidgetNamespace +> = core.serialization.enum_(["comment_suggestion_replies", "email_preview", "link_preview", "plug_nudge"]); + +export declare namespace SnapWidgetNamespace { + type Raw = "comment_suggestion_replies" | "email_preview" | "link_preview" | "plug_nudge"; +} diff --git a/src/serialization/types/SnapWidgetStatus.ts b/src/serialization/types/SnapWidgetStatus.ts new file mode 100644 index 0000000..45fea1b --- /dev/null +++ b/src/serialization/types/SnapWidgetStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SnapWidgetStatus: core.serialization.Schema = + core.serialization.enum_(["draft", "published"]); + +export declare namespace SnapWidgetStatus { + type Raw = "draft" | "published"; +} diff --git a/src/serialization/types/SnapWidgetType.ts b/src/serialization/types/SnapWidgetType.ts new file mode 100644 index 0000000..b5143f0 --- /dev/null +++ b/src/serialization/types/SnapWidgetType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SnapWidgetType: core.serialization.Schema = + core.serialization.stringLiteral("email_preview"); + +export declare namespace SnapWidgetType { + type Raw = "email_preview"; +} diff --git a/src/serialization/types/SnapWidgetsCreateRequest.ts b/src/serialization/types/SnapWidgetsCreateRequest.ts new file mode 100644 index 0000000..e5123cc --- /dev/null +++ b/src/serialization/types/SnapWidgetsCreateRequest.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { SnapWidgetNamespace } from "./SnapWidgetNamespace"; +import { SnapWidgetStatus } from "./SnapWidgetStatus"; +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { CreateEmailPreviewWidget } from "./CreateEmailPreviewWidget"; + +const _Base = core.serialization.object({ + name: core.serialization.string(), + namespace: SnapWidgetNamespace.optional(), + status: SnapWidgetStatus.optional(), +}); +export const SnapWidgetsCreateRequest: core.serialization.Schema< + serializers.SnapWidgetsCreateRequest.Raw, + DevRev.SnapWidgetsCreateRequest +> = core.serialization + .union("type", { + email_preview: CreateEmailPreviewWidget.extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace SnapWidgetsCreateRequest { + type Raw = SnapWidgetsCreateRequest.EmailPreview; + + interface EmailPreview extends _Base, CreateEmailPreviewWidget.Raw { + type: "email_preview"; + } + + interface _Base { + name: string; + namespace?: SnapWidgetNamespace.Raw | null; + status?: SnapWidgetStatus.Raw | null; + } +} diff --git a/src/serialization/types/SnapWidgetsCreateRequestType.ts b/src/serialization/types/SnapWidgetsCreateRequestType.ts new file mode 100644 index 0000000..8cb5788 --- /dev/null +++ b/src/serialization/types/SnapWidgetsCreateRequestType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SnapWidgetsCreateRequestType: core.serialization.Schema< + serializers.SnapWidgetsCreateRequestType.Raw, + DevRev.SnapWidgetsCreateRequestType +> = core.serialization.stringLiteral("email_preview"); + +export declare namespace SnapWidgetsCreateRequestType { + type Raw = "email_preview"; +} diff --git a/src/serialization/types/SnapWidgetsCreateResponse.ts b/src/serialization/types/SnapWidgetsCreateResponse.ts new file mode 100644 index 0000000..6e629be --- /dev/null +++ b/src/serialization/types/SnapWidgetsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SnapWidget } from "./SnapWidget"; + +export const SnapWidgetsCreateResponse: core.serialization.ObjectSchema< + serializers.SnapWidgetsCreateResponse.Raw, + DevRev.SnapWidgetsCreateResponse +> = core.serialization.object({ + snapWidget: core.serialization.property("snap_widget", SnapWidget), +}); + +export declare namespace SnapWidgetsCreateResponse { + interface Raw { + snap_widget: SnapWidget.Raw; + } +} diff --git a/src/serialization/types/StageDiagramSummary.ts b/src/serialization/types/StageDiagramSummary.ts new file mode 100644 index 0000000..42a4594 --- /dev/null +++ b/src/serialization/types/StageDiagramSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const StageDiagramSummary: core.serialization.ObjectSchema< + serializers.StageDiagramSummary.Raw, + DevRev.StageDiagramSummary +> = AtomBaseSummary; + +export declare namespace StageDiagramSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/StageFilter.ts b/src/serialization/types/StageFilter.ts new file mode 100644 index 0000000..a83aa3f --- /dev/null +++ b/src/serialization/types/StageFilter.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StageFilter: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.list(core.serialization.string()).optional(), + }); + +export declare namespace StageFilter { + interface Raw { + name?: string[] | null; + } +} diff --git a/src/serialization/types/StageInit.ts b/src/serialization/types/StageInit.ts new file mode 100644 index 0000000..321d83b --- /dev/null +++ b/src/serialization/types/StageInit.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StageInit: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optional(), + name: core.serialization.string().optional(), + }); + +export declare namespace StageInit { + interface Raw { + id?: string | null; + name?: string | null; + } +} diff --git a/src/serialization/types/StageUpdate.ts b/src/serialization/types/StageUpdate.ts new file mode 100644 index 0000000..99cc99a --- /dev/null +++ b/src/serialization/types/StageUpdate.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StageUpdate: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string().optional(), + stage: core.serialization.string().optional(), + }); + +export declare namespace StageUpdate { + interface Raw { + name?: string | null; + stage?: string | null; + } +} diff --git a/src/serialization/types/StageValidationOptionForCreate.ts b/src/serialization/types/StageValidationOptionForCreate.ts new file mode 100644 index 0000000..bb05dfc --- /dev/null +++ b/src/serialization/types/StageValidationOptionForCreate.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StageValidationOptionForCreate: core.serialization.Schema< + serializers.StageValidationOptionForCreate.Raw, + DevRev.StageValidationOptionForCreate +> = core.serialization.stringLiteral("allow_non_start"); + +export declare namespace StageValidationOptionForCreate { + type Raw = "allow_non_start"; +} diff --git a/src/serialization/types/StageValidationOptionForUpdate.ts b/src/serialization/types/StageValidationOptionForUpdate.ts new file mode 100644 index 0000000..57f0289 --- /dev/null +++ b/src/serialization/types/StageValidationOptionForUpdate.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StageValidationOptionForUpdate: core.serialization.Schema< + serializers.StageValidationOptionForUpdate.Raw, + DevRev.StageValidationOptionForUpdate +> = core.serialization.stringLiteral("allow_invalid_transition"); + +export declare namespace StageValidationOptionForUpdate { + type Raw = "allow_invalid_transition"; +} diff --git a/src/serialization/types/StagedInfoFilter.ts b/src/serialization/types/StagedInfoFilter.ts new file mode 100644 index 0000000..1b2df80 --- /dev/null +++ b/src/serialization/types/StagedInfoFilter.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StagedInfoFilter: core.serialization.ObjectSchema< + serializers.StagedInfoFilter.Raw, + DevRev.StagedInfoFilter +> = core.serialization.object({ + isStaged: core.serialization.property("is_staged", core.serialization.boolean().optional()), +}); + +export declare namespace StagedInfoFilter { + interface Raw { + is_staged?: boolean | null; + } +} diff --git a/src/serialization/types/StockFieldOverride.ts b/src/serialization/types/StockFieldOverride.ts new file mode 100644 index 0000000..cc10535 --- /dev/null +++ b/src/serialization/types/StockFieldOverride.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StockFieldOverride: core.serialization.Schema< + serializers.StockFieldOverride.Raw, + DevRev.StockFieldOverride +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace StockFieldOverride { + type Raw = Record; +} diff --git a/src/serialization/types/StockSchemaFragment.ts b/src/serialization/types/StockSchemaFragment.ts new file mode 100644 index 0000000..4863926 --- /dev/null +++ b/src/serialization/types/StockSchemaFragment.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptor } from "./SchemaFieldDescriptor"; +import { AtomSummary } from "./AtomSummary"; +import { AtomBase } from "./AtomBase"; + +export const StockSchemaFragment: core.serialization.ObjectSchema< + serializers.StockSchemaFragment.Raw, + DevRev.StockSchemaFragment +> = core.serialization + .object({ + description: core.serialization.string().optional(), + fields: core.serialization.list(SchemaFieldDescriptor), + leafType: core.serialization.property("leaf_type", core.serialization.string().optional()), + newFragmentRef: core.serialization.property("new_fragment_ref", AtomSummary.optional()), + oldFragmentRef: core.serialization.property("old_fragment_ref", AtomSummary.optional()), + title: core.serialization.string().optional(), + }) + .extend(AtomBase); + +export declare namespace StockSchemaFragment { + interface Raw extends AtomBase.Raw { + description?: string | null; + fields: SchemaFieldDescriptor.Raw[]; + leaf_type?: string | null; + new_fragment_ref?: AtomSummary.Raw | null; + old_fragment_ref?: AtomSummary.Raw | null; + title?: string | null; + } +} diff --git a/src/serialization/types/StockSchemaFragmentsGetResponse.ts b/src/serialization/types/StockSchemaFragmentsGetResponse.ts new file mode 100644 index 0000000..7264ae3 --- /dev/null +++ b/src/serialization/types/StockSchemaFragmentsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { StockSchemaFragment } from "./StockSchemaFragment"; + +export const StockSchemaFragmentsGetResponse: core.serialization.ObjectSchema< + serializers.StockSchemaFragmentsGetResponse.Raw, + DevRev.StockSchemaFragmentsGetResponse +> = core.serialization.object({ + fragment: StockSchemaFragment, +}); + +export declare namespace StockSchemaFragmentsGetResponse { + interface Raw { + fragment: StockSchemaFragment.Raw; + } +} diff --git a/src/serialization/types/StockSchemaFragmentsListRequestFilterPreset.ts b/src/serialization/types/StockSchemaFragmentsListRequestFilterPreset.ts new file mode 100644 index 0000000..2e7b7a8 --- /dev/null +++ b/src/serialization/types/StockSchemaFragmentsListRequestFilterPreset.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StockSchemaFragmentsListRequestFilterPreset: core.serialization.Schema< + serializers.StockSchemaFragmentsListRequestFilterPreset.Raw, + DevRev.StockSchemaFragmentsListRequestFilterPreset +> = core.serialization.enum_(["customizable_types_preset", "no_preset"]); + +export declare namespace StockSchemaFragmentsListRequestFilterPreset { + type Raw = "customizable_types_preset" | "no_preset"; +} diff --git a/src/serialization/types/StockSchemaFragmentsListRequestPrune.ts b/src/serialization/types/StockSchemaFragmentsListRequestPrune.ts new file mode 100644 index 0000000..4e620d6 --- /dev/null +++ b/src/serialization/types/StockSchemaFragmentsListRequestPrune.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const StockSchemaFragmentsListRequestPrune: core.serialization.Schema< + serializers.StockSchemaFragmentsListRequestPrune.Raw, + DevRev.StockSchemaFragmentsListRequestPrune +> = core.serialization.enum_(["composite_schemas", "fields"]); + +export declare namespace StockSchemaFragmentsListRequestPrune { + type Raw = "composite_schemas" | "fields"; +} diff --git a/src/serialization/types/StockSchemaFragmentsListResponse.ts b/src/serialization/types/StockSchemaFragmentsListResponse.ts new file mode 100644 index 0000000..0617cbc --- /dev/null +++ b/src/serialization/types/StockSchemaFragmentsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { StockSchemaFragment } from "./StockSchemaFragment"; + +export const StockSchemaFragmentsListResponse: core.serialization.ObjectSchema< + serializers.StockSchemaFragmentsListResponse.Raw, + DevRev.StockSchemaFragmentsListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + result: core.serialization.list(StockSchemaFragment), +}); + +export declare namespace StockSchemaFragmentsListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + result: StockSchemaFragment.Raw[]; + } +} diff --git a/src/serialization/types/Subtype.ts b/src/serialization/types/Subtype.ts new file mode 100644 index 0000000..eaf0462 --- /dev/null +++ b/src/serialization/types/Subtype.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const Subtype: core.serialization.ObjectSchema = + core.serialization.object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + fragmentId: core.serialization.property("fragment_id", core.serialization.string()), + leafType: core.serialization.property("leaf_type", core.serialization.string()), + value: core.serialization.string(), + }); + +export declare namespace Subtype { + interface Raw { + display_name?: string | null; + fragment_id: string; + leaf_type: string; + value: string; + } +} diff --git a/src/serialization/types/SubtypesListResponse.ts b/src/serialization/types/SubtypesListResponse.ts new file mode 100644 index 0000000..2db9957 --- /dev/null +++ b/src/serialization/types/SubtypesListResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Subtype } from "./Subtype"; + +export const SubtypesListResponse: core.serialization.ObjectSchema< + serializers.SubtypesListResponse.Raw, + DevRev.SubtypesListResponse +> = core.serialization.object({ + subtypes: core.serialization.list(Subtype), +}); + +export declare namespace SubtypesListResponse { + interface Raw { + subtypes: Subtype.Raw[]; + } +} diff --git a/src/serialization/types/Survey.ts b/src/serialization/types/Survey.ts new file mode 100644 index 0000000..7c2b59b --- /dev/null +++ b/src/serialization/types/Survey.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptor } from "./SchemaFieldDescriptor"; +import { SurveyFieldWithMetadata } from "./SurveyFieldWithMetadata"; +import { AtomBase } from "./AtomBase"; + +export const Survey: core.serialization.ObjectSchema = core.serialization + .object({ + description: core.serialization.string().optional(), + introductoryText: core.serialization.property("introductory_text", core.serialization.string().optional()), + name: core.serialization.string().optional(), + responseText: core.serialization.property("response_text", core.serialization.string().optional()), + schema: core.serialization.list(SchemaFieldDescriptor).optional(), + schemaWithMetadata: core.serialization.property( + "schema_with_metadata", + core.serialization.list(SurveyFieldWithMetadata).optional() + ), + }) + .extend(AtomBase); + +export declare namespace Survey { + interface Raw extends AtomBase.Raw { + description?: string | null; + introductory_text?: string | null; + name?: string | null; + response_text?: string | null; + schema?: SchemaFieldDescriptor.Raw[] | null; + schema_with_metadata?: SurveyFieldWithMetadata.Raw[] | null; + } +} diff --git a/src/serialization/types/SurveyAggregationFilter.ts b/src/serialization/types/SurveyAggregationFilter.ts new file mode 100644 index 0000000..8ff2102 --- /dev/null +++ b/src/serialization/types/SurveyAggregationFilter.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SurveyAggregationFilter: core.serialization.Schema< + serializers.SurveyAggregationFilter.Raw, + DevRev.SurveyAggregationFilter +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SurveyAggregationFilter { + type Raw = Record; +} diff --git a/src/serialization/types/SurveyFieldWithMetadata.ts b/src/serialization/types/SurveyFieldWithMetadata.ts new file mode 100644 index 0000000..96c2a69 --- /dev/null +++ b/src/serialization/types/SurveyFieldWithMetadata.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SchemaFieldDescriptor } from "./SchemaFieldDescriptor"; + +export const SurveyFieldWithMetadata: core.serialization.ObjectSchema< + serializers.SurveyFieldWithMetadata.Raw, + DevRev.SurveyFieldWithMetadata +> = core.serialization.object({ + field: SchemaFieldDescriptor.optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + question: core.serialization.string().optional(), +}); + +export declare namespace SurveyFieldWithMetadata { + interface Raw { + field?: SchemaFieldDescriptor.Raw | null; + metadata?: Record | null; + question?: string | null; + } +} diff --git a/src/serialization/types/SurveyResponse.ts b/src/serialization/types/SurveyResponse.ts new file mode 100644 index 0000000..37e822e --- /dev/null +++ b/src/serialization/types/SurveyResponse.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { EnumValue } from "./EnumValue"; +import { UserSummary } from "./UserSummary"; +import { AtomBase } from "./AtomBase"; + +export const SurveyResponse: core.serialization.ObjectSchema = + core.serialization + .object({ + dispatchId: core.serialization.property("dispatch_id", core.serialization.string().optional()), + dispatchedChannels: core.serialization.property( + "dispatched_channels", + core.serialization.list(EnumValue).optional() + ), + object: core.serialization.string().optional(), + recipient: UserSummary.optional(), + response: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + responseChannel: core.serialization.property("response_channel", EnumValue.optional()), + stage: EnumValue.optional(), + survey: core.serialization.string().optional(), + }) + .extend(AtomBase); + +export declare namespace SurveyResponse { + interface Raw extends AtomBase.Raw { + dispatch_id?: string | null; + dispatched_channels?: EnumValue.Raw[] | null; + object?: string | null; + recipient?: UserSummary.Raw | null; + response?: Record | null; + response_channel?: EnumValue.Raw | null; + stage?: EnumValue.Raw | null; + survey?: string | null; + } +} diff --git a/src/serialization/types/SurveysCreateResponse.ts b/src/serialization/types/SurveysCreateResponse.ts new file mode 100644 index 0000000..2ef5e88 --- /dev/null +++ b/src/serialization/types/SurveysCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Survey } from "./Survey"; + +export const SurveysCreateResponse: core.serialization.ObjectSchema< + serializers.SurveysCreateResponse.Raw, + DevRev.SurveysCreateResponse +> = core.serialization.object({ + survey: Survey, +}); + +export declare namespace SurveysCreateResponse { + interface Raw { + survey: Survey.Raw; + } +} diff --git a/src/serialization/types/SurveysDeleteResponse.ts b/src/serialization/types/SurveysDeleteResponse.ts new file mode 100644 index 0000000..36fbeaf --- /dev/null +++ b/src/serialization/types/SurveysDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SurveysDeleteResponse: core.serialization.Schema< + serializers.SurveysDeleteResponse.Raw, + DevRev.SurveysDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SurveysDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/SurveysListResponse.ts b/src/serialization/types/SurveysListResponse.ts new file mode 100644 index 0000000..2951591 --- /dev/null +++ b/src/serialization/types/SurveysListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Survey } from "./Survey"; + +export const SurveysListResponse: core.serialization.ObjectSchema< + serializers.SurveysListResponse.Raw, + DevRev.SurveysListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + surveys: core.serialization.list(Survey), +}); + +export declare namespace SurveysListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + surveys: Survey.Raw[]; + } +} diff --git a/src/serialization/types/SurveysResponsesListResponse.ts b/src/serialization/types/SurveysResponsesListResponse.ts new file mode 100644 index 0000000..7a44f1e --- /dev/null +++ b/src/serialization/types/SurveysResponsesListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SurveyResponse } from "./SurveyResponse"; + +export const SurveysResponsesListResponse: core.serialization.ObjectSchema< + serializers.SurveysResponsesListResponse.Raw, + DevRev.SurveysResponsesListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + surveyResponses: core.serialization.property("survey_responses", core.serialization.list(SurveyResponse)), +}); + +export declare namespace SurveysResponsesListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + survey_responses: SurveyResponse.Raw[]; + } +} diff --git a/src/serialization/types/SurveysSendRequestEmail.ts b/src/serialization/types/SurveysSendRequestEmail.ts new file mode 100644 index 0000000..f70748c --- /dev/null +++ b/src/serialization/types/SurveysSendRequestEmail.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SurveysSendRequestEmail: core.serialization.ObjectSchema< + serializers.SurveysSendRequestEmail.Raw, + DevRev.SurveysSendRequestEmail +> = core.serialization.object({ + body: core.serialization.string(), + recipients: core.serialization.list(core.serialization.string()), + sender: core.serialization.string(), + subject: core.serialization.string(), +}); + +export declare namespace SurveysSendRequestEmail { + interface Raw { + body: string; + recipients: string[]; + sender: string; + subject: string; + } +} diff --git a/src/serialization/types/SurveysSendResponse.ts b/src/serialization/types/SurveysSendResponse.ts new file mode 100644 index 0000000..b03637f --- /dev/null +++ b/src/serialization/types/SurveysSendResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SurveysSendResponse: core.serialization.Schema< + serializers.SurveysSendResponse.Raw, + DevRev.SurveysSendResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SurveysSendResponse { + type Raw = Record; +} diff --git a/src/serialization/types/SurveysSubmitResponse.ts b/src/serialization/types/SurveysSubmitResponse.ts new file mode 100644 index 0000000..d0be996 --- /dev/null +++ b/src/serialization/types/SurveysSubmitResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SurveysSubmitResponse: core.serialization.Schema< + serializers.SurveysSubmitResponse.Raw, + DevRev.SurveysSubmitResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace SurveysSubmitResponse { + type Raw = Record; +} diff --git a/src/serialization/types/SyncMetadataFilter.ts b/src/serialization/types/SyncMetadataFilter.ts new file mode 100644 index 0000000..b885ed9 --- /dev/null +++ b/src/serialization/types/SyncMetadataFilter.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SyncMetadataFilterSyncInFilter } from "./SyncMetadataFilterSyncInFilter"; +import { SyncMetadataFilterSyncOutFilter } from "./SyncMetadataFilterSyncOutFilter"; + +export const SyncMetadataFilter: core.serialization.ObjectSchema< + serializers.SyncMetadataFilter.Raw, + DevRev.SyncMetadataFilter +> = core.serialization.object({ + lastSyncIn: core.serialization.property("last_sync_in", SyncMetadataFilterSyncInFilter.optional()), + lastSyncOut: core.serialization.property("last_sync_out", SyncMetadataFilterSyncOutFilter.optional()), + originSystem: core.serialization.property( + "origin_system", + core.serialization.list(core.serialization.string()).optional() + ), +}); + +export declare namespace SyncMetadataFilter { + interface Raw { + last_sync_in?: SyncMetadataFilterSyncInFilter.Raw | null; + last_sync_out?: SyncMetadataFilterSyncOutFilter.Raw | null; + origin_system?: string[] | null; + } +} diff --git a/src/serialization/types/SyncMetadataFilterSyncInFilter.ts b/src/serialization/types/SyncMetadataFilterSyncInFilter.ts new file mode 100644 index 0000000..45288d6 --- /dev/null +++ b/src/serialization/types/SyncMetadataFilterSyncInFilter.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SyncMetadataFilterSyncInFilterStatus } from "./SyncMetadataFilterSyncInFilterStatus"; +import { DateFilter } from "./DateFilter"; + +export const SyncMetadataFilterSyncInFilter: core.serialization.ObjectSchema< + serializers.SyncMetadataFilterSyncInFilter.Raw, + DevRev.SyncMetadataFilterSyncInFilter +> = core.serialization.object({ + status: core.serialization.list(SyncMetadataFilterSyncInFilterStatus).optional(), + syncDate: core.serialization.property("sync_date", DateFilter.optional()), + syncUnit: core.serialization.property("sync_unit", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace SyncMetadataFilterSyncInFilter { + interface Raw { + status?: SyncMetadataFilterSyncInFilterStatus.Raw[] | null; + sync_date?: DateFilter.Raw | null; + sync_unit?: string[] | null; + } +} diff --git a/src/serialization/types/SyncMetadataFilterSyncInFilterStatus.ts b/src/serialization/types/SyncMetadataFilterSyncInFilterStatus.ts new file mode 100644 index 0000000..ba5dbc6 --- /dev/null +++ b/src/serialization/types/SyncMetadataFilterSyncInFilterStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SyncMetadataFilterSyncInFilterStatus: core.serialization.Schema< + serializers.SyncMetadataFilterSyncInFilterStatus.Raw, + DevRev.SyncMetadataFilterSyncInFilterStatus +> = core.serialization.enum_(["failed", "modified", "staged", "succeeded"]); + +export declare namespace SyncMetadataFilterSyncInFilterStatus { + type Raw = "failed" | "modified" | "staged" | "succeeded"; +} diff --git a/src/serialization/types/SyncMetadataFilterSyncOutFilter.ts b/src/serialization/types/SyncMetadataFilterSyncOutFilter.ts new file mode 100644 index 0000000..69ace6e --- /dev/null +++ b/src/serialization/types/SyncMetadataFilterSyncOutFilter.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SyncMetadataFilterSyncOutFilterStatus } from "./SyncMetadataFilterSyncOutFilterStatus"; +import { DateFilter } from "./DateFilter"; + +export const SyncMetadataFilterSyncOutFilter: core.serialization.ObjectSchema< + serializers.SyncMetadataFilterSyncOutFilter.Raw, + DevRev.SyncMetadataFilterSyncOutFilter +> = core.serialization.object({ + status: core.serialization.list(SyncMetadataFilterSyncOutFilterStatus).optional(), + syncDate: core.serialization.property("sync_date", DateFilter.optional()), + syncUnit: core.serialization.property("sync_unit", core.serialization.list(core.serialization.string()).optional()), +}); + +export declare namespace SyncMetadataFilterSyncOutFilter { + interface Raw { + status?: SyncMetadataFilterSyncOutFilterStatus.Raw[] | null; + sync_date?: DateFilter.Raw | null; + sync_unit?: string[] | null; + } +} diff --git a/src/serialization/types/SyncMetadataFilterSyncOutFilterStatus.ts b/src/serialization/types/SyncMetadataFilterSyncOutFilterStatus.ts new file mode 100644 index 0000000..ec0f810 --- /dev/null +++ b/src/serialization/types/SyncMetadataFilterSyncOutFilterStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const SyncMetadataFilterSyncOutFilterStatus: core.serialization.Schema< + serializers.SyncMetadataFilterSyncOutFilterStatus.Raw, + DevRev.SyncMetadataFilterSyncOutFilterStatus +> = core.serialization.enum_(["failed", "succeeded"]); + +export declare namespace SyncMetadataFilterSyncOutFilterStatus { + type Raw = "failed" | "succeeded"; +} diff --git a/src/serialization/types/SysUser.ts b/src/serialization/types/SysUser.ts new file mode 100644 index 0000000..f6cc480 --- /dev/null +++ b/src/serialization/types/SysUser.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserBase } from "./UserBase"; + +export const SysUser: core.serialization.ObjectSchema = UserBase; + +export declare namespace SysUser { + type Raw = UserBase.Raw; +} diff --git a/src/serialization/types/SysUserSummary.ts b/src/serialization/types/SysUserSummary.ts new file mode 100644 index 0000000..3b4e566 --- /dev/null +++ b/src/serialization/types/SysUserSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserBaseSummary } from "./UserBaseSummary"; + +export const SysUserSummary: core.serialization.ObjectSchema = + UserBaseSummary; + +export declare namespace SysUserSummary { + type Raw = UserBaseSummary.Raw; +} diff --git a/src/serialization/types/SysUsersListResponse.ts b/src/serialization/types/SysUsersListResponse.ts new file mode 100644 index 0000000..eac9de3 --- /dev/null +++ b/src/serialization/types/SysUsersListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SysUser } from "./SysUser"; + +export const SysUsersListResponse: core.serialization.ObjectSchema< + serializers.SysUsersListResponse.Raw, + DevRev.SysUsersListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + sysUsers: core.serialization.property("sys_users", core.serialization.list(SysUser)), +}); + +export declare namespace SysUsersListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + sys_users: SysUser.Raw[]; + } +} diff --git a/src/serialization/types/SysUsersUpdateResponse.ts b/src/serialization/types/SysUsersUpdateResponse.ts new file mode 100644 index 0000000..4276351 --- /dev/null +++ b/src/serialization/types/SysUsersUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SysUser } from "./SysUser"; + +export const SysUsersUpdateResponse: core.serialization.ObjectSchema< + serializers.SysUsersUpdateResponse.Raw, + DevRev.SysUsersUpdateResponse +> = core.serialization.object({ + sysUser: core.serialization.property("sys_user", SysUser), +}); + +export declare namespace SysUsersUpdateResponse { + interface Raw { + sys_user: SysUser.Raw; + } +} diff --git a/src/serialization/types/Tag.ts b/src/serialization/types/Tag.ts new file mode 100644 index 0000000..c9c64fe --- /dev/null +++ b/src/serialization/types/Tag.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBase } from "./AtomBase"; + +export const Tag: core.serialization.ObjectSchema = core.serialization + .object({ + allowedValues: core.serialization.property( + "allowed_values", + core.serialization.list(core.serialization.string()).optional() + ), + description: core.serialization.string().optional(), + name: core.serialization.string(), + }) + .extend(AtomBase); + +export declare namespace Tag { + interface Raw extends AtomBase.Raw { + allowed_values?: string[] | null; + description?: string | null; + name: string; + } +} diff --git a/src/serialization/types/TagSearchSummary.ts b/src/serialization/types/TagSearchSummary.ts new file mode 100644 index 0000000..bc8df44 --- /dev/null +++ b/src/serialization/types/TagSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TagSummary } from "./TagSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const TagSearchSummary: core.serialization.ObjectSchema< + serializers.TagSearchSummary.Raw, + DevRev.TagSearchSummary +> = core.serialization + .object({ + tag: TagSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace TagSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + tag: TagSummary.Raw; + } +} diff --git a/src/serialization/types/TagSummary.ts b/src/serialization/types/TagSummary.ts new file mode 100644 index 0000000..64b098e --- /dev/null +++ b/src/serialization/types/TagSummary.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const TagSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + name: core.serialization.string(), + }) + .extend(AtomBaseSummary); + +export declare namespace TagSummary { + interface Raw extends AtomBaseSummary.Raw { + name: string; + } +} diff --git a/src/serialization/types/TagWithValue.ts b/src/serialization/types/TagWithValue.ts new file mode 100644 index 0000000..b476ed2 --- /dev/null +++ b/src/serialization/types/TagWithValue.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TagSummary } from "./TagSummary"; + +export const TagWithValue: core.serialization.ObjectSchema = + core.serialization.object({ + tag: TagSummary, + value: core.serialization.string().optional(), + }); + +export declare namespace TagWithValue { + interface Raw { + tag: TagSummary.Raw; + value?: string | null; + } +} diff --git a/src/serialization/types/TagWithValueFilter.ts b/src/serialization/types/TagWithValueFilter.ts new file mode 100644 index 0000000..fc8eb5e --- /dev/null +++ b/src/serialization/types/TagWithValueFilter.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TagWithValueFilter: core.serialization.ObjectSchema< + serializers.TagWithValueFilter.Raw, + DevRev.TagWithValueFilter +> = core.serialization.object({ + id: core.serialization.string().optional(), + value: core.serialization.string().optional(), +}); + +export declare namespace TagWithValueFilter { + interface Raw { + id?: string | null; + value?: string | null; + } +} diff --git a/src/serialization/types/Task.ts b/src/serialization/types/Task.ts new file mode 100644 index 0000000..2ea71f1 --- /dev/null +++ b/src/serialization/types/Task.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WorkBase } from "./WorkBase"; + +export const Task: core.serialization.ObjectSchema = WorkBase; + +export declare namespace Task { + type Raw = WorkBase.Raw; +} diff --git a/src/serialization/types/TaskPriority.ts b/src/serialization/types/TaskPriority.ts new file mode 100644 index 0000000..a8ea5e1 --- /dev/null +++ b/src/serialization/types/TaskPriority.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TaskPriority: core.serialization.Schema = + core.serialization.enum_(["p0", "p1", "p2", "p3"]); + +export declare namespace TaskPriority { + type Raw = "p0" | "p1" | "p2" | "p3"; +} diff --git a/src/serialization/types/TaskSummary.ts b/src/serialization/types/TaskSummary.ts new file mode 100644 index 0000000..b56e3b4 --- /dev/null +++ b/src/serialization/types/TaskSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WorkBaseSummary } from "./WorkBaseSummary"; + +export const TaskSummary: core.serialization.ObjectSchema = + WorkBaseSummary; + +export declare namespace TaskSummary { + type Raw = WorkBaseSummary.Raw; +} diff --git a/src/serialization/types/TenantFragment.ts b/src/serialization/types/TenantFragment.ts new file mode 100644 index 0000000..3101236 --- /dev/null +++ b/src/serialization/types/TenantFragment.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragmentBase } from "./CustomSchemaFragmentBase"; + +export const TenantFragment: core.serialization.ObjectSchema = + CustomSchemaFragmentBase; + +export declare namespace TenantFragment { + type Raw = CustomSchemaFragmentBase.Raw; +} diff --git a/src/serialization/types/TenantFragmentSummary.ts b/src/serialization/types/TenantFragmentSummary.ts new file mode 100644 index 0000000..d899166 --- /dev/null +++ b/src/serialization/types/TenantFragmentSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CustomSchemaFragmentBaseSummary } from "./CustomSchemaFragmentBaseSummary"; + +export const TenantFragmentSummary: core.serialization.ObjectSchema< + serializers.TenantFragmentSummary.Raw, + DevRev.TenantFragmentSummary +> = CustomSchemaFragmentBaseSummary; + +export declare namespace TenantFragmentSummary { + type Raw = CustomSchemaFragmentBaseSummary.Raw; +} diff --git a/src/serialization/types/Ticket.ts b/src/serialization/types/Ticket.ts new file mode 100644 index 0000000..72fbe20 --- /dev/null +++ b/src/serialization/types/Ticket.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TicketChannels } from "./TicketChannels"; +import { GroupSummary } from "./GroupSummary"; +import { OrgSummary } from "./OrgSummary"; +import { EnumValue } from "./EnumValue"; +import { TicketSeverity } from "./TicketSeverity"; +import { SlaTrackerSummary } from "./SlaTrackerSummary"; +import { WorkBase } from "./WorkBase"; + +export const Ticket: core.serialization.ObjectSchema = core.serialization + .object({ + channels: core.serialization.list(TicketChannels).optional(), + group: GroupSummary.optional(), + needsResponse: core.serialization.property("needs_response", core.serialization.boolean().optional()), + revOrg: core.serialization.property("rev_org", OrgSummary.optional()), + sentiment: EnumValue.optional(), + severity: TicketSeverity.optional(), + slaTracker: core.serialization.property("sla_tracker", SlaTrackerSummary.optional()), + sourceChannel: core.serialization.property("source_channel", core.serialization.string().optional()), + }) + .extend(WorkBase); + +export declare namespace Ticket { + interface Raw extends WorkBase.Raw { + channels?: TicketChannels.Raw[] | null; + group?: GroupSummary.Raw | null; + needs_response?: boolean | null; + rev_org?: OrgSummary.Raw | null; + sentiment?: EnumValue.Raw | null; + severity?: TicketSeverity.Raw | null; + sla_tracker?: SlaTrackerSummary.Raw | null; + source_channel?: string | null; + } +} diff --git a/src/serialization/types/TicketChannels.ts b/src/serialization/types/TicketChannels.ts new file mode 100644 index 0000000..e0ebf35 --- /dev/null +++ b/src/serialization/types/TicketChannels.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TicketChannels: core.serialization.Schema = + core.serialization.enum_(["email", "plug", "slack", "twilio"]); + +export declare namespace TicketChannels { + type Raw = "email" | "plug" | "slack" | "twilio"; +} diff --git a/src/serialization/types/TicketSeverity.ts b/src/serialization/types/TicketSeverity.ts new file mode 100644 index 0000000..8c99a42 --- /dev/null +++ b/src/serialization/types/TicketSeverity.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TicketSeverity: core.serialization.Schema = + core.serialization.enum_(["blocker", "high", "low", "medium"]); + +export declare namespace TicketSeverity { + type Raw = "blocker" | "high" | "low" | "medium"; +} diff --git a/src/serialization/types/TicketSummary.ts b/src/serialization/types/TicketSummary.ts new file mode 100644 index 0000000..29c569c --- /dev/null +++ b/src/serialization/types/TicketSummary.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OrgSummary } from "./OrgSummary"; +import { TicketSeverity } from "./TicketSeverity"; +import { WorkBaseSummary } from "./WorkBaseSummary"; + +export const TicketSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + revOrg: core.serialization.property("rev_org", OrgSummary.optional()), + severity: TicketSeverity.optional(), + }) + .extend(WorkBaseSummary); + +export declare namespace TicketSummary { + interface Raw extends WorkBaseSummary.Raw { + rev_org?: OrgSummary.Raw | null; + severity?: TicketSeverity.Raw | null; + } +} diff --git a/src/serialization/types/TimelineComment.ts b/src/serialization/types/TimelineComment.ts new file mode 100644 index 0000000..ba12de9 --- /dev/null +++ b/src/serialization/types/TimelineComment.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { TimelineCommentBodyType } from "./TimelineCommentBodyType"; +import { TimelineSnapKitBody } from "./TimelineSnapKitBody"; +import { SnapWidget } from "./SnapWidget"; +import { TimelineEntryBase } from "./TimelineEntryBase"; + +export const TimelineComment: core.serialization.ObjectSchema = + core.serialization + .object({ + artifacts: core.serialization.list(ArtifactSummary).optional(), + body: core.serialization.string().optional(), + bodyType: core.serialization.property("body_type", TimelineCommentBodyType.optional()), + snapKitBody: core.serialization.property("snap_kit_body", TimelineSnapKitBody.optional()), + snapWidgetBody: core.serialization.property( + "snap_widget_body", + core.serialization.list(SnapWidget).optional() + ), + }) + .extend(TimelineEntryBase); + +export declare namespace TimelineComment { + interface Raw extends TimelineEntryBase.Raw { + artifacts?: ArtifactSummary.Raw[] | null; + body?: string | null; + body_type?: TimelineCommentBodyType.Raw | null; + snap_kit_body?: TimelineSnapKitBody.Raw | null; + snap_widget_body?: SnapWidget.Raw[] | null; + } +} diff --git a/src/serialization/types/TimelineCommentBodyType.ts b/src/serialization/types/TimelineCommentBodyType.ts new file mode 100644 index 0000000..0bbd5f8 --- /dev/null +++ b/src/serialization/types/TimelineCommentBodyType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineCommentBodyType: core.serialization.Schema< + serializers.TimelineCommentBodyType.Raw, + DevRev.TimelineCommentBodyType +> = core.serialization.enum_(["snap_kit", "snap_widget", "text"]); + +export declare namespace TimelineCommentBodyType { + type Raw = "snap_kit" | "snap_widget" | "text"; +} diff --git a/src/serialization/types/TimelineCommentSummary.ts b/src/serialization/types/TimelineCommentSummary.ts new file mode 100644 index 0000000..d3a15c6 --- /dev/null +++ b/src/serialization/types/TimelineCommentSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntryBaseSummary } from "./TimelineEntryBaseSummary"; + +export const TimelineCommentSummary: core.serialization.ObjectSchema< + serializers.TimelineCommentSummary.Raw, + DevRev.TimelineCommentSummary +> = TimelineEntryBaseSummary; + +export declare namespace TimelineCommentSummary { + type Raw = TimelineEntryBaseSummary.Raw; +} diff --git a/src/serialization/types/TimelineEntriesCollection.ts b/src/serialization/types/TimelineEntriesCollection.ts new file mode 100644 index 0000000..37338d3 --- /dev/null +++ b/src/serialization/types/TimelineEntriesCollection.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntriesCollection: core.serialization.Schema< + serializers.TimelineEntriesCollection.Raw, + DevRev.TimelineEntriesCollection +> = core.serialization.enum_(["discussions", "events"]); + +export declare namespace TimelineEntriesCollection { + type Raw = "discussions" | "events"; +} diff --git a/src/serialization/types/TimelineEntriesCreateRequest.ts b/src/serialization/types/TimelineEntriesCreateRequest.ts new file mode 100644 index 0000000..d7c0588 --- /dev/null +++ b/src/serialization/types/TimelineEntriesCreateRequest.ts @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { TimelineEntriesCollection } from "./TimelineEntriesCollection"; +import { TimelineEntryVisibility } from "./TimelineEntryVisibility"; +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { TimelineEntriesCreateRequestTimelineComment } from "./TimelineEntriesCreateRequestTimelineComment"; + +const _Base = core.serialization.object({ + collections: core.serialization.list(TimelineEntriesCollection).optional(), + expiresAt: core.serialization.property("expires_at", core.serialization.date().optional()), + labels: core.serialization.list(core.serialization.string()).optional(), + object: core.serialization.string(), + privateTo: core.serialization.property( + "private_to", + core.serialization.list(core.serialization.string()).optional() + ), + visibility: TimelineEntryVisibility.optional(), +}); +export const TimelineEntriesCreateRequest: core.serialization.Schema< + serializers.TimelineEntriesCreateRequest.Raw, + DevRev.TimelineEntriesCreateRequest +> = core.serialization + .union("type", { + timeline_comment: TimelineEntriesCreateRequestTimelineComment.extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace TimelineEntriesCreateRequest { + type Raw = TimelineEntriesCreateRequest.TimelineComment; + + interface TimelineComment extends _Base, TimelineEntriesCreateRequestTimelineComment.Raw { + type: "timeline_comment"; + } + + interface _Base { + collections?: TimelineEntriesCollection.Raw[] | null; + expires_at?: string | null; + labels?: string[] | null; + object: string; + private_to?: string[] | null; + visibility?: TimelineEntryVisibility.Raw | null; + } +} diff --git a/src/serialization/types/TimelineEntriesCreateRequestTimelineComment.ts b/src/serialization/types/TimelineEntriesCreateRequestTimelineComment.ts new file mode 100644 index 0000000..76e3ac2 --- /dev/null +++ b/src/serialization/types/TimelineEntriesCreateRequestTimelineComment.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineCommentBodyType } from "./TimelineCommentBodyType"; +import { TimelineSnapKitBody } from "./TimelineSnapKitBody"; + +export const TimelineEntriesCreateRequestTimelineComment: core.serialization.ObjectSchema< + serializers.TimelineEntriesCreateRequestTimelineComment.Raw, + DevRev.TimelineEntriesCreateRequestTimelineComment +> = core.serialization.object({ + artifacts: core.serialization.list(core.serialization.string()).optional(), + body: core.serialization.string().optional(), + bodyType: core.serialization.property("body_type", TimelineCommentBodyType.optional()), + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + linkPreviews: core.serialization.property( + "link_previews", + core.serialization.list(core.serialization.string()).optional() + ), + snapKitBody: core.serialization.property("snap_kit_body", TimelineSnapKitBody.optional()), + snapWidgetBody: core.serialization.property( + "snap_widget_body", + core.serialization.list(core.serialization.string()).optional() + ), +}); + +export declare namespace TimelineEntriesCreateRequestTimelineComment { + interface Raw { + artifacts?: string[] | null; + body?: string | null; + body_type?: TimelineCommentBodyType.Raw | null; + external_ref?: string | null; + link_previews?: string[] | null; + snap_kit_body?: TimelineSnapKitBody.Raw | null; + snap_widget_body?: string[] | null; + } +} diff --git a/src/serialization/types/TimelineEntriesCreateRequestType.ts b/src/serialization/types/TimelineEntriesCreateRequestType.ts new file mode 100644 index 0000000..8edbd67 --- /dev/null +++ b/src/serialization/types/TimelineEntriesCreateRequestType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntriesCreateRequestType: core.serialization.Schema< + serializers.TimelineEntriesCreateRequestType.Raw, + DevRev.TimelineEntriesCreateRequestType +> = core.serialization.stringLiteral("timeline_comment"); + +export declare namespace TimelineEntriesCreateRequestType { + type Raw = "timeline_comment"; +} diff --git a/src/serialization/types/TimelineEntriesCreateResponse.ts b/src/serialization/types/TimelineEntriesCreateResponse.ts new file mode 100644 index 0000000..fadd660 --- /dev/null +++ b/src/serialization/types/TimelineEntriesCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntry } from "./TimelineEntry"; + +export const TimelineEntriesCreateResponse: core.serialization.ObjectSchema< + serializers.TimelineEntriesCreateResponse.Raw, + DevRev.TimelineEntriesCreateResponse +> = core.serialization.object({ + timelineEntry: core.serialization.property("timeline_entry", TimelineEntry), +}); + +export declare namespace TimelineEntriesCreateResponse { + interface Raw { + timeline_entry: TimelineEntry.Raw; + } +} diff --git a/src/serialization/types/TimelineEntriesListResponse.ts b/src/serialization/types/TimelineEntriesListResponse.ts new file mode 100644 index 0000000..eebe5c8 --- /dev/null +++ b/src/serialization/types/TimelineEntriesListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntry } from "./TimelineEntry"; + +export const TimelineEntriesListResponse: core.serialization.ObjectSchema< + serializers.TimelineEntriesListResponse.Raw, + DevRev.TimelineEntriesListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + timelineEntries: core.serialization.property("timeline_entries", core.serialization.list(TimelineEntry)), +}); + +export declare namespace TimelineEntriesListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + timeline_entries: TimelineEntry.Raw[]; + } +} diff --git a/src/serialization/types/TimelineEntriesUpdateRequest.ts b/src/serialization/types/TimelineEntriesUpdateRequest.ts new file mode 100644 index 0000000..47a1d70 --- /dev/null +++ b/src/serialization/types/TimelineEntriesUpdateRequest.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { TimelineEntriesUpdateRequestTimelineComment } from "./TimelineEntriesUpdateRequestTimelineComment"; + +const _Base = core.serialization.object({ + id: core.serialization.string(), +}); +export const TimelineEntriesUpdateRequest: core.serialization.Schema< + serializers.TimelineEntriesUpdateRequest.Raw, + DevRev.TimelineEntriesUpdateRequest +> = core.serialization + .union("type", { + timeline_comment: TimelineEntriesUpdateRequestTimelineComment.extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace TimelineEntriesUpdateRequest { + type Raw = TimelineEntriesUpdateRequest.TimelineComment; + + interface TimelineComment extends _Base, TimelineEntriesUpdateRequestTimelineComment.Raw { + type: "timeline_comment"; + } + + interface _Base { + id: string; + } +} diff --git a/src/serialization/types/TimelineEntriesUpdateRequestTimelineComment.ts b/src/serialization/types/TimelineEntriesUpdateRequestTimelineComment.ts new file mode 100644 index 0000000..535c12d --- /dev/null +++ b/src/serialization/types/TimelineEntriesUpdateRequestTimelineComment.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntriesUpdateRequestTimelineCommentArtifacts } from "./TimelineEntriesUpdateRequestTimelineCommentArtifacts"; +import { TimelineCommentBodyType } from "./TimelineCommentBodyType"; +import { TimelineEntriesUpdateRequestTimelineCommentLinkPreviews } from "./TimelineEntriesUpdateRequestTimelineCommentLinkPreviews"; +import { TimelineSnapKitBody } from "./TimelineSnapKitBody"; + +export const TimelineEntriesUpdateRequestTimelineComment: core.serialization.ObjectSchema< + serializers.TimelineEntriesUpdateRequestTimelineComment.Raw, + DevRev.TimelineEntriesUpdateRequestTimelineComment +> = core.serialization.object({ + artifacts: TimelineEntriesUpdateRequestTimelineCommentArtifacts.optional(), + body: core.serialization.string().optional(), + bodyType: core.serialization.property("body_type", TimelineCommentBodyType.optional()), + linkPreviews: core.serialization.property( + "link_previews", + TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.optional() + ), + snapKitBody: core.serialization.property("snap_kit_body", TimelineSnapKitBody.optional()), +}); + +export declare namespace TimelineEntriesUpdateRequestTimelineComment { + interface Raw { + artifacts?: TimelineEntriesUpdateRequestTimelineCommentArtifacts.Raw | null; + body?: string | null; + body_type?: TimelineCommentBodyType.Raw | null; + link_previews?: TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.Raw | null; + snap_kit_body?: TimelineSnapKitBody.Raw | null; + } +} diff --git a/src/serialization/types/TimelineEntriesUpdateRequestTimelineCommentArtifacts.ts b/src/serialization/types/TimelineEntriesUpdateRequestTimelineCommentArtifacts.ts new file mode 100644 index 0000000..137be9e --- /dev/null +++ b/src/serialization/types/TimelineEntriesUpdateRequestTimelineCommentArtifacts.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntriesUpdateRequestTimelineCommentArtifacts: core.serialization.ObjectSchema< + serializers.TimelineEntriesUpdateRequestTimelineCommentArtifacts.Raw, + DevRev.TimelineEntriesUpdateRequestTimelineCommentArtifacts +> = core.serialization.object({ + add: core.serialization.list(core.serialization.string()).optional(), + remove: core.serialization.list(core.serialization.string()).optional(), + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace TimelineEntriesUpdateRequestTimelineCommentArtifacts { + interface Raw { + add?: string[] | null; + remove?: string[] | null; + set?: string[] | null; + } +} diff --git a/src/serialization/types/TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.ts b/src/serialization/types/TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.ts new file mode 100644 index 0000000..328aabd --- /dev/null +++ b/src/serialization/types/TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntriesUpdateRequestTimelineCommentLinkPreviews: core.serialization.ObjectSchema< + serializers.TimelineEntriesUpdateRequestTimelineCommentLinkPreviews.Raw, + DevRev.TimelineEntriesUpdateRequestTimelineCommentLinkPreviews +> = core.serialization.object({ + add: core.serialization.list(core.serialization.string()).optional(), + remove: core.serialization.list(core.serialization.string()).optional(), + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace TimelineEntriesUpdateRequestTimelineCommentLinkPreviews { + interface Raw { + add?: string[] | null; + remove?: string[] | null; + set?: string[] | null; + } +} diff --git a/src/serialization/types/TimelineEntriesUpdateRequestType.ts b/src/serialization/types/TimelineEntriesUpdateRequestType.ts new file mode 100644 index 0000000..cab3d6d --- /dev/null +++ b/src/serialization/types/TimelineEntriesUpdateRequestType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntriesUpdateRequestType: core.serialization.Schema< + serializers.TimelineEntriesUpdateRequestType.Raw, + DevRev.TimelineEntriesUpdateRequestType +> = core.serialization.stringLiteral("timeline_comment"); + +export declare namespace TimelineEntriesUpdateRequestType { + type Raw = "timeline_comment"; +} diff --git a/src/serialization/types/TimelineEntriesUpdateResponse.ts b/src/serialization/types/TimelineEntriesUpdateResponse.ts new file mode 100644 index 0000000..48933cf --- /dev/null +++ b/src/serialization/types/TimelineEntriesUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntry } from "./TimelineEntry"; + +export const TimelineEntriesUpdateResponse: core.serialization.ObjectSchema< + serializers.TimelineEntriesUpdateResponse.Raw, + DevRev.TimelineEntriesUpdateResponse +> = core.serialization.object({ + timelineEntry: core.serialization.property("timeline_entry", TimelineEntry), +}); + +export declare namespace TimelineEntriesUpdateResponse { + interface Raw { + timeline_entry: TimelineEntry.Raw; + } +} diff --git a/src/serialization/types/TimelineEntry.ts b/src/serialization/types/TimelineEntry.ts new file mode 100644 index 0000000..21cd139 --- /dev/null +++ b/src/serialization/types/TimelineEntry.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineComment } from "./TimelineComment"; + +export const TimelineEntry: core.serialization.Schema = + core.serialization + .union("type", { + timeline_comment: TimelineComment, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace TimelineEntry { + type Raw = TimelineEntry.TimelineComment; + + interface TimelineComment extends TimelineComment.Raw { + type: "timeline_comment"; + } +} diff --git a/src/serialization/types/TimelineEntryBase.ts b/src/serialization/types/TimelineEntryBase.ts new file mode 100644 index 0000000..31894c7 --- /dev/null +++ b/src/serialization/types/TimelineEntryBase.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TimelineEntryObjectType } from "./TimelineEntryObjectType"; +import { TimelineReaction } from "./TimelineReaction"; +import { TimelineThread } from "./TimelineThread"; +import { TimelineEntryVisibility } from "./TimelineEntryVisibility"; +import { AtomBase } from "./AtomBase"; + +export const TimelineEntryBase: core.serialization.ObjectSchema< + serializers.TimelineEntryBase.Raw, + DevRev.TimelineEntryBase +> = core.serialization + .object({ + externalRef: core.serialization.property("external_ref", core.serialization.string().optional()), + labels: core.serialization.list(core.serialization.string()).optional(), + object: core.serialization.string(), + objectDisplayId: core.serialization.property("object_display_id", core.serialization.string()), + objectType: core.serialization.property("object_type", TimelineEntryObjectType.optional()), + reactions: core.serialization.list(TimelineReaction).optional(), + thread: TimelineThread.optional(), + visibility: TimelineEntryVisibility.optional(), + }) + .extend(AtomBase); + +export declare namespace TimelineEntryBase { + interface Raw extends AtomBase.Raw { + external_ref?: string | null; + labels?: string[] | null; + object: string; + object_display_id: string; + object_type?: TimelineEntryObjectType.Raw | null; + reactions?: TimelineReaction.Raw[] | null; + thread?: TimelineThread.Raw | null; + visibility?: TimelineEntryVisibility.Raw | null; + } +} diff --git a/src/serialization/types/TimelineEntryBaseSummary.ts b/src/serialization/types/TimelineEntryBaseSummary.ts new file mode 100644 index 0000000..517bf27 --- /dev/null +++ b/src/serialization/types/TimelineEntryBaseSummary.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const TimelineEntryBaseSummary: core.serialization.ObjectSchema< + serializers.TimelineEntryBaseSummary.Raw, + DevRev.TimelineEntryBaseSummary +> = AtomBaseSummary; + +export declare namespace TimelineEntryBaseSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/TimelineEntryObjectType.ts b/src/serialization/types/TimelineEntryObjectType.ts new file mode 100644 index 0000000..073156d --- /dev/null +++ b/src/serialization/types/TimelineEntryObjectType.ts @@ -0,0 +1,47 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntryObjectType: core.serialization.Schema< + serializers.TimelineEntryObjectType.Raw, + DevRev.TimelineEntryObjectType +> = core.serialization.enum_([ + "account", + "capability", + "conversation", + "engagement", + "enhancement", + "feature", + "issue", + "meeting", + "opportunity", + "product", + "rev_org", + "rev_user", + "task", + "ticket", + "timeline_comment", +]); + +export declare namespace TimelineEntryObjectType { + type Raw = + | "account" + | "capability" + | "conversation" + | "engagement" + | "enhancement" + | "feature" + | "issue" + | "meeting" + | "opportunity" + | "product" + | "rev_org" + | "rev_user" + | "task" + | "ticket" + | "timeline_comment"; +} diff --git a/src/serialization/types/TimelineEntryType.ts b/src/serialization/types/TimelineEntryType.ts new file mode 100644 index 0000000..1bb3949 --- /dev/null +++ b/src/serialization/types/TimelineEntryType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntryType: core.serialization.Schema = + core.serialization.stringLiteral("timeline_comment"); + +export declare namespace TimelineEntryType { + type Raw = "timeline_comment"; +} diff --git a/src/serialization/types/TimelineEntryVisibility.ts b/src/serialization/types/TimelineEntryVisibility.ts new file mode 100644 index 0000000..c941e61 --- /dev/null +++ b/src/serialization/types/TimelineEntryVisibility.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineEntryVisibility: core.serialization.Schema< + serializers.TimelineEntryVisibility.Raw, + DevRev.TimelineEntryVisibility +> = core.serialization.enum_(["external", "internal", "private", "public"]); + +export declare namespace TimelineEntryVisibility { + type Raw = "external" | "internal" | "private" | "public"; +} diff --git a/src/serialization/types/TimelineReaction.ts b/src/serialization/types/TimelineReaction.ts new file mode 100644 index 0000000..e4d52ad --- /dev/null +++ b/src/serialization/types/TimelineReaction.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineReaction: core.serialization.ObjectSchema< + serializers.TimelineReaction.Raw, + DevRev.TimelineReaction +> = core.serialization.object({ + emoji: core.serialization.string().optional(), + reacted: core.serialization.boolean().optional(), + totalUsers: core.serialization.property("total_users", core.serialization.number().optional()), +}); + +export declare namespace TimelineReaction { + interface Raw { + emoji?: string | null; + reacted?: boolean | null; + total_users?: number | null; + } +} diff --git a/src/serialization/types/TimelineSnapKitBody.ts b/src/serialization/types/TimelineSnapKitBody.ts new file mode 100644 index 0000000..4e30481 --- /dev/null +++ b/src/serialization/types/TimelineSnapKitBody.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineSnapKitBody: core.serialization.ObjectSchema< + serializers.TimelineSnapKitBody.Raw, + DevRev.TimelineSnapKitBody +> = core.serialization.object({ + body: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + snapInActionName: core.serialization.property("snap_in_action_name", core.serialization.string().optional()), + snapInId: core.serialization.property("snap_in_id", core.serialization.string().optional()), +}); + +export declare namespace TimelineSnapKitBody { + interface Raw { + body?: Record | null; + snap_in_action_name?: string | null; + snap_in_id?: string | null; + } +} diff --git a/src/serialization/types/TimelineThread.ts b/src/serialization/types/TimelineThread.ts new file mode 100644 index 0000000..24404f2 --- /dev/null +++ b/src/serialization/types/TimelineThread.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TimelineThread: core.serialization.ObjectSchema = + core.serialization.object({ + totalReplies: core.serialization.property("total_replies", core.serialization.number().optional()), + }); + +export declare namespace TimelineThread { + interface Raw { + total_replies?: number | null; + } +} diff --git a/src/serialization/types/TrackEvent.ts b/src/serialization/types/TrackEvent.ts new file mode 100644 index 0000000..a76ea92 --- /dev/null +++ b/src/serialization/types/TrackEvent.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ClientContext } from "./ClientContext"; + +export const TrackEvent: core.serialization.ObjectSchema = + core.serialization.object({ + clientContext: core.serialization.property("client_context", ClientContext.optional()), + eventId: core.serialization.property("event_id", core.serialization.string().optional()), + eventTime: core.serialization.property("event_time", core.serialization.date().optional()), + name: core.serialization.string(), + payload: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + }); + +export declare namespace TrackEvent { + interface Raw { + client_context?: ClientContext.Raw | null; + event_id?: string | null; + event_time?: string | null; + name: string; + payload: Record; + } +} diff --git a/src/serialization/types/TrackEventsPublishResponse.ts b/src/serialization/types/TrackEventsPublishResponse.ts new file mode 100644 index 0000000..9e7ad7f --- /dev/null +++ b/src/serialization/types/TrackEventsPublishResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const TrackEventsPublishResponse: core.serialization.Schema< + serializers.TrackEventsPublishResponse.Raw, + DevRev.TrackEventsPublishResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace TrackEventsPublishResponse { + type Raw = Record; +} diff --git a/src/serialization/types/Unit.ts b/src/serialization/types/Unit.ts new file mode 100644 index 0000000..93b1309 --- /dev/null +++ b/src/serialization/types/Unit.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UnitType } from "./UnitType"; + +export const Unit: core.serialization.ObjectSchema = core.serialization.object({ + type: UnitType, + name: core.serialization.string(), +}); + +export declare namespace Unit { + interface Raw { + type: UnitType.Raw; + name: string; + } +} diff --git a/src/serialization/types/UnitType.ts b/src/serialization/types/UnitType.ts new file mode 100644 index 0000000..8f6968f --- /dev/null +++ b/src/serialization/types/UnitType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const UnitType: core.serialization.Schema = core.serialization.enum_([ + "boolean", + "number", +]); + +export declare namespace UnitType { + type Raw = "boolean" | "number"; +} diff --git a/src/serialization/types/UnlinkRevUserFromRevOrgResponse.ts b/src/serialization/types/UnlinkRevUserFromRevOrgResponse.ts new file mode 100644 index 0000000..7eb4030 --- /dev/null +++ b/src/serialization/types/UnlinkRevUserFromRevOrgResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { RevUser } from "./RevUser"; + +export const UnlinkRevUserFromRevOrgResponse: core.serialization.ObjectSchema< + serializers.UnlinkRevUserFromRevOrgResponse.Raw, + DevRev.UnlinkRevUserFromRevOrgResponse +> = core.serialization.object({ + revUser: core.serialization.property("rev_user", RevUser), +}); + +export declare namespace UnlinkRevUserFromRevOrgResponse { + interface Raw { + rev_user: RevUser.Raw; + } +} diff --git a/src/serialization/types/Uom.ts b/src/serialization/types/Uom.ts new file mode 100644 index 0000000..8bbd9bc --- /dev/null +++ b/src/serialization/types/Uom.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AggregationDetail } from "./AggregationDetail"; +import { UomMetricScope } from "./UomMetricScope"; +import { PartSummary } from "./PartSummary"; +import { Unit } from "./Unit"; +import { AtomBase } from "./AtomBase"; + +export const Uom: core.serialization.ObjectSchema = core.serialization + .object({ + aggregationDetails: core.serialization.property("aggregation_details", AggregationDetail), + description: core.serialization.string().optional(), + dimensions: core.serialization.list(core.serialization.string()).optional(), + isEnabled: core.serialization.property("is_enabled", core.serialization.boolean()), + metricName: core.serialization.property("metric_name", core.serialization.string()), + metricScope: core.serialization.property("metric_scope", UomMetricScope), + name: core.serialization.string(), + part: PartSummary.optional(), + product: PartSummary, + unit: Unit, + }) + .extend(AtomBase); + +export declare namespace Uom { + interface Raw extends AtomBase.Raw { + aggregation_details: AggregationDetail.Raw; + description?: string | null; + dimensions?: string[] | null; + is_enabled: boolean; + metric_name: string; + metric_scope: UomMetricScope.Raw; + name: string; + part?: PartSummary.Raw | null; + product: PartSummary.Raw; + unit: Unit.Raw; + } +} diff --git a/src/serialization/types/UomMetricScope.ts b/src/serialization/types/UomMetricScope.ts new file mode 100644 index 0000000..884414c --- /dev/null +++ b/src/serialization/types/UomMetricScope.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const UomMetricScope: core.serialization.Schema = + core.serialization.enum_(["org", "user"]); + +export declare namespace UomMetricScope { + type Raw = "org" | "user"; +} diff --git a/src/serialization/types/UomsCountResponse.ts b/src/serialization/types/UomsCountResponse.ts new file mode 100644 index 0000000..5962f5c --- /dev/null +++ b/src/serialization/types/UomsCountResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const UomsCountResponse: core.serialization.ObjectSchema< + serializers.UomsCountResponse.Raw, + DevRev.UomsCountResponse +> = core.serialization.object({ + count: core.serialization.number(), +}); + +export declare namespace UomsCountResponse { + interface Raw { + count: number; + } +} diff --git a/src/serialization/types/UomsCreateResponse.ts b/src/serialization/types/UomsCreateResponse.ts new file mode 100644 index 0000000..d59f941 --- /dev/null +++ b/src/serialization/types/UomsCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Uom } from "./Uom"; + +export const UomsCreateResponse: core.serialization.ObjectSchema< + serializers.UomsCreateResponse.Raw, + DevRev.UomsCreateResponse +> = core.serialization.object({ + uom: Uom, +}); + +export declare namespace UomsCreateResponse { + interface Raw { + uom: Uom.Raw; + } +} diff --git a/src/serialization/types/UomsGetResponse.ts b/src/serialization/types/UomsGetResponse.ts new file mode 100644 index 0000000..88b2d12 --- /dev/null +++ b/src/serialization/types/UomsGetResponse.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Uom } from "./Uom"; + +export const UomsGetResponse: core.serialization.ObjectSchema = + core.serialization.object({ + uom: Uom, + }); + +export declare namespace UomsGetResponse { + interface Raw { + uom: Uom.Raw; + } +} diff --git a/src/serialization/types/UomsListResponse.ts b/src/serialization/types/UomsListResponse.ts new file mode 100644 index 0000000..d42afe2 --- /dev/null +++ b/src/serialization/types/UomsListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Uom } from "./Uom"; + +export const UomsListResponse: core.serialization.ObjectSchema< + serializers.UomsListResponse.Raw, + DevRev.UomsListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + uoms: core.serialization.list(Uom), +}); + +export declare namespace UomsListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + uoms: Uom.Raw[]; + } +} diff --git a/src/serialization/types/UomsUpdateRequestDimensions.ts b/src/serialization/types/UomsUpdateRequestDimensions.ts new file mode 100644 index 0000000..37c4684 --- /dev/null +++ b/src/serialization/types/UomsUpdateRequestDimensions.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const UomsUpdateRequestDimensions: core.serialization.ObjectSchema< + serializers.UomsUpdateRequestDimensions.Raw, + DevRev.UomsUpdateRequestDimensions +> = core.serialization.object({ + add: core.serialization.list(core.serialization.string()).optional(), + remove: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace UomsUpdateRequestDimensions { + interface Raw { + add?: string[] | null; + remove?: string[] | null; + } +} diff --git a/src/serialization/types/UomsUpdateResponse.ts b/src/serialization/types/UomsUpdateResponse.ts new file mode 100644 index 0000000..678dfc6 --- /dev/null +++ b/src/serialization/types/UomsUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Uom } from "./Uom"; + +export const UomsUpdateResponse: core.serialization.ObjectSchema< + serializers.UomsUpdateResponse.Raw, + DevRev.UomsUpdateResponse +> = core.serialization.object({ + uom: Uom, +}); + +export declare namespace UomsUpdateResponse { + interface Raw { + uom: Uom.Raw; + } +} diff --git a/src/serialization/types/UserBase.ts b/src/serialization/types/UserBase.ts new file mode 100644 index 0000000..c5ae0ee --- /dev/null +++ b/src/serialization/types/UserBase.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { UserState } from "./UserState"; +import { AtomBase } from "./AtomBase"; + +export const UserBase: core.serialization.ObjectSchema = core.serialization + .object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + displayPicture: core.serialization.property("display_picture", ArtifactSummary.optional()), + email: core.serialization.string().optional(), + fullName: core.serialization.property("full_name", core.serialization.string().optional()), + phoneNumbers: core.serialization.property( + "phone_numbers", + core.serialization.list(core.serialization.string()).optional() + ), + state: UserState.optional(), + }) + .extend(AtomBase); + +export declare namespace UserBase { + interface Raw extends AtomBase.Raw { + display_name?: string | null; + display_picture?: ArtifactSummary.Raw | null; + email?: string | null; + full_name?: string | null; + phone_numbers?: string[] | null; + state?: UserState.Raw | null; + } +} diff --git a/src/serialization/types/UserBaseSummary.ts b/src/serialization/types/UserBaseSummary.ts new file mode 100644 index 0000000..b01f052 --- /dev/null +++ b/src/serialization/types/UserBaseSummary.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { UserState } from "./UserState"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const UserBaseSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + displayPicture: core.serialization.property("display_picture", ArtifactSummary.optional()), + email: core.serialization.string().optional(), + fullName: core.serialization.property("full_name", core.serialization.string().optional()), + state: UserState.optional(), + }) + .extend(AtomBaseSummary); + +export declare namespace UserBaseSummary { + interface Raw extends AtomBaseSummary.Raw { + display_name?: string | null; + display_picture?: ArtifactSummary.Raw | null; + email?: string | null; + full_name?: string | null; + state?: UserState.Raw | null; + } +} diff --git a/src/serialization/types/UserSearchSummary.ts b/src/serialization/types/UserSearchSummary.ts new file mode 100644 index 0000000..e6fe60e --- /dev/null +++ b/src/serialization/types/UserSearchSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CommentSearchSummary } from "./CommentSearchSummary"; +import { UserSummary } from "./UserSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const UserSearchSummary: core.serialization.ObjectSchema< + serializers.UserSearchSummary.Raw, + DevRev.UserSearchSummary +> = core.serialization + .object({ + comments: core.serialization.list(CommentSearchSummary).optional(), + user: UserSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace UserSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + comments?: CommentSearchSummary.Raw[] | null; + user: UserSummary.Raw; + } +} diff --git a/src/serialization/types/UserSkill.ts b/src/serialization/types/UserSkill.ts new file mode 100644 index 0000000..b56d197 --- /dev/null +++ b/src/serialization/types/UserSkill.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const UserSkill: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string().optional(), + }); + +export declare namespace UserSkill { + interface Raw { + name?: string | null; + } +} diff --git a/src/serialization/types/UserState.ts b/src/serialization/types/UserState.ts new file mode 100644 index 0000000..1766928 --- /dev/null +++ b/src/serialization/types/UserState.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const UserState: core.serialization.Schema = + core.serialization.enum_(["active", "deactivated", "deleted", "locked", "shadow", "unassigned"]); + +export declare namespace UserState { + type Raw = "active" | "deactivated" | "deleted" | "locked" | "shadow" | "unassigned"; +} diff --git a/src/serialization/types/UserSummary.ts b/src/serialization/types/UserSummary.ts new file mode 100644 index 0000000..c34a5a1 --- /dev/null +++ b/src/serialization/types/UserSummary.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserBaseSummary } from "./UserBaseSummary"; +import { RevUserSummary } from "./RevUserSummary"; + +export const UserSummary: core.serialization.Schema = + core.serialization + .union("type", { + dev_user: UserBaseSummary, + rev_user: RevUserSummary, + service_account: UserBaseSummary, + sys_user: UserBaseSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace UserSummary { + type Raw = UserSummary.DevUser | UserSummary.RevUser | UserSummary.ServiceAccount | UserSummary.SysUser; + + interface DevUser extends UserBaseSummary.Raw { + type: "dev_user"; + } + + interface RevUser extends RevUserSummary.Raw { + type: "rev_user"; + } + + interface ServiceAccount extends UserBaseSummary.Raw { + type: "service_account"; + } + + interface SysUser extends UserBaseSummary.Raw { + type: "sys_user"; + } +} diff --git a/src/serialization/types/UserType.ts b/src/serialization/types/UserType.ts new file mode 100644 index 0000000..25b88db --- /dev/null +++ b/src/serialization/types/UserType.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const UserType: core.serialization.Schema = core.serialization.enum_([ + "dev_user", + "rev_user", + "service_account", + "sys_user", +]); + +export declare namespace UserType { + type Raw = "dev_user" | "rev_user" | "service_account" | "sys_user"; +} diff --git a/src/serialization/types/VistaBaseSummary.ts b/src/serialization/types/VistaBaseSummary.ts new file mode 100644 index 0000000..8e86377 --- /dev/null +++ b/src/serialization/types/VistaBaseSummary.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const VistaBaseSummary: core.serialization.ObjectSchema< + serializers.VistaBaseSummary.Raw, + DevRev.VistaBaseSummary +> = core.serialization + .object({ + name: core.serialization.string(), + }) + .extend(AtomBaseSummary); + +export declare namespace VistaBaseSummary { + interface Raw extends AtomBaseSummary.Raw { + name: string; + } +} diff --git a/src/serialization/types/VistaGroupItemState.ts b/src/serialization/types/VistaGroupItemState.ts new file mode 100644 index 0000000..1b79f3c --- /dev/null +++ b/src/serialization/types/VistaGroupItemState.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const VistaGroupItemState: core.serialization.Schema< + serializers.VistaGroupItemState.Raw, + DevRev.VistaGroupItemState +> = core.serialization.enum_(["active", "completed", "planned"]); + +export declare namespace VistaGroupItemState { + type Raw = "active" | "completed" | "planned"; +} diff --git a/src/serialization/types/VistaGroupItemSummary.ts b/src/serialization/types/VistaGroupItemSummary.ts new file mode 100644 index 0000000..f41a411 --- /dev/null +++ b/src/serialization/types/VistaGroupItemSummary.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { VistaGroupItemType } from "./VistaGroupItemType"; +import { VistaGroupItemState } from "./VistaGroupItemState"; + +export const VistaGroupItemSummary: core.serialization.ObjectSchema< + serializers.VistaGroupItemSummary.Raw, + DevRev.VistaGroupItemSummary +> = core.serialization.object({ + type: VistaGroupItemType, + endDate: core.serialization.property("end_date", core.serialization.date().optional()), + id: core.serialization.string(), + name: core.serialization.string(), + startDate: core.serialization.property("start_date", core.serialization.date().optional()), + state: VistaGroupItemState.optional(), +}); + +export declare namespace VistaGroupItemSummary { + interface Raw { + type: VistaGroupItemType.Raw; + end_date?: string | null; + id: string; + name: string; + start_date?: string | null; + state?: VistaGroupItemState.Raw | null; + } +} diff --git a/src/serialization/types/VistaGroupItemType.ts b/src/serialization/types/VistaGroupItemType.ts new file mode 100644 index 0000000..4a38d5c --- /dev/null +++ b/src/serialization/types/VistaGroupItemType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const VistaGroupItemType: core.serialization.Schema< + serializers.VistaGroupItemType.Raw, + DevRev.VistaGroupItemType +> = core.serialization.enum_(["curated", "dynamic"]); + +export declare namespace VistaGroupItemType { + type Raw = "curated" | "dynamic"; +} diff --git a/src/serialization/types/VistaSearchSummary.ts b/src/serialization/types/VistaSearchSummary.ts new file mode 100644 index 0000000..14946fd --- /dev/null +++ b/src/serialization/types/VistaSearchSummary.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { VistaSummary } from "./VistaSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const VistaSearchSummary: core.serialization.ObjectSchema< + serializers.VistaSearchSummary.Raw, + DevRev.VistaSearchSummary +> = core.serialization + .object({ + vista: VistaSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace VistaSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + vista: VistaSummary.Raw; + } +} diff --git a/src/serialization/types/VistaSummary.ts b/src/serialization/types/VistaSummary.ts new file mode 100644 index 0000000..46d29db --- /dev/null +++ b/src/serialization/types/VistaSummary.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { VistaBaseSummary } from "./VistaBaseSummary"; +import { GroupedVistaSummary } from "./GroupedVistaSummary"; + +export const VistaSummary: core.serialization.Schema = + core.serialization + .union("type", { + curated: VistaBaseSummary, + dynamic: VistaBaseSummary, + grouped: GroupedVistaSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace VistaSummary { + type Raw = VistaSummary.Curated | VistaSummary.Dynamic | VistaSummary.Grouped; + + interface Curated extends VistaBaseSummary.Raw { + type: "curated"; + } + + interface Dynamic extends VistaBaseSummary.Raw { + type: "dynamic"; + } + + interface Grouped extends GroupedVistaSummary.Raw { + type: "grouped"; + } +} diff --git a/src/serialization/types/VistaType.ts b/src/serialization/types/VistaType.ts new file mode 100644 index 0000000..81dbcfe --- /dev/null +++ b/src/serialization/types/VistaType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const VistaType: core.serialization.Schema = + core.serialization.enum_(["curated", "dynamic", "grouped"]); + +export declare namespace VistaType { + type Raw = "curated" | "dynamic" | "grouped"; +} diff --git a/src/serialization/types/Webhook.ts b/src/serialization/types/Webhook.ts new file mode 100644 index 0000000..e71fa03 --- /dev/null +++ b/src/serialization/types/Webhook.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WebhookEventType } from "./WebhookEventType"; +import { WebhookStatus } from "./WebhookStatus"; +import { AtomBase } from "./AtomBase"; + +export const Webhook: core.serialization.ObjectSchema = core.serialization + .object({ + eventTypes: core.serialization.property("event_types", core.serialization.list(WebhookEventType).optional()), + secret: core.serialization.string(), + status: WebhookStatus, + url: core.serialization.string(), + }) + .extend(AtomBase); + +export declare namespace Webhook { + interface Raw extends AtomBase.Raw { + event_types?: WebhookEventType.Raw[] | null; + secret: string; + status: WebhookStatus.Raw; + url: string; + } +} diff --git a/src/serialization/types/WebhookEventRequest.ts b/src/serialization/types/WebhookEventRequest.ts new file mode 100644 index 0000000..6f316cc --- /dev/null +++ b/src/serialization/types/WebhookEventRequest.ts @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WebhookEventType } from "./WebhookEventType"; +import { EventAccountCreated } from "./EventAccountCreated"; +import { EventAccountDeleted } from "./EventAccountDeleted"; +import { EventAccountUpdated } from "./EventAccountUpdated"; +import { EventConversationCreated } from "./EventConversationCreated"; +import { EventConversationDeleted } from "./EventConversationDeleted"; +import { EventConversationUpdated } from "./EventConversationUpdated"; +import { EventDevUserCreated } from "./EventDevUserCreated"; +import { EventDevUserDeleted } from "./EventDevUserDeleted"; +import { EventDevUserUpdated } from "./EventDevUserUpdated"; +import { EventGroupCreated } from "./EventGroupCreated"; +import { EventGroupDeleted } from "./EventGroupDeleted"; +import { EventGroupUpdated } from "./EventGroupUpdated"; +import { EventPartCreated } from "./EventPartCreated"; +import { EventPartDeleted } from "./EventPartDeleted"; +import { EventPartUpdated } from "./EventPartUpdated"; +import { EventRevOrgCreated } from "./EventRevOrgCreated"; +import { EventRevOrgDeleted } from "./EventRevOrgDeleted"; +import { EventRevOrgUpdated } from "./EventRevOrgUpdated"; +import { EventRevUserCreated } from "./EventRevUserCreated"; +import { EventRevUserDeleted } from "./EventRevUserDeleted"; +import { EventRevUserUpdated } from "./EventRevUserUpdated"; +import { EventSlaTrackerCreated } from "./EventSlaTrackerCreated"; +import { EventSlaTrackerDeleted } from "./EventSlaTrackerDeleted"; +import { EventSlaTrackerUpdated } from "./EventSlaTrackerUpdated"; +import { EventSurveyResponseCreated } from "./EventSurveyResponseCreated"; +import { EventSurveyResponseDeleted } from "./EventSurveyResponseDeleted"; +import { EventSurveyResponseUpdated } from "./EventSurveyResponseUpdated"; +import { EventTagCreated } from "./EventTagCreated"; +import { EventTagDeleted } from "./EventTagDeleted"; +import { EventTagUpdated } from "./EventTagUpdated"; +import { EventTimelineEntryCreated } from "./EventTimelineEntryCreated"; +import { EventTimelineEntryDeleted } from "./EventTimelineEntryDeleted"; +import { EventTimelineEntryUpdated } from "./EventTimelineEntryUpdated"; +import { WebhookEventVerify } from "./WebhookEventVerify"; +import { EventWebhookCreated } from "./EventWebhookCreated"; +import { EventWebhookDeleted } from "./EventWebhookDeleted"; +import { EventWebhookUpdated } from "./EventWebhookUpdated"; +import { EventWorkCreated } from "./EventWorkCreated"; +import { EventWorkDeleted } from "./EventWorkDeleted"; +import { EventWorkUpdated } from "./EventWorkUpdated"; + +export const WebhookEventRequest: core.serialization.ObjectSchema< + serializers.WebhookEventRequest.Raw, + DevRev.WebhookEventRequest +> = core.serialization.object({ + type: WebhookEventType.optional(), + accountCreated: core.serialization.property("account_created", EventAccountCreated.optional()), + accountDeleted: core.serialization.property("account_deleted", EventAccountDeleted.optional()), + accountUpdated: core.serialization.property("account_updated", EventAccountUpdated.optional()), + conversationCreated: core.serialization.property("conversation_created", EventConversationCreated.optional()), + conversationDeleted: core.serialization.property("conversation_deleted", EventConversationDeleted.optional()), + conversationUpdated: core.serialization.property("conversation_updated", EventConversationUpdated.optional()), + devUserCreated: core.serialization.property("dev_user_created", EventDevUserCreated.optional()), + devUserDeleted: core.serialization.property("dev_user_deleted", EventDevUserDeleted.optional()), + devUserUpdated: core.serialization.property("dev_user_updated", EventDevUserUpdated.optional()), + groupCreated: core.serialization.property("group_created", EventGroupCreated.optional()), + groupDeleted: core.serialization.property("group_deleted", EventGroupDeleted.optional()), + groupUpdated: core.serialization.property("group_updated", EventGroupUpdated.optional()), + id: core.serialization.string(), + partCreated: core.serialization.property("part_created", EventPartCreated.optional()), + partDeleted: core.serialization.property("part_deleted", EventPartDeleted.optional()), + partUpdated: core.serialization.property("part_updated", EventPartUpdated.optional()), + revOrgCreated: core.serialization.property("rev_org_created", EventRevOrgCreated.optional()), + revOrgDeleted: core.serialization.property("rev_org_deleted", EventRevOrgDeleted.optional()), + revOrgUpdated: core.serialization.property("rev_org_updated", EventRevOrgUpdated.optional()), + revUserCreated: core.serialization.property("rev_user_created", EventRevUserCreated.optional()), + revUserDeleted: core.serialization.property("rev_user_deleted", EventRevUserDeleted.optional()), + revUserUpdated: core.serialization.property("rev_user_updated", EventRevUserUpdated.optional()), + slaTrackerCreated: core.serialization.property("sla_tracker_created", EventSlaTrackerCreated.optional()), + slaTrackerDeleted: core.serialization.property("sla_tracker_deleted", EventSlaTrackerDeleted.optional()), + slaTrackerUpdated: core.serialization.property("sla_tracker_updated", EventSlaTrackerUpdated.optional()), + surveyResponseCreated: core.serialization.property( + "survey_response_created", + EventSurveyResponseCreated.optional() + ), + surveyResponseDeleted: core.serialization.property( + "survey_response_deleted", + EventSurveyResponseDeleted.optional() + ), + surveyResponseUpdated: core.serialization.property( + "survey_response_updated", + EventSurveyResponseUpdated.optional() + ), + tagCreated: core.serialization.property("tag_created", EventTagCreated.optional()), + tagDeleted: core.serialization.property("tag_deleted", EventTagDeleted.optional()), + tagUpdated: core.serialization.property("tag_updated", EventTagUpdated.optional()), + timelineEntryCreated: core.serialization.property("timeline_entry_created", EventTimelineEntryCreated.optional()), + timelineEntryDeleted: core.serialization.property("timeline_entry_deleted", EventTimelineEntryDeleted.optional()), + timelineEntryUpdated: core.serialization.property("timeline_entry_updated", EventTimelineEntryUpdated.optional()), + timestamp: core.serialization.date().optional(), + verify: WebhookEventVerify.optional(), + webhookCreated: core.serialization.property("webhook_created", EventWebhookCreated.optional()), + webhookDeleted: core.serialization.property("webhook_deleted", EventWebhookDeleted.optional()), + webhookId: core.serialization.property("webhook_id", core.serialization.string()), + webhookUpdated: core.serialization.property("webhook_updated", EventWebhookUpdated.optional()), + workCreated: core.serialization.property("work_created", EventWorkCreated.optional()), + workDeleted: core.serialization.property("work_deleted", EventWorkDeleted.optional()), + workUpdated: core.serialization.property("work_updated", EventWorkUpdated.optional()), +}); + +export declare namespace WebhookEventRequest { + interface Raw { + type?: WebhookEventType.Raw | null; + account_created?: EventAccountCreated.Raw | null; + account_deleted?: EventAccountDeleted.Raw | null; + account_updated?: EventAccountUpdated.Raw | null; + conversation_created?: EventConversationCreated.Raw | null; + conversation_deleted?: EventConversationDeleted.Raw | null; + conversation_updated?: EventConversationUpdated.Raw | null; + dev_user_created?: EventDevUserCreated.Raw | null; + dev_user_deleted?: EventDevUserDeleted.Raw | null; + dev_user_updated?: EventDevUserUpdated.Raw | null; + group_created?: EventGroupCreated.Raw | null; + group_deleted?: EventGroupDeleted.Raw | null; + group_updated?: EventGroupUpdated.Raw | null; + id: string; + part_created?: EventPartCreated.Raw | null; + part_deleted?: EventPartDeleted.Raw | null; + part_updated?: EventPartUpdated.Raw | null; + rev_org_created?: EventRevOrgCreated.Raw | null; + rev_org_deleted?: EventRevOrgDeleted.Raw | null; + rev_org_updated?: EventRevOrgUpdated.Raw | null; + rev_user_created?: EventRevUserCreated.Raw | null; + rev_user_deleted?: EventRevUserDeleted.Raw | null; + rev_user_updated?: EventRevUserUpdated.Raw | null; + sla_tracker_created?: EventSlaTrackerCreated.Raw | null; + sla_tracker_deleted?: EventSlaTrackerDeleted.Raw | null; + sla_tracker_updated?: EventSlaTrackerUpdated.Raw | null; + survey_response_created?: EventSurveyResponseCreated.Raw | null; + survey_response_deleted?: EventSurveyResponseDeleted.Raw | null; + survey_response_updated?: EventSurveyResponseUpdated.Raw | null; + tag_created?: EventTagCreated.Raw | null; + tag_deleted?: EventTagDeleted.Raw | null; + tag_updated?: EventTagUpdated.Raw | null; + timeline_entry_created?: EventTimelineEntryCreated.Raw | null; + timeline_entry_deleted?: EventTimelineEntryDeleted.Raw | null; + timeline_entry_updated?: EventTimelineEntryUpdated.Raw | null; + timestamp?: string | null; + verify?: WebhookEventVerify.Raw | null; + webhook_created?: EventWebhookCreated.Raw | null; + webhook_deleted?: EventWebhookDeleted.Raw | null; + webhook_id: string; + webhook_updated?: EventWebhookUpdated.Raw | null; + work_created?: EventWorkCreated.Raw | null; + work_deleted?: EventWorkDeleted.Raw | null; + work_updated?: EventWorkUpdated.Raw | null; + } +} diff --git a/src/serialization/types/WebhookEventResponse.ts b/src/serialization/types/WebhookEventResponse.ts new file mode 100644 index 0000000..755d18f --- /dev/null +++ b/src/serialization/types/WebhookEventResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WebhookEventResponse: core.serialization.ObjectSchema< + serializers.WebhookEventResponse.Raw, + DevRev.WebhookEventResponse +> = core.serialization.object({ + challenge: core.serialization.string().optional(), +}); + +export declare namespace WebhookEventResponse { + interface Raw { + challenge?: string | null; + } +} diff --git a/src/serialization/types/WebhookEventType.ts b/src/serialization/types/WebhookEventType.ts new file mode 100644 index 0000000..0763a4e --- /dev/null +++ b/src/serialization/types/WebhookEventType.ts @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WebhookEventType: core.serialization.Schema = + core.serialization.enum_([ + "account_created", + "account_deleted", + "account_updated", + "conversation_created", + "conversation_deleted", + "conversation_updated", + "dev_user_created", + "dev_user_deleted", + "dev_user_updated", + "group_created", + "group_deleted", + "group_updated", + "part_created", + "part_deleted", + "part_updated", + "rev_org_created", + "rev_org_deleted", + "rev_org_updated", + "rev_user_created", + "rev_user_deleted", + "rev_user_updated", + "sla_tracker_created", + "sla_tracker_deleted", + "sla_tracker_updated", + "tag_created", + "tag_deleted", + "tag_updated", + "timeline_entry_created", + "timeline_entry_deleted", + "timeline_entry_updated", + "verify", + "webhook_created", + "webhook_deleted", + "webhook_updated", + "work_created", + "work_deleted", + "work_updated", + ]); + +export declare namespace WebhookEventType { + type Raw = + | "account_created" + | "account_deleted" + | "account_updated" + | "conversation_created" + | "conversation_deleted" + | "conversation_updated" + | "dev_user_created" + | "dev_user_deleted" + | "dev_user_updated" + | "group_created" + | "group_deleted" + | "group_updated" + | "part_created" + | "part_deleted" + | "part_updated" + | "rev_org_created" + | "rev_org_deleted" + | "rev_org_updated" + | "rev_user_created" + | "rev_user_deleted" + | "rev_user_updated" + | "sla_tracker_created" + | "sla_tracker_deleted" + | "sla_tracker_updated" + | "tag_created" + | "tag_deleted" + | "tag_updated" + | "timeline_entry_created" + | "timeline_entry_deleted" + | "timeline_entry_updated" + | "verify" + | "webhook_created" + | "webhook_deleted" + | "webhook_updated" + | "work_created" + | "work_deleted" + | "work_updated"; +} diff --git a/src/serialization/types/WebhookEventVerify.ts b/src/serialization/types/WebhookEventVerify.ts new file mode 100644 index 0000000..0dc1cad --- /dev/null +++ b/src/serialization/types/WebhookEventVerify.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WebhookEventVerify: core.serialization.ObjectSchema< + serializers.WebhookEventVerify.Raw, + DevRev.WebhookEventVerify +> = core.serialization.object({ + challenge: core.serialization.string(), +}); + +export declare namespace WebhookEventVerify { + interface Raw { + challenge: string; + } +} diff --git a/src/serialization/types/WebhookStatus.ts b/src/serialization/types/WebhookStatus.ts new file mode 100644 index 0000000..4134c38 --- /dev/null +++ b/src/serialization/types/WebhookStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WebhookStatus: core.serialization.Schema = + core.serialization.enum_(["active", "inactive", "unverified"]); + +export declare namespace WebhookStatus { + type Raw = "active" | "inactive" | "unverified"; +} diff --git a/src/serialization/types/WebhookSummary.ts b/src/serialization/types/WebhookSummary.ts new file mode 100644 index 0000000..1930ba7 --- /dev/null +++ b/src/serialization/types/WebhookSummary.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const WebhookSummary: core.serialization.ObjectSchema = + AtomBaseSummary; + +export declare namespace WebhookSummary { + type Raw = AtomBaseSummary.Raw; +} diff --git a/src/serialization/types/WeeklyOrgSchedule.ts b/src/serialization/types/WeeklyOrgSchedule.ts new file mode 100644 index 0000000..3b79dbd --- /dev/null +++ b/src/serialization/types/WeeklyOrgSchedule.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WeeklyOrgSchedule: core.serialization.Schema = + core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace WeeklyOrgSchedule { + type Raw = Record; +} diff --git a/src/serialization/types/Work.ts b/src/serialization/types/Work.ts new file mode 100644 index 0000000..f4e510c --- /dev/null +++ b/src/serialization/types/Work.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Issue } from "./Issue"; +import { WorkBase } from "./WorkBase"; +import { Ticket } from "./Ticket"; + +export const Work: core.serialization.Schema = core.serialization + .union("type", { + issue: Issue, + opportunity: WorkBase, + task: WorkBase, + ticket: Ticket, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace Work { + type Raw = Work.Issue | Work.Opportunity | Work.Task | Work.Ticket; + + interface Issue extends Issue.Raw { + type: "issue"; + } + + interface Opportunity extends WorkBase.Raw { + type: "opportunity"; + } + + interface Task extends WorkBase.Raw { + type: "task"; + } + + interface Ticket extends Ticket.Raw { + type: "ticket"; + } +} diff --git a/src/serialization/types/WorkBase.ts b/src/serialization/types/WorkBase.ts new file mode 100644 index 0000000..249f94e --- /dev/null +++ b/src/serialization/types/WorkBase.ts @@ -0,0 +1,58 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { PartSummary } from "./PartSummary"; +import { ArtifactSummary } from "./ArtifactSummary"; +import { UserSummary } from "./UserSummary"; +import { LegacyStage } from "./LegacyStage"; +import { TagWithValue } from "./TagWithValue"; +import { AtomBase } from "./AtomBase"; + +export const WorkBase: core.serialization.ObjectSchema = core.serialization + .object({ + appliesToPart: core.serialization.property("applies_to_part", PartSummary.optional()), + artifacts: core.serialization.list(ArtifactSummary).optional(), + body: core.serialization.string().optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + ownedBy: core.serialization.property("owned_by", core.serialization.list(UserSummary)), + reportedBy: core.serialization.property("reported_by", core.serialization.list(UserSummary).optional()), + stage: LegacyStage.optional(), + stockSchemaFragment: core.serialization.property( + "stock_schema_fragment", + core.serialization.string().optional() + ), + subtype: core.serialization.string().optional(), + tags: core.serialization.list(TagWithValue).optional(), + targetCloseDate: core.serialization.property("target_close_date", core.serialization.date().optional()), + title: core.serialization.string(), + }) + .extend(AtomBase); + +export declare namespace WorkBase { + interface Raw extends AtomBase.Raw { + applies_to_part?: PartSummary.Raw | null; + artifacts?: ArtifactSummary.Raw[] | null; + body?: string | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + owned_by: UserSummary.Raw[]; + reported_by?: UserSummary.Raw[] | null; + stage?: LegacyStage.Raw | null; + stock_schema_fragment?: string | null; + subtype?: string | null; + tags?: TagWithValue.Raw[] | null; + target_close_date?: string | null; + title: string; + } +} diff --git a/src/serialization/types/WorkBaseSummary.ts b/src/serialization/types/WorkBaseSummary.ts new file mode 100644 index 0000000..bb5f186 --- /dev/null +++ b/src/serialization/types/WorkBaseSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { UserSummary } from "./UserSummary"; +import { LegacyStageSummary } from "./LegacyStageSummary"; +import { AtomBaseSummary } from "./AtomBaseSummary"; + +export const WorkBaseSummary: core.serialization.ObjectSchema = + core.serialization + .object({ + ownedBy: core.serialization.property("owned_by", core.serialization.list(UserSummary)), + stage: LegacyStageSummary.optional(), + title: core.serialization.string(), + }) + .extend(AtomBaseSummary); + +export declare namespace WorkBaseSummary { + interface Raw extends AtomBaseSummary.Raw { + owned_by: UserSummary.Raw[]; + stage?: LegacyStageSummary.Raw | null; + title: string; + } +} diff --git a/src/serialization/types/WorkSearchSummary.ts b/src/serialization/types/WorkSearchSummary.ts new file mode 100644 index 0000000..97e08d2 --- /dev/null +++ b/src/serialization/types/WorkSearchSummary.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { CommentSearchSummary } from "./CommentSearchSummary"; +import { WorkSummary } from "./WorkSummary"; +import { SearchSummaryBase } from "./SearchSummaryBase"; + +export const WorkSearchSummary: core.serialization.ObjectSchema< + serializers.WorkSearchSummary.Raw, + DevRev.WorkSearchSummary +> = core.serialization + .object({ + comments: core.serialization.list(CommentSearchSummary).optional(), + work: WorkSummary, + }) + .extend(SearchSummaryBase); + +export declare namespace WorkSearchSummary { + interface Raw extends SearchSummaryBase.Raw { + comments?: CommentSearchSummary.Raw[] | null; + work: WorkSummary.Raw; + } +} diff --git a/src/serialization/types/WorkSummary.ts b/src/serialization/types/WorkSummary.ts new file mode 100644 index 0000000..325b1c6 --- /dev/null +++ b/src/serialization/types/WorkSummary.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { IssueSummary } from "./IssueSummary"; +import { WorkBaseSummary } from "./WorkBaseSummary"; +import { TicketSummary } from "./TicketSummary"; + +export const WorkSummary: core.serialization.Schema = + core.serialization + .union("type", { + issue: IssueSummary, + opportunity: WorkBaseSummary, + task: WorkBaseSummary, + ticket: TicketSummary, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace WorkSummary { + type Raw = WorkSummary.Issue | WorkSummary.Opportunity | WorkSummary.Task | WorkSummary.Ticket; + + interface Issue extends IssueSummary.Raw { + type: "issue"; + } + + interface Opportunity extends WorkBaseSummary.Raw { + type: "opportunity"; + } + + interface Task extends WorkBaseSummary.Raw { + type: "task"; + } + + interface Ticket extends TicketSummary.Raw { + type: "ticket"; + } +} diff --git a/src/serialization/types/WorkType.ts b/src/serialization/types/WorkType.ts new file mode 100644 index 0000000..59dffd5 --- /dev/null +++ b/src/serialization/types/WorkType.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorkType: core.serialization.Schema = core.serialization.enum_([ + "issue", + "opportunity", + "task", + "ticket", +]); + +export declare namespace WorkType { + type Raw = "issue" | "opportunity" | "task" | "ticket"; +} diff --git a/src/serialization/types/WorksCreateRequest.ts b/src/serialization/types/WorksCreateRequest.ts new file mode 100644 index 0000000..5bca679 --- /dev/null +++ b/src/serialization/types/WorksCreateRequest.ts @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { CustomSchemaSpec } from "./CustomSchemaSpec"; +import { StageInit } from "./StageInit"; +import { StageValidationOptionForCreate } from "./StageValidationOptionForCreate"; +import { SetTagWithValue } from "./SetTagWithValue"; +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { WorksCreateRequestIssue } from "./WorksCreateRequestIssue"; +import { WorksCreateRequestOpportunity } from "./WorksCreateRequestOpportunity"; +import { WorksCreateRequestTask } from "./WorksCreateRequestTask"; +import { WorksCreateRequestTicket } from "./WorksCreateRequestTicket"; + +const _Base = core.serialization.object({ + appliesToPart: core.serialization.property("applies_to_part", core.serialization.string()), + artifacts: core.serialization.list(core.serialization.string()).optional(), + body: core.serialization.string().optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + customSchemaSpec: core.serialization.property("custom_schema_spec", CustomSchemaSpec.optional()), + ownedBy: core.serialization.property("owned_by", core.serialization.list(core.serialization.string())), + reportedBy: core.serialization.property( + "reported_by", + core.serialization.list(core.serialization.string()).optional() + ), + stage: StageInit.optional(), + stageValidationOptions: core.serialization.property( + "stage_validation_options", + core.serialization.list(StageValidationOptionForCreate).optional() + ), + tags: core.serialization.list(SetTagWithValue).optional(), + targetCloseDate: core.serialization.property("target_close_date", core.serialization.date().optional()), + title: core.serialization.string(), +}); +export const WorksCreateRequest: core.serialization.Schema< + serializers.WorksCreateRequest.Raw, + DevRev.WorksCreateRequest +> = core.serialization + .union("type", { + issue: WorksCreateRequestIssue.extend(_Base), + opportunity: WorksCreateRequestOpportunity.extend(_Base), + task: WorksCreateRequestTask.extend(_Base), + ticket: WorksCreateRequestTicket.extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace WorksCreateRequest { + type Raw = + | WorksCreateRequest.Issue + | WorksCreateRequest.Opportunity + | WorksCreateRequest.Task + | WorksCreateRequest.Ticket; + + interface Issue extends _Base, WorksCreateRequestIssue.Raw { + type: "issue"; + } + + interface Opportunity extends _Base, WorksCreateRequestOpportunity.Raw { + type: "opportunity"; + } + + interface Task extends _Base, WorksCreateRequestTask.Raw { + type: "task"; + } + + interface Ticket extends _Base, WorksCreateRequestTicket.Raw { + type: "ticket"; + } + + interface _Base { + applies_to_part: string; + artifacts?: string[] | null; + body?: string | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + custom_schema_spec?: CustomSchemaSpec.Raw | null; + owned_by: string[]; + reported_by?: string[] | null; + stage?: StageInit.Raw | null; + stage_validation_options?: StageValidationOptionForCreate.Raw[] | null; + tags?: SetTagWithValue.Raw[] | null; + target_close_date?: string | null; + title: string; + } +} diff --git a/src/serialization/types/WorksCreateRequestIssue.ts b/src/serialization/types/WorksCreateRequestIssue.ts new file mode 100644 index 0000000..81d14d2 --- /dev/null +++ b/src/serialization/types/WorksCreateRequestIssue.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { IssuePriority } from "./IssuePriority"; + +export const WorksCreateRequestIssue: core.serialization.ObjectSchema< + serializers.WorksCreateRequestIssue.Raw, + DevRev.WorksCreateRequestIssue +> = core.serialization.object({ + developedWith: core.serialization.property( + "developed_with", + core.serialization.list(core.serialization.string()).optional() + ), + priority: IssuePriority.optional(), + priorityV2: core.serialization.property("priority_v2", core.serialization.number().optional()), + sprint: core.serialization.string().optional(), + targetStartDate: core.serialization.property("target_start_date", core.serialization.date().optional()), +}); + +export declare namespace WorksCreateRequestIssue { + interface Raw { + developed_with?: string[] | null; + priority?: IssuePriority.Raw | null; + priority_v2?: number | null; + sprint?: string | null; + target_start_date?: string | null; + } +} diff --git a/src/serialization/types/WorksCreateRequestOpportunity.ts b/src/serialization/types/WorksCreateRequestOpportunity.ts new file mode 100644 index 0000000..21ea9c7 --- /dev/null +++ b/src/serialization/types/WorksCreateRequestOpportunity.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { OpportunityForecastCategory } from "./OpportunityForecastCategory"; +import { OpportunityPriority } from "./OpportunityPriority"; + +export const WorksCreateRequestOpportunity: core.serialization.ObjectSchema< + serializers.WorksCreateRequestOpportunity.Raw, + DevRev.WorksCreateRequestOpportunity +> = core.serialization.object({ + account: core.serialization.string(), + amount: core.serialization.number().optional(), + contacts: core.serialization.list(core.serialization.string()).optional(), + customerBudget: core.serialization.property("customer_budget", core.serialization.number().optional()), + forecastCategory: core.serialization.property("forecast_category", OpportunityForecastCategory.optional()), + priority: OpportunityPriority.optional(), + probability: core.serialization.number().optional(), +}); + +export declare namespace WorksCreateRequestOpportunity { + interface Raw { + account: string; + amount?: number | null; + contacts?: string[] | null; + customer_budget?: number | null; + forecast_category?: OpportunityForecastCategory.Raw | null; + priority?: OpportunityPriority.Raw | null; + probability?: number | null; + } +} diff --git a/src/serialization/types/WorksCreateRequestTask.ts b/src/serialization/types/WorksCreateRequestTask.ts new file mode 100644 index 0000000..a41c67d --- /dev/null +++ b/src/serialization/types/WorksCreateRequestTask.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TaskPriority } from "./TaskPriority"; + +export const WorksCreateRequestTask: core.serialization.ObjectSchema< + serializers.WorksCreateRequestTask.Raw, + DevRev.WorksCreateRequestTask +> = core.serialization.object({ + embedded: core.serialization.boolean().optional(), + priority: TaskPriority.optional(), + startDate: core.serialization.property("start_date", core.serialization.date().optional()), +}); + +export declare namespace WorksCreateRequestTask { + interface Raw { + embedded?: boolean | null; + priority?: TaskPriority.Raw | null; + start_date?: string | null; + } +} diff --git a/src/serialization/types/WorksCreateRequestTicket.ts b/src/serialization/types/WorksCreateRequestTicket.ts new file mode 100644 index 0000000..bef24ca --- /dev/null +++ b/src/serialization/types/WorksCreateRequestTicket.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TicketChannels } from "./TicketChannels"; +import { TicketSeverity } from "./TicketSeverity"; + +export const WorksCreateRequestTicket: core.serialization.ObjectSchema< + serializers.WorksCreateRequestTicket.Raw, + DevRev.WorksCreateRequestTicket +> = core.serialization.object({ + channels: core.serialization.list(TicketChannels).optional(), + group: core.serialization.string().optional(), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + needsResponse: core.serialization.property("needs_response", core.serialization.boolean().optional()), + revOrg: core.serialization.property("rev_org", core.serialization.string().optional()), + severity: TicketSeverity.optional(), + sourceChannel: core.serialization.property("source_channel", core.serialization.string().optional()), +}); + +export declare namespace WorksCreateRequestTicket { + interface Raw { + channels?: TicketChannels.Raw[] | null; + group?: string | null; + is_spam?: boolean | null; + needs_response?: boolean | null; + rev_org?: string | null; + severity?: TicketSeverity.Raw | null; + source_channel?: string | null; + } +} diff --git a/src/serialization/types/WorksCreateResponse.ts b/src/serialization/types/WorksCreateResponse.ts new file mode 100644 index 0000000..1e8f2f0 --- /dev/null +++ b/src/serialization/types/WorksCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const WorksCreateResponse: core.serialization.ObjectSchema< + serializers.WorksCreateResponse.Raw, + DevRev.WorksCreateResponse +> = core.serialization.object({ + work: Work, +}); + +export declare namespace WorksCreateResponse { + interface Raw { + work: Work.Raw; + } +} diff --git a/src/serialization/types/WorksDeleteResponse.ts b/src/serialization/types/WorksDeleteResponse.ts new file mode 100644 index 0000000..adfba5e --- /dev/null +++ b/src/serialization/types/WorksDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksDeleteResponse: core.serialization.Schema< + serializers.WorksDeleteResponse.Raw, + DevRev.WorksDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace WorksDeleteResponse { + type Raw = Record; +} diff --git a/src/serialization/types/WorksExportResponse.ts b/src/serialization/types/WorksExportResponse.ts new file mode 100644 index 0000000..0c8087d --- /dev/null +++ b/src/serialization/types/WorksExportResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const WorksExportResponse: core.serialization.ObjectSchema< + serializers.WorksExportResponse.Raw, + DevRev.WorksExportResponse +> = core.serialization.object({ + works: core.serialization.list(Work), +}); + +export declare namespace WorksExportResponse { + interface Raw { + works: Work.Raw[]; + } +} diff --git a/src/serialization/types/WorksFilterIssue.ts b/src/serialization/types/WorksFilterIssue.ts new file mode 100644 index 0000000..2638d94 --- /dev/null +++ b/src/serialization/types/WorksFilterIssue.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { DateFilter } from "./DateFilter"; +import { IssuePriority } from "./IssuePriority"; +import { SlaSummaryFilter } from "./SlaSummaryFilter"; + +export const WorksFilterIssue: core.serialization.ObjectSchema< + serializers.WorksFilterIssue.Raw, + DevRev.WorksFilterIssue +> = core.serialization.object({ + accounts: core.serialization.list(core.serialization.string()).optional(), + actualStartDate: core.serialization.property("actual_start_date", DateFilter.optional()), + priority: core.serialization.list(IssuePriority).optional(), + priorityV2: core.serialization.property( + "priority_v2", + core.serialization.list(core.serialization.number()).optional() + ), + revOrgs: core.serialization.property("rev_orgs", core.serialization.list(core.serialization.string()).optional()), + slaSummary: core.serialization.property("sla_summary", SlaSummaryFilter.optional()), + sprint: core.serialization.list(core.serialization.string()).optional(), + subtype: core.serialization.list(core.serialization.string()).optional(), + targetStartDate: core.serialization.property("target_start_date", DateFilter.optional()), +}); + +export declare namespace WorksFilterIssue { + interface Raw { + accounts?: string[] | null; + actual_start_date?: DateFilter.Raw | null; + priority?: IssuePriority.Raw[] | null; + priority_v2?: number[] | null; + rev_orgs?: string[] | null; + sla_summary?: SlaSummaryFilter.Raw | null; + sprint?: string[] | null; + subtype?: string[] | null; + target_start_date?: DateFilter.Raw | null; + } +} diff --git a/src/serialization/types/WorksFilterOpportunity.ts b/src/serialization/types/WorksFilterOpportunity.ts new file mode 100644 index 0000000..db9206d --- /dev/null +++ b/src/serialization/types/WorksFilterOpportunity.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksFilterOpportunity: core.serialization.ObjectSchema< + serializers.WorksFilterOpportunity.Raw, + DevRev.WorksFilterOpportunity +> = core.serialization.object({ + account: core.serialization.list(core.serialization.string()).optional(), + contacts: core.serialization.list(core.serialization.string()).optional(), + subtype: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace WorksFilterOpportunity { + interface Raw { + account?: string[] | null; + contacts?: string[] | null; + subtype?: string[] | null; + } +} diff --git a/src/serialization/types/WorksFilterTicket.ts b/src/serialization/types/WorksFilterTicket.ts new file mode 100644 index 0000000..f792df0 --- /dev/null +++ b/src/serialization/types/WorksFilterTicket.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TicketChannels } from "./TicketChannels"; +import { TicketSeverity } from "./TicketSeverity"; +import { SlaSummaryFilter } from "./SlaSummaryFilter"; +import { SurveyAggregationFilter } from "./SurveyAggregationFilter"; + +export const WorksFilterTicket: core.serialization.ObjectSchema< + serializers.WorksFilterTicket.Raw, + DevRev.WorksFilterTicket +> = core.serialization.object({ + channels: core.serialization.list(TicketChannels).optional(), + group: core.serialization.list(core.serialization.string()).optional(), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + needsResponse: core.serialization.property("needs_response", core.serialization.boolean().optional()), + revOrg: core.serialization.property("rev_org", core.serialization.list(core.serialization.string()).optional()), + severity: core.serialization.list(TicketSeverity).optional(), + slaSummary: core.serialization.property("sla_summary", SlaSummaryFilter.optional()), + sourceChannel: core.serialization.property( + "source_channel", + core.serialization.list(core.serialization.string()).optional() + ), + subtype: core.serialization.list(core.serialization.string()).optional(), + surveys: SurveyAggregationFilter.optional(), +}); + +export declare namespace WorksFilterTicket { + interface Raw { + channels?: TicketChannels.Raw[] | null; + group?: string[] | null; + is_spam?: boolean | null; + needs_response?: boolean | null; + rev_org?: string[] | null; + severity?: TicketSeverity.Raw[] | null; + sla_summary?: SlaSummaryFilter.Raw | null; + source_channel?: string[] | null; + subtype?: string[] | null; + surveys?: SurveyAggregationFilter.Raw | null; + } +} diff --git a/src/serialization/types/WorksGetResponse.ts b/src/serialization/types/WorksGetResponse.ts new file mode 100644 index 0000000..8601980 --- /dev/null +++ b/src/serialization/types/WorksGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const WorksGetResponse: core.serialization.ObjectSchema< + serializers.WorksGetResponse.Raw, + DevRev.WorksGetResponse +> = core.serialization.object({ + work: Work, +}); + +export declare namespace WorksGetResponse { + interface Raw { + work: Work.Raw; + } +} diff --git a/src/serialization/types/WorksListResponse.ts b/src/serialization/types/WorksListResponse.ts new file mode 100644 index 0000000..e556b4e --- /dev/null +++ b/src/serialization/types/WorksListResponse.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const WorksListResponse: core.serialization.ObjectSchema< + serializers.WorksListResponse.Raw, + DevRev.WorksListResponse +> = core.serialization.object({ + nextCursor: core.serialization.property("next_cursor", core.serialization.string().optional()), + prevCursor: core.serialization.property("prev_cursor", core.serialization.string().optional()), + works: core.serialization.list(Work), +}); + +export declare namespace WorksListResponse { + interface Raw { + next_cursor?: string | null; + prev_cursor?: string | null; + works: Work.Raw[]; + } +} diff --git a/src/serialization/types/WorksUpdateRequest.ts b/src/serialization/types/WorksUpdateRequest.ts new file mode 100644 index 0000000..ce54f24 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequest.ts @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { WorksUpdateRequestArtifacts } from "./WorksUpdateRequestArtifacts"; +import { CustomSchemaSpec } from "./CustomSchemaSpec"; +import { WorksUpdateRequestOwnedBy } from "./WorksUpdateRequestOwnedBy"; +import { WorksUpdateRequestReportedBy } from "./WorksUpdateRequestReportedBy"; +import { StageUpdate } from "./StageUpdate"; +import { StageValidationOptionForUpdate } from "./StageValidationOptionForUpdate"; +import { WorksUpdateRequestStagedInfoStagedInfoUpdate } from "./WorksUpdateRequestStagedInfoStagedInfoUpdate"; +import { WorksUpdateRequestTags } from "./WorksUpdateRequestTags"; +import * as core from "../../core"; +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import { WorksUpdateRequestIssue } from "./WorksUpdateRequestIssue"; +import { Empty } from "./Empty"; +import { WorksUpdateRequestOpportunity } from "./WorksUpdateRequestOpportunity"; +import { WorksUpdateRequestTask } from "./WorksUpdateRequestTask"; +import { WorksUpdateRequestTicket } from "./WorksUpdateRequestTicket"; + +const _Base = core.serialization.object({ + appliesToPart: core.serialization.property("applies_to_part", core.serialization.string().optional()), + artifacts: WorksUpdateRequestArtifacts.optional(), + body: core.serialization.string().optional(), + customFields: core.serialization.property( + "custom_fields", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() + ), + customSchemaFragments: core.serialization.property( + "custom_schema_fragments", + core.serialization.list(core.serialization.string()).optional() + ), + customSchemaSpec: core.serialization.property("custom_schema_spec", CustomSchemaSpec.optional()), + id: core.serialization.string(), + ownedBy: core.serialization.property("owned_by", WorksUpdateRequestOwnedBy.optional()), + reportedBy: core.serialization.property("reported_by", WorksUpdateRequestReportedBy.optional()), + stage: StageUpdate.optional(), + stageValidationOptions: core.serialization.property( + "stage_validation_options", + core.serialization.list(StageValidationOptionForUpdate).optional() + ), + stagedInfo: core.serialization.property("staged_info", WorksUpdateRequestStagedInfoStagedInfoUpdate.optional()), + tags: WorksUpdateRequestTags.optional(), + targetCloseDate: core.serialization.property("target_close_date", core.serialization.date().optional()), + title: core.serialization.string().optional(), +}); +export const WorksUpdateRequest: core.serialization.Schema< + serializers.WorksUpdateRequest.Raw, + DevRev.WorksUpdateRequest +> = core.serialization + .union("type", { + issue: WorksUpdateRequestIssue.extend(_Base), + none: core.serialization + .object({ + value: Empty, + }) + .extend(_Base), + opportunity: WorksUpdateRequestOpportunity.extend(_Base), + task: WorksUpdateRequestTask.extend(_Base), + ticket: WorksUpdateRequestTicket.extend(_Base), + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace WorksUpdateRequest { + type Raw = + | WorksUpdateRequest.Issue + | WorksUpdateRequest.None + | WorksUpdateRequest.Opportunity + | WorksUpdateRequest.Task + | WorksUpdateRequest.Ticket; + + interface Issue extends _Base, WorksUpdateRequestIssue.Raw { + type: "issue"; + } + + interface None extends _Base { + type: "none"; + value: Empty.Raw; + } + + interface Opportunity extends _Base, WorksUpdateRequestOpportunity.Raw { + type: "opportunity"; + } + + interface Task extends _Base, WorksUpdateRequestTask.Raw { + type: "task"; + } + + interface Ticket extends _Base, WorksUpdateRequestTicket.Raw { + type: "ticket"; + } + + interface _Base { + applies_to_part?: string | null; + artifacts?: WorksUpdateRequestArtifacts.Raw | null; + body?: string | null; + custom_fields?: Record | null; + custom_schema_fragments?: string[] | null; + custom_schema_spec?: CustomSchemaSpec.Raw | null; + id: string; + owned_by?: WorksUpdateRequestOwnedBy.Raw | null; + reported_by?: WorksUpdateRequestReportedBy.Raw | null; + stage?: StageUpdate.Raw | null; + stage_validation_options?: StageValidationOptionForUpdate.Raw[] | null; + staged_info?: WorksUpdateRequestStagedInfoStagedInfoUpdate.Raw | null; + tags?: WorksUpdateRequestTags.Raw | null; + target_close_date?: string | null; + title?: string | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestArtifacts.ts b/src/serialization/types/WorksUpdateRequestArtifacts.ts new file mode 100644 index 0000000..861d310 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestArtifacts.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksUpdateRequestArtifacts: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestArtifacts.Raw, + DevRev.WorksUpdateRequestArtifacts +> = core.serialization.object({ + add: core.serialization.list(core.serialization.string()).optional(), + remove: core.serialization.list(core.serialization.string()).optional(), + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace WorksUpdateRequestArtifacts { + interface Raw { + add?: string[] | null; + remove?: string[] | null; + set?: string[] | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestIssue.ts b/src/serialization/types/WorksUpdateRequestIssue.ts new file mode 100644 index 0000000..83e7f41 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestIssue.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WorksUpdateRequestIssueDevelopedWith } from "./WorksUpdateRequestIssueDevelopedWith"; +import { IssuePriority } from "./IssuePriority"; + +export const WorksUpdateRequestIssue: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestIssue.Raw, + DevRev.WorksUpdateRequestIssue +> = core.serialization.object({ + developedWith: core.serialization.property("developed_with", WorksUpdateRequestIssueDevelopedWith.optional()), + priority: IssuePriority.optional(), + priorityV2: core.serialization.property("priority_v2", core.serialization.number().optional()), + sprint: core.serialization.string().optional(), + targetStartDate: core.serialization.property("target_start_date", core.serialization.date().optional()), +}); + +export declare namespace WorksUpdateRequestIssue { + interface Raw { + developed_with?: WorksUpdateRequestIssueDevelopedWith.Raw | null; + priority?: IssuePriority.Raw | null; + priority_v2?: number | null; + sprint?: string | null; + target_start_date?: string | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestIssueDevelopedWith.ts b/src/serialization/types/WorksUpdateRequestIssueDevelopedWith.ts new file mode 100644 index 0000000..98079db --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestIssueDevelopedWith.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksUpdateRequestIssueDevelopedWith: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestIssueDevelopedWith.Raw, + DevRev.WorksUpdateRequestIssueDevelopedWith +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace WorksUpdateRequestIssueDevelopedWith { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestOpportunity.ts b/src/serialization/types/WorksUpdateRequestOpportunity.ts new file mode 100644 index 0000000..d83c53b --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestOpportunity.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WorksUpdateRequestOpportunityContacts } from "./WorksUpdateRequestOpportunityContacts"; + +export const WorksUpdateRequestOpportunity: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestOpportunity.Raw, + DevRev.WorksUpdateRequestOpportunity +> = core.serialization.object({ + account: core.serialization.string().optional(), + amount: core.serialization.number().optional(), + contacts: WorksUpdateRequestOpportunityContacts.optional(), + customerBudget: core.serialization.property("customer_budget", core.serialization.number().optional()), + probability: core.serialization.number().optional(), +}); + +export declare namespace WorksUpdateRequestOpportunity { + interface Raw { + account?: string | null; + amount?: number | null; + contacts?: WorksUpdateRequestOpportunityContacts.Raw | null; + customer_budget?: number | null; + probability?: number | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestOpportunityContacts.ts b/src/serialization/types/WorksUpdateRequestOpportunityContacts.ts new file mode 100644 index 0000000..0eaca7e --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestOpportunityContacts.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksUpdateRequestOpportunityContacts: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestOpportunityContacts.Raw, + DevRev.WorksUpdateRequestOpportunityContacts +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()), +}); + +export declare namespace WorksUpdateRequestOpportunityContacts { + interface Raw { + set: string[]; + } +} diff --git a/src/serialization/types/WorksUpdateRequestOwnedBy.ts b/src/serialization/types/WorksUpdateRequestOwnedBy.ts new file mode 100644 index 0000000..b07bf84 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestOwnedBy.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksUpdateRequestOwnedBy: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestOwnedBy.Raw, + DevRev.WorksUpdateRequestOwnedBy +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace WorksUpdateRequestOwnedBy { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestReportedBy.ts b/src/serialization/types/WorksUpdateRequestReportedBy.ts new file mode 100644 index 0000000..56becdc --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestReportedBy.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksUpdateRequestReportedBy: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestReportedBy.Raw, + DevRev.WorksUpdateRequestReportedBy +> = core.serialization.object({ + set: core.serialization.list(core.serialization.string()).optional(), +}); + +export declare namespace WorksUpdateRequestReportedBy { + interface Raw { + set?: string[] | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestStagedInfoStagedInfoUpdate.ts b/src/serialization/types/WorksUpdateRequestStagedInfoStagedInfoUpdate.ts new file mode 100644 index 0000000..ea518f9 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestStagedInfoStagedInfoUpdate.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; + +export const WorksUpdateRequestStagedInfoStagedInfoUpdate: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestStagedInfoStagedInfoUpdate.Raw, + DevRev.WorksUpdateRequestStagedInfoStagedInfoUpdate +> = core.serialization.object({ + unresolvedFields: core.serialization.property( + "unresolved_fields", + core.serialization.list(core.serialization.string()) + ), +}); + +export declare namespace WorksUpdateRequestStagedInfoStagedInfoUpdate { + interface Raw { + unresolved_fields: string[]; + } +} diff --git a/src/serialization/types/WorksUpdateRequestTags.ts b/src/serialization/types/WorksUpdateRequestTags.ts new file mode 100644 index 0000000..1efab71 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestTags.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { SetTagWithValue } from "./SetTagWithValue"; + +export const WorksUpdateRequestTags: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestTags.Raw, + DevRev.WorksUpdateRequestTags +> = core.serialization.object({ + set: core.serialization.list(SetTagWithValue).optional(), +}); + +export declare namespace WorksUpdateRequestTags { + interface Raw { + set?: SetTagWithValue.Raw[] | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestTask.ts b/src/serialization/types/WorksUpdateRequestTask.ts new file mode 100644 index 0000000..fd5a578 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestTask.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TaskPriority } from "./TaskPriority"; + +export const WorksUpdateRequestTask: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestTask.Raw, + DevRev.WorksUpdateRequestTask +> = core.serialization.object({ + embedded: core.serialization.boolean().optional(), + priority: TaskPriority.optional(), + startDate: core.serialization.property("start_date", core.serialization.date().optional()), +}); + +export declare namespace WorksUpdateRequestTask { + interface Raw { + embedded?: boolean | null; + priority?: TaskPriority.Raw | null; + start_date?: string | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestTicket.ts b/src/serialization/types/WorksUpdateRequestTicket.ts new file mode 100644 index 0000000..11109a3 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestTicket.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { WorksUpdateRequestTicketChannels } from "./WorksUpdateRequestTicketChannels"; +import { TicketSeverity } from "./TicketSeverity"; + +export const WorksUpdateRequestTicket: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestTicket.Raw, + DevRev.WorksUpdateRequestTicket +> = core.serialization.object({ + channels: WorksUpdateRequestTicketChannels.optional(), + group: core.serialization.string().optional(), + isSpam: core.serialization.property("is_spam", core.serialization.boolean().optional()), + needsResponse: core.serialization.property("needs_response", core.serialization.boolean().optional()), + revOrg: core.serialization.property("rev_org", core.serialization.string().optional()), + severity: TicketSeverity.optional(), +}); + +export declare namespace WorksUpdateRequestTicket { + interface Raw { + channels?: WorksUpdateRequestTicketChannels.Raw | null; + group?: string | null; + is_spam?: boolean | null; + needs_response?: boolean | null; + rev_org?: string | null; + severity?: TicketSeverity.Raw | null; + } +} diff --git a/src/serialization/types/WorksUpdateRequestTicketChannels.ts b/src/serialization/types/WorksUpdateRequestTicketChannels.ts new file mode 100644 index 0000000..bef66f8 --- /dev/null +++ b/src/serialization/types/WorksUpdateRequestTicketChannels.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { TicketChannels } from "./TicketChannels"; + +export const WorksUpdateRequestTicketChannels: core.serialization.ObjectSchema< + serializers.WorksUpdateRequestTicketChannels.Raw, + DevRev.WorksUpdateRequestTicketChannels +> = core.serialization.object({ + set: core.serialization.list(TicketChannels).optional(), +}); + +export declare namespace WorksUpdateRequestTicketChannels { + interface Raw { + set?: TicketChannels.Raw[] | null; + } +} diff --git a/src/serialization/types/WorksUpdateResponse.ts b/src/serialization/types/WorksUpdateResponse.ts new file mode 100644 index 0000000..2492e43 --- /dev/null +++ b/src/serialization/types/WorksUpdateResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as DevRev from "../../api/index"; +import * as core from "../../core"; +import { Work } from "./Work"; + +export const WorksUpdateResponse: core.serialization.ObjectSchema< + serializers.WorksUpdateResponse.Raw, + DevRev.WorksUpdateResponse +> = core.serialization.object({ + work: Work, +}); + +export declare namespace WorksUpdateResponse { + interface Raw { + work: Work.Raw; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts new file mode 100644 index 0000000..0217ab1 --- /dev/null +++ b/src/serialization/types/index.ts @@ -0,0 +1,633 @@ +export * from "./AccessLevel"; +export * from "./Account"; +export * from "./AccountSearchSummary"; +export * from "./SearchSummaryBase"; +export * from "./AccountSummary"; +export * from "./AccountsCreateResponse"; +export * from "./AccountsDeleteResponse"; +export * from "./AccountsExportResponse"; +export * from "./AccountsFilters"; +export * from "./AccountsGetResponse"; +export * from "./AccountsListResponse"; +export * from "./AccountsUpdateRequestArtifacts"; +export * from "./AccountsUpdateResponse"; +export * from "./AggregatedSchema"; +export * from "./AggregatedSchemaGetResponse"; +export * from "./AggregationDetail"; +export * from "./AggregationDetailAggregationType"; +export * from "./AppFragment"; +export * from "./CustomSchemaFragmentBase"; +export * from "./AtomBase"; +export * from "./AppFragmentSummary"; +export * from "./ArchetypeMetricTarget"; +export * from "./Article"; +export * from "./ArticleSearchSummary"; +export * from "./ArticleStatus"; +export * from "./ArticleSummary"; +export * from "./ArticleType"; +export * from "./ArticlesCountResponse"; +export * from "./ArticlesCreateRequestResource"; +export * from "./ArticlesCreateResponse"; +export * from "./ArticlesDeleteResponse"; +export * from "./ArticlesGetResponse"; +export * from "./ArticlesListResponse"; +export * from "./ArticlesUpdateRequestAppliesToParts"; +export * from "./ArticlesUpdateRequestArtifacts"; +export * from "./ArticlesUpdateRequestAuthoredBy"; +export * from "./ArticlesUpdateRequestExtractedContent"; +export * from "./ArticlesUpdateRequestOwnedBy"; +export * from "./ArticlesUpdateRequestReorder"; +export * from "./ArticlesUpdateRequestSharedWith"; +export * from "./ArticlesUpdateRequestTags"; +export * from "./ArticlesUpdateResponse"; +export * from "./ArtifactSearchSummary"; +export * from "./ArtifactSummary"; +export * from "./ArtifactsPrepareResponse"; +export * from "./ArtifactsPrepareResponseFormData"; +export * from "./ArtifactsVersionsPrepareResponse"; +export * from "./ArtifactsVersionsPrepareResponseFormData"; +export * from "./AtomBaseSummary"; +export * from "./AtomSummary"; +export * from "./AtomType"; +export * from "./BooleanExpression"; +export * from "./BooleanExpressionAndExpression"; +export * from "./BooleanExpressionNotExpression"; +export * from "./BooleanExpressionOrExpression"; +export * from "./BooleanExpressionPrimitiveExpression"; +export * from "./BooleanExpressionType"; +export * from "./Capability"; +export * from "./CapabilitySummary"; +export * from "./ClientContext"; +export * from "./ClientContextBrowser"; +export * from "./ClientContextCpu"; +export * from "./ClientContextDevice"; +export * from "./ClientContextEngine"; +export * from "./ClientContextOs"; +export * from "./ClientContextPage"; +export * from "./CodeChange"; +export * from "./CodeChangeSource"; +export * from "./CodeChangesCreateRequest"; +export * from "./CodeChangesCreateResponse"; +export * from "./CodeChangesDeleteResponse"; +export * from "./CodeChangesGetResponse"; +export * from "./CodeChangesListResponse"; +export * from "./CodeChangesUpdateResponse"; +export * from "./CommentSearchSummary"; +export * from "./Conversation"; +export * from "./ConversationMetadata"; +export * from "./ConversationSearchSummary"; +export * from "./ConversationSummary"; +export * from "./ConversationsCreateRequestMessage"; +export * from "./ConversationsCreateRequestMetadata"; +export * from "./ConversationsCreateRequestTypeValue"; +export * from "./ConversationsCreateResponse"; +export * from "./ConversationsDeleteResponse"; +export * from "./ConversationsExportResponse"; +export * from "./ConversationsGetResponse"; +export * from "./ConversationsListResponse"; +export * from "./ConversationsUpdateRequestAppliesToParts"; +export * from "./ConversationsUpdateRequestMetadata"; +export * from "./ConversationsUpdateRequestTags"; +export * from "./ConversationsUpdateRequestUserSessions"; +export * from "./ConversationsUpdateResponse"; +export * from "./CreateEmailInfo"; +export * from "./CreateEmailInlineAttachment"; +export * from "./CreateEmailPreviewWidget"; +export * from "./CreateOrgScheduleInterval"; +export * from "./CreateWeeklyOrgScheduleInterval"; +export * from "./CuratedVistaSummary"; +export * from "./CustomObjectSearchSummary"; +export * from "./CustomObjectSummary"; +export * from "./CustomSchemaFragment"; +export * from "./CustomSchemaFragmentBaseSummary"; +export * from "./CustomSchemaFragmentCondition"; +export * from "./CustomSchemaFragmentFragmentType"; +export * from "./CustomSchemaFragmentSummary"; +export * from "./CustomSchemaFragmentType"; +export * from "./CustomSchemaFragmentsGetResponse"; +export * from "./CustomSchemaFragmentsListRequestPrune"; +export * from "./CustomSchemaFragmentsListResponse"; +export * from "./CustomSchemaFragmentsSetRequest"; +export * from "./CustomSchemaFragmentsSetRequestAppFragment"; +export * from "./CustomSchemaFragmentsSetRequestCustomTypeFragment"; +export * from "./CustomSchemaFragmentsSetRequestTenantFragment"; +export * from "./CustomSchemaFragmentsSetRequestType"; +export * from "./CustomSchemaFragmentsSetResponse"; +export * from "./CustomSchemaSpec"; +export * from "./CustomStage"; +export * from "./CustomStageSummary"; +export * from "./CustomStagesCreateResponse"; +export * from "./CustomStagesGetResponse"; +export * from "./CustomStagesListResponse"; +export * from "./CustomStagesUpdateResponse"; +export * from "./CustomState"; +export * from "./CustomStatesCreateResponse"; +export * from "./CustomStatesGetResponse"; +export * from "./CustomStatesListResponse"; +export * from "./CustomStatesUpdateResponse"; +export * from "./CustomTypeFragment"; +export * from "./CustomTypeFragmentSummary"; +export * from "./CustomTypePathComponent"; +export * from "./DashboardSearchSummary"; +export * from "./DashboardSummary"; +export * from "./DateFilter"; +export * from "./DateFilterType"; +export * from "./DateTimeFilter"; +export * from "./DateTimePreset"; +export * from "./DateTimePresetLastNDays"; +export * from "./DateTimePresetNextNDays"; +export * from "./DateTimePresetType"; +export * from "./DevUser"; +export * from "./DevUserJobTitle"; +export * from "./DevUserSummary"; +export * from "./DevUsersIdentitiesLinkResponse"; +export * from "./DevUsersIdentitiesUnlinkResponse"; +export * from "./DevUsersUpdateResponse"; +export * from "./DirectorySummary"; +export * from "./DynamicGroupInfo"; +export * from "./DynamicVistaSummary"; +export * from "./EmailInfo"; +export * from "./EmailInlineAttachment"; +export * from "./EmailPreviewWidget"; +export * from "./SnapWidgetBase"; +export * from "./Empty"; +export * from "./Engagement"; +export * from "./EngagementSummary"; +export * from "./EngagementType"; +export * from "./EngagementsCountResponse"; +export * from "./EngagementsCreateRequestEngagementType"; +export * from "./EngagementsCreateResponse"; +export * from "./EngagementsDeleteResponse"; +export * from "./EngagementsGetResponse"; +export * from "./EngagementsListResponse"; +export * from "./EngagementsUpdateRequestArtifactIds"; +export * from "./EngagementsUpdateRequestMembers"; +export * from "./EngagementsUpdateRequestTags"; +export * from "./EngagementsUpdateResponse"; +export * from "./Enhancement"; +export * from "./EnhancementSummary"; +export * from "./EnumValue"; +export * from "./Error_"; +export * from "./ErrorBadRequest"; +export * from "./ErrorBadRequestArtifactAlreadyAttachedToAParent"; +export * from "./ErrorBadRequestBadRequest"; +export * from "./ErrorBadRequestInvalidApiVersion"; +export * from "./ErrorBadRequestInvalidEnumValue"; +export * from "./ErrorBadRequestInvalidField"; +export * from "./ErrorBadRequestInvalidId"; +export * from "./ErrorBadRequestMergeWorksError"; +export * from "./ErrorBadRequestMergeWorksErrorErrorSubtype"; +export * from "./ErrorBadRequestMergeWorksErrorError"; +export * from "./ErrorBadRequestMergeWorksErrorErrorAlreadyMerged"; +export * from "./ErrorBadRequestMergeWorksErrorErrorClosed"; +export * from "./ErrorBadRequestMergeWorksErrorErrorDifferentWorkspace"; +export * from "./ErrorBadRequestMergeWorksErrorErrorInvalidStageTransition"; +export * from "./ErrorBadRequestMissingDependency"; +export * from "./ErrorBadRequestMissingDependencyDependency"; +export * from "./ErrorBadRequestMissingRequiredField"; +export * from "./ErrorBadRequestParseError"; +export * from "./ErrorBadRequestStaleSchemaFragments"; +export * from "./ErrorBadRequestType"; +export * from "./ErrorBadRequestUnexpectedIdType"; +export * from "./ErrorBadRequestUnexpectedJsonType"; +export * from "./ErrorBadRequestUnexpectedJsonTypeType"; +export * from "./ErrorBadRequestValueNotPermitted"; +export * from "./ErrorBase"; +export * from "./ErrorConflict"; +export * from "./ErrorConflictConflict"; +export * from "./ErrorConflictType"; +export * from "./ErrorForbidden"; +export * from "./ErrorForbiddenForbidden"; +export * from "./ErrorForbiddenType"; +export * from "./ErrorInternalServerError"; +export * from "./ErrorInternalServerErrorInternalError"; +export * from "./ErrorInternalServerErrorType"; +export * from "./ErrorNotFound"; +export * from "./ErrorNotFoundNotFound"; +export * from "./ErrorNotFoundType"; +export * from "./ErrorServiceUnavailable"; +export * from "./ErrorServiceUnavailableServiceUnavailable"; +export * from "./ErrorServiceUnavailableType"; +export * from "./ErrorTooManyRequests"; +export * from "./ErrorTooManyRequestsTooManyRequests"; +export * from "./ErrorTooManyRequestsType"; +export * from "./ErrorUnauthorized"; +export * from "./ErrorUnauthorizedType"; +export * from "./ErrorUnauthorizedUnauthenticated"; +export * from "./EventAccountCreated"; +export * from "./EventAccountDeleted"; +export * from "./EventAccountUpdated"; +export * from "./EventConversationCreated"; +export * from "./EventConversationDeleted"; +export * from "./EventConversationUpdated"; +export * from "./EventDevUserCreated"; +export * from "./EventDevUserDeleted"; +export * from "./EventDevUserUpdated"; +export * from "./EventGroupCreated"; +export * from "./EventGroupDeleted"; +export * from "./EventGroupUpdated"; +export * from "./EventPartCreated"; +export * from "./EventPartDeleted"; +export * from "./EventPartUpdated"; +export * from "./EventRevOrgCreated"; +export * from "./EventRevOrgDeleted"; +export * from "./EventRevOrgUpdated"; +export * from "./EventRevUserCreated"; +export * from "./EventRevUserDeleted"; +export * from "./EventRevUserUpdated"; +export * from "./EventSlaTrackerCreated"; +export * from "./EventSlaTrackerDeleted"; +export * from "./EventSlaTrackerUpdated"; +export * from "./EventSource"; +export * from "./EventSourceGetResponse"; +export * from "./EventSourceSetupInstructions"; +export * from "./EventSourceStatus"; +export * from "./EventSourcesScheduleEventResponse"; +export * from "./EventSurveyResponseCreated"; +export * from "./EventSurveyResponseDeleted"; +export * from "./EventSurveyResponseUpdated"; +export * from "./EventTagCreated"; +export * from "./EventTagDeleted"; +export * from "./EventTagUpdated"; +export * from "./EventTimelineEntryCreated"; +export * from "./EventTimelineEntryDeleted"; +export * from "./EventTimelineEntryUpdated"; +export * from "./EventWebhookCreated"; +export * from "./EventWebhookDeleted"; +export * from "./EventWebhookUpdated"; +export * from "./EventWorkCreated"; +export * from "./EventWorkDeleted"; +export * from "./EventWorkUpdated"; +export * from "./ExternalIdentity"; +export * from "./Feature"; +export * from "./FeatureSummary"; +export * from "./FieldDescriptor"; +export * from "./Group"; +export * from "./GroupMemberType"; +export * from "./GroupMembersAddResponse"; +export * from "./GroupMembersListResponse"; +export * from "./GroupMembersListResponseMember"; +export * from "./GroupMembersRemoveResponse"; +export * from "./GroupSearchSummary"; +export * from "./GroupSummary"; +export * from "./GroupType"; +export * from "./GroupedVistaFlavor"; +export * from "./GroupedVistaSummary"; +export * from "./VistaBaseSummary"; +export * from "./GroupsCreateResponse"; +export * from "./GroupsGetResponse"; +export * from "./GroupsListResponse"; +export * from "./GroupsUpdateRequestDynamicGroupInfo"; +export * from "./GroupsUpdateResponse"; +export * from "./Issue"; +export * from "./WorkBase"; +export * from "./IssuePriority"; +export * from "./IssueSummary"; +export * from "./WorkBaseSummary"; +export * from "./JobHistoryItem"; +export * from "./LegacyStage"; +export * from "./LegacyStageSummary"; +export * from "./LinesOfCode"; +export * from "./Link"; +export * from "./LinkEndpointSummary"; +export * from "./LinkEndpointType"; +export * from "./LinkRevUserToRevOrgResponse"; +export * from "./LinkSearchSummary"; +export * from "./LinkSummary"; +export * from "./LinkType"; +export * from "./LinksCreateResponse"; +export * from "./LinksDeleteResponse"; +export * from "./LinksDirection"; +export * from "./LinksGetResponse"; +export * from "./LinksListResponse"; +export * from "./ListMode"; +export * from "./MeetingSummary"; +export * from "./MemberSummary"; +export * from "./MemberType"; +export * from "./MetricDataPoint"; +export * from "./MetricDataPointDimension"; +export * from "./MetricDefinition"; +export * from "./MetricDefinitionAppliesTo"; +export * from "./MetricDefinitionMetricType"; +export * from "./MetricDefinitionStatus"; +export * from "./MetricDefinitionSummary"; +export * from "./MetricDefinitionsListResponse"; +export * from "./MetricsData"; +export * from "./ObjectMemberSearchSummary"; +export * from "./ObjectMemberSummary"; +export * from "./Opportunity"; +export * from "./OpportunityForecastCategory"; +export * from "./OpportunityPriority"; +export * from "./OpportunitySummary"; +export * from "./OrgBase"; +export * from "./OrgBaseSummary"; +export * from "./OrgEnvironment"; +export * from "./OrgSchedule"; +export * from "./OrgScheduleFragment"; +export * from "./OrgScheduleFragmentOverview"; +export * from "./OrgScheduleFragmentStatus"; +export * from "./OrgScheduleFragmentsCreateResponse"; +export * from "./OrgScheduleFragmentsGetResponse"; +export * from "./OrgScheduleFragmentsTransitionResponse"; +export * from "./OrgScheduleInterval"; +export * from "./OrgScheduleStatus"; +export * from "./OrgScheduleSummary"; +export * from "./OrgSchedulesCreateResponse"; +export * from "./OrgSchedulesGetResponse"; +export * from "./OrgSchedulesListResponse"; +export * from "./OrgSchedulesSetFutureResponse"; +export * from "./OrgSchedulesTransitionResponse"; +export * from "./OrgSchedulesUpdateResponse"; +export * from "./OrgSearchSummary"; +export * from "./OrgSummary"; +export * from "./OrgType"; +export * from "./ParentPartFilter"; +export * from "./Part"; +export * from "./PartBase"; +export * from "./PartBaseSummary"; +export * from "./PartSearchSummary"; +export * from "./PartSummary"; +export * from "./PartType"; +export * from "./PartsCreateRequest"; +export * from "./PartsCreateRequestCapability"; +export * from "./PartsCreateRequestEnhancement"; +export * from "./PartsCreateRequestFeature"; +export * from "./PartsCreateRequestProduct"; +export * from "./PartsCreateResponse"; +export * from "./PartsDeleteResponse"; +export * from "./PartsGetResponse"; +export * from "./PartsListResponse"; +export * from "./PartsUpdateRequest"; +export * from "./PartsUpdateRequestArtifacts"; +export * from "./PartsUpdateRequestCapability"; +export * from "./PartsUpdateRequestEnhancement"; +export * from "./PartsUpdateRequestFeature"; +export * from "./PartsUpdateRequestOwnedBy"; +export * from "./PartsUpdateRequestProduct"; +export * from "./PartsUpdateResponse"; +export * from "./Product"; +export * from "./ProductSummary"; +export * from "./QuestionAnswer"; +export * from "./QuestionAnswerSearchSummary"; +export * from "./QuestionAnswerStatus"; +export * from "./QuestionAnswerSummary"; +export * from "./QuestionAnswersCreateResponse"; +export * from "./QuestionAnswersGetResponse"; +export * from "./QuestionAnswersListResponse"; +export * from "./QuestionAnswersUpdateRequestAppliesToArticles"; +export * from "./QuestionAnswersUpdateRequestAppliesToParts"; +export * from "./QuestionAnswersUpdateRequestOwnedBy"; +export * from "./QuestionAnswersUpdateRequestSharedWith"; +export * from "./QuestionAnswersUpdateRequestSources"; +export * from "./QuestionAnswersUpdateRequestTags"; +export * from "./QuestionAnswersUpdateResponse"; +export * from "./Resource"; +export * from "./ResourceSummary"; +export * from "./RevOrg"; +export * from "./RevOrgSummary"; +export * from "./RevOrgsCreateResponse"; +export * from "./RevOrgsGetResponse"; +export * from "./RevOrgsListResponse"; +export * from "./RevOrgsUpdateRequestArtifacts"; +export * from "./RevOrgsUpdateResponse"; +export * from "./RevUser"; +export * from "./RevUserSummary"; +export * from "./UserBaseSummary"; +export * from "./RevUsersCreateResponse"; +export * from "./RevUsersDeleteResponse"; +export * from "./RevUsersGetResponse"; +export * from "./RevUsersListResponse"; +export * from "./RevUsersUpdateRequestArtifacts"; +export * from "./RevUsersUpdateRequestCustomSchemaFragments"; +export * from "./RevUsersUpdateResponse"; +export * from "./SchemaBoolFieldDescriptor"; +export * from "./SchemaFieldDescriptorBase"; +export * from "./SchemaBoolListFieldDescriptor"; +export * from "./SchemaCompositeFieldDescriptor"; +export * from "./SchemaCompositeListFieldDescriptor"; +export * from "./SchemaDateFieldDescriptor"; +export * from "./SchemaDateListFieldDescriptor"; +export * from "./SchemaDoubleFieldDescriptor"; +export * from "./SchemaDoubleListFieldDescriptor"; +export * from "./SchemaEnumFieldDescriptor"; +export * from "./SchemaEnumListFieldDescriptor"; +export * from "./SchemaFieldCreateViewUiMetadata"; +export * from "./SchemaFieldDescriptor"; +export * from "./SchemaFieldDescriptorArrayType"; +export * from "./SchemaFieldDescriptorArrayTypeBaseType"; +export * from "./SchemaFieldDescriptorFieldType"; +export * from "./SchemaFieldDetailViewUiMetadata"; +export * from "./SchemaFieldFilterViewUiMetadata"; +export * from "./SchemaFieldListViewUiMetadata"; +export * from "./SchemaFieldMfzMetadata"; +export * from "./SchemaFieldOasisMetadata"; +export * from "./SchemaFieldSummaryViewUiMetadata"; +export * from "./SchemaFieldUenumValue"; +export * from "./SchemaFieldUiMetadata"; +export * from "./SchemaIdFieldDescriptor"; +export * from "./SchemaIdListFieldDescriptor"; +export * from "./SchemaIntFieldDescriptor"; +export * from "./SchemaIntListFieldDescriptor"; +export * from "./SchemaRichTextFieldDescriptor"; +export * from "./SchemaRichTextListFieldDescriptor"; +export * from "./SchemaStructFieldDescriptor"; +export * from "./SchemaStructListFieldDescriptor"; +export * from "./SchemaTextFieldDescriptor"; +export * from "./SchemaTextListFieldDescriptor"; +export * from "./SchemaTimestampFieldDescriptor"; +export * from "./SchemaTimestampListFieldDescriptor"; +export * from "./SchemaTokensFieldDescriptor"; +export * from "./SchemaTokensListFieldDescriptor"; +export * from "./SchemaUenumFieldDescriptor"; +export * from "./SchemaUenumListFieldDescriptor"; +export * from "./SchemaUnknownFieldDescriptor"; +export * from "./SearchCoreResponse"; +export * from "./SearchHybridNamespace"; +export * from "./SearchHybridResponse"; +export * from "./SearchNamespace"; +export * from "./SearchResult"; +export * from "./SearchResultType"; +export * from "./SearchSortByParam"; +export * from "./SearchSortOrderParam"; +export * from "./ServiceAccount"; +export * from "./ServiceAccountSummary"; +export * from "./ServiceAccountsGetResponse"; +export * from "./SetIssueSelector"; +export * from "./SetOrgScheduleFragmentSummary"; +export * from "./SetSharedWithMembership"; +export * from "./SetSlaPolicy"; +export * from "./SetSlaSelector"; +export * from "./SetSupportMetricTarget"; +export * from "./SetTagWithValue"; +export * from "./SetWeeklyOrgSchedule"; +export * from "./SharedWithMembershipFilter"; +export * from "./Sla"; +export * from "./SlaAppliesTo"; +export * from "./SlaAssignResult"; +export * from "./SlaCompensation"; +export * from "./SlaEvaluationPeriod"; +export * from "./SlaPolicy"; +export * from "./SlaSelectorAppliesTo"; +export * from "./SlaSelectorPriority"; +export * from "./SlaSelectorSeverity"; +export * from "./SlaStatus"; +export * from "./SlaSummary"; +export * from "./SlaSummaryFilter"; +export * from "./SlaSummaryStage"; +export * from "./SlaTracker"; +export * from "./SlaTrackerSummary"; +export * from "./SlaType"; +export * from "./SlasAssignResponse"; +export * from "./SlasCreateResponse"; +export * from "./SlasFilterAppliesToOperatorType"; +export * from "./SlasGetResponse"; +export * from "./SlasListResponse"; +export * from "./SlasTransitionResponse"; +export * from "./SlasUpdateResponse"; +export * from "./SnapInVersionSummary"; +export * from "./SnapInsResourcesResponse"; +export * from "./SnapInsResourcesResponseKeyringData"; +export * from "./SnapWidget"; +export * from "./SnapWidgetNamespace"; +export * from "./SnapWidgetStatus"; +export * from "./SnapWidgetType"; +export * from "./SnapWidgetsCreateRequest"; +export * from "./SnapWidgetsCreateRequestType"; +export * from "./SnapWidgetsCreateResponse"; +export * from "./StageDiagramSummary"; +export * from "./StageFilter"; +export * from "./StageInit"; +export * from "./StageUpdate"; +export * from "./StageValidationOptionForCreate"; +export * from "./StageValidationOptionForUpdate"; +export * from "./StagedInfoFilter"; +export * from "./StockFieldOverride"; +export * from "./StockSchemaFragment"; +export * from "./StockSchemaFragmentsGetResponse"; +export * from "./StockSchemaFragmentsListRequestFilterPreset"; +export * from "./StockSchemaFragmentsListRequestPrune"; +export * from "./StockSchemaFragmentsListResponse"; +export * from "./Subtype"; +export * from "./SubtypesListResponse"; +export * from "./Survey"; +export * from "./SurveyAggregationFilter"; +export * from "./SurveyFieldWithMetadata"; +export * from "./SurveyResponse"; +export * from "./SurveysCreateResponse"; +export * from "./SurveysDeleteResponse"; +export * from "./SurveysListResponse"; +export * from "./SurveysResponsesListResponse"; +export * from "./SurveysSendRequestEmail"; +export * from "./SurveysSendResponse"; +export * from "./SurveysSubmitResponse"; +export * from "./SyncMetadataFilter"; +export * from "./SyncMetadataFilterSyncInFilter"; +export * from "./SyncMetadataFilterSyncInFilterStatus"; +export * from "./SyncMetadataFilterSyncOutFilter"; +export * from "./SyncMetadataFilterSyncOutFilterStatus"; +export * from "./SysUser"; +export * from "./SysUserSummary"; +export * from "./SysUsersListResponse"; +export * from "./SysUsersUpdateResponse"; +export * from "./Tag"; +export * from "./TagSearchSummary"; +export * from "./TagSummary"; +export * from "./TagWithValue"; +export * from "./TagWithValueFilter"; +export * from "./Task"; +export * from "./TaskPriority"; +export * from "./TaskSummary"; +export * from "./TenantFragment"; +export * from "./TenantFragmentSummary"; +export * from "./Ticket"; +export * from "./TicketChannels"; +export * from "./TicketSeverity"; +export * from "./TicketSummary"; +export * from "./TimelineComment"; +export * from "./TimelineEntryBase"; +export * from "./TimelineCommentBodyType"; +export * from "./TimelineCommentSummary"; +export * from "./TimelineEntriesCollection"; +export * from "./TimelineEntriesCreateRequest"; +export * from "./TimelineEntriesCreateRequestTimelineComment"; +export * from "./TimelineEntriesCreateRequestType"; +export * from "./TimelineEntriesCreateResponse"; +export * from "./TimelineEntriesListResponse"; +export * from "./TimelineEntriesUpdateRequest"; +export * from "./TimelineEntriesUpdateRequestTimelineComment"; +export * from "./TimelineEntriesUpdateRequestTimelineCommentArtifacts"; +export * from "./TimelineEntriesUpdateRequestTimelineCommentLinkPreviews"; +export * from "./TimelineEntriesUpdateRequestType"; +export * from "./TimelineEntriesUpdateResponse"; +export * from "./TimelineEntry"; +export * from "./TimelineEntryBaseSummary"; +export * from "./TimelineEntryObjectType"; +export * from "./TimelineEntryType"; +export * from "./TimelineEntryVisibility"; +export * from "./TimelineReaction"; +export * from "./TimelineSnapKitBody"; +export * from "./TimelineThread"; +export * from "./TrackEvent"; +export * from "./TrackEventsPublishResponse"; +export * from "./Unit"; +export * from "./UnitType"; +export * from "./UnlinkRevUserFromRevOrgResponse"; +export * from "./Uom"; +export * from "./UomMetricScope"; +export * from "./UomsCountResponse"; +export * from "./UomsCreateResponse"; +export * from "./UomsGetResponse"; +export * from "./UomsListResponse"; +export * from "./UomsUpdateRequestDimensions"; +export * from "./UomsUpdateResponse"; +export * from "./UserBase"; +export * from "./UserSearchSummary"; +export * from "./UserSkill"; +export * from "./UserState"; +export * from "./UserSummary"; +export * from "./UserType"; +export * from "./VistaGroupItemState"; +export * from "./VistaGroupItemSummary"; +export * from "./VistaGroupItemType"; +export * from "./VistaSearchSummary"; +export * from "./VistaSummary"; +export * from "./VistaType"; +export * from "./Webhook"; +export * from "./WebhookEventRequest"; +export * from "./WebhookEventResponse"; +export * from "./WebhookEventType"; +export * from "./WebhookEventVerify"; +export * from "./WebhookStatus"; +export * from "./WebhookSummary"; +export * from "./WeeklyOrgSchedule"; +export * from "./Work"; +export * from "./WorkSearchSummary"; +export * from "./WorkSummary"; +export * from "./WorkType"; +export * from "./WorksCreateRequest"; +export * from "./WorksCreateRequestIssue"; +export * from "./WorksCreateRequestOpportunity"; +export * from "./WorksCreateRequestTask"; +export * from "./WorksCreateRequestTicket"; +export * from "./WorksCreateResponse"; +export * from "./WorksDeleteResponse"; +export * from "./WorksExportResponse"; +export * from "./WorksFilterIssue"; +export * from "./WorksFilterOpportunity"; +export * from "./WorksFilterTicket"; +export * from "./WorksGetResponse"; +export * from "./WorksListResponse"; +export * from "./WorksUpdateRequest"; +export * from "./WorksUpdateRequestArtifacts"; +export * from "./WorksUpdateRequestIssue"; +export * from "./WorksUpdateRequestIssueDevelopedWith"; +export * from "./WorksUpdateRequestOpportunity"; +export * from "./WorksUpdateRequestOpportunityContacts"; +export * from "./WorksUpdateRequestOwnedBy"; +export * from "./WorksUpdateRequestReportedBy"; +export * from "./WorksUpdateRequestStagedInfoStagedInfoUpdate"; +export * from "./WorksUpdateRequestTags"; +export * from "./WorksUpdateRequestTask"; +export * from "./WorksUpdateRequestTicket"; +export * from "./WorksUpdateRequestTicketChannels"; +export * from "./WorksUpdateResponse"; diff --git a/tests/custom.test.ts b/tests/custom.test.ts new file mode 100644 index 0000000..7f5e031 --- /dev/null +++ b/tests/custom.test.ts @@ -0,0 +1,13 @@ +/** + * This is a custom test file, if you wish to add more tests + * to your SDK. + * Be sure to mark this file in `.fernignore`. + * + * If you include example requests/responses in your fern definition, + * you will have tests automatically generated for you. + */ +describe("test", () => { + it("default", () => { + expect(true).toBe(true); + }); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..538c94f --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "extendedDiagnostics": true, + "strict": true, + "target": "ES6", + "module": "CommonJS", + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true, + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "baseUrl": "src" + }, + "include": ["src"], + "exclude": [] +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..b461c44 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,2677 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ampproject/remapping@^2.2.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" + integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" + integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== + dependencies: + "@babel/highlight" "^7.24.7" + picocolors "^1.0.0" + +"@babel/compat-data@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.2.tgz#e41928bd33475305c586f6acbbb7e3ade7a6f7f5" + integrity sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ== + +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" + integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/helper-compilation-targets" "^7.25.2" + "@babel/helper-module-transforms" "^7.25.2" + "@babel/helpers" "^7.25.0" + "@babel/parser" "^7.25.0" + "@babel/template" "^7.25.0" + "@babel/traverse" "^7.25.2" + "@babel/types" "^7.25.2" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/generator@^7.25.0", "@babel/generator@^7.7.2": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.0.tgz#f858ddfa984350bc3d3b7f125073c9af6988f18e" + integrity sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw== + dependencies: + "@babel/types" "^7.25.0" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + +"@babel/helper-compilation-targets@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz#e1d9410a90974a3a5a66e84ff55ef62e3c02d06c" + integrity sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw== + dependencies: + "@babel/compat-data" "^7.25.2" + "@babel/helper-validator-option" "^7.24.8" + browserslist "^4.23.1" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-module-imports@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" + integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + +"@babel/helper-module-transforms@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz#ee713c29768100f2776edf04d4eb23b8d27a66e6" + integrity sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ== + dependencies: + "@babel/helper-module-imports" "^7.24.7" + "@babel/helper-simple-access" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + "@babel/traverse" "^7.25.2" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.24.7", "@babel/helper-plugin-utils@^7.8.0": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" + integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== + +"@babel/helper-simple-access@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" + integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + +"@babel/helper-string-parser@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" + integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== + +"@babel/helper-validator-identifier@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" + integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== + +"@babel/helper-validator-option@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" + integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== + +"@babel/helpers@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.0.tgz#e69beb7841cb93a6505531ede34f34e6a073650a" + integrity sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw== + dependencies: + "@babel/template" "^7.25.0" + "@babel/types" "^7.25.0" + +"@babel/highlight@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" + integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.7" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.0.tgz#9fdc9237504d797b6e7b8f66e78ea7f570d256ad" + integrity sha512-CzdIU9jdP0dg7HdyB+bHvDJGagUv+qtzZt5rYCWwW6tITNqV9odjp6Qu41gkG0ca5UfdDUWrKkiAnHHdGRnOrA== + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-import-meta@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz#39a1fa4a7e3d3d7f34e2acc6be585b718d30e02d" + integrity sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ== + dependencies: + "@babel/helper-plugin-utils" "^7.24.7" + +"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-top-level-await@^7.8.3": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-typescript@^7.7.2": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.7.tgz#58d458271b4d3b6bb27ee6ac9525acbb259bad1c" + integrity sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA== + dependencies: + "@babel/helper-plugin-utils" "^7.24.7" + +"@babel/template@^7.25.0", "@babel/template@^7.3.3": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.0.tgz#e733dc3134b4fede528c15bc95e89cb98c52592a" + integrity sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/parser" "^7.25.0" + "@babel/types" "^7.25.0" + +"@babel/traverse@^7.24.7", "@babel/traverse@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.2.tgz#1a0a4aef53177bead359ccd0c89f4426c805b2ae" + integrity sha512-s4/r+a7xTnny2O6FcZzqgT6nE4/GHEdcqj4qAeglbUOh0TeglEfmNJFAd/OLoVtGd6ZhAO8GCVvCNUO5t/VJVQ== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/parser" "^7.25.0" + "@babel/template" "^7.25.0" + "@babel/types" "^7.25.2" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.24.7", "@babel/types@^7.25.0", "@babel/types@^7.25.2", "@babel/types@^7.3.3": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.2.tgz#55fb231f7dc958cd69ea141a4c2997e819646125" + integrity sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q== + dependencies: + "@babel/helper-string-parser" "^7.24.8" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== + dependencies: + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== + dependencies: + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== + dependencies: + expect "^29.7.0" + jest-snapshot "^29.7.0" + +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== + dependencies: + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" + +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^6.0.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + callsites "^3.0.0" + graceful-fs "^4.2.9" + +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== + dependencies: + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== + dependencies: + "@jest/test-result" "^29.7.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + slash "^3.0.0" + +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + +"@sinonjs/commons@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + +"@types/babel__core@^7.1.14": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.8" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" + integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.20.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" + integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== + dependencies: + "@babel/types" "^7.20.7" + +"@types/graceful-fs@^4.1.3": + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== + +"@types/istanbul-lib-report@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/jest@29.5.5": + version "29.5.5" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.5.tgz#727204e06228fe24373df9bae76b90f3e8236a2a" + integrity sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + +"@types/jsdom@^20.0.0": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808" + integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== + dependencies: + "@types/node" "*" + "@types/tough-cookie" "*" + parse5 "^7.0.0" + +"@types/node-fetch@2.6.9": + version "2.6.9" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e" + integrity sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA== + dependencies: + "@types/node" "*" + form-data "^4.0.0" + +"@types/node@*": + version "22.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.0.0.tgz#04862a2a71e62264426083abe1e27e87cac05a30" + integrity sha512-VT7KSYudcPOzP5Q0wfbowyNLaVR8QWUdw+088uFWwfvpY6uCWaXpqV6ieLAu9WBcnTa7H4Z5RLK8I5t2FuOcqw== + dependencies: + undici-types "~6.11.1" + +"@types/node@17.0.33": + version "17.0.33" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.33.tgz#3c1879b276dc63e73030bb91165e62a4509cd506" + integrity sha512-miWq2m2FiQZmaHfdZNcbpp9PuXg34W5JZ5CrJ/BaS70VuhoJENBEQybeiYSaPBRNq6KQGnjfEnc/F3PN++D+XQ== + +"@types/qs@6.9.8": + version "6.9.8" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.8.tgz#f2a7de3c107b89b441e071d5472e6b726b4adf45" + integrity sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg== + +"@types/stack-utils@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== + +"@types/tough-cookie@*": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== + +"@types/url-join@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/url-join/-/url-join-4.0.1.tgz#4989c97f969464647a8586c7252d97b449cdc045" + integrity sha512-wDXw9LEEUHyV+7UWy7U315nrJGJ7p1BzaCxDpEoLr789Dk1WDVMMlf3iBfbG2F8NdWnYyFbtTxUn2ZNbm1Q4LQ== + +"@types/yargs-parser@*": + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== + +"@types/yargs@^17.0.8": + version "17.0.32" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.32.tgz#030774723a2f7faafebf645f4e5a48371dca6229" + integrity sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog== + dependencies: + "@types/yargs-parser" "*" + +abab@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== + +acorn-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== + dependencies: + acorn "^8.1.0" + acorn-walk "^8.0.2" + +acorn-walk@^8.0.2: + version "8.3.3" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e" + integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw== + dependencies: + acorn "^8.11.0" + +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.8.1: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + +anymatch@^3.0.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== + dependencies: + "@jest/transform" "^29.7.0" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.6.3" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + +babel-preset-current-node-syntax@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.8.3" + "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.8.3" + +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== + dependencies: + babel-plugin-jest-hoist "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +browserslist@^4.23.1: + version "4.23.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.2.tgz#244fe803641f1c19c28c48c4b6ec9736eb3d32ed" + integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA== + dependencies: + caniuse-lite "^1.0.30001640" + electron-to-chromium "^1.4.820" + node-releases "^2.0.14" + update-browserslist-db "^1.1.0" + +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caniuse-lite@^1.0.30001640: + version "1.0.30001644" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001644.tgz#bcd4212a7a03bdedba1ea850b8a72bfe4bec2395" + integrity sha512-YGvlOZB4QhZuiis+ETS0VXR+MExbFf4fZYYeMTEE0aTQd/RdIjkTyZjLrbYVKnHzppDvnOhritRVv+i7Go6mHw== + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + +ci-info@^3.2.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + +cjs-module-lexer@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz#c485341ae8fd999ca4ee5af2d7a1c9ae01e0099c" + integrity sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q== + +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== + +collect-v8-coverage@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +cssom@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36" + integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw== + +cssom@~0.3.6: + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== + +cssstyle@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== + dependencies: + cssom "~0.3.6" + +data-urls@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" + integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== + dependencies: + abab "^2.0.6" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" + +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: + version "4.3.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b" + integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== + dependencies: + ms "2.1.2" + +decimal.js@^10.4.2: + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== + +dedent@^1.0.0: + version "1.5.3" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" + integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + +define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + +domexception@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" + integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== + dependencies: + webidl-conversions "^7.0.0" + +electron-to-chromium@^1.4.820: + version "1.5.3" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.3.tgz#032bbb8661c0449656fd896e805c8f7150229a0f" + integrity sha512-QNdYSS5i8D9axWp/6XIezRObRHqaav/ur9z1VzCDUCH1XIFOr9WQk5xmgunhsTpjjgDy3oLxO/WMOVZlpUQrlA== + +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +escalade@^3.1.1, escalade@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" + integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== + dependencies: + esprima "^4.0.1" + estraverse "^5.2.0" + esutils "^2.0.2" + optionalDependencies: + source-map "~0.6.1" + +esprima@^4.0.0, esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== + +expect@^29.0.0, expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== + dependencies: + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +formdata-node@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-6.0.3.tgz#48f8e2206ae2befded82af621ef015f08168dc6d" + integrity sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@^2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob@^7.1.3, glob@^7.1.4: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + +graceful-fs@^4.2.9: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +hasown@^2.0.0, hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + +html-encoding-sniffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" + integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== + dependencies: + whatwg-encoding "^2.0.0" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +iconv-lite@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +import-local@^3.0.2: + version "3.2.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" + integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-core-module@^2.13.0: + version "2.15.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.0.tgz#71c72ec5442ace7e76b306e9d48db361f22699ea" + integrity sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA== + dependencies: + hasown "^2.0.2" + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== + +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +istanbul-lib-instrument@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz#fa15401df6c15874bcb2105f773325d78c666765" + integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== + dependencies: + "@babel/core" "^7.23.9" + "@babel/parser" "^7.23.9" + "@istanbuljs/schema" "^0.1.3" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + +istanbul-lib-report@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^4.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.1.3: + version "3.1.7" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== + dependencies: + execa "^5.0.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^1.0.0" + is-generator-fn "^2.0.0" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + pretty-format "^29.7.0" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== + dependencies: + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + create-jest "^29.7.0" + exit "^0.1.2" + import-local "^3.0.2" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + yargs "^17.3.1" + +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-json-comments "^3.1.1" + +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== + dependencies: + detect-newline "^3.0.0" + +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + +jest-environment-jsdom@29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz#d206fa3551933c3fd519e5dfdb58a0f5139a837f" + integrity sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/jsdom" "^20.0.0" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + jsdom "^20.0.0" + +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== + dependencies: + "@jest/types" "^29.6.3" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== + dependencies: + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + dependencies: + chalk "^4.0.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.3" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-util "^29.7.0" + +jest-pnp-resolver@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== + +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== + +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== + dependencies: + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" + +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-pnp-resolver "^1.2.2" + jest-util "^29.7.0" + jest-validate "^29.7.0" + resolve "^1.20.0" + resolve.exports "^2.0.0" + slash "^3.0.0" + +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== + dependencies: + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + strip-bom "^4.0.0" + +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.7.0" + graceful-fs "^4.2.9" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + natural-compare "^1.4.0" + pretty-format "^29.7.0" + semver "^7.5.3" + +jest-util@^29.0.0, jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== + dependencies: + "@jest/types" "^29.6.3" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.6.3" + leven "^3.1.0" + pretty-format "^29.7.0" + +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== + dependencies: + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.7.0" + string-length "^4.0.1" + +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== + dependencies: + "@types/node" "*" + jest-util "^29.7.0" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== + dependencies: + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" + import-local "^3.0.2" + jest-cli "^29.7.0" + +js-base64@3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.2.tgz#816d11d81a8aff241603d19ce5761e13e41d7745" + integrity sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsdom@^20.0.0: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-20.0.3.tgz#886a41ba1d4726f67a8858028c99489fed6ad4db" + integrity sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ== + dependencies: + abab "^2.0.6" + acorn "^8.8.1" + acorn-globals "^7.0.0" + cssom "^0.5.0" + cssstyle "^2.3.0" + data-urls "^3.0.2" + decimal.js "^10.4.2" + domexception "^4.0.0" + escodegen "^2.0.0" + form-data "^4.0.0" + html-encoding-sniffer "^3.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.1" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^4.1.2" + w3c-xmlserializer "^4.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^2.0.0" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" + ws "^8.11.0" + xml-name-validator "^4.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json5@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lodash.memoize@4.x: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + +make-error@1.x: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== + dependencies: + tmpl "1.0.5" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +micromatch@^4.0.4: + version "4.0.7" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5" + integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +node-fetch@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + +node-releases@^2.0.14: + version "2.0.18" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +nwsapi@^2.2.2: + version "2.2.12" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.12.tgz#fb6af5c0ec35b27b4581eb3bbad34ec9e5c696f8" + integrity sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w== + +object-inspect@^1.13.1: + version "1.13.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" + integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +parse5@^7.0.0, parse5@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +picocolors@^1.0.0, picocolors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" + integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== + +picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pirates@^4.0.4: + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +prettier@2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== + +pretty-format@^29.0.0, pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + +prompts@^2.0.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + +psl@^1.1.33: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + +punycode@^2.1.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + +pure-rand@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" + integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== + +qs@6.11.2: + version "6.11.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" + integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== + dependencies: + side-channel "^1.0.4" + +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + +react-is@^18.0.0: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve.exports@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== + +resolve@^1.20.0: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== + dependencies: + xmlchars "^2.2.0" + +semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.5.3, semver@^7.5.4: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" + +signal-exit@^3.0.3, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tough-cookie@^4.1.2: + version "4.1.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + +tr46@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" + integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== + dependencies: + punycode "^2.1.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +ts-jest@29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b" + integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA== + dependencies: + bs-logger "0.x" + fast-json-stable-stringify "2.x" + jest-util "^29.0.0" + json5 "^2.2.3" + lodash.memoize "4.x" + make-error "1.x" + semver "^7.5.3" + yargs-parser "^21.0.1" + +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +typescript@4.6.4: + version "4.6.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" + integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== + +undici-types@~6.11.1: + version "6.11.1" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.11.1.tgz#432ea6e8efd54a48569705a699e62d8f4981b197" + integrity sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ== + +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + +update-browserslist-db@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + +url-join@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" + integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== + +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + +v8-to-istanbul@^9.0.1: + version "9.3.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" + integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + +w3c-xmlserializer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" + integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== + dependencies: + xml-name-validator "^4.0.0" + +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== + +whatwg-encoding@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" + integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== + dependencies: + iconv-lite "0.6.3" + +whatwg-mimetype@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" + integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== + +whatwg-url@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" + integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== + dependencies: + tr46 "^3.0.0" + webidl-conversions "^7.0.0" + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + +ws@^8.11.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + +xml-name-validator@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" + integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== + +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yargs-parser@^21.0.1, yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.3.1: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==