diff --git a/.devcontainer/.env b/.devcontainer/.env
deleted file mode 100644
index d1016e040..000000000
--- a/.devcontainer/.env
+++ /dev/null
@@ -1,11 +0,0 @@
-POSTGRES_USER=postgres
-POSTGRES_PASSWORD=abc123
-POSTGRES_DB=postgres
-POSTGRES_HOST=postgres
-POSTGRES_PORT=5432
-
-ZENSTACK_TEST_DB_USER=postgres
-ZENSTACK_TEST_DB_PASS=abc123
-ZENSTACK_TEST_DB_NAME=postgres
-ZENSTACK_TEST_DB_HOST=postgres
-ZENSTACK_TEST_DB_PORT=5432
\ No newline at end of file
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
deleted file mode 100644
index f8dff6f9c..000000000
--- a/.devcontainer/docker-compose.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: zenstack
-
-volumes:
- postgres-data:
-
-networks:
- workspace:
- external: false
-
-services:
- workspace:
- container_name: zenstack-workspace
- image: mcr.microsoft.com/devcontainers/javascript-node:20
- restart: always
- volumes:
- - ..:/workspace:cached
- env_file: ./.env
- command: sleep infinity
- networks:
- - workspace
-
- postgres:
- container_name: zenstack-postgres
- image: postgres
- restart: always
- volumes:
- - postgres-data:/var/lib/postgresql/
- env_file: ./.env
- networks:
- - workspace
- ports:
- - 5432:5432
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
- interval: 5s
- timeout: 5s
- retries: 5
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 884a2323e..000000000
--- a/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-**/dist/**
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index 707715244..000000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "root": true,
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "ecmaVersion": 6,
- "sourceType": "module"
- },
- "plugins": ["@typescript-eslint"],
- "extends": [
- "eslint:recommended",
- "plugin:@typescript-eslint/eslint-recommended",
- "plugin:@typescript-eslint/recommended",
- "plugin:jest/recommended"
- ],
- "rules": {
- "@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
- "jest/expect-expect": "off"
- }
-}
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 2766c310e..000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,3 +0,0 @@
-* text=auto eol=lf
-
-*.bat text=auto eol=crlf
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 9812232d7..3ba8779da 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -14,9 +14,10 @@ If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
-- ZenStack version: [e.g., 2.0.0]
-- Prisma version: [e.g., 5.7.0]
+- ZenStack version: [e.g., 3.1.0]
- Database type: [e.g. Postgresql]
+- Node.js/Bun version: [e.g., 20.0.0]
+- Package manager: [e.g., npm, yarn, pnpm]
**Additional context**
Add any other context about the problem here.
diff --git a/.github/release/.release-manifest.json b/.github/release/.release-manifest.json
deleted file mode 100644
index 1857a084d..000000000
--- a/.github/release/.release-manifest.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- ".": "2.0.0-alpha.1",
- "packages/ide/jetbrains": "2.0.0-alpha.2",
- "packages/language": "2.0.0-alpha.2",
- "packages/misc/redwood": "2.0.0-alpha.2",
- "packages/plugins/openapi": "2.0.0-alpha.2",
- "packages/plugins/swr": "2.0.0-alpha.2",
- "packages/plugins/tanstack-query": "2.0.0-alpha.2",
- "packages/plugins/trpc": "2.0.0-alpha.2",
- "packages/runtime": "2.0.0-alpha.2",
- "packages/sdk": "2.0.0-alpha.2",
- "packages/server": "2.0.0-alpha.2",
- "packages/testtools": "2.0.0-alpha.2"
-}
\ No newline at end of file
diff --git a/.github/release/release-main-config.json b/.github/release/release-main-config.json
deleted file mode 100644
index 57e614a77..000000000
--- a/.github/release/release-main-config.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
- "packages": {
- ".": {
- "package-name": "zenstack-monorepo",
- "component": "Monorepo",
- "exclude-paths": ["tests", ".github"]
- },
- "packages/ide/jetbrains": {
- "package-name": "jetbrains",
- "component": "JetBrains_IDE"
- },
- "packages/language": {
- "package-name": "@zenstackhq/language",
- "component": "Language"
- },
- "packages/misc/redwood": {
- "package-name": "@zenstackhq/redwood",
- "component": "Redwood"
- },
- "packages/plugins/openapi": {
- "package-name": "@zenstackhq/openapi",
- "component": "OpenAPI_Plugin"
- },
- "packages/plugins/swr": {
- "package-name": "@zenstackhq/swr",
- "component": "SWR_Plugin"
- },
- "packages/plugins/tanstack-query": {
- "package-name": "@zenstackhq/tanstack-query",
- "component": "Tanstack_Query_Plugin"
- },
- "packages/plugins/trpc": {
- "package-name": "@zenstackhq/trpc",
- "component": "tRPC_Plugin"
- },
- "packages/runtime": {
- "package-name": "@zenstackhq/runtime",
- "component": "Runtime"
- },
- "packages/sdk": {
- "package-name": "@zenstackhq/sdk",
- "component": "SDK"
- },
- "packages/server": {
- "package-name": "@zenstackhq/server",
- "component": "Server"
- },
- "packages/testtools": {
- "package-name": "@zenstackhq/testtools",
- "component": "Test_Tools"
- }
- },
- "include-component-in-tag": false,
- "pull-request-footer": "This PR was generated by [Release-Please](https://github.com/googleapis/release-please).",
- "prerelease": true,
- "bump-minor-pre-major": true,
- "bump-patch-for-minor-pre-major": true,
- "sequential-calls": true,
- "separate-pull-requests": false,
- "versioning": "prerelease",
- "release-type": "node",
- "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
-}
diff --git a/.github/workflows/config/codeql-config.yml b/.github/workflows/config/codeql-config.yml
index 17504a392..c72655d1e 100644
--- a/.github/workflows/config/codeql-config.yml
+++ b/.github/workflows/config/codeql-config.yml
@@ -5,4 +5,3 @@ paths-ignore:
- '**/*.test.ts'
- '**/*.test.tsx'
- '**/__tests__/**'
- - 'packages/ide/**'
diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml
deleted file mode 100644
index 8683f346b..000000000
--- a/.github/workflows/integration-test.yml
+++ /dev/null
@@ -1,96 +0,0 @@
-# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
-
-name: Integration Tests
-
-env:
- TELEMETRY_TRACKING_TOKEN: ${{ secrets.TELEMETRY_TRACKING_TOKEN }}
- DO_NOT_TRACK: '1'
-
-on:
- pull_request:
- branches:
- - main
- - dev
- - release/*
-
-permissions:
- contents: read
-
-jobs:
- build-test:
- runs-on: buildjet-8vcpu-ubuntu-2204
-
- services:
- postgres:
- image: postgres
- env:
- POSTGRES_PASSWORD: abc123
- # Set health checks to wait until postgres has started
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- ports:
- - 5432:5432
-
- strategy:
- matrix:
- node-version: [20.x]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Install pnpm
- uses: pnpm/action-setup@v2
- with:
- version: 9.15.9
-
- - name: Use Node.js ${{ matrix.node-version }}
- uses: buildjet/setup-node@v3
- with:
- node-version: ${{ matrix.node-version }}
- cache: 'pnpm'
-
- - name: Get pnpm store directory
- id: pnpm-cache
- shell: bash
- run: |
- echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
-
- - name: Setup pnpm cache
- uses: buildjet/cache@v3
- with:
- path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- restore-keys: |
- ${{ runner.os }}-pnpm-store-
-
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
-
- - name: Gradle Wrapper Validation
- uses: gradle/wrapper-validation-action@v1.1.0
-
- - name: Setup Java
- uses: actions/setup-java@v4
- with:
- distribution: zulu
- java-version: 17
-
- - name: Setup Gradle
- uses: gradle/gradle-build-action@v2.4.2
- with:
- gradle-home-cache-cleanup: true
-
- - name: Build
- run: DEFAULT_NPM_TAG=latest pnpm run build
-
- # install again for internal dependencies
- - name: Install internal dependencies
- run: pnpm install --frozen-lockfile
-
- - name: Integration Test
- run: pnpm run test-scaffold && pnpm run test-integration
diff --git a/.github/workflows/regression-test.yml b/.github/workflows/regression-test.yml
deleted file mode 100644
index 636639c6e..000000000
--- a/.github/workflows/regression-test.yml
+++ /dev/null
@@ -1,96 +0,0 @@
-# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
-
-name: Regression Tests
-
-env:
- TELEMETRY_TRACKING_TOKEN: ${{ secrets.TELEMETRY_TRACKING_TOKEN }}
- DO_NOT_TRACK: '1'
-
-on:
- pull_request:
- branches:
- - main
- - dev
- - release/*
-
-permissions:
- contents: read
-
-jobs:
- build-test:
- runs-on: buildjet-8vcpu-ubuntu-2204
-
- services:
- postgres:
- image: postgres
- env:
- POSTGRES_PASSWORD: abc123
- # Set health checks to wait until postgres has started
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- ports:
- - 5432:5432
-
- strategy:
- matrix:
- node-version: [20.x]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Install pnpm
- uses: pnpm/action-setup@v2
- with:
- version: 9.15.9
-
- - name: Use Node.js ${{ matrix.node-version }}
- uses: buildjet/setup-node@v3
- with:
- node-version: ${{ matrix.node-version }}
- cache: 'pnpm'
-
- - name: Get pnpm store directory
- id: pnpm-cache
- shell: bash
- run: |
- echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
-
- - name: Setup pnpm cache
- uses: buildjet/cache@v3
- with:
- path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- restore-keys: |
- ${{ runner.os }}-pnpm-store-
-
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
-
- - name: Gradle Wrapper Validation
- uses: gradle/wrapper-validation-action@v1.1.0
-
- - name: Setup Java
- uses: actions/setup-java@v4
- with:
- distribution: zulu
- java-version: 17
-
- - name: Setup Gradle
- uses: gradle/gradle-build-action@v2.4.2
- with:
- gradle-home-cache-cleanup: true
-
- - name: Build
- run: DEFAULT_NPM_TAG=latest pnpm run build
-
- # install again for internal dependencies
- - name: Install internal dependencies
- run: pnpm install --frozen-lockfile
-
- - name: Regression Test
- run: pnpm run test-scaffold && pnpm run test-regression
diff --git a/.github/workflows/security-dependency-review.yml b/.github/workflows/security-dependency-review.yml
deleted file mode 100644
index 09018a429..000000000
--- a/.github/workflows/security-dependency-review.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-# Dependency Review Action
-#
-# This Action will scan dependency manifest files that change as part of a Pull Request,
-# surfacing known-vulnerable versions of the packages declared or updated in the PR.
-# Once installed, if the workflow run is marked as required,
-# PRs introducing known-vulnerable packages will be blocked from merging.
-#
-# Source repository: https://github.com/actions/dependency-review-action
-name: Security - Dependency Review
-on:
- merge_group:
- pull_request:
-
-permissions:
- contents: read
-
-jobs:
- dependency-review:
- runs-on: ubuntu-latest
- steps:
- - name: Harden Runner
- uses: step-security/harden-runner@v2.6.1
- with:
- egress-policy: audit
-
- # checks out the repository
- - uses: actions/checkout@v4
- with:
- submodules: 'recursive'
- token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account.
-
- - name: 'Dependency Review'
- uses: actions/dependency-review-action@v2.5.1
diff --git a/.github/workflows/security-ossar.yml b/.github/workflows/security-ossar.yml
deleted file mode 100644
index 244f2b147..000000000
--- a/.github/workflows/security-ossar.yml
+++ /dev/null
@@ -1,74 +0,0 @@
-# This workflow uses actions that are not certified by GitHub.
-# They are provided by a third-party and are governed by
-# separate terms of service, privacy policy, and support
-# documentation.
-
-# This workflow integrates a collection of open source static analysis tools
-# with GitHub code scanning. For documentation, or to provide feedback, visit
-# https://github.com/github/ossar-action
-name: Security - OSSAR
-
-on:
- merge_group:
- push:
- branches:
- - main
- - dev
- - release/*
- - v2
- pull_request:
- branches:
- - main
- - dev
- - release/*
- - v2
- schedule:
- - cron: '41 3 * * 5'
-
-permissions:
- contents: read
-
-jobs:
- OSSAR-Scan:
- runs-on: windows-latest
- permissions:
- contents: read # for actions/checkout to fetch code
- security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
- actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
-
- steps:
- - name: Harden Runner
- uses: step-security/harden-runner@v2.6.1
- with:
- egress-policy: audit
-
- - name: Workflow Telemetry
- uses: catchpoint/workflow-telemetry-action@v1.8.7
- with:
- github_token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account.
- comment_on_pr: false
- theme: dark
- proc_trace_sys_enable: true
-
- # checks out the repository
- - uses: actions/checkout@v4
- with:
- submodules: 'recursive'
- token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account.
-
- - uses: actions/setup-dotnet@v3.2.0
- with:
- dotnet-version: |
- 5.0.x
- 6.0.x
-
- # Run open source static analysis tools
- - name: Run OSSAR
- uses: github/ossar-action@v1
- id: ossar
-
- # Upload results to the Security tab
- - name: Upload OSSAR results
- uses: github/codeql-action/upload-sarif@v2.22.12
- with:
- sarif_file: ${{ steps.ossar.outputs.sarifFile }}
diff --git a/.github/workflows/security-scorecard.yml b/.github/workflows/security-scorecard.yml
deleted file mode 100644
index c80226279..000000000
--- a/.github/workflows/security-scorecard.yml
+++ /dev/null
@@ -1,68 +0,0 @@
-# This workflow uses actions that are not certified by GitHub. They are provided
-# by a third-party and are governed by separate terms of service, privacy
-# policy, and support documentation.
-
-name: Security - Scorecard supply-chain security
-on:
- # For Branch-Protection check. Only the default branch is supported. See
- # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
- branch_protection_rule:
- # To guarantee Maintained check is occasionally updated. See
- # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
- schedule:
- - cron: '21 9 * * 6'
- push:
- branches:
- - main
-
-# Declare default permissions as read only.
-permissions:
- contents: read
-
-jobs:
- analysis:
- name: Scorecard analysis
- runs-on: ubuntu-latest
- permissions:
- # Needed to upload the results to code-scanning dashboard.
- security-events: write
- # Needed to publish results and get a badge (see publish_results below).
- id-token: write
- # Uncomment the permissions below if installing in a private repository.
- # contents: read
- # actions: read
-
- steps:
- - name: Harden Runner
- uses: step-security/harden-runner@v2.6.1
- with:
- egress-policy: audit
-
- # checks out the repository
- - uses: actions/checkout@v4
- with:
- submodules: 'recursive'
- token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account.
-
- - name: 'Run analysis'
- uses: ossf/scorecard-action@v2.3.3
- with:
- results_file: results.sarif
- results_format: sarif
- repo_token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account.
- publish_results: true
-
- # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
- # format to the repository Actions tab.
- - name: 'Upload artifact'
- uses: actions/upload-artifact@v4
- with:
- name: SARIF file
- path: results.sarif
- retention-days: 5
-
- # Upload the results to GitHub's code scanning dashboard.
- - name: 'Upload to code-scanning'
- uses: github/codeql-action/upload-sarif@v2.2.4
- with:
- sarif_file: results.sarif
diff --git a/.npmrc b/.npmrc
deleted file mode 100644
index 308555701..000000000
--- a/.npmrc
+++ /dev/null
@@ -1,3 +0,0 @@
-auto-install-peers=true
-git-checks=false
-node-linker=hoisted
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 14a85cdea..000000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# 0.5.0 (2022-12-15)
-
-### Features
-
-- Serialization between client (hooks) and server now uses [superjson](https://github.com/blitz-js/superjson), [[#139](https://github.com/zenstackhq/zenstack/issues/139)]
-
-### Fixes and improvements
-
-- Fixed goto definition issue in VSCode extension, [[#69](https://github.com/zenstackhq/zenstack/issues/69)]
-
-### Breaking changes
-
-- Next-auth adapter and helper are moved to a separate package `@zenstackhq/next-auth`.
-
-# 0.4.0 (2022-12-01)
-
-### Features
-
-- `zenstack init` command for initializing a project, [#109](https://github.com/zenstackhq/zenstack/issues/109), [doc](https://zenstack.dev/#/quick-start?id=adding-to-an-existing-project).
-
-- Field constraint suport, [#94](https://github.com/zenstackhq/zenstack/issues/94), [doc](https://zenstack.dev/#/zmodel-field-constraint).
-
-- Support for server-side CRUD with access policy check (SSR), [#126](https://github.com/zenstackhq/zenstack/issues/126), [doc](https://zenstack.dev/#/server-side-rendering).
-
-- Options for disabling fetching in hooks (useful when arguments are not ready), [#57](https://github.com/zenstackhq/zenstack/issues/57), [doc](https://zenstack.dev/#/runtime-api?id=requestoptions).
-
-- Telemetry in CLI, [#102](https://github.com/zenstackhq/zenstack/issues/102), [doc](https://zenstack.dev/#/telemetry).
-
-- Iron-session based starter, [#95](https://github.com/zenstackhq/zenstack/issues/95), [link](https://github.com/zenstackhq/nextjs-iron-session-starter).
-
-- Barebone starter (without authentication), [link](https://github.com/zenstackhq/nextjs-barebone-starter).
-
-- [Website](https://zenstack.dev) is live!
-
-### Fixes and improvements
-
-- Merge `@zenstackhq/internal` into `@zenstackhq/runtime` so as to have a single runtime dependency, [#70](https://github.com/zenstackhq/zenstack/issues/70).
-
-- More accurate log for access policy violation, [#71](https://github.com/zenstackhq/zenstack/issues/71).
-
-- `auth()` function's return type is now resolved to `User` model in ZModel, instead of `Any`, [#65](https://github.com/zenstackhq/zenstack/issues/65).
-
-- Improved ZModel type checking, [#67](https://github.com/zenstackhq/zenstack/issues/67), [#46](https://github.com/zenstackhq/zenstack/issues/46), [#99](https://github.com/zenstackhq/zenstack/issues/99).
-
-- Upgraded to Prisma 4.7.
-
-### Breaking changes
-
-- @zenstackhq/runtime doesn't export anything now.
-
- Use @zenstackhq/runtime/types for type definitions shared between client and server, @zenstackhq/runtime/client for client-specific libaries (like React hooks), and @zenstackhq/runtime/server for server-specific libraries.
-
-# 0.3.0 (2022-11-08)
-
-### Features
-
-- `@password` and `@omit` attribute support
-
-- Configurable logging (to stdout and emitting as events)
-
-### Fixes and improvements
-
-- More robust policy checks
-
-- Properly handles complex types like BigInt, Date, Decimal, etc.
-
-- Makes sure Prisma schema is regenerated for related CLI commands
-
-- Lower VSCode engine version requirement for the extension
-
-- Better overall documentation
-
-# 0.2.0 (2022-10-29)
-
-### Features
-
-- `ZModel` data modeling schema (an extension to [Prisma Schema](https://www.prisma.io/docs/concepts/components/prisma-schema))
-
-- `zenstack` cli for generating RESTful services, auth adapters and React hooks from `ZModel`
-
-- Policy engine that transforms policy rules into Prisma query conditions
-
-- Runtime packages
-
-- An initial set of tests
diff --git a/SECURITY.md b/SECURITY.md
index d79cbe67e..2d74e8769 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -4,7 +4,7 @@
| Version | Supported |
| ------- | ------------------ |
-| >=1.0.0 | :white_check_mark: |
+| >=2.0.0 | :white_check_mark: |
## Reporting a Vulnerability
diff --git a/jest.config.ts b/jest.config.ts
deleted file mode 100644
index b08a6426f..000000000
--- a/jest.config.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * For a detailed explanation regarding each configuration property and type check, visit:
- * https://jestjs.io/docs/configuration
- */
-
-import path from 'path';
-
-export default {
- // Automatically clear mock calls, instances, contexts and results before every test
- clearMocks: true,
-
- globalSetup: path.join(__dirname, './script/test-global-setup.ts'),
-
- setupFiles: [path.join(__dirname, './script/set-test-env.ts')],
-
- // Indicates whether the coverage information should be collected while executing the test
- collectCoverage: true,
-
- // The directory where Jest should output its coverage files
- coverageDirectory: path.join(__dirname, '.test/coverage'),
-
- // An array of regexp pattern strings used to skip coverage collection
- coveragePathIgnorePatterns: ['/node_modules/', '/tests/'],
-
- // Indicates which provider should be used to instrument code for coverage
- coverageProvider: 'v8',
-
- // A list of reporter names that Jest uses when writing coverage reports
- coverageReporters: ['json', 'text', 'lcov', 'clover'],
-
- // A map from regular expressions to paths to transformers
- transform: { '^.+\\.tsx?$': 'ts-jest' },
-
- testTimeout: 300000,
-};
diff --git a/packages/LICENSE b/packages/LICENSE
deleted file mode 100644
index 62f71afa1..000000000
--- a/packages/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2022-2025 ZenStack
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/packages/ide/jetbrains/.gitignore b/packages/ide/jetbrains/.gitignore
deleted file mode 100644
index 80b28c077..000000000
--- a/packages/ide/jetbrains/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-.gradle
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### IntelliJ IDEA ###
-.idea/modules.xml
-.idea/jarRepositories.xml
-.idea/compiler.xml
-.idea/libraries/
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-.sign
diff --git a/packages/ide/jetbrains/.idea/.gitignore b/packages/ide/jetbrains/.idea/.gitignore
deleted file mode 100644
index 13566b81b..000000000
--- a/packages/ide/jetbrains/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/packages/ide/jetbrains/.idea/.name b/packages/ide/jetbrains/.idea/.name
deleted file mode 100644
index 8aa065d41..000000000
--- a/packages/ide/jetbrains/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-zenstack
\ No newline at end of file
diff --git a/packages/ide/jetbrains/.idea/gradle.xml b/packages/ide/jetbrains/.idea/gradle.xml
deleted file mode 100644
index 42862bf11..000000000
--- a/packages/ide/jetbrains/.idea/gradle.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/ide/jetbrains/.idea/kotlinc.xml b/packages/ide/jetbrains/.idea/kotlinc.xml
deleted file mode 100644
index ae3f30ae1..000000000
--- a/packages/ide/jetbrains/.idea/kotlinc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/ide/jetbrains/.idea/misc.xml b/packages/ide/jetbrains/.idea/misc.xml
deleted file mode 100644
index 510c2cda9..000000000
--- a/packages/ide/jetbrains/.idea/misc.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/ide/jetbrains/.idea/vcs.xml b/packages/ide/jetbrains/.idea/vcs.xml
deleted file mode 100644
index c2365ab11..000000000
--- a/packages/ide/jetbrains/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/ide/jetbrains/CHANGELOG.md b/packages/ide/jetbrains/CHANGELOG.md
deleted file mode 100644
index 81e2c8542..000000000
--- a/packages/ide/jetbrains/CHANGELOG.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# Changelog
-
-## [Unreleased]
-
-### Fixed
-
-- Update JetBrains platform version compatibility.
-
-## 2.18.0
-
-### Fixed
-
-- Views are not required to have a unique identifying field marked with `@id` or `@unique`.
-
-## 2.17.0
-
-### Fixed
-
-- Support `@db.Json` and `@db.JsonB` attributes on strongly typed JSON fields.
-
-## 2.16.0
-
-### Fixed
-
-- Prefer to use "stdlib.zmodel" from user's node_modules folder.
-
-## 2.13.0
-
-### Added
-
-- Support `@default` for `@json` fields.
-
-### Fixed
-
-## 2.12.1
-
-### Added
-
-- Validating regex patterns in ZModel.
-
-## 2.12.0
-
-### Added
-
-- Field encryption attribute `@encrypted`.
-
-## 2.9.3
-
-### Fixed
-
-- Proper semantic highlighting and formatting for type declarations.
-
-## 2.9.0
-
-### Added
-
-- Support for using `@@validate` attribute inside type declarations.
-
-## 2.8.1
-
-### Fixed
-
-- Wrong validation errors when using strongly typed JSON fields in a multi-file schema setup.
-
-## 2.8.0
-
-### Added
-
-- Type declaration support.
-
-## 2.7.0
-
-### Fixed
-
-- ZModel validation issues importing zmodel files from npm packages.
-
-## 2.6.0
-
-### Fixed
-
-- ZModel validation issues when accessing fields defined in a base model from `future().` or `this.`.
-
-## 2.5.0
-
-### Added
-
-- A new `path` parameter to the `@@validate` attribute for providing an optional path to the field that caused the error.
-
-## 2.4.0
-
-### Added
-
-- The `uuid()` function is updated to support the new UUID version feature from Prisma.
-
-## 2.3.0
-
-### Added
-
-- New `check()` policy rule function.
-
-### Fixed
-
-- Fixed the issue with formatting schemas containing `Unsupported` type.
-
-## 2.2.0
-
-### Added
-
-- Support comparing fields from different models in mutation policy rules ("create", "update", and "delete).
-
-## 2.1.0
-
-### Added
-
-- Support using ZModel type names (e.g., `DateTime`) as model field names.
-- `auth()` is resolved from all reachable schema files.
-
-## 2.0.0
-
-### Added
-
-- ZenStack V2 release!
-
-## 1.11.0
-
-### Added
-
-- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`.
-
-### Fixed
-
-- Fixed several ZModel validation issues related to model inheritance.
-
-## 1.7.0
-
-### Added
-
-- Auto-completion is now supported inside attributes.
diff --git a/packages/ide/jetbrains/build.gradle.kts b/packages/ide/jetbrains/build.gradle.kts
deleted file mode 100644
index d48d18452..000000000
--- a/packages/ide/jetbrains/build.gradle.kts
+++ /dev/null
@@ -1,99 +0,0 @@
-import org.jetbrains.changelog.Changelog
-import org.jetbrains.changelog.date
-
-plugins {
- id("java")
- id("org.jetbrains.kotlin.jvm") version "1.9.21"
- id("org.jetbrains.intellij") version "1.16.1"
- id("org.jetbrains.changelog") version "2.2.0"
-}
-
-group = "dev.zenstack"
-version = "2.22.2"
-
-repositories {
- mavenCentral()
-}
-
-// Configure Gradle IntelliJ Plugin
-// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
-intellij {
- version.set("2023.3.2")
- type.set("IU") // Target IDE Platform
-
- plugins.set(listOf("JavaScript", "org.jetbrains.plugins.textmate"))
-}
-
-tasks {
- // Set the JVM compatibility versions
- withType {
- sourceCompatibility = "17"
- targetCompatibility = "17"
- }
- withType {
- kotlinOptions.jvmTarget = "17"
- }
-
- prepareSandbox {
- doLast {
- copy {
- from("${project.projectDir}/../../schema/bundle/language-server/main.js")
- into("${destinationDir.path}/zenstack/language-server/")
- }
- copy {
- from("${project.projectDir}/../../schema/src/res/stdlib.zmodel")
- into("${destinationDir.path}/zenstack/res/")
- }
- copy {
- from("${project.projectDir}/src/main/textMate/zmodel.tmbundle")
- into("${destinationDir.path}/zenstack/res/zmodel.tmbundle")
- }
- copy {
- from("${project.projectDir}/../../language/syntaxes/zmodel.tmLanguage")
- into("${destinationDir.path}/zenstack/res/zmodel.tmbundle/Syntaxes/")
- }
- }
- }
-
- patchPluginXml {
- sinceBuild.set("233.2")
- untilBuild.set("271.*")
- changeNotes.set(provider {
- changelog.renderItem(
- changelog
- .getUnreleased()
- .withHeader(false)
- .withEmptySections(false),
- Changelog.OutputType.HTML
- )
- })
- }
-
- signPlugin {
- certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
- privateKey.set(System.getenv("PRIVATE_KEY"))
- password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
- }
-
- publishPlugin {
- token.set(System.getenv("PUBLISH_TOKEN"))
- }
-}
-
-changelog {
- header.set(provider { "[${version.get()}] - ${date()}" })
- introduction.set(
- """
- [ZenStack](https://zenstack.dev) is a toolkit that simplifies the development of a web app's backend. This plugin provides code editing experiences for its ZModel schema language.
-
- ## Features
-
- - Syntax highlighting
- - Error highlighting
- - Go to definition
- - Code completion
- - Formatting
- """.trimIndent()
- )
- groups.set(listOf("Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"))
-}
diff --git a/packages/ide/jetbrains/gradle.properties b/packages/ide/jetbrains/gradle.properties
deleted file mode 100644
index e1c1990f8..000000000
--- a/packages/ide/jetbrains/gradle.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
-kotlin.stdlib.default.dependency=false
-# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
-org.gradle.configuration-cache=false
-# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
-org.gradle.caching=true
diff --git a/packages/ide/jetbrains/gradle/wrapper/gradle-wrapper.jar b/packages/ide/jetbrains/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 249e5832f..000000000
Binary files a/packages/ide/jetbrains/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/packages/ide/jetbrains/gradle/wrapper/gradle-wrapper.properties b/packages/ide/jetbrains/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index a59520664..000000000
--- a/packages/ide/jetbrains/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/packages/ide/jetbrains/gradlew b/packages/ide/jetbrains/gradlew
deleted file mode 100755
index 1b6c78733..000000000
--- a/packages/ide/jetbrains/gradlew
+++ /dev/null
@@ -1,234 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright © 2015-2021 the original authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-##############################################################################
-#
-# Gradle start up script for POSIX generated by Gradle.
-#
-# Important for running:
-#
-# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
-# noncompliant, but you have some other compliant shell such as ksh or
-# bash, then to run this script, type that shell name before the whole
-# command line, like:
-#
-# ksh Gradle
-#
-# Busybox and similar reduced shells will NOT work, because this script
-# requires all of these POSIX shell features:
-# * functions;
-# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
-# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
-# * compound commands having a testable exit status, especially «case»;
-# * various built-in commands including «command», «set», and «ulimit».
-#
-# Important for patching:
-#
-# (2) This script targets any POSIX shell, so it avoids extensions provided
-# by Bash, Ksh, etc; in particular arrays are avoided.
-#
-# The "traditional" practice of packing multiple parameters into a
-# space-separated string is a well documented source of bugs and security
-# problems, so this is (mostly) avoided, by progressively accumulating
-# options in "$@", and eventually passing that to Java.
-#
-# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
-# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
-# see the in-line comments for details.
-#
-# There are tweaks for specific operating systems such as AIX, CygWin,
-# Darwin, MinGW, and NonStop.
-#
-# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
-# within the Gradle project.
-#
-# You can find Gradle at https://github.com/gradle/gradle/.
-#
-##############################################################################
-
-# Attempt to set APP_HOME
-
-# Resolve links: $0 may be a link
-app_path=$0
-
-# Need this for daisy-chained symlinks.
-while
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
- [ -h "$app_path" ]
-do
- ls=$( ls -ld "$app_path" )
- link=${ls#*' -> '}
- case $link in #(
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
-done
-
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
-APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD=maximum
-
-warn () {
- echo "$*"
-} >&2
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-} >&2
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "$( uname )" in #(
- CYGWIN* ) cygwin=true ;; #(
- Darwin* ) darwin=true ;; #(
- MSYS* | MINGW* ) msys=true ;; #(
- NONSTOP* ) nonstop=true ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD=$JAVA_HOME/jre/sh/java
- else
- JAVACMD=$JAVA_HOME/bin/java
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
- case $MAX_FD in #(
- max*)
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/packages/ide/jetbrains/gradlew.bat b/packages/ide/jetbrains/gradlew.bat
deleted file mode 100644
index ac1b06f93..000000000
--- a/packages/ide/jetbrains/gradlew.bat
+++ /dev/null
@@ -1,89 +0,0 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/packages/ide/jetbrains/package.json b/packages/ide/jetbrains/package.json
deleted file mode 100644
index dcadde4bc..000000000
--- a/packages/ide/jetbrains/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "jetbrains",
- "version": "2.22.2",
- "displayName": "ZenStack JetBrains IDE Plugin",
- "description": "ZenStack JetBrains IDE plugin",
- "homepage": "https://zenstack.dev",
- "private": true,
- "scripts": {
- "build": "run-script-os",
- "build:win32": "gradlew.bat buildPlugin",
- "build:default": "./gradlew buildPlugin"
- },
- "author": "ZenStack Team",
- "license": "MIT",
- "devDependencies": {
- "@zenstackhq/language": "workspace:*",
- "run-script-os": "^1.1.6",
- "zenstack": "workspace:*"
- }
-}
diff --git a/packages/ide/jetbrains/settings.gradle.kts b/packages/ide/jetbrains/settings.gradle.kts
deleted file mode 100644
index e0ac2ff8b..000000000
--- a/packages/ide/jetbrains/settings.gradle.kts
+++ /dev/null
@@ -1,8 +0,0 @@
-pluginManagement {
- repositories {
- mavenCentral()
- gradlePluginPortal()
- }
-}
-
-rootProject.name = "zenstack"
\ No newline at end of file
diff --git a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/Utils.kt b/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/Utils.kt
deleted file mode 100644
index b35ae1ec0..000000000
--- a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/Utils.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-package dev.zenstack
-
-import com.intellij.lang.javascript.service.JSLanguageServiceUtil
-import org.jetbrains.plugins.textmate.TextMateService
-import org.jetbrains.plugins.textmate.configuration.TextMateUserBundlesSettings
-
-class Utils {
- companion object {
- fun addTextMateBundle() {
- println("Adding ZenStack textmate bundle")
- val textMateBundle = JSLanguageServiceUtil.getPluginDirectory(javaClass, "res/zmodel.tmbundle")
- TextMateUserBundlesSettings.instance?.addBundle(textMateBundle.path, "zmodel")
- reloadTextMateBundles()
- }
-
- fun disableTextMateBundle() {
- println("Disabling ZenStack textmate bundle")
- val textMateBundle = JSLanguageServiceUtil.getPluginDirectory(javaClass, "res/zmodel.tmbundle")
- TextMateUserBundlesSettings.instance?.disableBundle(textMateBundle.path)
- reloadTextMateBundles()
- }
-
- private fun reloadTextMateBundles() {
- val textMateService = TextMateService.getInstance();
- textMateService.reloadEnabledBundles()
- }
- }
-}
\ No newline at end of file
diff --git a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelFileType.kt b/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelFileType.kt
deleted file mode 100644
index b0c4ada21..000000000
--- a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelFileType.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package dev.zenstack.lang
-
-import com.intellij.openapi.fileTypes.LanguageFileType
-import javax.swing.Icon
-
-object ZModelFileType : LanguageFileType(ZModelLanguage) {
- override fun getName(): String = "ZModel"
-
- override fun getDescription(): String = "ZModel Language"
-
- override fun getDefaultExtension(): String = "zmodel"
-
- override fun getIcon(): Icon = ZModelIcons.ZModel
-}
\ No newline at end of file
diff --git a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelIcons.kt b/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelIcons.kt
deleted file mode 100644
index f168410d6..000000000
--- a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelIcons.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package dev.zenstack.lang
-
-import com.intellij.openapi.util.IconLoader;
-
-object ZModelIcons {
- @JvmField
- val ZModel = IconLoader.getIcon("/icons/zmodel.png", javaClass)
-}
diff --git a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelLanguage.kt b/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelLanguage.kt
deleted file mode 100644
index cfc60749f..000000000
--- a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lang/ZModelLanguage.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package dev.zenstack.lang
-
-import com.intellij.lang.Language
-
-object ZModelLanguage : Language("ZModel") {
- override fun getDisplayName(): String = "ZModel"
-}
diff --git a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lsp/ZenStackLspServerDescriptor.kt b/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lsp/ZenStackLspServerDescriptor.kt
deleted file mode 100644
index 524d9e812..000000000
--- a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lsp/ZenStackLspServerDescriptor.kt
+++ /dev/null
@@ -1,55 +0,0 @@
-package dev.zenstack.lsp
-
-import com.intellij.execution.ExecutionException
-import com.intellij.execution.configurations.GeneralCommandLine
-import com.intellij.javascript.nodejs.interpreter.NodeCommandLineConfigurator
-import com.intellij.javascript.nodejs.interpreter.NodeJsInterpreterManager
-import com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter
-import com.intellij.javascript.nodejs.interpreter.wsl.WslNodeInterpreter
-import com.intellij.lang.javascript.service.JSLanguageServiceUtil
-import com.intellij.openapi.project.Project
-import com.intellij.openapi.vfs.VirtualFile
-import com.intellij.platform.lsp.api.ProjectWideLspServerDescriptor
-import com.intellij.platform.lsp.api.customization.LspFormattingSupport
-import dev.zenstack.lang.ZModelFileType
-import dev.zenstack.Utils
-
-class ZenStackLspServerDescriptor(project: Project) : ProjectWideLspServerDescriptor(project, "ZenStack") {
-
- override fun isSupportedFile(file: VirtualFile) = file.fileType == ZModelFileType
-
- override fun createCommandLine(): GeneralCommandLine {
-
- Utils.Companion.addTextMateBundle()
-
- // start language server
- val interpreter = NodeJsInterpreterManager.getInstance(project).interpreter
- if (interpreter !is NodeJsLocalInterpreter && interpreter !is WslNodeInterpreter) {
- throw ExecutionException("Interpreter not configured")
- }
-
- val lsp = JSLanguageServiceUtil.getPluginDirectory(javaClass, "language-server/main.js")
- if (lsp == null || !lsp.exists()) {
- // broken plugin installation?
- throw ExecutionException("Language server not found")
- }
-
- return GeneralCommandLine().apply {
- withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE)
- withCharset(Charsets.UTF_8)
- addParameter(lsp.path)
- addParameter("--stdio")
-
- NodeCommandLineConfigurator.find(interpreter)
- .configure(this, NodeCommandLineConfigurator.defaultOptions(project))
- }
- }
-
- override val lspGoToDefinitionSupport = true
-
- override val lspHoverSupport = true
-
- override val lspFormattingSupport = object : LspFormattingSupport() {
- override fun shouldFormatThisFileExclusivelyByServer(file: VirtualFile, ideCanFormatThisFileItself: Boolean, serverExplicitlyWantsToFormatThisFile: Boolean) = file.fileType == ZModelFileType
- }
-}
diff --git a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lsp/ZenStackLspServerSupportProvider.kt b/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lsp/ZenStackLspServerSupportProvider.kt
deleted file mode 100644
index 6fb6d79db..000000000
--- a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/lsp/ZenStackLspServerSupportProvider.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-package dev.zenstack.lsp
-
-import com.intellij.javascript.nodejs.interpreter.NodeJsInterpreterManager
-import com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter
-import com.intellij.javascript.nodejs.interpreter.wsl.WslNodeInterpreter
-import com.intellij.openapi.project.Project
-import com.intellij.openapi.vfs.VirtualFile
-import com.intellij.platform.lsp.api.LspServerSupportProvider
-import dev.zenstack.lang.ZModelFileType
-
-class ZenStackLspServerSupportProvider : LspServerSupportProvider {
- override fun fileOpened(project: Project, file: VirtualFile, serverStarter: LspServerSupportProvider.LspServerStarter) {
- if (file.fileType != ZModelFileType) return
-
- val node = NodeJsInterpreterManager.getInstance(project).interpreter
- if (node !is NodeJsLocalInterpreter && node !is WslNodeInterpreter) return
-
- serverStarter.ensureServerStarted(ZenStackLspServerDescriptor(project))
- }
-}
\ No newline at end of file
diff --git a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/plugin/PluginStateListener.kt b/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/plugin/PluginStateListener.kt
deleted file mode 100644
index 984f3f0ba..000000000
--- a/packages/ide/jetbrains/src/main/kotlin/dev/zenstack/plugin/PluginStateListener.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package dev.zenstack.plugin
-
-import com.intellij.ide.plugins.DynamicPluginListener
-import com.intellij.ide.plugins.IdeaPluginDescriptor
-import dev.zenstack.Utils
-import org.jetbrains.plugins.textmate.TextMateService
-
-class PluginStateListener: DynamicPluginListener {
- override fun beforePluginLoaded(pluginDescriptor: IdeaPluginDescriptor) {
- // install TextMate bundle
- Utils.Companion.addTextMateBundle()
- }
-
- override fun beforePluginUnload(pluginDescriptor: IdeaPluginDescriptor, isUpdate: Boolean) {
- // uninstall TextMate bundle
- Utils.disableTextMateBundle()
- }
-}
\ No newline at end of file
diff --git a/packages/ide/jetbrains/src/main/resources/META-INF/plugin.xml b/packages/ide/jetbrains/src/main/resources/META-INF/plugin.xml
deleted file mode 100644
index 9c5ddb5f8..000000000
--- a/packages/ide/jetbrains/src/main/resources/META-INF/plugin.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
- dev.zenstack.zenstack
-
-
- ZenStack Language Tools
-
-
- ZenStack
-
-
- ZenStack is a toolkit that simplifies the development of a web app's backend. This plugin provides code editing experiences for its ZModel schema language.
-
- Features
-
-
- - Syntax highlighting
- - Error highlighting
- - Go to definition
- - Code completion
- - Formatting
-
- ]]>
-
-
- com.intellij.modules.ultimate
- JavaScript
- org.jetbrains.plugins.textmate
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/ide/jetbrains/src/main/resources/META-INF/pluginIcon.svg b/packages/ide/jetbrains/src/main/resources/META-INF/pluginIcon.svg
deleted file mode 100644
index c70b27f19..000000000
--- a/packages/ide/jetbrains/src/main/resources/META-INF/pluginIcon.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
diff --git a/packages/ide/jetbrains/src/main/resources/META-INF/pluginIcon_dark.svg b/packages/ide/jetbrains/src/main/resources/META-INF/pluginIcon_dark.svg
deleted file mode 100644
index 6f52be69d..000000000
--- a/packages/ide/jetbrains/src/main/resources/META-INF/pluginIcon_dark.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
diff --git a/packages/ide/jetbrains/src/main/resources/icons/zmodel.png b/packages/ide/jetbrains/src/main/resources/icons/zmodel.png
deleted file mode 100644
index dab4013a3..000000000
Binary files a/packages/ide/jetbrains/src/main/resources/icons/zmodel.png and /dev/null differ
diff --git a/packages/ide/jetbrains/src/main/resources/icons/zmodel_dark.png b/packages/ide/jetbrains/src/main/resources/icons/zmodel_dark.png
deleted file mode 100644
index 7b4b2b226..000000000
Binary files a/packages/ide/jetbrains/src/main/resources/icons/zmodel_dark.png and /dev/null differ
diff --git a/packages/ide/jetbrains/src/main/textMate/zmodel.tmbundle/info.plist b/packages/ide/jetbrains/src/main/textMate/zmodel.tmbundle/info.plist
deleted file mode 100644
index 9abe98fab..000000000
--- a/packages/ide/jetbrains/src/main/textMate/zmodel.tmbundle/info.plist
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- contactEmailRot13
- contact@zenstack.dev
- contactName
- ZenStack Team
- description
- ZModel Language
- name
- zmodel
- uuid
- 0EA94AB2-A210-4A58-9A25-CFFF59AC430B
-
-
diff --git a/packages/language/.eslintrc.json b/packages/language/.eslintrc.json
deleted file mode 100644
index 442a51516..000000000
--- a/packages/language/.eslintrc.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "ignorePatterns": "src/generated/*",
- "extends": ["../../.eslintrc.json"]
-}
diff --git a/packages/language/CHANGELOG.md b/packages/language/CHANGELOG.md
deleted file mode 100644
index cc2a59fdc..000000000
--- a/packages/language/CHANGELOG.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changelog
-
-## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21)
-
-
-### Miscellaneous Chores
-
-* release 2.0.0-alpha.2 ([f40d7e3](https://github.com/zenstackhq/zenstack/commit/f40d7e3718d4210137a2e131d28b5491d065b914))
diff --git a/packages/language/LICENSE b/packages/language/LICENSE
deleted file mode 120000
index 30cff7403..000000000
--- a/packages/language/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../LICENSE
\ No newline at end of file
diff --git a/packages/language/README.md b/packages/language/README.md
deleted file mode 100644
index 27c17fd12..000000000
--- a/packages/language/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# ZenStack ZModel language compiler
-
-This package provides the AST of ZModel - ZenStack's modeling language.
-
-Visit [Homepage](https://zenstack.dev) for more details.
diff --git a/packages/language/script/generate-plist.ts b/packages/language/script/generate-plist.ts
deleted file mode 100644
index f987f71ed..000000000
--- a/packages/language/script/generate-plist.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-// convert textmate grammar from json to plist with fixes
-
-import { json2plist } from 'plist2';
-import fs from 'fs';
-import path from 'path';
-
-const src = fs.readFileSync(path.resolve(__dirname, '../syntaxes/zmodel.tmLanguage.json'), 'utf-8');
-const json = JSON.parse(src);
-json['fileTypes'] = ['zmodel'];
-
-const plist = json2plist(JSON.stringify(json));
-fs.writeFileSync(path.resolve(__dirname, '../syntaxes/zmodel.tmLanguage'), plist, 'utf-8');
diff --git a/packages/language/syntaxes/zmodel.tmLanguage b/packages/language/syntaxes/zmodel.tmLanguage
deleted file mode 100644
index 40b92fb9a..000000000
--- a/packages/language/syntaxes/zmodel.tmLanguage
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
- name
- zmodel
- scopeName
- source.zmodel
- fileTypes
-
- zmodel
-
- patterns
-
-
- include
- #comments
-
-
- name
- keyword.control.zmodel
- match
- \b(Any|BigInt|Boolean|Bytes|ContextType|DateTime|Decimal|FieldReference|Float|Int|Json|Null|Object|String|TransitiveFieldReference|Unsupported|abstract|attribute|datasource|enum|extends|false|function|generator|import|in|model|null|plugin|this|true|type|view)\b
-
-
- name
- string.quoted.double.zmodel
- begin
- "
- end
- "
- patterns
-
-
- include
- #string-character-escape
-
-
-
-
- name
- string.quoted.single.zmodel
- begin
- '
- end
- '
- patterns
-
-
- include
- #string-character-escape
-
-
-
-
- repository
-
- comments
-
- patterns
-
-
- name
- comment.block.zmodel
- begin
- /\*
- beginCaptures
-
- 0
-
- name
- punctuation.definition.comment.zmodel
-
-
- end
- \*/
- endCaptures
-
- 0
-
- name
- punctuation.definition.comment.zmodel
-
-
-
-
- begin
- //
- beginCaptures
-
- 1
-
- name
- punctuation.whitespace.comment.leading.zmodel
-
-
- end
- (?=$)
- name
- comment.line.zmodel
-
-
-
- string-character-escape
-
- name
- constant.character.escape.zmodel
- match
- \\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]+\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)
-
-
-
-
\ No newline at end of file
diff --git a/packages/language/syntaxes/zmodel.tmLanguage.json b/packages/language/syntaxes/zmodel.tmLanguage.json
deleted file mode 100644
index 0fb0227e5..000000000
--- a/packages/language/syntaxes/zmodel.tmLanguage.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "name": "zmodel",
- "scopeName": "source.zmodel",
- "fileTypes": [
- ".zmodel"
- ],
- "patterns": [
- {
- "include": "#comments"
- },
- {
- "name": "keyword.control.zmodel",
- "match": "\\b(Any|BigInt|Boolean|Bytes|ContextType|DateTime|Decimal|FieldReference|Float|Int|Json|Null|Object|String|TransitiveFieldReference|Unsupported|abstract|attribute|datasource|enum|extends|false|function|generator|import|in|model|null|plugin|this|true|type|view)\\b"
- },
- {
- "name": "string.quoted.double.zmodel",
- "begin": "\"",
- "end": "\"",
- "patterns": [
- {
- "include": "#string-character-escape"
- }
- ]
- },
- {
- "name": "string.quoted.single.zmodel",
- "begin": "'",
- "end": "'",
- "patterns": [
- {
- "include": "#string-character-escape"
- }
- ]
- }
- ],
- "repository": {
- "comments": {
- "patterns": [
- {
- "name": "comment.block.zmodel",
- "begin": "/\\*",
- "beginCaptures": {
- "0": {
- "name": "punctuation.definition.comment.zmodel"
- }
- },
- "end": "\\*/",
- "endCaptures": {
- "0": {
- "name": "punctuation.definition.comment.zmodel"
- }
- }
- },
- {
- "begin": "//",
- "beginCaptures": {
- "1": {
- "name": "punctuation.whitespace.comment.leading.zmodel"
- }
- },
- "end": "(?=$)",
- "name": "comment.line.zmodel"
- }
- ]
- },
- "string-character-escape": {
- "name": "constant.character.escape.zmodel",
- "match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)"
- }
- }
-}
diff --git a/packages/misc/redwood/CHANGELOG.md b/packages/misc/redwood/CHANGELOG.md
deleted file mode 100644
index cc2a59fdc..000000000
--- a/packages/misc/redwood/CHANGELOG.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changelog
-
-## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21)
-
-
-### Miscellaneous Chores
-
-* release 2.0.0-alpha.2 ([f40d7e3](https://github.com/zenstackhq/zenstack/commit/f40d7e3718d4210137a2e131d28b5491d065b914))
diff --git a/packages/misc/redwood/LICENSE b/packages/misc/redwood/LICENSE
deleted file mode 120000
index 5853aaea5..000000000
--- a/packages/misc/redwood/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../../LICENSE
\ No newline at end of file
diff --git a/packages/misc/redwood/README.md b/packages/misc/redwood/README.md
deleted file mode 100644
index 7c4742dc4..000000000
--- a/packages/misc/redwood/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-# ZenStack RedwoodJS Integration
-
-This package provides the CLI and runtime APIs for integrating [ZenStack](https://zenstack.dev) into a [RedwoodJS](https://redwoodjs.com/) project. You can use ZenStack as a drop-in replacement to Prisma and define flexible access control policies declaratively inside the database schema. It's especially useful for building multi-tenant applications which tend to have complex authorization requirements beyond RBAC.
-
-ZenStack is a full-stack toolkit built above Prisma ORM. It extends Prisma at the schema and the runtime level for adding the following capabilities:
-
-- Flexible access control
-- Data validation rules
-- Multi-file schemas
-- Custom attributes and functions in schemas
-
-You can find a more detailed integration guide [here](https://zenstack.dev/docs/guides/redwood).
-
-### Setting up
-
-Run the following package setup command:
-
-```bash
-yarn rw setup package @zenstackhq/redwood
-```
-
-The setup command will:
-
-1. Update "redwood.toml" to allow ZenStack CLI plugin.
-1. Install ZenStack dependencies.
-1. Copy your Prisma schema file "api/db/schema.prisma" to "api/db/schema.zmodel".
-1. Add a "zenstack" section into "api/package.json" to specify the location 1f both the "schema.prisma" and "schema.zmodel" files.
-1. Install a GraphQLYoga plugin in "api/src/functions/graphql.[ts|js]".
-1. Eject service templates and modify the templates to use `context.db` (ZenStack-enhanced `PrismaClient`) instead of `db` for data access.
-
-### Modeling data and access policies
-
-ZenStack's ZModel language is a superset of Prisma schema language. You should use it to define both the data schema and access policies. [The Complete Guide](https://zenstack.dev/docs/the-complete-guide/part1/) of ZenStack is the best way to learn how to author ZModel schemas.
-
-You should run the following command after updating "schema.zmodel":
-
-```bash
-yarn rw @zenstackhq generate
-```
-
-The command does the following things:
-
-1. Regenerate "schema.prisma"
-2. Run `prisma generate` to regenerate PrismaClient
-3. Generates supporting JS modules for enforcing access policies at runtime
-
-
-
-### Development workflow
-
-The workflow of using ZenStack is very similar to using Prisma in RedwoodJS projects. The two main differences are:
-
-1. Generation
-
- You should run `yarn rw @zenstackhq generate` in place of `yarn rw prisma generate`. The ZenStack's generate command internally regenerates the Prisma schema from the ZModel schema, runs `prisma generate` automatically, and also generates other modules for supporting access policy enforcement at the runtime.
-
-2. Database access in services
-
- In your service code, you should use `context.db` instead of `db` for accessing the database. The `context.db` is an enhanced Prisma client that enforces access policies.
-
- The "setup" command prepared a customized service code template. When you run `yarn rw g service`, the generated code will already use `context.db`.
-
-Other Prisma-related workflows like generation migration or pushing schema to the database stay unchanged.
-
-### Deployment
-
-You should run the "generate" command in your deployment script before `yarn rw deploy`. For example, to deploy to Vercel, the command can be:
-
-```bash
-yarn rw @zenstackhq generate && yarn rw deploy vercel
-```
-
-### Using the `@zenstackhq` CLI plugin
-
-The `@zenstackhq/redwood` package registers a set of custom commands to the RedwoodJS CLI under the `@zenstackhq` namespace. You can run it with:
-
-```bash
-yarn rw @zenstackhq [options]
-```
-
-The plugin is a simple wrapper of the standard `zenstack` CLI, similar to how RedwoodJS wraps the standard `prisma` CLI. It's equivalent to running `npx zenstack ...` inside the "api" directory.
-
-See the [CLI references](https://zenstack.dev/docs/reference/cli) for the full list of commands.
-
-### Sample application
-
-You can find a complete multi-tenant Todo application built with RedwoodJS and ZenStack at: [https://github.com/zenstackhq/sample-todo-redwood](https://github.com/zenstackhq/sample-todo-redwood).
-
-### Getting help
-
-The best way to get help and updates about ZenStack is by joining our [Discord server](https://discord.gg/Ykhr738dUe).
diff --git a/packages/misc/redwood/bin/cli b/packages/misc/redwood/bin/cli
deleted file mode 100755
index ef22870e9..000000000
--- a/packages/misc/redwood/bin/cli
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-
-require('../dist/setup-package').default();
diff --git a/packages/misc/redwood/package.json b/packages/misc/redwood/package.json
deleted file mode 100644
index f65f3bf55..000000000
--- a/packages/misc/redwood/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "@zenstackhq/redwood",
- "displayName": "ZenStack RedwoodJS Integration",
- "version": "2.22.2",
- "description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
- "repository": {
- "type": "git",
- "url": "https://github.com/zenstackhq/zenstack"
- },
- "scripts": {
- "clean": "rimraf dist",
- "build": "pnpm lint --max-warnings=0 && pnpm clean && tsc && pnpm pack dist --pack-destination ../../../.build",
- "watch": "tsc --watch",
- "lint": "eslint src --ext ts",
- "prepublishOnly": "pnpm build"
- },
- "main": "./dist/index.js",
- "types": "./dist/index.d.ts",
- "exports": {
- ".": {
- "default": "./dist/index.js",
- "types": "./dist/index.d.ts"
- },
- "./graphql": {
- "default": "./dist/graphql.js",
- "types": "./dist/graphql.d.ts"
- },
- "./package.json": {
- "default": "./package.json"
- }
- },
- "bin": "bin/cli",
- "engines": {
- "redwoodjs": ">=6.0.0"
- },
- "author": {
- "name": "ZenStack Team"
- },
- "homepage": "https://zenstack.dev",
- "license": "MIT",
- "dependencies": {
- "@redwoodjs/cli-helpers": "^7.7.3",
- "@zenstackhq/runtime": "workspace:*",
- "colors": "1.4.0",
- "execa": "^5.0.0",
- "listr2": "^6.0.0",
- "semver": "^7.5.2",
- "terminal-link": "^2.0.0",
- "ts-morph": "catalog:",
- "yargs": "^17.7.2"
- },
- "devDependencies": {
- "@redwoodjs/graphql-server": "^7.7.3",
- "@types/yargs": "^17.0.32",
- "graphql-yoga": "^5.0.2"
- }
-}
diff --git a/packages/misc/redwood/src/cli-passthrough.ts b/packages/misc/redwood/src/cli-passthrough.ts
deleted file mode 100644
index 367b5f06f..000000000
--- a/packages/misc/redwood/src/cli-passthrough.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { getPaths } from '@redwoodjs/cli-helpers';
-import colors from 'colors';
-import execa from 'execa';
-import { CommandModule } from 'yargs';
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-async function runCommand(command: string, options: any) {
- const args = ['zenstack', command];
- for (const [name, value] of Object.entries(options)) {
- args.push(name.length > 1 ? `--${name}` : `-${name}`);
- if (typeof value === 'string') {
- // Make sure options that take multiple quoted words
- // are passed to zenstack with quotes.
- value.split(' ').length > 1 ? args.push(`"${value}"`) : args.push(value);
- }
- }
-
- console.log();
- console.log(colors.green('Running ZenStack CLI...'));
- console.log(colors.underline('$ npx ' + args.join(' ')));
- console.log();
-
- try {
- await execa('npx', args, { cwd: getPaths().api.base, shell: true, stdio: 'inherit', cleanup: true });
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- } catch (e: any) {
- process.exit(e?.exitCode || 1);
- }
-}
-
-/**
- * Creates a yargs command that passes all options to the ZenStack CLI command.
- */
-export function makePassthroughCommand(command: string): CommandModule {
- return {
- command,
- describe: `Run \`zenstack ${command} ...\``,
- builder: (yargs) => {
- return yargs
- .strictOptions(false)
- .strictCommands(false)
- .strict(false)
- .parserConfiguration({ 'camel-case-expansion': false, 'boolean-negation': false });
- },
- handler: async ({ _, $0: _$0, ...options }) => {
- await runCommand(command, options);
- },
- };
-}
diff --git a/packages/misc/redwood/src/commands/setup.ts b/packages/misc/redwood/src/commands/setup.ts
deleted file mode 100644
index ec5979617..000000000
--- a/packages/misc/redwood/src/commands/setup.ts
+++ /dev/null
@@ -1,274 +0,0 @@
-import { getInstalledRedwoodVersion, getPaths, updateTomlConfig } from '@redwoodjs/cli-helpers';
-import colors from 'colors';
-import execa from 'execa';
-import fs from 'fs';
-import { Listr, ListrTask } from 'listr2';
-import path from 'path';
-import semver from 'semver';
-import terminalLink from 'terminal-link';
-import { Project, SyntaxKind, type PropertyAssignment } from 'ts-morph';
-import type { CommandModule } from 'yargs';
-import { addApiPackages } from '../utils';
-
-function updateToml() {
- return {
- title: 'Updating redwood.toml...',
- task: () => {
- updateTomlConfig('@zenstackhq/redwood');
- },
- };
-}
-
-function installDependencies() {
- return addApiPackages([
- { pkg: 'zenstack', dev: true },
- { pkg: '@zenstackhq/runtime' },
- { pkg: '@zenstackhq/redwood' },
- ]);
-}
-
-// copy schema.prisma to schema.zmodel, and update package.json
-function bootstrapSchema() {
- return {
- title: 'Bootstrapping ZModel schema...',
- task: () => {
- const apiPaths = getPaths().api;
- const zmodel = path.join(path.dirname(apiPaths.dbSchema), 'schema.zmodel');
- if (!fs.existsSync(zmodel)) {
- fs.cpSync(apiPaths.dbSchema, zmodel);
- } else {
- console.info(
- colors.blue(`Schema file "${path.relative(getPaths().base, zmodel)}" already exists. Skipping.`)
- );
- }
-
- const pkgJson = path.join(apiPaths.base, 'package.json');
- if (fs.existsSync(pkgJson)) {
- const content = fs.readFileSync(pkgJson, 'utf-8');
- const pkg = JSON.parse(content);
- if (!pkg.zenstack) {
- pkg.zenstack = {
- schema: normalizePath(path.relative(apiPaths.base, zmodel)),
- prisma: normalizePath(path.relative(apiPaths.base, apiPaths.dbSchema)),
- };
- fs.writeFileSync(pkgJson, JSON.stringify(pkg, null, 4));
- }
- }
- },
- };
-}
-
-// ensures posix path separators are used in package.json
-function normalizePath(_path: string) {
- return _path.replaceAll(path.sep, path.posix.sep);
-}
-
-// install ZenStack GraphQLYoga plugin
-function installGraphQLPlugin() {
- return {
- title: 'Installing GraphQL plugin...',
- task: async () => {
- // locate "api/functions/graphql.[js|ts]"
- let graphQlSourcePath: string | undefined;
- const functionsDir = getPaths().api.functions;
- if (fs.existsSync(path.join(functionsDir, 'graphql.ts'))) {
- graphQlSourcePath = path.join(functionsDir, 'graphql.ts');
- } else if (fs.existsSync(path.join(functionsDir, 'graphql.js'))) {
- graphQlSourcePath = path.join(functionsDir, 'graphql.js');
- }
-
- if (!graphQlSourcePath) {
- console.warn(
- colors.yellow(`Unable to find handler source file: ${path.join(functionsDir, 'graphql.(js|ts)')}`)
- );
- return;
- }
-
- // add import
- const project = new Project();
- const graphQlSourceFile = project.addSourceFileAtPathIfExists(graphQlSourcePath)!;
- let graphQlSourceFileChanged = false;
- let identified = false;
-
- const imports = graphQlSourceFile.getImportDeclarations();
- if (!imports.some((i) => i.getModuleSpecifierValue() === '@zenstackhq/redwood')) {
- graphQlSourceFile.addImportDeclaration({
- moduleSpecifier: '@zenstackhq/redwood',
- namedImports: ['useZenStack'],
- });
- graphQlSourceFileChanged = true;
- }
-
- // add "extraPlugins" option to `createGraphQLHandler` call
- graphQlSourceFile.getDescendantsOfKind(SyntaxKind.CallExpression).forEach((expr) => {
- if (identified) {
- return;
- }
-
- if (expr.getExpression().asKind(SyntaxKind.Identifier)?.getText() === 'createGraphQLHandler') {
- const arg = expr.getArguments()[0]?.asKind(SyntaxKind.ObjectLiteralExpression);
- if (arg) {
- identified = true;
- const props = arg.getProperties();
- const pluginsProp = props.find(
- (p): p is PropertyAssignment =>
- p.asKind(SyntaxKind.PropertyAssignment)?.getName() === 'extraPlugins'
- );
- if (pluginsProp) {
- const pluginArr = pluginsProp.getInitializerIfKind(SyntaxKind.ArrayLiteralExpression);
- if (pluginArr) {
- if (!pluginArr.getElements().some((e) => e.getText().includes('useZenStack'))) {
- pluginArr.addElement('useZenStack(db)');
- graphQlSourceFileChanged = true;
- }
- }
- } else {
- arg.addPropertyAssignment({
- name: 'extraPlugins',
- initializer: '[useZenStack(db)]',
- });
- graphQlSourceFileChanged = true;
- }
- }
- }
- });
-
- if (!identified) {
- console.warn(
- colors.yellow(
- 'Unable to determine how to install ZenStack GraphQL plugin. Please add it manually following https://zenstack.dev/docs/guides/redwood.'
- )
- );
- }
-
- if (graphQlSourceFileChanged) {
- graphQlSourceFile.formatText();
- }
-
- // create type-def file to add `db` into global context
- let contextTypeDefCreated = false;
- if (graphQlSourcePath.endsWith('.ts')) {
- const typeDefPath = path.join(getPaths().api.src, 'zenstack.d.ts');
- if (!fs.existsSync(typeDefPath)) {
- const rwVersion: string = getInstalledRedwoodVersion();
- const contextModule =
- rwVersion && semver.lt(rwVersion, '7.0.0')
- ? '@redwoodjs/graphql-server' // pre v7
- : '@redwoodjs/context'; // v7+
-
- const typeDefSourceFile = project.createSourceFile(
- typeDefPath,
- `import type { PrismaClient } from '@zenstackhq/runtime'
-
-declare module '${contextModule}' {
- interface GlobalContext {
- db: PrismaClient
- }
-}
-`
- );
- typeDefSourceFile.formatText();
- contextTypeDefCreated = true;
- }
- }
-
- if (graphQlSourceFileChanged || contextTypeDefCreated) {
- await project.save();
- }
- },
- };
-}
-
-// eject templates used for `yarn rw generate service`
-function ejectServiceTemplates() {
- return {
- title: 'Ejecting service templates...',
- task: async () => {
- if (fs.existsSync(path.join(getPaths().api.base, 'generators', 'service'))) {
- console.info(colors.blue('Service templates already ejected. Skipping.'));
- return;
- }
-
- await execa('yarn', ['rw', 'setup', 'generator', 'service'], { cwd: getPaths().api.base });
- const serviceTemplateTsFile = path.join(
- getPaths().api.base,
- 'generators',
- 'service',
- 'service.ts.template'
- );
- const serviceTemplateJsFile = path.join(
- getPaths().api.base,
- 'generators',
- 'service',
- 'service.js.template'
- );
- const serviceTemplateFile = fs.existsSync(serviceTemplateTsFile)
- ? serviceTemplateTsFile
- : fs.existsSync(serviceTemplateJsFile)
- ? serviceTemplateJsFile
- : undefined;
-
- if (!serviceTemplateFile) {
- console.warn(colors.red('Unable to find the ejected service template file.'));
- return;
- }
-
- // replace `db.` with `context.db.`
- const templateContent = fs.readFileSync(serviceTemplateFile, 'utf-8');
- const newTemplateContent = templateContent
- .replace(/^import { db } from.*\n$/gm, '')
- .replace(/return db\./g, 'return context.db.');
- fs.writeFileSync(serviceTemplateFile, newTemplateContent);
- },
- };
-}
-
-function whatsNext() {
- const zmodel = path.relative(getPaths().base, path.join(path.dirname(getPaths().api.dbSchema), 'schema.zmodel'));
- const task: ListrTask = {
- title: `What's next...`,
- task: (_ctx, task) => {
- task.title =
- `What's next...\n\n` +
- ` - Install ${terminalLink('IDE extensions', 'https://zenstack.dev/docs/guides/ide')}.\n` +
- ` - Use "${zmodel}" to model database schema and access control.\n` +
- ` - Run \`yarn rw @zenstackhq generate\` to regenerate Prisma schema and client.\n` +
- ` - Learn ${terminalLink(
- "how ZenStack extends Prisma's power",
- 'https://zenstack.dev/docs/the-complete-guide/part1'
- )}.\n` +
- ` - Create a sample schema with \`yarn rw @zenstackhq sample\`.\n` +
- ` - Join ${terminalLink(
- 'Discord community',
- 'https://discord.gg/Ykhr738dUe'
- )} for questions and updates.\n`;
- },
- };
- return task;
-}
-
-const setupCommand: CommandModule = {
- command: 'setup',
- describe: 'Set up ZenStack environment',
- builder: (yargs) => yargs,
- handler: async () => {
- const tasks = new Listr([
- updateToml(),
- installDependencies(),
- bootstrapSchema(),
- installGraphQLPlugin(),
- ejectServiceTemplates(),
- whatsNext(),
- ]);
-
- try {
- await tasks.run();
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- } catch (e: any) {
- console.error(colors.red(e.message));
- process.exit(e?.exitCode || 1);
- }
- },
-};
-
-export default setupCommand;
diff --git a/packages/misc/redwood/src/graphql.ts b/packages/misc/redwood/src/graphql.ts
deleted file mode 100644
index 943329744..000000000
--- a/packages/misc/redwood/src/graphql.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { ForbiddenError, ValidationError } from '@redwoodjs/graphql-server';
-import {
- CrudFailureReason,
- EnhancementOptions,
- PrismaErrorCode,
- enhance,
- isPrismaClientKnownRequestError,
- type AuthUser,
-} from '@zenstackhq/runtime';
-import { type Plugin } from 'graphql-yoga';
-
-/**
- * Plugin options
- */
-export type ZenStackPluginOptions = EnhancementOptions;
-
-/**
- * A GraphQLYoga plugin that adds a ZenStack-enhanced PrismaClient into the context
- * as `context.db`.
- * @param db The original PrismaClient.
- * @param getAuthUser A hook function for getting the current user. By default `context.currentUser` is used.
- * @param options Options for creating the enhanced PrismaClient. See https://zenstack.dev/docs/reference/runtime-api#enhance for more details.
- * @returns
- */
-export function useZenStack(
- db: PrismaClient,
- getAuthUser?: (currentUser: unknown) => Promise,
- options?: ZenStackPluginOptions
-): Plugin<{ currentUser: unknown; db: PrismaClient }> {
- return {
- onContextBuilding: () => {
- return async ({ context }) => {
- const user = getAuthUser ? await getAuthUser(context.currentUser) : (context.currentUser as AuthUser);
- context.db = enhance(
- db,
- { user },
- {
- errorTransformer: transformError,
- ...options,
- }
- );
- };
- },
- };
-}
-
-// Transforms ZenStack errors into appropriate RedwoodJS errors
-function transformError(error: unknown) {
- if (isPrismaClientKnownRequestError(error) && error.code === PrismaErrorCode.CONSTRAINT_FAILED) {
- if (
- error.meta?.reason === CrudFailureReason.ACCESS_POLICY_VIOLATION ||
- error.meta?.reason === CrudFailureReason.RESULT_NOT_READABLE
- ) {
- return new ForbiddenError(error.message);
- } else if (error.meta?.reason === CrudFailureReason.DATA_VALIDATION_VIOLATION) {
- return new ValidationError(error.message);
- }
- }
- return error;
-}
diff --git a/packages/misc/redwood/src/index.ts b/packages/misc/redwood/src/index.ts
deleted file mode 100644
index 67585bb3f..000000000
--- a/packages/misc/redwood/src/index.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { makePassthroughCommand } from './cli-passthrough';
-import setup from './commands/setup';
-
-export const commands = [
- setup,
- makePassthroughCommand('generate'),
- makePassthroughCommand('info'),
- makePassthroughCommand('format'),
- makePassthroughCommand('repl'),
-];
-export * from './graphql';
diff --git a/packages/misc/redwood/src/setup-package.ts b/packages/misc/redwood/src/setup-package.ts
deleted file mode 100644
index 8d916ac3a..000000000
--- a/packages/misc/redwood/src/setup-package.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import yargs from 'yargs';
-import { hideBin } from 'yargs/helpers';
-import setupCommand from './commands/setup';
-
-export default async function setupPackage() {
- await yargs(hideBin(process.argv))
- .scriptName('zenstack-setup')
- // @ts-expect-error yargs types are wrong
- .command('$0', 'set up ZenStack', setupCommand.builder, setupCommand.handler)
- .parseAsync();
-}
diff --git a/packages/misc/redwood/src/utils.ts b/packages/misc/redwood/src/utils.ts
deleted file mode 100644
index dbf8a1a04..000000000
--- a/packages/misc/redwood/src/utils.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { getPaths } from '@redwoodjs/cli-helpers';
-import execa from 'execa';
-
-/**
- * Utility for adding npm dependencies to "api" package
- */
-export const addApiPackages = (apiPackages: { pkg: string; dev?: boolean }[]) => ({
- title: 'Adding required api packages...',
- task: async () => {
- const devPkgs = apiPackages.filter((p) => p.dev).map((p) => p.pkg);
- if (devPkgs.length > 0) {
- await execa('yarn', ['add', '-D', ...devPkgs], { cwd: getPaths().api.base });
- }
-
- const runtimePkgs = apiPackages.filter((p) => !p.dev).map((p) => p.pkg);
- if (runtimePkgs.length > 0) {
- await execa('yarn', ['add', ...runtimePkgs], { cwd: getPaths().api.base });
- }
- },
-});
diff --git a/packages/misc/redwood/tsconfig.json b/packages/misc/redwood/tsconfig.json
deleted file mode 100644
index a11845a55..000000000
--- a/packages/misc/redwood/tsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "../../../tsconfig.base.json",
- "compilerOptions": {
- "lib": ["ESNext"],
- "outDir": "dist"
- },
- "include": ["src/**/*.ts"]
-}
diff --git a/packages/plugins/openapi/CHANGELOG.md b/packages/plugins/openapi/CHANGELOG.md
deleted file mode 100644
index cc2a59fdc..000000000
--- a/packages/plugins/openapi/CHANGELOG.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changelog
-
-## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21)
-
-
-### Miscellaneous Chores
-
-* release 2.0.0-alpha.2 ([f40d7e3](https://github.com/zenstackhq/zenstack/commit/f40d7e3718d4210137a2e131d28b5491d065b914))
diff --git a/packages/plugins/openapi/LICENSE b/packages/plugins/openapi/LICENSE
deleted file mode 120000
index 30cff7403..000000000
--- a/packages/plugins/openapi/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../LICENSE
\ No newline at end of file
diff --git a/packages/plugins/openapi/README.md b/packages/plugins/openapi/README.md
deleted file mode 100644
index 605cb2a1a..000000000
--- a/packages/plugins/openapi/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# ZenStack OpenAPI plugin
-
-This package contains ZenStack plugin for generating OpenAPI specification.
-
-Visit [Homepage](https://zenstack.dev) for more details.
diff --git a/packages/plugins/openapi/jest.config.ts b/packages/plugins/openapi/jest.config.ts
deleted file mode 120000
index 09c104090..000000000
--- a/packages/plugins/openapi/jest.config.ts
+++ /dev/null
@@ -1 +0,0 @@
-../../../jest.config.ts
\ No newline at end of file
diff --git a/packages/plugins/openapi/package.json b/packages/plugins/openapi/package.json
deleted file mode 100644
index 9672b1c04..000000000
--- a/packages/plugins/openapi/package.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "name": "@zenstackhq/openapi",
- "displayName": "ZenStack Plugin and Runtime for OpenAPI",
- "version": "2.22.2",
- "description": "ZenStack plugin and runtime supporting OpenAPI",
- "main": "index.js",
- "repository": {
- "type": "git",
- "url": "https://github.com/zenstackhq/zenstack"
- },
- "publishConfig": {
- "directory": "dist",
- "linkDirectory": true
- },
- "scripts": {
- "clean": "rimraf dist",
- "build": "pnpm lint --max-warnings=0 && pnpm clean && tsc && copyfiles ./package.json ./README.md ./LICENSE dist && copyfiles -u 1 ./src/plugin.zmodel dist && pnpm pack dist --pack-destination ../../../../.build",
- "watch": "tsc --watch",
- "lint": "eslint src --ext ts",
- "test": "jest",
- "prepublishOnly": "pnpm build"
- },
- "keywords": [
- "openapi"
- ],
- "author": "ZenStack Team",
- "license": "MIT",
- "dependencies": {
- "@zenstackhq/runtime": "workspace:*",
- "@zenstackhq/sdk": "workspace:*",
- "openapi-types": "^12.1.0",
- "semver": "^7.5.2",
- "ts-pattern": "^4.3.0",
- "yaml": "^2.2.2",
- "zod-validation-error": "catalog:"
- },
- "peerDependencies": {
- "zod": "catalog:"
- },
- "devDependencies": {
- "@readme/openapi-parser": "^2.4.0",
- "@types/pluralize": "^0.0.29",
- "@types/semver": "^7.3.13",
- "@types/tmp": "^0.2.3",
- "@zenstackhq/testtools": "workspace:*",
- "pluralize": "^8.0.0",
- "tmp": "^0.2.1",
- "zenstack": "workspace:*"
- }
-}
diff --git a/packages/plugins/openapi/src/generator-base.ts b/packages/plugins/openapi/src/generator-base.ts
deleted file mode 100644
index 29f6aee6a..000000000
--- a/packages/plugins/openapi/src/generator-base.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-import { getZodErrorMessage } from '@zenstackhq/runtime/local-helpers';
-import { PluginError, getDataModels, hasAttribute, type PluginOptions, type PluginResult } from '@zenstackhq/sdk';
-import { Model } from '@zenstackhq/sdk/ast';
-import type { DMMF } from '@zenstackhq/sdk/prisma';
-import type { OpenAPIV3_1 as OAPI } from 'openapi-types';
-import semver from 'semver';
-import { name } from '.';
-import { SecuritySchemesSchema } from './schema';
-
-export abstract class OpenAPIGeneratorBase {
- protected readonly DEFAULT_SPEC_VERSION = '3.1.0';
-
- constructor(protected model: Model, protected options: PluginOptions, protected dmmf: DMMF.Document) {}
-
- abstract generate(): PluginResult;
-
- protected get includedModels() {
- const includeOpenApiIgnored = this.getOption('includeOpenApiIgnored', false);
- const models = getDataModels(this.model);
- return includeOpenApiIgnored ? models : models.filter((d) => !hasAttribute(d, '@@openapi.ignore'));
- }
-
- protected wrapArray(
- schema: OAPI.ReferenceObject | OAPI.SchemaObject,
- isArray: boolean
- ): OAPI.ReferenceObject | OAPI.SchemaObject {
- if (isArray) {
- return { type: 'array', items: schema };
- } else {
- return schema;
- }
- }
-
- protected wrapNullable(
- schema: OAPI.ReferenceObject | OAPI.SchemaObject,
- isNullable: boolean
- ): OAPI.ReferenceObject | OAPI.SchemaObject {
- if (!isNullable) {
- return schema;
- }
-
- const specVersion = this.getOption('specVersion', this.DEFAULT_SPEC_VERSION);
-
- // https://stackoverflow.com/questions/48111459/how-to-define-a-property-that-can-be-string-or-null-in-openapi-swagger
- // https://stackoverflow.com/questions/40920441/how-to-specify-a-property-can-be-null-or-a-reference-with-swagger
- if (semver.gte(specVersion, '3.1.0')) {
- // OAPI 3.1.0 and above has native 'null' type
- if ((schema as OAPI.BaseSchemaObject).oneOf) {
- // merge into existing 'oneOf'
- return { oneOf: [...(schema as OAPI.BaseSchemaObject).oneOf!, { type: 'null' }] };
- } else {
- // wrap into a 'oneOf'
- return { oneOf: [{ type: 'null' }, schema] };
- }
- } else {
- if ((schema as OAPI.ReferenceObject).$ref) {
- // nullable $ref needs to be represented as: { allOf: [{ $ref: ... }], nullable: true }
- return {
- allOf: [schema],
- nullable: true,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- } as any;
- } else {
- // nullable scalar: { type: ..., nullable: true }
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- return { ...schema, nullable: true } as any;
- }
- }
- }
-
- protected array(itemType: OAPI.SchemaObject | OAPI.ReferenceObject) {
- return { type: 'array', items: itemType } as const;
- }
-
- protected oneOf(...schemas: (OAPI.SchemaObject | OAPI.ReferenceObject)[]) {
- return { oneOf: schemas };
- }
-
- protected allOf(...schemas: (OAPI.SchemaObject | OAPI.ReferenceObject)[]) {
- return { allOf: schemas };
- }
-
- protected getOption(name: string): T | undefined;
- protected getOption(name: string, defaultValue: D): T;
- protected getOption(name: string, defaultValue?: T): T | undefined {
- const value = this.options[name];
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- return value === undefined ? defaultValue : value;
- }
-
- protected generateSecuritySchemes() {
- const securitySchemes = this.getOption[]>('securitySchemes');
- if (securitySchemes) {
- const parsed = SecuritySchemesSchema.safeParse(securitySchemes);
- if (!parsed.success) {
- throw new PluginError(name, `"securitySchemes" option is invalid: ${getZodErrorMessage(parsed.error)}`);
- }
- return parsed.data;
- }
- return undefined;
- }
-
- protected pruneComponents(paths: OAPI.PathsObject, components: OAPI.ComponentsObject) {
- const schemas = components.schemas;
- if (schemas) {
- const roots = new Set();
- for (const path of Object.values(paths)) {
- this.collectUsedComponents(path, roots);
- }
-
- // build a transitive closure for all reachable schemas from roots
- const allUsed = new Set(roots);
-
- let todo = [...allUsed];
- while (todo.length > 0) {
- const curr = new Set(allUsed);
- Object.entries(schemas)
- .filter(([key]) => todo.includes(key))
- .forEach(([, value]) => {
- this.collectUsedComponents(value, allUsed);
- });
- todo = [...allUsed].filter((e) => !curr.has(e));
- }
-
- // prune unused schemas
- Object.keys(schemas).forEach((key) => {
- if (!allUsed.has(key)) {
- delete schemas[key];
- }
- });
- }
- }
-
- private collectUsedComponents(value: unknown, allUsed: Set) {
- if (!value) {
- return;
- }
-
- if (Array.isArray(value)) {
- value.forEach((item) => {
- this.collectUsedComponents(item, allUsed);
- });
- } else if (typeof value === 'object') {
- Object.entries(value).forEach(([subKey, subValue]) => {
- if (subKey === '$ref') {
- const ref = subValue as string;
- const name = ref.split('/').pop();
- if (name && !allUsed.has(name)) {
- allUsed.add(name);
- }
- } else {
- this.collectUsedComponents(subValue, allUsed);
- }
- });
- }
- }
-}
diff --git a/packages/plugins/openapi/src/index.ts b/packages/plugins/openapi/src/index.ts
deleted file mode 100644
index 264403c0a..000000000
--- a/packages/plugins/openapi/src/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { PluginError, PluginFunction } from '@zenstackhq/sdk';
-import { RESTfulOpenAPIGenerator } from './rest-generator';
-import { RPCOpenAPIGenerator } from './rpc-generator';
-
-export const name = 'OpenAPI';
-
-const run: PluginFunction = async (model, options, dmmf) => {
- if (!dmmf) {
- throw new Error('DMMF is required');
- }
-
- const flavor = options.flavor ? (options.flavor as string) : 'rpc';
-
- switch (flavor) {
- case 'rest':
- return new RESTfulOpenAPIGenerator(model, options, dmmf).generate();
- case 'rpc':
- return new RPCOpenAPIGenerator(model, options, dmmf).generate();
- default:
- throw new PluginError(name, `Unknown flavor: ${flavor}`);
- }
-};
-
-export default run;
diff --git a/packages/plugins/openapi/src/meta.ts b/packages/plugins/openapi/src/meta.ts
deleted file mode 100644
index 6a038938a..000000000
--- a/packages/plugins/openapi/src/meta.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { getObjectLiteral } from '@zenstackhq/sdk';
-import { DataModel } from '@zenstackhq/sdk/ast';
-
-/**
- * Metadata for a resource, expressed by @@openapi.meta attribute.
- */
-export type ModelMeta = {
- tagDescription?: string;
- security?: Array>;
-};
-
-/**
- * Metadata for a resource operation, expressed by @@openapi.meta attribute.
- */
-export type OperationMeta = {
- ignore?: boolean;
- method?: string;
- path?: string;
- summary?: string;
- description?: string;
- tags?: string[];
- deprecated?: boolean;
- security?: Array>;
-};
-
-/**
- * Metadata for a resource, expressed by @@openapi.meta attribute.
- */
-export type ResourceMeta = ModelMeta & Record;
-
-export function getModelResourceMeta(model: DataModel) {
- return getObjectLiteral(
- model.attributes.find((attr) => attr.decl.ref?.name === '@@openapi.meta')?.args[0].value
- );
-}
diff --git a/packages/plugins/openapi/src/plugin.zmodel b/packages/plugins/openapi/src/plugin.zmodel
deleted file mode 100644
index 506e286c9..000000000
--- a/packages/plugins/openapi/src/plugin.zmodel
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Mark a data model to be ignored when generating OpenAPI specification.
- */
-attribute @@openapi.ignore()
-
-/**
- * Provide metadata for a data model for generating OpenAPI specification.
- */
-attribute @@openapi.meta(_ meta: Object)
diff --git a/packages/plugins/openapi/src/rest-generator.ts b/packages/plugins/openapi/src/rest-generator.ts
deleted file mode 100644
index 30e2607ae..000000000
--- a/packages/plugins/openapi/src/rest-generator.ts
+++ /dev/null
@@ -1,1069 +0,0 @@
-// Inspired by: https://github.com/omar-dulaimi/prisma-trpc-generator
-
-import {
- analyzePolicies,
- getDataModels,
- hasAttribute,
- isForeignKeyField,
- isIdField,
- isRelationshipField,
- PluginError,
- PluginOptions,
- requireOption,
- resolvePath,
-} from '@zenstackhq/sdk';
-import {
- DataModel,
- DataModelField,
- DataModelFieldType,
- Enum,
- isDataModel,
- isEnum,
- isTypeDef,
- Model,
- TypeDef,
- TypeDefField,
- TypeDefFieldType,
-} from '@zenstackhq/sdk/ast';
-import type { DMMF } from '@zenstackhq/sdk/prisma';
-import { invariant, lowerCaseFirst } from '@zenstackhq/runtime/local-helpers';
-import fs from 'fs';
-import type { OpenAPIV3_1 as OAPI } from 'openapi-types';
-import path from 'path';
-import pluralize from 'pluralize';
-import { match, P } from 'ts-pattern';
-import YAML from 'yaml';
-import { name } from '.';
-import { OpenAPIGeneratorBase } from './generator-base';
-import { getModelResourceMeta } from './meta';
-
-type Policies = ReturnType;
-
-/**
- * Generates RESTful style OpenAPI specification.
- */
-export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase {
- private warnings: string[] = [];
- private modelNameMapping: Record;
-
- constructor(protected model: Model, protected options: PluginOptions, protected dmmf: DMMF.Document) {
- super(model, options, dmmf);
-
- if (this.options.omitInputDetails !== undefined) {
- throw new PluginError(name, '"omitInputDetails" option is not supported for "rest" flavor');
- }
-
- this.modelNameMapping = this.getOption('modelNameMapping', {} as Record);
- }
-
- generate() {
- let output = requireOption(this.options, 'output', name);
- output = resolvePath(output, this.options);
-
- const components = this.generateComponents();
- const paths = this.generatePaths();
-
- // prune unused component schemas
- this.pruneComponents(paths, components);
-
- // generate security schemes, and root-level security
- components.securitySchemes = this.generateSecuritySchemes();
- let security: OAPI.Document['security'] | undefined = undefined;
- if (components.securitySchemes && Object.keys(components.securitySchemes).length > 0) {
- security = Object.keys(components.securitySchemes).map((scheme) => ({ [scheme]: [] }));
- }
-
- const openapi: OAPI.Document = {
- openapi: this.getOption('specVersion', this.DEFAULT_SPEC_VERSION),
- info: {
- title: this.getOption('title', 'ZenStack Generated API'),
- version: this.getOption('version', '1.0.0'),
- description: this.getOption('description'),
- summary: this.getOption('summary'),
- },
- tags: this.includedModels.map((model) => {
- const meta = getModelResourceMeta(model);
- return {
- name: lowerCaseFirst(model.name),
- description: meta?.tagDescription ?? `${model.name} operations`,
- };
- }),
- paths,
- components,
- security,
- };
-
- // ensure output folder exists
- fs.mkdirSync(path.dirname(output), { recursive: true });
-
- const ext = path.extname(output);
- if (ext && (ext.toLowerCase() === '.yaml' || ext.toLowerCase() === '.yml')) {
- fs.writeFileSync(output, YAML.stringify(openapi));
- } else {
- fs.writeFileSync(output, JSON.stringify(openapi, undefined, 2));
- }
-
- return { warnings: this.warnings };
- }
-
- private generatePaths(): OAPI.PathsObject {
- let result: OAPI.PathsObject = {};
-
- const includeModelNames = this.includedModels.map((d) => d.name);
-
- for (const model of this.dmmf.datamodel.models) {
- if (includeModelNames.includes(model.name)) {
- const zmodel = this.model.declarations.find(
- (d) => isDataModel(d) && d.name === model.name
- ) as DataModel;
- if (zmodel) {
- result = {
- ...result,
- ...this.generatePathsForModel(model, zmodel),
- } as OAPI.PathsObject;
- } else {
- this.warnings.push(`Unable to load ZModel definition for: ${model.name}}`);
- }
- }
- }
- return result;
- }
-
- private mapModelName(modelName: string): string {
- return this.modelNameMapping[modelName] ?? modelName;
- }
-
- private generatePathsForModel(model: DMMF.Model, zmodel: DataModel): OAPI.PathItemObject | undefined {
- const result: Record = {};
-
- // analyze access policies to determine default security
- const policies = analyzePolicies(zmodel);
-
- let prefix = this.getOption('prefix', '');
- if (prefix.endsWith('/')) {
- prefix = prefix.substring(0, prefix.length - 1);
- }
-
- const resourceMeta = getModelResourceMeta(zmodel);
-
- const modelName = this.mapModelName(model.name);
-
- // GET /resource
- // POST /resource
- result[`${prefix}/${lowerCaseFirst(modelName)}`] = {
- get: this.makeResourceList(zmodel, policies, resourceMeta),
- post: this.makeResourceCreate(zmodel, policies, resourceMeta),
- };
-
- // GET /resource/{id}
- // PUT /resource/{id}
- // PATCH /resource/{id}
- // DELETE /resource/{id}
- result[`${prefix}/${lowerCaseFirst(modelName)}/{id}`] = {
- get: this.makeResourceFetch(zmodel, policies, resourceMeta),
- put: this.makeResourceUpdate(zmodel, policies, `update-${modelName}-put`, resourceMeta),
- patch: this.makeResourceUpdate(zmodel, policies, `update-${modelName}-patch`, resourceMeta),
- delete: this.makeResourceDelete(zmodel, policies, resourceMeta),
- };
-
- // paths for related resources and relationships
- for (const field of zmodel.fields) {
- const relationDecl = field.type.reference?.ref;
- if (!isDataModel(relationDecl)) {
- continue;
- }
-
- // GET /resource/{id}/{relationship}
- const relatedDataPath = `${prefix}/${lowerCaseFirst(modelName)}/{id}/${field.name}`;
- let container = result[relatedDataPath];
- if (!container) {
- container = result[relatedDataPath] = {};
- }
- container.get = this.makeRelatedFetch(zmodel, field, relationDecl, resourceMeta);
-
- const relationshipPath = `${prefix}/${lowerCaseFirst(modelName)}/{id}/relationships/${field.name}`;
- container = result[relationshipPath];
- if (!container) {
- container = result[relationshipPath] = {};
- }
- // GET /resource/{id}/relationships/{relationship}
- container.get = this.makeRelationshipFetch(zmodel, field, policies, resourceMeta);
-
- // PUT /resource/{id}/relationships/{relationship}
- container.put = this.makeRelationshipUpdate(
- zmodel,
- field,
- policies,
- `update-${model.name}-relationship-${field.name}-put`,
- resourceMeta
- );
- // PATCH /resource/{id}/relationships/{relationship}
- container.patch = this.makeRelationshipUpdate(
- zmodel,
- field,
- policies,
- `update-${model.name}-relationship-${field.name}-patch`,
- resourceMeta
- );
-
- if (field.type.array) {
- // POST /resource/{id}/relationships/{relationship}
- container.post = this.makeRelationshipCreate(zmodel, field, policies, resourceMeta);
- }
- }
-
- return result;
- }
-
- private makeResourceList(model: DataModel, policies: Policies, resourceMeta: { security?: object } | undefined) {
- return {
- operationId: `list-${model.name}`,
- description: `List "${model.name}" resources`,
- tags: [lowerCaseFirst(model.name)],
- parameters: [
- this.parameter('include'),
- this.parameter('sort'),
- this.parameter('page-offset'),
- this.parameter('page-limit'),
- ...this.generateFilterParameters(model),
- ],
- responses: {
- '200': this.success(`${model.name}ListResponse`),
- '403': this.forbidden(),
- },
- security: resourceMeta?.security ?? policies.read === true ? [] : undefined,
- };
- }
-
- private makeResourceCreate(model: DataModel, policies: Policies, resourceMeta: { security?: object } | undefined) {
- return {
- operationId: `create-${model.name}`,
- description: `Create a "${model.name}" resource`,
- tags: [lowerCaseFirst(model.name)],
- requestBody: {
- content: {
- 'application/vnd.api+json': {
- schema: this.ref(`${model.name}CreateRequest`),
- },
- },
- },
- responses: {
- '201': this.success(`${model.name}Response`),
- '403': this.forbidden(),
- '422': this.validationError(),
- },
- security: resourceMeta?.security ?? policies.create === true ? [] : undefined,
- };
- }
-
- private makeResourceFetch(model: DataModel, policies: Policies, resourceMeta: { security?: object } | undefined) {
- return {
- operationId: `fetch-${model.name}`,
- description: `Fetch a "${model.name}" resource`,
- tags: [lowerCaseFirst(model.name)],
- parameters: [this.parameter('id'), this.parameter('include')],
- responses: {
- '200': this.success(`${model.name}Response`),
- '403': this.forbidden(),
- '404': this.notFound(),
- },
- security: resourceMeta?.security ?? policies.read === true ? [] : undefined,
- };
- }
-
- private makeRelatedFetch(
- model: DataModel,
- field: DataModelField,
- relationDecl: DataModel,
- resourceMeta: { security?: object } | undefined
- ) {
- const policies = analyzePolicies(relationDecl);
- const parameters: OAPI.OperationObject['parameters'] = [this.parameter('id'), this.parameter('include')];
- if (field.type.array) {
- parameters.push(
- this.parameter('sort'),
- this.parameter('page-offset'),
- this.parameter('page-limit'),
- ...this.generateFilterParameters(model)
- );
- }
- const result = {
- operationId: `fetch-${model.name}-related-${field.name}`,
- description: `Fetch the related "${field.name}" resource for "${model.name}"`,
- tags: [lowerCaseFirst(model.name)],
- parameters,
- responses: {
- '200': this.success(
- field.type.array ? `${relationDecl.name}ListResponse` : `${relationDecl.name}Response`
- ),
- '403': this.forbidden(),
- '404': this.notFound(),
- },
- security: resourceMeta?.security ?? policies.read === true ? [] : undefined,
- };
- return result;
- }
-
- private makeResourceUpdate(
- model: DataModel,
- policies: Policies,
- operationId: string,
- resourceMeta: { security?: object } | undefined
- ) {
- return {
- operationId,
- description: `Update a "${model.name}" resource`,
- tags: [lowerCaseFirst(model.name)],
- parameters: [this.parameter('id')],
- requestBody: {
- content: {
- 'application/vnd.api+json': {
- schema: this.ref(`${model.name}UpdateRequest`),
- },
- },
- },
- responses: {
- '200': this.success(`${model.name}Response`),
- '403': this.forbidden(),
- '404': this.notFound(),
- '422': this.validationError(),
- },
- security: resourceMeta?.security ?? policies.update === true ? [] : undefined,
- };
- }
-
- private makeResourceDelete(model: DataModel, policies: Policies, resourceMeta: { security?: object } | undefined) {
- return {
- operationId: `delete-${model.name}`,
- description: `Delete a "${model.name}" resource`,
- tags: [lowerCaseFirst(model.name)],
- parameters: [this.parameter('id')],
- responses: {
- '200': this.success(),
- '403': this.forbidden(),
- '404': this.notFound(),
- },
- security: resourceMeta?.security ?? policies.delete === true ? [] : undefined,
- };
- }
-
- private makeRelationshipFetch(
- model: DataModel,
- field: DataModelField,
- policies: Policies,
- resourceMeta: { security?: object } | undefined
- ) {
- const parameters: OAPI.OperationObject['parameters'] = [this.parameter('id')];
- if (field.type.array) {
- parameters.push(
- this.parameter('sort'),
- this.parameter('page-offset'),
- this.parameter('page-limit'),
- ...this.generateFilterParameters(model)
- );
- }
- return {
- operationId: `fetch-${model.name}-relationship-${field.name}`,
- description: `Fetch the "${field.name}" relationships for a "${model.name}"`,
- tags: [lowerCaseFirst(model.name)],
- parameters,
- responses: {
- '200': field.type.array
- ? this.success('_toManyRelationshipResponse')
- : this.success('_toOneRelationshipResponse'),
- '403': this.forbidden(),
- '404': this.notFound(),
- },
- security: resourceMeta?.security ?? policies.read === true ? [] : undefined,
- };
- }
-
- private makeRelationshipCreate(
- model: DataModel,
- field: DataModelField,
- policies: Policies,
- resourceMeta: { security?: object } | undefined
- ) {
- return {
- operationId: `create-${model.name}-relationship-${field.name}`,
- description: `Create new "${field.name}" relationships for a "${model.name}"`,
- tags: [lowerCaseFirst(model.name)],
- parameters: [this.parameter('id')],
- requestBody: {
- content: {
- 'application/vnd.api+json': {
- schema: this.ref('_toManyRelationshipRequest'),
- },
- },
- },
- responses: {
- '200': this.success('_toManyRelationshipResponse'),
- '403': this.forbidden(),
- '404': this.notFound(),
- },
- security: resourceMeta?.security ?? policies.update === true ? [] : undefined,
- };
- }
-
- private makeRelationshipUpdate(
- model: DataModel,
- field: DataModelField,
- policies: Policies,
- operationId: string,
- resourceMeta: { security?: object } | undefined
- ) {
- return {
- operationId,
- description: `Update "${field.name}" ${pluralize('relationship', field.type.array ? 2 : 1)} for a "${
- model.name
- }"`,
- tags: [lowerCaseFirst(model.name)],
- parameters: [this.parameter('id')],
- requestBody: {
- content: {
- 'application/vnd.api+json': {
- schema: field.type.array
- ? this.ref('_toManyRelationshipRequest')
- : this.ref('_toOneRelationshipRequest'),
- },
- },
- },
- responses: {
- '200': field.type.array
- ? this.success('_toManyRelationshipResponse')
- : this.success('_toOneRelationshipResponse'),
- '403': this.forbidden(),
- '404': this.notFound(),
- },
- security: resourceMeta?.security ?? policies.update === true ? [] : undefined,
- };
- }
-
- private generateFilterParameters(model: DataModel) {
- const result: OAPI.ParameterObject[] = [];
-
- const hasMultipleIds = model.fields.filter((f) => isIdField(f)).length > 1;
-
- for (const field of model.fields) {
- if (isForeignKeyField(field)) {
- // no filtering with foreign keys because one can filter
- // directly on the relationship
- continue;
- }
-
- // For multiple ids, make each id field filterable like a regular field
- if (isIdField(field) && !hasMultipleIds) {
- // id filter
- result.push(this.makeFilterParameter(field, 'id', 'Id filter'));
- continue;
- }
-
- // equality filter
- result.push(this.makeFilterParameter(field, '', 'Equality filter', field.type.array));
-
- if (isRelationshipField(field)) {
- // TODO: how to express nested filters?
- continue;
- }
-
- if (field.type.array) {
- // collection filters
- result.push(this.makeFilterParameter(field, '$has', 'Collection contains filter'));
- result.push(this.makeFilterParameter(field, '$hasEvery', 'Collection contains-all filter', true));
- result.push(this.makeFilterParameter(field, '$hasSome', 'Collection contains-any filter', true));
- result.push(
- this.makeFilterParameter(field, '$isEmpty', 'Collection is empty filter', false, {
- type: 'boolean',
- })
- );
- } else {
- if (field.type.type && ['Int', 'BigInt', 'Float', 'Decimal', 'DateTime'].includes(field.type.type)) {
- // comparison filters
- result.push(this.makeFilterParameter(field, '$lt', 'Less-than filter'));
- result.push(this.makeFilterParameter(field, '$lte', 'Less-than or equal filter'));
- result.push(this.makeFilterParameter(field, '$gt', 'Greater-than filter'));
- result.push(this.makeFilterParameter(field, '$gte', 'Greater-than or equal filter'));
- }
-
- if (field.type.type === 'String') {
- result.push(this.makeFilterParameter(field, '$contains', 'String contains filter'));
- result.push(
- this.makeFilterParameter(field, '$icontains', 'String case-insensitive contains filter')
- );
- result.push(this.makeFilterParameter(field, '$search', 'String full-text search filter'));
- result.push(this.makeFilterParameter(field, '$startsWith', 'String startsWith filter'));
- result.push(this.makeFilterParameter(field, '$endsWith', 'String endsWith filter'));
- }
- }
- }
-
- return result;
- }
-
- private makeFilterParameter(
- field: DataModelField,
- name: string,
- description: string,
- array = false,
- schemaOverride?: OAPI.SchemaObject
- ) {
- let schema: OAPI.SchemaObject | OAPI.ReferenceObject;
-
- if (schemaOverride) {
- schema = schemaOverride;
- } else {
- const fieldDecl = field.type.reference?.ref;
- if (isEnum(fieldDecl)) {
- schema = this.ref(fieldDecl.name);
- } else if (isDataModel(fieldDecl)) {
- schema = { type: 'string' };
- } else if (isTypeDef(fieldDecl) || field.type.type === 'Json') {
- schema = { type: 'string', format: 'json' };
- } else {
- invariant(field.type.type);
- schema = this.fieldTypeToOpenAPISchema(field.type);
- }
- }
-
- schema = this.wrapArray(schema, array);
-
- return {
- name: name === 'id' ? 'filter[id]' : `filter[${field.name}${name}]`,
- required: false,
- description: name === 'id' ? description : `${description} for "${field.name}"`,
- in: 'query',
- style: 'form',
- explode: false,
- schema,
- } as OAPI.ParameterObject;
- }
-
- private generateComponents() {
- const schemas: Record = {};
- const parameters: Record = {};
- const components: OAPI.ComponentsObject = {
- schemas,
- parameters,
- };
-
- for (const [name, value] of Object.entries(this.generateSharedComponents())) {
- schemas[name] = value;
- }
-
- for (const [name, value] of Object.entries(this.generateParameters())) {
- parameters[name] = value;
- }
-
- for (const _enum of this.model.declarations.filter((d): d is Enum => isEnum(d))) {
- schemas[_enum.name] = this.generateEnumComponent(_enum);
- }
-
- // data models
- for (const model of getDataModels(this.model)) {
- for (const [name, value] of Object.entries(this.generateDataModelComponents(model))) {
- schemas[name] = value;
- }
- }
-
- // type defs
- for (const typeDef of this.model.declarations.filter(isTypeDef)) {
- schemas[typeDef.name] = this.generateTypeDefComponent(typeDef);
- }
-
- return components;
- }
-
- private generateSharedComponents(): Record {
- return {
- _jsonapi: {
- type: 'object',
- description: 'An object describing the server’s implementation',
- required: ['version'],
- properties: {
- version: { type: 'string' },
- },
- },
- _meta: {
- type: 'object',
- description: 'Meta information about the request or response',
- properties: {
- serialization: {
- description: 'Superjson serialization metadata',
- },
- },
- additionalProperties: true,
- },
- _resourceIdentifier: {
- type: 'object',
- description: 'Identifier for a resource',
- required: ['type', 'id'],
- properties: {
- type: { type: 'string', description: 'Resource type' },
- id: { type: 'string', description: 'Resource id' },
- },
- },
- _resource: this.allOf(this.ref('_resourceIdentifier'), {
- type: 'object',
- description: 'A resource with attributes and relationships',
- properties: {
- attributes: { type: 'object', description: 'Resource attributes' },
- relationships: { type: 'object', description: 'Resource relationships' },
- },
- }),
- _links: {
- type: 'object',
- required: ['self'],
- description: 'Links related to the resource',
- properties: { self: { type: 'string', description: 'Link for refetching the curent results' } },
- },
- _pagination: {
- type: 'object',
- description: 'Pagination information',
- required: ['first', 'last', 'prev', 'next'],
- properties: {
- first: this.wrapNullable({ type: 'string', description: 'Link to the first page' }, true),
- last: this.wrapNullable({ type: 'string', description: 'Link to the last page' }, true),
- prev: this.wrapNullable({ type: 'string', description: 'Link to the previous page' }, true),
- next: this.wrapNullable({ type: 'string', description: 'Link to the next page' }, true),
- },
- },
- _errors: {
- type: 'array',
- description: 'An array of error objects',
- items: {
- type: 'object',
- required: ['status', 'code'],
- properties: {
- status: { type: 'string', description: 'HTTP status' },
- code: { type: 'string', description: 'Error code' },
- prismaCode: {
- type: 'string',
- description: 'Prisma error code if the error is thrown by Prisma',
- },
- title: { type: 'string', description: 'Error title' },
- detail: { type: 'string', description: 'Error detail' },
- reason: {
- type: 'string',
- description: 'Detailed error reason',
- },
- zodErrors: {
- type: 'object',
- additionalProperties: true,
- description: 'Zod validation errors if the error is due to data validation failure',
- },
- },
- },
- },
- _errorResponse: {
- type: 'object',
- required: ['errors'],
- description: 'An error response',
- properties: {
- jsonapi: this.ref('_jsonapi'),
- errors: this.ref('_errors'),
- },
- },
- _relationLinks: {
- type: 'object',
- required: ['self', 'related'],
- description: 'Links related to a relationship',
- properties: {
- self: { type: 'string', description: 'Link for fetching this relationship' },
- related: {
- type: 'string',
- description: 'Link for fetching the resource represented by this relationship',
- },
- },
- },
- _toOneRelationship: {
- type: 'object',
- description: 'A to-one relationship',
- properties: {
- data: this.wrapNullable(this.ref('_resourceIdentifier'), true),
- },
- },
- _toOneRelationshipWithLinks: {
- type: 'object',
- required: ['links', 'data'],
- description: 'A to-one relationship with links',
- properties: {
- links: this.ref('_relationLinks'),
- data: this.wrapNullable(this.ref('_resourceIdentifier'), true),
- },
- },
- _toManyRelationship: {
- type: 'object',
- required: ['data'],
- description: 'A to-many relationship',
- properties: {
- data: this.array(this.ref('_resourceIdentifier')),
- },
- },
- _toManyRelationshipWithLinks: {
- type: 'object',
- required: ['links', 'data'],
- description: 'A to-many relationship with links',
- properties: {
- links: this.ref('_pagedRelationLinks'),
- data: this.array(this.ref('_resourceIdentifier')),
- },
- },
- _pagedRelationLinks: {
- description: 'Relationship links with pagination information',
- ...this.allOf(this.ref('_pagination'), this.ref('_relationLinks')),
- },
- _toManyRelationshipRequest: {
- type: 'object',
- required: ['data'],
- description: 'Input for manipulating a to-many relationship',
- properties: {
- data: {
- type: 'array',
- items: this.ref('_resourceIdentifier'),
- },
- },
- },
- _toOneRelationshipRequest: {
- description: 'Input for manipulating a to-one relationship',
- ...this.wrapNullable(
- {
- type: 'object',
- required: ['data'],
- properties: {
- data: this.ref('_resourceIdentifier'),
- },
- },
- true
- ),
- },
- _toManyRelationshipResponse: {
- description: 'Response for a to-many relationship',
- ...this.allOf(this.ref('_toManyRelationshipWithLinks'), {
- type: 'object',
- properties: {
- jsonapi: this.ref('_jsonapi'),
- },
- }),
- },
- _toOneRelationshipResponse: {
- description: 'Response for a to-one relationship',
- ...this.allOf(this.ref('_toOneRelationshipWithLinks'), {
- type: 'object',
- properties: {
- jsonapi: this.ref('_jsonapi'),
- },
- }),
- },
- };
- }
-
- private generateParameters(): Record {
- return {
- id: {
- name: 'id',
- in: 'path',
- description: 'The resource id',
- required: true,
- schema: { type: 'string' },
- },
- include: {
- name: 'include',
- in: 'query',
- description: 'Relationships to include',
- required: false,
- style: 'form',
- schema: { type: 'string' },
- },
- sort: {
- name: 'sort',
- in: 'query',
- description: 'Fields to sort by',
- required: false,
- style: 'form',
- schema: { type: 'string' },
- },
- 'page-offset': {
- name: 'page[offset]',
- in: 'query',
- description: 'Offset for pagination',
- required: false,
- style: 'form',
- schema: { type: 'integer' },
- },
- 'page-limit': {
- name: 'page[limit]',
- in: 'query',
- description: 'Limit for pagination',
- required: false,
- style: 'form',
- schema: { type: 'integer' },
- },
- };
- }
-
- private generateEnumComponent(_enum: Enum) {
- const schema: OAPI.SchemaObject = {
- type: 'string',
- description: `The "${_enum.name}" Enum`,
- enum: _enum.fields.map((f) => f.name),
- };
- return schema;
- }
-
- private generateTypeDefComponent(typeDef: TypeDef) {
- const schema: OAPI.SchemaObject = {
- type: 'object',
- description: `The "${typeDef.name}" TypeDef`,
- properties: typeDef.fields.reduce((acc, field) => {
- acc[field.name] = this.generateField(field);
- return acc;
- }, {} as Record),
- };
- return schema;
- }
-
- private generateDataModelComponents(model: DataModel) {
- const result: Record = {};
- result[`${model.name}`] = this.generateModelEntity(model, 'read');
-
- result[`${model.name}CreateRequest`] = {
- type: 'object',
- description: `Input for creating a "${model.name}"`,
- required: ['data'],
- properties: {
- data: this.generateModelEntity(model, 'create'),
- meta: this.ref('_meta'),
- },
- };
-
- result[`${model.name}UpdateRequest`] = {
- type: 'object',
- description: `Input for updating a "${model.name}"`,
- required: ['data'],
- properties: { data: this.generateModelEntity(model, 'update'), meta: this.ref('_meta') },
- };
-
- const relationships: Record = {};
- for (const field of model.fields) {
- if (isRelationshipField(field)) {
- if (field.type.array) {
- relationships[field.name] = this.ref('_toManyRelationship');
- } else {
- relationships[field.name] = this.ref('_toOneRelationship');
- }
- }
- }
-
- result[`${model.name}Response`] = {
- type: 'object',
- description: `Response for a "${model.name}"`,
- required: ['data'],
- properties: {
- jsonapi: this.ref('_jsonapi'),
- data: this.allOf(this.ref(`${model.name}`), {
- type: 'object',
- properties: { relationships: { type: 'object', properties: relationships } },
- }),
- meta: this.ref('_meta'),
- included: {
- type: 'array',
- items: this.ref('_resource'),
- },
- links: this.ref('_links'),
- },
- };
-
- result[`${model.name}ListResponse`] = {
- type: 'object',
- description: `Response for a list of "${model.name}"`,
- required: ['data', 'links'],
- properties: {
- jsonapi: this.ref('_jsonapi'),
- data: this.array(
- this.allOf(this.ref(`${model.name}`), {
- type: 'object',
- properties: { relationships: { type: 'object', properties: relationships } },
- })
- ),
- meta: this.ref('_meta'),
- included: {
- type: 'array',
- items: this.ref('_resource'),
- },
- links: this.allOf(this.ref('_links'), this.ref('_pagination')),
- },
- };
-
- return result;
- }
-
- private generateModelEntity(model: DataModel, mode: 'read' | 'create' | 'update'): OAPI.SchemaObject {
- const idFields = model.fields.filter((f) => isIdField(f));
- // For compound ids each component is also exposed as a separate fields.
- const fields = idFields.length > 1 ? model.fields : model.fields.filter((f) => !isIdField(f));
-
- const attributes: Record = {};
- const relationships: Record = {};
-
- const required: string[] = [];
-
- for (const field of fields) {
- if (isForeignKeyField(field) && mode !== 'read') {
- // foreign keys are not exposed as attributes
- continue;
- }
- if (isRelationshipField(field)) {
- let relType: string;
- if (mode === 'create' || mode === 'update') {
- relType = field.type.array ? '_toManyRelationship' : '_toOneRelationship';
- } else {
- relType = field.type.array ? '_toManyRelationshipWithLinks' : '_toOneRelationshipWithLinks';
- }
- relationships[field.name] = this.wrapNullable(this.ref(relType), field.type.optional);
- } else {
- attributes[field.name] = this.generateField(field);
- if (
- mode === 'create' &&
- !field.type.optional &&
- !hasAttribute(field, '@default') &&
- // collection relation fields are implicitly optional
- !(isDataModel(field.$resolvedType?.decl) && field.type.array)
- ) {
- required.push(field.name);
- } else if (mode === 'read') {
- // Until we support sparse fieldsets, all fields are required for read operations
- required.push(field.name);
- }
- }
- }
-
- const toplevelRequired = ['type', 'attributes'];
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- let properties: any = {
- type: { type: 'string' },
- attributes: {
- type: 'object',
- required: required.length > 0 ? required : undefined,
- properties: attributes,
- },
- };
-
- let idFieldSchema: OAPI.SchemaObject = { type: 'string' };
- if (idFields.length === 1) {
- // FIXME: JSON:API actually requires id field to be a string,
- // but currently the RESTAPIHandler returns the original data
- // type as declared in the ZModel schema.
- idFieldSchema = this.fieldTypeToOpenAPISchema(idFields[0].type);
- }
-
- if (mode === 'create') {
- // 'id' is required if there's no default value
- const idFields = model.fields.filter((f) => isIdField(f));
- if (idFields.length === 1 && !hasAttribute(idFields[0], '@default')) {
- properties = { id: idFieldSchema, ...properties };
- toplevelRequired.unshift('id');
- }
- } else {
- // 'id' always required for read and update
- properties = { id: idFieldSchema, ...properties };
- toplevelRequired.unshift('id');
- }
-
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const result: any = {
- type: 'object',
- description: `The "${model.name}" model`,
- required: toplevelRequired,
- properties,
- } satisfies OAPI.SchemaObject;
-
- if (Object.keys(relationships).length > 0) {
- result.properties.relationships = {
- type: 'object',
- properties: relationships,
- };
- }
-
- return result;
- }
-
- private generateField(field: DataModelField | TypeDefField) {
- return this.wrapArray(
- this.wrapNullable(this.fieldTypeToOpenAPISchema(field.type), field.type.optional),
- field.type.array
- );
- }
-
- private fieldTypeToOpenAPISchema(
- type: DataModelFieldType | TypeDefFieldType
- ): OAPI.ReferenceObject | OAPI.SchemaObject {
- return match(type.type)
- .with('String', () => ({ type: 'string' }))
- .with(P.union('Int', 'BigInt'), () => ({ type: 'integer' }))
- .with('Float', () => ({ type: 'number' }))
- .with('Decimal', () => this.oneOf({ type: 'number' }, { type: 'string' }))
- .with('Boolean', () => ({ type: 'boolean' }))
- .with('DateTime', () => ({ type: 'string', format: 'date-time' }))
- .with('Bytes', () => ({ type: 'string', format: 'byte', description: 'Base64 encoded byte array' }))
- .with('Json', () => ({}))
- .otherwise((t) => {
- const fieldDecl = type.reference?.ref;
- invariant(fieldDecl, `Type ${t} is not a model reference`);
- return this.ref(fieldDecl?.name);
- });
- }
-
- private ref(type: string) {
- return { $ref: `#/components/schemas/${type}` };
- }
-
- private parameter(type: string) {
- return { $ref: `#/components/parameters/${type}` };
- }
-
- private forbidden() {
- return {
- description: 'Request is forbidden',
- content: {
- 'application/vnd.api+json': {
- schema: this.ref('_errorResponse'),
- },
- },
- };
- }
-
- private validationError() {
- return {
- description: 'Request is unprocessable due to validation errors',
- content: {
- 'application/vnd.api+json': {
- schema: this.ref('_errorResponse'),
- },
- },
- };
- }
-
- private notFound() {
- return {
- description: 'Resource is not found',
- content: {
- 'application/vnd.api+json': {
- schema: this.ref('_errorResponse'),
- },
- },
- };
- }
-
- private success(responseComponent?: string) {
- return {
- description: 'Successful operation',
- content: responseComponent
- ? {
- 'application/vnd.api+json': {
- schema: this.ref(responseComponent),
- },
- }
- : undefined,
- };
- }
-}
diff --git a/packages/plugins/openapi/src/rpc-generator.ts b/packages/plugins/openapi/src/rpc-generator.ts
deleted file mode 100644
index 463d3411e..000000000
--- a/packages/plugins/openapi/src/rpc-generator.ts
+++ /dev/null
@@ -1,963 +0,0 @@
-// Inspired by: https://github.com/omar-dulaimi/prisma-trpc-generator
-
-import { PluginError, PluginOptions, analyzePolicies, requireOption, resolvePath } from '@zenstackhq/sdk';
-import {
- DataModel,
- Model,
- TypeDef,
- TypeDefField,
- TypeDefFieldType,
- isDataModel,
- isEnum,
- isTypeDef,
-} from '@zenstackhq/sdk/ast';
-import {
- AggregateOperationSupport,
- addMissingInputObjectTypesForAggregate,
- addMissingInputObjectTypesForInclude,
- addMissingInputObjectTypesForModelArgs,
- addMissingInputObjectTypesForSelect,
- resolveAggregateOperationSupport,
-} from '@zenstackhq/sdk/dmmf-helpers';
-import { supportCreateMany, type DMMF } from '@zenstackhq/sdk/prisma';
-import { lowerCaseFirst, upperCaseFirst, invariant } from '@zenstackhq/runtime/local-helpers';
-import * as fs from 'fs';
-import type { OpenAPIV3_1 as OAPI } from 'openapi-types';
-import * as path from 'path';
-import { P, match } from 'ts-pattern';
-import YAML from 'yaml';
-import { name } from '.';
-import { OpenAPIGeneratorBase } from './generator-base';
-import { getModelResourceMeta } from './meta';
-
-const ANY_OBJECT = '_AnyObject';
-
-/**
- * Generates OpenAPI specification.
- */
-export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase {
- private inputObjectTypes: DMMF.InputType[] = [];
- private outputObjectTypes: DMMF.OutputType[] = [];
- private usedComponents: Set = new Set();
- private aggregateOperationSupport: AggregateOperationSupport;
- private warnings: string[] = [];
- private omitInputDetails: boolean;
-
- constructor(protected model: Model, protected options: PluginOptions, protected dmmf: DMMF.Document) {
- super(model, options, dmmf);
-
- this.omitInputDetails = this.getOption('omitInputDetails', false);
- if (this.omitInputDetails !== undefined && typeof this.omitInputDetails !== 'boolean') {
- throw new PluginError(name, `Invalid option value for "omitInputDetails", boolean expected`);
- }
- }
-
- generate() {
- let output = requireOption(this.options, 'output', name);
- output = resolvePath(output, this.options);
-
- // input types
- this.inputObjectTypes.push(...(this.dmmf.schema.inputObjectTypes.prisma ?? []));
- this.outputObjectTypes.push(...this.dmmf.schema.outputObjectTypes.prisma);
-
- // add input object types that are missing from Prisma dmmf
- addMissingInputObjectTypesForModelArgs(this.inputObjectTypes, this.dmmf.datamodel.models);
- addMissingInputObjectTypesForInclude(this.inputObjectTypes, this.dmmf.datamodel.models);
- addMissingInputObjectTypesForSelect(this.inputObjectTypes, this.outputObjectTypes, this.dmmf.datamodel.models);
- addMissingInputObjectTypesForAggregate(this.inputObjectTypes, this.outputObjectTypes);
-
- this.aggregateOperationSupport = resolveAggregateOperationSupport(this.inputObjectTypes);
-
- const components = this.generateComponents();
- const paths = this.generatePaths(components);
-
- // generate security schemes, and root-level security
- components.securitySchemes = this.generateSecuritySchemes();
- let security: OAPI.Document['security'] | undefined = undefined;
- if (components.securitySchemes && Object.keys(components.securitySchemes).length > 0) {
- security = Object.keys(components.securitySchemes).map((scheme) => ({ [scheme]: [] }));
- }
-
- // prune unused component schemas
- this.pruneComponents(paths, components);
-
- const openapi: OAPI.Document = {
- openapi: this.getOption('specVersion', this.DEFAULT_SPEC_VERSION),
- info: {
- title: this.getOption('title', 'ZenStack Generated API'),
- version: this.getOption('version', '1.0.0'),
- description: this.getOption('description'),
- summary: this.getOption('summary'),
- },
- tags: this.includedModels.map((model) => {
- const meta = getModelResourceMeta(model);
- return {
- name: lowerCaseFirst(model.name),
- description: meta?.tagDescription ?? `${model.name} operations`,
- };
- }),
- components,
- paths,
- security,
- };
-
- // ensure output folder exists
- fs.mkdirSync(path.dirname(output), { recursive: true });
-
- const ext = path.extname(output);
- if (ext && (ext.toLowerCase() === '.yaml' || ext.toLowerCase() === '.yml')) {
- fs.writeFileSync(output, YAML.stringify(openapi));
- } else {
- fs.writeFileSync(output, JSON.stringify(openapi, undefined, 2));
- }
-
- return { warnings: this.warnings };
- }
-
- private generatePaths(components: OAPI.ComponentsObject): OAPI.PathsObject {
- let result: OAPI.PathsObject = {};
-
- for (const model of this.dmmf.datamodel.models) {
- const zmodel = this.model.declarations.find((d) => isDataModel(d) && d.name === model.name) as DataModel;
- if (zmodel) {
- result = {
- ...result,
- ...this.generatePathsForModel(model, zmodel, components),
- } as OAPI.PathsObject;
- } else {
- this.warnings.push(`Unable to load ZModel definition for: ${model.name}}`);
- }
- }
- return result;
- }
-
- private generatePathsForModel(
- model: DMMF.Model,
- zmodel: DataModel,
- components: OAPI.ComponentsObject
- ): OAPI.PathItemObject | undefined {
- const result: OAPI.PathItemObject & Record = {};
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const ops: (DMMF.ModelMapping & { createOne?: string | null } & Record) | undefined =
- this.dmmf.mappings.modelOperations.find((ops) => ops.model === model.name);
- if (!ops) {
- this.warnings.push(`Unable to find mapping for model ${model.name}`);
- return undefined;
- }
-
- const modelName = upperCaseFirst(model.name);
-
- type OperationDefinition = {
- method: 'get' | 'post' | 'put' | 'patch' | 'delete';
- operation: string;
- description: string;
- inputType?: object;
- outputType: object;
- successCode?: number;
- security?: Array>;
- };
-
- const definitions: OperationDefinition[] = [];
- const hasRelation = zmodel.fields.some((f) => isDataModel(f.type.reference?.ref));
-
- // analyze access policies to determine default security
- const { create, read, update, delete: del } = analyzePolicies(zmodel);
-
- // OrderByWithRelationInput's name is different when "fullTextSearch" is enabled
- const orderByWithRelationInput = this.inputObjectTypes
- .map((o) => upperCaseFirst(o.name))
- .includes(`${modelName}OrderByWithRelationInput`)
- ? `${modelName}OrderByWithRelationInput`
- : `${modelName}OrderByWithRelationAndSearchRelevanceInput`;
-
- if (ops['createOne']) {
- definitions.push({
- method: 'post',
- operation: 'create',
- inputType: this.component(
- `${modelName}CreateArgs`,
- {
- type: 'object',
- required: ['data'],
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
- data: this.omittableRef(`${modelName}CreateInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref(modelName)),
- description: `Create a new ${modelName}`,
- successCode: 201,
- security: create === true ? [] : undefined,
- });
- }
-
- if (ops['createMany'] && supportCreateMany(zmodel.$container)) {
- definitions.push({
- method: 'post',
- operation: 'createMany',
- inputType: this.component(
- `${modelName}CreateManyArgs`,
- {
- type: 'object',
- required: ['data'],
- properties: {
- data: this.oneOf(
- this.omittableRef(`${modelName}CreateManyInput`),
- this.array(this.omittableRef(`${modelName}CreateManyInput`))
- ),
- skipDuplicates: {
- type: 'boolean',
- description:
- 'Do not insert records with unique fields or ID fields that already exist.',
- },
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref('BatchPayload')),
- description: `Create several ${modelName}`,
- successCode: 201,
- security: create === true ? [] : undefined,
- });
- }
-
- if (ops['findUnique']) {
- definitions.push({
- method: 'get',
- operation: 'findUnique',
- inputType: this.component(
- `${modelName}FindUniqueArgs`,
- {
- type: 'object',
- required: ['where'],
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
- where: this.omittableRef(`${modelName}WhereUniqueInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref(modelName)),
- description: `Find one unique ${modelName}`,
- security: read === true ? [] : undefined,
- });
- }
-
- if (ops['findFirst']) {
- definitions.push({
- method: 'get',
- operation: 'findFirst',
- inputType: this.component(
- `${modelName}FindFirstArgs`,
- {
- type: 'object',
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
- where: this.omittableRef(`${modelName}WhereInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref(modelName)),
- description: `Find the first ${modelName} matching the given condition`,
- security: read === true ? [] : undefined,
- });
- }
-
- if (ops['findMany']) {
- definitions.push({
- method: 'get',
- operation: 'findMany',
- inputType: this.component(
- `${modelName}FindManyArgs`,
- {
- type: 'object',
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
- where: this.omittableRef(`${modelName}WhereInput`),
- orderBy: this.oneOf(
- this.omittableRef(orderByWithRelationInput),
- this.array(this.omittableRef(orderByWithRelationInput))
- ),
- cursor: this.omittableRef(`${modelName}WhereUniqueInput`),
- take: { type: 'integer' },
- skip: { type: 'integer' },
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.array(this.ref(modelName))),
- description: `Find a list of ${modelName}`,
- security: read === true ? [] : undefined,
- });
- }
-
- if (ops['updateOne']) {
- definitions.push({
- method: 'patch',
- operation: 'update',
- inputType: this.component(
- `${modelName}UpdateArgs`,
- {
- type: 'object',
- required: ['where', 'data'],
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
- where: this.omittableRef(`${modelName}WhereUniqueInput`),
- data: this.omittableRef(`${modelName}UpdateInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref(modelName)),
- description: `Update a ${modelName}`,
- security: update === true ? [] : undefined,
- });
- }
-
- if (ops['updateMany']) {
- definitions.push({
- operation: 'updateMany',
- method: 'patch',
- inputType: this.component(
- `${modelName}UpdateManyArgs`,
- {
- type: 'object',
- required: ['data'],
- properties: {
- where: this.omittableRef(`${modelName}WhereInput`),
- data: this.omittableRef(`${modelName}UpdateManyMutationInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref('BatchPayload')),
- description: `Update ${modelName}s matching the given condition`,
- security: update === true ? [] : undefined,
- });
- }
-
- if (ops['upsertOne']) {
- definitions.push({
- method: 'post',
- operation: 'upsert',
- inputType: this.component(
- `${modelName}UpsertArgs`,
- {
- type: 'object',
- required: ['create', 'update', 'where'],
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
- where: this.omittableRef(`${modelName}WhereUniqueInput`),
- create: this.omittableRef(`${modelName}CreateInput`),
- update: this.omittableRef(`${modelName}UpdateInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref(modelName)),
- description: `Upsert a ${modelName}`,
- security: create === true && update == true ? [] : undefined,
- });
- }
-
- if (ops['deleteOne']) {
- definitions.push({
- method: 'delete',
- operation: 'delete',
- inputType: this.component(
- `${modelName}DeleteUniqueArgs`,
- {
- type: 'object',
- required: ['where'],
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
- where: this.omittableRef(`${modelName}WhereUniqueInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref(modelName)),
- description: `Delete one unique ${modelName}`,
- security: del === true ? [] : undefined,
- });
- }
-
- if (ops['deleteMany']) {
- definitions.push({
- method: 'delete',
- operation: 'deleteMany',
- inputType: this.component(
- `${modelName}DeleteManyArgs`,
- {
- type: 'object',
- properties: {
- where: this.omittableRef(`${modelName}WhereInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref('BatchPayload')),
- description: `Delete ${modelName}s matching the given condition`,
- security: del === true ? [] : undefined,
- });
- }
-
- // somehow dmmf doesn't contain "count" operation, so we unconditionally add it here
- definitions.push({
- method: 'get',
- operation: 'count',
- inputType: this.component(
- `${modelName}CountArgs`,
- {
- type: 'object',
- properties: {
- select: this.omittableRef(`${modelName}Select`),
- where: this.omittableRef(`${modelName}WhereInput`),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(
- this.oneOf({ type: 'integer' }, this.ref(`${modelName}CountAggregateOutputType`))
- ),
- description: `Find a list of ${modelName}`,
- security: read === true ? [] : undefined,
- });
-
- if (ops['aggregate']) {
- definitions.push({
- method: 'get',
- operation: 'aggregate',
- inputType: this.component(
- `${modelName}AggregateArgs`,
- {
- type: 'object',
- properties: {
- where: this.omittableRef(`${modelName}WhereInput`),
- orderBy: this.omittableRef(orderByWithRelationInput),
- cursor: this.omittableRef(`${modelName}WhereUniqueInput`),
- take: { type: 'integer' },
- skip: { type: 'integer' },
- ...this.aggregateFields(model),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.ref(`Aggregate${modelName}`)),
- description: `Aggregate ${modelName}s`,
- security: read === true ? [] : undefined,
- });
- }
-
- if (ops['groupBy']) {
- definitions.push({
- method: 'get',
- operation: 'groupBy',
- inputType: this.component(
- `${modelName}GroupByArgs`,
- {
- type: 'object',
- properties: {
- where: this.omittableRef(`${modelName}WhereInput`),
- orderBy: this.omittableRef(orderByWithRelationInput),
- by: this.omittableRef(`${modelName}ScalarFieldEnum`),
- having: this.omittableRef(`${modelName}ScalarWhereWithAggregatesInput`),
- take: { type: 'integer' },
- skip: { type: 'integer' },
- ...this.aggregateFields(model),
- meta: this.ref('_Meta'),
- },
- },
- components
- ),
- outputType: this.response(this.array(this.ref(`${modelName}GroupByOutputType`))),
- description: `Group ${modelName}s by fields`,
- security: read === true ? [] : undefined,
- });
- }
-
- // get meta specified with @@openapi.meta
- const resourceMeta = getModelResourceMeta(zmodel);
-
- for (const { method, operation, description, inputType, outputType, successCode, security } of definitions) {
- const meta = resourceMeta?.[operation];
-
- if (meta?.ignore === true) {
- continue;
- }
-
- const resolvedMethod = meta?.method ?? method;
- let resolvedPath = meta?.path ?? operation;
- if (resolvedPath.startsWith('/')) {
- resolvedPath = resolvedPath.substring(1);
- }
-
- let prefix = this.getOption('prefix', '');
- if (prefix.endsWith('/')) {
- prefix = prefix.substring(0, prefix.length - 1);
- }
-
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const def: OAPI.OperationObject = {
- operationId: `${operation}${modelName}`,
- description: meta?.description ?? description,
- tags: meta?.tags || [lowerCaseFirst(model.name)],
- summary: meta?.summary,
- // security priority: operation-level > model-level > inferred
- security: meta?.security ?? resourceMeta?.security ?? security,
- deprecated: meta?.deprecated,
- responses: {
- [successCode !== undefined ? successCode : '200']: {
- description: 'Successful operation',
- content: {
- 'application/json': {
- schema: outputType,
- },
- },
- },
- '400': {
- content: {
- 'application/json': {
- schema: this.ref('_Error'),
- },
- },
- description: 'Invalid request',
- },
- '403': {
- content: {
- 'application/json': {
- schema: this.ref('_Error'),
- },
- },
- description: 'Request is forbidden',
- },
- '422': {
- content: {
- 'application/json': {
- schema: this.ref('_Error'),
- },
- },
- description: 'Request is unprocessable due to validation errors',
- },
- },
- };
-
- if (inputType) {
- if (['post', 'put', 'patch'].includes(resolvedMethod)) {
- def.requestBody = {
- content: {
- 'application/json': {
- schema: inputType,
- },
- },
- };
- } else {
- def.parameters = [
- {
- name: 'q',
- in: 'query',
- required: true,
- description: 'Superjson-serialized Prisma query object',
- content: {
- 'application/json': {
- schema: inputType,
- },
- },
- },
- {
- name: 'meta',
- in: 'query',
- description: 'Superjson serialization metadata for parameter "q"',
- content: {
- 'application/json': {
- schema: {},
- },
- },
- },
- ] satisfies OAPI.ParameterObject[];
- }
- }
-
- const includeModelNames = this.includedModels.map((d) => d.name);
- if (includeModelNames.includes(model.name)) {
- result[`${prefix}/${lowerCaseFirst(model.name)}/${resolvedPath}`] = {
- [resolvedMethod]: def,
- };
- }
- }
- return result;
- }
-
- private aggregateFields(model: DMMF.Model) {
- const result: Record = {};
- const supportedOps = this.aggregateOperationSupport[model.name];
- const modelName = upperCaseFirst(model.name);
- if (supportedOps) {
- if (supportedOps.count) {
- result._count = this.oneOf({ type: 'boolean' }, this.omittableRef(`${modelName}CountAggregateInput`));
- }
- if (supportedOps.min) {
- result._min = this.omittableRef(`${modelName}MinAggregateInput`);
- }
- if (supportedOps.max) {
- result._max = this.omittableRef(`${modelName}MaxAggregateInput`);
- }
- if (supportedOps.sum) {
- result._sum = this.omittableRef(`${modelName}SumAggregateInput`);
- }
- if (supportedOps.avg) {
- result._avg = this.omittableRef(`${modelName}AvgAggregateInput`);
- }
- }
- return result;
- }
-
- private component(name: string, def: object, components: OAPI.ComponentsObject): object {
- invariant(components.schemas);
- components.schemas[name] = def;
- return this.ref(name);
- }
-
- private generateComponents() {
- const schemas: Record = {};
- const components: OAPI.ComponentsObject = {
- schemas,
- };
-
- if (this.omitInputDetails) {
- // generate a catch-all object type
- schemas[ANY_OBJECT] = {
- type: 'object',
- additionalProperties: true,
- };
- }
-
- // user-defined and built-in enums
- for (const _enum of [...(this.dmmf.schema.enumTypes.model ?? []), ...this.dmmf.schema.enumTypes.prisma]) {
- schemas[upperCaseFirst(_enum.name)] = this.generateEnumComponent(_enum);
- }
-
- // Also add enums from AST that might not be in DMMF (e.g., only used in TypeDefs)
- for (const enumDecl of this.model.declarations.filter(isEnum)) {
- if (!schemas[upperCaseFirst(enumDecl.name)]) {
- schemas[upperCaseFirst(enumDecl.name)] = {
- type: 'string',
- enum: enumDecl.fields.map((f) => f.name),
- };
- }
- }
-
- // data models
- for (const model of this.dmmf.datamodel.models) {
- schemas[upperCaseFirst(model.name)] = this.generateEntityComponent(model);
- }
-
- // type defs
- for (const typeDef of this.model.declarations.filter(isTypeDef)) {
- schemas[upperCaseFirst(typeDef.name)] = this.generateTypeDefComponent(typeDef);
- }
-
- for (const input of this.inputObjectTypes) {
- schemas[upperCaseFirst(input.name)] = this.generateInputComponent(input);
- }
-
- for (const output of this.outputObjectTypes.filter((t) => !['Query', 'Mutation'].includes(t.name))) {
- schemas[upperCaseFirst(output.name)] = this.generateOutputComponent(output);
- }
-
- schemas['_Meta'] = {
- type: 'object',
- description: 'Meta information about the request or response',
- properties: {
- serialization: {
- description: 'Serialization metadata',
- },
- },
- additionalProperties: true,
- };
-
- schemas['_Error'] = {
- type: 'object',
- required: ['error'],
- properties: {
- error: {
- type: 'object',
- required: ['message'],
- properties: {
- prisma: {
- type: 'boolean',
- description: 'Indicates if the error occurred during a Prisma call',
- },
- rejectedByPolicy: {
- type: 'boolean',
- description: 'Indicates if the error was due to rejection by a policy',
- },
- code: {
- type: 'string',
- description: 'Prisma error code. Only available when "prisma" field is true.',
- },
- message: {
- type: 'string',
- description: 'Error message',
- },
- reason: {
- type: 'string',
- description: 'Detailed error reason',
- },
- zodErrors: {
- type: 'object',
- additionalProperties: true,
- description: 'Zod validation errors if the error is due to data validation failure',
- },
- },
- additionalProperties: true,
- },
- },
- };
-
- // misc types
- schemas['BatchPayload'] = {
- type: 'object',
- properties: {
- count: { type: 'integer' },
- },
- };
-
- return components;
- }
-
- private generateEnumComponent(_enum: DMMF.SchemaEnum): OAPI.SchemaObject {
- const schema: OAPI.SchemaObject = {
- type: 'string',
- enum: _enum.values as string[],
- };
- return schema;
- }
-
- private generateEntityComponent(model: DMMF.Model): OAPI.SchemaObject {
- const properties: Record = {};
-
- const required: string[] = [];
- for (const field of model.fields) {
- properties[field.name] = this.generateField(field, model.name);
- if (field.isRequired && !(field.relationName && field.isList)) {
- required.push(field.name);
- }
- }
-
- const result: OAPI.SchemaObject = { type: 'object', properties };
- if (required.length > 0) {
- result.required = required;
- }
- return result;
- }
-
- private generateField(
- def: { kind: DMMF.FieldKind; type: string; isList: boolean; isRequired: boolean; name?: string },
- modelName?: string
- ) {
- // For Json fields, check if there's a corresponding TypeDef in the original model
- if (def.kind === 'scalar' && def.type === 'Json' && modelName && def.name) {
- const dataModel = this.model.declarations.find((d) => isDataModel(d) && d.name === modelName) as DataModel;
- if (dataModel) {
- const field = dataModel.fields.find((f) => f.name === def.name);
- if (field?.type.reference?.ref && isTypeDef(field.type.reference.ref)) {
- // This Json field references a TypeDef
- // Use field.type.array from ZModel AST instead of def.isList from DMMF,
- // since Prisma treats TypeDef fields as plain Json and doesn't know about arrays
- return this.wrapArray(
- this.wrapNullable(this.ref(field.type.reference.ref.name, true), !def.isRequired),
- field.type.array
- );
- }
- }
- }
-
- switch (def.kind) {
- case 'scalar':
- return this.wrapArray(this.prismaTypeToOpenAPIType(def.type, !def.isRequired), def.isList);
-
- case 'enum':
- case 'object':
- return this.wrapArray(this.wrapNullable(this.ref(def.type, false), !def.isRequired), def.isList);
-
- default:
- throw new PluginError(name, `Unsupported field kind: ${def.kind}`);
- }
- }
-
- private generateInputComponent(input: DMMF.InputType): OAPI.SchemaObject {
- const properties: Record = {};
- for (const field of input.fields) {
- const options = field.inputTypes
- .filter(
- (f) =>
- f.type !== 'Null' &&
- // fieldRefTypes refer to other fields in the model and don't need to be generated as part of schema
- f.location !== 'fieldRefTypes'
- )
- .map((f) => {
- return this.wrapArray(this.prismaTypeToOpenAPIType(f.type, false), f.isList);
- });
-
- let prop = options.length > 1 ? { oneOf: options } : options[0];
-
- // if types include 'Null', make it nullable
- prop = this.wrapNullable(
- prop,
- field.inputTypes.some((f) => f.type === 'Null')
- );
-
- properties[field.name] = prop;
- }
-
- const result: OAPI.SchemaObject = { type: 'object', properties };
- this.setInputRequired(input.fields, result);
- return result;
- }
-
- private generateOutputComponent(output: DMMF.OutputType): OAPI.SchemaObject {
- const properties: Record = {};
- for (const field of output.fields) {
- let outputType: OAPI.ReferenceObject | OAPI.SchemaObject;
- switch (field.outputType.location) {
- case 'scalar':
- case 'enumTypes':
- outputType = this.prismaTypeToOpenAPIType(field.outputType.type, !!field.isNullable);
- break;
- case 'outputObjectTypes':
- outputType = this.prismaTypeToOpenAPIType(field.outputType.type, !!field.isNullable);
- break;
- }
- field.outputType;
- properties[field.name] = this.wrapArray(outputType, field.outputType.isList);
- }
-
- const result: OAPI.SchemaObject = { type: 'object', properties };
- this.setOutputRequired(output.fields, result);
- return result;
- }
-
- private generateTypeDefComponent(typeDef: TypeDef): OAPI.SchemaObject {
- const schema: OAPI.SchemaObject = {
- type: 'object',
- description: `The "${typeDef.name}" TypeDef`,
- properties: typeDef.fields.reduce((acc, field) => {
- acc[field.name] = this.generateTypeDefField(field);
- return acc;
- }, {} as Record),
- };
-
- const required = typeDef.fields.filter((f) => !f.type.optional).map((f) => f.name);
- if (required.length > 0) {
- schema.required = required;
- }
-
- return schema;
- }
-
- private generateTypeDefField(field: TypeDefField): OAPI.ReferenceObject | OAPI.SchemaObject {
- return this.wrapArray(
- this.wrapNullable(this.typeDefFieldTypeToOpenAPISchema(field.type), field.type.optional),
- field.type.array
- );
- }
-
- private typeDefFieldTypeToOpenAPISchema(type: TypeDefFieldType): OAPI.ReferenceObject | OAPI.SchemaObject {
- // For references to other types (TypeDef, Enum, Model)
- if (type.reference?.ref) {
- return this.ref(type.reference.ref.name, true);
- }
-
- // For scalar types, reuse the existing mapping logic
- // Note: Json type is handled as empty schema for consistency
- return match(type.type)
- .with('Json', () => ({} as OAPI.SchemaObject))
- .otherwise((t) => {
- // Delegate to prismaTypeToOpenAPIType for all other scalar types
- return this.prismaTypeToOpenAPIType(String(t), false);
- });
- }
-
- private setInputRequired(fields: readonly DMMF.SchemaArg[], result: OAPI.NonArraySchemaObject) {
- const required = fields.filter((f) => f.isRequired).map((f) => f.name);
- if (required.length > 0) {
- result.required = required;
- }
- }
-
- private setOutputRequired(fields: readonly DMMF.SchemaField[], result: OAPI.NonArraySchemaObject) {
- const required = fields.filter((f) => f.isNullable !== true).map((f) => f.name);
- if (required.length > 0) {
- result.required = required;
- }
- }
-
- private prismaTypeToOpenAPIType(type: string, nullable: boolean): OAPI.ReferenceObject | OAPI.SchemaObject {
- const result = match(type)
- .with('String', () => ({ type: 'string' }))
- .with(P.union('Int', 'BigInt'), () => ({ type: 'integer' }))
- .with('Float', () => ({ type: 'number' }))
- .with('Decimal', () => this.oneOf({ type: 'string' }, { type: 'number' }))
- .with(P.union('Boolean', 'True'), () => ({ type: 'boolean' }))
- .with('DateTime', () => ({ type: 'string', format: 'date-time' }))
- .with('Bytes', () => ({ type: 'string', format: 'byte' }))
- .with(P.union('JSON', 'Json'), () => {
- // For Json fields, check if there's a specific TypeDef reference
- // Otherwise, return empty schema for arbitrary JSON
- const isTypeDefType = this.model.declarations.some((d) => isTypeDef(d) && d.name === type);
- return isTypeDefType ? this.ref(type, false) : {};
- })
- .otherwise((type) => this.ref(type.toString(), false));
-
- return this.wrapNullable(result, nullable);
- }
-
- private ref(type: string, rooted = true, description?: string): OAPI.ReferenceObject {
- if (rooted) {
- this.usedComponents.add(type);
- }
- return { $ref: `#/components/schemas/${upperCaseFirst(type)}`, description };
- }
-
- private omittableRef(type: string, rooted = true, description?: string): OAPI.ReferenceObject {
- if (this.omitInputDetails) {
- return this.ref(ANY_OBJECT);
- } else {
- return this.ref(type, rooted, description);
- }
- }
-
- private response(schema: OAPI.SchemaObject): OAPI.SchemaObject {
- return {
- type: 'object',
- required: ['data'],
- properties: {
- data: { ...schema, description: 'The Prisma response data serialized with superjson' },
- meta: this.ref('_Meta', true, 'The superjson serialization metadata for the "data" field'),
- },
- };
- }
-}
diff --git a/packages/plugins/openapi/src/schema.ts b/packages/plugins/openapi/src/schema.ts
deleted file mode 100644
index 777e9ef6d..000000000
--- a/packages/plugins/openapi/src/schema.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import z from 'zod';
-
-/**
- * Zod schema for OpenAPI security schemes: https://swagger.io/docs/specification/authentication/
- */
-export const SecuritySchemesSchema = z.record(
- z.string(),
- z.union([
- z.object({ type: z.literal('http'), scheme: z.literal('basic') }),
- z.object({ type: z.literal('http'), scheme: z.literal('bearer'), bearerFormat: z.string().optional() }),
- z.object({
- type: z.literal('apiKey'),
- in: z.union([z.literal('header'), z.literal('query'), z.literal('cookie')]),
- name: z.string(),
- }),
- z.object({
- type: z.literal('oauth2'),
- description: z.string(),
- flows: z.object({
- authorizationCode: z.object({
- authorizationUrl: z.string(),
- tokenUrl: z.string(),
- refreshUrl: z.string(),
- scopes: z.record(z.string(), z.string()),
- }),
- implicit: z.object({
- authorizationUrl: z.string(),
- refreshUrl: z.string(),
- scopes: z.record(z.string(), z.string()),
- }),
- password: z.object({
- tokenUrl: z.string(),
- refreshUrl: z.string(),
- scopes: z.record(z.string(), z.string()),
- }),
- clientCredentials: z.object({
- tokenUrl: z.string(),
- refreshUrl: z.string(),
- scopes: z.record(z.string(), z.string()),
- }),
- }),
- }),
- ])
-);
diff --git a/packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml
deleted file mode 100644
index b6e0ad750..000000000
--- a/packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml
+++ /dev/null
@@ -1,3267 +0,0 @@
-openapi: 3.0.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: user
- description: User operations
- - name: profile
- description: Profile operations
- - name: post_Item
- description: Post-related operations
- - name: postLike
- description: PostLike operations
-paths:
- /user:
- get:
- operationId: list-User
- description: List "User" resources
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[email]
- required: false
- description: Equality filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$contains]
- required: false
- description: String contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$icontains]
- required: false
- description: String case-insensitive contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$search]
- required: false
- description: String full-text search filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$startsWith]
- required: false
- description: String startsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$endsWith]
- required: false
- description: String endsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[role]
- required: false
- description: Equality filter for "role"
- in: query
- style: form
- explode: false
- schema:
- $ref: '#/components/schemas/role'
- - name: filter[posts]
- required: false
- description: Equality filter for "posts"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- - name: filter[profile]
- required: false
- description: Equality filter for "profile"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-User
- description: Create a "User" resource
- tags:
- - user
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}:
- get:
- operationId: fetch-User
- description: Fetch a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-User-put
- description: Update a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-User-patch
- description: Update a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-User
- description: Delete a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/posts:
- get:
- operationId: fetch-User-related-posts
- description: Fetch the related "posts" resource for "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[email]
- required: false
- description: Equality filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$contains]
- required: false
- description: String contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$icontains]
- required: false
- description: String case-insensitive contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$search]
- required: false
- description: String full-text search filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$startsWith]
- required: false
- description: String startsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$endsWith]
- required: false
- description: String endsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[role]
- required: false
- description: Equality filter for "role"
- in: query
- style: form
- explode: false
- schema:
- $ref: '#/components/schemas/role'
- - name: filter[posts]
- required: false
- description: Equality filter for "posts"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- - name: filter[profile]
- required: false
- description: Equality filter for "profile"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/relationships/posts:
- get:
- operationId: fetch-User-relationship-posts
- description: Fetch the "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[email]
- required: false
- description: Equality filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$contains]
- required: false
- description: String contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$icontains]
- required: false
- description: String case-insensitive contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$search]
- required: false
- description: String full-text search filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$startsWith]
- required: false
- description: String startsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$endsWith]
- required: false
- description: String endsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[role]
- required: false
- description: Equality filter for "role"
- in: query
- style: form
- explode: false
- schema:
- $ref: '#/components/schemas/role'
- - name: filter[posts]
- required: false
- description: Equality filter for "posts"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- - name: filter[profile]
- required: false
- description: Equality filter for "profile"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-User-relationship-posts-put
- description: Update "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-User-relationship-posts-patch
- description: Update "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-User-relationship-posts
- description: Create new "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/profile:
- get:
- operationId: fetch-User-related-profile
- description: Fetch the related "profile" resource for "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/relationships/profile:
- get:
- operationId: fetch-User-relationship-profile
- description: Fetch the "profile" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-User-relationship-profile-put
- description: Update "profile" relationship for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-User-relationship-profile-patch
- description: Update "profile" relationship for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile:
- get:
- operationId: list-Profile
- description: List "Profile" resources
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image]
- required: false
- description: Equality filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$contains]
- required: false
- description: String contains filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$icontains]
- required: false
- description: String case-insensitive contains filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$search]
- required: false
- description: String full-text search filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$startsWith]
- required: false
- description: String startsWith filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$endsWith]
- required: false
- description: String endsWith filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[user]
- required: false
- description: Equality filter for "user"
- in: query
- style: form
- explode: false
- schema:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-Profile
- description: Create a "Profile" resource
- tags:
- - profile
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile/{id}:
- get:
- operationId: fetch-Profile
- description: Fetch a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-Profile-put
- description: Update a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-Profile-patch
- description: Update a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-Profile
- description: Delete a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile/{id}/user:
- get:
- operationId: fetch-Profile-related-user
- description: Fetch the related "user" resource for "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile/{id}/relationships/user:
- get:
- operationId: fetch-Profile-relationship-user
- description: Fetch the "user" relationships for a "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-Profile-relationship-user-put
- description: Update "user" relationship for a "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-Profile-relationship-user-patch
- description: Update "user" relationship for a "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item:
- get:
- operationId: list-post_Item
- description: List "post_Item" resources
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[title]
- required: false
- description: Equality filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$contains]
- required: false
- description: String contains filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$icontains]
- required: false
- description: String case-insensitive contains filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$search]
- required: false
- description: String full-text search filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$startsWith]
- required: false
- description: String startsWith filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$endsWith]
- required: false
- description: String endsWith filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[author]
- required: false
- description: Equality filter for "author"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[published]
- required: false
- description: Equality filter for "published"
- in: query
- style: form
- explode: false
- schema:
- type: boolean
- - name: filter[viewCount]
- required: false
- description: Equality filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$lt]
- required: false
- description: Less-than filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$lte]
- required: false
- description: Less-than or equal filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$gt]
- required: false
- description: Greater-than filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$gte]
- required: false
- description: Greater-than or equal filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[notes]
- required: false
- description: Equality filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$contains]
- required: false
- description: String contains filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$icontains]
- required: false
- description: String case-insensitive contains filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$search]
- required: false
- description: String full-text search filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$startsWith]
- required: false
- description: String startsWith filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$endsWith]
- required: false
- description: String endsWith filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-post_Item
- description: Create a "post_Item" resource
- tags:
- - post_Item
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item/{id}:
- get:
- operationId: fetch-post_Item
- description: Fetch a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-post_Item-put
- description: Update a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-post_Item-patch
- description: Update a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-post_Item
- description: Delete a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item/{id}/author:
- get:
- operationId: fetch-post_Item-related-author
- description: Fetch the related "author" resource for "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item/{id}/relationships/author:
- get:
- operationId: fetch-post_Item-relationship-author
- description: Fetch the "author" relationships for a "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-post_Item-relationship-author-put
- description: Update "author" relationship for a "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-post_Item-relationship-author-patch
- description: Update "author" relationship for a "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike:
- get:
- operationId: list-PostLike
- description: List "PostLike" resources
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[post]
- required: false
- description: Equality filter for "post"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[user]
- required: false
- description: Equality filter for "user"
- in: query
- style: form
- explode: false
- schema:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-PostLike
- description: Create a "PostLike" resource
- tags:
- - postLike
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}:
- get:
- operationId: fetch-PostLike
- description: Fetch a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-PostLike-put
- description: Update a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-PostLike-patch
- description: Update a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-PostLike
- description: Delete a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/post:
- get:
- operationId: fetch-PostLike-related-post
- description: Fetch the related "post" resource for "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/relationships/post:
- get:
- operationId: fetch-PostLike-relationship-post
- description: Fetch the "post" relationships for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-PostLike-relationship-post-put
- description: Update "post" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-PostLike-relationship-post-patch
- description: Update "post" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/user:
- get:
- operationId: fetch-PostLike-related-user
- description: Fetch the related "user" resource for "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/relationships/user:
- get:
- operationId: fetch-PostLike-relationship-user
- description: Fetch the "user" relationships for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-PostLike-relationship-user-put
- description: Update "user" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-PostLike-relationship-user-patch
- description: Update "user" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
-components:
- schemas:
- _jsonapi:
- type: object
- description: An object describing the server’s implementation
- required:
- - version
- properties:
- version:
- type: string
- _meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Superjson serialization metadata
- additionalProperties: true
- _resourceIdentifier:
- type: object
- description: Identifier for a resource
- required:
- - type
- - id
- properties:
- type:
- type: string
- description: Resource type
- id:
- type: string
- description: Resource id
- _resource:
- allOf:
- - $ref: '#/components/schemas/_resourceIdentifier'
- - type: object
- description: A resource with attributes and relationships
- properties:
- attributes:
- type: object
- description: Resource attributes
- relationships:
- type: object
- description: Resource relationships
- _links:
- type: object
- required:
- - self
- description: Links related to the resource
- properties:
- self:
- type: string
- description: Link for refetching the curent results
- _pagination:
- type: object
- description: Pagination information
- required:
- - first
- - last
- - prev
- - next
- properties:
- first:
- type: string
- description: Link to the first page
- nullable: true
- last:
- type: string
- description: Link to the last page
- nullable: true
- prev:
- type: string
- description: Link to the previous page
- nullable: true
- next:
- type: string
- description: Link to the next page
- nullable: true
- _errors:
- type: array
- description: An array of error objects
- items:
- type: object
- required:
- - status
- - code
- properties:
- status:
- type: string
- description: HTTP status
- code:
- type: string
- description: Error code
- prismaCode:
- type: string
- description: Prisma error code if the error is thrown by Prisma
- title:
- type: string
- description: Error title
- detail:
- type: string
- description: Error detail
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- _errorResponse:
- type: object
- required:
- - errors
- description: An error response
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- errors:
- $ref: '#/components/schemas/_errors'
- _relationLinks:
- type: object
- required:
- - self
- - related
- description: Links related to a relationship
- properties:
- self:
- type: string
- description: Link for fetching this relationship
- related:
- type: string
- description: Link for fetching the resource represented by this relationship
- _toOneRelationship:
- type: object
- description: A to-one relationship
- properties:
- data:
- allOf:
- - $ref: '#/components/schemas/_resourceIdentifier'
- nullable: true
- _toOneRelationshipWithLinks:
- type: object
- required:
- - links
- - data
- description: A to-one relationship with links
- properties:
- links:
- $ref: '#/components/schemas/_relationLinks'
- data:
- allOf:
- - $ref: '#/components/schemas/_resourceIdentifier'
- nullable: true
- _toManyRelationship:
- type: object
- required:
- - data
- description: A to-many relationship
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/_resourceIdentifier'
- _toManyRelationshipWithLinks:
- type: object
- required:
- - links
- - data
- description: A to-many relationship with links
- properties:
- links:
- $ref: '#/components/schemas/_pagedRelationLinks'
- data:
- type: array
- items:
- $ref: '#/components/schemas/_resourceIdentifier'
- _pagedRelationLinks:
- description: Relationship links with pagination information
- allOf:
- - $ref: '#/components/schemas/_pagination'
- - $ref: '#/components/schemas/_relationLinks'
- _toManyRelationshipRequest:
- type: object
- required:
- - data
- description: Input for manipulating a to-many relationship
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/_resourceIdentifier'
- _toOneRelationshipRequest:
- description: Input for manipulating a to-one relationship
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/_resourceIdentifier'
- nullable: true
- _toManyRelationshipResponse:
- description: Response for a to-many relationship
- allOf:
- - $ref: '#/components/schemas/_toManyRelationshipWithLinks'
- - type: object
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- _toOneRelationshipResponse:
- description: Response for a to-one relationship
- allOf:
- - $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- - type: object
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- role:
- type: string
- description: The "role" Enum
- enum:
- - USER
- - ADMIN
- User:
- type: object
- description: The "User" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/role'
- required:
- - createdAt
- - updatedAt
- - email
- - role
- relationships:
- type: object
- properties:
- posts:
- $ref: '#/components/schemas/_toManyRelationshipWithLinks'
- profile:
- allOf:
- - $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- nullable: true
- UserCreateRequest:
- type: object
- description: Input for creating a "User"
- required:
- - data
- properties:
- data:
- type: object
- description: The "User" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- attributes:
- type: object
- required:
- - updatedAt
- - email
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/role'
- relationships:
- type: object
- properties:
- posts:
- $ref: '#/components/schemas/_toManyRelationship'
- profile:
- allOf:
- - $ref: '#/components/schemas/_toOneRelationship'
- nullable: true
- meta:
- $ref: '#/components/schemas/_meta'
- UserUpdateRequest:
- type: object
- description: Input for updating a "User"
- required:
- - data
- properties:
- data:
- type: object
- description: The "User" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/role'
- relationships:
- type: object
- properties:
- posts:
- $ref: '#/components/schemas/_toManyRelationship'
- profile:
- allOf:
- - $ref: '#/components/schemas/_toOneRelationship'
- nullable: true
- meta:
- $ref: '#/components/schemas/_meta'
- UserResponse:
- type: object
- description: Response for a "User"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/User'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a1
- posts:
- $ref: '#/components/schemas/_toManyRelationship'
- profile:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- UserListResponse:
- type: object
- description: Response for a list of "User"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/User'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a1
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- Profile:
- type: object
- description: The "Profile" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- image:
- type: string
- nullable: true
- userId:
- type: string
- required:
- - image
- - userId
- relationships:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- ProfileCreateRequest:
- type: object
- description: Input for creating a "Profile"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Profile" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- attributes:
- type: object
- properties:
- image:
- type: string
- nullable: true
- relationships:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- ProfileUpdateRequest:
- type: object
- description: Input for updating a "Profile"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Profile" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- image:
- type: string
- nullable: true
- relationships:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- ProfileResponse:
- type: object
- description: Response for a "Profile"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/Profile'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a2
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- ProfileListResponse:
- type: object
- description: Response for a list of "Profile"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/Profile'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a2
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- post_Item:
- type: object
- description: The "post_Item" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- required:
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- relationships:
- type: object
- properties:
- author:
- allOf:
- - $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- nullable: true
- post_ItemCreateRequest:
- type: object
- description: Input for creating a "post_Item"
- required:
- - data
- properties:
- data:
- type: object
- description: The "post_Item" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- required:
- - updatedAt
- - title
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- relationships:
- type: object
- properties:
- author:
- allOf:
- - $ref: '#/components/schemas/_toOneRelationship'
- nullable: true
- meta:
- $ref: '#/components/schemas/_meta'
- post_ItemUpdateRequest:
- type: object
- description: Input for updating a "post_Item"
- required:
- - data
- properties:
- data:
- type: object
- description: The "post_Item" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- relationships:
- type: object
- properties:
- author:
- allOf:
- - $ref: '#/components/schemas/_toOneRelationship'
- nullable: true
- meta:
- $ref: '#/components/schemas/_meta'
- post_ItemResponse:
- type: object
- description: Response for a "post_Item"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/post_Item'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a3
- author:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- post_ItemListResponse:
- type: object
- description: Response for a list of "post_Item"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/post_Item'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a3
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- PostLike:
- type: object
- description: The "PostLike" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- postId:
- type: string
- userId:
- type: string
- required:
- - postId
- - userId
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- user:
- $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- PostLikeCreateRequest:
- type: object
- description: Input for creating a "PostLike"
- required:
- - data
- properties:
- data:
- type: object
- description: The "PostLike" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- PostLikeUpdateRequest:
- type: object
- description: Input for updating a "PostLike"
- required:
- - data
- properties:
- data:
- type: object
- description: The "PostLike" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- PostLikeResponse:
- type: object
- description: Response for a "PostLike"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/PostLike'
- - type: object
- properties:
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- PostLikeListResponse:
- type: object
- description: Response for a list of "PostLike"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/PostLike'
- - type: object
- properties:
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- parameters:
- id:
- name: id
- in: path
- description: The resource id
- required: true
- schema:
- type: string
- include:
- name: include
- in: query
- description: Relationships to include
- required: false
- style: form
- schema:
- type: string
- sort:
- name: sort
- in: query
- description: Fields to sort by
- required: false
- style: form
- schema:
- type: string
- page-offset:
- name: page[offset]
- in: query
- description: Offset for pagination
- required: false
- style: form
- schema:
- type: integer
- page-limit:
- name: page[limit]
- in: query
- description: Limit for pagination
- required: false
- style: form
- schema:
- type: integer
diff --git a/packages/plugins/openapi/tests/baseline/rest-3.1.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-3.1.0.baseline.yaml
deleted file mode 100644
index 1e331ab8e..000000000
--- a/packages/plugins/openapi/tests/baseline/rest-3.1.0.baseline.yaml
+++ /dev/null
@@ -1,3279 +0,0 @@
-openapi: 3.1.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: user
- description: User operations
- - name: profile
- description: Profile operations
- - name: post_Item
- description: Post-related operations
- - name: postLike
- description: PostLike operations
-paths:
- /user:
- get:
- operationId: list-User
- description: List "User" resources
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[email]
- required: false
- description: Equality filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$contains]
- required: false
- description: String contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$icontains]
- required: false
- description: String case-insensitive contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$search]
- required: false
- description: String full-text search filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$startsWith]
- required: false
- description: String startsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$endsWith]
- required: false
- description: String endsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[role]
- required: false
- description: Equality filter for "role"
- in: query
- style: form
- explode: false
- schema:
- $ref: '#/components/schemas/role'
- - name: filter[posts]
- required: false
- description: Equality filter for "posts"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- - name: filter[profile]
- required: false
- description: Equality filter for "profile"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-User
- description: Create a "User" resource
- tags:
- - user
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}:
- get:
- operationId: fetch-User
- description: Fetch a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-User-put
- description: Update a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-User-patch
- description: Update a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-User
- description: Delete a "User" resource
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/posts:
- get:
- operationId: fetch-User-related-posts
- description: Fetch the related "posts" resource for "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[email]
- required: false
- description: Equality filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$contains]
- required: false
- description: String contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$icontains]
- required: false
- description: String case-insensitive contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$search]
- required: false
- description: String full-text search filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$startsWith]
- required: false
- description: String startsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$endsWith]
- required: false
- description: String endsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[role]
- required: false
- description: Equality filter for "role"
- in: query
- style: form
- explode: false
- schema:
- $ref: '#/components/schemas/role'
- - name: filter[posts]
- required: false
- description: Equality filter for "posts"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- - name: filter[profile]
- required: false
- description: Equality filter for "profile"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/relationships/posts:
- get:
- operationId: fetch-User-relationship-posts
- description: Fetch the "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[email]
- required: false
- description: Equality filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$contains]
- required: false
- description: String contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$icontains]
- required: false
- description: String case-insensitive contains filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$search]
- required: false
- description: String full-text search filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$startsWith]
- required: false
- description: String startsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[email$endsWith]
- required: false
- description: String endsWith filter for "email"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[role]
- required: false
- description: Equality filter for "role"
- in: query
- style: form
- explode: false
- schema:
- $ref: '#/components/schemas/role'
- - name: filter[posts]
- required: false
- description: Equality filter for "posts"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- - name: filter[profile]
- required: false
- description: Equality filter for "profile"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-User-relationship-posts-put
- description: Update "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-User-relationship-posts-patch
- description: Update "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-User-relationship-posts
- description: Create new "posts" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toManyRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/profile:
- get:
- operationId: fetch-User-related-profile
- description: Fetch the related "profile" resource for "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /user/{id}/relationships/profile:
- get:
- operationId: fetch-User-relationship-profile
- description: Fetch the "profile" relationships for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-User-relationship-profile-put
- description: Update "profile" relationship for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-User-relationship-profile-patch
- description: Update "profile" relationship for a "User"
- tags:
- - user
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile:
- get:
- operationId: list-Profile
- description: List "Profile" resources
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image]
- required: false
- description: Equality filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$contains]
- required: false
- description: String contains filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$icontains]
- required: false
- description: String case-insensitive contains filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$search]
- required: false
- description: String full-text search filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$startsWith]
- required: false
- description: String startsWith filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[image$endsWith]
- required: false
- description: String endsWith filter for "image"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[user]
- required: false
- description: Equality filter for "user"
- in: query
- style: form
- explode: false
- schema:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-Profile
- description: Create a "Profile" resource
- tags:
- - profile
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile/{id}:
- get:
- operationId: fetch-Profile
- description: Fetch a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-Profile-put
- description: Update a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-Profile-patch
- description: Update a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/ProfileResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-Profile
- description: Delete a "Profile" resource
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile/{id}/user:
- get:
- operationId: fetch-Profile-related-user
- description: Fetch the related "user" resource for "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /profile/{id}/relationships/user:
- get:
- operationId: fetch-Profile-relationship-user
- description: Fetch the "user" relationships for a "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-Profile-relationship-user-put
- description: Update "user" relationship for a "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-Profile-relationship-user-patch
- description: Update "user" relationship for a "Profile"
- tags:
- - profile
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item:
- get:
- operationId: list-post_Item
- description: List "post_Item" resources
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[createdAt]
- required: false
- description: Equality filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lt]
- required: false
- description: Less-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$lte]
- required: false
- description: Less-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gt]
- required: false
- description: Greater-than filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[createdAt$gte]
- required: false
- description: Greater-than or equal filter for "createdAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt]
- required: false
- description: Equality filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lt]
- required: false
- description: Less-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$lte]
- required: false
- description: Less-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gt]
- required: false
- description: Greater-than filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[updatedAt$gte]
- required: false
- description: Greater-than or equal filter for "updatedAt"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[title]
- required: false
- description: Equality filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$contains]
- required: false
- description: String contains filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$icontains]
- required: false
- description: String case-insensitive contains filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$search]
- required: false
- description: String full-text search filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$startsWith]
- required: false
- description: String startsWith filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[title$endsWith]
- required: false
- description: String endsWith filter for "title"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[author]
- required: false
- description: Equality filter for "author"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[published]
- required: false
- description: Equality filter for "published"
- in: query
- style: form
- explode: false
- schema:
- type: boolean
- - name: filter[viewCount]
- required: false
- description: Equality filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$lt]
- required: false
- description: Less-than filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$lte]
- required: false
- description: Less-than or equal filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$gt]
- required: false
- description: Greater-than filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[viewCount$gte]
- required: false
- description: Greater-than or equal filter for "viewCount"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[notes]
- required: false
- description: Equality filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$contains]
- required: false
- description: String contains filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$icontains]
- required: false
- description: String case-insensitive contains filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$search]
- required: false
- description: String full-text search filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$startsWith]
- required: false
- description: String startsWith filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[notes$endsWith]
- required: false
- description: String endsWith filter for "notes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[likes]
- required: false
- description: Equality filter for "likes"
- in: query
- style: form
- explode: false
- schema:
- type: array
- items:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-post_Item
- description: Create a "post_Item" resource
- tags:
- - post_Item
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item/{id}:
- get:
- operationId: fetch-post_Item
- description: Fetch a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-post_Item-put
- description: Update a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-post_Item-patch
- description: Update a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-post_Item
- description: Delete a "post_Item" resource
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item/{id}/author:
- get:
- operationId: fetch-post_Item-related-author
- description: Fetch the related "author" resource for "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /post_Item/{id}/relationships/author:
- get:
- operationId: fetch-post_Item-relationship-author
- description: Fetch the "author" relationships for a "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-post_Item-relationship-author-put
- description: Update "author" relationship for a "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-post_Item-relationship-author-patch
- description: Update "author" relationship for a "post_Item"
- tags:
- - post_Item
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike:
- get:
- operationId: list-PostLike
- description: List "PostLike" resources
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[post]
- required: false
- description: Equality filter for "post"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[user]
- required: false
- description: Equality filter for "user"
- in: query
- style: form
- explode: false
- schema:
- type: string
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- post:
- operationId: create-PostLike
- description: Create a "PostLike" resource
- tags:
- - postLike
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}:
- get:
- operationId: fetch-PostLike
- description: Fetch a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-PostLike-put
- description: Update a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-PostLike-patch
- description: Update a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/PostLikeResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- delete:
- operationId: delete-PostLike
- description: Delete a "PostLike" resource
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/post:
- get:
- operationId: fetch-PostLike-related-post
- description: Fetch the related "post" resource for "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/post_ItemResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/relationships/post:
- get:
- operationId: fetch-PostLike-relationship-post
- description: Fetch the "post" relationships for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-PostLike-relationship-post-put
- description: Update "post" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-PostLike-relationship-post-patch
- description: Update "post" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/user:
- get:
- operationId: fetch-PostLike-related-user
- description: Fetch the related "user" resource for "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/UserResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- /postLike/{id}/relationships/user:
- get:
- operationId: fetch-PostLike-relationship-user
- description: Fetch the "user" relationships for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- put:
- operationId: update-PostLike-relationship-user-put
- description: Update "user" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- patch:
- operationId: update-PostLike-relationship-user-patch
- description: Update "user" relationship for a "PostLike"
- tags:
- - postLike
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_toOneRelationshipResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
-components:
- schemas:
- _jsonapi:
- type: object
- description: An object describing the server’s implementation
- required:
- - version
- properties:
- version:
- type: string
- _meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Superjson serialization metadata
- additionalProperties: true
- _resourceIdentifier:
- type: object
- description: Identifier for a resource
- required:
- - type
- - id
- properties:
- type:
- type: string
- description: Resource type
- id:
- type: string
- description: Resource id
- _resource:
- allOf:
- - $ref: '#/components/schemas/_resourceIdentifier'
- - type: object
- description: A resource with attributes and relationships
- properties:
- attributes:
- type: object
- description: Resource attributes
- relationships:
- type: object
- description: Resource relationships
- _links:
- type: object
- required:
- - self
- description: Links related to the resource
- properties:
- self:
- type: string
- description: Link for refetching the curent results
- _pagination:
- type: object
- description: Pagination information
- required:
- - first
- - last
- - prev
- - next
- properties:
- first:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the first page
- last:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the last page
- prev:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the previous page
- next:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the next page
- _errors:
- type: array
- description: An array of error objects
- items:
- type: object
- required:
- - status
- - code
- properties:
- status:
- type: string
- description: HTTP status
- code:
- type: string
- description: Error code
- prismaCode:
- type: string
- description: Prisma error code if the error is thrown by Prisma
- title:
- type: string
- description: Error title
- detail:
- type: string
- description: Error detail
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- _errorResponse:
- type: object
- required:
- - errors
- description: An error response
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- errors:
- $ref: '#/components/schemas/_errors'
- _relationLinks:
- type: object
- required:
- - self
- - related
- description: Links related to a relationship
- properties:
- self:
- type: string
- description: Link for fetching this relationship
- related:
- type: string
- description: Link for fetching the resource represented by this relationship
- _toOneRelationship:
- type: object
- description: A to-one relationship
- properties:
- data:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_resourceIdentifier'
- _toOneRelationshipWithLinks:
- type: object
- required:
- - links
- - data
- description: A to-one relationship with links
- properties:
- links:
- $ref: '#/components/schemas/_relationLinks'
- data:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_resourceIdentifier'
- _toManyRelationship:
- type: object
- required:
- - data
- description: A to-many relationship
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/_resourceIdentifier'
- _toManyRelationshipWithLinks:
- type: object
- required:
- - links
- - data
- description: A to-many relationship with links
- properties:
- links:
- $ref: '#/components/schemas/_pagedRelationLinks'
- data:
- type: array
- items:
- $ref: '#/components/schemas/_resourceIdentifier'
- _pagedRelationLinks:
- description: Relationship links with pagination information
- allOf:
- - $ref: '#/components/schemas/_pagination'
- - $ref: '#/components/schemas/_relationLinks'
- _toManyRelationshipRequest:
- type: object
- required:
- - data
- description: Input for manipulating a to-many relationship
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/_resourceIdentifier'
- _toOneRelationshipRequest:
- description: Input for manipulating a to-one relationship
- oneOf:
- - type: 'null'
- - type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/_resourceIdentifier'
- _toManyRelationshipResponse:
- description: Response for a to-many relationship
- allOf:
- - $ref: '#/components/schemas/_toManyRelationshipWithLinks'
- - type: object
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- _toOneRelationshipResponse:
- description: Response for a to-one relationship
- allOf:
- - $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- - type: object
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- role:
- type: string
- description: The "role" Enum
- enum:
- - USER
- - ADMIN
- User:
- type: object
- description: The "User" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/role'
- required:
- - createdAt
- - updatedAt
- - email
- - role
- relationships:
- type: object
- properties:
- posts:
- $ref: '#/components/schemas/_toManyRelationshipWithLinks'
- profile:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- UserCreateRequest:
- type: object
- description: Input for creating a "User"
- required:
- - data
- properties:
- data:
- type: object
- description: The "User" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- attributes:
- type: object
- required:
- - updatedAt
- - email
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/role'
- relationships:
- type: object
- properties:
- posts:
- $ref: '#/components/schemas/_toManyRelationship'
- profile:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- UserUpdateRequest:
- type: object
- description: Input for updating a "User"
- required:
- - data
- properties:
- data:
- type: object
- description: The "User" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/role'
- relationships:
- type: object
- properties:
- posts:
- $ref: '#/components/schemas/_toManyRelationship'
- profile:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- UserResponse:
- type: object
- description: Response for a "User"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/User'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a1
- posts:
- $ref: '#/components/schemas/_toManyRelationship'
- profile:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- UserListResponse:
- type: object
- description: Response for a list of "User"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/User'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a1
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- Profile:
- type: object
- description: The "Profile" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- type: string
- required:
- - image
- - userId
- relationships:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- ProfileCreateRequest:
- type: object
- description: Input for creating a "Profile"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Profile" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- attributes:
- type: object
- properties:
- image:
- oneOf:
- - type: 'null'
- - type: string
- relationships:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- ProfileUpdateRequest:
- type: object
- description: Input for updating a "Profile"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Profile" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- image:
- oneOf:
- - type: 'null'
- - type: string
- relationships:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- ProfileResponse:
- type: object
- description: Response for a "Profile"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/Profile'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a2
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- ProfileListResponse:
- type: object
- description: Response for a list of "Profile"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/Profile'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a2
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- post_Item:
- type: object
- description: The "post_Item" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- required:
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- relationships:
- type: object
- properties:
- author:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- post_ItemCreateRequest:
- type: object
- description: Input for creating a "post_Item"
- required:
- - data
- properties:
- data:
- type: object
- description: The "post_Item" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- required:
- - updatedAt
- - title
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- relationships:
- type: object
- properties:
- author:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- post_ItemUpdateRequest:
- type: object
- description: Input for updating a "post_Item"
- required:
- - data
- properties:
- data:
- type: object
- description: The "post_Item" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- relationships:
- type: object
- properties:
- author:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- post_ItemResponse:
- type: object
- description: Response for a "post_Item"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/post_Item'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a3
- author:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- post_ItemListResponse:
- type: object
- description: Response for a list of "post_Item"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/post_Item'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a3
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- PostLike:
- type: object
- description: The "PostLike" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- postId:
- type: string
- userId:
- type: string
- required:
- - postId
- - userId
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- user:
- $ref: '#/components/schemas/_toOneRelationshipWithLinks'
- PostLikeCreateRequest:
- type: object
- description: Input for creating a "PostLike"
- required:
- - data
- properties:
- data:
- type: object
- description: The "PostLike" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- PostLikeUpdateRequest:
- type: object
- description: Input for updating a "PostLike"
- required:
- - data
- properties:
- data:
- type: object
- description: The "PostLike" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- PostLikeResponse:
- type: object
- description: Response for a "PostLike"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/PostLike'
- - type: object
- properties:
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- PostLikeListResponse:
- type: object
- description: Response for a list of "PostLike"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/PostLike'
- - type: object
- properties:
- relationships:
- type: object
- properties:
- post:
- $ref: '#/components/schemas/_toOneRelationship'
- user:
- $ref: '#/components/schemas/_toOneRelationship'
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- parameters:
- id:
- name: id
- in: path
- description: The resource id
- required: true
- schema:
- type: string
- include:
- name: include
- in: query
- description: Relationships to include
- required: false
- style: form
- schema:
- type: string
- sort:
- name: sort
- in: query
- description: Fields to sort by
- required: false
- style: form
- schema:
- type: string
- page-offset:
- name: page[offset]
- in: query
- description: Offset for pagination
- required: false
- style: form
- schema:
- type: integer
- page-limit:
- name: page[limit]
- in: query
- description: Limit for pagination
- required: false
- style: form
- schema:
- type: integer
diff --git a/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.0.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.0.0.baseline.yaml
deleted file mode 100644
index 71b0b859d..000000000
--- a/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.0.0.baseline.yaml
+++ /dev/null
@@ -1,872 +0,0 @@
-openapi: 3.0.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: foo
- description: Foo operations
-paths:
- /foo:
- get:
- operationId: list-Foo
- description: List "Foo" resources
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string]
- required: false
- description: Equality filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$contains]
- required: false
- description: String contains filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$icontains]
- required: false
- description: String case-insensitive contains filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$search]
- required: false
- description: String full-text search filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$startsWith]
- required: false
- description: String startsWith filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$endsWith]
- required: false
- description: String endsWith filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[int]
- required: false
- description: Equality filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$lt]
- required: false
- description: Less-than filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$lte]
- required: false
- description: Less-than or equal filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$gt]
- required: false
- description: Greater-than filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$gte]
- required: false
- description: Greater-than or equal filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt]
- required: false
- description: Equality filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$lt]
- required: false
- description: Less-than filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$lte]
- required: false
- description: Less-than or equal filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$gt]
- required: false
- description: Greater-than filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$gte]
- required: false
- description: Greater-than or equal filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[date]
- required: false
- description: Equality filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$lt]
- required: false
- description: Less-than filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$lte]
- required: false
- description: Less-than or equal filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$gt]
- required: false
- description: Greater-than filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$gte]
- required: false
- description: Greater-than or equal filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[float]
- required: false
- description: Equality filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$lt]
- required: false
- description: Less-than filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$lte]
- required: false
- description: Less-than or equal filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$gt]
- required: false
- description: Greater-than filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$gte]
- required: false
- description: Greater-than or equal filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[decimal]
- required: false
- description: Equality filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$lt]
- required: false
- description: Less-than filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$lte]
- required: false
- description: Less-than or equal filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$gt]
- required: false
- description: Greater-than filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$gte]
- required: false
- description: Greater-than or equal filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[boolean]
- required: false
- description: Equality filter for "boolean"
- in: query
- style: form
- explode: false
- schema:
- type: boolean
- - name: filter[bytes]
- required: false
- description: Equality filter for "bytes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: byte
- description: Base64 encoded byte array
- - name: filter[json]
- required: false
- description: Equality filter for "json"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: json
- - name: filter[plainJson]
- required: false
- description: Equality filter for "plainJson"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: json
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- post:
- operationId: create-Foo
- description: Create a "Foo" resource
- tags:
- - foo
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- /foo/{id}:
- get:
- operationId: fetch-Foo
- description: Fetch a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- put:
- operationId: update-Foo-put
- description: Update a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- patch:
- operationId: update-Foo-patch
- description: Update a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- delete:
- operationId: delete-Foo
- description: Delete a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
-components:
- schemas:
- _jsonapi:
- type: object
- description: An object describing the server’s implementation
- required:
- - version
- properties:
- version:
- type: string
- _meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Superjson serialization metadata
- additionalProperties: true
- _resourceIdentifier:
- type: object
- description: Identifier for a resource
- required:
- - type
- - id
- properties:
- type:
- type: string
- description: Resource type
- id:
- type: string
- description: Resource id
- _resource:
- allOf:
- - $ref: '#/components/schemas/_resourceIdentifier'
- - type: object
- description: A resource with attributes and relationships
- properties:
- attributes:
- type: object
- description: Resource attributes
- relationships:
- type: object
- description: Resource relationships
- _links:
- type: object
- required:
- - self
- description: Links related to the resource
- properties:
- self:
- type: string
- description: Link for refetching the curent results
- _pagination:
- type: object
- description: Pagination information
- required:
- - first
- - last
- - prev
- - next
- properties:
- first:
- type: string
- description: Link to the first page
- nullable: true
- last:
- type: string
- description: Link to the last page
- nullable: true
- prev:
- type: string
- description: Link to the previous page
- nullable: true
- next:
- type: string
- description: Link to the next page
- nullable: true
- _errors:
- type: array
- description: An array of error objects
- items:
- type: object
- required:
- - status
- - code
- properties:
- status:
- type: string
- description: HTTP status
- code:
- type: string
- description: Error code
- prismaCode:
- type: string
- description: Prisma error code if the error is thrown by Prisma
- title:
- type: string
- description: Error title
- detail:
- type: string
- description: Error detail
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- _errorResponse:
- type: object
- required:
- - errors
- description: An error response
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- errors:
- $ref: '#/components/schemas/_errors'
- Foo:
- type: object
- description: The "Foo" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - json
- - plainJson
- properties:
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: number
- - type: string
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- description: Base64 encoded byte array
- json:
- allOf:
- - $ref: '#/components/schemas/Meta'
- nullable: true
- plainJson: {}
- FooCreateRequest:
- type: object
- description: Input for creating a "Foo"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Foo" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- attributes:
- type: object
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - plainJson
- properties:
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: number
- - type: string
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- description: Base64 encoded byte array
- json:
- allOf:
- - $ref: '#/components/schemas/Meta'
- nullable: true
- plainJson: {}
- meta:
- $ref: '#/components/schemas/_meta'
- FooUpdateRequest:
- type: object
- description: Input for updating a "Foo"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Foo" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: number
- - type: string
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- description: Base64 encoded byte array
- json:
- allOf:
- - $ref: '#/components/schemas/Meta'
- nullable: true
- plainJson: {}
- meta:
- $ref: '#/components/schemas/_meta'
- FooResponse:
- type: object
- description: Response for a "Foo"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/Foo'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a1 {}
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- FooListResponse:
- type: object
- description: Response for a list of "Foo"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/Foo'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a1
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- Meta:
- type: object
- description: The "Meta" TypeDef
- properties:
- something:
- type: string
- parameters:
- id:
- name: id
- in: path
- description: The resource id
- required: true
- schema:
- type: string
- include:
- name: include
- in: query
- description: Relationships to include
- required: false
- style: form
- schema:
- type: string
- sort:
- name: sort
- in: query
- description: Fields to sort by
- required: false
- style: form
- schema:
- type: string
- page-offset:
- name: page[offset]
- in: query
- description: Offset for pagination
- required: false
- style: form
- schema:
- type: integer
- page-limit:
- name: page[limit]
- in: query
- description: Limit for pagination
- required: false
- style: form
- schema:
- type: integer
diff --git a/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.1.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.1.0.baseline.yaml
deleted file mode 100644
index 6d41ebdf6..000000000
--- a/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.1.0.baseline.yaml
+++ /dev/null
@@ -1,876 +0,0 @@
-openapi: 3.1.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: foo
- description: Foo operations
-paths:
- /foo:
- get:
- operationId: list-Foo
- description: List "Foo" resources
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/include'
- - $ref: '#/components/parameters/sort'
- - $ref: '#/components/parameters/page-offset'
- - $ref: '#/components/parameters/page-limit'
- - name: filter[id]
- required: false
- description: Id filter
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string]
- required: false
- description: Equality filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$contains]
- required: false
- description: String contains filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$icontains]
- required: false
- description: String case-insensitive contains filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$search]
- required: false
- description: String full-text search filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$startsWith]
- required: false
- description: String startsWith filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[string$endsWith]
- required: false
- description: String endsWith filter for "string"
- in: query
- style: form
- explode: false
- schema:
- type: string
- - name: filter[int]
- required: false
- description: Equality filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$lt]
- required: false
- description: Less-than filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$lte]
- required: false
- description: Less-than or equal filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$gt]
- required: false
- description: Greater-than filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[int$gte]
- required: false
- description: Greater-than or equal filter for "int"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt]
- required: false
- description: Equality filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$lt]
- required: false
- description: Less-than filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$lte]
- required: false
- description: Less-than or equal filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$gt]
- required: false
- description: Greater-than filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[bigInt$gte]
- required: false
- description: Greater-than or equal filter for "bigInt"
- in: query
- style: form
- explode: false
- schema:
- type: integer
- - name: filter[date]
- required: false
- description: Equality filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$lt]
- required: false
- description: Less-than filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$lte]
- required: false
- description: Less-than or equal filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$gt]
- required: false
- description: Greater-than filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[date$gte]
- required: false
- description: Greater-than or equal filter for "date"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: date-time
- - name: filter[float]
- required: false
- description: Equality filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$lt]
- required: false
- description: Less-than filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$lte]
- required: false
- description: Less-than or equal filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$gt]
- required: false
- description: Greater-than filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[float$gte]
- required: false
- description: Greater-than or equal filter for "float"
- in: query
- style: form
- explode: false
- schema:
- type: number
- - name: filter[decimal]
- required: false
- description: Equality filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$lt]
- required: false
- description: Less-than filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$lte]
- required: false
- description: Less-than or equal filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$gt]
- required: false
- description: Greater-than filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[decimal$gte]
- required: false
- description: Greater-than or equal filter for "decimal"
- in: query
- style: form
- explode: false
- schema:
- oneOf:
- - type: number
- - type: string
- - name: filter[boolean]
- required: false
- description: Equality filter for "boolean"
- in: query
- style: form
- explode: false
- schema:
- type: boolean
- - name: filter[bytes]
- required: false
- description: Equality filter for "bytes"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: byte
- description: Base64 encoded byte array
- - name: filter[json]
- required: false
- description: Equality filter for "json"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: json
- - name: filter[plainJson]
- required: false
- description: Equality filter for "plainJson"
- in: query
- style: form
- explode: false
- schema:
- type: string
- format: json
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooListResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- post:
- operationId: create-Foo
- description: Create a "Foo" resource
- tags:
- - foo
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooCreateRequest'
- responses:
- '201':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- /foo/{id}:
- get:
- operationId: fetch-Foo
- description: Fetch a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- - $ref: '#/components/parameters/include'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- put:
- operationId: update-Foo-put
- description: Update a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- patch:
- operationId: update-Foo-patch
- description: Update a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- requestBody:
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooUpdateRequest'
- responses:
- '200':
- description: Successful operation
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/FooResponse'
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '422':
- description: Request is unprocessable due to validation errors
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
- delete:
- operationId: delete-Foo
- description: Delete a "Foo" resource
- tags:
- - foo
- parameters:
- - $ref: '#/components/parameters/id'
- responses:
- '200':
- description: Successful operation
- '403':
- description: Request is forbidden
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- '404':
- description: Resource is not found
- content:
- application/vnd.api+json:
- schema:
- $ref: '#/components/schemas/_errorResponse'
- security: []
-components:
- schemas:
- _jsonapi:
- type: object
- description: An object describing the server’s implementation
- required:
- - version
- properties:
- version:
- type: string
- _meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Superjson serialization metadata
- additionalProperties: true
- _resourceIdentifier:
- type: object
- description: Identifier for a resource
- required:
- - type
- - id
- properties:
- type:
- type: string
- description: Resource type
- id:
- type: string
- description: Resource id
- _resource:
- allOf:
- - $ref: '#/components/schemas/_resourceIdentifier'
- - type: object
- description: A resource with attributes and relationships
- properties:
- attributes:
- type: object
- description: Resource attributes
- relationships:
- type: object
- description: Resource relationships
- _links:
- type: object
- required:
- - self
- description: Links related to the resource
- properties:
- self:
- type: string
- description: Link for refetching the curent results
- _pagination:
- type: object
- description: Pagination information
- required:
- - first
- - last
- - prev
- - next
- properties:
- first:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the first page
- last:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the last page
- prev:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the previous page
- next:
- oneOf:
- - type: 'null'
- - type: string
- description: Link to the next page
- _errors:
- type: array
- description: An array of error objects
- items:
- type: object
- required:
- - status
- - code
- properties:
- status:
- type: string
- description: HTTP status
- code:
- type: string
- description: Error code
- prismaCode:
- type: string
- description: Prisma error code if the error is thrown by Prisma
- title:
- type: string
- description: Error title
- detail:
- type: string
- description: Error detail
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- _errorResponse:
- type: object
- required:
- - errors
- description: An error response
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- errors:
- $ref: '#/components/schemas/_errors'
- Foo:
- type: object
- description: The "Foo" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - json
- - plainJson
- properties:
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: number
- - type: string
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- description: Base64 encoded byte array
- json:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Meta'
- plainJson: {}
- FooCreateRequest:
- type: object
- description: Input for creating a "Foo"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Foo" model
- required:
- - type
- - attributes
- properties:
- type:
- type: string
- attributes:
- type: object
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - plainJson
- properties:
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: number
- - type: string
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- description: Base64 encoded byte array
- json:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Meta'
- plainJson: {}
- meta:
- $ref: '#/components/schemas/_meta'
- FooUpdateRequest:
- type: object
- description: Input for updating a "Foo"
- required:
- - data
- properties:
- data:
- type: object
- description: The "Foo" model
- required:
- - id
- - type
- - attributes
- properties:
- id:
- type: string
- type:
- type: string
- attributes:
- type: object
- properties:
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: number
- - type: string
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- description: Base64 encoded byte array
- json:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Meta'
- plainJson: {}
- meta:
- $ref: '#/components/schemas/_meta'
- FooResponse:
- type: object
- description: Response for a "Foo"
- required:
- - data
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- allOf:
- - $ref: '#/components/schemas/Foo'
- - type: object
- properties:
- relationships:
- type: object
- properties: &a1 {}
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- $ref: '#/components/schemas/_links'
- FooListResponse:
- type: object
- description: Response for a list of "Foo"
- required:
- - data
- - links
- properties:
- jsonapi:
- $ref: '#/components/schemas/_jsonapi'
- data:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/Foo'
- - type: object
- properties:
- relationships:
- type: object
- properties: *a1
- meta:
- $ref: '#/components/schemas/_meta'
- included:
- type: array
- items:
- $ref: '#/components/schemas/_resource'
- links:
- allOf:
- - $ref: '#/components/schemas/_links'
- - $ref: '#/components/schemas/_pagination'
- Meta:
- type: object
- description: The "Meta" TypeDef
- properties:
- something:
- type: string
- parameters:
- id:
- name: id
- in: path
- description: The resource id
- required: true
- schema:
- type: string
- include:
- name: include
- in: query
- description: Relationships to include
- required: false
- style: form
- schema:
- type: string
- sort:
- name: sort
- in: query
- description: Fields to sort by
- required: false
- style: form
- schema:
- type: string
- page-offset:
- name: page[offset]
- in: query
- description: Offset for pagination
- required: false
- style: form
- schema:
- type: integer
- page-limit:
- name: page[limit]
- in: query
- description: Limit for pagination
- required: false
- style: form
- schema:
- type: integer
diff --git a/packages/plugins/openapi/tests/baseline/rpc-3.0.0-omit.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-3.0.0-omit.baseline.yaml
deleted file mode 100644
index 0a48952db..000000000
--- a/packages/plugins/openapi/tests/baseline/rpc-3.0.0-omit.baseline.yaml
+++ /dev/null
@@ -1,3020 +0,0 @@
-openapi: 3.0.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: user
- description: User operations
- - name: profile
- description: Profile operations
- - name: post_Item
- description: Post-related operations
-components:
- schemas:
- _AnyObject:
- type: object
- additionalProperties: true
- Role:
- type: string
- enum:
- - USER
- - ADMIN
- User:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- type: array
- items:
- $ref: '#/components/schemas/Post_Item'
- profile:
- allOf:
- - $ref: '#/components/schemas/Profile'
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- Profile:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- user:
- $ref: '#/components/schemas/User'
- userId:
- type: string
- required:
- - id
- - user
- - userId
- Post_Item:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- author:
- allOf:
- - $ref: '#/components/schemas/User'
- nullable: true
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- AggregateUser:
- type: object
- properties:
- _count:
- allOf:
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- nullable: true
- UserGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- _count:
- allOf:
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- AggregateProfile:
- type: object
- properties:
- _count:
- allOf:
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- nullable: true
- ProfileGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- userId:
- type: string
- _count:
- allOf:
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- nullable: true
- required:
- - id
- - userId
- AggregatePost_Item:
- type: object
- properties:
- _count:
- allOf:
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- nullable: true
- _avg:
- allOf:
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- nullable: true
- _sum:
- allOf:
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- nullable: true
- Post_ItemGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- _count:
- allOf:
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- nullable: true
- _avg:
- allOf:
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- nullable: true
- _sum:
- allOf:
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- UserCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- email:
- type: integer
- role:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- - _all
- UserMinAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- email:
- type: string
- nullable: true
- role:
- allOf:
- - $ref: '#/components/schemas/Role'
- nullable: true
- UserMaxAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- email:
- type: string
- nullable: true
- role:
- allOf:
- - $ref: '#/components/schemas/Role'
- nullable: true
- ProfileCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- image:
- type: integer
- userId:
- type: integer
- _all:
- type: integer
- required:
- - id
- - image
- - userId
- - _all
- ProfileMinAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- image:
- type: string
- nullable: true
- userId:
- type: string
- nullable: true
- ProfileMaxAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- image:
- type: string
- nullable: true
- userId:
- type: string
- nullable: true
- Post_ItemCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- title:
- type: integer
- authorId:
- type: integer
- published:
- type: integer
- viewCount:
- type: integer
- notes:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- - _all
- Post_ItemAvgAggregateOutputType:
- type: object
- properties:
- viewCount:
- type: number
- nullable: true
- Post_ItemSumAggregateOutputType:
- type: object
- properties:
- viewCount:
- type: integer
- nullable: true
- Post_ItemMinAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- title:
- type: string
- nullable: true
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- nullable: true
- viewCount:
- type: integer
- nullable: true
- notes:
- type: string
- nullable: true
- Post_ItemMaxAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- title:
- type: string
- nullable: true
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- nullable: true
- viewCount:
- type: integer
- nullable: true
- notes:
- type: string
- nullable: true
- _Meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Serialization metadata
- additionalProperties: true
- _Error:
- type: object
- required:
- - error
- properties:
- error:
- type: object
- required:
- - message
- properties:
- prisma:
- type: boolean
- description: Indicates if the error occurred during a Prisma call
- rejectedByPolicy:
- type: boolean
- description: Indicates if the error was due to rejection by a policy
- code:
- type: string
- description: Prisma error code. Only available when "prisma" field is true.
- message:
- type: string
- description: Error message
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- additionalProperties: true
- BatchPayload:
- type: object
- properties:
- count:
- type: integer
- UserCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- UserUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- create:
- $ref: '#/components/schemas/_AnyObject'
- update:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- by:
- $ref: '#/components/schemas/_AnyObject'
- having:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- ProfileUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- create:
- $ref: '#/components/schemas/_AnyObject'
- update:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- by:
- $ref: '#/components/schemas/_AnyObject'
- having:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- create:
- $ref: '#/components/schemas/_AnyObject'
- update:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- by:
- $ref: '#/components/schemas/_AnyObject'
- having:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
-paths:
- /user/create:
- post:
- operationId: createUser
- description: Create a new User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateArgs'
- /user/createMany:
- post:
- operationId: createManyUser
- description: Create several User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateManyArgs'
- /user/findUnique:
- get:
- operationId: findUniqueUser
- description: Find one unique User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findFirst:
- get:
- operationId: findFirstUser
- description: Find the first User matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findMany:
- get:
- operationId: findManyUser
- description: Find users matching the given conditions
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/update:
- patch:
- operationId: updateUser
- description: Update a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateArgs'
- /user/updateMany:
- patch:
- operationId: updateManyUser
- description: Update Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateManyArgs'
- /user/upsert:
- post:
- operationId: upsertUser
- description: Upsert a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpsertArgs'
- /user/dodelete:
- put:
- operationId: deleteUser
- description: Delete a unique user
- tags:
- - delete
- - user
- summary: Delete a user yeah yeah
- deprecated: true
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteUniqueArgs'
- /user/deleteMany:
- delete:
- operationId: deleteManyUser
- description: Delete Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/count:
- get:
- operationId: countUser
- description: Find a list of User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/aggregate:
- get:
- operationId: aggregateUser
- description: Aggregate Users
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateUser'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/groupBy:
- get:
- operationId: groupByUser
- description: Group Users by fields
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/UserGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/create:
- post:
- operationId: createProfile
- description: Create a new Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateArgs'
- /profile/createMany:
- post:
- operationId: createManyProfile
- description: Create several Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateManyArgs'
- /profile/findUnique:
- get:
- operationId: findUniqueProfile
- description: Find one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findFirst:
- get:
- operationId: findFirstProfile
- description: Find the first Profile matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findMany:
- get:
- operationId: findManyProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/update:
- patch:
- operationId: updateProfile
- description: Update a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateArgs'
- /profile/updateMany:
- patch:
- operationId: updateManyProfile
- description: Update Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateManyArgs'
- /profile/upsert:
- post:
- operationId: upsertProfile
- description: Upsert a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpsertArgs'
- /profile/delete:
- delete:
- operationId: deleteProfile
- description: Delete one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/deleteMany:
- delete:
- operationId: deleteManyProfile
- description: Delete Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/count:
- get:
- operationId: countProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/aggregate:
- get:
- operationId: aggregateProfile
- description: Aggregate Profiles
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateProfile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/groupBy:
- get:
- operationId: groupByProfile
- description: Group Profiles by fields
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ProfileGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/create:
- post:
- operationId: createPost_Item
- description: Create a new Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateArgs'
- /post_Item/createMany:
- post:
- operationId: createManyPost_Item
- description: Create several Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateManyArgs'
- /post_Item/findUnique:
- get:
- operationId: findUniquePost_Item
- description: Find one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/findFirst:
- get:
- operationId: findFirstPost_Item
- description: Find the first Post_Item matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/update:
- patch:
- operationId: updatePost_Item
- description: Update a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateArgs'
- /post_Item/updateMany:
- patch:
- operationId: updateManyPost_Item
- description: Update Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateManyArgs'
- /post_Item/upsert:
- post:
- operationId: upsertPost_Item
- description: Upsert a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpsertArgs'
- /post_Item/delete:
- delete:
- operationId: deletePost_Item
- description: Delete one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/deleteMany:
- delete:
- operationId: deleteManyPost_Item
- description: Delete Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/count:
- get:
- operationId: countPost_Item
- description: Find a list of Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/aggregate:
- get:
- operationId: aggregatePost_Item
- description: Aggregate Post_Items
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregatePost_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/groupBy:
- get:
- operationId: groupByPost_Item
- description: Group Post_Items by fields
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
diff --git a/packages/plugins/openapi/tests/baseline/rpc-3.0.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-3.0.0.baseline.yaml
deleted file mode 100644
index b3c4deaa8..000000000
--- a/packages/plugins/openapi/tests/baseline/rpc-3.0.0.baseline.yaml
+++ /dev/null
@@ -1,5789 +0,0 @@
-openapi: 3.0.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: user
- description: User operations
- - name: profile
- description: Profile operations
- - name: post_Item
- description: Post-related operations
-components:
- schemas:
- Role:
- type: string
- enum:
- - USER
- - ADMIN
- UserScalarFieldEnum:
- type: string
- enum:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- ProfileScalarFieldEnum:
- type: string
- enum:
- - id
- - image
- - userId
- Post_ItemScalarFieldEnum:
- type: string
- enum:
- - id
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- SortOrder:
- type: string
- enum:
- - asc
- - desc
- QueryMode:
- type: string
- enum:
- - default
- - insensitive
- NullsOrder:
- type: string
- enum:
- - first
- - last
- User:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- type: array
- items:
- $ref: '#/components/schemas/Post_Item'
- profile:
- allOf:
- - $ref: '#/components/schemas/Profile'
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- Profile:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- user:
- $ref: '#/components/schemas/User'
- userId:
- type: string
- required:
- - id
- - user
- - userId
- Post_Item:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- author:
- allOf:
- - $ref: '#/components/schemas/User'
- nullable: true
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- UserWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- email:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- role:
- oneOf:
- - $ref: '#/components/schemas/EnumroleFilter'
- - $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemListRelationFilter'
- profile:
- oneOf:
- - $ref: '#/components/schemas/ProfileNullableScalarRelationFilter'
- - $ref: '#/components/schemas/ProfileWhereInput'
- nullable: true
- UserOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- createdAt:
- $ref: '#/components/schemas/SortOrder'
- updatedAt:
- $ref: '#/components/schemas/SortOrder'
- email:
- $ref: '#/components/schemas/SortOrder'
- role:
- $ref: '#/components/schemas/SortOrder'
- posts:
- $ref: '#/components/schemas/Post_ItemOrderByRelationAggregateInput'
- profile:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- UserWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- email:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- role:
- oneOf:
- - $ref: '#/components/schemas/EnumroleFilter'
- - $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemListRelationFilter'
- profile:
- oneOf:
- - $ref: '#/components/schemas/ProfileNullableScalarRelationFilter'
- - $ref: '#/components/schemas/ProfileWhereInput'
- nullable: true
- UserScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- email:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- role:
- oneOf:
- - $ref: '#/components/schemas/EnumroleWithAggregatesFilter'
- - $ref: '#/components/schemas/Role'
- ProfileWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- image:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- userId:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- user:
- oneOf:
- - $ref: '#/components/schemas/UserScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- ProfileOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- image:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- userId:
- $ref: '#/components/schemas/SortOrder'
- user:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- ProfileWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- userId:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- image:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- user:
- oneOf:
- - $ref: '#/components/schemas/UserScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- ProfileScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- image:
- oneOf:
- - $ref: '#/components/schemas/StringNullableWithAggregatesFilter'
- - type: string
- nullable: true
- userId:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- Post_ItemWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- author:
- oneOf:
- - $ref: '#/components/schemas/UserNullableScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- nullable: true
- Post_ItemOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- createdAt:
- $ref: '#/components/schemas/SortOrder'
- updatedAt:
- $ref: '#/components/schemas/SortOrder'
- title:
- $ref: '#/components/schemas/SortOrder'
- authorId:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- published:
- $ref: '#/components/schemas/SortOrder'
- viewCount:
- $ref: '#/components/schemas/SortOrder'
- notes:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- author:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- Post_ItemWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- author:
- oneOf:
- - $ref: '#/components/schemas/UserNullableScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- nullable: true
- Post_ItemScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableWithAggregatesFilter'
- - type: string
- nullable: true
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolWithAggregatesFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntWithAggregatesFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableWithAggregatesFilter'
- - type: string
- nullable: true
- UserCreateInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput'
- profile:
- $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput'
- required:
- - email
- UserUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- posts:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput'
- profile:
- $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput'
- UserCreateManyInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- required:
- - email
- UserUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- ProfileCreateInput:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- user:
- $ref: '#/components/schemas/UserCreateNestedOneWithoutProfileInput'
- required:
- - user
- ProfileUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- user:
- $ref: '#/components/schemas/UserUpdateOneRequiredWithoutProfileNestedInput'
- ProfileCreateManyInput:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- userId:
- type: string
- required:
- - userId
- ProfileUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- Post_ItemCreateInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- author:
- $ref: '#/components/schemas/UserCreateNestedOneWithoutPostsInput'
- required:
- - id
- - title
- Post_ItemUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- author:
- $ref: '#/components/schemas/UserUpdateOneWithoutPostsNestedInput'
- Post_ItemCreateManyInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- required:
- - id
- - title
- Post_ItemUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- StringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- DateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- EnumroleFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleFilter'
- Post_ItemListRelationFilter:
- type: object
- properties:
- every:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- some:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- none:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- ProfileNullableScalarRelationFilter:
- type: object
- properties:
- is:
- allOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- nullable: true
- isNot:
- allOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- nullable: true
- Post_ItemOrderByRelationAggregateInput:
- type: object
- properties:
- _count:
- $ref: '#/components/schemas/SortOrder'
- StringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- DateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- EnumroleWithAggregatesFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- _max:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- StringNullableFilter:
- type: object
- properties:
- equals:
- type: string
- nullable: true
- in:
- type: array
- items:
- type: string
- nullable: true
- notIn:
- type: array
- items:
- type: string
- nullable: true
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableFilter'
- nullable: true
- UserScalarRelationFilter:
- type: object
- properties:
- is:
- $ref: '#/components/schemas/UserWhereInput'
- isNot:
- $ref: '#/components/schemas/UserWhereInput'
- SortOrderInput:
- type: object
- properties:
- sort:
- $ref: '#/components/schemas/SortOrder'
- nulls:
- $ref: '#/components/schemas/NullsOrder'
- required:
- - sort
- StringNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- nullable: true
- in:
- type: array
- items:
- type: string
- nullable: true
- notIn:
- type: array
- items:
- type: string
- nullable: true
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter'
- nullable: true
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- BoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- IntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- UserNullableScalarRelationFilter:
- type: object
- properties:
- is:
- allOf:
- - $ref: '#/components/schemas/UserWhereInput'
- nullable: true
- isNot:
- allOf:
- - $ref: '#/components/schemas/UserWhereInput'
- nullable: true
- BoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- IntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- Post_ItemCreateNestedManyWithoutAuthorInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- ProfileCreateNestedOneWithoutUserInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- Post_ItemUncheckedCreateNestedManyWithoutAuthorInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- ProfileUncheckedCreateNestedOneWithoutUserInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- StringFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- DateTimeFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- format: date-time
- EnumroleFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- $ref: '#/components/schemas/Role'
- Post_ItemUpdateManyWithoutAuthorNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- upsert:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- set:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- disconnect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- delete:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- updateMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- deleteMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- ProfileUpdateOneWithoutUserNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- upsert:
- $ref: '#/components/schemas/ProfileUpsertWithoutUserInput'
- disconnect:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- delete:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateToOneWithWhereWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- Post_ItemUncheckedUpdateManyWithoutAuthorNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- upsert:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- set:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- disconnect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- delete:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- updateMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- deleteMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- ProfileUncheckedUpdateOneWithoutUserNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- upsert:
- $ref: '#/components/schemas/ProfileUpsertWithoutUserInput'
- disconnect:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- delete:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateToOneWithWhereWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- UserCreateNestedOneWithoutProfileInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- NullableStringFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- nullable: true
- UserUpdateOneRequiredWithoutProfileNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput'
- upsert:
- $ref: '#/components/schemas/UserUpsertWithoutProfileInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateToOneWithWhereWithoutProfileInput'
- - $ref: '#/components/schemas/UserUpdateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput'
- UserCreateNestedOneWithoutPostsInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- BoolFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: boolean
- IntFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: integer
- increment:
- type: integer
- decrement:
- type: integer
- multiply:
- type: integer
- divide:
- type: integer
- UserUpdateOneWithoutPostsNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput'
- upsert:
- $ref: '#/components/schemas/UserUpsertWithoutPostsInput'
- disconnect:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserWhereInput'
- delete:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserWhereInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateToOneWithWhereWithoutPostsInput'
- - $ref: '#/components/schemas/UserUpdateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput'
- NestedStringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- NestedDateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedEnumroleFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleFilter'
- NestedStringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- NestedIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- NestedDateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedEnumroleWithAggregatesFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- _max:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- NestedStringNullableFilter:
- type: object
- properties:
- equals:
- type: string
- nullable: true
- in:
- type: array
- items:
- type: string
- nullable: true
- notIn:
- type: array
- items:
- type: string
- nullable: true
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableFilter'
- nullable: true
- NestedStringNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- nullable: true
- in:
- type: array
- items:
- type: string
- nullable: true
- notIn:
- type: array
- items:
- type: string
- nullable: true
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter'
- nullable: true
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- NestedIntNullableFilter:
- type: object
- properties:
- equals:
- type: integer
- nullable: true
- in:
- type: array
- items:
- type: integer
- nullable: true
- notIn:
- type: array
- items:
- type: integer
- nullable: true
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntNullableFilter'
- nullable: true
- NestedBoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- NestedBoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- NestedIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- NestedFloatFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatFilter'
- Post_ItemCreateWithoutAuthorInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- required:
- - id
- - title
- Post_ItemUncheckedCreateWithoutAuthorInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- required:
- - id
- - title
- Post_ItemCreateOrConnectWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- required:
- - where
- - create
- Post_ItemCreateManyAuthorInputEnvelope:
- type: object
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateManyAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInput'
- skipDuplicates:
- type: boolean
- required:
- - data
- ProfileCreateWithoutUserInput:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- ProfileUncheckedCreateWithoutUserInput:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- ProfileCreateOrConnectWithoutUserInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- required:
- - where
- - create
- Post_ItemUpsertWithWhereUniqueWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedUpdateWithoutAuthorInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- required:
- - where
- - update
- - create
- Post_ItemUpdateWithWhereUniqueWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedUpdateWithoutAuthorInput'
- required:
- - where
- - data
- Post_ItemUpdateManyWithWhereWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedUpdateManyWithoutAuthorInput'
- required:
- - where
- - data
- Post_ItemScalarWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- nullable: true
- ProfileUpsertWithoutUserInput:
- type: object
- properties:
- update:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- required:
- - update
- - create
- ProfileUpdateToOneWithWhereWithoutUserInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- required:
- - data
- ProfileUpdateWithoutUserInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- ProfileUncheckedUpdateWithoutUserInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- UserCreateWithoutProfileInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput'
- required:
- - email
- UserUncheckedCreateWithoutProfileInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- $ref: "#/components/schemas/Post_ItemUncheckedCreateNestedManyWithoutAuthorInpu\
- t"
- required:
- - email
- UserCreateOrConnectWithoutProfileInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- required:
- - where
- - create
- UserUpsertWithoutProfileInput:
- type: object
- properties:
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- required:
- - update
- - create
- UserUpdateToOneWithWhereWithoutProfileInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput'
- required:
- - data
- UserUpdateWithoutProfileInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- posts:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput'
- UserUncheckedUpdateWithoutProfileInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- posts:
- $ref: "#/components/schemas/Post_ItemUncheckedUpdateManyWithoutAuthorNestedInpu\
- t"
- UserCreateWithoutPostsInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- profile:
- $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput'
- required:
- - email
- UserUncheckedCreateWithoutPostsInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- profile:
- $ref: '#/components/schemas/ProfileUncheckedCreateNestedOneWithoutUserInput'
- required:
- - email
- UserCreateOrConnectWithoutPostsInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- required:
- - where
- - create
- UserUpsertWithoutPostsInput:
- type: object
- properties:
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- required:
- - update
- - create
- UserUpdateToOneWithWhereWithoutPostsInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput'
- required:
- - data
- UserUpdateWithoutPostsInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- profile:
- $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput'
- UserUncheckedUpdateWithoutPostsInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- profile:
- $ref: '#/components/schemas/ProfileUncheckedUpdateOneWithoutUserNestedInput'
- Post_ItemCreateManyAuthorInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- required:
- - id
- - title
- Post_ItemUpdateWithoutAuthorInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- Post_ItemUncheckedUpdateWithoutAuthorInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- Post_ItemUncheckedUpdateManyWithoutAuthorInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- nullable: true
- UserDefaultArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- ProfileDefaultArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- UserInclude:
- type: object
- properties:
- posts:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/Post_ItemFindManyArgs'
- profile:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileDefaultArgs'
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountOutputTypeDefaultArgs'
- ProfileInclude:
- type: object
- properties:
- user:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- Post_ItemInclude:
- type: object
- properties:
- author:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- UserCountOutputTypeSelect:
- type: object
- properties:
- posts:
- type: boolean
- UserCountOutputTypeDefaultArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserCountOutputTypeSelect'
- UserSelect:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- posts:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/Post_ItemFindManyArgs'
- profile:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileDefaultArgs'
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountOutputTypeDefaultArgs'
- ProfileSelect:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- user:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- userId:
- type: boolean
- Post_ItemSelect:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- title:
- type: boolean
- author:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- authorId:
- type: boolean
- published:
- type: boolean
- viewCount:
- type: boolean
- notes:
- type: boolean
- UserCountAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- _all:
- type: boolean
- UserMinAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- UserMaxAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- ProfileCountAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- userId:
- type: boolean
- _all:
- type: boolean
- ProfileMinAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- userId:
- type: boolean
- ProfileMaxAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- userId:
- type: boolean
- AggregateUser:
- type: object
- properties:
- _count:
- allOf:
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- nullable: true
- UserGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- _count:
- allOf:
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- AggregateProfile:
- type: object
- properties:
- _count:
- allOf:
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- nullable: true
- ProfileGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- image:
- type: string
- nullable: true
- userId:
- type: string
- _count:
- allOf:
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- nullable: true
- required:
- - id
- - userId
- AggregatePost_Item:
- type: object
- properties:
- _count:
- allOf:
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- nullable: true
- _avg:
- allOf:
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- nullable: true
- _sum:
- allOf:
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- nullable: true
- Post_ItemGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- type: string
- nullable: true
- _count:
- allOf:
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- nullable: true
- _avg:
- allOf:
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- nullable: true
- _sum:
- allOf:
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- nullable: true
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- UserCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- email:
- type: integer
- role:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- - _all
- UserMinAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- email:
- type: string
- nullable: true
- role:
- allOf:
- - $ref: '#/components/schemas/Role'
- nullable: true
- UserMaxAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- email:
- type: string
- nullable: true
- role:
- allOf:
- - $ref: '#/components/schemas/Role'
- nullable: true
- ProfileCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- image:
- type: integer
- userId:
- type: integer
- _all:
- type: integer
- required:
- - id
- - image
- - userId
- - _all
- ProfileMinAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- image:
- type: string
- nullable: true
- userId:
- type: string
- nullable: true
- ProfileMaxAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- image:
- type: string
- nullable: true
- userId:
- type: string
- nullable: true
- Post_ItemCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- title:
- type: integer
- authorId:
- type: integer
- published:
- type: integer
- viewCount:
- type: integer
- notes:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- - _all
- Post_ItemAvgAggregateOutputType:
- type: object
- properties:
- viewCount:
- type: number
- nullable: true
- Post_ItemSumAggregateOutputType:
- type: object
- properties:
- viewCount:
- type: integer
- nullable: true
- Post_ItemMinAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- title:
- type: string
- nullable: true
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- nullable: true
- viewCount:
- type: integer
- nullable: true
- notes:
- type: string
- nullable: true
- Post_ItemMaxAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- createdAt:
- type: string
- format: date-time
- nullable: true
- updatedAt:
- type: string
- format: date-time
- nullable: true
- title:
- type: string
- nullable: true
- authorId:
- type: string
- nullable: true
- published:
- type: boolean
- nullable: true
- viewCount:
- type: integer
- nullable: true
- notes:
- type: string
- nullable: true
- _Meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Serialization metadata
- additionalProperties: true
- _Error:
- type: object
- required:
- - error
- properties:
- error:
- type: object
- required:
- - message
- properties:
- prisma:
- type: boolean
- description: Indicates if the error occurred during a Prisma call
- rejectedByPolicy:
- type: boolean
- description: Indicates if the error was due to rejection by a policy
- code:
- type: string
- description: Prisma error code. Only available when "prisma" field is true.
- message:
- type: string
- description: Error message
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- additionalProperties: true
- BatchPayload:
- type: object
- properties:
- count:
- type: integer
- UserCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- data:
- $ref: '#/components/schemas/UserCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/UserCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/UserOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- UserUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- data:
- $ref: '#/components/schemas/UserUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- data:
- $ref: '#/components/schemas/UserUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- create:
- $ref: '#/components/schemas/UserCreateInput'
- update:
- $ref: '#/components/schemas/UserUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- orderBy:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountAggregateInput'
- _min:
- $ref: '#/components/schemas/UserMinAggregateInput'
- _max:
- $ref: '#/components/schemas/UserMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- orderBy:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/UserScalarFieldEnum'
- having:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountAggregateInput'
- _min:
- $ref: '#/components/schemas/UserMinAggregateInput'
- _max:
- $ref: '#/components/schemas/UserMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- data:
- $ref: '#/components/schemas/ProfileCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- ProfileUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- data:
- $ref: '#/components/schemas/ProfileUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- data:
- $ref: '#/components/schemas/ProfileUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- create:
- $ref: '#/components/schemas/ProfileCreateInput'
- update:
- $ref: '#/components/schemas/ProfileUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- orderBy:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileCountAggregateInput'
- _min:
- $ref: '#/components/schemas/ProfileMinAggregateInput'
- _max:
- $ref: '#/components/schemas/ProfileMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- orderBy:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/ProfileScalarFieldEnum'
- having:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileCountAggregateInput'
- _min:
- $ref: '#/components/schemas/ProfileMinAggregateInput'
- _max:
- $ref: '#/components/schemas/ProfileMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- data:
- $ref: '#/components/schemas/Post_ItemCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- Post_ItemUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- data:
- $ref: '#/components/schemas/Post_ItemUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- data:
- $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- create:
- $ref: '#/components/schemas/Post_ItemCreateInput'
- update:
- $ref: '#/components/schemas/Post_ItemUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- orderBy:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- orderBy:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/Post_ItemScalarFieldEnum'
- having:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
-paths:
- /user/create:
- post:
- operationId: createUser
- description: Create a new User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateArgs'
- /user/createMany:
- post:
- operationId: createManyUser
- description: Create several User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateManyArgs'
- /user/findUnique:
- get:
- operationId: findUniqueUser
- description: Find one unique User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findFirst:
- get:
- operationId: findFirstUser
- description: Find the first User matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findMany:
- get:
- operationId: findManyUser
- description: Find users matching the given conditions
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/update:
- patch:
- operationId: updateUser
- description: Update a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateArgs'
- /user/updateMany:
- patch:
- operationId: updateManyUser
- description: Update Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateManyArgs'
- /user/upsert:
- post:
- operationId: upsertUser
- description: Upsert a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpsertArgs'
- /user/dodelete:
- put:
- operationId: deleteUser
- description: Delete a unique user
- tags:
- - delete
- - user
- summary: Delete a user yeah yeah
- deprecated: true
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteUniqueArgs'
- /user/deleteMany:
- delete:
- operationId: deleteManyUser
- description: Delete Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/count:
- get:
- operationId: countUser
- description: Find a list of User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/aggregate:
- get:
- operationId: aggregateUser
- description: Aggregate Users
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateUser'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/groupBy:
- get:
- operationId: groupByUser
- description: Group Users by fields
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/UserGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/create:
- post:
- operationId: createProfile
- description: Create a new Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateArgs'
- /profile/createMany:
- post:
- operationId: createManyProfile
- description: Create several Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateManyArgs'
- /profile/findUnique:
- get:
- operationId: findUniqueProfile
- description: Find one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findFirst:
- get:
- operationId: findFirstProfile
- description: Find the first Profile matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findMany:
- get:
- operationId: findManyProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/update:
- patch:
- operationId: updateProfile
- description: Update a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateArgs'
- /profile/updateMany:
- patch:
- operationId: updateManyProfile
- description: Update Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateManyArgs'
- /profile/upsert:
- post:
- operationId: upsertProfile
- description: Upsert a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpsertArgs'
- /profile/delete:
- delete:
- operationId: deleteProfile
- description: Delete one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/deleteMany:
- delete:
- operationId: deleteManyProfile
- description: Delete Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/count:
- get:
- operationId: countProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/aggregate:
- get:
- operationId: aggregateProfile
- description: Aggregate Profiles
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateProfile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/groupBy:
- get:
- operationId: groupByProfile
- description: Group Profiles by fields
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ProfileGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/create:
- post:
- operationId: createPost_Item
- description: Create a new Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateArgs'
- /post_Item/createMany:
- post:
- operationId: createManyPost_Item
- description: Create several Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateManyArgs'
- /post_Item/findUnique:
- get:
- operationId: findUniquePost_Item
- description: Find one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/findFirst:
- get:
- operationId: findFirstPost_Item
- description: Find the first Post_Item matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/update:
- patch:
- operationId: updatePost_Item
- description: Update a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateArgs'
- /post_Item/updateMany:
- patch:
- operationId: updateManyPost_Item
- description: Update Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateManyArgs'
- /post_Item/upsert:
- post:
- operationId: upsertPost_Item
- description: Upsert a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpsertArgs'
- /post_Item/delete:
- delete:
- operationId: deletePost_Item
- description: Delete one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/deleteMany:
- delete:
- operationId: deleteManyPost_Item
- description: Delete Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/count:
- get:
- operationId: countPost_Item
- description: Find a list of Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/aggregate:
- get:
- operationId: aggregatePost_Item
- description: Aggregate Post_Items
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregatePost_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/groupBy:
- get:
- operationId: groupByPost_Item
- description: Group Post_Items by fields
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
diff --git a/packages/plugins/openapi/tests/baseline/rpc-3.1.0-omit.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-3.1.0-omit.baseline.yaml
deleted file mode 100644
index 11369e7d0..000000000
--- a/packages/plugins/openapi/tests/baseline/rpc-3.1.0-omit.baseline.yaml
+++ /dev/null
@@ -1,3058 +0,0 @@
-openapi: 3.1.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: user
- description: User operations
- - name: profile
- description: Profile operations
- - name: post_Item
- description: Post-related operations
-components:
- schemas:
- _AnyObject:
- type: object
- additionalProperties: true
- Role:
- type: string
- enum:
- - USER
- - ADMIN
- User:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- type: array
- items:
- $ref: '#/components/schemas/Post_Item'
- profile:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Profile'
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- Profile:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- user:
- $ref: '#/components/schemas/User'
- userId:
- type: string
- required:
- - id
- - user
- - userId
- Post_Item:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- author:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/User'
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- AggregateUser:
- type: object
- properties:
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- UserGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- AggregateProfile:
- type: object
- properties:
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- ProfileGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- type: string
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- required:
- - id
- - userId
- AggregatePost_Item:
- type: object
- properties:
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- _avg:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- _sum:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- Post_ItemGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- _avg:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- _sum:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- UserCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- email:
- type: integer
- role:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- - _all
- UserMinAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- email:
- oneOf:
- - type: 'null'
- - type: string
- role:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Role'
- UserMaxAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- email:
- oneOf:
- - type: 'null'
- - type: string
- role:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Role'
- ProfileCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- image:
- type: integer
- userId:
- type: integer
- _all:
- type: integer
- required:
- - id
- - image
- - userId
- - _all
- ProfileMinAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- oneOf:
- - type: 'null'
- - type: string
- ProfileMaxAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- oneOf:
- - type: 'null'
- - type: string
- Post_ItemCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- title:
- type: integer
- authorId:
- type: integer
- published:
- type: integer
- viewCount:
- type: integer
- notes:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- - _all
- Post_ItemAvgAggregateOutputType:
- type: object
- properties:
- viewCount:
- oneOf:
- - type: 'null'
- - type: number
- Post_ItemSumAggregateOutputType:
- type: object
- properties:
- viewCount:
- oneOf:
- - type: 'null'
- - type: integer
- Post_ItemMinAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- title:
- oneOf:
- - type: 'null'
- - type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- oneOf:
- - type: 'null'
- - type: boolean
- viewCount:
- oneOf:
- - type: 'null'
- - type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- Post_ItemMaxAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- title:
- oneOf:
- - type: 'null'
- - type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- oneOf:
- - type: 'null'
- - type: boolean
- viewCount:
- oneOf:
- - type: 'null'
- - type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- _Meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Serialization metadata
- additionalProperties: true
- _Error:
- type: object
- required:
- - error
- properties:
- error:
- type: object
- required:
- - message
- properties:
- prisma:
- type: boolean
- description: Indicates if the error occurred during a Prisma call
- rejectedByPolicy:
- type: boolean
- description: Indicates if the error was due to rejection by a policy
- code:
- type: string
- description: Prisma error code. Only available when "prisma" field is true.
- message:
- type: string
- description: Error message
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- additionalProperties: true
- BatchPayload:
- type: object
- properties:
- count:
- type: integer
- UserCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- UserUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- create:
- $ref: '#/components/schemas/_AnyObject'
- update:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- by:
- $ref: '#/components/schemas/_AnyObject'
- having:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- ProfileUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- create:
- $ref: '#/components/schemas/_AnyObject'
- update:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- by:
- $ref: '#/components/schemas/_AnyObject'
- having:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/_AnyObject'
- _min:
- $ref: '#/components/schemas/_AnyObject'
- _max:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/_AnyObject'
- - type: array
- items:
- $ref: '#/components/schemas/_AnyObject'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- data:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- create:
- $ref: '#/components/schemas/_AnyObject'
- update:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- include:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/_AnyObject'
- where:
- $ref: '#/components/schemas/_AnyObject'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- cursor:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/_AnyObject'
- orderBy:
- $ref: '#/components/schemas/_AnyObject'
- by:
- $ref: '#/components/schemas/_AnyObject'
- having:
- $ref: '#/components/schemas/_AnyObject'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
-paths:
- /user/create:
- post:
- operationId: createUser
- description: Create a new User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateArgs'
- /user/createMany:
- post:
- operationId: createManyUser
- description: Create several User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateManyArgs'
- /user/findUnique:
- get:
- operationId: findUniqueUser
- description: Find one unique User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findFirst:
- get:
- operationId: findFirstUser
- description: Find the first User matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findMany:
- get:
- operationId: findManyUser
- description: Find users matching the given conditions
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/update:
- patch:
- operationId: updateUser
- description: Update a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateArgs'
- /user/updateMany:
- patch:
- operationId: updateManyUser
- description: Update Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateManyArgs'
- /user/upsert:
- post:
- operationId: upsertUser
- description: Upsert a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpsertArgs'
- /user/dodelete:
- put:
- operationId: deleteUser
- description: Delete a unique user
- tags:
- - delete
- - user
- summary: Delete a user yeah yeah
- deprecated: true
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteUniqueArgs'
- /user/deleteMany:
- delete:
- operationId: deleteManyUser
- description: Delete Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/count:
- get:
- operationId: countUser
- description: Find a list of User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/aggregate:
- get:
- operationId: aggregateUser
- description: Aggregate Users
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateUser'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/groupBy:
- get:
- operationId: groupByUser
- description: Group Users by fields
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/UserGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/create:
- post:
- operationId: createProfile
- description: Create a new Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateArgs'
- /profile/createMany:
- post:
- operationId: createManyProfile
- description: Create several Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateManyArgs'
- /profile/findUnique:
- get:
- operationId: findUniqueProfile
- description: Find one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findFirst:
- get:
- operationId: findFirstProfile
- description: Find the first Profile matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findMany:
- get:
- operationId: findManyProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/update:
- patch:
- operationId: updateProfile
- description: Update a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateArgs'
- /profile/updateMany:
- patch:
- operationId: updateManyProfile
- description: Update Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateManyArgs'
- /profile/upsert:
- post:
- operationId: upsertProfile
- description: Upsert a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpsertArgs'
- /profile/delete:
- delete:
- operationId: deleteProfile
- description: Delete one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/deleteMany:
- delete:
- operationId: deleteManyProfile
- description: Delete Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/count:
- get:
- operationId: countProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/aggregate:
- get:
- operationId: aggregateProfile
- description: Aggregate Profiles
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateProfile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/groupBy:
- get:
- operationId: groupByProfile
- description: Group Profiles by fields
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ProfileGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/create:
- post:
- operationId: createPost_Item
- description: Create a new Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateArgs'
- /post_Item/createMany:
- post:
- operationId: createManyPost_Item
- description: Create several Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateManyArgs'
- /post_Item/findUnique:
- get:
- operationId: findUniquePost_Item
- description: Find one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/findFirst:
- get:
- operationId: findFirstPost_Item
- description: Find the first Post_Item matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/update:
- patch:
- operationId: updatePost_Item
- description: Update a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateArgs'
- /post_Item/updateMany:
- patch:
- operationId: updateManyPost_Item
- description: Update Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateManyArgs'
- /post_Item/upsert:
- post:
- operationId: upsertPost_Item
- description: Upsert a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpsertArgs'
- /post_Item/delete:
- delete:
- operationId: deletePost_Item
- description: Delete one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/deleteMany:
- delete:
- operationId: deleteManyPost_Item
- description: Delete Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/count:
- get:
- operationId: countPost_Item
- description: Find a list of Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/aggregate:
- get:
- operationId: aggregatePost_Item
- description: Aggregate Post_Items
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregatePost_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/groupBy:
- get:
- operationId: groupByPost_Item
- description: Group Post_Items by fields
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
diff --git a/packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml
deleted file mode 100644
index 5c5103e09..000000000
--- a/packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml
+++ /dev/null
@@ -1,5853 +0,0 @@
-openapi: 3.1.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: user
- description: User operations
- - name: profile
- description: Profile operations
- - name: post_Item
- description: Post-related operations
-components:
- schemas:
- Role:
- type: string
- enum:
- - USER
- - ADMIN
- UserScalarFieldEnum:
- type: string
- enum:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- ProfileScalarFieldEnum:
- type: string
- enum:
- - id
- - image
- - userId
- Post_ItemScalarFieldEnum:
- type: string
- enum:
- - id
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- SortOrder:
- type: string
- enum:
- - asc
- - desc
- QueryMode:
- type: string
- enum:
- - default
- - insensitive
- NullsOrder:
- type: string
- enum:
- - first
- - last
- User:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- type: array
- items:
- $ref: '#/components/schemas/Post_Item'
- profile:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Profile'
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- Profile:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- user:
- $ref: '#/components/schemas/User'
- userId:
- type: string
- required:
- - id
- - user
- - userId
- Post_Item:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- author:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/User'
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- UserWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- email:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- role:
- oneOf:
- - $ref: '#/components/schemas/EnumroleFilter'
- - $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemListRelationFilter'
- profile:
- oneOf:
- - $ref: '#/components/schemas/ProfileNullableScalarRelationFilter'
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: 'null'
- UserOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- createdAt:
- $ref: '#/components/schemas/SortOrder'
- updatedAt:
- $ref: '#/components/schemas/SortOrder'
- email:
- $ref: '#/components/schemas/SortOrder'
- role:
- $ref: '#/components/schemas/SortOrder'
- posts:
- $ref: '#/components/schemas/Post_ItemOrderByRelationAggregateInput'
- profile:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- UserWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- email:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/UserWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserWhereInput'
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- role:
- oneOf:
- - $ref: '#/components/schemas/EnumroleFilter'
- - $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemListRelationFilter'
- profile:
- oneOf:
- - $ref: '#/components/schemas/ProfileNullableScalarRelationFilter'
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: 'null'
- UserScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- email:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- role:
- oneOf:
- - $ref: '#/components/schemas/EnumroleWithAggregatesFilter'
- - $ref: '#/components/schemas/Role'
- ProfileWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- image:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- userId:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- user:
- oneOf:
- - $ref: '#/components/schemas/UserScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- ProfileOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- image:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- userId:
- $ref: '#/components/schemas/SortOrder'
- user:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- ProfileWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- userId:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/ProfileWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileWhereInput'
- image:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- user:
- oneOf:
- - $ref: '#/components/schemas/UserScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- ProfileScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- image:
- oneOf:
- - $ref: '#/components/schemas/StringNullableWithAggregatesFilter'
- - type: string
- - type: 'null'
- userId:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- Post_ItemWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- author:
- oneOf:
- - $ref: '#/components/schemas/UserNullableScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- - type: 'null'
- Post_ItemOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- createdAt:
- $ref: '#/components/schemas/SortOrder'
- updatedAt:
- $ref: '#/components/schemas/SortOrder'
- title:
- $ref: '#/components/schemas/SortOrder'
- authorId:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- published:
- $ref: '#/components/schemas/SortOrder'
- viewCount:
- $ref: '#/components/schemas/SortOrder'
- notes:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- author:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- Post_ItemWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- author:
- oneOf:
- - $ref: '#/components/schemas/UserNullableScalarRelationFilter'
- - $ref: '#/components/schemas/UserWhereInput'
- - type: 'null'
- Post_ItemScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableWithAggregatesFilter'
- - type: string
- - type: 'null'
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolWithAggregatesFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntWithAggregatesFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableWithAggregatesFilter'
- - type: string
- - type: 'null'
- UserCreateInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput'
- profile:
- $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput'
- required:
- - email
- UserUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- posts:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput'
- profile:
- $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput'
- UserCreateManyInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- required:
- - email
- UserUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- ProfileCreateInput:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- user:
- $ref: '#/components/schemas/UserCreateNestedOneWithoutProfileInput'
- required:
- - user
- ProfileUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- user:
- $ref: '#/components/schemas/UserUpdateOneRequiredWithoutProfileNestedInput'
- ProfileCreateManyInput:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- type: string
- required:
- - userId
- ProfileUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- Post_ItemCreateInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- author:
- $ref: '#/components/schemas/UserCreateNestedOneWithoutPostsInput'
- required:
- - id
- - title
- Post_ItemUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- author:
- $ref: '#/components/schemas/UserUpdateOneWithoutPostsNestedInput'
- Post_ItemCreateManyInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- required:
- - id
- - title
- Post_ItemUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- StringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- DateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- EnumroleFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleFilter'
- Post_ItemListRelationFilter:
- type: object
- properties:
- every:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- some:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- none:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- ProfileNullableScalarRelationFilter:
- type: object
- properties:
- is:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileWhereInput'
- isNot:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileWhereInput'
- Post_ItemOrderByRelationAggregateInput:
- type: object
- properties:
- _count:
- $ref: '#/components/schemas/SortOrder'
- StringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- DateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- EnumroleWithAggregatesFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- _max:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- StringNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableFilter'
- - type: 'null'
- UserScalarRelationFilter:
- type: object
- properties:
- is:
- $ref: '#/components/schemas/UserWhereInput'
- isNot:
- $ref: '#/components/schemas/UserWhereInput'
- SortOrderInput:
- type: object
- properties:
- sort:
- $ref: '#/components/schemas/SortOrder'
- nulls:
- $ref: '#/components/schemas/NullsOrder'
- required:
- - sort
- StringNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter'
- - type: 'null'
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- BoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- IntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- UserNullableScalarRelationFilter:
- type: object
- properties:
- is:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserWhereInput'
- isNot:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserWhereInput'
- BoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- IntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- Post_ItemCreateNestedManyWithoutAuthorInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- ProfileCreateNestedOneWithoutUserInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- Post_ItemUncheckedCreateNestedManyWithoutAuthorInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- ProfileUncheckedCreateNestedOneWithoutUserInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- StringFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- DateTimeFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- format: date-time
- EnumroleFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- $ref: '#/components/schemas/Role'
- Post_ItemUpdateManyWithoutAuthorNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- upsert:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- set:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- disconnect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- delete:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- updateMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- deleteMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- ProfileUpdateOneWithoutUserNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- upsert:
- $ref: '#/components/schemas/ProfileUpsertWithoutUserInput'
- disconnect:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- delete:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateToOneWithWhereWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- Post_ItemUncheckedUpdateManyWithoutAuthorNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- connectOrCreate:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput'
- upsert:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput'
- createMany:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope'
- set:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- disconnect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- delete:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- connect:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput'
- updateMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput'
- deleteMany:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- ProfileUncheckedUpdateOneWithoutUserNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- connectOrCreate:
- $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput'
- upsert:
- $ref: '#/components/schemas/ProfileUpsertWithoutUserInput'
- disconnect:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- delete:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileWhereInput'
- connect:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateToOneWithWhereWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- UserCreateNestedOneWithoutProfileInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- NullableStringFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- oneOf:
- - type: 'null'
- - type: string
- UserUpdateOneRequiredWithoutProfileNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput'
- upsert:
- $ref: '#/components/schemas/UserUpsertWithoutProfileInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateToOneWithWhereWithoutProfileInput'
- - $ref: '#/components/schemas/UserUpdateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput'
- UserCreateNestedOneWithoutPostsInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- BoolFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: boolean
- IntFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: integer
- increment:
- type: integer
- decrement:
- type: integer
- multiply:
- type: integer
- divide:
- type: integer
- UserUpdateOneWithoutPostsNestedInput:
- type: object
- properties:
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- connectOrCreate:
- $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput'
- upsert:
- $ref: '#/components/schemas/UserUpsertWithoutPostsInput'
- disconnect:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserWhereInput'
- delete:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserWhereInput'
- connect:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateToOneWithWhereWithoutPostsInput'
- - $ref: '#/components/schemas/UserUpdateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput'
- NestedStringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- NestedDateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedEnumroleFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleFilter'
- NestedStringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- NestedIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- NestedDateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedEnumroleWithAggregatesFilter:
- type: object
- properties:
- equals:
- $ref: '#/components/schemas/Role'
- in:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- notIn:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- not:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/NestedEnumroleWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- _max:
- $ref: '#/components/schemas/NestedEnumroleFilter'
- NestedStringNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableFilter'
- - type: 'null'
- NestedStringNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter'
- - type: 'null'
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedStringNullableFilter'
- NestedIntNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: integer
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: integer
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntNullableFilter'
- - type: 'null'
- NestedBoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- NestedBoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- NestedIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- NestedFloatFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatFilter'
- Post_ItemCreateWithoutAuthorInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- required:
- - id
- - title
- Post_ItemUncheckedCreateWithoutAuthorInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- required:
- - id
- - title
- Post_ItemCreateOrConnectWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- required:
- - where
- - create
- Post_ItemCreateManyAuthorInputEnvelope:
- type: object
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateManyAuthorInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateManyAuthorInput'
- skipDuplicates:
- type: boolean
- required:
- - data
- ProfileCreateWithoutUserInput:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- ProfileUncheckedCreateWithoutUserInput:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- ProfileCreateOrConnectWithoutUserInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- required:
- - where
- - create
- Post_ItemUpsertWithWhereUniqueWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- update:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedUpdateWithoutAuthorInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput'
- required:
- - where
- - update
- - create
- Post_ItemUpdateWithWhereUniqueWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateWithoutAuthorInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedUpdateWithoutAuthorInput'
- required:
- - where
- - data
- Post_ItemUpdateManyWithWhereWithoutAuthorInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput'
- - $ref: '#/components/schemas/Post_ItemUncheckedUpdateManyWithoutAuthorInput'
- required:
- - where
- - data
- Post_ItemScalarWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemScalarWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- createdAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- title:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- authorId:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- published:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- viewCount:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- notes:
- oneOf:
- - $ref: '#/components/schemas/StringNullableFilter'
- - type: string
- - type: 'null'
- ProfileUpsertWithoutUserInput:
- type: object
- properties:
- update:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- required:
- - update
- - create
- ProfileUpdateToOneWithWhereWithoutUserInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput'
- - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput'
- required:
- - data
- ProfileUpdateWithoutUserInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- ProfileUncheckedUpdateWithoutUserInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- image:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- UserCreateWithoutProfileInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput'
- required:
- - email
- UserUncheckedCreateWithoutProfileInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- posts:
- $ref: "#/components/schemas/Post_ItemUncheckedCreateNestedManyWithoutAuthorInpu\
- t"
- required:
- - email
- UserCreateOrConnectWithoutProfileInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- required:
- - where
- - create
- UserUpsertWithoutProfileInput:
- type: object
- properties:
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- required:
- - update
- - create
- UserUpdateToOneWithWhereWithoutProfileInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutProfileInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput'
- required:
- - data
- UserUpdateWithoutProfileInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- posts:
- $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput'
- UserUncheckedUpdateWithoutProfileInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- posts:
- $ref: "#/components/schemas/Post_ItemUncheckedUpdateManyWithoutAuthorNestedInpu\
- t"
- UserCreateWithoutPostsInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- profile:
- $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput'
- required:
- - email
- UserUncheckedCreateWithoutPostsInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- profile:
- $ref: '#/components/schemas/ProfileUncheckedCreateNestedOneWithoutUserInput'
- required:
- - email
- UserCreateOrConnectWithoutPostsInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- required:
- - where
- - create
- UserUpsertWithoutPostsInput:
- type: object
- properties:
- update:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput'
- create:
- oneOf:
- - $ref: '#/components/schemas/UserCreateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- required:
- - update
- - create
- UserUpdateToOneWithWhereWithoutPostsInput:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- data:
- oneOf:
- - $ref: '#/components/schemas/UserUpdateWithoutPostsInput'
- - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput'
- required:
- - data
- UserUpdateWithoutPostsInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- profile:
- $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput'
- UserUncheckedUpdateWithoutPostsInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- email:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- role:
- oneOf:
- - $ref: '#/components/schemas/Role'
- - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput'
- profile:
- $ref: '#/components/schemas/ProfileUncheckedUpdateOneWithoutUserNestedInput'
- Post_ItemCreateManyAuthorInput:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- required:
- - id
- - title
- Post_ItemUpdateWithoutAuthorInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- Post_ItemUncheckedUpdateWithoutAuthorInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- Post_ItemUncheckedUpdateManyWithoutAuthorInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- createdAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- updatedAt:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- title:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- published:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- viewCount:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- notes:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput'
- - type: 'null'
- UserDefaultArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- ProfileDefaultArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- UserInclude:
- type: object
- properties:
- posts:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/Post_ItemFindManyArgs'
- profile:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileDefaultArgs'
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountOutputTypeDefaultArgs'
- ProfileInclude:
- type: object
- properties:
- user:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- Post_ItemInclude:
- type: object
- properties:
- author:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- UserCountOutputTypeSelect:
- type: object
- properties:
- posts:
- type: boolean
- UserCountOutputTypeDefaultArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserCountOutputTypeSelect'
- UserSelect:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- posts:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/Post_ItemFindManyArgs'
- profile:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileDefaultArgs'
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountOutputTypeDefaultArgs'
- ProfileSelect:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- user:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- userId:
- type: boolean
- Post_ItemSelect:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- title:
- type: boolean
- author:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserDefaultArgs'
- authorId:
- type: boolean
- published:
- type: boolean
- viewCount:
- type: boolean
- notes:
- type: boolean
- UserCountAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- _all:
- type: boolean
- UserMinAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- UserMaxAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- createdAt:
- type: boolean
- updatedAt:
- type: boolean
- email:
- type: boolean
- role:
- type: boolean
- ProfileCountAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- userId:
- type: boolean
- _all:
- type: boolean
- ProfileMinAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- userId:
- type: boolean
- ProfileMaxAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- image:
- type: boolean
- userId:
- type: boolean
- AggregateUser:
- type: object
- properties:
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- UserGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- email:
- type: string
- role:
- $ref: '#/components/schemas/Role'
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/UserMaxAggregateOutputType'
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- AggregateProfile:
- type: object
- properties:
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- ProfileGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- type: string
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/ProfileMaxAggregateOutputType'
- required:
- - id
- - userId
- AggregatePost_Item:
- type: object
- properties:
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- _avg:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- _sum:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- Post_ItemGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- createdAt:
- type: string
- format: date-time
- updatedAt:
- type: string
- format: date-time
- title:
- type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- type: boolean
- viewCount:
- type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- _avg:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType'
- _sum:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType'
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - published
- - viewCount
- UserCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- email:
- type: integer
- role:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - email
- - role
- - _all
- UserMinAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- email:
- oneOf:
- - type: 'null'
- - type: string
- role:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Role'
- UserMaxAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- email:
- oneOf:
- - type: 'null'
- - type: string
- role:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Role'
- ProfileCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- image:
- type: integer
- userId:
- type: integer
- _all:
- type: integer
- required:
- - id
- - image
- - userId
- - _all
- ProfileMinAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- oneOf:
- - type: 'null'
- - type: string
- ProfileMaxAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- image:
- oneOf:
- - type: 'null'
- - type: string
- userId:
- oneOf:
- - type: 'null'
- - type: string
- Post_ItemCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- createdAt:
- type: integer
- updatedAt:
- type: integer
- title:
- type: integer
- authorId:
- type: integer
- published:
- type: integer
- viewCount:
- type: integer
- notes:
- type: integer
- _all:
- type: integer
- required:
- - id
- - createdAt
- - updatedAt
- - title
- - authorId
- - published
- - viewCount
- - notes
- - _all
- Post_ItemAvgAggregateOutputType:
- type: object
- properties:
- viewCount:
- oneOf:
- - type: 'null'
- - type: number
- Post_ItemSumAggregateOutputType:
- type: object
- properties:
- viewCount:
- oneOf:
- - type: 'null'
- - type: integer
- Post_ItemMinAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- title:
- oneOf:
- - type: 'null'
- - type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- oneOf:
- - type: 'null'
- - type: boolean
- viewCount:
- oneOf:
- - type: 'null'
- - type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- Post_ItemMaxAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- createdAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- updatedAt:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- title:
- oneOf:
- - type: 'null'
- - type: string
- authorId:
- oneOf:
- - type: 'null'
- - type: string
- published:
- oneOf:
- - type: 'null'
- - type: boolean
- viewCount:
- oneOf:
- - type: 'null'
- - type: integer
- notes:
- oneOf:
- - type: 'null'
- - type: string
- _Meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Serialization metadata
- additionalProperties: true
- _Error:
- type: object
- required:
- - error
- properties:
- error:
- type: object
- required:
- - message
- properties:
- prisma:
- type: boolean
- description: Indicates if the error occurred during a Prisma call
- rejectedByPolicy:
- type: boolean
- description: Indicates if the error was due to rejection by a policy
- code:
- type: string
- description: Prisma error code. Only available when "prisma" field is true.
- message:
- type: string
- description: Error message
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- additionalProperties: true
- BatchPayload:
- type: object
- properties:
- count:
- type: integer
- UserCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- data:
- $ref: '#/components/schemas/UserCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/UserCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/UserOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- UserUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- data:
- $ref: '#/components/schemas/UserUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- data:
- $ref: '#/components/schemas/UserUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- create:
- $ref: '#/components/schemas/UserCreateInput'
- update:
- $ref: '#/components/schemas/UserUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- include:
- $ref: '#/components/schemas/UserInclude'
- where:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/UserSelect'
- where:
- $ref: '#/components/schemas/UserWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- orderBy:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/UserWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountAggregateInput'
- _min:
- $ref: '#/components/schemas/UserMinAggregateInput'
- _max:
- $ref: '#/components/schemas/UserMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- UserGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/UserWhereInput'
- orderBy:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/UserScalarFieldEnum'
- having:
- $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/UserCountAggregateInput'
- _min:
- $ref: '#/components/schemas/UserMinAggregateInput'
- _max:
- $ref: '#/components/schemas/UserMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- data:
- $ref: '#/components/schemas/ProfileCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/ProfileCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- ProfileUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- data:
- $ref: '#/components/schemas/ProfileUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- data:
- $ref: '#/components/schemas/ProfileUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- create:
- $ref: '#/components/schemas/ProfileCreateInput'
- update:
- $ref: '#/components/schemas/ProfileUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- include:
- $ref: '#/components/schemas/ProfileInclude'
- where:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/ProfileSelect'
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- orderBy:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/ProfileWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileCountAggregateInput'
- _min:
- $ref: '#/components/schemas/ProfileMinAggregateInput'
- _max:
- $ref: '#/components/schemas/ProfileMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- ProfileGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/ProfileWhereInput'
- orderBy:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/ProfileScalarFieldEnum'
- having:
- $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/ProfileCountAggregateInput'
- _min:
- $ref: '#/components/schemas/ProfileMinAggregateInput'
- _max:
- $ref: '#/components/schemas/ProfileMaxAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- data:
- $ref: '#/components/schemas/Post_ItemCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- Post_ItemUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- data:
- $ref: '#/components/schemas/Post_ItemUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- data:
- $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- create:
- $ref: '#/components/schemas/Post_ItemCreateInput'
- update:
- $ref: '#/components/schemas/Post_ItemUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- include:
- $ref: '#/components/schemas/Post_ItemInclude'
- where:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/Post_ItemSelect'
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- orderBy:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/Post_ItemWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
- Post_ItemGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/Post_ItemWhereInput'
- orderBy:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/Post_ItemScalarFieldEnum'
- having:
- $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
-paths:
- /user/create:
- post:
- operationId: createUser
- description: Create a new User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateArgs'
- /user/createMany:
- post:
- operationId: createManyUser
- description: Create several User
- tags:
- - user
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCreateManyArgs'
- /user/findUnique:
- get:
- operationId: findUniqueUser
- description: Find one unique User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findFirst:
- get:
- operationId: findFirstUser
- description: Find the first User matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/findMany:
- get:
- operationId: findManyUser
- description: Find users matching the given conditions
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/update:
- patch:
- operationId: updateUser
- description: Update a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateArgs'
- /user/updateMany:
- patch:
- operationId: updateManyUser
- description: Update Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpdateManyArgs'
- /user/upsert:
- post:
- operationId: upsertUser
- description: Upsert a User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserUpsertArgs'
- /user/dodelete:
- put:
- operationId: deleteUser
- description: Delete a unique user
- tags:
- - delete
- - user
- summary: Delete a user yeah yeah
- deprecated: true
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/User'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteUniqueArgs'
- /user/deleteMany:
- delete:
- operationId: deleteManyUser
- description: Delete Users matching the given condition
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/count:
- get:
- operationId: countUser
- description: Find a list of User
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/UserCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/aggregate:
- get:
- operationId: aggregateUser
- description: Aggregate Users
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateUser'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /user/groupBy:
- get:
- operationId: groupByUser
- description: Group Users by fields
- tags:
- - user
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/UserGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UserGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/create:
- post:
- operationId: createProfile
- description: Create a new Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateArgs'
- /profile/createMany:
- post:
- operationId: createManyProfile
- description: Create several Profile
- tags:
- - profile
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCreateManyArgs'
- /profile/findUnique:
- get:
- operationId: findUniqueProfile
- description: Find one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findFirst:
- get:
- operationId: findFirstProfile
- description: Find the first Profile matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/findMany:
- get:
- operationId: findManyProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/update:
- patch:
- operationId: updateProfile
- description: Update a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateArgs'
- /profile/updateMany:
- patch:
- operationId: updateManyProfile
- description: Update Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpdateManyArgs'
- /profile/upsert:
- post:
- operationId: upsertProfile
- description: Upsert a Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileUpsertArgs'
- /profile/delete:
- delete:
- operationId: deleteProfile
- description: Delete one unique Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Profile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/deleteMany:
- delete:
- operationId: deleteManyProfile
- description: Delete Profiles matching the given condition
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/count:
- get:
- operationId: countProfile
- description: Find a list of Profile
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/ProfileCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/aggregate:
- get:
- operationId: aggregateProfile
- description: Aggregate Profiles
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateProfile'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /profile/groupBy:
- get:
- operationId: groupByProfile
- description: Group Profiles by fields
- tags:
- - profile
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ProfileGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProfileGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/create:
- post:
- operationId: createPost_Item
- description: Create a new Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateArgs'
- /post_Item/createMany:
- post:
- operationId: createManyPost_Item
- description: Create several Post_Item
- tags:
- - post_Item
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCreateManyArgs'
- /post_Item/findUnique:
- get:
- operationId: findUniquePost_Item
- description: Find one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/findFirst:
- get:
- operationId: findFirstPost_Item
- description: Find the first Post_Item matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/update:
- patch:
- operationId: updatePost_Item
- description: Update a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateArgs'
- /post_Item/updateMany:
- patch:
- operationId: updateManyPost_Item
- description: Update Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpdateManyArgs'
- /post_Item/upsert:
- post:
- operationId: upsertPost_Item
- description: Upsert a Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemUpsertArgs'
- /post_Item/delete:
- delete:
- operationId: deletePost_Item
- description: Delete one unique Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Post_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/deleteMany:
- delete:
- operationId: deleteManyPost_Item
- description: Delete Post_Items matching the given condition
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/count:
- get:
- operationId: countPost_Item
- description: Find a list of Post_Item
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/aggregate:
- get:
- operationId: aggregatePost_Item
- description: Aggregate Post_Items
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregatePost_Item'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /post_Item/groupBy:
- get:
- operationId: groupByPost_Item
- description: Group Post_Items by fields
- tags:
- - post_Item
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Post_ItemGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Post_ItemGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
diff --git a/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.0.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.0.0.baseline.yaml
deleted file mode 100644
index eaea71827..000000000
--- a/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.0.0.baseline.yaml
+++ /dev/null
@@ -1,3094 +0,0 @@
-openapi: 3.0.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: foo
- description: Foo operations
-components:
- schemas:
- FooScalarFieldEnum:
- type: string
- enum:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - json
- - plainJson
- SortOrder:
- type: string
- enum:
- - asc
- - desc
- NullableJsonNullValueInput:
- type: string
- enum:
- - DbNull
- - JsonNull
- JsonNullValueInput:
- type: string
- enum:
- - JsonNull
- QueryMode:
- type: string
- enum:
- - default
- - insensitive
- JsonNullValueFilter:
- type: string
- enum:
- - DbNull
- - JsonNull
- - AnyNull
- NullsOrder:
- type: string
- enum:
- - first
- - last
- Foo:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- nullable: true
- json:
- allOf:
- - $ref: '#/components/schemas/Meta'
- nullable: true
- plainJson: {}
- required:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- Meta:
- type: object
- description: The "Meta" TypeDef
- properties:
- something:
- type: string
- required:
- - something
- FooWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- string:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- int:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- bigInt:
- oneOf:
- - $ref: '#/components/schemas/BigIntFilter'
- - type: integer
- date:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- float:
- oneOf:
- - $ref: '#/components/schemas/FloatFilter'
- - type: number
- decimal:
- oneOf:
- - $ref: '#/components/schemas/DecimalFilter'
- - oneOf:
- - type: string
- - type: number
- boolean:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- bytes:
- oneOf:
- - $ref: '#/components/schemas/BytesNullableFilter'
- - type: string
- format: byte
- nullable: true
- json:
- $ref: '#/components/schemas/JsonNullableFilter'
- plainJson:
- $ref: '#/components/schemas/JsonFilter'
- FooOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- string:
- $ref: '#/components/schemas/SortOrder'
- int:
- $ref: '#/components/schemas/SortOrder'
- bigInt:
- $ref: '#/components/schemas/SortOrder'
- date:
- $ref: '#/components/schemas/SortOrder'
- float:
- $ref: '#/components/schemas/SortOrder'
- decimal:
- $ref: '#/components/schemas/SortOrder'
- boolean:
- $ref: '#/components/schemas/SortOrder'
- bytes:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- json:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- plainJson:
- $ref: '#/components/schemas/SortOrder'
- FooWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- string:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- int:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- bigInt:
- oneOf:
- - $ref: '#/components/schemas/BigIntFilter'
- - type: integer
- date:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- float:
- oneOf:
- - $ref: '#/components/schemas/FloatFilter'
- - type: number
- decimal:
- oneOf:
- - $ref: '#/components/schemas/DecimalFilter'
- - oneOf:
- - type: string
- - type: number
- boolean:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- bytes:
- oneOf:
- - $ref: '#/components/schemas/BytesNullableFilter'
- - type: string
- format: byte
- nullable: true
- json:
- $ref: '#/components/schemas/JsonNullableFilter'
- plainJson:
- $ref: '#/components/schemas/JsonFilter'
- FooScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- string:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- int:
- oneOf:
- - $ref: '#/components/schemas/IntWithAggregatesFilter'
- - type: integer
- bigInt:
- oneOf:
- - $ref: '#/components/schemas/BigIntWithAggregatesFilter'
- - type: integer
- date:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- float:
- oneOf:
- - $ref: '#/components/schemas/FloatWithAggregatesFilter'
- - type: number
- decimal:
- oneOf:
- - $ref: '#/components/schemas/DecimalWithAggregatesFilter'
- - oneOf:
- - type: string
- - type: number
- boolean:
- oneOf:
- - $ref: '#/components/schemas/BoolWithAggregatesFilter'
- - type: boolean
- bytes:
- oneOf:
- - $ref: '#/components/schemas/BytesNullableWithAggregatesFilter'
- - type: string
- format: byte
- nullable: true
- json:
- $ref: '#/components/schemas/JsonNullableWithAggregatesFilter'
- plainJson:
- $ref: '#/components/schemas/JsonWithAggregatesFilter'
- FooCreateInput:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- nullable: true
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- FooUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- string:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- int:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- bigInt:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/BigIntFieldUpdateOperationsInput'
- date:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- float:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/FloatFieldUpdateOperationsInput'
- decimal:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/DecimalFieldUpdateOperationsInput'
- boolean:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- bytes:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput'
- nullable: true
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- FooCreateManyInput:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- nullable: true
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- FooUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- string:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- int:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- bigInt:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/BigIntFieldUpdateOperationsInput'
- date:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- float:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/FloatFieldUpdateOperationsInput'
- decimal:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/DecimalFieldUpdateOperationsInput'
- boolean:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- bytes:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput'
- nullable: true
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- StringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- IntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- BigIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntFilter'
- DateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- FloatFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatFilter'
- DecimalFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalFilter'
- BoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- BytesNullableFilter:
- type: object
- properties:
- equals:
- type: string
- format: byte
- nullable: true
- in:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- notIn:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableFilter'
- nullable: true
- JsonNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- nullable: true
- array_ends_with:
- nullable: true
- array_contains:
- nullable: true
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- JsonFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- nullable: true
- array_ends_with:
- nullable: true
- array_contains:
- nullable: true
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- SortOrderInput:
- type: object
- properties:
- sort:
- $ref: '#/components/schemas/SortOrder'
- nulls:
- $ref: '#/components/schemas/NullsOrder'
- required:
- - sort
- StringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- IntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- BigIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _max:
- $ref: '#/components/schemas/NestedBigIntFilter'
- DateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- FloatWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedFloatFilter'
- _min:
- $ref: '#/components/schemas/NestedFloatFilter'
- _max:
- $ref: '#/components/schemas/NestedFloatFilter'
- DecimalWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _sum:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _min:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _max:
- $ref: '#/components/schemas/NestedDecimalFilter'
- BoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- BytesNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: byte
- nullable: true
- in:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- notIn:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter'
- nullable: true
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- JsonNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- nullable: true
- array_ends_with:
- nullable: true
- array_contains:
- nullable: true
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedJsonNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedJsonNullableFilter'
- JsonWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- nullable: true
- array_ends_with:
- nullable: true
- array_contains:
- nullable: true
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedJsonFilter'
- _max:
- $ref: '#/components/schemas/NestedJsonFilter'
- StringFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- IntFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: integer
- increment:
- type: integer
- decrement:
- type: integer
- multiply:
- type: integer
- divide:
- type: integer
- BigIntFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: integer
- increment:
- type: integer
- decrement:
- type: integer
- multiply:
- type: integer
- divide:
- type: integer
- DateTimeFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- format: date-time
- FloatFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: number
- increment:
- type: number
- decrement:
- type: number
- multiply:
- type: number
- divide:
- type: number
- DecimalFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- oneOf:
- - type: string
- - type: number
- increment:
- oneOf:
- - type: string
- - type: number
- decrement:
- oneOf:
- - type: string
- - type: number
- multiply:
- oneOf:
- - type: string
- - type: number
- divide:
- oneOf:
- - type: string
- - type: number
- BoolFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: boolean
- NullableBytesFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- format: byte
- nullable: true
- NestedStringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- NestedIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- NestedBigIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntFilter'
- NestedDateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedFloatFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatFilter'
- NestedDecimalFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalFilter'
- NestedBoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- NestedBytesNullableFilter:
- type: object
- properties:
- equals:
- type: string
- format: byte
- nullable: true
- in:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- notIn:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableFilter'
- nullable: true
- NestedStringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- NestedIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- NestedBigIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _max:
- $ref: '#/components/schemas/NestedBigIntFilter'
- NestedDateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedFloatWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedFloatFilter'
- _min:
- $ref: '#/components/schemas/NestedFloatFilter'
- _max:
- $ref: '#/components/schemas/NestedFloatFilter'
- NestedDecimalWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _sum:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _min:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _max:
- $ref: '#/components/schemas/NestedDecimalFilter'
- NestedBoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- NestedBytesNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: byte
- nullable: true
- in:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- notIn:
- type: array
- items:
- type: string
- format: byte
- nullable: true
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter'
- nullable: true
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- NestedIntNullableFilter:
- type: object
- properties:
- equals:
- type: integer
- nullable: true
- in:
- type: array
- items:
- type: integer
- nullable: true
- notIn:
- type: array
- items:
- type: integer
- nullable: true
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntNullableFilter'
- nullable: true
- NestedJsonNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- nullable: true
- array_ends_with:
- nullable: true
- array_contains:
- nullable: true
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- NestedJsonFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- nullable: true
- array_ends_with:
- nullable: true
- array_contains:
- nullable: true
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- FooSelect:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- json:
- type: boolean
- plainJson:
- type: boolean
- FooCountAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- json:
- type: boolean
- plainJson:
- type: boolean
- _all:
- type: boolean
- FooAvgAggregateInput:
- type: object
- properties:
- int:
- type: boolean
- bigInt:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- FooSumAggregateInput:
- type: object
- properties:
- int:
- type: boolean
- bigInt:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- FooMinAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- FooMaxAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- AggregateFoo:
- type: object
- properties:
- _count:
- allOf:
- - $ref: '#/components/schemas/FooCountAggregateOutputType'
- nullable: true
- _avg:
- allOf:
- - $ref: '#/components/schemas/FooAvgAggregateOutputType'
- nullable: true
- _sum:
- allOf:
- - $ref: '#/components/schemas/FooSumAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/FooMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/FooMaxAggregateOutputType'
- nullable: true
- FooGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- type: string
- format: byte
- nullable: true
- json:
- nullable: true
- plainJson: {}
- _count:
- allOf:
- - $ref: '#/components/schemas/FooCountAggregateOutputType'
- nullable: true
- _avg:
- allOf:
- - $ref: '#/components/schemas/FooAvgAggregateOutputType'
- nullable: true
- _sum:
- allOf:
- - $ref: '#/components/schemas/FooSumAggregateOutputType'
- nullable: true
- _min:
- allOf:
- - $ref: '#/components/schemas/FooMinAggregateOutputType'
- nullable: true
- _max:
- allOf:
- - $ref: '#/components/schemas/FooMaxAggregateOutputType'
- nullable: true
- required:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- FooCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- string:
- type: integer
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: integer
- float:
- type: integer
- decimal:
- type: integer
- boolean:
- type: integer
- bytes:
- type: integer
- json:
- type: integer
- plainJson:
- type: integer
- _all:
- type: integer
- required:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - json
- - plainJson
- - _all
- FooAvgAggregateOutputType:
- type: object
- properties:
- int:
- type: number
- nullable: true
- bigInt:
- type: number
- nullable: true
- float:
- type: number
- nullable: true
- decimal:
- oneOf:
- - type: string
- - type: number
- nullable: true
- FooSumAggregateOutputType:
- type: object
- properties:
- int:
- type: integer
- nullable: true
- bigInt:
- type: integer
- nullable: true
- float:
- type: number
- nullable: true
- decimal:
- oneOf:
- - type: string
- - type: number
- nullable: true
- FooMinAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- string:
- type: string
- nullable: true
- int:
- type: integer
- nullable: true
- bigInt:
- type: integer
- nullable: true
- date:
- type: string
- format: date-time
- nullable: true
- float:
- type: number
- nullable: true
- decimal:
- oneOf:
- - type: string
- - type: number
- nullable: true
- boolean:
- type: boolean
- nullable: true
- bytes:
- type: string
- format: byte
- nullable: true
- FooMaxAggregateOutputType:
- type: object
- properties:
- id:
- type: string
- nullable: true
- string:
- type: string
- nullable: true
- int:
- type: integer
- nullable: true
- bigInt:
- type: integer
- nullable: true
- date:
- type: string
- format: date-time
- nullable: true
- float:
- type: number
- nullable: true
- decimal:
- oneOf:
- - type: string
- - type: number
- nullable: true
- boolean:
- type: boolean
- nullable: true
- bytes:
- type: string
- format: byte
- nullable: true
- _Meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Serialization metadata
- additionalProperties: true
- _Error:
- type: object
- required:
- - error
- properties:
- error:
- type: object
- required:
- - message
- properties:
- prisma:
- type: boolean
- description: Indicates if the error occurred during a Prisma call
- rejectedByPolicy:
- type: boolean
- description: Indicates if the error was due to rejection by a policy
- code:
- type: string
- description: Prisma error code. Only available when "prisma" field is true.
- message:
- type: string
- description: Error message
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- additionalProperties: true
- BatchPayload:
- type: object
- properties:
- count:
- type: integer
- FooCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- data:
- $ref: '#/components/schemas/FooCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/FooCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- FooFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereInput'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/FooOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
- FooUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- data:
- $ref: '#/components/schemas/FooUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- data:
- $ref: '#/components/schemas/FooUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- create:
- $ref: '#/components/schemas/FooCreateInput'
- update:
- $ref: '#/components/schemas/FooUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- orderBy:
- $ref: '#/components/schemas/FooOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/FooCountAggregateInput'
- _min:
- $ref: '#/components/schemas/FooMinAggregateInput'
- _max:
- $ref: '#/components/schemas/FooMaxAggregateInput'
- _sum:
- $ref: '#/components/schemas/FooSumAggregateInput'
- _avg:
- $ref: '#/components/schemas/FooAvgAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- orderBy:
- $ref: '#/components/schemas/FooOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/FooScalarFieldEnum'
- having:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/FooCountAggregateInput'
- _min:
- $ref: '#/components/schemas/FooMinAggregateInput'
- _max:
- $ref: '#/components/schemas/FooMaxAggregateInput'
- _sum:
- $ref: '#/components/schemas/FooSumAggregateInput'
- _avg:
- $ref: '#/components/schemas/FooAvgAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
-paths:
- /foo/create:
- post:
- operationId: createFoo
- description: Create a new Foo
- tags:
- - foo
- security: []
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooCreateArgs'
- /foo/createMany:
- post:
- operationId: createManyFoo
- description: Create several Foo
- tags:
- - foo
- security: []
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooCreateManyArgs'
- /foo/findUnique:
- get:
- operationId: findUniqueFoo
- description: Find one unique Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/findFirst:
- get:
- operationId: findFirstFoo
- description: Find the first Foo matching the given condition
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/findMany:
- get:
- operationId: findManyFoo
- description: Find a list of Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/update:
- patch:
- operationId: updateFoo
- description: Update a Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooUpdateArgs'
- /foo/updateMany:
- patch:
- operationId: updateManyFoo
- description: Update Foos matching the given condition
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooUpdateManyArgs'
- /foo/upsert:
- post:
- operationId: upsertFoo
- description: Upsert a Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooUpsertArgs'
- /foo/delete:
- delete:
- operationId: deleteFoo
- description: Delete one unique Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/deleteMany:
- delete:
- operationId: deleteManyFoo
- description: Delete Foos matching the given condition
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/count:
- get:
- operationId: countFoo
- description: Find a list of Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/FooCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/aggregate:
- get:
- operationId: aggregateFoo
- description: Aggregate Foos
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateFoo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/groupBy:
- get:
- operationId: groupByFoo
- description: Group Foos by fields
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/FooGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
diff --git a/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml
deleted file mode 100644
index 5f3e59136..000000000
--- a/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml
+++ /dev/null
@@ -1,3174 +0,0 @@
-openapi: 3.1.0
-info:
- title: ZenStack Generated API
- version: 1.0.0
-tags:
- - name: foo
- description: Foo operations
-components:
- schemas:
- FooScalarFieldEnum:
- type: string
- enum:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - json
- - plainJson
- SortOrder:
- type: string
- enum:
- - asc
- - desc
- NullableJsonNullValueInput:
- type: string
- enum:
- - DbNull
- - JsonNull
- JsonNullValueInput:
- type: string
- enum:
- - JsonNull
- QueryMode:
- type: string
- enum:
- - default
- - insensitive
- JsonNullValueFilter:
- type: string
- enum:
- - DbNull
- - JsonNull
- - AnyNull
- NullsOrder:
- type: string
- enum:
- - first
- - last
- Foo:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- json:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/Meta'
- plainJson: {}
- required:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- Meta:
- type: object
- description: The "Meta" TypeDef
- properties:
- something:
- type: string
- required:
- - something
- FooWhereInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- string:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- int:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- bigInt:
- oneOf:
- - $ref: '#/components/schemas/BigIntFilter'
- - type: integer
- date:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- float:
- oneOf:
- - $ref: '#/components/schemas/FloatFilter'
- - type: number
- decimal:
- oneOf:
- - $ref: '#/components/schemas/DecimalFilter'
- - oneOf:
- - type: string
- - type: number
- boolean:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- bytes:
- oneOf:
- - $ref: '#/components/schemas/BytesNullableFilter'
- - type: string
- format: byte
- - type: 'null'
- json:
- $ref: '#/components/schemas/JsonNullableFilter'
- plainJson:
- $ref: '#/components/schemas/JsonFilter'
- FooOrderByWithRelationInput:
- type: object
- properties:
- id:
- $ref: '#/components/schemas/SortOrder'
- string:
- $ref: '#/components/schemas/SortOrder'
- int:
- $ref: '#/components/schemas/SortOrder'
- bigInt:
- $ref: '#/components/schemas/SortOrder'
- date:
- $ref: '#/components/schemas/SortOrder'
- float:
- $ref: '#/components/schemas/SortOrder'
- decimal:
- $ref: '#/components/schemas/SortOrder'
- boolean:
- $ref: '#/components/schemas/SortOrder'
- bytes:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- json:
- oneOf:
- - $ref: '#/components/schemas/SortOrder'
- - $ref: '#/components/schemas/SortOrderInput'
- plainJson:
- $ref: '#/components/schemas/SortOrder'
- FooWhereUniqueInput:
- type: object
- properties:
- id:
- type: string
- AND:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/FooWhereInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooWhereInput'
- string:
- oneOf:
- - $ref: '#/components/schemas/StringFilter'
- - type: string
- int:
- oneOf:
- - $ref: '#/components/schemas/IntFilter'
- - type: integer
- bigInt:
- oneOf:
- - $ref: '#/components/schemas/BigIntFilter'
- - type: integer
- date:
- oneOf:
- - $ref: '#/components/schemas/DateTimeFilter'
- - type: string
- format: date-time
- float:
- oneOf:
- - $ref: '#/components/schemas/FloatFilter'
- - type: number
- decimal:
- oneOf:
- - $ref: '#/components/schemas/DecimalFilter'
- - oneOf:
- - type: string
- - type: number
- boolean:
- oneOf:
- - $ref: '#/components/schemas/BoolFilter'
- - type: boolean
- bytes:
- oneOf:
- - $ref: '#/components/schemas/BytesNullableFilter'
- - type: string
- format: byte
- - type: 'null'
- json:
- $ref: '#/components/schemas/JsonNullableFilter'
- plainJson:
- $ref: '#/components/schemas/JsonFilter'
- FooScalarWhereWithAggregatesInput:
- type: object
- properties:
- AND:
- oneOf:
- - $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- OR:
- type: array
- items:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- NOT:
- oneOf:
- - $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- id:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- string:
- oneOf:
- - $ref: '#/components/schemas/StringWithAggregatesFilter'
- - type: string
- int:
- oneOf:
- - $ref: '#/components/schemas/IntWithAggregatesFilter'
- - type: integer
- bigInt:
- oneOf:
- - $ref: '#/components/schemas/BigIntWithAggregatesFilter'
- - type: integer
- date:
- oneOf:
- - $ref: '#/components/schemas/DateTimeWithAggregatesFilter'
- - type: string
- format: date-time
- float:
- oneOf:
- - $ref: '#/components/schemas/FloatWithAggregatesFilter'
- - type: number
- decimal:
- oneOf:
- - $ref: '#/components/schemas/DecimalWithAggregatesFilter'
- - oneOf:
- - type: string
- - type: number
- boolean:
- oneOf:
- - $ref: '#/components/schemas/BoolWithAggregatesFilter'
- - type: boolean
- bytes:
- oneOf:
- - $ref: '#/components/schemas/BytesNullableWithAggregatesFilter'
- - type: string
- format: byte
- - type: 'null'
- json:
- $ref: '#/components/schemas/JsonNullableWithAggregatesFilter'
- plainJson:
- $ref: '#/components/schemas/JsonWithAggregatesFilter'
- FooCreateInput:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- FooUpdateInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- string:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- int:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- bigInt:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/BigIntFieldUpdateOperationsInput'
- date:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- float:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/FloatFieldUpdateOperationsInput'
- decimal:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/DecimalFieldUpdateOperationsInput'
- boolean:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- bytes:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput'
- - type: 'null'
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- FooCreateManyInput:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- required:
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- FooUpdateManyMutationInput:
- type: object
- properties:
- id:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- string:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/StringFieldUpdateOperationsInput'
- int:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/IntFieldUpdateOperationsInput'
- bigInt:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/BigIntFieldUpdateOperationsInput'
- date:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput'
- float:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/FloatFieldUpdateOperationsInput'
- decimal:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/DecimalFieldUpdateOperationsInput'
- boolean:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput'
- bytes:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput'
- - type: 'null'
- json:
- oneOf:
- - $ref: '#/components/schemas/NullableJsonNullValueInput'
- - {}
- plainJson:
- oneOf:
- - $ref: '#/components/schemas/JsonNullValueInput'
- - {}
- StringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- IntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- BigIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntFilter'
- DateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- FloatFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatFilter'
- DecimalFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalFilter'
- BoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- BytesNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableFilter'
- - type: 'null'
- JsonNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- oneOf:
- - type: 'null'
- - {}
- array_ends_with:
- oneOf:
- - type: 'null'
- - {}
- array_contains:
- oneOf:
- - type: 'null'
- - {}
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- JsonFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- oneOf:
- - type: 'null'
- - {}
- array_ends_with:
- oneOf:
- - type: 'null'
- - {}
- array_contains:
- oneOf:
- - type: 'null'
- - {}
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- SortOrderInput:
- type: object
- properties:
- sort:
- $ref: '#/components/schemas/SortOrder'
- nulls:
- $ref: '#/components/schemas/NullsOrder'
- required:
- - sort
- StringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- IntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- BigIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _max:
- $ref: '#/components/schemas/NestedBigIntFilter'
- DateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- FloatWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedFloatFilter'
- _min:
- $ref: '#/components/schemas/NestedFloatFilter'
- _max:
- $ref: '#/components/schemas/NestedFloatFilter'
- DecimalWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _sum:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _min:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _max:
- $ref: '#/components/schemas/NestedDecimalFilter'
- BoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- BytesNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter'
- - type: 'null'
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- JsonNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- oneOf:
- - type: 'null'
- - {}
- array_ends_with:
- oneOf:
- - type: 'null'
- - {}
- array_contains:
- oneOf:
- - type: 'null'
- - {}
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedJsonNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedJsonNullableFilter'
- JsonWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- oneOf:
- - type: 'null'
- - {}
- array_ends_with:
- oneOf:
- - type: 'null'
- - {}
- array_contains:
- oneOf:
- - type: 'null'
- - {}
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedJsonFilter'
- _max:
- $ref: '#/components/schemas/NestedJsonFilter'
- StringFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- IntFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: integer
- increment:
- type: integer
- decrement:
- type: integer
- multiply:
- type: integer
- divide:
- type: integer
- BigIntFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: integer
- increment:
- type: integer
- decrement:
- type: integer
- multiply:
- type: integer
- divide:
- type: integer
- DateTimeFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: string
- format: date-time
- FloatFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: number
- increment:
- type: number
- decrement:
- type: number
- multiply:
- type: number
- divide:
- type: number
- DecimalFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- oneOf:
- - type: string
- - type: number
- increment:
- oneOf:
- - type: string
- - type: number
- decrement:
- oneOf:
- - type: string
- - type: number
- multiply:
- oneOf:
- - type: string
- - type: number
- divide:
- oneOf:
- - type: string
- - type: number
- BoolFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- type: boolean
- NullableBytesFieldUpdateOperationsInput:
- type: object
- properties:
- set:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- NestedStringFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringFilter'
- NestedIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntFilter'
- NestedBigIntFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntFilter'
- NestedDateTimeFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedFloatFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatFilter'
- NestedDecimalFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalFilter'
- NestedBoolFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolFilter'
- NestedBytesNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableFilter'
- - type: 'null'
- NestedStringWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- in:
- type: array
- items:
- type: string
- notIn:
- type: array
- items:
- type: string
- lt:
- type: string
- lte:
- type: string
- gt:
- type: string
- gte:
- type: string
- contains:
- type: string
- startsWith:
- type: string
- endsWith:
- type: string
- not:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/NestedStringWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedStringFilter'
- _max:
- $ref: '#/components/schemas/NestedStringFilter'
- NestedIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedIntFilter'
- _max:
- $ref: '#/components/schemas/NestedIntFilter'
- NestedBigIntWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: integer
- in:
- type: array
- items:
- type: integer
- notIn:
- type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedBigIntWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBigIntFilter'
- _max:
- $ref: '#/components/schemas/NestedBigIntFilter'
- NestedDateTimeWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: string
- format: date-time
- in:
- type: array
- items:
- type: string
- format: date-time
- notIn:
- type: array
- items:
- type: string
- format: date-time
- lt:
- type: string
- format: date-time
- lte:
- type: string
- format: date-time
- gt:
- type: string
- format: date-time
- gte:
- type: string
- format: date-time
- not:
- oneOf:
- - type: string
- format: date-time
- - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- _max:
- $ref: '#/components/schemas/NestedDateTimeFilter'
- NestedFloatWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: number
- in:
- type: array
- items:
- type: number
- notIn:
- type: array
- items:
- type: number
- lt:
- type: number
- lte:
- type: number
- gt:
- type: number
- gte:
- type: number
- not:
- oneOf:
- - type: number
- - $ref: '#/components/schemas/NestedFloatWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedFloatFilter'
- _sum:
- $ref: '#/components/schemas/NestedFloatFilter'
- _min:
- $ref: '#/components/schemas/NestedFloatFilter'
- _max:
- $ref: '#/components/schemas/NestedFloatFilter'
- NestedDecimalWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: string
- - type: number
- in:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- notIn:
- type: array
- items:
- oneOf:
- - type: string
- - type: number
- lt:
- oneOf:
- - type: string
- - type: number
- lte:
- oneOf:
- - type: string
- - type: number
- gt:
- oneOf:
- - type: string
- - type: number
- gte:
- oneOf:
- - type: string
- - type: number
- not:
- oneOf:
- - oneOf:
- - type: string
- - type: number
- - $ref: '#/components/schemas/NestedDecimalWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _avg:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _sum:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _min:
- $ref: '#/components/schemas/NestedDecimalFilter'
- _max:
- $ref: '#/components/schemas/NestedDecimalFilter'
- NestedBoolWithAggregatesFilter:
- type: object
- properties:
- equals:
- type: boolean
- not:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter'
- _count:
- $ref: '#/components/schemas/NestedIntFilter'
- _min:
- $ref: '#/components/schemas/NestedBoolFilter'
- _max:
- $ref: '#/components/schemas/NestedBoolFilter'
- NestedBytesNullableWithAggregatesFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: string
- format: byte
- not:
- oneOf:
- - type: string
- format: byte
- - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter'
- - type: 'null'
- _count:
- $ref: '#/components/schemas/NestedIntNullableFilter'
- _min:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- _max:
- $ref: '#/components/schemas/NestedBytesNullableFilter'
- NestedIntNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - type: 'null'
- - type: integer
- in:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: integer
- notIn:
- oneOf:
- - type: 'null'
- - type: array
- items:
- type: integer
- lt:
- type: integer
- lte:
- type: integer
- gt:
- type: integer
- gte:
- type: integer
- not:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/NestedIntNullableFilter'
- - type: 'null'
- NestedJsonNullableFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- oneOf:
- - type: 'null'
- - {}
- array_ends_with:
- oneOf:
- - type: 'null'
- - {}
- array_contains:
- oneOf:
- - type: 'null'
- - {}
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- NestedJsonFilter:
- type: object
- properties:
- equals:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- path:
- type: array
- items:
- type: string
- mode:
- $ref: '#/components/schemas/QueryMode'
- string_contains:
- type: string
- string_starts_with:
- type: string
- string_ends_with:
- type: string
- array_starts_with:
- oneOf:
- - type: 'null'
- - {}
- array_ends_with:
- oneOf:
- - type: 'null'
- - {}
- array_contains:
- oneOf:
- - type: 'null'
- - {}
- lt: {}
- lte: {}
- gt: {}
- gte: {}
- not:
- oneOf:
- - {}
- - $ref: '#/components/schemas/JsonNullValueFilter'
- FooSelect:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- json:
- type: boolean
- plainJson:
- type: boolean
- FooCountAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- json:
- type: boolean
- plainJson:
- type: boolean
- _all:
- type: boolean
- FooAvgAggregateInput:
- type: object
- properties:
- int:
- type: boolean
- bigInt:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- FooSumAggregateInput:
- type: object
- properties:
- int:
- type: boolean
- bigInt:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- FooMinAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- FooMaxAggregateInput:
- type: object
- properties:
- id:
- type: boolean
- string:
- type: boolean
- int:
- type: boolean
- bigInt:
- type: boolean
- date:
- type: boolean
- float:
- type: boolean
- decimal:
- type: boolean
- boolean:
- type: boolean
- bytes:
- type: boolean
- AggregateFoo:
- type: object
- properties:
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooCountAggregateOutputType'
- _avg:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooAvgAggregateOutputType'
- _sum:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooSumAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooMaxAggregateOutputType'
- FooGroupByOutputType:
- type: object
- properties:
- id:
- type: string
- string:
- type: string
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: string
- format: date-time
- float:
- type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- boolean:
- type: boolean
- bytes:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- json:
- oneOf:
- - type: 'null'
- - {}
- plainJson: {}
- _count:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooCountAggregateOutputType'
- _avg:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooAvgAggregateOutputType'
- _sum:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooSumAggregateOutputType'
- _min:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooMinAggregateOutputType'
- _max:
- oneOf:
- - type: 'null'
- - $ref: '#/components/schemas/FooMaxAggregateOutputType'
- required:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - plainJson
- FooCountAggregateOutputType:
- type: object
- properties:
- id:
- type: integer
- string:
- type: integer
- int:
- type: integer
- bigInt:
- type: integer
- date:
- type: integer
- float:
- type: integer
- decimal:
- type: integer
- boolean:
- type: integer
- bytes:
- type: integer
- json:
- type: integer
- plainJson:
- type: integer
- _all:
- type: integer
- required:
- - id
- - string
- - int
- - bigInt
- - date
- - float
- - decimal
- - boolean
- - bytes
- - json
- - plainJson
- - _all
- FooAvgAggregateOutputType:
- type: object
- properties:
- int:
- oneOf:
- - type: 'null'
- - type: number
- bigInt:
- oneOf:
- - type: 'null'
- - type: number
- float:
- oneOf:
- - type: 'null'
- - type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- - type: 'null'
- FooSumAggregateOutputType:
- type: object
- properties:
- int:
- oneOf:
- - type: 'null'
- - type: integer
- bigInt:
- oneOf:
- - type: 'null'
- - type: integer
- float:
- oneOf:
- - type: 'null'
- - type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- - type: 'null'
- FooMinAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- string:
- oneOf:
- - type: 'null'
- - type: string
- int:
- oneOf:
- - type: 'null'
- - type: integer
- bigInt:
- oneOf:
- - type: 'null'
- - type: integer
- date:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- float:
- oneOf:
- - type: 'null'
- - type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- - type: 'null'
- boolean:
- oneOf:
- - type: 'null'
- - type: boolean
- bytes:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- FooMaxAggregateOutputType:
- type: object
- properties:
- id:
- oneOf:
- - type: 'null'
- - type: string
- string:
- oneOf:
- - type: 'null'
- - type: string
- int:
- oneOf:
- - type: 'null'
- - type: integer
- bigInt:
- oneOf:
- - type: 'null'
- - type: integer
- date:
- oneOf:
- - type: 'null'
- - type: string
- format: date-time
- float:
- oneOf:
- - type: 'null'
- - type: number
- decimal:
- oneOf:
- - type: string
- - type: number
- - type: 'null'
- boolean:
- oneOf:
- - type: 'null'
- - type: boolean
- bytes:
- oneOf:
- - type: 'null'
- - type: string
- format: byte
- _Meta:
- type: object
- description: Meta information about the request or response
- properties:
- serialization:
- description: Serialization metadata
- additionalProperties: true
- _Error:
- type: object
- required:
- - error
- properties:
- error:
- type: object
- required:
- - message
- properties:
- prisma:
- type: boolean
- description: Indicates if the error occurred during a Prisma call
- rejectedByPolicy:
- type: boolean
- description: Indicates if the error was due to rejection by a policy
- code:
- type: string
- description: Prisma error code. Only available when "prisma" field is true.
- message:
- type: string
- description: Error message
- reason:
- type: string
- description: Detailed error reason
- zodErrors:
- type: object
- additionalProperties: true
- description: Zod validation errors if the error is due to data validation
- failure
- additionalProperties: true
- BatchPayload:
- type: object
- properties:
- count:
- type: integer
- FooCreateArgs:
- type: object
- required:
- - data
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- data:
- $ref: '#/components/schemas/FooCreateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooCreateManyArgs:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - $ref: '#/components/schemas/FooCreateManyInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooCreateManyInput'
- skipDuplicates:
- type: boolean
- description: Do not insert records with unique fields or ID fields that already
- exist.
- meta:
- $ref: '#/components/schemas/_Meta'
- FooFindUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooFindFirstArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooFindManyArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereInput'
- orderBy:
- oneOf:
- - $ref: '#/components/schemas/FooOrderByWithRelationInput'
- - type: array
- items:
- $ref: '#/components/schemas/FooOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- meta:
- $ref: '#/components/schemas/_Meta'
- FooUpdateArgs:
- type: object
- required:
- - where
- - data
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- data:
- $ref: '#/components/schemas/FooUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooUpdateManyArgs:
- type: object
- required:
- - data
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- data:
- $ref: '#/components/schemas/FooUpdateManyMutationInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooUpsertArgs:
- type: object
- required:
- - create
- - update
- - where
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- create:
- $ref: '#/components/schemas/FooCreateInput'
- update:
- $ref: '#/components/schemas/FooUpdateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooDeleteUniqueArgs:
- type: object
- required:
- - where
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooDeleteManyArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooCountArgs:
- type: object
- properties:
- select:
- $ref: '#/components/schemas/FooSelect'
- where:
- $ref: '#/components/schemas/FooWhereInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooAggregateArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- orderBy:
- $ref: '#/components/schemas/FooOrderByWithRelationInput'
- cursor:
- $ref: '#/components/schemas/FooWhereUniqueInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/FooCountAggregateInput'
- _min:
- $ref: '#/components/schemas/FooMinAggregateInput'
- _max:
- $ref: '#/components/schemas/FooMaxAggregateInput'
- _sum:
- $ref: '#/components/schemas/FooSumAggregateInput'
- _avg:
- $ref: '#/components/schemas/FooAvgAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
- FooGroupByArgs:
- type: object
- properties:
- where:
- $ref: '#/components/schemas/FooWhereInput'
- orderBy:
- $ref: '#/components/schemas/FooOrderByWithRelationInput'
- by:
- $ref: '#/components/schemas/FooScalarFieldEnum'
- having:
- $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput'
- take:
- type: integer
- skip:
- type: integer
- _count:
- oneOf:
- - type: boolean
- - $ref: '#/components/schemas/FooCountAggregateInput'
- _min:
- $ref: '#/components/schemas/FooMinAggregateInput'
- _max:
- $ref: '#/components/schemas/FooMaxAggregateInput'
- _sum:
- $ref: '#/components/schemas/FooSumAggregateInput'
- _avg:
- $ref: '#/components/schemas/FooAvgAggregateInput'
- meta:
- $ref: '#/components/schemas/_Meta'
-paths:
- /foo/create:
- post:
- operationId: createFoo
- description: Create a new Foo
- tags:
- - foo
- security: []
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooCreateArgs'
- /foo/createMany:
- post:
- operationId: createManyFoo
- description: Create several Foo
- tags:
- - foo
- security: []
- responses:
- '201':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooCreateManyArgs'
- /foo/findUnique:
- get:
- operationId: findUniqueFoo
- description: Find one unique Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooFindUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/findFirst:
- get:
- operationId: findFirstFoo
- description: Find the first Foo matching the given condition
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooFindFirstArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/findMany:
- get:
- operationId: findManyFoo
- description: Find a list of Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooFindManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/update:
- patch:
- operationId: updateFoo
- description: Update a Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooUpdateArgs'
- /foo/updateMany:
- patch:
- operationId: updateManyFoo
- description: Update Foos matching the given condition
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooUpdateManyArgs'
- /foo/upsert:
- post:
- operationId: upsertFoo
- description: Upsert a Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooUpsertArgs'
- /foo/delete:
- delete:
- operationId: deleteFoo
- description: Delete one unique Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/Foo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooDeleteUniqueArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/deleteMany:
- delete:
- operationId: deleteManyFoo
- description: Delete Foos matching the given condition
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/BatchPayload'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooDeleteManyArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/count:
- get:
- operationId: countFoo
- description: Find a list of Foo
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- oneOf:
- - type: integer
- - $ref: '#/components/schemas/FooCountAggregateOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooCountArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/aggregate:
- get:
- operationId: aggregateFoo
- description: Aggregate Foos
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- $ref: '#/components/schemas/AggregateFoo'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooAggregateArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
- /foo/groupBy:
- get:
- operationId: groupByFoo
- description: Group Foos by fields
- tags:
- - foo
- security: []
- responses:
- '200':
- description: Successful operation
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/FooGroupByOutputType'
- description: The Prisma response data serialized with superjson
- meta:
- $ref: '#/components/schemas/_Meta'
- description: The superjson serialization metadata for the "data" field
- '400':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Invalid request
- '403':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is forbidden
- '422':
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/_Error'
- description: Request is unprocessable due to validation errors
- parameters:
- - name: q
- in: query
- required: true
- description: Superjson-serialized Prisma query object
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/FooGroupByArgs'
- - name: meta
- in: query
- description: Superjson serialization metadata for parameter "q"
- content:
- application/json:
- schema: {}
diff --git a/packages/plugins/openapi/tests/openapi-restful.test.ts b/packages/plugins/openapi/tests/openapi-restful.test.ts
deleted file mode 100644
index bde8ea53c..000000000
--- a/packages/plugins/openapi/tests/openapi-restful.test.ts
+++ /dev/null
@@ -1,439 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-///
-
-import OpenAPIParser from '@readme/openapi-parser';
-import { getLiteral, getObjectLiteral } from '@zenstackhq/sdk';
-import { Model, Plugin, isPlugin } from '@zenstackhq/sdk/ast';
-import { loadZModelAndDmmf, normalizePath } from '@zenstackhq/testtools';
-import fs from 'fs';
-import path from 'path';
-import * as tmp from 'tmp';
-import YAML from 'yaml';
-import generate from '../src';
-
-tmp.setGracefulCleanup();
-
-describe('Open API Plugin RESTful Tests', () => {
- it('run plugin', async () => {
- for (const specVersion of ['3.0.0', '3.1.0']) {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '${specVersion}'
-}
-
-enum role {
- USER
- ADMIN
-}
-
-model User {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- email String @unique
- role role @default(USER)
- posts post_Item[]
- profile Profile?
- likes PostLike[]
-}
-
-model Profile {
- id String @id @default(cuid())
- image String?
-
- user User @relation(fields: [userId], references: [id])
- userId String @unique
-}
-
-model post_Item {
- id String @id
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- title String
- author User? @relation(fields: [authorId], references: [id])
- authorId String?
- published Boolean @default(false)
- viewCount Int @default(0)
- notes String?
- likes PostLike[]
-
- @@openapi.meta({
- tagDescription: 'Post-related operations'
- })
-}
-
-model PostLike {
- post post_Item @relation(fields: [postId], references: [id])
- postId String
- user User @relation(fields: [userId], references: [id])
- userId String
- @@id([postId, userId])
-}
-
-model Foo {
- id String @id
- @@openapi.ignore
-}
-
-model Bar {
- id String @id
- @@ignore
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output, specVersion);
- await generate(model, options, dmmf);
-
- console.log(`OpenAPI specification generated for ${specVersion}: ${output}`);
-
- const api = await OpenAPIParser.validate(output);
-
- expect(api.tags).toEqual(
- expect.arrayContaining([
- expect.objectContaining({ name: 'user', description: 'User operations' }),
- expect.objectContaining({ name: 'post_Item', description: 'Post-related operations' }),
- ])
- );
-
- expect(api.paths?.['/user']?.['get']).toBeTruthy();
- expect(api.paths?.['/user']?.['post']).toBeTruthy();
- expect(api.paths?.['/user']?.['put']).toBeFalsy();
- expect(api.paths?.['/user/{id}']?.['get']).toBeTruthy();
- expect(api.paths?.['/user/{id}']?.['patch']).toBeTruthy();
- expect(api.paths?.['/user/{id}']?.['delete']).toBeTruthy();
- expect(api.paths?.['/user/{id}/posts']?.['get']).toBeTruthy();
- expect(api.paths?.['/user/{id}/relationships/posts']?.['get']).toBeTruthy();
- expect(api.paths?.['/user/{id}/relationships/posts']?.['post']).toBeTruthy();
- expect(api.paths?.['/user/{id}/relationships/posts']?.['patch']).toBeTruthy();
- expect(api.paths?.['/user/{id}/relationships/likes']?.['get']).toBeTruthy();
- expect(api.paths?.['/user/{id}/relationships/likes']?.['post']).toBeTruthy();
- expect(api.paths?.['/user/{id}/relationships/likes']?.['patch']).toBeTruthy();
- expect(api.paths?.['/post_Item/{id}/relationships/author']?.['get']).toBeTruthy();
- expect(api.paths?.['/post_Item/{id}/relationships/author']?.['post']).toBeUndefined();
- expect(api.paths?.['/post_Item/{id}/relationships/author']?.['patch']).toBeTruthy();
- expect(api.paths?.['/post_Item/{id}/relationships/likes']?.['get']).toBeTruthy();
- expect(api.paths?.['/post_Item/{id}/relationships/likes']?.['post']).toBeTruthy();
- expect(api.paths?.['/post_Item/{id}/relationships/likes']?.['patch']).toBeTruthy();
- expect(api.paths?.['/foo']).toBeUndefined();
- expect(api.paths?.['/bar']).toBeUndefined();
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe(specVersion);
- const baseline = YAML.parse(
- fs.readFileSync(`${__dirname}/baseline/rest-${specVersion}.baseline.yaml`, 'utf-8')
- );
- expect(parsed).toMatchObject(baseline);
- }
- });
-
- it('common options', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '3.0.0'
- title = 'My Awesome API'
- version = '1.0.0'
- description = 'awesome api'
- prefix = '/myapi'
-}
-
-model User {
- id String @id
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe('3.0.0');
-
- const api = await OpenAPIParser.validate(output);
- expect(api.info).toEqual(
- expect.objectContaining({
- title: 'My Awesome API',
- version: '1.0.0',
- description: 'awesome api',
- })
- );
-
- expect(api.paths?.['/myapi/user']).toBeTruthy();
- });
-
- it('security schemes valid', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'http', scheme: 'basic' },
- myBearer: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
- myApiKey: { type: 'apiKey', in: 'header', name: 'X-API-KEY' }
- }
-}
-
-model User {
- id String @id
- posts Post[]
-}
-
-model Post {
- id String @id
- author User @relation(fields: [authorId], references: [id])
- authorId String
- @@allow('read', true)
-}
-`);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.components.securitySchemes).toEqual(
- expect.objectContaining({
- myBasic: { type: 'http', scheme: 'basic' },
- myBearer: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
- myApiKey: { type: 'apiKey', in: 'header', name: 'X-API-KEY' },
- })
- );
- expect(parsed.security).toEqual(expect.arrayContaining([{ myBasic: [] }, { myBearer: [] }]));
-
- const api = await OpenAPIParser.validate(output);
- expect(api.paths?.['/user']?.['get']?.security).toBeUndefined();
- expect(api.paths?.['/user/{id}/posts']?.['get']?.security).toEqual([]);
- expect(api.paths?.['/post']?.['get']?.security).toEqual([]);
- expect(api.paths?.['/post']?.['post']?.security).toBeUndefined();
- });
-
- it('security model level override', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'http', scheme: 'basic' }
- }
-}
-
-model User {
- id String @id
- value Int
-
- @@allow('all', value > 0)
-
- @@openapi.meta({
- security: []
- })
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- const api = await OpenAPIParser.validate(output);
- expect(api.paths?.['/user']?.['get']?.security).toHaveLength(0);
- expect(api.paths?.['/user/{id}']?.['put']?.security).toHaveLength(0);
- });
-
- it('security schemes invalid', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'invalid', scheme: 'basic' }
- }
-}
-
-model User {
- id String @id
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await expect(generate(model, options, dmmf)).rejects.toEqual(
- expect.objectContaining({ message: expect.stringContaining('"securitySchemes" option is invalid') })
- );
- });
-
- it('ignored model used as relation', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
-}
-
-model User {
- id String @id
- email String @unique
- posts Post[]
-}
-
-model Post {
- id String @id
- title String
- author User? @relation(fields: [authorId], references: [id])
- authorId String?
-
- @@openapi.ignore()
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output, '3.1.0');
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- await OpenAPIParser.validate(output);
- });
-
- it('field type coverage', async () => {
- for (const specVersion of ['3.0.0', '3.1.0']) {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '${specVersion}'
-}
-
-type Meta {
- something String
-}
-
-model Foo {
- id String @id @default(cuid())
-
- string String
- int Int
- bigInt BigInt
- date DateTime
- float Float
- decimal Decimal
- boolean Boolean
- bytes Bytes
- json Meta? @json
- plainJson Json
-
- @@allow('all', true)
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output, specVersion);
- await generate(model, options, dmmf);
-
- console.log(`OpenAPI specification generated for ${specVersion}: ${output}`);
-
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe(specVersion);
- const baseline = YAML.parse(
- fs.readFileSync(`${__dirname}/baseline/rest-type-coverage-${specVersion}.baseline.yaml`, 'utf-8')
- );
- expect(parsed).toMatchObject(baseline);
- }
- });
-
- it('int field as id', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
-}
-
-model Foo {
- id Int @id @default(autoincrement())
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output, '3.0.0');
- await generate(model, options, dmmf);
- console.log(`OpenAPI specification generated: ${output}`);
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.components.schemas.Foo.properties.id.type).toBe('integer');
- });
-
- it('exposes individual fields from a compound id as attributes', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
-}
-
-model User {
- email String
- role String
- company String
- @@id([role, company])
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output, '3.1.0');
- await generate(model, options, dmmf);
-
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe('3.1.0');
-
- expect(Object.keys(parsed.components.schemas.User.properties.attributes.properties)).toEqual(
- expect.arrayContaining(['role', 'company'])
- );
- });
-
- it('works with mapped model name', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- title = 'My Awesome API'
- prefix = '/api'
- modelNameMapping = {
- User: 'myUser'
- }
-}
-
-model User {
- id String @id
- posts Post[]
-}
-
-model Post {
- id String @id
- author User @relation(fields: [authorId], references: [id])
- authorId String
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
- console.log('OpenAPI specification generated:', output);
- const api = await OpenAPIParser.validate(output);
- expect(api.paths?.['/api/myUser']).toBeTruthy();
- expect(api.paths?.['/api/user']).toBeFalsy();
- expect(api.paths?.['/api/post']).toBeTruthy();
- });
-});
-
-function buildOptions(model: Model, modelFile: string, output: string, specVersion = '3.0.0') {
- const optionFields = model.declarations.find((d): d is Plugin => isPlugin(d))?.fields || [];
- const options: any = { schemaPath: modelFile, output, specVersion, flavor: 'rest' };
- optionFields.forEach((f) => (options[f.name] = getLiteral(f.value) ?? getObjectLiteral(f.value)));
- return options;
-}
diff --git a/packages/plugins/openapi/tests/openapi-rpc.test.ts b/packages/plugins/openapi/tests/openapi-rpc.test.ts
deleted file mode 100644
index 731b38f2a..000000000
--- a/packages/plugins/openapi/tests/openapi-rpc.test.ts
+++ /dev/null
@@ -1,663 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-///
-
-import OpenAPIParser from '@readme/openapi-parser';
-import { getLiteral, getObjectLiteral } from '@zenstackhq/sdk';
-import { Model, Plugin, isPlugin } from '@zenstackhq/sdk/ast';
-import { loadSchema, loadZModelAndDmmf, normalizePath } from '@zenstackhq/testtools';
-import fs from 'fs';
-import path from 'path';
-import * as tmp from 'tmp';
-import YAML from 'yaml';
-import generate from '../src';
-
-tmp.setGracefulCleanup();
-
-describe('Open API Plugin RPC Tests', () => {
- it('run plugin', async () => {
- for (const specVersion of ['3.0.0', '3.1.0']) {
- for (const omitInputDetails of [true, false]) {
- const { projectDir } = await loadSchema(
- `
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '${specVersion}'
- omitInputDetails = ${omitInputDetails}
- output = '$projectRoot/openapi.yaml'
-}
-
-enum role {
- USER
- ADMIN
-}
-
-model User {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- email String @unique
- role role @default(USER)
- posts post_Item[]
- profile Profile?
-
- @@openapi.meta({
- findMany: {
- description: 'Find users matching the given conditions'
- },
- delete: {
- method: 'put',
- path: 'dodelete',
- description: 'Delete a unique user',
- summary: 'Delete a user yeah yeah',
- tags: ['delete', 'user'],
- deprecated: true
- },
- })
-}
-
-model Profile {
- id String @id @default(cuid())
- image String?
-
- user User @relation(fields: [userId], references: [id])
- userId String @unique
-}
-
-model post_Item {
- id String @id
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- title String
- author User? @relation(fields: [authorId], references: [id])
- authorId String?
- published Boolean @default(false)
- viewCount Int @default(0)
- notes String?
-
- @@openapi.meta({
- tagDescription: 'Post-related operations',
- findMany: {
- ignore: true
- }
- })
-}
-
-model Foo {
- id String @id
- @@openapi.ignore
-}
-
-model Bar {
- id String @id
- @@ignore
-}
- `,
- { provider: 'postgresql', pushDb: false }
- );
-
- console.log(
- `OpenAPI specification generated for ${specVersion}${
- omitInputDetails ? ' - omit' : ''
- }: ${projectDir}/openapi.yaml`
- );
-
- const parsed = YAML.parse(fs.readFileSync(path.join(projectDir, 'openapi.yaml'), 'utf-8'));
- expect(parsed.openapi).toBe(specVersion);
- const baseline = YAML.parse(
- fs.readFileSync(
- `${__dirname}/baseline/rpc-${specVersion}${omitInputDetails ? '-omit' : ''}.baseline.yaml`,
- 'utf-8'
- )
- );
- expect(parsed).toMatchObject(baseline);
-
- const api = await OpenAPIParser.validate(path.join(projectDir, 'openapi.yaml'));
-
- expect(api.tags).toEqual(
- expect.arrayContaining([
- expect.objectContaining({ name: 'user', description: 'User operations' }),
- expect.objectContaining({ name: 'post_Item', description: 'Post-related operations' }),
- ])
- );
-
- expect(api.paths?.['/user/findMany']?.['get']?.description).toBe(
- 'Find users matching the given conditions'
- );
- const del = api.paths?.['/user/dodelete']?.['put'];
- expect(del?.description).toBe('Delete a unique user');
- expect(del?.summary).toBe('Delete a user yeah yeah');
- expect(del?.tags).toEqual(expect.arrayContaining(['delete', 'user']));
- expect(del?.deprecated).toBe(true);
- expect(api.paths?.['/post/findMany']).toBeUndefined();
- expect(api.paths?.['/foo/findMany']).toBeUndefined();
- expect(api.paths?.['/bar/findMany']).toBeUndefined();
- }
- }
- });
-
- it('options', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '3.0.0'
- title = 'My Awesome API'
- version = '1.0.0'
- description = 'awesome api'
- prefix = '/myapi'
-}
-
-model User {
- id String @id
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe('3.0.0');
-
- const api = await OpenAPIParser.validate(output);
- expect(api.info).toEqual(
- expect.objectContaining({
- title: 'My Awesome API',
- version: '1.0.0',
- description: 'awesome api',
- })
- );
-
- expect(api.paths?.['/myapi/user/findMany']).toBeTruthy();
- });
-
- it('security schemes valid', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'http', scheme: 'basic' },
- myBearer: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
- myApiKey: { type: 'apiKey', in: 'header', name: 'X-API-KEY' }
- }
-}
-
-model User {
- id String @id
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.components.securitySchemes).toEqual(
- expect.objectContaining({
- myBasic: { type: 'http', scheme: 'basic' },
- myBearer: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
- myApiKey: { type: 'apiKey', in: 'header', name: 'X-API-KEY' },
- })
- );
- expect(parsed.security).toEqual(expect.arrayContaining([{ myBasic: [] }, { myBearer: [] }]));
- });
-
- it('security schemes invalid', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'invalid', scheme: 'basic' }
- }
-}
-
-model User {
- id String @id
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await expect(generate(model, options, dmmf)).rejects.toEqual(
- expect.objectContaining({ message: expect.stringContaining('"securitySchemes" option is invalid') })
- );
- });
-
- it('security model level override', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'http', scheme: 'basic' }
- }
-}
-
-model User {
- id String @id
-
- @@openapi.meta({
- security: []
- })
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- const api = await OpenAPIParser.validate(output);
- expect(api.paths?.['/user/findMany']?.['get']?.security).toHaveLength(0);
- });
-
- it('security operation level override', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'http', scheme: 'basic' }
- }
-}
-
-model User {
- id String @id
-
- @@allow('read', true)
-
- @@openapi.meta({
- security: [],
- findMany: {
- security: [{ myBasic: [] }]
- }
- })
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- const api = await OpenAPIParser.validate(output);
- expect(api.paths?.['/user/findMany']?.['get']?.security).toHaveLength(1);
- });
-
- it('security inferred', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- securitySchemes = {
- myBasic: { type: 'http', scheme: 'basic' }
- }
-}
-
-model User {
- id String @id
- @@allow('create', true)
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- const api = await OpenAPIParser.validate(output);
- expect(api.paths?.['/user/create']?.['post']?.security).toHaveLength(0);
- expect(api.paths?.['/user/findMany']?.['get']?.security).toBeUndefined();
- });
-
- it('v3.1.0 fields', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- summary = 'awesome api'
-}
-
-model User {
- id String @id
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe('3.1.0');
- expect(parsed.info.summary).toEqual('awesome api');
- });
-
- it('ignored model used as relation', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
-}
-
-model User {
- id String @id
- email String @unique
- posts Post[]
-}
-
-model Post {
- id String @id
- title String
- author User? @relation(fields: [authorId], references: [id])
- authorId String?
-
- @@openapi.ignore()
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
- await OpenAPIParser.validate(output);
- });
-
- it('field type coverage', async () => {
- for (const specVersion of ['3.0.0', '3.1.0']) {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '${specVersion}'
-}
-
-type Meta {
- something String
-}
-
-model Foo {
- id String @id @default(cuid())
-
- string String
- int Int
- bigInt BigInt
- date DateTime
- float Float
- decimal Decimal
- boolean Boolean
- bytes Bytes?
- json Meta? @json
- plainJson Json
-
- @@allow('all', true)
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log(`OpenAPI specification generated for ${specVersion}: ${output}`);
-
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe(specVersion);
- const baseline = YAML.parse(
- fs.readFileSync(`${__dirname}/baseline/rpc-type-coverage-${specVersion}.baseline.yaml`, 'utf-8')
- );
- expect(parsed).toMatchObject(baseline);
- }
- });
-
- it('complex TypeDef structures', async () => {
- for (const specVersion of ['3.0.0', '3.1.0']) {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '${specVersion}'
-}
-
-enum Status {
- PENDING
- APPROVED
- REJECTED
-}
-
-type Address {
- street String
- city String
- country String
- zipCode String?
-}
-
-type ContactInfo {
- email String
- phone String?
- addresses Address[]
-}
-
-type ReviewItem {
- id String
- status Status
- reviewer ContactInfo
- score Int
- comments String[]
- metadata Json?
-}
-
-type ComplexData {
- reviews ReviewItem[]
- primaryContact ContactInfo
- tags String[]
- settings Json
-}
-
-model Product {
- id String @id @default(cuid())
- name String
- data ComplexData @json
- simpleJson Json
-
- @@allow('all', true)
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe(specVersion);
-
- // Verify all TypeDefs are generated
- expect(parsed.components.schemas.Address).toBeDefined();
- expect(parsed.components.schemas.ContactInfo).toBeDefined();
- expect(parsed.components.schemas.ReviewItem).toBeDefined();
- expect(parsed.components.schemas.ComplexData).toBeDefined();
-
- // Verify enum reference in TypeDef
- expect(parsed.components.schemas.ReviewItem.properties.status.$ref).toBe('#/components/schemas/Status');
-
- // Json field inside a TypeDef should remain generic (wrapped with nullable since it's optional)
- // OpenAPI 3.1 uses oneOf with null type, while 3.0 uses nullable: true
- if (specVersion === '3.1.0') {
- expect(parsed.components.schemas.ReviewItem.properties.metadata).toEqual({
- oneOf: [
- { type: 'null' },
- {}
- ]
- });
- } else {
- expect(parsed.components.schemas.ReviewItem.properties.metadata).toEqual({ nullable: true });
- }
-
- // Verify nested TypeDef references
- expect(parsed.components.schemas.ContactInfo.properties.addresses.type).toBe('array');
- expect(parsed.components.schemas.ContactInfo.properties.addresses.items.$ref).toBe('#/components/schemas/Address');
-
- // Verify array of complex objects
- expect(parsed.components.schemas.ComplexData.properties.reviews.type).toBe('array');
- expect(parsed.components.schemas.ComplexData.properties.reviews.items.$ref).toBe('#/components/schemas/ReviewItem');
-
- // Verify the Product model references the ComplexData TypeDef
- expect(parsed.components.schemas.Product.properties.data.$ref).toBe('#/components/schemas/ComplexData');
-
- // Verify plain Json field remains generic
- expect(parsed.components.schemas.Product.properties.simpleJson).toEqual({});
- }
- });
-
- it('array of TypeDef with enum directly on model field', async () => {
- for (const specVersion of ['3.0.0', '3.1.0']) {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- specVersion = '${specVersion}'
-}
-
-enum Language {
- FR
- EN
- ES
- DE
- IT
-}
-
-type TranslatedField {
- language Language
- content String
-}
-
-model Article {
- id String @id @default(cuid())
- title TranslatedField[] @json
- description TranslatedField[] @json
-
- @@allow('all', true)
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- await OpenAPIParser.validate(output);
-
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.openapi).toBe(specVersion);
-
- // Verify TranslatedField TypeDef is generated
- expect(parsed.components.schemas.TranslatedField).toBeDefined();
-
- // Verify Language enum is generated
- expect(parsed.components.schemas.Language).toBeDefined();
-
- // Verify enum reference inside TranslatedField
- expect(parsed.components.schemas.TranslatedField.properties.language.$ref).toBe('#/components/schemas/Language');
-
- // Verify array of TypeDef directly on model field
- expect(parsed.components.schemas.Article.properties.title.type).toBe('array');
- expect(parsed.components.schemas.Article.properties.title.items.$ref).toBe('#/components/schemas/TranslatedField');
-
- // Verify second array field as well
- expect(parsed.components.schemas.Article.properties.description.type).toBe('array');
- expect(parsed.components.schemas.Article.properties.description.items.$ref).toBe('#/components/schemas/TranslatedField');
- }
- });
-
- it('full-text search', async () => {
- const { model, dmmf, modelFile } = await loadZModelAndDmmf(`
-generator js {
- provider = 'prisma-client-js'
- previewFeatures = ['fullTextSearch']
-}
-
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
-}
-
-enum role {
- USER
- ADMIN
-}
-
-model User {
- id String @id
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- email String @unique
- role role @default(USER)
- posts post_Item[]
-}
-
-model post_Item {
- id String @id
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- title String
- author User? @relation(fields: [authorId], references: [id])
- authorId String?
- published Boolean @default(false)
- viewCount Int @default(0)
-}
- `);
-
- const { name: output } = tmp.fileSync({ postfix: '.yaml' });
-
- const options = buildOptions(model, modelFile, output);
- await generate(model, options, dmmf);
-
- console.log('OpenAPI specification generated:', output);
-
- await OpenAPIParser.validate(output);
- });
-
- it('auth() in @default()', async () => {
- const { projectDir } = await loadSchema(`
-plugin openapi {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- output = '$projectRoot/openapi.yaml'
- flavor = 'rpc'
-}
-
-model User {
- id Int @id
- posts Post[]
-}
-
-model Post {
- id Int @id
- title String
- author User @relation(fields: [authorId], references: [id])
- authorId Int @default(auth().id)
-}
- `);
-
- const output = path.join(projectDir, 'openapi.yaml');
- console.log('OpenAPI specification generated:', output);
-
- await OpenAPIParser.validate(output);
- const parsed = YAML.parse(fs.readFileSync(output, 'utf-8'));
- expect(parsed.components.schemas.PostCreateInput.required).not.toContain('author');
- expect(parsed.components.schemas.PostCreateManyInput.required).not.toContain('authorId');
- });
-});
-
-function buildOptions(model: Model, modelFile: string, output: string) {
- const optionFields = model.declarations.find((d): d is Plugin => isPlugin(d))?.fields || [];
- const options: any = { schemaPath: modelFile, output, flavor: 'rpc' };
- optionFields.forEach((f) => (options[f.name] = getLiteral(f.value) ?? getObjectLiteral(f.value)));
- return options;
-}
diff --git a/packages/plugins/openapi/tsconfig.json b/packages/plugins/openapi/tsconfig.json
deleted file mode 100644
index bbb5b304b..000000000
--- a/packages/plugins/openapi/tsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "../../../tsconfig.base.json",
- "compilerOptions": {
- "outDir": "dist",
- "strictPropertyInitialization": false
- },
- "include": ["src/**/*.ts"]
-}
diff --git a/packages/plugins/prisma-types.ts b/packages/plugins/prisma-types.ts
deleted file mode 100644
index 3e0b8108a..000000000
--- a/packages/plugins/prisma-types.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-/// Types copied over from Prisma's generated code to avoid being broken due to Prisma upgrades
-
-export type Enumerable = T | Array;
-
-type _TupleToUnion = T extends (infer E)[] ? E : never;
-
-export type TupleToUnion = _TupleToUnion;
-
-export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T;
-
-export type PickEnumerable | keyof T> = Pick>;
-
-type SelectAndInclude = {
- select: any;
- include: any;
-};
-type HasSelect = {
- select: any;
-};
-type HasInclude = {
- include: any;
-};
-
-export type CheckSelect = T extends SelectAndInclude
- ? 'Please either choose `select` or `include`'
- : T extends HasSelect
- ? U
- : T extends HasInclude
- ? U
- : S;
diff --git a/packages/plugins/swr/CHANGELOG.md b/packages/plugins/swr/CHANGELOG.md
deleted file mode 100644
index cc2a59fdc..000000000
--- a/packages/plugins/swr/CHANGELOG.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changelog
-
-## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21)
-
-
-### Miscellaneous Chores
-
-* release 2.0.0-alpha.2 ([f40d7e3](https://github.com/zenstackhq/zenstack/commit/f40d7e3718d4210137a2e131d28b5491d065b914))
diff --git a/packages/plugins/swr/LICENSE b/packages/plugins/swr/LICENSE
deleted file mode 120000
index 5853aaea5..000000000
--- a/packages/plugins/swr/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../../LICENSE
\ No newline at end of file
diff --git a/packages/plugins/swr/README.md b/packages/plugins/swr/README.md
deleted file mode 100644
index e651fe280..000000000
--- a/packages/plugins/swr/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# ZenStack React plugin & runtime
-
-This package contains ZenStack plugin and runtime for ReactJS.
-
-Visit [Homepage](https://zenstack.dev) for more details.
diff --git a/packages/plugins/swr/jest.config.ts b/packages/plugins/swr/jest.config.ts
deleted file mode 120000
index 09c104090..000000000
--- a/packages/plugins/swr/jest.config.ts
+++ /dev/null
@@ -1 +0,0 @@
-../../../jest.config.ts
\ No newline at end of file
diff --git a/packages/plugins/swr/package.json b/packages/plugins/swr/package.json
deleted file mode 100644
index f1c4cc182..000000000
--- a/packages/plugins/swr/package.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "name": "@zenstackhq/swr",
- "displayName": "ZenStack plugin for generating SWR hooks",
- "version": "2.22.2",
- "description": "ZenStack plugin for generating SWR hooks",
- "main": "index.js",
- "repository": {
- "type": "git",
- "url": "https://github.com/zenstackhq/zenstack"
- },
- "scripts": {
- "clean": "rimraf dist",
- "build": "pnpm lint --max-warnings=0 && pnpm clean && tsc && tsup-node --config ./tsup.config.ts && copyfiles ./package.json ./README.md ./LICENSE dist && pnpm pack dist --pack-destination ../../../../.build",
- "watch": "concurrently \"tsc --watch\" \"tsup-node --config ./tsup.config.ts --watch\"",
- "lint": "eslint src --ext ts",
- "test": "jest",
- "prepublishOnly": "pnpm build"
- },
- "publishConfig": {
- "directory": "dist",
- "linkDirectory": true
- },
- "keywords": [],
- "author": "ZenStack Team",
- "license": "MIT",
- "exports": {
- ".": {
- "default": "./index.js"
- },
- "./package.json": {
- "default": "./package.json"
- },
- "./runtime": {
- "types": "./runtime/index.d.ts",
- "import": "./runtime/index.mjs",
- "require": "./runtime/index.js",
- "default": "./runtime/index.js"
- }
- },
- "dependencies": {
- "@zenstackhq/runtime": "workspace:*",
- "@zenstackhq/sdk": "workspace:*",
- "cross-fetch": "^4.0.0",
- "semver": "^7.5.2",
- "ts-morph": "catalog:",
- "ts-pattern": "^4.3.0"
- },
- "peerDependencies": {
- "swr": "2.2.5 - 2"
- },
- "devDependencies": {
- "@tanstack/react-query": "^4.28.0",
- "@testing-library/react": "^14.0.0",
- "@types/react": "18.2.0",
- "@types/semver": "^7.3.13",
- "@types/tmp": "^0.2.3",
- "@zenstackhq/testtools": "workspace:*",
- "nock": "^13.3.6",
- "react": "18.2.0"
- }
-}
diff --git a/packages/plugins/swr/src/generator.ts b/packages/plugins/swr/src/generator.ts
deleted file mode 100644
index a2fee939e..000000000
--- a/packages/plugins/swr/src/generator.ts
+++ /dev/null
@@ -1,393 +0,0 @@
-import {
- PluginOptions,
- RUNTIME_PACKAGE,
- createProject,
- ensureEmptyDir,
- generateModelMeta,
- getDataModels,
- isDelegateModel,
- requireOption,
- resolvePath,
- saveProject,
-} from '@zenstackhq/sdk';
-import { DataModel, DataModelFieldType, Model, isEnum, isTypeDef } from '@zenstackhq/sdk/ast';
-import { getPrismaClientImportSpec, supportCreateMany, type DMMF } from '@zenstackhq/sdk/prisma';
-import { upperCaseFirst, paramCase } from '@zenstackhq/runtime/local-helpers';
-import path from 'path';
-import type { OptionalKind, ParameterDeclarationStructure, Project, SourceFile } from 'ts-morph';
-import { P, match } from 'ts-pattern';
-import { name } from '.';
-
-export async function generate(model: Model, options: PluginOptions, dmmf: DMMF.Document) {
- let outDir = requireOption(options, 'output', name);
- outDir = resolvePath(outDir, options);
- ensureEmptyDir(outDir);
-
- const project = createProject();
- const warnings: string[] = [];
-
- const models = getDataModels(model);
- const typeDefs = model.declarations.filter(isTypeDef);
-
- await generateModelMeta(project, models, typeDefs, {
- output: path.join(outDir, '__model_meta.ts'),
- generateAttributes: false,
- });
-
- generateIndex(project, outDir, models);
-
- models.forEach((dataModel) => {
- const mapping = dmmf.mappings.modelOperations.find((op) => op.model === dataModel.name);
- if (!mapping) {
- warnings.push(`Unable to find mapping for model ${dataModel.name}`);
- return;
- }
- generateModelHooks(project, outDir, dataModel, mapping, options);
- });
-
- await saveProject(project);
- return { warnings };
-}
-
-function generateModelHooks(
- project: Project,
- outDir: string,
- model: DataModel,
- mapping: DMMF.ModelMapping,
- options: PluginOptions
-) {
- const fileName = paramCase(model.name);
- const sf = project.createSourceFile(path.join(outDir, `${fileName}.ts`), undefined, { overwrite: true });
-
- const prismaImport = getPrismaClientImportSpec(outDir, options);
- sf.addImportDeclaration({
- namedImports: ['Prisma'],
- isTypeOnly: true,
- moduleSpecifier: prismaImport,
- });
- sf.addStatements([
- `import { type GetNextArgs, type QueryOptions, type InfiniteQueryOptions, type MutationOptions, type PickEnumerable } from '@zenstackhq/swr/runtime';`,
- `import type { PolicyCrudKind } from '${RUNTIME_PACKAGE}'`,
- `import metadata from './__model_meta';`,
- `import * as request from '@zenstackhq/swr/runtime';`,
- ]);
-
- const modelNameCap = upperCaseFirst(model.name);
-
- const mutationFuncs: string[] = [];
-
- // Note: delegate models don't support create and upsert operations
-
- // create is somehow named "createOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (!isDelegateModel(model) && (mapping.create || (mapping as any).createOne)) {
- const argsType = `Prisma.${model.name}CreateArgs`;
- mutationFuncs.push(generateMutation(sf, model, 'POST', 'create', argsType, false));
- }
-
- // createMany
- if (!isDelegateModel(model) && mapping.createMany && supportCreateMany(model.$container)) {
- const argsType = `Prisma.${model.name}CreateManyArgs`;
- mutationFuncs.push(generateMutation(sf, model, 'POST', 'createMany', argsType, true));
- }
-
- // findMany
- if (mapping.findMany) {
- const argsType = `Prisma.${model.name}FindManyArgs`;
- const inputType = `Prisma.SelectSubset`;
- const returnElement = `Prisma.${model.name}GetPayload`;
- const returnType = `Array<${returnElement}>`;
- const optimisticReturn = `Array<${makeOptimistic(returnElement)}>`;
-
- // regular findMany
- generateQueryHook(sf, model, 'findMany', argsType, inputType, optimisticReturn, undefined, false);
-
- // infinite findMany
- generateQueryHook(sf, model, 'findMany', argsType, inputType, returnType, undefined, true);
- }
-
- // findUnique
- if (mapping.findUnique) {
- const argsType = `Prisma.${model.name}FindUniqueArgs`;
- const inputType = `Prisma.SelectSubset`;
- const returnType = makeOptimistic(`Prisma.${model.name}GetPayload`);
- generateQueryHook(sf, model, 'findUnique', argsType, inputType, returnType, undefined, false);
- }
-
- // findFirst
- if (mapping.findFirst) {
- const argsType = `Prisma.${model.name}FindFirstArgs`;
- const inputType = `Prisma.SelectSubset`;
- const returnType = makeOptimistic(`Prisma.${model.name}GetPayload`);
- generateQueryHook(sf, model, 'findFirst', argsType, inputType, returnType, undefined, false);
- }
-
- // update
- // update is somehow named "updateOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (mapping.update || (mapping as any).updateOne) {
- const argsType = `Prisma.${model.name}UpdateArgs`;
- mutationFuncs.push(generateMutation(sf, model, 'PUT', 'update', argsType, false));
- }
-
- // updateMany
- if (mapping.updateMany) {
- const argsType = `Prisma.${model.name}UpdateManyArgs`;
- mutationFuncs.push(generateMutation(sf, model, 'PUT', 'updateMany', argsType, true));
- }
-
- // upsert
- // upsert is somehow named "upsertOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (!isDelegateModel(model) && (mapping.upsert || (mapping as any).upsertOne)) {
- const argsType = `Prisma.${model.name}UpsertArgs`;
- mutationFuncs.push(generateMutation(sf, model, 'POST', 'upsert', argsType, false));
- }
-
- // del
- // delete is somehow named "deleteOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (mapping.delete || (mapping as any).deleteOne) {
- const argsType = `Prisma.${model.name}DeleteArgs`;
- mutationFuncs.push(generateMutation(sf, model, 'DELETE', 'delete', argsType, false));
- }
-
- // deleteMany
- if (mapping.deleteMany) {
- const argsType = `Prisma.${model.name}DeleteManyArgs`;
- mutationFuncs.push(generateMutation(sf, model, 'DELETE', 'deleteMany', argsType, true));
- }
-
- // aggregate
- if (mapping.aggregate) {
- const argsType = `Prisma.${modelNameCap}AggregateArgs`;
- const inputType = `Prisma.Subset`;
- const returnType = `Prisma.Get${modelNameCap}AggregateType`;
- generateQueryHook(sf, model, 'aggregate', argsType, inputType, returnType);
- }
-
- // groupBy
- if (mapping.groupBy) {
- const useName = model.name;
- const typeParameters = [
- `T extends Prisma.${useName}GroupByArgs`,
- `HasSelectOrTake extends Prisma.Or>, Prisma.Extends<'take', Prisma.Keys>>`,
- `OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.${useName}GroupByArgs['orderBy'] }: { orderBy?: Prisma.${useName}GroupByArgs['orderBy'] },`,
- `OrderFields extends Prisma.ExcludeUnderscoreKeys>>`,
- `ByFields extends Prisma.MaybeTupleToUnion`,
- `ByValid extends Prisma.Has`,
- `HavingFields extends Prisma.GetHavingFields`,
- `HavingValid extends Prisma.Has`,
- `ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False`,
- `InputErrors extends ByEmpty extends Prisma.True
- ? \`Error: "by" must not be empty.\`
- : HavingValid extends Prisma.False
- ? {
- [P in HavingFields]: P extends ByFields
- ? never
- : P extends string
- ? \`Error: Field "\${P}" used in "having" needs to be provided in "by".\`
- : [
- Error,
- 'Field ',
- P,
- \` in "having" needs to be provided in "by"\`,
- ]
- }[HavingFields]
- : 'take' extends Prisma.Keys
- ? 'orderBy' extends Prisma.Keys
- ? ByValid extends Prisma.True
- ? {}
- : {
- [P in OrderFields]: P extends ByFields
- ? never
- : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
- }[OrderFields]
- : 'Error: If you provide "take", you also need to provide "orderBy"'
- : 'skip' extends Prisma.Keys
- ? 'orderBy' extends Prisma.Keys
- ? ByValid extends Prisma.True
- ? {}
- : {
- [P in OrderFields]: P extends ByFields
- ? never
- : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
- }[OrderFields]
- : 'Error: If you provide "skip", you also need to provide "orderBy"'
- : ByValid extends Prisma.True
- ? {}
- : {
- [P in OrderFields]: P extends ByFields
- ? never
- : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
- }[OrderFields]`,
- ];
- const inputType = `Prisma.SubsetIntersection & InputErrors`;
- const returnType = `{} extends InputErrors ?
- Array &
- {
- [P in ((keyof T) & (keyof Prisma.${modelNameCap}GroupByOutputType))]: P extends '_count'
- ? T[P] extends boolean
- ? number
- : Prisma.GetScalarType
- : Prisma.GetScalarType
- }
- > : InputErrors`;
- generateQueryHook(sf, model, 'groupBy', '', inputType, returnType, typeParameters);
- }
-
- // somehow dmmf doesn't contain "count" operation, so we unconditionally add it here
- {
- const argsType = `Prisma.${model.name}CountArgs`;
- const inputType = `Prisma.Subset`;
- const returnType = `T extends { select: any; } ? T['select'] extends true ? number : Prisma.GetScalarType : number`;
- generateQueryHook(sf, model, 'count', argsType, inputType, returnType);
- }
-
- // extra `check` hook for ZenStack's permission checker API
- {
- generateCheckHook(sf, model, prismaImport);
- }
-}
-
-function makeOptimistic(returnType: string) {
- return `${returnType} & { $optimistic?: boolean }`;
-}
-
-function generateIndex(project: Project, outDir: string, models: DataModel[]) {
- const sf = project.createSourceFile(path.join(outDir, 'index.ts'), undefined, { overwrite: true });
- sf.addStatements(models.map((d) => `export * from './${paramCase(d.name)}';`));
- sf.addStatements(`export { Provider } from '@zenstackhq/swr/runtime';`);
- sf.addStatements(`export { default as metadata } from './__model_meta';`);
-}
-
-function generateQueryHook(
- sf: SourceFile,
- model: DataModel,
- operation: string,
- argsType: string,
- inputType: string,
- returnType: string,
- typeParameters?: string[],
- infinite = false
-) {
- const typeParams = typeParameters ? [...typeParameters] : [`T extends ${argsType}`];
- if (infinite) {
- typeParams.push(`R extends ${returnType}`);
- }
-
- const parameters: OptionalKind[] = [];
- if (!infinite) {
- parameters.push({
- name: 'args?',
- type: inputType,
- });
- } else {
- parameters.push({
- name: 'getNextArgs',
- type: `GetNextArgs<${inputType} | undefined, R>`,
- });
- }
- parameters.push({
- name: 'options?',
- type: infinite ? `InfiniteQueryOptions<${returnType}>` : `QueryOptions<${returnType}>`,
- });
-
- sf.addFunction({
- name: `use${infinite ? 'Infinite' : ''}${upperCaseFirst(operation)}${model.name}`,
- typeParameters: typeParams,
- isExported: true,
- parameters,
- })
- .addBody()
- .addStatements([
- !infinite
- ? `return request.useModelQuery('${model.name}', '${operation}', args, options);`
- : `return request.useInfiniteModelQuery('${model.name}', '${operation}', getNextArgs, options);`,
- ]);
-}
-
-function generateMutation(
- sf: SourceFile,
- model: DataModel,
- method: 'POST' | 'PUT' | 'PATCH' | 'DELETE',
- operation: string,
- argsType: string,
- batchResult: boolean
-) {
- // non-batch mutations are subject to read-back check
- const checkReadBack = !batchResult;
- const genericReturnType = batchResult ? 'Prisma.BatchPayload' : `Prisma.${model.name}GetPayload | undefined`;
- const returnType = batchResult ? 'Prisma.BatchPayload' : `Prisma.${model.name}GetPayload<${argsType}> | undefined`;
- const genericInputType = `Prisma.SelectSubset`;
-
- const funcName = `${operation}${model.name}`;
-
- // generate mutation hook
- sf.addFunction({
- name: `use${upperCaseFirst(operation)}${model.name}`,
- isExported: true,
- parameters: [
- {
- name: 'options?',
- type: `MutationOptions<${returnType}, unknown, ${argsType}>`,
- },
- ],
- })
- .addBody()
- .addStatements([
- `const mutation = request.useModelMutation('${model.name}', '${method}', '${operation}', metadata, options, ${checkReadBack});`,
- `return {
- ...mutation,
- trigger: (args: ${genericInputType}) => {
- return mutation.trigger(args, options as any) as Promise<${genericReturnType}>;
- }
- };`,
- ]);
-
- return funcName;
-}
-
-function generateCheckHook(sf: SourceFile, model: DataModel, prismaImport: string) {
- const mapFilterType = (type: DataModelFieldType) => {
- return match(type.type)
- .with(P.union('Int', 'BigInt'), () => 'number')
- .with('String', () => 'string')
- .with('Boolean', () => 'boolean')
- .otherwise(() => undefined);
- };
-
- const filterFields: Array<{ name: string; type: string }> = [];
- const enumsToImport = new Set();
-
- // collect filterable fields and enums to import
- model.fields.forEach((f) => {
- if (isEnum(f.type.reference?.ref)) {
- enumsToImport.add(f.type.reference.$refText);
- filterFields.push({ name: f.name, type: f.type.reference.$refText });
- }
-
- const mappedType = mapFilterType(f.type);
- if (mappedType) {
- filterFields.push({ name: f.name, type: mappedType });
- }
- });
-
- if (enumsToImport.size > 0) {
- // import enums
- sf.addStatements(`import type { ${Array.from(enumsToImport).join(', ')} } from '${prismaImport}';`);
- }
-
- const whereType = `{ ${filterFields.map(({ name, type }) => `${name}?: ${type}`).join('; ')} }`;
-
- const func = sf.addFunction({
- name: `useCheck${model.name}`,
- isExported: true,
- parameters: [
- { name: 'args', type: `{ operation: PolicyCrudKind; where?: ${whereType}; }` },
- { name: 'options?', type: `QueryOptions` },
- ],
- });
-
- func.addStatements(`return request.useModelQuery('${model.name}', 'check', args, options);`);
-}
diff --git a/packages/plugins/swr/src/index.ts b/packages/plugins/swr/src/index.ts
deleted file mode 100644
index 16ae20c05..000000000
--- a/packages/plugins/swr/src/index.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import type { PluginFunction } from '@zenstackhq/sdk';
-import { generate } from './generator';
-
-export const name = 'SWR';
-
-const run: PluginFunction = async (model, options, dmmf) => {
- if (!dmmf) {
- throw new Error('DMMF is required');
- }
- return generate(model, options, dmmf);
-};
-
-export default run;
diff --git a/packages/plugins/swr/src/runtime/index.ts b/packages/plugins/swr/src/runtime/index.ts
deleted file mode 100644
index 9f1df0b8e..000000000
--- a/packages/plugins/swr/src/runtime/index.ts
+++ /dev/null
@@ -1,552 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-import { deserialize, serialize } from '@zenstackhq/runtime/browser';
-import {
- applyMutation,
- getMutatedModels,
- getReadModels,
- type ModelMeta,
- type PrismaWriteActionType,
-} from '@zenstackhq/runtime/cross';
-import { lowerCaseFirst } from '@zenstackhq/runtime/local-helpers';
-import { createContext, useContext } from 'react';
-import type { Cache, Fetcher, SWRConfiguration, SWRResponse } from 'swr';
-import useSWR, { useSWRConfig } from 'swr';
-import { ScopedMutator } from 'swr/_internal';
-import useSWRInfinite, {
- unstable_serialize,
- type SWRInfiniteConfiguration,
- type SWRInfiniteFetcher,
- type SWRInfiniteResponse,
-} from 'swr/infinite';
-import useSWRMutation, { type SWRMutationConfiguration } from 'swr/mutation';
-export * from './prisma-types';
-
-/**
- * Function signature for `fetch`.
- */
-export type FetchFn = (url: string, options?: RequestInit) => Promise;
-
-/**
- * Context type for configuring react hooks.
- */
-export type RequestHandlerContext = {
- /**
- * The endpoint to use for the queries.
- */
- endpoint?: string;
-
- /**
- * A custom fetch function for sending the HTTP requests.
- */
- fetch?: FetchFn;
-
- /**
- * If logging is enabled.
- */
- logging?: boolean;
-};
-
-const DEFAULT_QUERY_ENDPOINT = '/api/model';
-
-/**
- * Context for configuring react hooks.
- */
-export const RequestHandlerContext = createContext({
- endpoint: DEFAULT_QUERY_ENDPOINT,
- fetch: undefined,
-});
-
-/**
- * Context provider.
- */
-export const Provider = RequestHandlerContext.Provider;
-
-/**
- * Hooks context.
- */
-export function useHooksContext() {
- const { endpoint, ...rest } = useContext(RequestHandlerContext);
- return { endpoint: endpoint ?? DEFAULT_QUERY_ENDPOINT, ...rest };
-}
-
-/**
- * Regular query options.
- */
-export type QueryOptions = {
- /**
- * Disable data fetching
- */
- disabled?: boolean;
-
- /**
- * Whether to enable automatic optimistic update. Defaults to `true`.
- */
- optimisticUpdate?: boolean;
-} & Omit>, 'fetcher'>;
-
-/**
- * Infinite query options.
- */
-export type InfiniteQueryOptions = {
- /**
- * Disable data fetching
- */
- disabled?: boolean;
-} & Omit>, 'fetcher'>;
-
-const QUERY_KEY_PREFIX = 'zenstack:query';
-const MUTATION_KEY_PREFIX = 'zenstack:mutation';
-
-type QueryKey = {
- prefix: typeof QUERY_KEY_PREFIX;
- model: string;
- operation: string;
- args?: unknown;
- infinite?: boolean;
- optimisticUpdate?: boolean;
-};
-
-/**
- * Result of optimistic data provider.
- */
-export type OptimisticDataProviderResult = {
- /**
- * Kind of the result.
- * - Update: use the `data` field to update the query cache.
- * - Skip: skip the optimistic update for this query.
- * - ProceedDefault: proceed with the default optimistic update.
- */
- kind: 'Update' | 'Skip' | 'ProceedDefault';
-
- /**
- * Data to update the query cache. Only applicable if `kind` is 'Update'.
- *
- * If the data is an object with fields updated, it should have a `$optimistic`
- * field set to `true`. If it's an array and an element object is created or updated,
- * the element should have a `$optimistic` field set to `true`.
- */
- data?: any;
-};
-
-/**
- * Optimistic data provider.
- *
- * @param args Arguments.
- * @param args.queryModel The model of the query.
- * @param args.queryOperation The operation of the query, `findMany`, `count`, etc.
- * @param args.queryArgs The arguments of the query.
- * @param args.currentData The current cache data for the query.
- * @param args.mutationArgs The arguments of the mutation.
- */
-export type OptimisticDataProvider = (args: {
- queryModel: string;
- queryOperation: string;
- queryArgs: any;
- currentData: any;
- mutationArgs: any;
-}) => OptimisticDataProviderResult | Promise;
-
-/**
- * Mutation options.
- */
-export type MutationOptions = {
- /**
- * Whether to automatically optimistic-update queries potentially impacted. Defaults to `false`.
- */
- optimisticUpdate?: boolean;
-
- /**
- * A callback for computing optimistic update data for each query cache entry.
- */
- optimisticDataProvider?: OptimisticDataProvider;
-} & Omit, 'fetcher'>;
-
-/**
- * Computes query key for the given model, operation, query args, and options.
- */
-export function getQueryKey(
- model: string,
- operation: string,
- args?: unknown,
- infinite?: boolean,
- optimisticUpdate?: boolean
-) {
- return JSON.stringify({
- prefix: QUERY_KEY_PREFIX,
- model,
- operation,
- args,
- infinite: infinite === true,
- optimisticUpdate: optimisticUpdate !== false,
- });
-}
-
-function getMutationKey(model: string, operation: string) {
- // use a random key since we don't have 1:1 mapping between mutation and query
- // https://github.com/vercel/swr/discussions/2461#discussioncomment-5281784
- return JSON.stringify({ prefix: MUTATION_KEY_PREFIX, model, operation, r: Date.now() });
-}
-
-function parseQueryKey(key: unknown): QueryKey | undefined {
- let keyValue: any = key;
- if (typeof key === 'string') {
- try {
- keyValue = JSON.parse(key);
- } catch {
- return undefined;
- }
- }
- return keyValue?.prefix === QUERY_KEY_PREFIX ? (keyValue as QueryKey) : undefined;
-}
-
-/**
- * Makes a model query with SWR.
- *
- * @param model Model name
- * @param operation Prisma operation (e.g, `findMany`)
- * @param args The request args object, which will be superjson-stringified and appended as "?q=" parameter
- * @param options Query options
- * @returns SWR response
- */
-export function useModelQuery(
- model: string,
- operation: string,
- args?: unknown,
- options?: QueryOptions
-): SWRResponse {
- const { endpoint, fetch } = useHooksContext();
- const key = options?.disabled
- ? null
- : getQueryKey(model, operation, args, false, options?.optimisticUpdate !== false);
- const url = makeUrl(`${endpoint}/${lowerCaseFirst(model)}/${operation}`, args);
- return useSWR(key, () => fetcher(url, undefined, fetch, false), options);
-}
-
-/**
- * Function for computing the query args for fetching a page during an infinite query.
- */
-export type GetNextArgs = (pageIndex: number, previousPageData: Result | null) => Args | null;
-
-/**
- * Makes an infinite GET request with SWR.
- *
- * @param model Model name
- * @param operation Prisma operation (e.g, `findMany`)
- * @param getNextArgs Function for computing the query args for a page
- * @param options Query options
- * @returns SWR infinite query response
- */
-export function useInfiniteModelQuery(
- model: string,
- operation: string,
- getNextArgs: GetNextArgs,
- options?: InfiniteQueryOptions
-): SWRInfiniteResponse {
- const { endpoint, fetch } = useHooksContext();
-
- const getKey = (pageIndex: number, previousPageData: Result | null) => {
- if (options?.disabled) {
- return null;
- }
- const nextArgs = getNextArgs(pageIndex, previousPageData);
- return nextArgs !== null // null means reached the end
- ? getQueryKey(model, operation, nextArgs, true, false)
- : null;
- };
-
- return useSWRInfinite(
- getKey,
- (key: unknown) => {
- const parsedKey = parseQueryKey(key);
- if (parsedKey) {
- const { model, operation, args } = parsedKey;
- const url = makeUrl(`${endpoint}/${lowerCaseFirst(model)}/${operation}`, args);
- return fetcher(url, undefined, fetch, false);
- } else {
- throw new Error('Invalid query key: ' + key);
- }
- },
- options
- );
-}
-
-export function useModelMutation(
- model: string,
- method: 'POST' | 'PUT' | 'DELETE',
- operation: string,
- modelMeta: ModelMeta,
- options?: MutationOptions,
- checkReadBack?: CheckReadBack
-) {
- const { endpoint, fetch, logging } = useHooksContext();
- const invalidate = options?.revalidate !== false ? useInvalidation(model, modelMeta) : undefined;
- const { cache, mutate } = useSWRConfig();
-
- return useSWRMutation(
- getMutationKey(model, operation),
- (_key, { arg }: { arg: any }) => {
- if (options?.optimisticUpdate) {
- optimisticUpdate(model, operation, arg, options, modelMeta, cache, mutate, logging);
- }
- const url = `${endpoint}/${lowerCaseFirst(model)}/${operation}`;
- return mutationRequest(method, url, arg, invalidate, fetch, checkReadBack);
- },
- options
- );
-}
-
-/**
- * Makes a mutation request.
- *
- * @param url The request URL
- * @param data The request data
- * @param invalidate Function for invalidating a query
- */
-export async function mutationRequest(
- method: 'POST' | 'PUT' | 'DELETE',
- url: string,
- data: unknown,
- invalidate?: Invalidator,
- fetch?: FetchFn,
- checkReadBack?: C
-): Promise {
- const reqUrl = method === 'DELETE' ? makeUrl(url, data) : url;
- const r = await fetcher(
- reqUrl,
- {
- method,
- headers: {
- 'content-type': 'application/json',
- },
- body: data ? marshal(data) : undefined,
- },
- fetch,
- checkReadBack
- );
-
- if (invalidate) {
- await invalidate(getOperationFromUrl(url), data);
- }
- return r;
-}
-
-// function for invalidating queries related to mutation represented by its operation and args
-type Invalidator = (operation: string, args?: unknown) => ReturnType;
-
-export function useInvalidation(model: string, modelMeta: ModelMeta): Invalidator {
- // https://swr.vercel.app/docs/advanced/cache#mutate-multiple-keys-from-regex
- const { logging } = useHooksContext();
- const { cache, mutate } = useSWRConfig();
- return async (operation: string, args: unknown) => {
- if (!(cache instanceof Map)) {
- throw new Error('mutate requires the cache provider to be a Map instance');
- }
-
- const mutatedModels = await getMutatedModels(model, operation as PrismaWriteActionType, args, modelMeta);
-
- const keys = Array.from(cache.keys()).filter((key: unknown) => {
- const parsedKey = parseQueryKey(key);
- if (!parsedKey) {
- return false;
- }
- const modelsRead = getReadModels(parsedKey.model, modelMeta, parsedKey.args);
- return modelsRead.some((m) => mutatedModels.includes(m));
- });
-
- if (logging) {
- keys.forEach((key) => {
- console.log(`Invalidating query ${key} due to mutation "${model}.${operation}"`);
- });
- }
-
- const mutations = keys.map((key) => {
- const parsedKey = parseQueryKey(key);
- // FIX: special handling for infinite query keys, but still not working
- // https://github.com/vercel/swr/discussions/2843
- return mutate(parsedKey?.infinite ? unstable_serialize(() => key) : key);
- });
- return Promise.all(mutations);
- };
-}
-
-/**
- * Makes fetch request for queries and mutations.
- */
-export async function fetcher(
- url: string,
- options?: RequestInit,
- customFetch?: FetchFn,
- checkReadBack?: C
-): Promise {
- // Note: 'cross-fetch' is supposed to handle fetch compatibility
- // but it doesn't work for cloudflare workers
- const _fetch =
- customFetch ??
- // check if fetch is available globally
- (typeof fetch === 'function'
- ? fetch
- : // fallback to 'cross-fetch' if otherwise
- (await import('cross-fetch')).default);
-
- const res = await _fetch(url, options);
- if (!res.ok) {
- const errData = unmarshal(await res.text());
- if (
- checkReadBack !== false &&
- errData.error?.prisma &&
- errData.error?.code === 'P2004' &&
- errData.error?.reason === 'RESULT_NOT_READABLE'
- ) {
- // policy doesn't allow mutation result to be read back, just return undefined
- return undefined as any;
- }
- const error: Error & { info?: unknown; status?: number } = new Error(
- 'An error occurred while fetching the data.'
- );
- error.info = errData.error;
- error.status = res.status;
- throw error;
- }
-
- const textResult = await res.text();
- try {
- return unmarshal(textResult).data as R;
- } catch (err) {
- console.error(`Unable to deserialize data:`, textResult);
- throw err;
- }
-}
-
-function marshal(value: unknown) {
- const { data, meta } = serialize(value);
- if (meta) {
- return JSON.stringify({ ...(data as any), meta: { serialization: meta } });
- } else {
- return JSON.stringify(data);
- }
-}
-
-function unmarshal(value: string) {
- const parsed = JSON.parse(value);
- if (typeof parsed === 'object' && parsed?.data && parsed?.meta?.serialization) {
- const deserializedData = deserialize(parsed.data, parsed.meta.serialization);
- return { ...parsed, data: deserializedData };
- } else {
- return parsed;
- }
-}
-
-function makeUrl(url: string, args: unknown) {
- if (!args) {
- return url;
- }
-
- const { data, meta } = serialize(args);
- let result = `${url}?q=${encodeURIComponent(JSON.stringify(data))}`;
- if (meta) {
- result += `&meta=${encodeURIComponent(JSON.stringify({ serialization: meta }))}`;
- }
- return result;
-}
-
-function getOperationFromUrl(url: string) {
- const parts = url.split('/');
- const r = parts.pop();
- if (!r) {
- throw new Error(`Invalid URL: ${url}`);
- } else {
- return r;
- }
-}
-
-async function optimisticUpdate(
- mutationModel: string,
- mutationOp: string,
- mutationArgs: any,
- options: MutationOptions | undefined,
- modelMeta: ModelMeta,
- cache: Cache,
- mutator: ScopedMutator,
- logging = false
-) {
- const optimisticPromises: Array> = [];
- for (const key of cache.keys()) {
- const parsedKey = parseQueryKey(key);
- if (!parsedKey) {
- continue;
- }
-
- if (!parsedKey.optimisticUpdate) {
- if (logging) {
- console.log(`Skipping optimistic update for ${key} due to opt-out`);
- }
- continue;
- }
-
- const cacheValue = cache.get(key);
- if (cacheValue?.error) {
- if (logging) {
- console.warn(`Skipping optimistic update for ${key} due to error:`, cacheValue.error);
- }
- continue;
- }
-
- if (options?.optimisticDataProvider) {
- const providerResult = await options.optimisticDataProvider({
- queryModel: parsedKey.model,
- queryOperation: parsedKey.operation,
- queryArgs: parsedKey.args,
- currentData: cacheValue?.data,
- mutationArgs,
- });
-
- if (providerResult?.kind === 'Skip') {
- if (logging) {
- console.log(`Skipping optimistic update for ${key} due to custom provider`);
- }
- continue;
- } else if (providerResult?.kind === 'Update') {
- if (logging) {
- console.log(`Optimistically updating query ${JSON.stringify(key)} due to provider`);
- }
- optimisticPromises.push(mutator(key, providerResult.data, { revalidate: false }));
- continue;
- }
- }
-
- if (!cacheValue) {
- continue;
- }
-
- const mutatedData = await applyMutation(
- parsedKey.model,
- parsedKey.operation,
- cacheValue.data,
- mutationModel,
- mutationOp as PrismaWriteActionType,
- mutationArgs,
- modelMeta,
- logging
- );
-
- if (mutatedData !== undefined) {
- // mutation applicable to this query, update cache
- if (logging) {
- console.log(
- `Optimistically updating query ${JSON.stringify(
- key
- )} due to mutation "${mutationModel}.${mutationOp}"`
- );
- }
- optimisticPromises.push(
- mutator(key, mutatedData, {
- // don't trigger revalidation here since we will do it
- // when the remote mutation succeeds
- revalidate: false,
- })
- );
- }
- }
-
- return Promise.all(optimisticPromises);
-}
diff --git a/packages/plugins/swr/src/runtime/prisma-types.ts b/packages/plugins/swr/src/runtime/prisma-types.ts
deleted file mode 120000
index 277b4b133..000000000
--- a/packages/plugins/swr/src/runtime/prisma-types.ts
+++ /dev/null
@@ -1 +0,0 @@
-../../../prisma-types.ts
\ No newline at end of file
diff --git a/packages/plugins/swr/tests/react-hooks.test.tsx b/packages/plugins/swr/tests/react-hooks.test.tsx
deleted file mode 100644
index 78f41a40b..000000000
--- a/packages/plugins/swr/tests/react-hooks.test.tsx
+++ /dev/null
@@ -1,755 +0,0 @@
-/**
- * @jest-environment jsdom
- */
-
-/* eslint-disable @typescript-eslint/ban-ts-comment */
-/* eslint-disable @typescript-eslint/no-explicit-any */
-///
-
-import { renderHook, waitFor } from '@testing-library/react';
-import { lowerCaseFirst } from '@zenstackhq/runtime/local-helpers';
-import nock from 'nock';
-import { SWRConfig, useSWRConfig } from 'swr';
-import {
- RequestHandlerContext,
- getQueryKey,
- mutationRequest,
- useModelQuery,
- useInvalidation,
- useModelMutation,
-} from '../src/runtime';
-import { modelMeta } from './test-model-meta';
-import React from 'react';
-
-const ENDPOINT = 'http://localhost/api/model';
-
-function makeUrl(model: string, operation: string, args?: unknown) {
- let r = `${ENDPOINT}/${lowerCaseFirst(model)}/${operation}`;
- if (args) {
- r += `?q=${encodeURIComponent(JSON.stringify(args))}`;
- }
- return r;
-}
-
-describe('SWR React Hooks Test', () => {
- // let cache: Map;
- const wrapper = ({ children }: { children: React.ReactNode }) => (
-
-
- {children}
-
-
- );
-
- beforeEach(async () => {
- nock.cleanAll();
- const { result } = renderHook(() => useSWRConfig());
- await waitFor(async () => {
- await result.current.mutate(() => true, undefined, { revalidate: false });
- });
- // await result.current.mutate(() => true, undefined, { revalidate: false });
- });
-
- it('simple query', async () => {
- const queryArgs = { where: { id: '1' } };
- const data = { id: '1', name: 'foo' };
-
- nock(makeUrl('User', 'findUnique', queryArgs))
- .get(/.*/)
- .reply(200, () => {
- console.log('Query data:', data);
- return {
- data,
- };
- });
-
- const { result } = renderHook(() => useModelQuery('User', 'findUnique', queryArgs), { wrapper });
-
- await waitFor(() => {
- expect(result.current.data).toMatchObject(data);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findUnique', queryArgs));
- expect(cacheData?.data).toMatchObject(data);
- });
- });
-
- it('create and invalidation legacy', async () => {
- const data: any[] = [];
-
- nock(makeUrl('User', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findMany'), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(0);
- });
-
- nock(makeUrl('User', 'create'))
- .post(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.push({ id: '1', name: 'foo' });
- return { data: data[0] };
- });
-
- const { result: invalidationResult } = renderHook(() => useInvalidation('User', modelMeta));
-
- await waitFor(async () => {
- const mutate = invalidationResult.current;
- const r = await mutationRequest(
- 'POST',
- makeUrl('User', 'create', undefined),
- { data: { name: 'foo' } },
- mutate
- );
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany', undefined));
- expect(cacheData?.data).toHaveLength(1);
- });
- });
-
- it('create and invalidation hooks with invalidation', async () => {
- const data: any[] = [];
-
- nock(makeUrl('User', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findMany'), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(0);
- });
-
- nock(makeUrl('User', 'create'))
- .post(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.push({ id: '1', name: 'foo' });
- return { data: data[0] };
- });
-
- const { result: useMutateResult } = renderHook(() => useModelMutation('User', 'POST', 'create', modelMeta), {
- wrapper,
- });
-
- await waitFor(async () => {
- const { trigger } = useMutateResult.current;
- const r = await trigger({ data: { name: 'foo' } });
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany', undefined));
- expect(cacheData?.data).toHaveLength(1);
- });
- });
-
- it('create and invalidation hooks no invalidation', async () => {
- const data: any[] = [];
-
- nock(makeUrl('User', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findMany'), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(0);
- });
-
- nock(makeUrl('User', 'create'))
- .post(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.push({ id: '1', name: 'foo' });
- return { data: data[0] };
- });
-
- const { result: useMutateResult } = renderHook(
- () => useModelMutation('User', 'POST', 'create', modelMeta, { revalidate: false }),
- {
- wrapper,
- }
- );
-
- await waitFor(async () => {
- const { trigger } = useMutateResult.current;
- const r = await trigger({ data: { name: 'foo' } });
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany', undefined));
- expect(cacheData?.data).toHaveLength(0);
- });
- });
-
- it('update and invalidation legacy', async () => {
- const queryArgs = { where: { id: '1' } };
- const data = { id: '1', name: 'foo' };
-
- nock(makeUrl('User', 'findUnique', queryArgs))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findUnique', queryArgs), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toMatchObject({ name: 'foo' });
- });
-
- nock(makeUrl('User', 'update'))
- .put(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.name = 'bar';
- return data;
- });
-
- const { result: useMutateResult } = renderHook(() => useInvalidation('User', modelMeta));
-
- await waitFor(async () => {
- const mutate = useMutateResult.current;
- const r = await mutationRequest(
- 'PUT',
- makeUrl('User', 'update', undefined),
- { ...queryArgs, data: { name: 'bar' } },
- mutate
- );
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findUnique', queryArgs));
- expect(cacheData?.data).toMatchObject({ name: 'bar' });
- });
- });
-
- it('update and invalidation hooks', async () => {
- const queryArgs = { where: { id: '1' } };
- const data = { id: '1', name: 'foo' };
-
- nock(makeUrl('User', 'findUnique', queryArgs))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findUnique', queryArgs), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toMatchObject({ name: 'foo' });
- });
-
- nock(makeUrl('User', 'update'))
- .put(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.name = 'bar';
- return data;
- });
-
- const { result: useMutateResult } = renderHook(() => useModelMutation('User', 'PUT', 'update', modelMeta), {
- wrapper,
- });
-
- await waitFor(async () => {
- const { trigger } = useMutateResult.current;
- const r = await trigger({ ...queryArgs, data: { name: 'bar' } });
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findUnique', queryArgs));
- expect(cacheData?.data).toMatchObject({ name: 'bar' });
- });
- });
-
- it('top-level mutation and nested-read invalidation', async () => {
- const queryArgs = { where: { id: '1' }, include: { posts: true } };
- const data = { posts: [{ id: '1', title: 'post1' }] };
-
- nock(makeUrl('User', 'findUnique', queryArgs))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findUnique', queryArgs), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toMatchObject(data);
- });
-
- nock(makeUrl('Post', 'update'))
- .put(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.posts[0].title = 'post2';
- return data;
- });
-
- const { result: useMutateResult } = renderHook(() => useInvalidation('Post', modelMeta));
-
- await waitFor(async () => {
- const mutate = useMutateResult.current;
- const r = await mutationRequest(
- 'PUT',
- makeUrl('Post', 'update', undefined),
- { where: { id: '1' }, data: { name: 'post2' } },
- mutate
- );
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findUnique', queryArgs));
- expect(cacheData?.data.posts[0].title).toBe('post2');
- });
- });
-
- it('nested mutation and top-level-read invalidation', async () => {
- const data = [{ id: '1', title: 'post1', ownerId: '1' }];
-
- nock(makeUrl('Post', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('Post', 'findMany'), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toMatchObject(data);
- });
-
- nock(makeUrl('User', 'update'))
- .put(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.push({ id: '2', title: 'post2', ownerId: '1' });
- return data;
- });
-
- const { result: useMutateResult } = renderHook(() => useInvalidation('User', modelMeta));
-
- await waitFor(async () => {
- const mutate = useMutateResult.current;
- const r = await mutationRequest(
- 'PUT',
- makeUrl('User', 'update', undefined),
- { where: { id: '1' }, data: { posts: { create: { title: 'post2' } } } },
- mutate
- );
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('Post', 'findMany'));
- expect(cacheData?.data).toHaveLength(2);
- });
- });
-
- it('independent mutation and query', async () => {
- const queryArgs = { where: { id: '1' } };
- const data = { id: '1', name: 'foo' };
-
- let queryCount = 0;
- nock(makeUrl('User', 'findUnique', queryArgs))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- queryCount++;
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findUnique', queryArgs), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toMatchObject({ name: 'foo' });
- });
-
- nock(makeUrl('Post', 'create'))
- .post(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- return { data: { id: '1', title: 'post1' } };
- });
-
- const { result: useMutateResult } = renderHook(() => useInvalidation('Post', modelMeta));
- await waitFor(async () => {
- const mutate = useMutateResult.current;
- const r = await mutationRequest(
- 'POST',
- makeUrl('Post', 'create', undefined),
- { data: { title: 'post1' } },
- mutate
- );
- console.log('Mutate result:', r);
- // no refetch caused by invalidation
- expect(queryCount).toBe(1);
- });
- });
-
- it('cascaded delete', async () => {
- const data: any[] = [{ id: '1', title: 'post1', ownerId: '1' }];
-
- nock(makeUrl('Post', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('Post', 'findMany'), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(1);
- });
-
- nock(makeUrl('User', 'delete'))
- .delete(/.*/)
- .reply(200, () => {
- console.log('Mutating data');
- data.pop();
- return { data: { id: '1' } };
- });
-
- const { result: useMutateResult } = renderHook(() => useInvalidation('User', modelMeta));
-
- await waitFor(async () => {
- const mutate = useMutateResult.current;
- await mutationRequest('DELETE', makeUrl('User', 'delete', undefined), { where: { id: '1' } }, mutate);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('Post', 'findMany'));
- expect(cacheData?.data).toHaveLength(0);
- });
- });
-
- it('optimistic create single', async () => {
- const data: any[] = [];
-
- nock(makeUrl('User', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findMany'), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(0);
- });
-
- nock(makeUrl('User', 'create'))
- .post(/.*/)
- .reply(200, () => {
- console.log('Not mutating data');
- return { data: null };
- });
-
- const { result: useMutateResult } = renderHook(
- () => useModelMutation('User', 'POST', 'create', modelMeta, { optimisticUpdate: true, revalidate: false }),
- {
- wrapper,
- }
- );
-
- await waitFor(async () => {
- const { trigger } = useMutateResult.current;
- const r = await trigger({ data: { name: 'foo' } });
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany'));
- expect(cacheData?.data).toHaveLength(1);
- });
- });
-
- it('optimistic create many', async () => {
- const data: any[] = [];
-
- nock(makeUrl('User', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findMany'), {
- wrapper,
- });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(0);
- });
-
- nock(makeUrl('User', 'createMany'))
- .post(/.*/)
- .reply(200, () => {
- console.log('Not mutating data');
- return { data: null };
- });
-
- const { result: mutationResult } = renderHook(
- () =>
- useModelMutation('User', 'POST', 'createMany', modelMeta, {
- optimisticUpdate: true,
- revalidate: false,
- }),
- {
- wrapper,
- }
- );
-
- await waitFor(async () => {
- const { trigger } = mutationResult.current;
- await trigger({ data: [{ name: 'foo' }, { name: 'bar' }] });
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany'));
- expect(cacheData?.data).toHaveLength(2);
- });
- });
-
- it('optimistic update', async () => {
- const queryArgs = { where: { id: '1' } };
- const data = { id: '1', name: 'foo' };
-
- nock(makeUrl('User', 'findUnique', queryArgs))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findUnique', queryArgs), {
- wrapper,
- });
- await waitFor(() => {
- expect(result.current.data).toMatchObject({ name: 'foo' });
- });
-
- nock(makeUrl('User', 'update'))
- .put(/.*/)
- .reply(200, () => {
- console.log('Not mutating data');
- return data;
- });
-
- const { result: mutationResult } = renderHook(
- () =>
- useModelMutation('User', 'PUT', 'update', modelMeta, {
- optimisticUpdate: true,
- revalidate: false,
- }),
- {
- wrapper,
- }
- );
-
- await waitFor(async () => {
- await mutationResult.current.trigger({ ...queryArgs, data: { name: 'bar' } });
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findUnique', queryArgs));
- expect(cacheData?.data).toMatchObject({ name: 'bar', $optimistic: true });
- });
- });
-
- it('optimistic delete', async () => {
- const data: any[] = [{ id: '1', name: 'foo' }];
-
- nock(makeUrl('User', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findMany'), {
- wrapper,
- });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(1);
- });
-
- nock(makeUrl('User', 'delete'))
- .delete(/.*/)
- .reply(200, () => {
- console.log('Not mutating data');
- return { data };
- });
-
- const { result: mutationResult } = renderHook(
- () =>
- useModelMutation('User', 'DELETE', 'delete', modelMeta, {
- optimisticUpdate: true,
- revalidate: false,
- }),
- {
- wrapper,
- }
- );
-
- await waitFor(async () => await mutationResult.current.trigger({ where: { id: '1' } }));
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany'));
- expect(cacheData?.data).toHaveLength(0);
- });
- });
-
- it('optimistic create with custom provider', async () => {
- const data: any[] = [];
-
- nock(makeUrl('User', 'findMany'))
- .get(/.*/)
- .reply(200, () => {
- console.log('Querying data:', JSON.stringify(data));
- return { data };
- })
- .persist();
-
- const { result } = renderHook(() => useModelQuery('User', 'findMany'), { wrapper });
- await waitFor(() => {
- expect(result.current.data).toHaveLength(0);
- });
-
- nock(makeUrl('User', 'create'))
- .post(/.*/)
- .reply(200, () => {
- console.log('Not mutating data');
- return { data: null };
- })
- .persist();
-
- const { result: useMutateResult1 } = renderHook(
- () =>
- useModelMutation('User', 'POST', 'create', modelMeta, {
- optimisticUpdate: true,
- revalidate: false,
- optimisticDataProvider: ({ queryModel, queryOperation }) => {
- if (queryModel === 'User' && queryOperation === 'findMany') {
- return { kind: 'Skip' };
- } else {
- return { kind: 'ProceedDefault' };
- }
- },
- }),
- {
- wrapper,
- }
- );
-
- await waitFor(async () => {
- const { trigger } = useMutateResult1.current;
- const r = await trigger({ data: { name: 'foo' } });
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult1 } = renderHook(() => useSWRConfig());
- // cache should not update
- await waitFor(() => {
- const cache = cacheResult1.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany'));
- expect(cacheData?.data).toHaveLength(0);
- });
-
- const { result: useMutateResult2 } = renderHook(
- () =>
- useModelMutation('User', 'POST', 'create', modelMeta, {
- optimisticUpdate: true,
- revalidate: false,
- optimisticDataProvider: ({ queryModel, queryOperation, currentData, mutationArgs }) => {
- if (queryModel === 'User' && queryOperation === 'findMany') {
- return {
- kind: 'Update',
- data: [
- ...currentData,
- { id: 100, name: mutationArgs.data.name + 'hooray', $optimistic: true },
- ],
- };
- } else {
- return { kind: 'ProceedDefault' };
- }
- },
- }),
- {
- wrapper,
- }
- );
-
- await waitFor(async () => {
- const { trigger } = useMutateResult2.current;
- const r = await trigger({ data: { name: 'foo' } });
- console.log('Mutate result:', r);
- });
-
- const { result: cacheResult } = renderHook(() => useSWRConfig());
- // cache should update
- await waitFor(() => {
- const cache = cacheResult.current.cache;
- const cacheData = cache.get(getQueryKey('User', 'findMany'));
- expect(cacheData?.data).toHaveLength(1);
- expect(cacheData?.data[0].name).toBe('foohooray');
- });
- });
-});
diff --git a/packages/plugins/swr/tests/swr.test.ts b/packages/plugins/swr/tests/swr.test.ts
deleted file mode 100644
index 7c26f18bd..000000000
--- a/packages/plugins/swr/tests/swr.test.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-///
-
-import { loadSchema, normalizePath } from '@zenstackhq/testtools';
-import fs from 'fs';
-import path from 'path';
-import tmp from 'tmp';
-
-describe('SWR Plugin Tests', () => {
- let origDir: string;
-
- beforeAll(() => {
- origDir = process.cwd();
- });
-
- afterEach(() => {
- process.chdir(origDir);
- });
-
- const sharedModel = `
-model User {
- id String @id
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- email String @unique
- role role @default(USER)
- posts post_Item[]
-}
-
-enum role {
- USER
- ADMIN
-}
-
-model post_Item {
- id String @id
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- title String
- author User? @relation(fields: [authorId], references: [id])
- authorId String?
- published Boolean @default(false)
- viewCount Int @default(0)
-}
-
-model Foo {
- id String @id
- @@ignore
-}
- `;
-
- it('run plugin', async () => {
- await loadSchema(
- `
-plugin swr {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- output = '$projectRoot/hooks'
-}
-
-${sharedModel}
- `,
- {
- provider: 'postgresql',
- pushDb: false,
- extraDependencies: [
- `${normalizePath(path.join(__dirname, '../dist'))}`,
- 'react@18.2.0',
- '@types/react@18.2.0',
- 'swr@^2',
- ],
- compile: true,
- }
- );
- });
-
- it('clear output', async () => {
- const { name: projectDir } = tmp.dirSync();
- fs.mkdirSync(path.join(projectDir, 'swr'), { recursive: true });
- fs.writeFileSync(path.join(projectDir, 'swr', 'test.txt'), 'hello');
-
- await loadSchema(
- `
- plugin swr {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- output = '$projectRoot/swr'
- }
-
- model User {
- id Int @id @default(autoincrement())
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- email String @unique
- password String @omit
- }
- `,
- {
- pushDb: false,
- projectDir,
- extraDependencies: [`${normalizePath(path.join(__dirname, '../dist'))}`],
- }
- );
-
- expect(fs.existsSync(path.join(projectDir, 'swr', 'test.txt'))).toBeFalsy();
- });
-
- it('existing output as file', async () => {
- const { name: projectDir } = tmp.dirSync();
- fs.writeFileSync(path.join(projectDir, 'swr'), 'hello');
-
- await expect(
- loadSchema(
- `
- plugin swr {
- provider = '${normalizePath(path.resolve(__dirname, '../dist'))}'
- output = '$projectRoot/swr'
- }
-
- model User {
- id Int @id @default(autoincrement())
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- email String
- password String @omit
- }
- `,
- { pushDb: false, projectDir, extraDependencies: [`${normalizePath(path.join(__dirname, '../dist'))}`] }
- )
- ).rejects.toThrow('already exists and is not a directory');
- });
-});
diff --git a/packages/plugins/swr/tests/test-model-meta.ts b/packages/plugins/swr/tests/test-model-meta.ts
deleted file mode 100644
index 001d773a9..000000000
--- a/packages/plugins/swr/tests/test-model-meta.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { ModelMeta } from '@zenstackhq/runtime/cross';
-
-const fieldDefaults = {
- isId: false,
- isDataModel: false,
- isArray: false,
- isOptional: true,
- attributes: [],
- isRelationOwner: false,
- isForeignKey: false,
-};
-
-export const modelMeta: ModelMeta = {
- models: {
- user: {
- name: 'user',
- fields: {
- id: {
- ...fieldDefaults,
- type: 'String',
- isId: true,
- name: 'id',
- isOptional: false,
- },
- name: { ...fieldDefaults, type: 'String', name: 'name' },
- email: { ...fieldDefaults, type: 'String', name: 'name', isOptional: false },
- posts: {
- ...fieldDefaults,
- type: 'Post',
- isDataModel: true,
- isArray: true,
- name: 'posts',
- },
- },
- uniqueConstraints: { id: { name: 'id', fields: ['id'] } },
- },
- post: {
- name: 'post',
- fields: {
- id: {
- ...fieldDefaults,
- type: 'String',
- isId: true,
- name: 'id',
- isOptional: false,
- },
- title: { ...fieldDefaults, type: 'String', name: 'title' },
- owner: { ...fieldDefaults, type: 'User', name: 'owner', isDataModel: true, isRelationOwner: true },
- ownerId: { ...fieldDefaults, type: 'User', name: 'owner', isForeignKey: true },
- },
- uniqueConstraints: { id: { name: 'id', fields: ['id'] } },
- },
- },
- deleteCascade: {
- user: ['Post'],
- },
-};
diff --git a/packages/plugins/swr/tsconfig.json b/packages/plugins/swr/tsconfig.json
deleted file mode 100644
index 9e4f772c5..000000000
--- a/packages/plugins/swr/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../../tsconfig.base.json",
- "compilerOptions": {
- "lib": ["ESNext", "DOM"],
- "outDir": "dist",
- "jsx": "react"
- },
- "include": ["src/**/*.ts"],
- "exclude": ["src/runtime"]
-}
diff --git a/packages/plugins/swr/tsup.config.ts b/packages/plugins/swr/tsup.config.ts
deleted file mode 100644
index 2735372fa..000000000
--- a/packages/plugins/swr/tsup.config.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { defineConfig } from 'tsup';
-
-export default defineConfig({
- entry: ['src/runtime/index.ts'],
- outDir: 'dist/runtime',
- splitting: false,
- sourcemap: true,
- clean: true,
- dts: true,
- format: ['cjs', 'esm'],
-});
diff --git a/packages/plugins/tanstack-query/CHANGELOG.md b/packages/plugins/tanstack-query/CHANGELOG.md
deleted file mode 100644
index cc2a59fdc..000000000
--- a/packages/plugins/tanstack-query/CHANGELOG.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changelog
-
-## [2.0.0-alpha.2](https://github.com/zenstackhq/zenstack/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-21)
-
-
-### Miscellaneous Chores
-
-* release 2.0.0-alpha.2 ([f40d7e3](https://github.com/zenstackhq/zenstack/commit/f40d7e3718d4210137a2e131d28b5491d065b914))
diff --git a/packages/plugins/tanstack-query/LICENSE b/packages/plugins/tanstack-query/LICENSE
deleted file mode 120000
index 5853aaea5..000000000
--- a/packages/plugins/tanstack-query/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-../../../LICENSE
\ No newline at end of file
diff --git a/packages/plugins/tanstack-query/README.md b/packages/plugins/tanstack-query/README.md
deleted file mode 100644
index 435ec13fd..000000000
--- a/packages/plugins/tanstack-query/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# ZenStack tanstack-query plugin & runtime
-
-This package contains ZenStack plugin for generating [tanstack-query](https://tanstack.com/query/latest) hooks.
-
-Visit [Homepage](https://zenstack.dev) for more details.
diff --git a/packages/plugins/tanstack-query/jest.config.ts b/packages/plugins/tanstack-query/jest.config.ts
deleted file mode 120000
index 09c104090..000000000
--- a/packages/plugins/tanstack-query/jest.config.ts
+++ /dev/null
@@ -1 +0,0 @@
-../../../jest.config.ts
\ No newline at end of file
diff --git a/packages/plugins/tanstack-query/package.json b/packages/plugins/tanstack-query/package.json
deleted file mode 100644
index 1bf1c871a..000000000
--- a/packages/plugins/tanstack-query/package.json
+++ /dev/null
@@ -1,124 +0,0 @@
-{
- "name": "@zenstackhq/tanstack-query",
- "displayName": "ZenStack plugin for generating tanstack-query hooks",
- "version": "2.22.2",
- "description": "ZenStack plugin for generating tanstack-query hooks",
- "main": "index.js",
- "exports": {
- ".": {
- "default": "./index.js"
- },
- "./package.json": {
- "default": "./package.json"
- },
- "./runtime": {
- "types": "./runtime/index.d.ts",
- "import": "./runtime/index.mjs",
- "require": "./runtime/index.js",
- "default": "./runtime/index.js"
- },
- "./runtime/react": {
- "types": "./runtime/react.d.ts",
- "import": "./runtime/react.mjs",
- "require": "./runtime/react.js",
- "default": "./runtime/react.js"
- },
- "./runtime/vue": {
- "types": "./runtime/vue.d.ts",
- "import": "./runtime/vue.mjs",
- "require": "./runtime/vue.js",
- "default": "./runtime/vue.js"
- },
- "./runtime/svelte": {
- "types": "./runtime/svelte.d.ts",
- "import": "./runtime/svelte.mjs",
- "require": "./runtime/svelte.js",
- "default": "./runtime/svelte.js"
- },
- "./runtime-v5": {
- "types": "./runtime-v5/index.d.ts",
- "import": "./runtime-v5/index.mjs",
- "require": "./runtime-v5/index.js",
- "default": "./runtime-v5/index.js"
- },
- "./runtime-v5/react": {
- "types": "./runtime-v5/react.d.ts",
- "import": "./runtime-v5/react.mjs",
- "require": "./runtime-v5/react.js",
- "default": "./runtime-v5/react.js"
- },
- "./runtime-v5/vue": {
- "types": "./runtime-v5/vue.d.ts",
- "import": "./runtime-v5/vue.mjs",
- "require": "./runtime-v5/vue.js",
- "default": "./runtime-v5/vue.js"
- },
- "./runtime-v5/svelte": {
- "types": "./runtime-v5/svelte.d.ts",
- "import": "./runtime-v5/svelte.mjs",
- "require": "./runtime-v5/svelte.js",
- "default": "./runtime-v5/svelte.js"
- },
- "./runtime-v5/angular": {
- "types": "./runtime-v5/angular.d.ts",
- "import": "./runtime-v5/angular.mjs",
- "require": "./runtime-v5/angular.js",
- "default": "./runtime-v5/angular.js"
- }
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/zenstackhq/zenstack"
- },
- "scripts": {
- "clean": "rimraf dist",
- "build": "pnpm lint --max-warnings=0 && pnpm clean && tsc && tsup-node --config ./tsup.config.ts && tsup-node --config ./tsup-v5.config.ts && node scripts/postbuild && copyfiles ./package.json ./README.md ./LICENSE dist && pnpm pack dist --pack-destination ../../../../.build",
- "watch": "concurrently \"tsc --watch\" \"tsup-node --config ./tsup.config.ts --watch\" \"tsup-node --config ./tsup-v5.config.ts --watch\"",
- "lint": "eslint src --ext ts",
- "test": "jest",
- "prepublishOnly": "pnpm build"
- },
- "publishConfig": {
- "directory": "dist",
- "linkDirectory": true
- },
- "keywords": [],
- "author": "ZenStack Team",
- "license": "MIT",
- "dependencies": {
- "@zenstackhq/runtime": "workspace:*",
- "@zenstackhq/sdk": "workspace:*",
- "cross-fetch": "^4.0.0",
- "semver": "^7.5.2",
- "ts-morph": "catalog:",
- "ts-pattern": "^4.3.0"
- },
- "devDependencies": {
- "@angular/core": "^20.0.0",
- "@angular/common": "^20.0.0",
- "@angular/platform-browser": "^20.0.0",
- "@tanstack/angular-query-v5": "npm:@tanstack/angular-query-experimental@5.84.x",
- "@tanstack/react-query": "^4.29.7",
- "@tanstack/react-query-v5": "npm:@tanstack/react-query@5.56.x",
- "@tanstack/svelte-query": "^4.29.7",
- "@tanstack/svelte-query-v5": "npm:@tanstack/svelte-query@^5.0.0",
- "@tanstack/vue-query": "^4.37.0",
- "@testing-library/react": "14.0.0",
- "@types/react": "18.2.0",
- "@types/semver": "^7.3.13",
- "@types/tmp": "^0.2.3",
- "@zenstackhq/testtools": "workspace:*",
- "glob": "^8.1.0",
- "jest-environment-jsdom": "^29.7.0",
- "nock": "^13.3.6",
- "react": "18.2.0",
- "react-test-renderer": "^18.2.0",
- "rxjs": "^7.8.0",
- "svelte": "^4.2.1",
- "swr": "^2.0.3",
- "tmp": "^0.2.3",
- "typescript": "^5.0.0",
- "vue": "^3.3.4",
- "zone.js": "^0.15.0"
- }
-}
diff --git a/packages/plugins/tanstack-query/scripts/postbuild.js b/packages/plugins/tanstack-query/scripts/postbuild.js
deleted file mode 100755
index 02abe2dfb..000000000
--- a/packages/plugins/tanstack-query/scripts/postbuild.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// tsup doesn't replace npm dependency aliases in the dist files, so we have to do it manually
-
-const fs = require('fs');
-const glob = require('glob');
-
-function replaceSync({ file, from, to }) {
- const paths = glob.sync(file, { ignore: [], nodir: true });
-
- paths.forEach(path => {
- const contents = fs.readFileSync(path, { encoding: 'utf-8' });
-
- const newContents = contents.replace(from, to);
-
- if (newContents !== contents) {
- fs.writeFileSync(path, newContents, { encoding: 'utf-8' });
- }
- });
-}
-
-// tsup incorrectly resolve to legacy types, make a fix here
-console.log('Replacing @tanstack/react-query-v5/build/legacy/types');
-replaceSync({
- file: 'dist/runtime-v5/react*(.d.ts|.d.mts)',
- from: /@tanstack\/react-query-v5\/build\/legacy\/types/g,
- to: '@tanstack/react-query',
-});
-
-console.log('Replacing @tanstack/react-query-v5');
-replaceSync({
- file: 'dist/runtime-v5/react*(.d.ts|.d.mts|.js|.mjs)',
- from: /@tanstack\/react-query-v5/g,
- to: '@tanstack/react-query',
-});
-
-console.log('Replacing @tanstack/svelte-query-v5');
-replaceSync({
- file: 'dist/runtime-v5/svelte*(.d.ts|.d.mts|.js|.mjs)',
- from: /@tanstack\/svelte-query-v5/g,
- to: '@tanstack/svelte-query',
-});
-
-console.log('Replacing @tanstack/vue-query-v5');
-replaceSync({
- file: 'dist/runtime-v5/vue*(.d.ts|.d.mts|.js|.mjs)',
- from: /@tanstack\/vue-query-v5/g,
- to: '@tanstack/vue-query',
-});
-
-console.log('Replacing @tanstack/angular-query-v5');
-replaceSync({
- file: 'dist/runtime-v5/angular*(.d.ts|.d.mts|.js|.mjs)',
- from: /@tanstack\/angular-query-v5/g,
- to: '@tanstack/angular-query-experimental',
-});
diff --git a/packages/plugins/tanstack-query/src/generator.ts b/packages/plugins/tanstack-query/src/generator.ts
deleted file mode 100644
index cc3bc22cf..000000000
--- a/packages/plugins/tanstack-query/src/generator.ts
+++ /dev/null
@@ -1,788 +0,0 @@
-import {
- PluginError,
- PluginOptions,
- RUNTIME_PACKAGE,
- createProject,
- ensureEmptyDir,
- generateModelMeta,
- getDataModels,
- getPrismaClientGenerator,
- isDelegateModel,
- requireOption,
- resolvePath,
- saveProject,
-} from '@zenstackhq/sdk';
-import { DataModel, DataModelFieldType, Model, isEnum, isTypeDef } from '@zenstackhq/sdk/ast';
-import { getPrismaClientImportSpec, supportCreateMany, type DMMF } from '@zenstackhq/sdk/prisma';
-import { lowerCaseFirst, upperCaseFirst, paramCase } from '@zenstackhq/runtime/local-helpers';
-import fs from 'fs';
-import path from 'path';
-import { Project, SourceFile, VariableDeclarationKind } from 'ts-morph';
-import { P, match } from 'ts-pattern';
-import { name } from '.';
-
-const supportedTargets = ['react', 'vue', 'svelte', 'angular'];
-type TargetFramework = (typeof supportedTargets)[number];
-type TanStackVersion = 'v4' | 'v5';
-
-export async function generate(model: Model, options: PluginOptions, dmmf: DMMF.Document) {
- const project = createProject();
- const warnings: string[] = [];
- const models = getDataModels(model);
- const typeDefs = model.declarations.filter(isTypeDef);
-
- const target = requireOption(options, 'target', name);
- if (!supportedTargets.includes(target)) {
- throw new PluginError(name, `Unsupported target "${target}", supported values: ${supportedTargets.join(', ')}`);
- }
-
- const version = typeof options.version === 'string' ? options.version : 'v5';
- if (version !== 'v4' && version !== 'v5') {
- throw new PluginError(name, `Unsupported version "${version}": use "v4" or "v5"`);
- }
-
- // Angular is only supported in v5
- if (target === 'angular' && version !== 'v5') {
- throw new PluginError(name, `Angular target is only supported with version "v5", got "${version}"`);
- }
-
- let outDir = requireOption(options, 'output', name);
- outDir = resolvePath(outDir, options);
- ensureEmptyDir(outDir);
-
- if (options.portable && typeof options.portable !== 'boolean') {
- throw new PluginError(
- name,
- `Invalid value for "portable" option: ${options.portable}, a boolean value is expected`
- );
- }
-
- await generateModelMeta(project, models, typeDefs, {
- output: path.join(outDir, '__model_meta.ts'),
- generateAttributes: false,
- });
-
- generateIndex(project, outDir, models, target, version);
-
- models.forEach((dataModel) => {
- const mapping = dmmf.mappings.modelOperations.find((op) => op.model === dataModel.name);
- if (!mapping) {
- warnings.push(`Unable to find mapping for model ${dataModel.name}`);
- return;
- }
- generateModelHooks(target, version, project, outDir, dataModel, mapping, options);
- });
-
- if (options.portable) {
- const gen = getPrismaClientGenerator(model);
- if (gen?.isNewGenerator) {
- warnings.push(`The "portable" option is not supported with the "prisma-client" generator and is ignored.`);
- } else {
- generateBundledTypes(project, outDir, options);
- }
- }
-
- await saveProject(project);
- return { warnings };
-}
-
-function generateQueryHook(
- target: TargetFramework,
- version: TanStackVersion,
- sf: SourceFile,
- model: string,
- operation: string,
- returnArray: boolean,
- optionalInput: boolean,
- overrideReturnType?: string,
- overrideInputType?: string,
- overrideTypeParameters?: string[],
- supportInfinite = false,
- supportOptimistic = false
-) {
- const generateModes: ('' | 'Infinite' | 'Suspense' | 'SuspenseInfinite')[] = [''];
- if (supportInfinite) {
- generateModes.push('Infinite');
- }
-
- if (target === 'react' && version === 'v5') {
- // react-query v5 supports suspense query
- generateModes.push('Suspense');
- if (supportInfinite) {
- generateModes.push('SuspenseInfinite');
- }
- }
-
- for (const generateMode of generateModes) {
- const capOperation = upperCaseFirst(operation);
-
- const argsType = overrideInputType ?? `Prisma.${model}${capOperation}Args`;
- let inputType = makeQueryArgsType(target, argsType);
- if (target === 'angular') {
- inputType = `${inputType} | (() => ${inputType})`;
- }
-
- const infinite = generateMode.includes('Infinite');
- const suspense = generateMode.includes('Suspense');
- const optimistic =
- supportOptimistic &&
- // infinite queries are not subject to optimistic updates
- !infinite;
-
- let defaultReturnType = `Prisma.${model}GetPayload`;
- if (optimistic) {
- defaultReturnType += '& { $optimistic?: boolean }';
- }
- if (returnArray) {
- defaultReturnType = `Array<${defaultReturnType}>`;
- }
-
- const returnType = overrideReturnType ?? defaultReturnType;
- const optionsType = makeQueryOptions(target, 'TQueryFnData', 'TData', infinite, suspense, version);
-
- const func = sf.addFunction({
- name: `use${generateMode}${capOperation}${model}`,
- typeParameters: overrideTypeParameters ?? [
- `TArgs extends ${argsType}`,
- `TQueryFnData = ${returnType} `,
- 'TData = TQueryFnData',
- 'TError = DefaultError',
- ],
- parameters: [
- {
- name: optionalInput ? 'args?' : 'args',
- type: inputType,
- },
- {
- name: 'options?',
- type: optionsType,
- },
- ],
- isExported: true,
- });
-
- if (version === 'v5' && infinite && ['react', 'svelte', 'angular'].includes(target)) {
- // getNextPageParam option is required in v5
- func.addStatements([`options = options ?? { getNextPageParam: () => null };`]);
- }
-
- func.addStatements([
- makeGetContext(target),
- `return use${generateMode}ModelQuery('${model}', \`\${endpoint}/${lowerCaseFirst(
- model
- )}/${operation}\`, args, options, fetch);`,
- ]);
- }
-}
-
-function generateMutationHook(
- target: TargetFramework,
- sf: SourceFile,
- model: string,
- operation: string,
- httpVerb: 'post' | 'put' | 'delete',
- checkReadBack: boolean,
- overrideReturnType?: string
-) {
- const capOperation = upperCaseFirst(operation);
-
- const argsType = `Prisma.${model}${capOperation}Args`;
- const inputType = `Prisma.SelectSubset`;
- let returnType = overrideReturnType ?? `CheckSelect>`;
- if (checkReadBack) {
- returnType = `(${returnType} | undefined )`;
- }
- const nonGenericOptionsType = `Omit<${makeMutationOptions(
- target,
- checkReadBack ? `(${overrideReturnType ?? model} | undefined)` : overrideReturnType ?? model,
- argsType
- )}, 'mutationFn'>`;
- const optionsType = `Omit<${makeMutationOptions(target, returnType, inputType)}, 'mutationFn'>`;
-
- const func = sf.addFunction({
- name: `use${capOperation}${model}`,
- isExported: true,
- parameters: [
- {
- name: 'options?',
- type: nonGenericOptionsType,
- },
- ],
- });
-
- // get endpoint from context
- func.addStatements([makeGetContext(target)]);
-
- func.addVariableStatement({
- declarationKind: VariableDeclarationKind.Const,
- declarations: [
- {
- name: `_mutation`,
- initializer: `
- useModelMutation<${argsType}, DefaultError, ${
- overrideReturnType ?? model
- }, ${checkReadBack}>('${model}', '${httpVerb.toUpperCase()}', \`\${endpoint}/${lowerCaseFirst(
- model
- )}/${operation}\`, metadata, options, fetch, ${checkReadBack})
- `,
- },
- ],
- });
-
- switch (target) {
- case 'react':
- case 'vue':
- case 'angular':
- // override the mutateAsync function to return the correct type
- func.addVariableStatement({
- declarationKind: VariableDeclarationKind.Const,
- declarations: [
- {
- name: 'mutation',
- initializer: `{
- ..._mutation,
- mutateAsync: async (
- args: Prisma.SelectSubset,
- options?: ${optionsType}
- ) => {
- return (await _mutation.mutateAsync(
- args,
- options as any
- )) as ${returnType};
- },
- }`,
- },
- ],
- });
- break;
-
- case 'svelte':
- // svelte-query returns a store for mutations
- // here we override the mutateAsync function to return the correct type
- // and call `derived` to return a new reactive store
- func.addVariableStatement({
- declarationKind: VariableDeclarationKind.Const,
- declarations: [
- {
- name: 'mutation',
- initializer: `derived(_mutation, value => ({
- ...value,
- mutateAsync: async (
- args: Prisma.SelectSubset,
- options?: ${optionsType}
- ) => {
- return (await value.mutateAsync(
- args,
- options as any
- )) as ${returnType};
- },
- }))`,
- },
- ],
- });
- break;
-
- default:
- throw new PluginError(name, `Unsupported target "${target}"`);
- }
-
- func.addStatements('return mutation;');
-}
-
-function generateCheckHook(
- target: string,
- version: TanStackVersion,
- sf: SourceFile,
- model: DataModel,
- prismaImport: string
-) {
- const mapFilterType = (type: DataModelFieldType) => {
- return match(type.type)
- .with(P.union('Int', 'BigInt'), () => 'number')
- .with('String', () => 'string')
- .with('Boolean', () => 'boolean')
- .otherwise(() => undefined);
- };
-
- const filterFields: Array<{ name: string; type: string }> = [];
- const enumsToImport = new Set();
-
- // collect filterable fields and enums to import
- model.fields.forEach((f) => {
- if (isEnum(f.type.reference?.ref)) {
- enumsToImport.add(f.type.reference.$refText);
- filterFields.push({ name: f.name, type: f.type.reference.$refText });
- }
-
- const mappedType = mapFilterType(f.type);
- if (mappedType) {
- filterFields.push({ name: f.name, type: mappedType });
- }
- });
-
- if (enumsToImport.size > 0) {
- // import enums
- sf.addStatements(`import type { ${Array.from(enumsToImport).join(', ')} } from '${prismaImport}';`);
- }
-
- const whereType = `{ ${filterFields.map(({ name, type }) => `${name}?: ${type}`).join('; ')} }`;
-
- const func = sf.addFunction({
- name: `useCheck${model.name}`,
- isExported: true,
- typeParameters: ['TError = DefaultError'],
- parameters: [
- { name: 'args', type: `{ operation: PolicyCrudKind; where?: ${whereType}; }` },
- { name: 'options?', type: makeQueryOptions(target, 'boolean', 'boolean', false, false, version) },
- ],
- });
-
- func.addStatements([
- makeGetContext(target),
- `return useModelQuery('${model.name}', \`\${endpoint}/${lowerCaseFirst(
- model.name
- )}/check\`, args, options, fetch);`,
- ]);
-}
-
-function generateModelHooks(
- target: TargetFramework,
- version: TanStackVersion,
- project: Project,
- outDir: string,
- model: DataModel,
- mapping: DMMF.ModelMapping,
- options: PluginOptions
-) {
- const modelNameCap = upperCaseFirst(model.name);
- const fileName = paramCase(model.name);
- const sf = project.createSourceFile(path.join(outDir, `${fileName}.ts`), undefined, { overwrite: true });
-
- const prismaImport = options.portable ? './__types' : getPrismaClientImportSpec(outDir, options);
- sf.addImportDeclaration({
- namedImports: ['Prisma', model.name],
- isTypeOnly: true,
- moduleSpecifier: prismaImport,
- });
- sf.addStatements(makeBaseImports(target, version));
-
- // Note: delegate models don't support create and upsert operations
-
- // create is somehow named "createOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (!isDelegateModel(model) && (mapping.create || (mapping as any).createOne)) {
- generateMutationHook(target, sf, model.name, 'create', 'post', true);
- }
-
- // createMany
- if (!isDelegateModel(model) && mapping.createMany && supportCreateMany(model.$container)) {
- generateMutationHook(target, sf, model.name, 'createMany', 'post', false, 'Prisma.BatchPayload');
- }
-
- // findMany
- if (mapping.findMany) {
- // regular findMany
- generateQueryHook(
- target,
- version,
- sf,
- model.name,
- 'findMany',
- true,
- true,
- undefined,
- undefined,
- undefined,
- true,
- true
- );
- }
-
- // findUnique
- if (mapping.findUnique) {
- generateQueryHook(
- target,
- version,
- sf,
- model.name,
- 'findUnique',
- false,
- false,
- undefined,
- undefined,
- undefined,
- false,
- true
- );
- }
-
- // findFirst
- if (mapping.findFirst) {
- generateQueryHook(
- target,
- version,
- sf,
- model.name,
- 'findFirst',
- false,
- true,
- undefined,
- undefined,
- undefined,
- false,
- true
- );
- }
-
- // update
- // update is somehow named "updateOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (mapping.update || (mapping as any).updateOne) {
- generateMutationHook(target, sf, model.name, 'update', 'put', true);
- }
-
- // updateMany
- if (mapping.updateMany) {
- generateMutationHook(target, sf, model.name, 'updateMany', 'put', false, 'Prisma.BatchPayload');
- }
-
- // upsert
- // upsert is somehow named "upsertOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (!isDelegateModel(model) && (mapping.upsert || (mapping as any).upsertOne)) {
- generateMutationHook(target, sf, model.name, 'upsert', 'post', true);
- }
-
- // del
- // delete is somehow named "deleteOne" in the DMMF
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- if (mapping.delete || (mapping as any).deleteOne) {
- generateMutationHook(target, sf, model.name, 'delete', 'delete', true);
- }
-
- // deleteMany
- if (mapping.deleteMany) {
- generateMutationHook(target, sf, model.name, 'deleteMany', 'delete', false, 'Prisma.BatchPayload');
- }
-
- // aggregate
- if (mapping.aggregate) {
- generateQueryHook(
- target,
- version,
- sf,
- modelNameCap,
- 'aggregate',
- false,
- false,
- `Prisma.Get${modelNameCap}AggregateType`
- );
- }
-
- // groupBy
- if (mapping.groupBy) {
- const useName = model.name;
-
- const returnType = `{} extends InputErrors ?
- Array &
- {
- [P in ((keyof TArgs) & (keyof Prisma.${modelNameCap}GroupByOutputType))]: P extends '_count'
- ? TArgs[P] extends boolean
- ? number
- : Prisma.GetScalarType
- : Prisma.GetScalarType
- }
- > : InputErrors`;
-
- const typeParameters = [
- `TArgs extends Prisma.${useName}GroupByArgs`,
- `HasSelectOrTake extends Prisma.Or>, Prisma.Extends<'take', Prisma.Keys>>`,
- `OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: Prisma.${useName}GroupByArgs['orderBy'] }: { orderBy?: Prisma.${useName}GroupByArgs['orderBy'] },`,
- `OrderFields extends Prisma.ExcludeUnderscoreKeys>>`,
- `ByFields extends Prisma.MaybeTupleToUnion`,
- `ByValid extends Prisma.Has`,
- `HavingFields extends Prisma.GetHavingFields`,
- `HavingValid extends Prisma.Has`,
- `ByEmpty extends TArgs['by'] extends never[] ? Prisma.True : Prisma.False`,
- `InputErrors extends ByEmpty extends Prisma.True
- ? \`Error: "by" must not be empty.\`
- : HavingValid extends Prisma.False
- ? {
- [P in HavingFields]: P extends ByFields
- ? never
- : P extends string
- ? \`Error: Field "\${P}" used in "having" needs to be provided in "by".\`
- : [
- Error,
- 'Field ',
- P,
- \` in "having" needs to be provided in "by"\`,
- ]
- }[HavingFields]
- : 'take' extends Prisma.Keys
- ? 'orderBy' extends Prisma.Keys
- ? ByValid extends Prisma.True
- ? {}
- : {
- [P in OrderFields]: P extends ByFields
- ? never
- : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
- }[OrderFields]
- : 'Error: If you provide "take", you also need to provide "orderBy"'
- : 'skip' extends Prisma.Keys
- ? 'orderBy' extends Prisma.Keys
- ? ByValid extends Prisma.True
- ? {}
- : {
- [P in OrderFields]: P extends ByFields
- ? never
- : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
- }[OrderFields]
- : 'Error: If you provide "skip", you also need to provide "orderBy"'
- : ByValid extends Prisma.True
- ? {}
- : {
- [P in OrderFields]: P extends ByFields
- ? never
- : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
- }[OrderFields]`,
- `TQueryFnData = ${returnType}`,
- `TData = TQueryFnData`,
- `TError = DefaultError`,
- ];
-
- generateQueryHook(
- target,
- version,
- sf,
- model.name,
- 'groupBy',
- false,
- false,
- returnType,
- `Prisma.SubsetIntersection & InputErrors`,
- typeParameters
- );
- }
-
- // somehow dmmf doesn't contain "count" operation, so we unconditionally add it here
- {
- generateQueryHook(
- target,
- version,
- sf,
- model.name,
- 'count',
- false,
- true,
- `TArgs extends { select: any; } ? TArgs['select'] extends true ? number : Prisma.GetScalarType : number`
- );
- }
-
- {
- // extra `check` hook for ZenStack's permission checker API
- generateCheckHook(target, version, sf, model, prismaImport);
- }
-}
-
-function generateIndex(
- project: Project,
- outDir: string,
- models: DataModel[],
- target: string,
- version: TanStackVersion
-) {
- const runtimeImportBase = makeRuntimeImportBase(version);
- const sf = project.createSourceFile(path.join(outDir, 'index.ts'), undefined, { overwrite: true });
- sf.addStatements(models.map((d) => `export * from './${paramCase(d.name)}';`));
- sf.addStatements(`export { getQueryKey } from '${runtimeImportBase}';`);
- switch (target) {
- case 'react':
- sf.addStatements(`export { Provider } from '${runtimeImportBase}/react';`);
- break;
- case 'vue':
- sf.addStatements(`export { VueQueryContextKey, provideHooksContext } from '${runtimeImportBase}/vue';`);
- break;
- case 'svelte':
- sf.addStatements(`export { SvelteQueryContextKey, setHooksContext } from '${runtimeImportBase}/svelte';`);
- break;
- case 'angular':
- sf.addStatements(
- `export { AngularQueryContextKey, provideAngularQueryContext } from '${runtimeImportBase}/angular';`
- );
- break;
- }
- sf.addStatements(`export { default as metadata } from './__model_meta';`);
-}
-
-function makeGetContext(target: TargetFramework) {
- switch (target) {
- case 'react':
- return 'const { endpoint, fetch } = getHooksContext();';
- case 'vue':
- return 'const { endpoint, fetch } = getHooksContext();';
- case 'svelte':
- return `const { endpoint, fetch } = getHooksContext();`;
- case 'angular':
- return 'const { endpoint, fetch } = getHooksContext();';
- default:
- throw new PluginError(name, `Unsupported target "${target}"`);
- }
-}
-
-function makeBaseImports(target: TargetFramework, version: TanStackVersion) {
- const runtimeImportBase = makeRuntimeImportBase(version);
- const shared = [
- `import { useModelQuery, useInfiniteModelQuery, useModelMutation } from '${runtimeImportBase}/${target}';`,
- `import type { PickEnumerable, CheckSelect, QueryError, ExtraQueryOptions, ExtraMutationOptions } from '${runtimeImportBase}';`,
- `import type { PolicyCrudKind } from '${RUNTIME_PACKAGE}'`,
- `import metadata from './__model_meta';`,
- `type DefaultError = QueryError;`,
- ];
- switch (target) {
- case 'react': {
- const suspense =
- version === 'v5'
- ? [
- `import { useSuspenseModelQuery, useSuspenseInfiniteModelQuery } from '${runtimeImportBase}/${target}';`,
- `import type { UseSuspenseQueryOptions, UseSuspenseInfiniteQueryOptions } from '@tanstack/react-query';`,
- ]
- : [];
- return [
- `import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';`,
- `import { getHooksContext } from '${runtimeImportBase}/${target}';`,
- ...shared,
- ...suspense,
- ];
- }
- case 'vue': {
- return [
- `import type { UseMutationOptions, UseQueryOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/vue-query';`,
- `import { getHooksContext } from '${runtimeImportBase}/${target}';`,
- `import type { MaybeRefOrGetter, ComputedRef, UnwrapRef } from 'vue';`,
- ...shared,
- ];
- }
- case 'svelte': {
- return [
- `import { derived } from 'svelte/store';`,
- `import type { MutationOptions, CreateQueryOptions, CreateInfiniteQueryOptions } from '@tanstack/svelte-query';`,
- ...(version === 'v5'
- ? [`import type { InfiniteData, StoreOrVal } from '@tanstack/svelte-query';`]
- : []),
- `import { getHooksContext } from '${runtimeImportBase}/${target}';`,
- ...shared,
- ];
- }
- case 'angular': {
- return [
- `import type { CreateMutationOptions, CreateQueryOptions, CreateInfiniteQueryOptions, InfiniteData } from '@tanstack/angular-query-experimental';`,
- `import { getHooksContext } from '${runtimeImportBase}/${target}';`,
- ...shared,
- ];
- }
- default:
- throw new PluginError(name, `Unsupported target: ${target}`);
- }
-}
-
-function makeQueryArgsType(target: string, argsType: string) {
- const type = `Prisma.SelectSubset`;
- if (target === 'vue') {
- return `MaybeRefOrGetter<${type}> | ComputedRef<${type}>`;
- } else {
- return type;
- }
-}
-
-function makeQueryOptions(
- target: string,
- returnType: string,
- dataType: string,
- infinite: boolean,
- suspense: boolean,
- version: TanStackVersion
-) {
- let result = match(target)
- .with('react', () =>
- infinite
- ? version === 'v4'
- ? `Omit, 'queryKey'>`
- : `Omit