diff --git a/.env b/.env index af3d7a12..cd2816a9 100644 --- a/.env +++ b/.env @@ -1,26 +1 @@ -PORT=8020 -DEBUG=1 -HOST_NAME=monkshood -SECRET_KEY=aLargeRandomSecretKey -DJANGO_SUPERUSER_USERNAME=admin -DJANGO_SUPERUSER_PASSWORD=sekret1 -DJANGO_SUPERUSER_EMAIL=admin@example.com -EMAIL_HOST=in-v3.mailjet.com -EMAIL_PORT=25 -EMAIL_HOST_USER=email_username -EMAIL_HOST_PASSWORD=email_password -DEFAULT_FROM_EMAIL=sender@mydomain.com -POSTGRES_PASSWORD=sekret2 -DATABASE_URL=postgres://postgres:sekret2@postgres:5432/postgres - -RABBITMQ_DEFAULT_USER=guest -RABBITMQ_DEFAULT_PASS=guest - -AUTH_LDAP_USE=0 -AUTH_LDAP_SERVER_URI=ldap://ldap.forumsys.com:389 -AUTH_LDAP_DIRECT_BIND=1 -AUTH_LDAP_BIND_DN_TEMPLATE=uid=%(user)s,dc=example,dc=com -AUTH_LDAP_BIND_DN=cn=read-only-admin,dc=example,dc=com -AUTH_LDAP_BIND_PASSWORD=password -AUTH_LDAP_SEARCH_BASE=ou=mathematicians,dc=example,dc=com -AUTH_LDAP_SEARCH_FILTER=(uid=%(user)s) +DEBUG=1 \ No newline at end of file diff --git a/.env.prod b/.env.prod new file mode 100644 index 00000000..af3d7a12 --- /dev/null +++ b/.env.prod @@ -0,0 +1,26 @@ +PORT=8020 +DEBUG=1 +HOST_NAME=monkshood +SECRET_KEY=aLargeRandomSecretKey +DJANGO_SUPERUSER_USERNAME=admin +DJANGO_SUPERUSER_PASSWORD=sekret1 +DJANGO_SUPERUSER_EMAIL=admin@example.com +EMAIL_HOST=in-v3.mailjet.com +EMAIL_PORT=25 +EMAIL_HOST_USER=email_username +EMAIL_HOST_PASSWORD=email_password +DEFAULT_FROM_EMAIL=sender@mydomain.com +POSTGRES_PASSWORD=sekret2 +DATABASE_URL=postgres://postgres:sekret2@postgres:5432/postgres + +RABBITMQ_DEFAULT_USER=guest +RABBITMQ_DEFAULT_PASS=guest + +AUTH_LDAP_USE=0 +AUTH_LDAP_SERVER_URI=ldap://ldap.forumsys.com:389 +AUTH_LDAP_DIRECT_BIND=1 +AUTH_LDAP_BIND_DN_TEMPLATE=uid=%(user)s,dc=example,dc=com +AUTH_LDAP_BIND_DN=cn=read-only-admin,dc=example,dc=com +AUTH_LDAP_BIND_PASSWORD=password +AUTH_LDAP_SEARCH_BASE=ou=mathematicians,dc=example,dc=com +AUTH_LDAP_SEARCH_FILTER=(uid=%(user)s) diff --git a/.flake8 b/.flake8 index 57b0c97f..0f023914 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,6 @@ [flake8] +max-line-length = 88 +extend-ignore = E203, W503 exclude= .git, diff --git a/.github/workflows/copyright-test.yml b/.github/workflows/copyright-test.yml index 0c7553dc..e324bada 100644 --- a/.github/workflows/copyright-test.yml +++ b/.github/workflows/copyright-test.yml @@ -17,10 +17,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v1 with: - python-version: 3.9 + python-version: '3.10' architecture: x64 - name: install ldap diff --git a/.github/workflows/coverage-test.yml b/.github/workflows/coverage-test.yml index f4f624b6..005675f4 100644 --- a/.github/workflows/coverage-test.yml +++ b/.github/workflows/coverage-test.yml @@ -17,10 +17,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v1 with: - python-version: 3.9 + python-version: '3.10' architecture: x64 - name: install sundials diff --git a/.github/workflows/style-test.yml b/.github/workflows/style-test.yml index 5c3242ee..3ada3666 100644 --- a/.github/workflows/style-test.yml +++ b/.github/workflows/style-test.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v1 with: - python-version: 3.9 + python-version: '3.10' architecture: x64 - name: install ldap diff --git a/.github/workflows/unit-test-os-versions.yml b/.github/workflows/unit-test-os-versions.yml index e29413f0..012da12c 100644 --- a/.github/workflows/unit-test-os-versions.yml +++ b/.github/workflows/unit-test-os-versions.yml @@ -14,15 +14,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] steps: - uses: actions/checkout@v1 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v1 with: - python-version: 3.9 + python-version: '3.10' architecture: x64 - name: install sundials (ubuntu) diff --git a/.github/workflows/unit-test-python-versions.yml b/.github/workflows/unit-test-python-versions.yml index 250f7792..40bb43e0 100644 --- a/.github/workflows/unit-test-python-versions.yml +++ b/.github/workflows/unit-test-python-versions.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, "3.10"] + python-version: ['3.10'] steps: - uses: actions/checkout@v1 diff --git a/.gitignore b/.gitignore index 6c14c0e4..1bedc646 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ pkpdapp/static # nodemodules frontend/node_modules + +logfile.log* diff --git a/Dockerfile b/Dockerfile index beedd4e1..b32acbe3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ # Using a 2-stage build. This is the builder for javascript frontend -FROM node:lts as build +FROM node:19 as build RUN mkdir -p /app/frontend WORKDIR /app/frontend -COPY frontend/package.json /app/frontend +COPY frontend-v2/package.json /app/frontend -RUN npm install --legacy-peer-deps +RUN npm install -COPY frontend /app/frontend/ +COPY frontend-v2 /app/frontend/ RUN npm run build -FROM python:3.9 +FROM python:3.10 # install libsundials-dev RUN apt-get update && apt-get upgrade -y @@ -34,7 +34,7 @@ RUN rm -rf /var/lib/apt/lists/* # install dependencies COPY ./requirements.txt / RUN apt-get update && apt-get upgrade -y -RUN apt-get install -y build-essential libsasl2-dev python-dev libldap2-dev libssl-dev +RUN apt-get install -y build-essential libsasl2-dev python3-dev libldap2-dev libssl-dev RUN pip install -r requirements.txt diff --git a/README.md b/README.md index dbc50b39..91dbfb32 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ described using the OpenAPI specification. To generate the OpenAPI specification, run the following command: ```bash -python manage.py generateschema --file schema.yml +python manage.py spectacular --color --file schema.yml ``` ## Generating RTX Query API class diff --git a/docker-compose.yml b/docker-compose.yml index 7bb15791..79ee686e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,14 +9,14 @@ services: ports: - "5432:5432" env_file: - - ./.env + - ./.env.prod restart: unless-stopped volumes: - db:/var/lib/postgresql/data rabbitmq: image: rabbitmq:3-management-alpine env_file: - - ./.env + - ./.env.prod ports: - 5672:5672 - 15672:15672 @@ -33,6 +33,6 @@ services: - "80:${PORT}" restart: unless-stopped env_file: - - ./.env + - ./.env.prod diff --git a/frontend-v2/cypress.config.ts b/frontend-v2/cypress.config.ts new file mode 100644 index 00000000..067f51cd --- /dev/null +++ b/frontend-v2/cypress.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from "cypress"; + +export default defineConfig({ + e2e: { + setupNodeEvents(on, config) { + // implement node event listeners here + }, + baseUrl: 'http://localhost:3000', + + }, + + component: { + devServer: { + framework: "next", + bundler: "webpack", + }, + }, +}); diff --git a/frontend-v2/cypress/.gitignore b/frontend-v2/cypress/.gitignore new file mode 100644 index 00000000..4c2cda08 --- /dev/null +++ b/frontend-v2/cypress/.gitignore @@ -0,0 +1,2 @@ +*.png +*.mp4 \ No newline at end of file diff --git a/frontend-v2/cypress/e2e/pkmodel.cy.js b/frontend-v2/cypress/e2e/pkmodel.cy.js new file mode 100644 index 00000000..4b69902f --- /dev/null +++ b/frontend-v2/cypress/e2e/pkmodel.cy.js @@ -0,0 +1,101 @@ +describe('landing page', () => { + beforeEach(() => { + const { username, password } = { username: 'demo', password: '12345'} + cy.login(username, password) + }) + + it('can create combined pk and pd model and simulate from it', () => { + // create a new project + cy.intercept('POST', '/api/project/').as('createProject') + cy.get('[data-cy="create-project"]').click() + cy.get('[data-cy="create-project-option-Small Molecule"]').click() + cy.wait('@createProject').then((interception) => { + const { id } = interception.response.body + + // select the species + cy.get(`[data-cy="project-${id}"]`).find('[data-cy="select-project.species"]').click() + cy.get('[data-cy="select-option-project.species-Monkey"]').click() + + // select the project + cy.get(`[data-cy="project-${id}"]`).find('[type=radio]').click() + }); + + cy.get('[data-cy="select-project.species"]').last().click() + cy.get('[data-cy="select-option-project.species-Monkey"]').last().click() + + + // go to model tab + cy.get('li').contains('Model').click() + + // select one compartment model + cy.get('[data-cy="select-pk_model"]').click() + cy.get('[data-cy="select-option-pk_model-one_compartment_preclinical"]').click() + + // select pd model + cy.get('[data-cy="select-pd_model"]').click() + cy.get('[data-cy="select-option-pd_model-indirect_effects_stimulation_elimination"]').click() + + // go to map variables tab + cy.contains('button', 'Map Variables').click() + + // dose into Aa compartment + cy.get('[data-cy="checkbox-dosing-Aa"]').click() + + // map C1 to pd effect + cy.get('[data-cy="checkbox-map-to-pd-C1"]').click() + + // go to parameters tab + cy.contains('button', 'Parameters').click() + + cy.get('[data-cy="parameter-CL-value"]').find('input').then(($input) => { + const old_value = $input.val() + + // reset to species defaults + cy.contains('button', 'Reset to Species Defaults').click() + cy.wait(1000) + + // check that the value has changed + cy.get('[data-cy="parameter-CL-value"]').find('input').then(($input) => { + expect($input.val()).not.to.eq(old_value) + }) + }); + + // go to trial design tab + cy.get('li').contains('Trial Design').click() + + // set the dose + cy.get('input[name="doses.0.amount"]').clear().type('1') + + // set the number of doses + cy.get('input[name="doses.0.repeats"]').clear().type('4') + + // set the duration + cy.get('input[name="doses.0.duration"]').clear().type('0.1') + + // set the interval + cy.get('input[name="doses.0.repeat_interval"]').clear().type('0.1') + + // go to simulation tab + cy.get('li').contains('Simulations').click() + + // should be no svg with class "main-svg" + cy.get('svg.main-svg').should('not.exist') + + // add a plot of Aa + cy.get('[data-cy="add-plot"]').click() + cy.get('[data-cy^="add-plot-option-Aa"]').click() + + // now there should be an svg with class "main-svg" + cy.get('svg.main-svg').should('exist') + + // should be no CL slider + cy.get('[data-cy="parameter-slider-CL"]').should('not.exist') + + // add a CL parameter slider + cy.get('[data-cy="add-parameter-slider"]').click() + cy.get('[data-cy="add-parameter-slider-option-CL"]').click() + + // CL slider should exist + cy.get('[data-cy="parameter-slider-CL"]').should('exist') + }); +}); diff --git a/frontend-v2/cypress/support/commands.ts b/frontend-v2/cypress/support/commands.ts new file mode 100644 index 00000000..59301d8b --- /dev/null +++ b/frontend-v2/cypress/support/commands.ts @@ -0,0 +1,55 @@ +/// +// *********************************************** +// This example commands.ts shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add('login', (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) +// +// declare global { +// namespace Cypress { +// interface Chainable { +// login(email: string, password: string): Chainable +// drag(subject: string, options?: Partial): Chainable +// dismiss(subject: string, options?: Partial): Chainable +// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable +// } +// } +// } + +Cypress.Commands.add('login', (username, password) => { + cy.visit('/') + + cy.get('input[name=username]').type(username) + + // {enter} causes the form to submit + cy.get('input[name=password]').type(`${password}{enter}`, { log: false }) + + // we should be redirected to / + cy.url().should('not.contain', 'login') + + // our auth cookies should be present + cy.getCookie('csrftoken').should('exist') + cy.getCookie('sessionid').should('exist') +}) + +export {} \ No newline at end of file diff --git a/frontend-v2/cypress/support/e2e.ts b/frontend-v2/cypress/support/e2e.ts new file mode 100644 index 00000000..f80f74f8 --- /dev/null +++ b/frontend-v2/cypress/support/e2e.ts @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/e2e.ts is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') \ No newline at end of file diff --git a/frontend-v2/package.json b/frontend-v2/package.json index 575dea34..679f117d 100644 --- a/frontend-v2/package.json +++ b/frontend-v2/package.json @@ -15,9 +15,14 @@ "@types/node": "^17.0.25", "@types/react": "^18.0.6", "@types/react-dom": "^18.0.2", + "http-proxy-middleware": "^2.0.6", + "papaparse": "^5.4.1", + "plotly.js": "^2.23.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.43.9", + "react-player": "^2.13.0", + "react-plotly.js": "^2.6.0", "react-redux": "^8.0.1", "react-scripts": "5.0.1", "typescript": "^4.6.0", @@ -27,7 +32,9 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "cypress:open": "cypress open", + "cypress:e2e": "start-server-and-test 'yarn start' http://127.0.0.1:3000 \"cypress run --e2e\"" }, "eslintConfig": { "extends": [ @@ -46,5 +53,12 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", + "@types/papaparse": "^5.3.10", + "@types/react-plotly.js": "^2.6.0", + "cypress": "^12.16.0", + "start-server-and-test": "^2.0.0" } } diff --git a/frontend-v2/public/index.html b/frontend-v2/public/index.html index 1dbdca65..0eb2f946 100644 --- a/frontend-v2/public/index.html +++ b/frontend-v2/public/index.html @@ -2,14 +2,14 @@ - + - + - React Redux App + PKPD App diff --git a/frontend-v2/public/logo192.png b/frontend-v2/public/logo192.png deleted file mode 100644 index 33624109..00000000 Binary files a/frontend-v2/public/logo192.png and /dev/null differ diff --git a/frontend-v2/public/logo512.png b/frontend-v2/public/logo512.png deleted file mode 100644 index b3516222..00000000 Binary files a/frontend-v2/public/logo512.png and /dev/null differ diff --git a/frontend-v2/public/logo_pkpdapp.svg b/frontend-v2/public/logo_pkpdapp.svg new file mode 100644 index 00000000..97fe0bbe --- /dev/null +++ b/frontend-v2/public/logo_pkpdapp.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + diff --git a/frontend-v2/public/manifest.json b/frontend-v2/public/manifest.json index 080d6c77..7ccca6bb 100644 --- a/frontend-v2/public/manifest.json +++ b/frontend-v2/public/manifest.json @@ -3,19 +3,8 @@ "name": "Create React App Sample", "icons": [ { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" + "src": "logo_pkpdapp.svg", + "type": "image/svg+xml" } ], "start_url": ".", diff --git a/frontend-v2/src/App.tsx b/frontend-v2/src/App.tsx index 28ce3c74..926152ee 100644 --- a/frontend-v2/src/App.tsx +++ b/frontend-v2/src/App.tsx @@ -1,27 +1,32 @@ -import React from 'react'; -import logo from './logo.svg'; -import { Counter } from './features/counter/Counter'; +import React, { useEffect } from 'react'; import './App.css'; -import { isAuthenticated, login } from './features/login/loginSlice'; -import { useDispatch, useSelector } from 'react-redux'; +import { fetchSession, isAuthenticated, login } from './features/login/loginSlice'; +import { useSelector } from 'react-redux'; import Login from './features/login/login'; import Sidebar from './features/main/Sidebar'; +import { useAppDispatch } from './app/hooks'; +import { RootState } from './app/store'; function App() { - const dispatch = useDispatch(); + const dispatch = useAppDispatch(); const isAuth = useSelector(isAuthenticated); + const error = useSelector((state: RootState) => state.login.error); const onLogin = (username: string, password: string) => { - dispatch(login(username, password)); + dispatch(login({ username, password })); } + useEffect(() => { + dispatch(fetchSession()); + }, [dispatch]); + return ( <> { isAuth ? ( ): ( - + )} ); diff --git a/frontend-v2/src/app/api.ts b/frontend-v2/src/app/api.ts index f1092940..853052d8 100644 --- a/frontend-v2/src/app/api.ts +++ b/frontend-v2/src/app/api.ts @@ -1,6 +1,210 @@ import { backendApi } from './backendApi' export const api = backendApi.enhanceEndpoints({ + addTagTypes: ['Project', 'Compound', 'Dataset', 'CombinedModel', 'Variable', 'Simulation', 'Protocol', 'Unit'], + endpoints: { + // Projects + projectList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'Project' as const, id })), + { type: 'Project', id: 'LIST' }, + ] + : [{ type: 'Project', id: 'LIST' }], + }, + projectRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'Project', id }], + }, + projectUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Project', id }], + }, + projectCreate: { + invalidatesTags: [{ type: 'Project', id: 'LIST' }], + }, + projectDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'Project', id }, + { type: 'Project', id: 'LIST' } + ], + }, + // Compounds + compoundList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'Compound' as const, id })), + { type: 'Compound', id: 'LIST' }, + ] + : [{ type: 'Compound', id: 'LIST' }], + }, + compoundRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'Compound', id }], + }, + compoundUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Compound', id }, { type: 'Unit', id: 'LIST' }], + }, + compoundCreate: { + invalidatesTags: [{ type: 'Compound', id: 'LIST' }], + }, + compoundDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'Compound', id }, + { type: 'Compound', id: 'LIST' } + ], + }, + // Datasets + datasetList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'Dataset' as const, id })), + { type: 'Dataset', id: 'LIST' }, + ] + : [{ type: 'Dataset', id: 'LIST' }], + }, + datasetRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'Dataset', id }], + }, + datasetUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Dataset', id }], + }, + datasetCreate: { + invalidatesTags: [{ type: 'Dataset', id: 'LIST' }], + }, + datasetDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'Dataset', id }, + { type: 'Dataset', id: 'LIST' } + ], + }, + // CombinedModel + combinedModelSetParamsToDefaultsUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Variable', id: 'LIST' }], + }, + combinedModelList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'CombinedModel' as const, id })), + { type: 'CombinedModel', id: 'LIST' }, + ] + : [{ type: 'CombinedModel', id: 'LIST' }], + }, + combinedModelRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'CombinedModel', id }], + }, + combinedModelUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'CombinedModel', id }, { type: 'Variable', id: 'LIST' }, { type: 'Protocol', id: 'LIST' }], + }, + combinedModelCreate: { + invalidatesTags: [{ type: 'CombinedModel', id: 'LIST' }, { type: 'Variable', id: 'LIST' }], + }, + combinedModelDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'CombinedModel', id }, + { type: 'CombinedModel', id: 'LIST' }, + { type: 'Variable', id: 'LIST' } + ], + }, + variableList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'Variable' as const, id })), + { type: 'Variable', id: 'LIST' }, + ] + : [{ type: 'Variable', id: 'LIST' }], + }, + variableRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'Variable', id }], + }, + variableUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Variable', id }, { type: 'Protocol', id: 'LIST' }], + }, + variableCreate: { + invalidatesTags: [{ type: 'Variable', id: 'LIST' }], + }, + variableDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'Variable', id }, + { type: 'Variable', id: 'LIST' } + ], + }, + simulationList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'Simulation' as const, id })), + { type: 'Simulation', id: 'LIST' }, + ] + : [{ type: 'Simulation', id: 'LIST' }], + }, + simulationRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'Simulation', id }], + }, + simulationUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Simulation', id }], + }, + simulationCreate: { + invalidatesTags: [{ type: 'Simulation', id: 'LIST' }], + }, + simulationDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'Simulation', id }, + { type: 'Simulation', id: 'LIST' } + ], + }, + protocolList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'Protocol' as const, id })), + { type: 'Protocol', id: 'LIST' }, + ] + : [{ type: 'Protocol', id: 'LIST' }], + }, + protocolRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'Protocol', id }], + }, + protocolUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Protocol', id }], + }, + protocolCreate: { + invalidatesTags: [{ type: 'Protocol', id: 'LIST' }], + }, + protocolDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'Protocol', id }, + { type: 'Protocol', id: 'LIST' } + ], + }, + unitList: { + providesTags: (result) => + result + ? [ + ...result.map(({ id }) => ({ type: 'Unit' as const, id })), + { type: 'Unit', id: 'LIST' }, + ] + : [{ type: 'Unit', id: 'LIST' }], + }, + unitRetrieve: { + providesTags: (result, error, { id }) => [{ type: 'Unit', id }], + }, + unitUpdate: { + invalidatesTags: (result, error, { id }) => [{ type: 'Unit', id }], + }, + unitCreate: { + invalidatesTags: [{ type: 'Unit', id: 'LIST' }], + }, + unitDestroy: { + invalidatesTags: (result, error, { id }) => [ + { type: 'Unit', id }, + { type: 'Unit', id: 'LIST' } + ], + }, + + }, //addTagTypes: ['User'], //endpoints: { // getUserByUserId: { @@ -15,4 +219,4 @@ export const api = backendApi.enhanceEndpoints({ // endpoint.keepUnusedDataFor = 120 // }, //}, -}) +}); diff --git a/frontend-v2/src/app/backendApi.ts b/frontend-v2/src/app/backendApi.ts index 01200dfa..d3f07c32 100644 --- a/frontend-v2/src/app/backendApi.ts +++ b/frontend-v2/src/app/backendApi.ts @@ -1,465 +1,551 @@ import { emptySplitApi as api } from "./emptyApi"; const injectedRtkApi = api.injectEndpoints({ endpoints: (build) => ({ - listDatasets: build.query({ - query: () => ({ url: `/api/dataset/` }), + algorithmList: build.query({ + query: () => ({ url: `/api/algorithm/` }), }), - createDataset: build.mutation< - CreateDatasetApiResponse, - CreateDatasetApiArg + algorithmCreate: build.mutation< + AlgorithmCreateApiResponse, + AlgorithmCreateApiArg >({ query: (queryArg) => ({ - url: `/api/dataset/`, + url: `/api/algorithm/`, method: "POST", - body: queryArg.dataset, + body: queryArg.algorithm, }), }), - retrieveDataset: build.query< - RetrieveDatasetApiResponse, - RetrieveDatasetApiArg + algorithmRetrieve: build.query< + AlgorithmRetrieveApiResponse, + AlgorithmRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/dataset/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/algorithm/${queryArg.id}/` }), }), - updateDataset: build.mutation< - UpdateDatasetApiResponse, - UpdateDatasetApiArg + algorithmUpdate: build.mutation< + AlgorithmUpdateApiResponse, + AlgorithmUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/dataset/${queryArg.id}/`, + url: `/api/algorithm/${queryArg.id}/`, method: "PUT", - body: queryArg.dataset, + body: queryArg.algorithm, }), }), - partialUpdateDataset: build.mutation< - PartialUpdateDatasetApiResponse, - PartialUpdateDatasetApiArg + algorithmPartialUpdate: build.mutation< + AlgorithmPartialUpdateApiResponse, + AlgorithmPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/dataset/${queryArg.id}/`, + url: `/api/algorithm/${queryArg.id}/`, method: "PATCH", - body: queryArg.dataset, + body: queryArg.patchedAlgorithm, }), }), - destroyDataset: build.mutation< - DestroyDatasetApiResponse, - DestroyDatasetApiArg + algorithmDestroy: build.mutation< + AlgorithmDestroyApiResponse, + AlgorithmDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/dataset/${queryArg.id}/`, + url: `/api/algorithm/${queryArg.id}/`, method: "DELETE", }), }), - listUsers: build.query({ - query: () => ({ url: `/api/user/` }), + auceCreate: build.mutation({ + query: () => ({ url: `/api/auce/`, method: "POST" }), + }), + biomarkerTypeList: build.query< + BiomarkerTypeListApiResponse, + BiomarkerTypeListApiArg + >({ + query: () => ({ url: `/api/biomarker_type/` }), }), - createUser: build.mutation({ + biomarkerTypeCreate: build.mutation< + BiomarkerTypeCreateApiResponse, + BiomarkerTypeCreateApiArg + >({ query: (queryArg) => ({ - url: `/api/user/`, + url: `/api/biomarker_type/`, method: "POST", - body: queryArg.user, + body: queryArg.biomarkerType, }), }), - retrieveUser: build.query({ - query: (queryArg) => ({ url: `/api/user/${queryArg.id}/` }), + biomarkerTypeRetrieve: build.query< + BiomarkerTypeRetrieveApiResponse, + BiomarkerTypeRetrieveApiArg + >({ + query: (queryArg) => ({ url: `/api/biomarker_type/${queryArg.id}/` }), }), - updateUser: build.mutation({ + biomarkerTypeUpdate: build.mutation< + BiomarkerTypeUpdateApiResponse, + BiomarkerTypeUpdateApiArg + >({ query: (queryArg) => ({ - url: `/api/user/${queryArg.id}/`, + url: `/api/biomarker_type/${queryArg.id}/`, method: "PUT", - body: queryArg.user, + body: queryArg.biomarkerType, }), }), - partialUpdateUser: build.mutation< - PartialUpdateUserApiResponse, - PartialUpdateUserApiArg + biomarkerTypePartialUpdate: build.mutation< + BiomarkerTypePartialUpdateApiResponse, + BiomarkerTypePartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/user/${queryArg.id}/`, + url: `/api/biomarker_type/${queryArg.id}/`, method: "PATCH", - body: queryArg.user, + body: queryArg.patchedBiomarkerType, }), }), - destroyUser: build.mutation({ + biomarkerTypeDestroy: build.mutation< + BiomarkerTypeDestroyApiResponse, + BiomarkerTypeDestroyApiArg + >({ query: (queryArg) => ({ - url: `/api/user/${queryArg.id}/`, + url: `/api/biomarker_type/${queryArg.id}/`, method: "DELETE", }), }), - listSubjects: build.query({ - query: () => ({ url: `/api/subject/` }), + combinedModelList: build.query< + CombinedModelListApiResponse, + CombinedModelListApiArg + >({ + query: (queryArg) => ({ + url: `/api/combined_model/`, + params: { project_id: queryArg.projectId }, + }), }), - createSubject: build.mutation< - CreateSubjectApiResponse, - CreateSubjectApiArg + combinedModelCreate: build.mutation< + CombinedModelCreateApiResponse, + CombinedModelCreateApiArg >({ query: (queryArg) => ({ - url: `/api/subject/`, + url: `/api/combined_model/`, method: "POST", - body: queryArg.subject, + body: queryArg.combinedModel, }), }), - retrieveSubject: build.query< - RetrieveSubjectApiResponse, - RetrieveSubjectApiArg + combinedModelRetrieve: build.query< + CombinedModelRetrieveApiResponse, + CombinedModelRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/subject/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/combined_model/${queryArg.id}/` }), }), - updateSubject: build.mutation< - UpdateSubjectApiResponse, - UpdateSubjectApiArg + combinedModelUpdate: build.mutation< + CombinedModelUpdateApiResponse, + CombinedModelUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/subject/${queryArg.id}/`, + url: `/api/combined_model/${queryArg.id}/`, method: "PUT", - body: queryArg.subject, + body: queryArg.combinedModel, }), }), - partialUpdateSubject: build.mutation< - PartialUpdateSubjectApiResponse, - PartialUpdateSubjectApiArg + combinedModelPartialUpdate: build.mutation< + CombinedModelPartialUpdateApiResponse, + CombinedModelPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/subject/${queryArg.id}/`, + url: `/api/combined_model/${queryArg.id}/`, method: "PATCH", - body: queryArg.subject, + body: queryArg.patchedCombinedModel, }), }), - destroySubject: build.mutation< - DestroySubjectApiResponse, - DestroySubjectApiArg + combinedModelDestroy: build.mutation< + CombinedModelDestroyApiResponse, + CombinedModelDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/subject/${queryArg.id}/`, + url: `/api/combined_model/${queryArg.id}/`, method: "DELETE", }), }), - listProjects: build.query({ - query: () => ({ url: `/api/project/` }), + combinedModelSetParamsToDefaultsUpdate: build.mutation< + CombinedModelSetParamsToDefaultsUpdateApiResponse, + CombinedModelSetParamsToDefaultsUpdateApiArg + >({ + query: (queryArg) => ({ + url: `/api/combined_model/${queryArg.id}/set_params_to_defaults/`, + method: "PUT", + body: queryArg.combinedModel, + }), }), - createProject: build.mutation< - CreateProjectApiResponse, - CreateProjectApiArg + combinedModelSetVariablesFromInferenceUpdate: build.mutation< + CombinedModelSetVariablesFromInferenceUpdateApiResponse, + CombinedModelSetVariablesFromInferenceUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/project/`, + url: `/api/combined_model/${queryArg.id}/set_variables_from_inference/`, + method: "PUT", + body: queryArg.combinedModel, + }), + }), + combinedModelSimulateCreate: build.mutation< + CombinedModelSimulateCreateApiResponse, + CombinedModelSimulateCreateApiArg + >({ + query: (queryArg) => ({ + url: `/api/combined_model/${queryArg.id}/simulate`, method: "POST", - body: queryArg.project, + body: queryArg.simulate, }), }), - retrieveProject: build.query< - RetrieveProjectApiResponse, - RetrieveProjectApiArg + compoundList: build.query({ + query: () => ({ url: `/api/compound/` }), + }), + compoundCreate: build.mutation< + CompoundCreateApiResponse, + CompoundCreateApiArg >({ - query: (queryArg) => ({ url: `/api/project/${queryArg.id}/` }), + query: (queryArg) => ({ + url: `/api/compound/`, + method: "POST", + body: queryArg.compound, + }), + }), + compoundRetrieve: build.query< + CompoundRetrieveApiResponse, + CompoundRetrieveApiArg + >({ + query: (queryArg) => ({ url: `/api/compound/${queryArg.id}/` }), }), - updateProject: build.mutation< - UpdateProjectApiResponse, - UpdateProjectApiArg + compoundUpdate: build.mutation< + CompoundUpdateApiResponse, + CompoundUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/project/${queryArg.id}/`, + url: `/api/compound/${queryArg.id}/`, method: "PUT", - body: queryArg.project, + body: queryArg.compound, }), }), - partialUpdateProject: build.mutation< - PartialUpdateProjectApiResponse, - PartialUpdateProjectApiArg + compoundPartialUpdate: build.mutation< + CompoundPartialUpdateApiResponse, + CompoundPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/project/${queryArg.id}/`, + url: `/api/compound/${queryArg.id}/`, method: "PATCH", - body: queryArg.project, + body: queryArg.patchedCompound, }), }), - destroyProject: build.mutation< - DestroyProjectApiResponse, - DestroyProjectApiArg + compoundDestroy: build.mutation< + CompoundDestroyApiResponse, + CompoundDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/project/${queryArg.id}/`, + url: `/api/compound/${queryArg.id}/`, method: "DELETE", }), }), - listProjectAccess: build.query< - ListProjectAccessApiResponse, - ListProjectAccessApiArg - >({ - query: () => ({ url: `/api/project_access/` }), + datasetList: build.query({ + query: () => ({ url: `/api/dataset/` }), }), - createProjectAccess: build.mutation< - CreateProjectAccessApiResponse, - CreateProjectAccessApiArg + datasetCreate: build.mutation< + DatasetCreateApiResponse, + DatasetCreateApiArg >({ query: (queryArg) => ({ - url: `/api/project_access/`, + url: `/api/dataset/`, method: "POST", - body: queryArg.projectAccess, + body: queryArg.dataset, }), }), - retrieveProjectAccess: build.query< - RetrieveProjectAccessApiResponse, - RetrieveProjectAccessApiArg + datasetRetrieve: build.query< + DatasetRetrieveApiResponse, + DatasetRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/project_access/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/dataset/${queryArg.id}/` }), }), - updateProjectAccess: build.mutation< - UpdateProjectAccessApiResponse, - UpdateProjectAccessApiArg + datasetUpdate: build.mutation< + DatasetUpdateApiResponse, + DatasetUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/project_access/${queryArg.id}/`, + url: `/api/dataset/${queryArg.id}/`, method: "PUT", - body: queryArg.projectAccess, + body: queryArg.dataset, }), }), - partialUpdateProjectAccess: build.mutation< - PartialUpdateProjectAccessApiResponse, - PartialUpdateProjectAccessApiArg + datasetPartialUpdate: build.mutation< + DatasetPartialUpdateApiResponse, + DatasetPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/project_access/${queryArg.id}/`, + url: `/api/dataset/${queryArg.id}/`, method: "PATCH", - body: queryArg.projectAccess, + body: queryArg.patchedDataset, }), }), - destroyProjectAccess: build.mutation< - DestroyProjectAccessApiResponse, - DestroyProjectAccessApiArg + datasetDestroy: build.mutation< + DatasetDestroyApiResponse, + DatasetDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/project_access/${queryArg.id}/`, + url: `/api/dataset/${queryArg.id}/`, method: "DELETE", }), }), - listDoses: build.query({ + datasetCsvUpdate: build.mutation< + DatasetCsvUpdateApiResponse, + DatasetCsvUpdateApiArg + >({ + query: (queryArg) => ({ + url: `/api/dataset/${queryArg.id}/csv/`, + method: "PUT", + body: queryArg.datasetCsv, + }), + }), + doseList: build.query({ query: () => ({ url: `/api/dose/` }), }), - createDose: build.mutation({ + doseCreate: build.mutation({ query: (queryArg) => ({ url: `/api/dose/`, method: "POST", body: queryArg.dose, }), }), - retrieveDose: build.query({ + doseRetrieve: build.query({ query: (queryArg) => ({ url: `/api/dose/${queryArg.id}/` }), }), - updateDose: build.mutation({ + doseUpdate: build.mutation({ query: (queryArg) => ({ url: `/api/dose/${queryArg.id}/`, method: "PUT", body: queryArg.dose, }), }), - partialUpdateDose: build.mutation< - PartialUpdateDoseApiResponse, - PartialUpdateDoseApiArg + dosePartialUpdate: build.mutation< + DosePartialUpdateApiResponse, + DosePartialUpdateApiArg >({ query: (queryArg) => ({ url: `/api/dose/${queryArg.id}/`, method: "PATCH", - body: queryArg.dose, + body: queryArg.patchedDose, }), }), - destroyDose: build.mutation({ + doseDestroy: build.mutation({ query: (queryArg) => ({ url: `/api/dose/${queryArg.id}/`, method: "DELETE", }), }), - listUnits: build.query({ - query: () => ({ url: `/api/unit/` }), + inferenceList: build.query({ + query: () => ({ url: `/api/inference/` }), }), - createUnit: build.mutation({ + inferenceCreate: build.mutation< + InferenceCreateApiResponse, + InferenceCreateApiArg + >({ query: (queryArg) => ({ - url: `/api/unit/`, + url: `/api/inference/`, method: "POST", - body: queryArg.unit, + body: queryArg.inference, }), }), - retrieveUnit: build.query({ - query: (queryArg) => ({ url: `/api/unit/${queryArg.id}/` }), + inferenceRetrieve: build.query< + InferenceRetrieveApiResponse, + InferenceRetrieveApiArg + >({ + query: (queryArg) => ({ url: `/api/inference/${queryArg.id}/` }), }), - updateUnit: build.mutation({ + inferenceUpdate: build.mutation< + InferenceUpdateApiResponse, + InferenceUpdateApiArg + >({ query: (queryArg) => ({ - url: `/api/unit/${queryArg.id}/`, + url: `/api/inference/${queryArg.id}/`, method: "PUT", - body: queryArg.unit, + body: queryArg.inference, }), }), - partialUpdateUnit: build.mutation< - PartialUpdateUnitApiResponse, - PartialUpdateUnitApiArg + inferencePartialUpdate: build.mutation< + InferencePartialUpdateApiResponse, + InferencePartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/unit/${queryArg.id}/`, + url: `/api/inference/${queryArg.id}/`, method: "PATCH", - body: queryArg.unit, + body: queryArg.patchedInference, }), }), - destroyUnit: build.mutation({ + inferenceDestroy: build.mutation< + InferenceDestroyApiResponse, + InferenceDestroyApiArg + >({ query: (queryArg) => ({ - url: `/api/unit/${queryArg.id}/`, + url: `/api/inference/${queryArg.id}/`, method: "DELETE", }), }), - listVariables: build.query({ - query: () => ({ url: `/api/variable/` }), + inferenceStopCreate: build.mutation< + InferenceStopCreateApiResponse, + InferenceStopCreateApiArg + >({ + query: (queryArg) => ({ + url: `/api/inference/${queryArg.id}/stop`, + method: "POST", + }), + }), + inferenceWizardCreate: build.mutation< + InferenceWizardCreateApiResponse, + InferenceWizardCreateApiArg + >({ + query: () => ({ url: `/api/inference/wizard`, method: "POST" }), + }), + inferenceChainList: build.query< + InferenceChainListApiResponse, + InferenceChainListApiArg + >({ + query: () => ({ url: `/api/inference_chain/` }), }), - createVariable: build.mutation< - CreateVariableApiResponse, - CreateVariableApiArg + inferenceChainCreate: build.mutation< + InferenceChainCreateApiResponse, + InferenceChainCreateApiArg >({ query: (queryArg) => ({ - url: `/api/variable/`, + url: `/api/inference_chain/`, method: "POST", - body: queryArg.variable, + body: queryArg.inferenceChain, }), }), - retrieveVariable: build.query< - RetrieveVariableApiResponse, - RetrieveVariableApiArg + inferenceChainRetrieve: build.query< + InferenceChainRetrieveApiResponse, + InferenceChainRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/variable/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/inference_chain/${queryArg.id}/` }), }), - updateVariable: build.mutation< - UpdateVariableApiResponse, - UpdateVariableApiArg + inferenceChainUpdate: build.mutation< + InferenceChainUpdateApiResponse, + InferenceChainUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/variable/${queryArg.id}/`, + url: `/api/inference_chain/${queryArg.id}/`, method: "PUT", - body: queryArg.variable, + body: queryArg.inferenceChain, }), }), - partialUpdateVariable: build.mutation< - PartialUpdateVariableApiResponse, - PartialUpdateVariableApiArg + inferenceChainPartialUpdate: build.mutation< + InferenceChainPartialUpdateApiResponse, + InferenceChainPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/variable/${queryArg.id}/`, + url: `/api/inference_chain/${queryArg.id}/`, method: "PATCH", - body: queryArg.variable, + body: queryArg.patchedInferenceChain, }), }), - destroyVariable: build.mutation< - DestroyVariableApiResponse, - DestroyVariableApiArg + inferenceChainDestroy: build.mutation< + InferenceChainDestroyApiResponse, + InferenceChainDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/variable/${queryArg.id}/`, + url: `/api/inference_chain/${queryArg.id}/`, method: "DELETE", }), }), - listProtocols: build.query({ - query: () => ({ url: `/api/protocol/` }), + ncaCreate: build.mutation({ + query: () => ({ url: `/api/nca/`, method: "POST" }), + }), + pharmacodynamicList: build.query< + PharmacodynamicListApiResponse, + PharmacodynamicListApiArg + >({ + query: () => ({ url: `/api/pharmacodynamic/` }), }), - createProtocol: build.mutation< - CreateProtocolApiResponse, - CreateProtocolApiArg + pharmacodynamicCreate: build.mutation< + PharmacodynamicCreateApiResponse, + PharmacodynamicCreateApiArg >({ query: (queryArg) => ({ - url: `/api/protocol/`, + url: `/api/pharmacodynamic/`, method: "POST", - body: queryArg.protocol, + body: queryArg.pharmacodynamic, }), }), - retrieveProtocol: build.query< - RetrieveProtocolApiResponse, - RetrieveProtocolApiArg + pharmacodynamicRetrieve: build.query< + PharmacodynamicRetrieveApiResponse, + PharmacodynamicRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/protocol/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/pharmacodynamic/${queryArg.id}/` }), }), - updateProtocol: build.mutation< - UpdateProtocolApiResponse, - UpdateProtocolApiArg + pharmacodynamicUpdate: build.mutation< + PharmacodynamicUpdateApiResponse, + PharmacodynamicUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/protocol/${queryArg.id}/`, + url: `/api/pharmacodynamic/${queryArg.id}/`, method: "PUT", - body: queryArg.protocol, + body: queryArg.pharmacodynamic, }), }), - partialUpdateProtocol: build.mutation< - PartialUpdateProtocolApiResponse, - PartialUpdateProtocolApiArg + pharmacodynamicPartialUpdate: build.mutation< + PharmacodynamicPartialUpdateApiResponse, + PharmacodynamicPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/protocol/${queryArg.id}/`, + url: `/api/pharmacodynamic/${queryArg.id}/`, method: "PATCH", - body: queryArg.protocol, + body: queryArg.patchedPharmacodynamic, }), }), - destroyProtocol: build.mutation< - DestroyProtocolApiResponse, - DestroyProtocolApiArg + pharmacodynamicDestroy: build.mutation< + PharmacodynamicDestroyApiResponse, + PharmacodynamicDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/protocol/${queryArg.id}/`, + url: `/api/pharmacodynamic/${queryArg.id}/`, method: "DELETE", }), }), - listBiomarkerTypes: build.query< - ListBiomarkerTypesApiResponse, - ListBiomarkerTypesApiArg - >({ - query: () => ({ url: `/api/biomarker_type/` }), - }), - createBiomarkerType: build.mutation< - CreateBiomarkerTypeApiResponse, - CreateBiomarkerTypeApiArg + pharmacodynamicMmtUpdate: build.mutation< + PharmacodynamicMmtUpdateApiResponse, + PharmacodynamicMmtUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/biomarker_type/`, - method: "POST", - body: queryArg.biomarkerType, + url: `/api/pharmacodynamic/${queryArg.id}/mmt/`, + method: "PUT", + body: queryArg.pharmacodynamic, }), }), - retrieveBiomarkerType: build.query< - RetrieveBiomarkerTypeApiResponse, - RetrieveBiomarkerTypeApiArg - >({ - query: (queryArg) => ({ url: `/api/biomarker_type/${queryArg.id}/` }), - }), - updateBiomarkerType: build.mutation< - UpdateBiomarkerTypeApiResponse, - UpdateBiomarkerTypeApiArg + pharmacodynamicSbmlUpdate: build.mutation< + PharmacodynamicSbmlUpdateApiResponse, + PharmacodynamicSbmlUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/biomarker_type/${queryArg.id}/`, + url: `/api/pharmacodynamic/${queryArg.id}/sbml/`, method: "PUT", - body: queryArg.biomarkerType, + body: queryArg.pharmacodynamicSbml, }), }), - partialUpdateBiomarkerType: build.mutation< - PartialUpdateBiomarkerTypeApiResponse, - PartialUpdateBiomarkerTypeApiArg + pharmacodynamicSetVariablesFromInferenceUpdate: build.mutation< + PharmacodynamicSetVariablesFromInferenceUpdateApiResponse, + PharmacodynamicSetVariablesFromInferenceUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/biomarker_type/${queryArg.id}/`, - method: "PATCH", - body: queryArg.biomarkerType, + url: `/api/pharmacodynamic/${queryArg.id}/set_variables_from_inference/`, + method: "PUT", + body: queryArg.pharmacodynamic, }), }), - destroyBiomarkerType: build.mutation< - DestroyBiomarkerTypeApiResponse, - DestroyBiomarkerTypeApiArg + pharmacodynamicSimulateCreate: build.mutation< + PharmacodynamicSimulateCreateApiResponse, + PharmacodynamicSimulateCreateApiArg >({ query: (queryArg) => ({ - url: `/api/biomarker_type/${queryArg.id}/`, - method: "DELETE", + url: `/api/pharmacodynamic/${queryArg.id}/simulate`, + method: "POST", + body: queryArg.simulate, }), }), - listPharmacokineticModels: build.query< - ListPharmacokineticModelsApiResponse, - ListPharmacokineticModelsApiArg + pharmacokineticList: build.query< + PharmacokineticListApiResponse, + PharmacokineticListApiArg >({ query: () => ({ url: `/api/pharmacokinetic/` }), }), - createPharmacokineticModel: build.mutation< - CreatePharmacokineticModelApiResponse, - CreatePharmacokineticModelApiArg + pharmacokineticCreate: build.mutation< + PharmacokineticCreateApiResponse, + PharmacokineticCreateApiArg >({ query: (queryArg) => ({ url: `/api/pharmacokinetic/`, @@ -467,15 +553,15 @@ const injectedRtkApi = api.injectEndpoints({ body: queryArg.pharmacokinetic, }), }), - retrievePharmacokineticModel: build.query< - RetrievePharmacokineticModelApiResponse, - RetrievePharmacokineticModelApiArg + pharmacokineticRetrieve: build.query< + PharmacokineticRetrieveApiResponse, + PharmacokineticRetrieveApiArg >({ query: (queryArg) => ({ url: `/api/pharmacokinetic/${queryArg.id}/` }), }), - updatePharmacokineticModel: build.mutation< - UpdatePharmacokineticModelApiResponse, - UpdatePharmacokineticModelApiArg + pharmacokineticUpdate: build.mutation< + PharmacokineticUpdateApiResponse, + PharmacokineticUpdateApiArg >({ query: (queryArg) => ({ url: `/api/pharmacokinetic/${queryArg.id}/`, @@ -483,966 +569,1926 @@ const injectedRtkApi = api.injectEndpoints({ body: queryArg.pharmacokinetic, }), }), - partialUpdatePharmacokineticModel: build.mutation< - PartialUpdatePharmacokineticModelApiResponse, - PartialUpdatePharmacokineticModelApiArg + pharmacokineticPartialUpdate: build.mutation< + PharmacokineticPartialUpdateApiResponse, + PharmacokineticPartialUpdateApiArg >({ query: (queryArg) => ({ url: `/api/pharmacokinetic/${queryArg.id}/`, method: "PATCH", - body: queryArg.pharmacokinetic, + body: queryArg.patchedPharmacokinetic, }), }), - destroyPharmacokineticModel: build.mutation< - DestroyPharmacokineticModelApiResponse, - DestroyPharmacokineticModelApiArg + pharmacokineticDestroy: build.mutation< + PharmacokineticDestroyApiResponse, + PharmacokineticDestroyApiArg >({ query: (queryArg) => ({ url: `/api/pharmacokinetic/${queryArg.id}/`, method: "DELETE", }), }), - listPharmacodynamicModels: build.query< - ListPharmacodynamicModelsApiResponse, - ListPharmacodynamicModelsApiArg - >({ - query: () => ({ url: `/api/pharmacodynamic/` }), + projectList: build.query({ + query: () => ({ url: `/api/project/` }), }), - createPharmacodynamicModel: build.mutation< - CreatePharmacodynamicModelApiResponse, - CreatePharmacodynamicModelApiArg + projectCreate: build.mutation< + ProjectCreateApiResponse, + ProjectCreateApiArg >({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/`, + url: `/api/project/`, method: "POST", - body: queryArg.pharmacodynamic, + body: queryArg.project, }), }), - retrievePharmacodynamicModel: build.query< - RetrievePharmacodynamicModelApiResponse, - RetrievePharmacodynamicModelApiArg + projectRetrieve: build.query< + ProjectRetrieveApiResponse, + ProjectRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/pharmacodynamic/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/project/${queryArg.id}/` }), }), - updatePharmacodynamicModel: build.mutation< - UpdatePharmacodynamicModelApiResponse, - UpdatePharmacodynamicModelApiArg + projectUpdate: build.mutation< + ProjectUpdateApiResponse, + ProjectUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/${queryArg.id}/`, + url: `/api/project/${queryArg.id}/`, method: "PUT", - body: queryArg.pharmacodynamic, + body: queryArg.project, }), }), - partialUpdatePharmacodynamicModel: build.mutation< - PartialUpdatePharmacodynamicModelApiResponse, - PartialUpdatePharmacodynamicModelApiArg + projectPartialUpdate: build.mutation< + ProjectPartialUpdateApiResponse, + ProjectPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/${queryArg.id}/`, + url: `/api/project/${queryArg.id}/`, method: "PATCH", - body: queryArg.pharmacodynamic, + body: queryArg.patchedProject, }), }), - destroyPharmacodynamicModel: build.mutation< - DestroyPharmacodynamicModelApiResponse, - DestroyPharmacodynamicModelApiArg + projectDestroy: build.mutation< + ProjectDestroyApiResponse, + ProjectDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/${queryArg.id}/`, + url: `/api/project/${queryArg.id}/`, method: "DELETE", }), }), - listDosedPharmacokineticModels: build.query< - ListDosedPharmacokineticModelsApiResponse, - ListDosedPharmacokineticModelsApiArg + projectMonolixUpdate: build.mutation< + ProjectMonolixUpdateApiResponse, + ProjectMonolixUpdateApiArg + >({ + query: (queryArg) => ({ + url: `/api/project/${queryArg.id}/monolix/`, + method: "PUT", + body: queryArg.monolix, + }), + }), + projectAccessList: build.query< + ProjectAccessListApiResponse, + ProjectAccessListApiArg >({ - query: () => ({ url: `/api/dosed_pharmacokinetic/` }), + query: () => ({ url: `/api/project_access/` }), }), - createDosedPharmacokineticModel: build.mutation< - CreateDosedPharmacokineticModelApiResponse, - CreateDosedPharmacokineticModelApiArg + projectAccessCreate: build.mutation< + ProjectAccessCreateApiResponse, + ProjectAccessCreateApiArg >({ query: (queryArg) => ({ - url: `/api/dosed_pharmacokinetic/`, + url: `/api/project_access/`, method: "POST", - body: queryArg.dosedPharmacokinetic, + body: queryArg.projectAccess, }), }), - retrieveDosedPharmacokineticModel: build.query< - RetrieveDosedPharmacokineticModelApiResponse, - RetrieveDosedPharmacokineticModelApiArg + projectAccessRetrieve: build.query< + ProjectAccessRetrieveApiResponse, + ProjectAccessRetrieveApiArg >({ - query: (queryArg) => ({ - url: `/api/dosed_pharmacokinetic/${queryArg.id}/`, - }), + query: (queryArg) => ({ url: `/api/project_access/${queryArg.id}/` }), }), - updateDosedPharmacokineticModel: build.mutation< - UpdateDosedPharmacokineticModelApiResponse, - UpdateDosedPharmacokineticModelApiArg + projectAccessUpdate: build.mutation< + ProjectAccessUpdateApiResponse, + ProjectAccessUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/dosed_pharmacokinetic/${queryArg.id}/`, + url: `/api/project_access/${queryArg.id}/`, method: "PUT", - body: queryArg.dosedPharmacokinetic, + body: queryArg.projectAccess, }), }), - partialUpdateDosedPharmacokineticModel: build.mutation< - PartialUpdateDosedPharmacokineticModelApiResponse, - PartialUpdateDosedPharmacokineticModelApiArg + projectAccessPartialUpdate: build.mutation< + ProjectAccessPartialUpdateApiResponse, + ProjectAccessPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/dosed_pharmacokinetic/${queryArg.id}/`, + url: `/api/project_access/${queryArg.id}/`, method: "PATCH", - body: queryArg.dosedPharmacokinetic, + body: queryArg.patchedProjectAccess, }), }), - destroyDosedPharmacokineticModel: build.mutation< - DestroyDosedPharmacokineticModelApiResponse, - DestroyDosedPharmacokineticModelApiArg + projectAccessDestroy: build.mutation< + ProjectAccessDestroyApiResponse, + ProjectAccessDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/dosed_pharmacokinetic/${queryArg.id}/`, + url: `/api/project_access/${queryArg.id}/`, method: "DELETE", }), }), - listInferences: build.query< - ListInferencesApiResponse, - ListInferencesApiArg - >({ - query: () => ({ url: `/api/inference/` }), + protocolList: build.query({ + query: (queryArg) => ({ + url: `/api/protocol/`, + params: { project_id: queryArg.projectId }, + }), }), - createInference: build.mutation< - CreateInferenceApiResponse, - CreateInferenceApiArg + protocolCreate: build.mutation< + ProtocolCreateApiResponse, + ProtocolCreateApiArg >({ query: (queryArg) => ({ - url: `/api/inference/`, + url: `/api/protocol/`, method: "POST", - body: queryArg.inference, + body: queryArg.protocol, }), }), - retrieveInference: build.query< - RetrieveInferenceApiResponse, - RetrieveInferenceApiArg + protocolRetrieve: build.query< + ProtocolRetrieveApiResponse, + ProtocolRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/inference/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/protocol/${queryArg.id}/` }), }), - updateInference: build.mutation< - UpdateInferenceApiResponse, - UpdateInferenceApiArg + protocolUpdate: build.mutation< + ProtocolUpdateApiResponse, + ProtocolUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/inference/${queryArg.id}/`, + url: `/api/protocol/${queryArg.id}/`, method: "PUT", - body: queryArg.inference, + body: queryArg.protocol, }), }), - partialUpdateInference: build.mutation< - PartialUpdateInferenceApiResponse, - PartialUpdateInferenceApiArg + protocolPartialUpdate: build.mutation< + ProtocolPartialUpdateApiResponse, + ProtocolPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/inference/${queryArg.id}/`, + url: `/api/protocol/${queryArg.id}/`, method: "PATCH", - body: queryArg.inference, + body: queryArg.patchedProtocol, }), }), - destroyInference: build.mutation< - DestroyInferenceApiResponse, - DestroyInferenceApiArg + protocolDestroy: build.mutation< + ProtocolDestroyApiResponse, + ProtocolDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/inference/${queryArg.id}/`, + url: `/api/protocol/${queryArg.id}/`, method: "DELETE", }), }), - listAlgorithms: build.query< - ListAlgorithmsApiResponse, - ListAlgorithmsApiArg + sessionRetrieve: build.query< + SessionRetrieveApiResponse, + SessionRetrieveApiArg >({ - query: () => ({ url: `/api/algorithm/` }), + query: () => ({ url: `/api/session/` }), }), - createAlgorithm: build.mutation< - CreateAlgorithmApiResponse, - CreateAlgorithmApiArg + simulationList: build.query< + SimulationListApiResponse, + SimulationListApiArg >({ query: (queryArg) => ({ - url: `/api/algorithm/`, + url: `/api/simulation/`, + params: { project_id: queryArg.projectId }, + }), + }), + simulationCreate: build.mutation< + SimulationCreateApiResponse, + SimulationCreateApiArg + >({ + query: (queryArg) => ({ + url: `/api/simulation/`, method: "POST", - body: queryArg.algorithm, + body: queryArg.simulation, }), }), - retrieveAlgorithm: build.query< - RetrieveAlgorithmApiResponse, - RetrieveAlgorithmApiArg + simulationRetrieve: build.query< + SimulationRetrieveApiResponse, + SimulationRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/algorithm/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/simulation/${queryArg.id}/` }), }), - updateAlgorithm: build.mutation< - UpdateAlgorithmApiResponse, - UpdateAlgorithmApiArg + simulationUpdate: build.mutation< + SimulationUpdateApiResponse, + SimulationUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/algorithm/${queryArg.id}/`, + url: `/api/simulation/${queryArg.id}/`, method: "PUT", - body: queryArg.algorithm, + body: queryArg.simulation, }), }), - partialUpdateAlgorithm: build.mutation< - PartialUpdateAlgorithmApiResponse, - PartialUpdateAlgorithmApiArg + simulationPartialUpdate: build.mutation< + SimulationPartialUpdateApiResponse, + SimulationPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/algorithm/${queryArg.id}/`, + url: `/api/simulation/${queryArg.id}/`, method: "PATCH", - body: queryArg.algorithm, + body: queryArg.patchedSimulation, }), }), - destroyAlgorithm: build.mutation< - DestroyAlgorithmApiResponse, - DestroyAlgorithmApiArg + simulationDestroy: build.mutation< + SimulationDestroyApiResponse, + SimulationDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/algorithm/${queryArg.id}/`, + url: `/api/simulation/${queryArg.id}/`, method: "DELETE", }), }), - listInferenceChains: build.query< - ListInferenceChainsApiResponse, - ListInferenceChainsApiArg - >({ - query: () => ({ url: `/api/inference_chain/` }), + subjectList: build.query({ + query: () => ({ url: `/api/subject/` }), }), - createInferenceChain: build.mutation< - CreateInferenceChainApiResponse, - CreateInferenceChainApiArg + subjectCreate: build.mutation< + SubjectCreateApiResponse, + SubjectCreateApiArg >({ query: (queryArg) => ({ - url: `/api/inference_chain/`, + url: `/api/subject/`, method: "POST", - body: queryArg.inferenceChain, + body: queryArg.subject, }), }), - retrieveInferenceChain: build.query< - RetrieveInferenceChainApiResponse, - RetrieveInferenceChainApiArg + subjectRetrieve: build.query< + SubjectRetrieveApiResponse, + SubjectRetrieveApiArg >({ - query: (queryArg) => ({ url: `/api/inference_chain/${queryArg.id}/` }), + query: (queryArg) => ({ url: `/api/subject/${queryArg.id}/` }), }), - updateInferenceChain: build.mutation< - UpdateInferenceChainApiResponse, - UpdateInferenceChainApiArg + subjectUpdate: build.mutation< + SubjectUpdateApiResponse, + SubjectUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/inference_chain/${queryArg.id}/`, + url: `/api/subject/${queryArg.id}/`, method: "PUT", - body: queryArg.inferenceChain, + body: queryArg.subject, }), }), - partialUpdateInferenceChain: build.mutation< - PartialUpdateInferenceChainApiResponse, - PartialUpdateInferenceChainApiArg + subjectPartialUpdate: build.mutation< + SubjectPartialUpdateApiResponse, + SubjectPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/inference_chain/${queryArg.id}/`, + url: `/api/subject/${queryArg.id}/`, method: "PATCH", - body: queryArg.inferenceChain, + body: queryArg.patchedSubject, }), }), - destroyInferenceChain: build.mutation< - DestroyInferenceChainApiResponse, - DestroyInferenceChainApiArg + subjectDestroy: build.mutation< + SubjectDestroyApiResponse, + SubjectDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/inference_chain/${queryArg.id}/`, + url: `/api/subject/${queryArg.id}/`, method: "DELETE", }), }), - listSessions: build.query({ - query: () => ({ url: `/api/session/` }), - }), - listWhoAmIs: build.query({ - query: () => ({ url: `/api/whoami/` }), + unitList: build.query({ + query: (queryArg) => ({ + url: `/api/unit/`, + params: { compound_id: queryArg.compoundId }, + }), }), - createNca: build.mutation({ + unitCreate: build.mutation({ query: (queryArg) => ({ - url: `/api/nca/`, + url: `/api/unit/`, method: "POST", - body: queryArg.body, + body: queryArg.unit, }), }), - createAuce: build.mutation({ + unitRetrieve: build.query({ query: (queryArg) => ({ - url: `/api/auce/`, - method: "POST", - body: queryArg.body, + url: `/api/unit/${queryArg.id}/`, + params: { compound_id: queryArg.compoundId }, }), }), - createSimulatePk: build.mutation< - CreateSimulatePkApiResponse, - CreateSimulatePkApiArg - >({ + unitUpdate: build.mutation({ query: (queryArg) => ({ - url: `/api/dosed_pharmacokinetic/${queryArg.id}/simulate`, - method: "POST", - body: queryArg.body, + url: `/api/unit/${queryArg.id}/`, + method: "PUT", + body: queryArg.unit, }), }), - createInferenceWizard: build.mutation< - CreateInferenceWizardApiResponse, - CreateInferenceWizardApiArg + unitPartialUpdate: build.mutation< + UnitPartialUpdateApiResponse, + UnitPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/inference/wizard`, - method: "POST", - body: queryArg.body, + url: `/api/unit/${queryArg.id}/`, + method: "PATCH", + body: queryArg.patchedUnit, }), }), - createStopInference: build.mutation< - CreateStopInferenceApiResponse, - CreateStopInferenceApiArg - >({ + unitDestroy: build.mutation({ query: (queryArg) => ({ - url: `/api/inference/${queryArg.id}/stop`, - method: "POST", - body: queryArg.body, + url: `/api/unit/${queryArg.id}/`, + method: "DELETE", }), }), - createSimulatePd: build.mutation< - CreateSimulatePdApiResponse, - CreateSimulatePdApiArg - >({ + userList: build.query({ + query: () => ({ url: `/api/user/` }), + }), + userCreate: build.mutation({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/${queryArg.id}/simulate`, + url: `/api/user/`, method: "POST", - body: queryArg.body, + body: queryArg.user, }), }), - csvDataset: build.mutation({ + userRetrieve: build.query({ + query: (queryArg) => ({ url: `/api/user/${queryArg.id}/` }), + }), + userUpdate: build.mutation({ query: (queryArg) => ({ - url: `/api/dataset/${queryArg.id}/csv/`, + url: `/api/user/${queryArg.id}/`, method: "PUT", - body: queryArg.datasetCsv, + body: queryArg.user, }), }), - monolixProject: build.mutation< - MonolixProjectApiResponse, - MonolixProjectApiArg + userPartialUpdate: build.mutation< + UserPartialUpdateApiResponse, + UserPartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/project/${queryArg.id}/monolix/`, - method: "PUT", - body: queryArg.monolix, + url: `/api/user/${queryArg.id}/`, + method: "PATCH", + body: queryArg.patchedUser, + }), + }), + userDestroy: build.mutation({ + query: (queryArg) => ({ + url: `/api/user/${queryArg.id}/`, + method: "DELETE", + }), + }), + variableList: build.query({ + query: (queryArg) => ({ + url: `/api/variable/`, + params: { + dosed_pk_model_id: queryArg.dosedPkModelId, + pd_model_id: queryArg.pdModelId, + project_id: queryArg.projectId, + }, }), }), - mmtPharmacodynamicModel: build.mutation< - MmtPharmacodynamicModelApiResponse, - MmtPharmacodynamicModelApiArg + variableCreate: build.mutation< + VariableCreateApiResponse, + VariableCreateApiArg >({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/${queryArg.id}/mmt/`, - method: "PUT", - body: queryArg.pharmacodynamic, + url: `/api/variable/`, + method: "POST", + body: queryArg.variable, }), }), - sbmlPharmacodynamicModel: build.mutation< - SbmlPharmacodynamicModelApiResponse, - SbmlPharmacodynamicModelApiArg + variableRetrieve: build.query< + VariableRetrieveApiResponse, + VariableRetrieveApiArg + >({ + query: (queryArg) => ({ url: `/api/variable/${queryArg.id}/` }), + }), + variableUpdate: build.mutation< + VariableUpdateApiResponse, + VariableUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/${queryArg.id}/sbml/`, + url: `/api/variable/${queryArg.id}/`, method: "PUT", - body: queryArg.pharmacodynamicSbml, + body: queryArg.variable, }), }), - setVariablesFromInferencePharmacodynamicModel: build.mutation< - SetVariablesFromInferencePharmacodynamicModelApiResponse, - SetVariablesFromInferencePharmacodynamicModelApiArg + variablePartialUpdate: build.mutation< + VariablePartialUpdateApiResponse, + VariablePartialUpdateApiArg >({ query: (queryArg) => ({ - url: `/api/pharmacodynamic/${queryArg.id}/set_variables_from_inference/`, - method: "PUT", - body: queryArg.pharmacodynamic, + url: `/api/variable/${queryArg.id}/`, + method: "PATCH", + body: queryArg.patchedVariable, }), }), - setVariablesFromInferenceDosedPharmacokineticModel: build.mutation< - SetVariablesFromInferenceDosedPharmacokineticModelApiResponse, - SetVariablesFromInferenceDosedPharmacokineticModelApiArg + variableDestroy: build.mutation< + VariableDestroyApiResponse, + VariableDestroyApiArg >({ query: (queryArg) => ({ - url: `/api/dosed_pharmacokinetic/${queryArg.id}/set_variables_from_inference/`, - method: "PUT", - body: queryArg.dosedPharmacokinetic, + url: `/api/variable/${queryArg.id}/`, + method: "DELETE", }), }), + whoamiRetrieve: build.query< + WhoamiRetrieveApiResponse, + WhoamiRetrieveApiArg + >({ + query: () => ({ url: `/api/whoami/` }), + }), }), overrideExisting: false, }); export { injectedRtkApi as backendApi }; -export type ListDatasetsApiResponse = /** status 200 */ Dataset[]; -export type ListDatasetsApiArg = void; -export type CreateDatasetApiResponse = /** status 201 */ Dataset; -export type CreateDatasetApiArg = { +export type AlgorithmListApiResponse = /** status 200 */ AlgorithmRead[]; +export type AlgorithmListApiArg = void; +export type AlgorithmCreateApiResponse = /** status 201 */ AlgorithmRead; +export type AlgorithmCreateApiArg = { + algorithm: Algorithm; +}; +export type AlgorithmRetrieveApiResponse = /** status 200 */ AlgorithmRead; +export type AlgorithmRetrieveApiArg = { + /** A unique integer value identifying this algorithm. */ + id: number; +}; +export type AlgorithmUpdateApiResponse = /** status 200 */ AlgorithmRead; +export type AlgorithmUpdateApiArg = { + /** A unique integer value identifying this algorithm. */ + id: number; + algorithm: Algorithm; +}; +export type AlgorithmPartialUpdateApiResponse = + /** status 200 */ AlgorithmRead; +export type AlgorithmPartialUpdateApiArg = { + /** A unique integer value identifying this algorithm. */ + id: number; + patchedAlgorithm: PatchedAlgorithm; +}; +export type AlgorithmDestroyApiResponse = unknown; +export type AlgorithmDestroyApiArg = { + /** A unique integer value identifying this algorithm. */ + id: number; +}; +export type AuceCreateApiResponse = unknown; +export type AuceCreateApiArg = void; +export type BiomarkerTypeListApiResponse = + /** status 200 */ BiomarkerTypeRead[]; +export type BiomarkerTypeListApiArg = void; +export type BiomarkerTypeCreateApiResponse = + /** status 201 */ BiomarkerTypeRead; +export type BiomarkerTypeCreateApiArg = { + biomarkerType: BiomarkerType; +}; +export type BiomarkerTypeRetrieveApiResponse = + /** status 200 */ BiomarkerTypeRead; +export type BiomarkerTypeRetrieveApiArg = { + /** A unique integer value identifying this biomarker type. */ + id: number; +}; +export type BiomarkerTypeUpdateApiResponse = + /** status 200 */ BiomarkerTypeRead; +export type BiomarkerTypeUpdateApiArg = { + /** A unique integer value identifying this biomarker type. */ + id: number; + biomarkerType: BiomarkerType; +}; +export type BiomarkerTypePartialUpdateApiResponse = + /** status 200 */ BiomarkerTypeRead; +export type BiomarkerTypePartialUpdateApiArg = { + /** A unique integer value identifying this biomarker type. */ + id: number; + patchedBiomarkerType: PatchedBiomarkerType; +}; +export type BiomarkerTypeDestroyApiResponse = unknown; +export type BiomarkerTypeDestroyApiArg = { + /** A unique integer value identifying this biomarker type. */ + id: number; +}; +export type CombinedModelListApiResponse = + /** status 200 */ CombinedModelRead[]; +export type CombinedModelListApiArg = { + /** Filter results by project ID */ + projectId?: number; +}; +export type CombinedModelCreateApiResponse = + /** status 201 */ CombinedModelRead; +export type CombinedModelCreateApiArg = { + combinedModel: CombinedModel; +}; +export type CombinedModelRetrieveApiResponse = + /** status 200 */ CombinedModelRead; +export type CombinedModelRetrieveApiArg = { + /** A unique integer value identifying this combined model. */ + id: number; +}; +export type CombinedModelUpdateApiResponse = + /** status 200 */ CombinedModelRead; +export type CombinedModelUpdateApiArg = { + /** A unique integer value identifying this combined model. */ + id: number; + combinedModel: CombinedModel; +}; +export type CombinedModelPartialUpdateApiResponse = + /** status 200 */ CombinedModelRead; +export type CombinedModelPartialUpdateApiArg = { + /** A unique integer value identifying this combined model. */ + id: number; + patchedCombinedModel: PatchedCombinedModel; +}; +export type CombinedModelDestroyApiResponse = unknown; +export type CombinedModelDestroyApiArg = { + /** A unique integer value identifying this combined model. */ + id: number; +}; +export type CombinedModelSetParamsToDefaultsUpdateApiResponse = + /** status 200 */ CombinedModelRead; +export type CombinedModelSetParamsToDefaultsUpdateApiArg = { + /** A unique integer value identifying this combined model. */ + id: number; + combinedModel: CombinedModel; +}; +export type CombinedModelSetVariablesFromInferenceUpdateApiResponse = + /** status 200 */ CombinedModelRead; +export type CombinedModelSetVariablesFromInferenceUpdateApiArg = { + /** A unique integer value identifying this combined model. */ + id: number; + combinedModel: CombinedModel; +}; +export type CombinedModelSimulateCreateApiResponse = + /** status 200 */ SimulateResponse; +export type CombinedModelSimulateCreateApiArg = { + id: number; + simulate: Simulate; +}; +export type CompoundListApiResponse = /** status 200 */ CompoundRead[]; +export type CompoundListApiArg = void; +export type CompoundCreateApiResponse = /** status 201 */ CompoundRead; +export type CompoundCreateApiArg = { + compound: Compound; +}; +export type CompoundRetrieveApiResponse = /** status 200 */ CompoundRead; +export type CompoundRetrieveApiArg = { + /** A unique integer value identifying this compound. */ + id: number; +}; +export type CompoundUpdateApiResponse = /** status 200 */ CompoundRead; +export type CompoundUpdateApiArg = { + /** A unique integer value identifying this compound. */ + id: number; + compound: Compound; +}; +export type CompoundPartialUpdateApiResponse = /** status 200 */ CompoundRead; +export type CompoundPartialUpdateApiArg = { + /** A unique integer value identifying this compound. */ + id: number; + patchedCompound: PatchedCompound; +}; +export type CompoundDestroyApiResponse = unknown; +export type CompoundDestroyApiArg = { + /** A unique integer value identifying this compound. */ + id: number; +}; +export type DatasetListApiResponse = /** status 200 */ DatasetRead[]; +export type DatasetListApiArg = void; +export type DatasetCreateApiResponse = /** status 201 */ DatasetRead; +export type DatasetCreateApiArg = { dataset: Dataset; }; -export type RetrieveDatasetApiResponse = /** status 200 */ Dataset; -export type RetrieveDatasetApiArg = { +export type DatasetRetrieveApiResponse = /** status 200 */ DatasetRead; +export type DatasetRetrieveApiArg = { /** A unique integer value identifying this dataset. */ - id: string; + id: number; }; -export type UpdateDatasetApiResponse = /** status 200 */ Dataset; -export type UpdateDatasetApiArg = { +export type DatasetUpdateApiResponse = /** status 200 */ DatasetRead; +export type DatasetUpdateApiArg = { /** A unique integer value identifying this dataset. */ - id: string; + id: number; dataset: Dataset; }; -export type PartialUpdateDatasetApiResponse = /** status 200 */ Dataset; -export type PartialUpdateDatasetApiArg = { +export type DatasetPartialUpdateApiResponse = /** status 200 */ DatasetRead; +export type DatasetPartialUpdateApiArg = { /** A unique integer value identifying this dataset. */ - id: string; - dataset: Dataset; + id: number; + patchedDataset: PatchedDataset; }; -export type DestroyDatasetApiResponse = unknown; -export type DestroyDatasetApiArg = { +export type DatasetDestroyApiResponse = unknown; +export type DatasetDestroyApiArg = { /** A unique integer value identifying this dataset. */ - id: string; + id: number; }; -export type ListUsersApiResponse = /** status 200 */ User[]; -export type ListUsersApiArg = void; -export type CreateUserApiResponse = /** status 201 */ User; -export type CreateUserApiArg = { - user: User; +export type DatasetCsvUpdateApiResponse = /** status 200 */ DatasetCsv; +export type DatasetCsvUpdateApiArg = { + /** A unique integer value identifying this dataset. */ + id: number; + datasetCsv: DatasetCsv; }; -export type RetrieveUserApiResponse = /** status 200 */ User; -export type RetrieveUserApiArg = { - /** A unique integer value identifying this user. */ - id: string; +export type DoseListApiResponse = /** status 200 */ DoseRead[]; +export type DoseListApiArg = void; +export type DoseCreateApiResponse = /** status 201 */ DoseRead; +export type DoseCreateApiArg = { + dose: Dose; }; -export type UpdateUserApiResponse = /** status 200 */ User; -export type UpdateUserApiArg = { - /** A unique integer value identifying this user. */ - id: string; - user: User; +export type DoseRetrieveApiResponse = /** status 200 */ DoseRead; +export type DoseRetrieveApiArg = { + /** A unique integer value identifying this dose. */ + id: number; }; -export type PartialUpdateUserApiResponse = /** status 200 */ User; -export type PartialUpdateUserApiArg = { - /** A unique integer value identifying this user. */ - id: string; - user: User; +export type DoseUpdateApiResponse = /** status 200 */ DoseRead; +export type DoseUpdateApiArg = { + /** A unique integer value identifying this dose. */ + id: number; + dose: Dose; }; -export type DestroyUserApiResponse = unknown; -export type DestroyUserApiArg = { - /** A unique integer value identifying this user. */ - id: string; +export type DosePartialUpdateApiResponse = /** status 200 */ DoseRead; +export type DosePartialUpdateApiArg = { + /** A unique integer value identifying this dose. */ + id: number; + patchedDose: PatchedDose; }; -export type ListSubjectsApiResponse = /** status 200 */ Subject[]; -export type ListSubjectsApiArg = void; -export type CreateSubjectApiResponse = /** status 201 */ Subject; -export type CreateSubjectApiArg = { - subject: Subject; +export type DoseDestroyApiResponse = unknown; +export type DoseDestroyApiArg = { + /** A unique integer value identifying this dose. */ + id: number; }; -export type RetrieveSubjectApiResponse = /** status 200 */ Subject; -export type RetrieveSubjectApiArg = { - /** A unique integer value identifying this subject. */ - id: string; +export type InferenceListApiResponse = /** status 200 */ InferenceRead[]; +export type InferenceListApiArg = void; +export type InferenceCreateApiResponse = /** status 201 */ InferenceRead; +export type InferenceCreateApiArg = { + inference: Inference; }; -export type UpdateSubjectApiResponse = /** status 200 */ Subject; -export type UpdateSubjectApiArg = { - /** A unique integer value identifying this subject. */ - id: string; - subject: Subject; +export type InferenceRetrieveApiResponse = /** status 200 */ InferenceRead; +export type InferenceRetrieveApiArg = { + /** A unique integer value identifying this inference. */ + id: number; }; -export type PartialUpdateSubjectApiResponse = /** status 200 */ Subject; -export type PartialUpdateSubjectApiArg = { - /** A unique integer value identifying this subject. */ - id: string; - subject: Subject; +export type InferenceUpdateApiResponse = /** status 200 */ InferenceRead; +export type InferenceUpdateApiArg = { + /** A unique integer value identifying this inference. */ + id: number; + inference: Inference; }; -export type DestroySubjectApiResponse = unknown; -export type DestroySubjectApiArg = { - /** A unique integer value identifying this subject. */ - id: string; +export type InferencePartialUpdateApiResponse = + /** status 200 */ InferenceRead; +export type InferencePartialUpdateApiArg = { + /** A unique integer value identifying this inference. */ + id: number; + patchedInference: PatchedInference; +}; +export type InferenceDestroyApiResponse = unknown; +export type InferenceDestroyApiArg = { + /** A unique integer value identifying this inference. */ + id: number; +}; +export type InferenceStopCreateApiResponse = unknown; +export type InferenceStopCreateApiArg = { + id: number; +}; +export type InferenceWizardCreateApiResponse = unknown; +export type InferenceWizardCreateApiArg = void; +export type InferenceChainListApiResponse = + /** status 200 */ InferenceChainRead[]; +export type InferenceChainListApiArg = void; +export type InferenceChainCreateApiResponse = + /** status 201 */ InferenceChainRead; +export type InferenceChainCreateApiArg = { + inferenceChain: InferenceChain; +}; +export type InferenceChainRetrieveApiResponse = + /** status 200 */ InferenceChainRead; +export type InferenceChainRetrieveApiArg = { + /** A unique integer value identifying this inference chain. */ + id: number; +}; +export type InferenceChainUpdateApiResponse = + /** status 200 */ InferenceChainRead; +export type InferenceChainUpdateApiArg = { + /** A unique integer value identifying this inference chain. */ + id: number; + inferenceChain: InferenceChain; +}; +export type InferenceChainPartialUpdateApiResponse = + /** status 200 */ InferenceChainRead; +export type InferenceChainPartialUpdateApiArg = { + /** A unique integer value identifying this inference chain. */ + id: number; + patchedInferenceChain: PatchedInferenceChain; +}; +export type InferenceChainDestroyApiResponse = unknown; +export type InferenceChainDestroyApiArg = { + /** A unique integer value identifying this inference chain. */ + id: number; +}; +export type NcaCreateApiResponse = unknown; +export type NcaCreateApiArg = void; +export type PharmacodynamicListApiResponse = + /** status 200 */ PharmacodynamicRead[]; +export type PharmacodynamicListApiArg = void; +export type PharmacodynamicCreateApiResponse = + /** status 201 */ PharmacodynamicRead; +export type PharmacodynamicCreateApiArg = { + pharmacodynamic: Pharmacodynamic; +}; +export type PharmacodynamicRetrieveApiResponse = + /** status 200 */ PharmacodynamicRead; +export type PharmacodynamicRetrieveApiArg = { + /** A unique integer value identifying this pharmacodynamic model. */ + id: number; +}; +export type PharmacodynamicUpdateApiResponse = + /** status 200 */ PharmacodynamicRead; +export type PharmacodynamicUpdateApiArg = { + /** A unique integer value identifying this pharmacodynamic model. */ + id: number; + pharmacodynamic: Pharmacodynamic; +}; +export type PharmacodynamicPartialUpdateApiResponse = + /** status 200 */ PharmacodynamicRead; +export type PharmacodynamicPartialUpdateApiArg = { + /** A unique integer value identifying this pharmacodynamic model. */ + id: number; + patchedPharmacodynamic: PatchedPharmacodynamic; +}; +export type PharmacodynamicDestroyApiResponse = unknown; +export type PharmacodynamicDestroyApiArg = { + /** A unique integer value identifying this pharmacodynamic model. */ + id: number; +}; +export type PharmacodynamicMmtUpdateApiResponse = + /** status 200 */ PharmacodynamicRead; +export type PharmacodynamicMmtUpdateApiArg = { + /** A unique integer value identifying this pharmacodynamic model. */ + id: number; + pharmacodynamic: Pharmacodynamic; +}; +export type PharmacodynamicSbmlUpdateApiResponse = + /** status 200 */ PharmacodynamicSbml; +export type PharmacodynamicSbmlUpdateApiArg = { + /** A unique integer value identifying this pharmacodynamic model. */ + id: number; + pharmacodynamicSbml: PharmacodynamicSbmlWrite; +}; +export type PharmacodynamicSetVariablesFromInferenceUpdateApiResponse = + /** status 200 */ PharmacodynamicRead; +export type PharmacodynamicSetVariablesFromInferenceUpdateApiArg = { + /** A unique integer value identifying this pharmacodynamic model. */ + id: number; + pharmacodynamic: Pharmacodynamic; +}; +export type PharmacodynamicSimulateCreateApiResponse = + /** status 200 */ SimulateResponse; +export type PharmacodynamicSimulateCreateApiArg = { + id: number; + simulate: Simulate; +}; +export type PharmacokineticListApiResponse = + /** status 200 */ PharmacokineticRead[]; +export type PharmacokineticListApiArg = void; +export type PharmacokineticCreateApiResponse = + /** status 201 */ PharmacokineticRead; +export type PharmacokineticCreateApiArg = { + pharmacokinetic: Pharmacokinetic; }; -export type ListProjectsApiResponse = /** status 200 */ Project[]; -export type ListProjectsApiArg = void; -export type CreateProjectApiResponse = /** status 201 */ Project; -export type CreateProjectApiArg = { +export type PharmacokineticRetrieveApiResponse = + /** status 200 */ PharmacokineticRead; +export type PharmacokineticRetrieveApiArg = { + /** A unique integer value identifying this pharmacokinetic model. */ + id: number; +}; +export type PharmacokineticUpdateApiResponse = + /** status 200 */ PharmacokineticRead; +export type PharmacokineticUpdateApiArg = { + /** A unique integer value identifying this pharmacokinetic model. */ + id: number; + pharmacokinetic: Pharmacokinetic; +}; +export type PharmacokineticPartialUpdateApiResponse = + /** status 200 */ PharmacokineticRead; +export type PharmacokineticPartialUpdateApiArg = { + /** A unique integer value identifying this pharmacokinetic model. */ + id: number; + patchedPharmacokinetic: PatchedPharmacokinetic; +}; +export type PharmacokineticDestroyApiResponse = unknown; +export type PharmacokineticDestroyApiArg = { + /** A unique integer value identifying this pharmacokinetic model. */ + id: number; +}; +export type ProjectListApiResponse = /** status 200 */ ProjectRead[]; +export type ProjectListApiArg = void; +export type ProjectCreateApiResponse = /** status 201 */ ProjectRead; +export type ProjectCreateApiArg = { project: Project; }; -export type RetrieveProjectApiResponse = /** status 200 */ Project; -export type RetrieveProjectApiArg = { +export type ProjectRetrieveApiResponse = /** status 200 */ ProjectRead; +export type ProjectRetrieveApiArg = { /** A unique integer value identifying this project. */ - id: string; + id: number; }; -export type UpdateProjectApiResponse = /** status 200 */ Project; -export type UpdateProjectApiArg = { +export type ProjectUpdateApiResponse = /** status 200 */ ProjectRead; +export type ProjectUpdateApiArg = { /** A unique integer value identifying this project. */ - id: string; + id: number; project: Project; }; -export type PartialUpdateProjectApiResponse = /** status 200 */ Project; -export type PartialUpdateProjectApiArg = { +export type ProjectPartialUpdateApiResponse = /** status 200 */ ProjectRead; +export type ProjectPartialUpdateApiArg = { /** A unique integer value identifying this project. */ - id: string; - project: Project; + id: number; + patchedProject: PatchedProject; }; -export type DestroyProjectApiResponse = unknown; -export type DestroyProjectApiArg = { +export type ProjectDestroyApiResponse = unknown; +export type ProjectDestroyApiArg = { /** A unique integer value identifying this project. */ - id: string; + id: number; }; -export type ListProjectAccessApiResponse = /** status 200 */ ProjectAccess[]; -export type ListProjectAccessApiArg = void; -export type CreateProjectAccessApiResponse = /** status 201 */ ProjectAccess; -export type CreateProjectAccessApiArg = { +export type ProjectMonolixUpdateApiResponse = /** status 200 */ MonolixRead; +export type ProjectMonolixUpdateApiArg = { + /** A unique integer value identifying this project. */ + id: number; + monolix: MonolixWrite; +}; +export type ProjectAccessListApiResponse = + /** status 200 */ ProjectAccessRead[]; +export type ProjectAccessListApiArg = void; +export type ProjectAccessCreateApiResponse = + /** status 201 */ ProjectAccessRead; +export type ProjectAccessCreateApiArg = { projectAccess: ProjectAccess; }; -export type RetrieveProjectAccessApiResponse = /** status 200 */ ProjectAccess; -export type RetrieveProjectAccessApiArg = { +export type ProjectAccessRetrieveApiResponse = + /** status 200 */ ProjectAccessRead; +export type ProjectAccessRetrieveApiArg = { /** A unique integer value identifying this project access. */ - id: string; + id: number; }; -export type UpdateProjectAccessApiResponse = /** status 200 */ ProjectAccess; -export type UpdateProjectAccessApiArg = { +export type ProjectAccessUpdateApiResponse = + /** status 200 */ ProjectAccessRead; +export type ProjectAccessUpdateApiArg = { /** A unique integer value identifying this project access. */ - id: string; + id: number; projectAccess: ProjectAccess; }; -export type PartialUpdateProjectAccessApiResponse = - /** status 200 */ ProjectAccess; -export type PartialUpdateProjectAccessApiArg = { +export type ProjectAccessPartialUpdateApiResponse = + /** status 200 */ ProjectAccessRead; +export type ProjectAccessPartialUpdateApiArg = { /** A unique integer value identifying this project access. */ - id: string; - projectAccess: ProjectAccess; + id: number; + patchedProjectAccess: PatchedProjectAccess; }; -export type DestroyProjectAccessApiResponse = unknown; -export type DestroyProjectAccessApiArg = { +export type ProjectAccessDestroyApiResponse = unknown; +export type ProjectAccessDestroyApiArg = { /** A unique integer value identifying this project access. */ - id: string; + id: number; }; -export type ListDosesApiResponse = /** status 200 */ Dose[]; -export type ListDosesApiArg = void; -export type CreateDoseApiResponse = /** status 201 */ Dose; -export type CreateDoseApiArg = { - dose: Dose; +export type ProtocolListApiResponse = /** status 200 */ ProtocolRead[]; +export type ProtocolListApiArg = { + /** Filter results by project ID */ + projectId?: number; }; -export type RetrieveDoseApiResponse = /** status 200 */ Dose; -export type RetrieveDoseApiArg = { - /** A unique integer value identifying this dose. */ - id: string; +export type ProtocolCreateApiResponse = /** status 201 */ ProtocolRead; +export type ProtocolCreateApiArg = { + protocol: Protocol; }; -export type UpdateDoseApiResponse = /** status 200 */ Dose; -export type UpdateDoseApiArg = { - /** A unique integer value identifying this dose. */ - id: string; - dose: Dose; +export type ProtocolRetrieveApiResponse = /** status 200 */ ProtocolRead; +export type ProtocolRetrieveApiArg = { + /** A unique integer value identifying this protocol. */ + id: number; }; -export type PartialUpdateDoseApiResponse = /** status 200 */ Dose; -export type PartialUpdateDoseApiArg = { - /** A unique integer value identifying this dose. */ - id: string; - dose: Dose; +export type ProtocolUpdateApiResponse = /** status 200 */ ProtocolRead; +export type ProtocolUpdateApiArg = { + /** A unique integer value identifying this protocol. */ + id: number; + protocol: Protocol; }; -export type DestroyDoseApiResponse = unknown; -export type DestroyDoseApiArg = { - /** A unique integer value identifying this dose. */ - id: string; +export type ProtocolPartialUpdateApiResponse = /** status 200 */ ProtocolRead; +export type ProtocolPartialUpdateApiArg = { + /** A unique integer value identifying this protocol. */ + id: number; + patchedProtocol: PatchedProtocol; +}; +export type ProtocolDestroyApiResponse = unknown; +export type ProtocolDestroyApiArg = { + /** A unique integer value identifying this protocol. */ + id: number; +}; +export type SessionRetrieveApiResponse = unknown; +export type SessionRetrieveApiArg = void; +export type SimulationListApiResponse = /** status 200 */ SimulationRead[]; +export type SimulationListApiArg = { + /** Filter results by project ID */ + projectId?: number; +}; +export type SimulationCreateApiResponse = /** status 201 */ SimulationRead; +export type SimulationCreateApiArg = { + simulation: Simulation; +}; +export type SimulationRetrieveApiResponse = /** status 200 */ SimulationRead; +export type SimulationRetrieveApiArg = { + /** A unique integer value identifying this simulation. */ + id: number; +}; +export type SimulationUpdateApiResponse = /** status 200 */ SimulationRead; +export type SimulationUpdateApiArg = { + /** A unique integer value identifying this simulation. */ + id: number; + simulation: Simulation; +}; +export type SimulationPartialUpdateApiResponse = + /** status 200 */ SimulationRead; +export type SimulationPartialUpdateApiArg = { + /** A unique integer value identifying this simulation. */ + id: number; + patchedSimulation: PatchedSimulation; +}; +export type SimulationDestroyApiResponse = unknown; +export type SimulationDestroyApiArg = { + /** A unique integer value identifying this simulation. */ + id: number; +}; +export type SubjectListApiResponse = /** status 200 */ SubjectRead[]; +export type SubjectListApiArg = void; +export type SubjectCreateApiResponse = /** status 201 */ SubjectRead; +export type SubjectCreateApiArg = { + subject: Subject; +}; +export type SubjectRetrieveApiResponse = /** status 200 */ SubjectRead; +export type SubjectRetrieveApiArg = { + /** A unique integer value identifying this subject. */ + id: number; +}; +export type SubjectUpdateApiResponse = /** status 200 */ SubjectRead; +export type SubjectUpdateApiArg = { + /** A unique integer value identifying this subject. */ + id: number; + subject: Subject; }; -export type ListUnitsApiResponse = /** status 200 */ Unit[]; -export type ListUnitsApiArg = void; -export type CreateUnitApiResponse = /** status 201 */ Unit; -export type CreateUnitApiArg = { +export type SubjectPartialUpdateApiResponse = /** status 200 */ SubjectRead; +export type SubjectPartialUpdateApiArg = { + /** A unique integer value identifying this subject. */ + id: number; + patchedSubject: PatchedSubject; +}; +export type SubjectDestroyApiResponse = unknown; +export type SubjectDestroyApiArg = { + /** A unique integer value identifying this subject. */ + id: number; +}; +export type UnitListApiResponse = /** status 200 */ UnitRead[]; +export type UnitListApiArg = { + /** Enable conversions based on compound information */ + compoundId?: number; +}; +export type UnitCreateApiResponse = /** status 201 */ UnitRead; +export type UnitCreateApiArg = { unit: Unit; }; -export type RetrieveUnitApiResponse = /** status 200 */ Unit; -export type RetrieveUnitApiArg = { +export type UnitRetrieveApiResponse = /** status 200 */ UnitRead; +export type UnitRetrieveApiArg = { + /** Enable conversions based on compound information */ + compoundId?: number; /** A unique integer value identifying this unit. */ - id: string; + id: number; }; -export type UpdateUnitApiResponse = /** status 200 */ Unit; -export type UpdateUnitApiArg = { +export type UnitUpdateApiResponse = /** status 200 */ UnitRead; +export type UnitUpdateApiArg = { /** A unique integer value identifying this unit. */ - id: string; + id: number; unit: Unit; }; -export type PartialUpdateUnitApiResponse = /** status 200 */ Unit; -export type PartialUpdateUnitApiArg = { +export type UnitPartialUpdateApiResponse = /** status 200 */ UnitRead; +export type UnitPartialUpdateApiArg = { /** A unique integer value identifying this unit. */ - id: string; - unit: Unit; + id: number; + patchedUnit: PatchedUnit; }; -export type DestroyUnitApiResponse = unknown; -export type DestroyUnitApiArg = { +export type UnitDestroyApiResponse = unknown; +export type UnitDestroyApiArg = { /** A unique integer value identifying this unit. */ - id: string; + id: number; +}; +export type UserListApiResponse = /** status 200 */ UserRead[]; +export type UserListApiArg = void; +export type UserCreateApiResponse = /** status 201 */ UserRead; +export type UserCreateApiArg = { + user: User; }; -export type ListVariablesApiResponse = /** status 200 */ Variable[]; -export type ListVariablesApiArg = void; -export type CreateVariableApiResponse = /** status 201 */ Variable; -export type CreateVariableApiArg = { +export type UserRetrieveApiResponse = /** status 200 */ UserRead; +export type UserRetrieveApiArg = { + /** A unique integer value identifying this user. */ + id: number; +}; +export type UserUpdateApiResponse = /** status 200 */ UserRead; +export type UserUpdateApiArg = { + /** A unique integer value identifying this user. */ + id: number; + user: User; +}; +export type UserPartialUpdateApiResponse = /** status 200 */ UserRead; +export type UserPartialUpdateApiArg = { + /** A unique integer value identifying this user. */ + id: number; + patchedUser: PatchedUser; +}; +export type UserDestroyApiResponse = unknown; +export type UserDestroyApiArg = { + /** A unique integer value identifying this user. */ + id: number; +}; +export type VariableListApiResponse = /** status 200 */ VariableRead[]; +export type VariableListApiArg = { + /** Filter results by dosed_pk_model ID */ + dosedPkModelId?: number; + /** Filter results by pd_model ID */ + pdModelId?: number; + /** Filter results by project ID */ + projectId?: number; +}; +export type VariableCreateApiResponse = /** status 201 */ VariableRead; +export type VariableCreateApiArg = { variable: Variable; }; -export type RetrieveVariableApiResponse = /** status 200 */ Variable; -export type RetrieveVariableApiArg = { +export type VariableRetrieveApiResponse = /** status 200 */ VariableRead; +export type VariableRetrieveApiArg = { /** A unique integer value identifying this variable. */ - id: string; + id: number; }; -export type UpdateVariableApiResponse = /** status 200 */ Variable; -export type UpdateVariableApiArg = { +export type VariableUpdateApiResponse = /** status 200 */ VariableRead; +export type VariableUpdateApiArg = { /** A unique integer value identifying this variable. */ - id: string; + id: number; variable: Variable; }; -export type PartialUpdateVariableApiResponse = /** status 200 */ Variable; -export type PartialUpdateVariableApiArg = { +export type VariablePartialUpdateApiResponse = /** status 200 */ VariableRead; +export type VariablePartialUpdateApiArg = { /** A unique integer value identifying this variable. */ - id: string; - variable: Variable; + id: number; + patchedVariable: PatchedVariable; }; -export type DestroyVariableApiResponse = unknown; -export type DestroyVariableApiArg = { +export type VariableDestroyApiResponse = unknown; +export type VariableDestroyApiArg = { /** A unique integer value identifying this variable. */ - id: string; -}; -export type ListProtocolsApiResponse = /** status 200 */ Protocol[]; -export type ListProtocolsApiArg = void; -export type CreateProtocolApiResponse = /** status 201 */ Protocol; -export type CreateProtocolApiArg = { - protocol: Protocol; -}; -export type RetrieveProtocolApiResponse = /** status 200 */ Protocol; -export type RetrieveProtocolApiArg = { - /** A unique integer value identifying this protocol. */ - id: string; -}; -export type UpdateProtocolApiResponse = /** status 200 */ Protocol; -export type UpdateProtocolApiArg = { - /** A unique integer value identifying this protocol. */ - id: string; - protocol: Protocol; + id: number; }; -export type PartialUpdateProtocolApiResponse = /** status 200 */ Protocol; -export type PartialUpdateProtocolApiArg = { - /** A unique integer value identifying this protocol. */ - id: string; - protocol: Protocol; +export type WhoamiRetrieveApiResponse = unknown; +export type WhoamiRetrieveApiArg = void; +export type CategoryEnum = "SA" | "OP" | "OT"; +export type Algorithm = { + name: string; + category: CategoryEnum; }; -export type DestroyProtocolApiResponse = unknown; -export type DestroyProtocolApiArg = { - /** A unique integer value identifying this protocol. */ - id: string; +export type AlgorithmRead = { + id: number; + name: string; + category: CategoryEnum; }; -export type ListBiomarkerTypesApiResponse = /** status 200 */ BiomarkerType[]; -export type ListBiomarkerTypesApiArg = void; -export type CreateBiomarkerTypeApiResponse = /** status 201 */ BiomarkerType; -export type CreateBiomarkerTypeApiArg = { - biomarkerType: BiomarkerType; +export type PatchedAlgorithm = { + name?: string; + category?: CategoryEnum; }; -export type RetrieveBiomarkerTypeApiResponse = /** status 200 */ BiomarkerType; -export type RetrieveBiomarkerTypeApiArg = { - /** A unique integer value identifying this biomarker type. */ - id: string; +export type PatchedAlgorithmRead = { + id?: number; + name?: string; + category?: CategoryEnum; }; -export type UpdateBiomarkerTypeApiResponse = /** status 200 */ BiomarkerType; -export type UpdateBiomarkerTypeApiArg = { - /** A unique integer value identifying this biomarker type. */ - id: string; - biomarkerType: BiomarkerType; +export type BiomarkerType = { + name: string; + description?: string | null; + display?: boolean; + color?: number; + axis?: boolean; + stored_unit: number; + dataset: number; + display_unit: number; + stored_time_unit: number; + display_time_unit: number; }; -export type PartialUpdateBiomarkerTypeApiResponse = - /** status 200 */ BiomarkerType; -export type PartialUpdateBiomarkerTypeApiArg = { - /** A unique integer value identifying this biomarker type. */ - id: string; - biomarkerType: BiomarkerType; +export type BiomarkerTypeRead = { + id: number; + data: { + [key: string]: any[]; + } | null; + is_continuous: boolean; + is_categorical: boolean; + name: string; + description?: string | null; + display?: boolean; + color?: number; + axis?: boolean; + stored_unit: number; + dataset: number; + display_unit: number; + stored_time_unit: number; + display_time_unit: number; }; -export type DestroyBiomarkerTypeApiResponse = unknown; -export type DestroyBiomarkerTypeApiArg = { - /** A unique integer value identifying this biomarker type. */ - id: string; -}; -export type ListPharmacokineticModelsApiResponse = - /** status 200 */ Pharmacokinetic[]; -export type ListPharmacokineticModelsApiArg = void; -export type CreatePharmacokineticModelApiResponse = - /** status 201 */ Pharmacokinetic; -export type CreatePharmacokineticModelApiArg = { - pharmacokinetic: Pharmacokinetic; +export type PatchedBiomarkerType = { + name?: string; + description?: string | null; + display?: boolean; + color?: number; + axis?: boolean; + stored_unit?: number; + dataset?: number; + display_unit?: number; + stored_time_unit?: number; + display_time_unit?: number; }; -export type RetrievePharmacokineticModelApiResponse = - /** status 200 */ Pharmacokinetic; -export type RetrievePharmacokineticModelApiArg = { - /** A unique integer value identifying this pharmacokinetic model. */ - id: string; +export type PatchedBiomarkerTypeRead = { + id?: number; + data?: { + [key: string]: any[]; + } | null; + is_continuous?: boolean; + is_categorical?: boolean; + name?: string; + description?: string | null; + display?: boolean; + color?: number; + axis?: boolean; + stored_unit?: number; + dataset?: number; + display_unit?: number; + stored_time_unit?: number; + display_time_unit?: number; +}; +export type PkpdMapping = { + pkpd_model: number; + pk_variable: number; + pd_variable: number; +}; +export type PkpdMappingRead = { + id: number; + datetime: string; + read_only: boolean; + pkpd_model: number; + pk_variable: number; + pd_variable: number; +}; +export type TypeEnum = "RO" | "FUP" | "BPR" | "TLG"; +export type DerivedVariable = { + read_only?: boolean; + datetime?: string | null; + type: TypeEnum; + pkpd_model: number; + pk_variable: number; }; -export type UpdatePharmacokineticModelApiResponse = - /** status 200 */ Pharmacokinetic; -export type UpdatePharmacokineticModelApiArg = { - /** A unique integer value identifying this pharmacokinetic model. */ - id: string; - pharmacokinetic: Pharmacokinetic; +export type DerivedVariableRead = { + id: number; + read_only?: boolean; + datetime?: string | null; + type: TypeEnum; + pkpd_model: number; + pk_variable: number; +}; +export type CombinedModelSpeciesEnum = "H" | "R" | "N" | "M"; +export type CombinedModel = { + mappings: PkpdMapping[]; + derived_variables: DerivedVariable[]; + read_only?: boolean; + datetime?: string | null; + name: string; + species?: CombinedModelSpeciesEnum; + has_saturation?: boolean; + has_effect?: boolean; + has_lag?: boolean; + has_bioavailability?: boolean; + has_hill_coefficient?: boolean; + time_max?: number; + project?: number | null; + pk_model?: number | null; + pd_model?: number | null; + pd_model2?: number | null; +}; +export type CombinedModelRead = { + id: number; + mappings: PkpdMappingRead[]; + derived_variables: DerivedVariableRead[]; + components: string; + variables: number[]; + mmt: string; + time_unit: number; + is_library_model: boolean; + read_only?: boolean; + datetime?: string | null; + name: string; + species?: CombinedModelSpeciesEnum; + has_saturation?: boolean; + has_effect?: boolean; + has_lag?: boolean; + has_bioavailability?: boolean; + has_hill_coefficient?: boolean; + time_max?: number; + project?: number | null; + pk_model?: number | null; + pd_model?: number | null; + pd_model2?: number | null; }; -export type PartialUpdatePharmacokineticModelApiResponse = - /** status 200 */ Pharmacokinetic; -export type PartialUpdatePharmacokineticModelApiArg = { - /** A unique integer value identifying this pharmacokinetic model. */ - id: string; - pharmacokinetic: Pharmacokinetic; +export type PatchedCombinedModel = { + mappings?: PkpdMapping[]; + derived_variables?: DerivedVariable[]; + read_only?: boolean; + datetime?: string | null; + name?: string; + species?: CombinedModelSpeciesEnum; + has_saturation?: boolean; + has_effect?: boolean; + has_lag?: boolean; + has_bioavailability?: boolean; + has_hill_coefficient?: boolean; + time_max?: number; + project?: number | null; + pk_model?: number | null; + pd_model?: number | null; + pd_model2?: number | null; }; -export type DestroyPharmacokineticModelApiResponse = unknown; -export type DestroyPharmacokineticModelApiArg = { - /** A unique integer value identifying this pharmacokinetic model. */ - id: string; -}; -export type ListPharmacodynamicModelsApiResponse = - /** status 200 */ Pharmacodynamic[]; -export type ListPharmacodynamicModelsApiArg = void; -export type CreatePharmacodynamicModelApiResponse = - /** status 201 */ Pharmacodynamic; -export type CreatePharmacodynamicModelApiArg = { - pharmacodynamic: Pharmacodynamic; +export type PatchedCombinedModelRead = { + id?: number; + mappings?: PkpdMappingRead[]; + derived_variables?: DerivedVariableRead[]; + components?: string; + variables?: number[]; + mmt?: string; + time_unit?: number; + is_library_model?: boolean; + read_only?: boolean; + datetime?: string | null; + name?: string; + species?: CombinedModelSpeciesEnum; + has_saturation?: boolean; + has_effect?: boolean; + has_lag?: boolean; + has_bioavailability?: boolean; + has_hill_coefficient?: boolean; + time_max?: number; + project?: number | null; + pk_model?: number | null; + pd_model?: number | null; + pd_model2?: number | null; }; -export type RetrievePharmacodynamicModelApiResponse = - /** status 200 */ Pharmacodynamic; -export type RetrievePharmacodynamicModelApiArg = { - /** A unique integer value identifying this pharmacodynamic model. */ - id: string; +export type SimulateResponse = { + time: number[]; + outputs: { + [key: string]: number[]; + }; }; -export type UpdatePharmacodynamicModelApiResponse = - /** status 200 */ Pharmacodynamic; -export type UpdatePharmacodynamicModelApiArg = { - /** A unique integer value identifying this pharmacodynamic model. */ - id: string; - pharmacodynamic: Pharmacodynamic; +export type ErrorResponse = { + error: string; }; -export type PartialUpdatePharmacodynamicModelApiResponse = - /** status 200 */ Pharmacodynamic; -export type PartialUpdatePharmacodynamicModelApiArg = { - /** A unique integer value identifying this pharmacodynamic model. */ - id: string; - pharmacodynamic: Pharmacodynamic; +export type Simulate = { + outputs: string[]; + variables: { + [key: string]: number; + }; + time_max?: number; }; -export type DestroyPharmacodynamicModelApiResponse = unknown; -export type DestroyPharmacodynamicModelApiArg = { - /** A unique integer value identifying this pharmacodynamic model. */ - id: string; -}; -export type ListDosedPharmacokineticModelsApiResponse = - /** status 200 */ DosedPharmacokinetic[]; -export type ListDosedPharmacokineticModelsApiArg = void; -export type CreateDosedPharmacokineticModelApiResponse = - /** status 201 */ DosedPharmacokinetic; -export type CreateDosedPharmacokineticModelApiArg = { - dosedPharmacokinetic: DosedPharmacokinetic; -}; -export type RetrieveDosedPharmacokineticModelApiResponse = - /** status 200 */ DosedPharmacokinetic; -export type RetrieveDosedPharmacokineticModelApiArg = { - /** A unique integer value identifying this dosed pharmacokinetic model. */ - id: string; -}; -export type UpdateDosedPharmacokineticModelApiResponse = - /** status 200 */ DosedPharmacokinetic; -export type UpdateDosedPharmacokineticModelApiArg = { - /** A unique integer value identifying this dosed pharmacokinetic model. */ - id: string; - dosedPharmacokinetic: DosedPharmacokinetic; -}; -export type PartialUpdateDosedPharmacokineticModelApiResponse = - /** status 200 */ DosedPharmacokinetic; -export type PartialUpdateDosedPharmacokineticModelApiArg = { - /** A unique integer value identifying this dosed pharmacokinetic model. */ - id: string; - dosedPharmacokinetic: DosedPharmacokinetic; -}; -export type DestroyDosedPharmacokineticModelApiResponse = unknown; -export type DestroyDosedPharmacokineticModelApiArg = { - /** A unique integer value identifying this dosed pharmacokinetic model. */ - id: string; -}; -export type ListInferencesApiResponse = /** status 200 */ Inference[]; -export type ListInferencesApiArg = void; -export type CreateInferenceApiResponse = /** status 201 */ Inference; -export type CreateInferenceApiArg = { - inference: Inference; +export type Efficacy = { + name?: string; + c50: number; + hill_coefficient?: number; + c50_unit: number; + compound: number; +}; +export type EfficacyRead = { + id: number; + name?: string; + c50: number; + hill_coefficient?: number; + c50_unit: number; + compound: number; +}; +export type CompoundTypeEnum = "SM" | "LM"; +export type IntrinsicClearanceAssayEnum = "MS" | "HC"; +export type Compound = { + efficacy_experiments: Efficacy[]; + name: string; + description?: string; + molecular_mass?: number; + compound_type?: CompoundTypeEnum; + fraction_unbound_plasma?: number | null; + blood_to_plasma_ratio?: number | null; + intrinsic_clearance?: number | null; + intrinsic_clearance_assay?: IntrinsicClearanceAssayEnum; + fraction_unbound_including_cells?: number | null; + target_molecular_mass?: number; + target_concentration?: number | null; + dissociation_constant?: number | null; + is_soluble?: boolean; + use_efficacy?: number | null; + molecular_mass_unit?: number; + intrinsic_clearance_unit?: number; + target_molecular_mass_unit?: number; + target_concentration_unit?: number; + dissociation_unit?: number; +}; +export type CompoundRead = { + id: number; + efficacy_experiments: EfficacyRead[]; + name: string; + description?: string; + molecular_mass?: number; + compound_type?: CompoundTypeEnum; + fraction_unbound_plasma?: number | null; + blood_to_plasma_ratio?: number | null; + intrinsic_clearance?: number | null; + intrinsic_clearance_assay?: IntrinsicClearanceAssayEnum; + fraction_unbound_including_cells?: number | null; + target_molecular_mass?: number; + target_concentration?: number | null; + dissociation_constant?: number | null; + is_soluble?: boolean; + use_efficacy?: number | null; + molecular_mass_unit?: number; + intrinsic_clearance_unit?: number; + target_molecular_mass_unit?: number; + target_concentration_unit?: number; + dissociation_unit?: number; +}; +export type PatchedCompound = { + efficacy_experiments?: Efficacy[]; + name?: string; + description?: string; + molecular_mass?: number; + compound_type?: CompoundTypeEnum; + fraction_unbound_plasma?: number | null; + blood_to_plasma_ratio?: number | null; + intrinsic_clearance?: number | null; + intrinsic_clearance_assay?: IntrinsicClearanceAssayEnum; + fraction_unbound_including_cells?: number | null; + target_molecular_mass?: number; + target_concentration?: number | null; + dissociation_constant?: number | null; + is_soluble?: boolean; + use_efficacy?: number | null; + molecular_mass_unit?: number; + intrinsic_clearance_unit?: number; + target_molecular_mass_unit?: number; + target_concentration_unit?: number; + dissociation_unit?: number; +}; +export type PatchedCompoundRead = { + id?: number; + efficacy_experiments?: EfficacyRead[]; + name?: string; + description?: string; + molecular_mass?: number; + compound_type?: CompoundTypeEnum; + fraction_unbound_plasma?: number | null; + blood_to_plasma_ratio?: number | null; + intrinsic_clearance?: number | null; + intrinsic_clearance_assay?: IntrinsicClearanceAssayEnum; + fraction_unbound_including_cells?: number | null; + target_molecular_mass?: number; + target_concentration?: number | null; + dissociation_constant?: number | null; + is_soluble?: boolean; + use_efficacy?: number | null; + molecular_mass_unit?: number; + intrinsic_clearance_unit?: number; + target_molecular_mass_unit?: number; + target_concentration_unit?: number; + dissociation_unit?: number; }; -export type RetrieveInferenceApiResponse = /** status 200 */ Inference; -export type RetrieveInferenceApiArg = { - /** A unique integer value identifying this inference. */ - id: string; +export type Dataset = { + name: string; + datetime?: string | null; + description?: string; + project?: number | null; }; -export type UpdateInferenceApiResponse = /** status 200 */ Inference; -export type UpdateInferenceApiArg = { - /** A unique integer value identifying this inference. */ - id: string; - inference: Inference; +export type Dose = { + start_time: number; + amount: number; + duration?: number; + repeats?: number; + repeat_interval?: number; + read_only?: boolean; + datetime?: string | null; }; -export type PartialUpdateInferenceApiResponse = /** status 200 */ Inference; -export type PartialUpdateInferenceApiArg = { - /** A unique integer value identifying this inference. */ - id: string; - inference: Inference; +export type DoseRead = { + id: number; + start_time: number; + amount: number; + duration?: number; + repeats?: number; + repeat_interval?: number; + read_only?: boolean; + datetime?: string | null; }; -export type DestroyInferenceApiResponse = unknown; -export type DestroyInferenceApiArg = { - /** A unique integer value identifying this inference. */ - id: string; +export type DoseTypeEnum = "D" | "I"; +export type Protocol = { + doses: Dose[]; + read_only?: boolean; + datetime?: string | null; + name: string; + dose_type?: DoseTypeEnum; + project?: number | null; + compound?: number | null; + time_unit?: number | null; + amount_unit?: number | null; }; -export type ListAlgorithmsApiResponse = /** status 200 */ Algorithm[]; -export type ListAlgorithmsApiArg = void; -export type CreateAlgorithmApiResponse = /** status 201 */ Algorithm; -export type CreateAlgorithmApiArg = { - algorithm: Algorithm; +export type ProtocolRead = { + id: number; + doses: DoseRead[]; + dataset: string; + variables: number[]; + subjects: number[]; + read_only?: boolean; + datetime?: string | null; + name: string; + dose_type?: DoseTypeEnum; + project?: number | null; + compound?: number | null; + time_unit?: number | null; + amount_unit?: number | null; }; -export type RetrieveAlgorithmApiResponse = /** status 200 */ Algorithm; -export type RetrieveAlgorithmApiArg = { - /** A unique integer value identifying this algorithm. */ - id: string; +export type DatasetRead = { + id: number; + biomarker_types: number[]; + subjects: number[]; + protocols: ProtocolRead[]; + name: string; + datetime?: string | null; + description?: string; + project?: number | null; }; -export type UpdateAlgorithmApiResponse = /** status 200 */ Algorithm; -export type UpdateAlgorithmApiArg = { - /** A unique integer value identifying this algorithm. */ - id: string; - algorithm: Algorithm; +export type PatchedDataset = { + name?: string; + datetime?: string | null; + description?: string; + project?: number | null; }; -export type PartialUpdateAlgorithmApiResponse = /** status 200 */ Algorithm; -export type PartialUpdateAlgorithmApiArg = { - /** A unique integer value identifying this algorithm. */ - id: string; - algorithm: Algorithm; +export type PatchedDatasetRead = { + id?: number; + biomarker_types?: number[]; + subjects?: number[]; + protocols?: ProtocolRead[]; + name?: string; + datetime?: string | null; + description?: string; + project?: number | null; }; -export type DestroyAlgorithmApiResponse = unknown; -export type DestroyAlgorithmApiArg = { - /** A unique integer value identifying this algorithm. */ - id: string; +export type DatasetCsv = { + csv: string; }; -export type ListInferenceChainsApiResponse = - /** status 200 */ InferenceChain[]; -export type ListInferenceChainsApiArg = void; -export type CreateInferenceChainApiResponse = /** status 201 */ InferenceChain; -export type CreateInferenceChainApiArg = { - inferenceChain: InferenceChain; +export type PatchedDose = { + start_time?: number; + amount?: number; + duration?: number; + repeats?: number; + repeat_interval?: number; + read_only?: boolean; + datetime?: string | null; }; -export type RetrieveInferenceChainApiResponse = - /** status 200 */ InferenceChain; -export type RetrieveInferenceChainApiArg = { - /** A unique integer value identifying this inference chain. */ - id: string; +export type PatchedDoseRead = { + id?: number; + start_time?: number; + amount?: number; + duration?: number; + repeats?: number; + repeat_interval?: number; + read_only?: boolean; + datetime?: string | null; }; -export type UpdateInferenceChainApiResponse = /** status 200 */ InferenceChain; -export type UpdateInferenceChainApiArg = { - /** A unique integer value identifying this inference chain. */ - id: string; - inferenceChain: InferenceChain; +export type LogLikelihoodParameter = { + name: string; + parent_index?: number | null; + child_index?: number; + length?: number | null; + child: number; + variable?: number | null; +}; +export type LogLikelihoodParameterRead = { + id: number; + name: string; + parent_index?: number | null; + child_index?: number; + length?: number | null; + parent: number; + child: number; + variable?: number | null; +}; +export type FormEnum = "N" | "U" | "LN" | "F" | "S" | "E" | "M"; +export type LogLikelihood = { + parameters: LogLikelihoodParameter[]; + name: string; + description?: string | null; + value?: number | null; + time_independent_data?: boolean; + observed?: boolean; + form?: FormEnum; + variable?: number | null; + biomarker_type?: number | null; + protocol_filter?: number | null; +}; +export type LogLikelihoodRead = { + id: number; + parameters: LogLikelihoodParameterRead[]; + model: string[] | null; + dataset: number | null; + time_variable: number | null; + is_a_prior: boolean; + name: string; + description?: string | null; + value?: number | null; + time_independent_data?: boolean; + observed?: boolean; + form?: FormEnum; + inference: number; + variable?: number | null; + biomarker_type?: number | null; + protocol_filter?: number | null; + children: number[]; }; -export type PartialUpdateInferenceChainApiResponse = - /** status 200 */ InferenceChain; -export type PartialUpdateInferenceChainApiArg = { - /** A unique integer value identifying this inference chain. */ - id: string; - inferenceChain: InferenceChain; +export type InitializationStrategyEnum = "D" | "R" | "F"; +export type Inference = { + log_likelihoods: LogLikelihood[]; + read_only?: boolean; + datetime?: string | null; + name: string; + description?: string; + initialization_strategy?: InitializationStrategyEnum; + number_of_chains?: number; + max_number_of_iterations?: number; + burn_in?: number; + number_of_iterations?: number; + time_elapsed?: number; + number_of_function_evals?: number; + task_id?: string | null; + metadata?: { + [key: string]: any; + }; + project: number; + algorithm?: number; + initialization_inference?: number | null; }; -export type DestroyInferenceChainApiResponse = unknown; -export type DestroyInferenceChainApiArg = { - /** A unique integer value identifying this inference chain. */ - id: string; -}; -export type ListSessionsApiResponse = /** status 200 */ any[]; -export type ListSessionsApiArg = void; -export type ListWhoAmIsApiResponse = /** status 200 */ any[]; -export type ListWhoAmIsApiArg = void; -export type CreateNcaApiResponse = /** status 201 */ any; -export type CreateNcaApiArg = { - body: any; -}; -export type CreateAuceApiResponse = /** status 201 */ any; -export type CreateAuceApiArg = { - body: any; -}; -export type CreateSimulatePkApiResponse = /** status 201 */ any; -export type CreateSimulatePkApiArg = { - id: string; - body: any; -}; -export type CreateInferenceWizardApiResponse = /** status 201 */ any; -export type CreateInferenceWizardApiArg = { - body: any; -}; -export type CreateStopInferenceApiResponse = /** status 201 */ any; -export type CreateStopInferenceApiArg = { - id: string; - body: any; -}; -export type CreateSimulatePdApiResponse = /** status 201 */ any; -export type CreateSimulatePdApiArg = { - id: string; - body: any; -}; -export type CsvDatasetApiResponse = /** status 200 */ DatasetCsv; -export type CsvDatasetApiArg = { - /** A unique integer value identifying this dataset. */ - id: string; - datasetCsv: DatasetCsv; +export type InferenceRead = { + id: number; + log_likelihoods: LogLikelihoodRead[]; + read_only?: boolean; + datetime?: string | null; + name: string; + description?: string; + initialization_strategy?: InitializationStrategyEnum; + number_of_chains?: number; + max_number_of_iterations?: number; + burn_in?: number; + number_of_iterations?: number; + time_elapsed?: number; + number_of_function_evals?: number; + task_id?: string | null; + metadata?: { + [key: string]: any; + }; + project: number; + algorithm?: number; + initialization_inference?: number | null; +}; +export type PatchedInference = { + log_likelihoods?: LogLikelihood[]; + read_only?: boolean; + datetime?: string | null; + name?: string; + description?: string; + initialization_strategy?: InitializationStrategyEnum; + number_of_chains?: number; + max_number_of_iterations?: number; + burn_in?: number; + number_of_iterations?: number; + time_elapsed?: number; + number_of_function_evals?: number; + task_id?: string | null; + metadata?: { + [key: string]: any; + }; + project?: number; + algorithm?: number; + initialization_inference?: number | null; +}; +export type PatchedInferenceRead = { + id?: number; + log_likelihoods?: LogLikelihoodRead[]; + read_only?: boolean; + datetime?: string | null; + name?: string; + description?: string; + initialization_strategy?: InitializationStrategyEnum; + number_of_chains?: number; + max_number_of_iterations?: number; + burn_in?: number; + number_of_iterations?: number; + time_elapsed?: number; + number_of_function_evals?: number; + task_id?: string | null; + metadata?: { + [key: string]: any; + }; + project?: number; + algorithm?: number; + initialization_inference?: number | null; +}; +export type InferenceChain = { + inference: number; +}; +export type InferenceChainRead = { + id: number; + data: string; + outputs: string; + inference: number; +}; +export type PatchedInferenceChain = { + inference?: number; +}; +export type PatchedInferenceChainRead = { + id?: number; + data?: string; + outputs?: string; + inference?: number; +}; +export type Pharmacodynamic = { + mmt?: string; + read_only?: boolean; + datetime?: string | null; + name: string; + description?: string; + time_max?: number; + is_library_model?: boolean; + project?: number | null; +}; +export type PharmacodynamicRead = { + id: number; + components: string; + variables: number[]; + mmt?: string; + read_only?: boolean; + datetime?: string | null; + name: string; + description?: string; + time_max?: number; + is_library_model?: boolean; + project?: number | null; +}; +export type PatchedPharmacodynamic = { + mmt?: string; + read_only?: boolean; + datetime?: string | null; + name?: string; + description?: string; + time_max?: number; + is_library_model?: boolean; + project?: number | null; +}; +export type PatchedPharmacodynamicRead = { + id?: number; + components?: string; + variables?: number[]; + mmt?: string; + read_only?: boolean; + datetime?: string | null; + name?: string; + description?: string; + time_max?: number; + is_library_model?: boolean; + project?: number | null; +}; +export type PharmacodynamicSbml = {}; +export type PharmacodynamicSbmlWrite = { + sbml: string; +}; +export type Pharmacokinetic = { + read_only?: boolean; + datetime?: string | null; + name: string; + description?: string; + mmt?: string; + time_max?: number; + is_library_model?: boolean; +}; +export type PharmacokineticRead = { + id: number; + read_only?: boolean; + datetime?: string | null; + name: string; + description?: string; + mmt?: string; + time_max?: number; + is_library_model?: boolean; +}; +export type PatchedPharmacokinetic = { + read_only?: boolean; + datetime?: string | null; + name?: string; + description?: string; + mmt?: string; + time_max?: number; + is_library_model?: boolean; +}; +export type PatchedPharmacokineticRead = { + id?: number; + read_only?: boolean; + datetime?: string | null; + name?: string; + description?: string; + mmt?: string; + time_max?: number; + is_library_model?: boolean; +}; +export type ProjectAccess = { + read_only?: boolean; + user: number; +}; +export type ProjectAccessRead = { + id: number; + read_only?: boolean; + user: number; + project: number; }; -export type MonolixProjectApiResponse = /** status 200 */ Monolix; -export type MonolixProjectApiArg = { - /** A unique integer value identifying this project. */ - id: string; - monolix: Monolix; +export type ProjectSpeciesEnum = "M" | "R" | "H" | "K" | "O"; +export type Project = { + user_access: ProjectAccess[]; + name: string; + description?: string; + species?: ProjectSpeciesEnum; + compound: number; }; -export type MmtPharmacodynamicModelApiResponse = - /** status 200 */ Pharmacodynamic; -export type MmtPharmacodynamicModelApiArg = { - /** A unique integer value identifying this pharmacodynamic model. */ - id: string; - pharmacodynamic: Pharmacodynamic; +export type ProjectRead = { + id: number; + user_access: ProjectAccessRead[]; + protocols: number[]; + name: string; + description?: string; + created: string; + species?: ProjectSpeciesEnum; + compound: number; + users: number[]; +}; +export type PatchedProject = { + user_access?: ProjectAccess[]; + name?: string; + description?: string; + species?: ProjectSpeciesEnum; + compound?: number; }; -export type SbmlPharmacodynamicModelApiResponse = - /** status 200 */ PharmacodynamicSbml; -export type SbmlPharmacodynamicModelApiArg = { - /** A unique integer value identifying this pharmacodynamic model. */ - id: string; - pharmacodynamicSbml: PharmacodynamicSbml; +export type PatchedProjectRead = { + id?: number; + user_access?: ProjectAccessRead[]; + protocols?: number[]; + name?: string; + description?: string; + created?: string; + species?: ProjectSpeciesEnum; + compound?: number; + users?: number[]; +}; +export type Monolix = {}; +export type MonolixRead = { + data: string; + pd_model: string; + pk_model: string; +}; +export type MonolixWrite = { + data_csv: string; + model_txt: string; + project_mlxtran: string; +}; +export type PatchedProjectAccess = { + read_only?: boolean; + user?: number; }; -export type SetVariablesFromInferencePharmacodynamicModelApiResponse = - /** status 200 */ Pharmacodynamic; -export type SetVariablesFromInferencePharmacodynamicModelApiArg = { - /** A unique integer value identifying this pharmacodynamic model. */ - id: string; - pharmacodynamic: Pharmacodynamic; +export type PatchedProjectAccessRead = { + id?: number; + read_only?: boolean; + user?: number; + project?: number; }; -export type SetVariablesFromInferenceDosedPharmacokineticModelApiResponse = - /** status 200 */ DosedPharmacokinetic; -export type SetVariablesFromInferenceDosedPharmacokineticModelApiArg = { - /** A unique integer value identifying this dosed pharmacokinetic model. */ - id: string; - dosedPharmacokinetic: DosedPharmacokinetic; +export type PatchedProtocol = { + doses?: Dose[]; + read_only?: boolean; + datetime?: string | null; + name?: string; + dose_type?: DoseTypeEnum; + project?: number | null; + compound?: number | null; + time_unit?: number | null; + amount_unit?: number | null; }; -export type Dataset = { +export type PatchedProtocolRead = { id?: number; - biomarker_types?: string[]; - subjects?: string[]; - protocols?: string; - name: string; + doses?: DoseRead[]; + dataset?: string; + variables?: number[]; + subjects?: number[]; + read_only?: boolean; datetime?: string | null; - description?: string; + name?: string; + dose_type?: DoseTypeEnum; project?: number | null; + compound?: number | null; + time_unit?: number | null; + amount_unit?: number | null; }; -export type User = { +export type SimulationSlider = { + variable: number; +}; +export type SimulationSliderRead = { + id: number; + variable: number; +}; +export type SimulationYAxis = { + right?: boolean; + variable: number; +}; +export type SimulationYAxisRead = { + id: number; + right?: boolean; + variable: number; +}; +export type SimulationCxLine = { + value: number; +}; +export type SimulationCxLineRead = { + id: number; + value: number; +}; +export type Y2ScaleEnum = "lin" | "lg2" | "lg10" | "ln"; +export type SimulationPlot = { + y_axes: SimulationYAxis[]; + cx_lines: SimulationCxLine[]; + index: number; + x_scale?: Y2ScaleEnum; + y_scale?: Y2ScaleEnum; + y2_scale?: Y2ScaleEnum; + min?: number | null; + max?: number | null; + min2?: number | null; + max2?: number | null; + x_unit: number; + y_unit?: number | null; + y_unit2?: number | null; +}; +export type SimulationPlotRead = { + id: number; + y_axes: SimulationYAxisRead[]; + cx_lines: SimulationCxLineRead[]; + index: number; + x_scale?: Y2ScaleEnum; + y_scale?: Y2ScaleEnum; + y2_scale?: Y2ScaleEnum; + min?: number | null; + max?: number | null; + min2?: number | null; + max2?: number | null; + x_unit: number; + y_unit?: number | null; + y_unit2?: number | null; +}; +export type Simulation = { + sliders: SimulationSlider[]; + plots: SimulationPlot[]; + name: string; + nrows?: number; + ncols?: number; + time_max?: number; + abs_tolerance?: number; + rel_tolerance?: number; + project: number; + time_max_unit: number; +}; +export type SimulationRead = { + id: number; + sliders: SimulationSliderRead[]; + plots: SimulationPlotRead[]; + name: string; + nrows?: number; + ncols?: number; + time_max?: number; + abs_tolerance?: number; + rel_tolerance?: number; + project: number; + time_max_unit: number; +}; +export type PatchedSimulation = { + sliders?: SimulationSlider[]; + plots?: SimulationPlot[]; + name?: string; + nrows?: number; + ncols?: number; + time_max?: number; + abs_tolerance?: number; + rel_tolerance?: number; + project?: number; + time_max_unit?: number; +}; +export type PatchedSimulationRead = { id?: number; - username: string; - first_name?: string; - last_name?: string; - email?: string; - profile?: { - id?: number; - user: number; - }; - project_set?: string[]; + sliders?: SimulationSliderRead[]; + plots?: SimulationPlotRead[]; + name?: string; + nrows?: number; + ncols?: number; + time_max?: number; + abs_tolerance?: number; + rel_tolerance?: number; + project?: number; + time_max_unit?: number; }; export type Subject = { - id?: number; id_in_dataset: number; shape?: number; display?: boolean; @@ -1450,36 +2496,33 @@ export type Subject = { dataset: number; protocol?: number | null; }; -export type Project = { - id?: number; - user_access: { - id?: number; - read_only?: boolean; - user: number; - project?: string; - }[]; - name: string; - description?: string; - users?: string[]; +export type SubjectRead = { + id: number; + id_in_dataset: number; + shape?: number; + display?: boolean; + metadata?: string; + dataset: number; + protocol?: number | null; }; -export type ProjectAccess = { - id?: number; - read_only?: boolean; - user: number; - project?: string; +export type PatchedSubject = { + id_in_dataset?: number; + shape?: number; + display?: boolean; + metadata?: string; + dataset?: number; + protocol?: number | null; }; -export type Dose = { +export type PatchedSubjectRead = { id?: number; - start_time: number; - amount: number; - duration?: number; - read_only?: boolean; - datetime?: string | null; - protocol: number; + id_in_dataset?: number; + shape?: number; + display?: boolean; + metadata?: string; + dataset?: number; + protocol?: number | null; }; export type Unit = { - id?: number; - compatible_units?: string; symbol: string; g?: number; m?: number; @@ -1490,18 +2533,97 @@ export type Unit = { mol?: number; multiplier?: number; }; -export type Variable = { +export type UnitRead = { + id: number; + compatible_units: { + [key: string]: string; + }[]; + symbol: string; + g?: number; + m?: number; + s?: number; + A?: number; + K?: number; + cd?: number; + mol?: number; + multiplier?: number; +}; +export type PatchedUnit = { + symbol?: string; + g?: number; + m?: number; + s?: number; + A?: number; + K?: number; + cd?: number; + mol?: number; + multiplier?: number; +}; +export type PatchedUnitRead = { + id?: number; + compatible_units?: { + [key: string]: string; + }[]; + symbol?: string; + g?: number; + m?: number; + s?: number; + A?: number; + K?: number; + cd?: number; + mol?: number; + multiplier?: number; +}; +export type User = { + username: string; + first_name?: string; + last_name?: string; + email?: string; +}; +export type Profile = { + user: number; +}; +export type ProfileRead = { + id: number; + user: number; +}; +export type UserRead = { + id: number; + username: string; + first_name?: string; + last_name?: string; + email?: string; + profile: ProfileRead; + project_set: number[]; +}; +export type PatchedUser = { + username?: string; + first_name?: string; + last_name?: string; + email?: string; +}; +export type PatchedUserRead = { id?: number; + username?: string; + first_name?: string; + last_name?: string; + email?: string; + profile?: ProfileRead; + project_set?: number[]; +}; +export type Variable = { read_only?: boolean; datetime?: string | null; is_public?: boolean; - lower_bound?: number; - upper_bound?: number; + lower_bound?: number | null; + upper_bound?: number | null; default_value?: number; is_log?: boolean; name: string; + description?: string | null; binding?: string | null; qname: string; + unit_symbol?: string | null; constant?: boolean; state?: boolean; color?: number; @@ -1511,272 +2633,204 @@ export type Variable = { pd_model?: number | null; pk_model?: number | null; dosed_pk_model?: number | null; + protocol?: number | null; }; -export type Protocol = { - id?: number; - doses?: { - id?: number; - start_time: number; - amount: number; - duration?: number; - read_only?: boolean; - datetime?: string | null; - protocol: number; - }[]; - dose_ids: string[]; - dosed_pk_models?: string[]; - dataset?: string; - subjects?: string[]; +export type VariableRead = { + id: number; read_only?: boolean; datetime?: string | null; - name: string; - dose_type?: "D" | "I"; - project?: number | null; - compound?: number | null; - time_unit?: number | null; - amount_unit?: number | null; -}; -export type BiomarkerType = { - id?: number; - data?: string; - is_continuous?: string; - is_categorical?: string; + is_public?: boolean; + lower_bound?: number | null; + upper_bound?: number | null; + default_value?: number; + is_log?: boolean; name: string; description?: string | null; - display?: boolean; + binding?: string | null; + qname: string; + unit_symbol?: string | null; + constant?: boolean; + state?: boolean; color?: number; + display?: boolean; axis?: boolean; - stored_unit: number; - dataset: number; - display_unit: number; - stored_time_unit: number; - display_time_unit: number; -}; -export type Pharmacokinetic = { - id?: number; - read_only?: boolean; - datetime?: string | null; - name: string; - description?: string; - mmt?: string; - time_max?: number; -}; -export type Pharmacodynamic = { - id?: number; - components?: string; - variables?: string[]; - mmt?: string; - read_only?: boolean; - datetime?: string | null; - name: string; - description?: string; - time_max?: number; - project?: number | null; + unit?: number | null; + pd_model?: number | null; + pk_model?: number | null; + dosed_pk_model?: number | null; + protocol?: number | null; }; -export type DosedPharmacokinetic = { - id?: number; - mappings: { - id?: number; - datetime?: string; - read_only?: boolean; - pkpd_model: number; - pk_variable: number; - pd_variable: number; - }[]; - components?: string; - variables?: string[]; - mmt?: string; +export type PatchedVariable = { read_only?: boolean; datetime?: string | null; - name: string; - dose_compartment?: string | null; - time_max?: number; - project?: number | null; - pk_model?: number | null; + is_public?: boolean; + lower_bound?: number | null; + upper_bound?: number | null; + default_value?: number; + is_log?: boolean; + name?: string; + description?: string | null; + binding?: string | null; + qname?: string; + unit_symbol?: string | null; + constant?: boolean; + state?: boolean; + color?: number; + display?: boolean; + axis?: boolean; + unit?: number | null; pd_model?: number | null; + pk_model?: number | null; + dosed_pk_model?: number | null; protocol?: number | null; }; -export type Inference = { +export type PatchedVariableRead = { id?: number; - log_likelihoods: { - id?: number; - parameters: { - id?: number; - name: string; - parent_index?: number | null; - child_index?: number; - length?: number | null; - parent?: string; - child: number; - variable?: number | null; - }[]; - model?: string; - dataset?: string; - time_variable?: string; - is_a_prior?: string; - name: string; - description?: string | null; - value?: number | null; - time_independent_data?: boolean; - observed?: boolean; - form?: "N" | "U" | "LN" | "F" | "S" | "E" | "M"; - inference?: string; - variable?: number | null; - biomarker_type?: number | null; - protocol_filter?: number | null; - children?: string[]; - }[]; read_only?: boolean; datetime?: string | null; - name: string; - description?: string; - initialization_strategy?: "D" | "R" | "F"; - number_of_chains?: number; - max_number_of_iterations?: number; - burn_in?: number; - number_of_iterations?: number; - time_elapsed?: number; - number_of_function_evals?: number; - task_id?: string | null; - metadata?: object; - project: number; - algorithm?: number; - initialization_inference?: number | null; -}; -export type Algorithm = { - id?: number; - name: string; - category: "SA" | "OP" | "OT"; -}; -export type InferenceChain = { - id?: number; - data?: string; - outputs?: string; - inference: number; -}; -export type DatasetCsv = { - csv: Blob; -}; -export type Monolix = { - data_csv: Blob; - model_txt: Blob; - project_mlxtran: Blob; - data?: string; - pd_model?: string; - pk_model?: string; -}; -export type PharmacodynamicSbml = { - sbml: string; + is_public?: boolean; + lower_bound?: number | null; + upper_bound?: number | null; + default_value?: number; + is_log?: boolean; + name?: string; + description?: string | null; + binding?: string | null; + qname?: string; + unit_symbol?: string | null; + constant?: boolean; + state?: boolean; + color?: number; + display?: boolean; + axis?: boolean; + unit?: number | null; + pd_model?: number | null; + pk_model?: number | null; + dosed_pk_model?: number | null; + protocol?: number | null; }; export const { - useListDatasetsQuery, - useCreateDatasetMutation, - useRetrieveDatasetQuery, - useUpdateDatasetMutation, - usePartialUpdateDatasetMutation, - useDestroyDatasetMutation, - useListUsersQuery, - useCreateUserMutation, - useRetrieveUserQuery, - useUpdateUserMutation, - usePartialUpdateUserMutation, - useDestroyUserMutation, - useListSubjectsQuery, - useCreateSubjectMutation, - useRetrieveSubjectQuery, - useUpdateSubjectMutation, - usePartialUpdateSubjectMutation, - useDestroySubjectMutation, - useListProjectsQuery, - useCreateProjectMutation, - useRetrieveProjectQuery, - useUpdateProjectMutation, - usePartialUpdateProjectMutation, - useDestroyProjectMutation, - useListProjectAccessQuery, - useCreateProjectAccessMutation, - useRetrieveProjectAccessQuery, - useUpdateProjectAccessMutation, - usePartialUpdateProjectAccessMutation, - useDestroyProjectAccessMutation, - useListDosesQuery, - useCreateDoseMutation, - useRetrieveDoseQuery, - useUpdateDoseMutation, - usePartialUpdateDoseMutation, - useDestroyDoseMutation, - useListUnitsQuery, - useCreateUnitMutation, - useRetrieveUnitQuery, - useUpdateUnitMutation, - usePartialUpdateUnitMutation, - useDestroyUnitMutation, - useListVariablesQuery, - useCreateVariableMutation, - useRetrieveVariableQuery, - useUpdateVariableMutation, - usePartialUpdateVariableMutation, - useDestroyVariableMutation, - useListProtocolsQuery, - useCreateProtocolMutation, - useRetrieveProtocolQuery, - useUpdateProtocolMutation, - usePartialUpdateProtocolMutation, - useDestroyProtocolMutation, - useListBiomarkerTypesQuery, - useCreateBiomarkerTypeMutation, - useRetrieveBiomarkerTypeQuery, - useUpdateBiomarkerTypeMutation, - usePartialUpdateBiomarkerTypeMutation, - useDestroyBiomarkerTypeMutation, - useListPharmacokineticModelsQuery, - useCreatePharmacokineticModelMutation, - useRetrievePharmacokineticModelQuery, - useUpdatePharmacokineticModelMutation, - usePartialUpdatePharmacokineticModelMutation, - useDestroyPharmacokineticModelMutation, - useListPharmacodynamicModelsQuery, - useCreatePharmacodynamicModelMutation, - useRetrievePharmacodynamicModelQuery, - useUpdatePharmacodynamicModelMutation, - usePartialUpdatePharmacodynamicModelMutation, - useDestroyPharmacodynamicModelMutation, - useListDosedPharmacokineticModelsQuery, - useCreateDosedPharmacokineticModelMutation, - useRetrieveDosedPharmacokineticModelQuery, - useUpdateDosedPharmacokineticModelMutation, - usePartialUpdateDosedPharmacokineticModelMutation, - useDestroyDosedPharmacokineticModelMutation, - useListInferencesQuery, - useCreateInferenceMutation, - useRetrieveInferenceQuery, - useUpdateInferenceMutation, - usePartialUpdateInferenceMutation, - useDestroyInferenceMutation, - useListAlgorithmsQuery, - useCreateAlgorithmMutation, - useRetrieveAlgorithmQuery, - useUpdateAlgorithmMutation, - usePartialUpdateAlgorithmMutation, - useDestroyAlgorithmMutation, - useListInferenceChainsQuery, - useCreateInferenceChainMutation, - useRetrieveInferenceChainQuery, - useUpdateInferenceChainMutation, - usePartialUpdateInferenceChainMutation, - useDestroyInferenceChainMutation, - useListSessionsQuery, - useListWhoAmIsQuery, - useCreateNcaMutation, - useCreateAuceMutation, - useCreateSimulatePkMutation, - useCreateInferenceWizardMutation, - useCreateStopInferenceMutation, - useCreateSimulatePdMutation, - useCsvDatasetMutation, - useMonolixProjectMutation, - useMmtPharmacodynamicModelMutation, - useSbmlPharmacodynamicModelMutation, - useSetVariablesFromInferencePharmacodynamicModelMutation, - useSetVariablesFromInferenceDosedPharmacokineticModelMutation, + useAlgorithmListQuery, + useAlgorithmCreateMutation, + useAlgorithmRetrieveQuery, + useAlgorithmUpdateMutation, + useAlgorithmPartialUpdateMutation, + useAlgorithmDestroyMutation, + useAuceCreateMutation, + useBiomarkerTypeListQuery, + useBiomarkerTypeCreateMutation, + useBiomarkerTypeRetrieveQuery, + useBiomarkerTypeUpdateMutation, + useBiomarkerTypePartialUpdateMutation, + useBiomarkerTypeDestroyMutation, + useCombinedModelListQuery, + useCombinedModelCreateMutation, + useCombinedModelRetrieveQuery, + useCombinedModelUpdateMutation, + useCombinedModelPartialUpdateMutation, + useCombinedModelDestroyMutation, + useCombinedModelSetParamsToDefaultsUpdateMutation, + useCombinedModelSetVariablesFromInferenceUpdateMutation, + useCombinedModelSimulateCreateMutation, + useCompoundListQuery, + useCompoundCreateMutation, + useCompoundRetrieveQuery, + useCompoundUpdateMutation, + useCompoundPartialUpdateMutation, + useCompoundDestroyMutation, + useDatasetListQuery, + useDatasetCreateMutation, + useDatasetRetrieveQuery, + useDatasetUpdateMutation, + useDatasetPartialUpdateMutation, + useDatasetDestroyMutation, + useDatasetCsvUpdateMutation, + useDoseListQuery, + useDoseCreateMutation, + useDoseRetrieveQuery, + useDoseUpdateMutation, + useDosePartialUpdateMutation, + useDoseDestroyMutation, + useInferenceListQuery, + useInferenceCreateMutation, + useInferenceRetrieveQuery, + useInferenceUpdateMutation, + useInferencePartialUpdateMutation, + useInferenceDestroyMutation, + useInferenceStopCreateMutation, + useInferenceWizardCreateMutation, + useInferenceChainListQuery, + useInferenceChainCreateMutation, + useInferenceChainRetrieveQuery, + useInferenceChainUpdateMutation, + useInferenceChainPartialUpdateMutation, + useInferenceChainDestroyMutation, + useNcaCreateMutation, + usePharmacodynamicListQuery, + usePharmacodynamicCreateMutation, + usePharmacodynamicRetrieveQuery, + usePharmacodynamicUpdateMutation, + usePharmacodynamicPartialUpdateMutation, + usePharmacodynamicDestroyMutation, + usePharmacodynamicMmtUpdateMutation, + usePharmacodynamicSbmlUpdateMutation, + usePharmacodynamicSetVariablesFromInferenceUpdateMutation, + usePharmacodynamicSimulateCreateMutation, + usePharmacokineticListQuery, + usePharmacokineticCreateMutation, + usePharmacokineticRetrieveQuery, + usePharmacokineticUpdateMutation, + usePharmacokineticPartialUpdateMutation, + usePharmacokineticDestroyMutation, + useProjectListQuery, + useProjectCreateMutation, + useProjectRetrieveQuery, + useProjectUpdateMutation, + useProjectPartialUpdateMutation, + useProjectDestroyMutation, + useProjectMonolixUpdateMutation, + useProjectAccessListQuery, + useProjectAccessCreateMutation, + useProjectAccessRetrieveQuery, + useProjectAccessUpdateMutation, + useProjectAccessPartialUpdateMutation, + useProjectAccessDestroyMutation, + useProtocolListQuery, + useProtocolCreateMutation, + useProtocolRetrieveQuery, + useProtocolUpdateMutation, + useProtocolPartialUpdateMutation, + useProtocolDestroyMutation, + useSessionRetrieveQuery, + useSimulationListQuery, + useSimulationCreateMutation, + useSimulationRetrieveQuery, + useSimulationUpdateMutation, + useSimulationPartialUpdateMutation, + useSimulationDestroyMutation, + useSubjectListQuery, + useSubjectCreateMutation, + useSubjectRetrieveQuery, + useSubjectUpdateMutation, + useSubjectPartialUpdateMutation, + useSubjectDestroyMutation, + useUnitListQuery, + useUnitCreateMutation, + useUnitRetrieveQuery, + useUnitUpdateMutation, + useUnitPartialUpdateMutation, + useUnitDestroyMutation, + useUserListQuery, + useUserCreateMutation, + useUserRetrieveQuery, + useUserUpdateMutation, + useUserPartialUpdateMutation, + useUserDestroyMutation, + useVariableListQuery, + useVariableCreateMutation, + useVariableRetrieveQuery, + useVariableUpdateMutation, + useVariablePartialUpdateMutation, + useVariableDestroyMutation, + useWhoamiRetrieveQuery, } = injectedRtkApi; diff --git a/frontend-v2/src/app/emptyApi.ts b/frontend-v2/src/app/emptyApi.ts index cf7b0414..b9b2bfde 100644 --- a/frontend-v2/src/app/emptyApi.ts +++ b/frontend-v2/src/app/emptyApi.ts @@ -1,8 +1,23 @@ // Or from '@reduxjs/toolkit/query' if not using the auto-generated hooks import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react' +import { selectCsrf } from '../features/login/loginSlice'; +import { RootState } from './store'; + +const baseQuery = fetchBaseQuery({ + baseUrl: "/", + credentials: "include", + prepareHeaders: (headers, { getState }) => { + const csrf = selectCsrf(getState() as RootState) + if (csrf) { + headers.set("X-CSRFToken", csrf); + } + return headers; + } +}); // initialize an empty api service that we'll inject endpoints into later as needed export const emptySplitApi = createApi({ - baseQuery: fetchBaseQuery({ baseUrl: '/' }), + baseQuery, endpoints: () => ({}), -}) \ No newline at end of file +}); + diff --git a/frontend-v2/src/app/hooks.ts b/frontend-v2/src/app/hooks.ts index 520e84ed..93bb45e0 100644 --- a/frontend-v2/src/app/hooks.ts +++ b/frontend-v2/src/app/hooks.ts @@ -1,6 +1,32 @@ import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; import type { RootState, AppDispatch } from './store'; +import { Control, FieldPath, FieldValues, useFormState } from 'react-hook-form'; +import { useEffect, useState } from 'react'; // Use throughout your app instead of plain `useDispatch` and `useSelector` export const useAppDispatch = () => useDispatch(); export const useAppSelector: TypedUseSelectorHook = useSelector; + +type Props = { + name: FieldPath; + control: Control; +}; + +export function useFieldState({ name, control}: Props) { + const { defaultValues } = useFormState({ control, name }); + const keys = name.split('.'); + const defaultValue = keys.reduce((acc, key) => { + if (acc && typeof acc === 'object') { + return acc[key]; + } + return undefined; + }, defaultValues); + + const [fieldValue, setFieldValue] = useState(defaultValue); + + useEffect(() => { + setFieldValue(defaultValue); + }, [defaultValue]); + + return [fieldValue, setFieldValue]; +} diff --git a/frontend-v2/src/app/store.ts b/frontend-v2/src/app/store.ts index 5ddabdad..f3a3a67a 100644 --- a/frontend-v2/src/app/store.ts +++ b/frontend-v2/src/app/store.ts @@ -1,15 +1,25 @@ import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit'; -import counterReducer from '../features/counter/counterSlice'; +import { setupListeners } from '@reduxjs/toolkit/query' import loginReducer from '../features/login/loginSlice'; import mainReducer from '../features/main/mainSlice'; +import { api } from '../app/api' export const store = configureStore({ reducer: { main: mainReducer, login: loginReducer, + [api.reducerPath]: api.reducer, }, + // Adding the api middleware enables caching, invalidation, polling, + // and other useful features of `rtk-query`. + middleware: (getDefaultMiddleware) => + getDefaultMiddleware().concat(api.middleware), }); +// optional, but required for refetchOnFocus/refetchOnReconnect behaviors +// see `setupListeners` docs - takes an optional callback as the 2nd arg for customization +setupListeners(store.dispatch) + export type AppDispatch = typeof store.dispatch; export type RootState = ReturnType; export type AppThunk = ThunkAction< diff --git a/frontend-v2/src/components/Checkbox.tsx b/frontend-v2/src/components/Checkbox.tsx new file mode 100644 index 00000000..6e3029d1 --- /dev/null +++ b/frontend-v2/src/components/Checkbox.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import { Control, Controller, FieldPath, FieldValues } from 'react-hook-form'; +import * as material from '@mui/material'; + +type Props = { + label: string; + name: FieldPath; + control: Control; + rules?: Object; + checkboxFieldProps?: material.CheckboxProps; +}; + +function Checkbox({ label, name, control, rules, checkboxFieldProps }: Props): React.ReactElement { + return ( + { + return ( + + } + label={label} + /> + ) + }} + /> + ); +}; + +export default Checkbox; \ No newline at end of file diff --git a/frontend-v2/src/components/ConfirmationDialog.tsx b/frontend-v2/src/components/ConfirmationDialog.tsx new file mode 100644 index 00000000..d6c772e1 --- /dev/null +++ b/frontend-v2/src/components/ConfirmationDialog.tsx @@ -0,0 +1,29 @@ +import { Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material'; +import React from 'react'; + +interface ConfirmationDialogProps { + open: boolean; + title: string; + message: string; + onConfirm: () => void; + onCancel: () => void; +} + +const ConfirmationDialog: React.FC = ({ open, title, message, onConfirm, onCancel }) => { + return ( + + {title} + {message} + + + + + + ); +}; + +export default ConfirmationDialog; \ No newline at end of file diff --git a/frontend-v2/src/components/DropdownButton.tsx b/frontend-v2/src/components/DropdownButton.tsx new file mode 100644 index 00000000..ccab023c --- /dev/null +++ b/frontend-v2/src/components/DropdownButton.tsx @@ -0,0 +1,70 @@ +import { Button, IconButton, ListItem, ListItemButton, ListItemText, Popover } from '@mui/material'; +import React, { useState } from 'react'; + +type Option = { + label: string; + value: any; +}; + +type Props = { + options: Option[]; + onOptionSelected: (value: any) => void; + children?: React.ReactNode; + disabled?: boolean; + data_cy?: string; + useIcon?: boolean; +}; + +const DropdownButton: React.FC = ({ data_cy, options, onOptionSelected, children, disabled, useIcon }) => { + const [anchorEl, setAnchorEl] = useState(null); + + if (useIcon === undefined) { + useIcon = true; + } + + const handleButtonClick = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }; + + const handleOptionSelected = (option: Option) => { + setAnchorEl(null); + onOptionSelected(option.value); + }; + + const open = Boolean(anchorEl); + const isDisabled = disabled || options.length === 0; + + if (data_cy === undefined) { + data_cy = `dropdown-button`; + } + + return ( +
+ {useIcon ? ( + + {children} + + ) : ( + + )} + setAnchorEl(null)} + data-cy={`dropdown-button-popover`} + anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }} + transformOrigin={{ vertical: 'top', horizontal: 'left' }} + > + {options.map((option, index) => ( + handleOptionSelected(option)} data-cy={`${data_cy}-option-${option.label}`}> + + + ))} + +
+ ); +}; + +export default DropdownButton; \ No newline at end of file diff --git a/frontend-v2/src/components/DynamicTabs.tsx b/frontend-v2/src/components/DynamicTabs.tsx new file mode 100644 index 00000000..bc5750cd --- /dev/null +++ b/frontend-v2/src/components/DynamicTabs.tsx @@ -0,0 +1,69 @@ +import React, { PropsWithChildren, ReactElement, useState } from 'react'; +import Box from '@mui/material/Box'; +import Tabs from '@mui/material/Tabs'; +import Tab from '@mui/material/Tab'; +import ErrorIcon from '@mui/icons-material/Error'; +import { Tooltip } from '@mui/material'; + +interface TabContextProps { + currentTab: number; + setCurrentTab: React.Dispatch>; +} + +export const TabContext = React.createContext({ + currentTab: 0, + setCurrentTab: () => {}, +}); + +interface DynamicTabsProps { + tabNames: string[]; + tabErrors?: { [key: string]: string }; +} + +interface TabPanelProps { + index?: number; +} + +export const TabPanel: React.FC> = ({ index, children }) => { + const { currentTab } = React.useContext(TabContext); + + return ; +}; + +export const DynamicTabs: React.FC> = ({ tabNames, tabErrors, children }) => { + const [currentTab, setCurrentTab] = useState(0); + + let errors: { [key: string]: ReactElement } = {}; + for (const key in tabErrors) { + errors[key] = ( + + + + ) + } + + + const handleChange = (event: React.SyntheticEvent, newValue: number) => { + setCurrentTab(newValue); + }; + + + return ( + + + + + {tabNames.map((name, index) => ( + + ))} + + + + {React.Children.map(children, (child, index) => { + return React.cloneElement(child as React.ReactElement, { index }); + })} + + + + ); +}; diff --git a/frontend-v2/src/components/FloatField.tsx b/frontend-v2/src/components/FloatField.tsx new file mode 100644 index 00000000..3b33c259 --- /dev/null +++ b/frontend-v2/src/components/FloatField.tsx @@ -0,0 +1,69 @@ +import React from 'react'; +import { Control, Controller, FieldPath, FieldValues } from 'react-hook-form'; +import * as material from '@mui/material'; +import { useFieldState } from '../app/hooks'; + +type Props = { + label?: string; + name: FieldPath; + control: Control; + rules?: Object; + textFieldProps?: material.TextFieldProps; + data_cy?: string; +}; + +function convert(value: any) { + if (typeof value === 'string') { + if (value !== '') { + return parseFloat(value); + } else { + return null; + } + } else { + return null; + } +} + +function FloatField({ label, name, control, rules, textFieldProps, data_cy }: Props): React.ReactElement { + const [fieldValue, setFieldValue] = useFieldState({ name, control }); + return ( + { + const handleBlur = (e: React.FocusEvent) => { + const updatedValue = convert(e.target.value); + console.log('handleBlur', updatedValue, value) + if (updatedValue !== value) { + e.target.value = updatedValue as any; + onChange(e); + } + onBlur(); + }; + + const handleChange = (e: React.ChangeEvent) => { + console.log('handleChage', convert(e.target.value)) + setFieldValue(convert(e.target.value)); + }; + return ( + + ); + }} + /> + ); +}; + +export default FloatField; diff --git a/frontend-v2/src/components/HelpButton.tsx b/frontend-v2/src/components/HelpButton.tsx new file mode 100644 index 00000000..a7b7679d --- /dev/null +++ b/frontend-v2/src/components/HelpButton.tsx @@ -0,0 +1,34 @@ +import React, { useState } from 'react'; +import { HelpOutline } from '@mui/icons-material'; +import HelpDialog from './HelpDialog'; +import { IconButton } from '@mui/material'; + +interface HelpButtonProps { + title: string; + children: React.ReactNode; +} + +const HelpButton: React.FC = ({ title, children }) => { + const [open, setOpen] = useState(false); + + const handleOpen = () => { + setOpen(true); + }; + + const handleClose = () => { + setOpen(false); + }; + + return ( + <> + + + + + {children} + + + ); +}; + +export default HelpButton; \ No newline at end of file diff --git a/frontend-v2/src/components/HelpDialog.tsx b/frontend-v2/src/components/HelpDialog.tsx new file mode 100644 index 00000000..993c7c45 --- /dev/null +++ b/frontend-v2/src/components/HelpDialog.tsx @@ -0,0 +1,25 @@ +import React from 'react'; +import { Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@mui/material'; + +interface HelpDialogProps { + open: boolean; + title: string; + onClose: () => void; + children: React.ReactNode; +} + +const HelpDialog: React.FC = ({ open, title, onClose, children }) => { + return ( + + {title} + {children} + + + + + ); +}; + +export default HelpDialog; \ No newline at end of file diff --git a/frontend-v2/src/components/IntegerField.tsx b/frontend-v2/src/components/IntegerField.tsx new file mode 100644 index 00000000..439b6c95 --- /dev/null +++ b/frontend-v2/src/components/IntegerField.tsx @@ -0,0 +1,61 @@ +import React from 'react'; +import { Control, Controller, FieldPath, FieldValues } from 'react-hook-form'; +import * as material from '@mui/material'; +import { useFieldState } from '../app/hooks'; + +type Props = { + label?: string; + name: FieldPath; + control: Control; + rules?: Object; + textFieldProps?: material.TextFieldProps; +}; + +function convert(value: any) { + if (typeof value === 'string' && value !== '') { + return parseInt(value); + } else { + return value; + } +} + +function IntegerField({ label, name, control, rules, textFieldProps }: Props): React.ReactElement { + const [fieldValue, setFieldValue] = useFieldState({ name, control }); + return ( + { + const handleBlur = (e: React.FocusEvent) => { + const updatedValue = convert(e.target.value); + if (updatedValue !== value) { + e.target.value = updatedValue; + onChange(e); + } + onBlur(); + }; + + const handleChange = (e: React.ChangeEvent) => { + setFieldValue(convert(e.target.value)); + }; + return ( + + ); + }} + /> + ); +}; + +export default IntegerField; diff --git a/frontend-v2/src/components/SelectField.tsx b/frontend-v2/src/components/SelectField.tsx new file mode 100644 index 00000000..ba8e931a --- /dev/null +++ b/frontend-v2/src/components/SelectField.tsx @@ -0,0 +1,57 @@ +import React from 'react'; +import { Control, Controller, FieldPath, FieldValues } from 'react-hook-form'; +import { Select, SelectProps, MenuItem, InputLabel, FormControl, OutlinedInput, FormControlProps } from '@mui/material'; + +type Option = { + value: any; + label: string; +}; + +type Props = { + label?: string; + name: FieldPath; + options: Option[]; + control: Control; + rules?: Object; + selectProps?: SelectProps; + formControlProps?: FormControlProps; +}; + +function SelectField({ label, name, options, control, rules, selectProps, formControlProps }: Props): React.ReactElement { + const labelId = `${name}-label`; + const displayEmpty = selectProps?.displayEmpty || true; + const labelWidth = (label ? label.length : 0) * 9 + return ( + ( + + {label} + + + )} + /> + ); +}; + +export default SelectField; \ No newline at end of file diff --git a/frontend-v2/src/components/TextField.tsx b/frontend-v2/src/components/TextField.tsx new file mode 100644 index 00000000..ebdac031 --- /dev/null +++ b/frontend-v2/src/components/TextField.tsx @@ -0,0 +1,60 @@ +import React, { useEffect, useState } from 'react'; +import { Control, Controller, FieldPath, FieldValues, useFormState } from 'react-hook-form'; +import * as material from '@mui/material'; +import { useFieldState } from '../app/hooks'; + +type Props = { + label?: string; + name: FieldPath; + control: Control; + rules?: Object; + mode?: 'onChange' | 'onBlur'; + textFieldProps?: material.TextFieldProps; +}; + +function TextField({ label, name, control, rules, mode, textFieldProps }: Props): React.ReactElement { + const [fieldValue, setFieldValue] = useFieldState({ name, control }); + + if (mode === undefined) { + mode = 'onBlur'; + } + + return ( + { + + const handleBlur = (e: React.FocusEvent) => { + if (mode === 'onBlur' && e.target.value !== value) { + onChange(e); + } + onBlur(); + }; + + const handleChange = (e: React.ChangeEvent) => { + setFieldValue(e.target.value); + if (mode === 'onChange') { + onChange(e); + } + }; + return ( + + ); + }} + /> + ); +}; + +export default TextField; \ No newline at end of file diff --git a/frontend-v2/src/components/Title.tsx b/frontend-v2/src/components/Title.tsx new file mode 100644 index 00000000..3da912a2 --- /dev/null +++ b/frontend-v2/src/components/Title.tsx @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { Typography } from '@mui/material'; + +interface Props { + title: string; +} + +export const Title = ({ title }: Props) => ( + + {title} + +); + diff --git a/frontend-v2/src/components/UnitField.tsx b/frontend-v2/src/components/UnitField.tsx new file mode 100644 index 00000000..398762c6 --- /dev/null +++ b/frontend-v2/src/components/UnitField.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { Control, FieldPath, FieldValues } from 'react-hook-form'; +import { SelectProps } from '@mui/material'; +import { Compound, Unit, UnitRead, useUnitRetrieveQuery } from '../app/backendApi'; +import SelectField from './SelectField'; + +type Props = { + label: string; + baseUnit?: UnitRead; + name: FieldPath; + control: Control; + rules?: Object; + selectProps?: SelectProps; + compound?: Compound; + isPreclinicalPerKg?: boolean; +}; + +function UnitField({ label, name, baseUnit, control, rules, selectProps, isPreclinicalPerKg }: Props): React.ReactElement { + if (!isPreclinicalPerKg) { + isPreclinicalPerKg = false; + } + + const isDimensionless = baseUnit?.symbol === '' || false; + if (!baseUnit || isDimensionless) { + selectProps = { ...selectProps, disabled: true }; + } + + const compatibleUnits = isPreclinicalPerKg ? + baseUnit?.compatible_units.filter(unit => unit.symbol.endsWith('/kg')) : + baseUnit?.compatible_units; + + const options = compatibleUnits ? + compatibleUnits.map((unit: { [key: string]: string }) => { + return { value: unit.id, label: unit.symbol } + }) : []; + + return ( + + ); +}; + +export default UnitField; \ No newline at end of file diff --git a/frontend-v2/src/features/counter/Counter.module.css b/frontend-v2/src/features/counter/Counter.module.css deleted file mode 100644 index 025bb729..00000000 --- a/frontend-v2/src/features/counter/Counter.module.css +++ /dev/null @@ -1,79 +0,0 @@ -.row { - display: flex; - align-items: center; - justify-content: center; -} - -.row > button { - margin-left: 4px; - margin-right: 8px; -} - -.row:not(:last-child) { - margin-bottom: 16px; -} - -.value { - font-size: 78px; - padding-left: 16px; - padding-right: 16px; - margin-top: 2px; - font-family: 'Courier New', Courier, monospace; -} - -.button { - appearance: none; - background: none; - font-size: 32px; - padding-left: 12px; - padding-right: 12px; - outline: none; - border: 2px solid transparent; - color: rgb(112, 76, 182); - padding-bottom: 4px; - cursor: pointer; - background-color: rgba(112, 76, 182, 0.1); - border-radius: 2px; - transition: all 0.15s; -} - -.textbox { - font-size: 32px; - padding: 2px; - width: 64px; - text-align: center; - margin-right: 4px; -} - -.button:hover, -.button:focus { - border: 2px solid rgba(112, 76, 182, 0.4); -} - -.button:active { - background-color: rgba(112, 76, 182, 0.2); -} - -.asyncButton { - composes: button; - position: relative; -} - -.asyncButton:after { - content: ''; - background-color: rgba(112, 76, 182, 0.15); - display: block; - position: absolute; - width: 100%; - height: 100%; - left: 0; - top: 0; - opacity: 0; - transition: width 1s linear, opacity 0.5s ease 1s; -} - -.asyncButton:active:after { - width: 0%; - opacity: 1; - transition: 0s; -} diff --git a/frontend-v2/src/features/counter/Counter.tsx b/frontend-v2/src/features/counter/Counter.tsx deleted file mode 100644 index ece5191b..00000000 --- a/frontend-v2/src/features/counter/Counter.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React, { useState } from 'react'; - -import { useAppSelector, useAppDispatch } from '../../app/hooks'; -import { - decrement, - increment, - incrementByAmount, - incrementAsync, - incrementIfOdd, - selectCount, -} from './counterSlice'; -import styles from './Counter.module.css'; - -export function Counter() { - const count = useAppSelector(selectCount); - const dispatch = useAppDispatch(); - const [incrementAmount, setIncrementAmount] = useState('2'); - - const incrementValue = Number(incrementAmount) || 0; - - return ( -
-
- - {count} - -
-
- setIncrementAmount(e.target.value)} - /> - - - -
-
- ); -} diff --git a/frontend-v2/src/features/counter/counterAPI.ts b/frontend-v2/src/features/counter/counterAPI.ts deleted file mode 100644 index 0a9cdd31..00000000 --- a/frontend-v2/src/features/counter/counterAPI.ts +++ /dev/null @@ -1,6 +0,0 @@ -// A mock function to mimic making an async request for data -export function fetchCount(amount = 1) { - return new Promise<{ data: number }>((resolve) => - setTimeout(() => resolve({ data: amount }), 500) - ); -} diff --git a/frontend-v2/src/features/counter/counterSlice.spec.ts b/frontend-v2/src/features/counter/counterSlice.spec.ts deleted file mode 100644 index 098163b9..00000000 --- a/frontend-v2/src/features/counter/counterSlice.spec.ts +++ /dev/null @@ -1,34 +0,0 @@ -import counterReducer, { - CounterState, - increment, - decrement, - incrementByAmount, -} from './counterSlice'; - -describe('counter reducer', () => { - const initialState: CounterState = { - value: 3, - status: 'idle', - }; - it('should handle initial state', () => { - expect(counterReducer(undefined, { type: 'unknown' })).toEqual({ - value: 0, - status: 'idle', - }); - }); - - it('should handle increment', () => { - const actual = counterReducer(initialState, increment()); - expect(actual.value).toEqual(4); - }); - - it('should handle decrement', () => { - const actual = counterReducer(initialState, decrement()); - expect(actual.value).toEqual(2); - }); - - it('should handle incrementByAmount', () => { - const actual = counterReducer(initialState, incrementByAmount(2)); - expect(actual.value).toEqual(5); - }); -}); diff --git a/frontend-v2/src/features/counter/counterSlice.ts b/frontend-v2/src/features/counter/counterSlice.ts deleted file mode 100644 index 015dca0a..00000000 --- a/frontend-v2/src/features/counter/counterSlice.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit'; -import { RootState, AppThunk } from '../../app/store'; -import { fetchCount } from './counterAPI'; - -export interface CounterState { - value: number; - status: 'idle' | 'loading' | 'failed'; -} - -const initialState: CounterState = { - value: 0, - status: 'idle', -}; - -// The function below is called a thunk and allows us to perform async logic. It -// can be dispatched like a regular action: `dispatch(incrementAsync(10))`. This -// will call the thunk with the `dispatch` function as the first argument. Async -// code can then be executed and other actions can be dispatched. Thunks are -// typically used to make async requests. -export const incrementAsync = createAsyncThunk( - 'counter/fetchCount', - async (amount: number) => { - const response = await fetchCount(amount); - // The value we return becomes the `fulfilled` action payload - return response.data; - } -); - -export const counterSlice = createSlice({ - name: 'counter', - initialState, - // The `reducers` field lets us define reducers and generate associated actions - reducers: { - increment: (state) => { - // Redux Toolkit allows us to write "mutating" logic in reducers. It - // doesn't actually mutate the state because it uses the Immer library, - // which detects changes to a "draft state" and produces a brand new - // immutable state based off those changes - state.value += 1; - }, - decrement: (state) => { - state.value -= 1; - }, - // Use the PayloadAction type to declare the contents of `action.payload` - incrementByAmount: (state, action: PayloadAction) => { - state.value += action.payload; - }, - }, - // The `extraReducers` field lets the slice handle actions defined elsewhere, - // including actions generated by createAsyncThunk or in other slices. - extraReducers: (builder) => { - builder - .addCase(incrementAsync.pending, (state) => { - state.status = 'loading'; - }) - .addCase(incrementAsync.fulfilled, (state, action) => { - state.status = 'idle'; - state.value += action.payload; - }) - .addCase(incrementAsync.rejected, (state) => { - state.status = 'failed'; - }); - }, -}); - -export const { increment, decrement, incrementByAmount } = counterSlice.actions; - -// The function below is called a selector and allows us to select a value from -// the state. Selectors can also be defined inline where they're used instead of -// in the slice file. For example: `useSelector((state: RootState) => state.counter.value)` -export const selectCount = (state: RootState) => state.counter.value; - -// We can also write thunks by hand, which may contain both sync and async logic. -// Here's an example of conditionally dispatching actions based on current state. -export const incrementIfOdd = - (amount: number): AppThunk => - (dispatch, getState) => { - const currentValue = selectCount(getState()); - if (currentValue % 2 === 1) { - dispatch(incrementByAmount(amount)); - } - }; - -export default counterSlice.reducer; diff --git a/frontend-v2/src/features/drug/Drug.tsx b/frontend-v2/src/features/drug/Drug.tsx new file mode 100644 index 00000000..a54c4371 --- /dev/null +++ b/frontend-v2/src/features/drug/Drug.tsx @@ -0,0 +1,186 @@ +import { Button, Grid, IconButton, List, ListItem, ListItemSecondaryAction, Radio, Stack, Tooltip, Typography } from '@mui/material'; +import { useSelector } from 'react-redux'; +import { RootState } from '../../app/store'; +import { Compound, Efficacy, EfficacyRead, useCompoundRetrieveQuery, useCompoundUpdateMutation, useProjectRetrieveQuery, useUnitListQuery } from '../../app/backendApi'; +import { useFieldArray, useForm, useFormState } from 'react-hook-form'; +import FloatField from '../../components/FloatField'; +import UnitField from '../../components/UnitField'; +import SelectField from '../../components/SelectField'; +import { useEffect, useState } from 'react'; +import DeleteIcon from '@mui/icons-material/Delete'; +import TextField from '../../components/TextField'; +import useDirty from '../../hooks/useDirty'; +import ConfirmationDialog from '../../components/ConfirmationDialog'; + + +const Drug: React.FC = () => { + const projectId = useSelector((state: RootState) => state.main.selectedProject); + const { data: project, isLoading: isProjectLoading } = useProjectRetrieveQuery({id: projectId || 0}, { skip: !projectId }) + const { data: compound, isLoading: isCompoundLoading } = useCompoundRetrieveQuery({id: project?.compound || 0}, { skip: !project }) + const [ updateCompound ] = useCompoundUpdateMutation() + const { data: units, isLoading: isLoadingUnits } = useUnitListQuery({ compoundId: project?.compound}, { skip: !project?.compound}); + + const [ showConfirmDelete, setShowConfirmDelete ] = useState(false); + + + // create a form for the compound data using react-hook-form + const { reset, handleSubmit, control, setValue } = useForm({ + defaultValues: compound || { name: '', description: '', compound_type: 'SM', efficacy_experiments: [] } + }); + const { isDirty } = useFormState({ control }); + + useDirty(isDirty); + + const { fields: efficacy_experiments, append, remove } = useFieldArray({ + control, + name: "efficacy_experiments", + keyName: "theKey", + }); + + + useEffect(() => { + reset(compound); + }, [compound, reset]); + + const submit = handleSubmit((data) => { + if (data && compound && (JSON.stringify(data) !== JSON.stringify(compound))) { + // strange bug in react-hook-form is creating efficancy_experiments with undefined compounds, remove these for now. + data.efficacy_experiments = data.efficacy_experiments.filter((efficacy_experiment) => efficacy_experiment.compound !== undefined); + updateCompound({ id: compound.id, compound: data }).then((result) => { + // if the compound has no efficacy experiments, but the result has, then set the first one as the use_efficacy + if ('data' in result) { + if (compound.efficacy_experiments.length === 0 && result.data.efficacy_experiments.length > 0) { + updateCompound({ id: compound.id, compound: { ...data, use_efficacy: result.data.efficacy_experiments[0].id }}); + } + } + }); + } + }); + + useEffect(() => { + const intervalId = setInterval(() => { + if (isDirty) { + submit(); + } + }, 1000); + + return () => clearInterval(intervalId); + }, [submit, isDirty]); + + useEffect(() => () => { submit(); }, []); + + const addNewEfficacyExperiment = () => { + append([{ name: '', c50: compound?.target_concentration || 0, c50_unit: compound?.target_concentration_unit || 0, hill_coefficient: 1, compound: compound?.id || 0 }]); + }; + + const deleteEfficacyExperiment = (index: number) => { + remove(index); + }; + + + if (isProjectLoading || isCompoundLoading || isLoadingUnits) { + return
Loading...
; + } + + if (!compound || !project || !units) { + return
Not found
; + } + + const intrinsic_clearance_assay_options = [ + { value: "MS", label: "Microsomes" }, + { value: "HC", label: "Hepatocytes" }, + ]; + + const is_soluble_options = [ + { value: false, label: "Membrane-bound" }, + { value: true, label: "Soluble" }, + ]; + + const isLM = compound.compound_type === 'LM'; + + const isEfficacySelected = (efficacy_experiment: EfficacyRead ) => { + if (compound.use_efficacy === undefined) { + return false; + } + return efficacy_experiment.id === compound.use_efficacy; + } + + const handleSelectEfficacy = (efficacy_experiment: EfficacyRead) => { + if (efficacy_experiment.id === compound.use_efficacy) { + setValue('use_efficacy', null); + submit(); + } else { + setValue('use_efficacy', efficacy_experiment.id); + submit(); + } + } + + return ( + + + + Drug Properties + + + + + u.id === compound.molecular_mass_unit)} compound={compound} /> + + + + + + Target Properties + + + + + + u.id === compound.molecular_mass_unit)} compound={compound} /> + + + + + + Efficacy-Safety Data + + + + {efficacy_experiments.map((efficacy_experiment, index) => ( + + + + + + u.id === efficacy_experiment.c50_unit)} compound={compound} /> + + + + + + handleSelectEfficacy(efficacy_experiment as unknown as EfficacyRead)}/> + + + setShowConfirmDelete(true)}> + + + + { deleteEfficacyExperiment(index); setShowConfirmDelete(false); }} + onCancel={() => setShowConfirmDelete(false)} + /> + + + ))} + + + + ); +} + +export default Drug; diff --git a/frontend-v2/src/features/help/Help.tsx b/frontend-v2/src/features/help/Help.tsx new file mode 100644 index 00000000..33da4112 --- /dev/null +++ b/frontend-v2/src/features/help/Help.tsx @@ -0,0 +1,82 @@ +import React, { useEffect } from 'react'; +import { DynamicTabs, TabPanel } from '../../components/DynamicTabs'; +import HelpTab from './HelpTab'; +import { parse } from 'papaparse'; +import { set } from 'react-hook-form'; +import { Container } from '@mui/material'; + +export type Question = { + question: string; + answer: string; +} + +export type TutorialVideo = { + title: string; + type: string; + link: string; + keywords: string[]; +} + +const tutorialVideosUrl: string = '/backend/tutorial_videos.csv'; + +const Help: React.FC = () => { + const [ tutorialVideos, setTutorialVideos ] = React.useState([]); + useEffect(() => { + parse(tutorialVideosUrl, { + download: true, + error: (err) => { + console.error('Error downloading tutorial videos:', err); + }, + complete: (results) => { + setTutorialVideos( + results.data.map((row) => { + const rowList = row as string[]; + return { + title: rowList[0], + type: rowList[1], + link: rowList[2].replace('view?usp=sharing', 'preview'), + keywords: rowList[3].split(',').map((keyword) => keyword.trim()) + }; + }) + ); + } + }) + }, []); + let generic_questions: Question[] = Array(5).fill({ + question: "Question 1?", + answer: "Answer 1" + }); + generic_questions = generic_questions.map((question, index) => { + return { + question: `Question ${index + 1}?`, + answer: `Answer ${index + 1}: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.` + }}); + + const questions = [ + generic_questions.slice(0, 0), + generic_questions.slice(0, 0), + generic_questions.slice(0, 0), + generic_questions.slice(0, 0), + generic_questions.slice(0, 0), + ] + const tutorials = [ + tutorialVideos.filter((video) => video.type.includes('Tutorial')), + tutorialVideos.filter((video) => video.type === 'Project'), + tutorialVideos.filter((video) => video.type === 'Drug'), + tutorialVideos.filter((video) => video.type === 'Model'), + tutorialVideos.filter((video) => video.type === 'Trial Design'), + tutorialVideos.filter((video) => video.type === 'Simulation'), + ] + + return ( + + { questions.map((question, index) => ( + + + + ))} + + ); +} + +export default Help; diff --git a/frontend-v2/src/features/help/HelpTab.tsx b/frontend-v2/src/features/help/HelpTab.tsx new file mode 100644 index 00000000..0e0d2484 --- /dev/null +++ b/frontend-v2/src/features/help/HelpTab.tsx @@ -0,0 +1,59 @@ +import { Accordion, AccordionDetails, AccordionSummary, Box, Card, Chip, Grid, Stack, Typography } from "@mui/material"; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import { Question, TutorialVideo } from "./Help"; +import ReactPlayer from 'react-player/youtube' + + +interface Props { + questions: Question[]; + videos: TutorialVideo[]; +} + +// tab that lists questions as mui accordian components +const HelpTab: React.FC = ({ questions, videos }) => { + return ( +
+ + {questions.map((question, index) => { + return ( + + } + > + {question.question} + + + {question.answer} + + + ) + })} + + + {videos.map((video, index) => { + return ( + + {video.title} + + { video.keywords.map((keyword, index) => { + return ( + + ) + })} + +