From 130eabea5afbbc23928d910ef1b168eb71987e88 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 09:29:29 +0200 Subject: [PATCH 01/19] feat(web-client): add native fetch http core --- web/packages/web-client/src/errors.ts | 10 +- .../web-client/src/http/fetchClient.ts | 164 +++++++++ web/packages/web-client/src/http/index.ts | 2 + web/packages/web-client/src/http/types.ts | 39 +++ web/packages/web-client/src/index.ts | 1 + .../tests/unit/http/fetchClient.spec.ts | 311 ++++++++++++++++++ 6 files changed, 526 insertions(+), 1 deletion(-) create mode 100644 web/packages/web-client/src/http/fetchClient.ts create mode 100644 web/packages/web-client/src/http/index.ts create mode 100644 web/packages/web-client/src/http/types.ts create mode 100644 web/packages/web-client/tests/unit/http/fetchClient.spec.ts diff --git a/web/packages/web-client/src/errors.ts b/web/packages/web-client/src/errors.ts index 616d2f4ab8c..2bb1084c68a 100644 --- a/web/packages/web-client/src/errors.ts +++ b/web/packages/web-client/src/errors.ts @@ -3,11 +3,19 @@ import { DavErrorCode } from './webdav' export class HttpError extends Error { public response: Response public statusCode: number + /** parsed response body, read once before the error is thrown */ + public data?: unknown - constructor(message: string, response: Response, statusCode: number = null) { + constructor( + message: string, + response: Response, + statusCode: number = null, + data?: unknown + ) { super(message) this.response = response this.statusCode = statusCode + this.data = data } } diff --git a/web/packages/web-client/src/http/fetchClient.ts b/web/packages/web-client/src/http/fetchClient.ts new file mode 100644 index 00000000000..e1bfb8ae8af --- /dev/null +++ b/web/packages/web-client/src/http/fetchClient.ts @@ -0,0 +1,164 @@ +import { HttpError } from '../errors' +import type { + FetchClientOptions, + FetchRequestOptions, + HttpResponse, + ResponseType +} from './types' + +const isBodyInit = (value: unknown): value is BodyInit => + typeof value === 'string' || + value instanceof Blob || + value instanceof FormData || + value instanceof URLSearchParams || + value instanceof ArrayBuffer || + value instanceof ReadableStream || + ArrayBuffer.isView(value) + +const hasScheme = (url: string) => /^[a-z][a-z0-9+.-]*:/i.test(url) + +export class FetchClient { + constructor(private readonly options: FetchClientOptions = {}) {} + + public async fetch(url: string, options: FetchRequestOptions = {}): Promise { + const { method = 'GET', params, body, signal, throwOnError = true } = options + + // Reported to onResponse as-is, never response.url: the maintenance mode allow-list + // is matched against relative paths. + const requestUrl = this.appendParams(url, params) + const headers = this.buildHeaders(options.headers) + const payload = this.buildBody(body, headers) + + let response: Response + try { + response = await fetch(this.resolveUrl(requestUrl), { + method, + headers, + ...(payload !== undefined && { body: payload }), + ...(signal && { signal }) + }) + } catch (error) { + // An abort is a caller decision, not a transport failure: propagate it verbatim. + if (error?.name === 'AbortError') { + throw error + } + // Degrade a transport failure to 500 so maintenance detection still runs. + this.options.onResponse?.({ response: null, status: 500, requestUrl }) + throw new HttpError(error?.message || 'Network request failed', null, 500) + } + + this.options.onResponse?.({ response, status: response.status, requestUrl }) + + if (!response.ok && throwOnError) { + throw await this.buildError(response) + } + + return response + } + + public async request( + url: string, + options: FetchRequestOptions = {} + ): Promise> { + const response = await this.fetch(url, options) + + return { + data: (await this.readBody(response, options.responseType)) as T, + status: response.status, + statusText: response.statusText, + headers: response.headers + } + } + + private buildHeaders(perRequest?: Record): Headers { + return new Headers({ + ...(this.options.staticHeaders || {}), + ...(this.options.headers?.() || {}), + ...(perRequest || {}) + }) + } + + private buildBody(body: unknown, headers: Headers): BodyInit | undefined { + if (body === undefined || body === null) { + return undefined + } + if (isBodyInit(body)) { + return body + } + if (!headers.has('Content-Type')) { + headers.set('Content-Type', 'application/json') + } + return JSON.stringify(body) + } + + private async buildError(response: Response): Promise { + // Clone so that HttpError.response still exposes an unread body to callers. + const data = await this.readBodySafely(response.clone()) + return new HttpError( + response.statusText || `Request failed with status ${response.status}`, + response, + response.status, + data + ) + } + + private async readBodySafely(response: Response): Promise { + try { + const text = await response.text() + if (!text) { + return undefined + } + try { + return JSON.parse(text) + } catch { + return text + } + } catch { + return undefined + } + } + + private async readBody(response: Response, responseType: ResponseType = 'json') { + if (responseType === 'none' || response.status === 204) { + return undefined + } + + switch (responseType) { + case 'text': + return await response.text() + case 'blob': + return await response.blob() + case 'arraybuffer': + return await response.arrayBuffer() + default: { + const text = await response.text() + return text ? JSON.parse(text) : undefined + } + } + } + + private appendParams(url: string, params?: FetchRequestOptions['params']): string { + if (!params) { + return url + } + + const entries = Object.entries(params) + .filter(([, value]) => value !== undefined && value !== null) + .map(([key, value]) => [key, String(value)]) + + if (!entries.length) { + return url + } + + const search = new URLSearchParams(entries).toString() + return url.includes('?') ? `${url}&${search}` : `${url}?${search}` + } + + private resolveUrl(url: string): string { + const { baseUrl } = this.options + if (!baseUrl || hasScheme(url)) { + return url + } + return `${baseUrl.replace(/\/+$/, '')}/${url.replace(/^\/+/, '')}` + } +} diff --git a/web/packages/web-client/src/http/index.ts b/web/packages/web-client/src/http/index.ts new file mode 100644 index 00000000000..305a5ab3f6f --- /dev/null +++ b/web/packages/web-client/src/http/index.ts @@ -0,0 +1,2 @@ +export * from './fetchClient' +export * from './types' diff --git a/web/packages/web-client/src/http/types.ts b/web/packages/web-client/src/http/types.ts new file mode 100644 index 00000000000..6eca887c144 --- /dev/null +++ b/web/packages/web-client/src/http/types.ts @@ -0,0 +1,39 @@ +export type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'none' + +export interface OnResponseArgs { + /** null on a transport-level failure */ + response: Response | null + /** 500 on a transport-level failure */ + status: number + /** the URL exactly as the caller passed it, before any baseUrl join */ + requestUrl: string +} + +export interface FetchClientOptions { + baseUrl?: string + /** headers that never change for the lifetime of the client */ + staticHeaders?: Record + /** evaluated per request */ + headers?: () => Record + /** invoked for every outcome, before any throw */ + onResponse?: (args: OnResponseArgs) => void +} + +export interface FetchRequestOptions { + method?: string + headers?: Record + params?: Record + /** JSON-encoded unless it is already a BodyInit */ + body?: unknown + responseType?: ResponseType + signal?: AbortSignal + /** default true; false returns the envelope for non-2xx instead of throwing */ + throwOnError?: boolean +} + +export interface HttpResponse { + data: T + status: number + statusText: string + headers: Headers +} diff --git a/web/packages/web-client/src/index.ts b/web/packages/web-client/src/index.ts index e8038b8fe05..105ca8a2744 100644 --- a/web/packages/web-client/src/index.ts +++ b/web/packages/web-client/src/index.ts @@ -3,6 +3,7 @@ import { ocs } from './ocs' import { webdav } from './webdav' export * from './errors' +export * from './http' export * from './helpers' export * from './utils' export * from './constants' diff --git a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts new file mode 100644 index 00000000000..00b95ec23d8 --- /dev/null +++ b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts @@ -0,0 +1,311 @@ +import { FetchClient } from '../../../src/http' +import { HttpError } from '../../../src/errors' + +const jsonResponse = (body: unknown, init: ResponseInit = {}) => + new Response(JSON.stringify(body), { + status: 200, + headers: { 'Content-Type': 'application/json' }, + ...init + }) + +describe('FetchClient', () => { + let fetchMock: ReturnType + + beforeEach(() => { + fetchMock = vi.fn() + vi.stubGlobal('fetch', fetchMock) + }) + + const lastCall = () => fetchMock.mock.calls[0] + + describe('request envelope', () => { + it('returns data, status, statusText and native Headers', async () => { + fetchMock.mockResolvedValue(jsonResponse({ some: 'value' }, { statusText: 'OK' })) + + const result = await new FetchClient().request<{ some: string }>('https://host/foo') + + expect(result.data).toEqual({ some: 'value' }) + expect(result.status).toBe(200) + expect(result.statusText).toBe('OK') + expect(result.headers.get('Content-Type')).toBe('application/json') + }) + }) + + describe('trap 1: throws on non-2xx', () => { + it.each([400, 404, 500, 503])('throws HttpError for %i', async (status) => { + fetchMock.mockResolvedValue(new Response('{}', { status })) + + const client = new FetchClient() + await expect(client.request('https://host/foo')).rejects.toBeInstanceOf(HttpError) + }) + + it('sets statusCode, not status', async () => { + fetchMock.mockResolvedValue(new Response('{}', { status: 423 })) + + const error: HttpError = await new FetchClient() + .request('https://host/foo') + .catch((e) => e) + + expect(error.statusCode).toBe(423) + }) + + it('carries the parsed error body on data', async () => { + fetchMock.mockResolvedValue( + new Response(JSON.stringify({ error: { message: 'nope' } }), { status: 400 }) + ) + + const error: HttpError = await new FetchClient() + .request('https://host/foo') + .catch((e) => e) + + expect(error.data).toEqual({ error: { message: 'nope' } }) + }) + + it('does not fail the throw path on a non-JSON error body', async () => { + fetchMock.mockResolvedValue(new Response('gateway', { status: 502 })) + + const error: HttpError = await new FetchClient() + .request('https://host/foo') + .catch((e) => e) + + expect(error.statusCode).toBe(502) + expect(error.data).toBe('gateway') + }) + + it('returns the envelope instead of throwing when throwOnError is false', async () => { + fetchMock.mockResolvedValue(new Response('{}', { status: 404 })) + + const result = await new FetchClient().request('https://host/foo', { + throwOnError: false + }) + + expect(result.status).toBe(404) + }) + }) + + describe('onResponse hook', () => { + it('fires for a successful response', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + const onResponse = vi.fn() + + await new FetchClient({ onResponse }).request('https://host/foo') + + expect(onResponse).toHaveBeenCalledWith( + expect.objectContaining({ status: 200, requestUrl: 'https://host/foo' }) + ) + }) + + it('fires for a non-2xx response before the throw', async () => { + fetchMock.mockResolvedValue(new Response('{}', { status: 503 })) + const onResponse = vi.fn() + + await new FetchClient({ onResponse }).request('https://host/foo').catch(() => undefined) + + expect(onResponse).toHaveBeenCalledWith(expect.objectContaining({ status: 503 })) + }) + + it('trap 4: reports the caller URL, not the resolved response.url', async () => { + const relative = 'ocs/v2.php/apps/notifications/api/v1/notifications/sse' + fetchMock.mockResolvedValue(new Response('{}', { status: 503 })) + const onResponse = vi.fn() + + await new FetchClient({ baseUrl: 'https://host/', onResponse }) + .request(relative) + .catch(() => undefined) + + expect(onResponse).toHaveBeenCalledWith( + expect.objectContaining({ requestUrl: relative }) + ) + }) + + it('trap 5: reports a transport failure as status 500 with a null response, then throws', async () => { + fetchMock.mockRejectedValue(new TypeError('Failed to fetch')) + const onResponse = vi.fn() + + const error = await new FetchClient({ onResponse }) + .request('https://host/foo') + .catch((e) => e) + + expect(onResponse).toHaveBeenCalledWith({ + response: null, + status: 500, + requestUrl: 'https://host/foo' + }) + expect(error).toBeInstanceOf(HttpError) + expect(error.statusCode).toBe(500) + }) + + it('does not invoke onResponse when the request is aborted', async () => { + const abortError = new DOMException('aborted', 'AbortError') + fetchMock.mockRejectedValue(abortError) + const onResponse = vi.fn() + + await expect( + new FetchClient({ onResponse }).request('https://host/foo') + ).rejects.toBe(abortError) + expect(onResponse).not.toHaveBeenCalled() + }) + }) + + describe('url and params', () => { + it('joins a relative url onto baseUrl without doubling slashes', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient({ baseUrl: 'https://host/' }).request('/foo') + + expect(lastCall()[0]).toBe('https://host/foo') + }) + + it('leaves an absolute url untouched', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient({ baseUrl: 'https://host/' }).request('https://other/foo') + + expect(lastCall()[0]).toBe('https://other/foo') + }) + + it('serializes params', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient().request('https://host/foo', { params: { a: '1', b: 2 } }) + + expect(lastCall()[0]).toBe('https://host/foo?a=1&b=2') + }) + + it('appends params onto a url that already has a query', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient().request('https://host/foo?x=0', { params: { a: '1' } }) + + expect(lastCall()[0]).toBe('https://host/foo?x=0&a=1') + }) + + it('leaves the url unchanged for empty or absent params', async () => { + // a fresh Response per call: a body is single-use + fetchMock.mockImplementation(() => Promise.resolve(jsonResponse({}))) + const client = new FetchClient() + + await client.request('https://host/foo', { params: {} }) + expect(lastCall()[0]).toBe('https://host/foo') + + fetchMock.mockClear() + await client.request('https://host/foo') + expect(lastCall()[0]).toBe('https://host/foo') + }) + }) + + describe('body encoding', () => { + it('JSON-stringifies a plain object and sets Content-Type', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient().request('https://host/foo', { + method: 'POST', + body: { a: 1 } + }) + + const init = lastCall()[1] + expect(init.body).toBe('{"a":1}') + expect((init.headers as Headers).get('Content-Type')).toBe('application/json') + }) + + it('passes a BodyInit through untouched and sets no Content-Type', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + const form = new FormData() + + await new FetchClient().request('https://host/foo', { method: 'POST', body: form }) + + const init = lastCall()[1] + expect(init.body).toBe(form) + expect((init.headers as Headers).get('Content-Type')).toBeNull() + }) + }) + + describe('responseType', () => { + it('reads text', async () => { + fetchMock.mockResolvedValue(new Response('hello', { status: 200 })) + + const result = await new FetchClient().request('https://host/foo', { + responseType: 'text' + }) + + expect(result.data).toBe('hello') + }) + + it('reads blob', async () => { + fetchMock.mockResolvedValue(new Response('hello', { status: 200 })) + + const result = await new FetchClient().request('https://host/foo', { + responseType: 'blob' + }) + + expect(result.data).toBeInstanceOf(Blob) + }) + + it('reads arraybuffer', async () => { + fetchMock.mockResolvedValue(new Response('hello', { status: 200 })) + + const result = await new FetchClient().request('https://host/foo', { + responseType: 'arraybuffer' + }) + + expect(result.data).toBeInstanceOf(ArrayBuffer) + }) + + it('returns undefined for responseType none and for 204', async () => { + const client = new FetchClient() + + fetchMock.mockResolvedValue(new Response('ignored', { status: 200 })) + expect( + (await client.request('https://host/a', { responseType: 'none' })).data + ).toBeUndefined() + + fetchMock.mockResolvedValue(new Response(null, { status: 204 })) + expect((await client.request('https://host/b')).data).toBeUndefined() + }) + + it('returns undefined for an empty json body rather than throwing', async () => { + fetchMock.mockResolvedValue(new Response('', { status: 200 })) + + const result = await new FetchClient().request('https://host/foo') + + expect(result.data).toBeUndefined() + }) + }) + + describe('headers', () => { + it('applies staticHeaders, then headers(), then per-request headers', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient({ + staticHeaders: { 'X-Static': 'a', 'X-Shared': 'static' }, + headers: () => ({ 'X-Dynamic': 'b', 'X-Shared': 'dynamic' }) + }).request('https://host/foo', { headers: { 'X-Shared': 'request' } }) + + const headers = lastCall()[1].headers as Headers + expect(headers.get('X-Static')).toBe('a') + expect(headers.get('X-Dynamic')).toBe('b') + expect(headers.get('X-Shared')).toBe('request') + }) + + it('evaluates headers() on every request', async () => { + // a fresh Response per call: a body is single-use + fetchMock.mockImplementation(() => Promise.resolve(jsonResponse({}))) + const headers = vi.fn().mockReturnValue({}) + const client = new FetchClient({ headers }) + + await client.request('https://host/a') + await client.request('https://host/b') + + expect(headers).toHaveBeenCalledTimes(2) + }) + }) + + it('forwards the abort signal', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + const controller = new AbortController() + + await new FetchClient().request('https://host/foo', { signal: controller.signal }) + + expect(lastCall()[1].signal).toBe(controller.signal) + }) +}) From 1e57b04d6d47f74c53bcd030bd7c163642aebca3 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 09:31:02 +0200 Subject: [PATCH 02/19] test(web-test-helpers): replace axios mocks with fetch-shaped helpers --- .../web-test-helpers/src/mocks/axios.ts | 11 ------- .../src/mocks/httpResponse.ts | 33 +++++++++++++++++++ .../web-test-helpers/src/mocks/index.ts | 2 +- 3 files changed, 34 insertions(+), 12 deletions(-) delete mode 100644 web/packages/web-test-helpers/src/mocks/axios.ts create mode 100644 web/packages/web-test-helpers/src/mocks/httpResponse.ts diff --git a/web/packages/web-test-helpers/src/mocks/axios.ts b/web/packages/web-test-helpers/src/mocks/axios.ts deleted file mode 100644 index 80dd4f04238..00000000000 --- a/web/packages/web-test-helpers/src/mocks/axios.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AxiosPromise, AxiosResponse } from 'axios' -import { mock } from 'vitest-mock-extended' - -export const mockAxiosResolve = (data: T = {} as any): AxiosResponse => { - const response = mock({ data }) - return response -} - -export const mockAxiosReject = (message = ''): AxiosPromise => { - return Promise.reject(new Error(message)) -} diff --git a/web/packages/web-test-helpers/src/mocks/httpResponse.ts b/web/packages/web-test-helpers/src/mocks/httpResponse.ts new file mode 100644 index 00000000000..e9ea07140dd --- /dev/null +++ b/web/packages/web-test-helpers/src/mocks/httpResponse.ts @@ -0,0 +1,33 @@ +import { HttpError, type HttpResponse } from '@ownclouders/web-client' + +/** + * Builds the envelope HttpClient resolves with. Replaces mockAxiosResolve. + */ +export const mockHttpResponse = ( + data: T = {} as T, + { + status = 200, + statusText = 'OK', + headers = {} + }: { + status?: number + statusText?: string + headers?: Record + } = {} +): HttpResponse => ({ + data, + status, + statusText, + headers: new Headers(headers) +}) + +/** + * Builds a rejected promise carrying the HttpError the fetch core throws. + * Replaces mockAxiosReject. Note callers branch on `statusCode`, never `status`. + */ +export const mockHttpError = ( + status = 500, + data: unknown = undefined, + message = '' +): Promise => + Promise.reject(new HttpError(message, new Response(null, { status }), status, data)) diff --git a/web/packages/web-test-helpers/src/mocks/index.ts b/web/packages/web-test-helpers/src/mocks/index.ts index 0becd889271..3bd6ed888a4 100644 --- a/web/packages/web-test-helpers/src/mocks/index.ts +++ b/web/packages/web-test-helpers/src/mocks/index.ts @@ -1,6 +1,6 @@ -export * from './axios' export * from './defaultComponentMocks' export * from './defaultStubs' +export * from './httpResponse' export * from './pinia' export * from './useAppDefaultsMock' export * from './useGetMatchingSpaceMock' From a45d8420976d0b0088c04afebb785d2685c85707 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 09:38:29 +0200 Subject: [PATCH 03/19] refactor(web-pkg): build HttpClient on the fetch core --- web/packages/web-pkg/src/http/client.ts | 122 +++++------------- .../web-pkg/tests/unit/http/client.spec.ts | 61 +++++++-- 2 files changed, 80 insertions(+), 103 deletions(-) diff --git a/web/packages/web-pkg/src/http/client.ts b/web/packages/web-pkg/src/http/client.ts index 50e2ed7dbc5..2b1aed38bc7 100644 --- a/web/packages/web-pkg/src/http/client.ts +++ b/web/packages/web-pkg/src/http/client.ts @@ -1,78 +1,51 @@ -import axios, { - AxiosError, - AxiosInstance, - AxiosRequestConfig, - AxiosResponse, - CancelTokenSource, - InternalAxiosRequestConfig -} from 'axios' -import merge from 'lodash-es/merge' +import { + FetchClient, + type FetchClientOptions, + type FetchRequestOptions, + type HttpResponse +} from '@ownclouders/web-client' import { z } from 'zod' -export type RequestConfig = AxiosRequestConfig & { +export type RequestConfig = FetchRequestOptions & { schema?: S extends z.Schema ? S : never } -export class HttpClient { - private readonly instance: AxiosInstance - private readonly cancelToken: CancelTokenSource - - constructor({ - config, - requestInterceptor, - responseInterceptor - }: { - config?: AxiosRequestConfig - requestInterceptor?: ( - value: InternalAxiosRequestConfig - ) => InternalAxiosRequestConfig | Promise> - responseInterceptor?: [ - (response: AxiosResponse) => AxiosResponse | Promise>, - (error: AxiosError) => AxiosResponse | Promise> - ] - } = {}) { - this.cancelToken = axios.CancelToken.source() - this.instance = axios.create(config) - if (requestInterceptor) { - this.instance.interceptors.request.use(requestInterceptor) - } +type Resolved = HttpResponse : T> - if (responseInterceptor) { - this.instance.interceptors.response.use(responseInterceptor[0], responseInterceptor[1]) - } - } +export class HttpClient { + private readonly client: FetchClient - public cancel(msg?: string): void { - this.cancelToken.cancel(msg) + constructor(options: FetchClientOptions = {}) { + this.client = new FetchClient(options) } - public async delete( + public delete( url: string, data?: D, config?: RequestConfig ) { - return await this.internalRequestWithData('delete', url, data, config) + return this.send(url, { ...config, method: 'DELETE', body: data }) } public get( url: string, config?: RequestConfig ) { - return this.internalRequest('get', url, config) + return this.send(url, { ...config, method: 'GET' }) } public head( url: string, config?: RequestConfig ) { - return this.internalRequest('head', url, config) + return this.send(url, { ...config, method: 'HEAD' }) } public options( url: string, config?: RequestConfig ) { - return this.internalRequest('options', url, config) + return this.send(url, { ...config, method: 'OPTIONS' }) } public patch( @@ -80,7 +53,7 @@ export class HttpClient { data?: D, config?: RequestConfig ) { - return this.internalRequestWithData('patch', url, data, config) + return this.send(url, { ...config, method: 'PATCH', body: data }) } public post( @@ -88,7 +61,7 @@ export class HttpClient { data?: D, config?: RequestConfig ) { - return this.internalRequestWithData('post', url, data, config) + return this.send(url, { ...config, method: 'POST', body: data }) } public put( @@ -96,57 +69,26 @@ export class HttpClient { data?: D, config?: RequestConfig ) { - return this.internalRequestWithData('put', url, data, config) + return this.send(url, { ...config, method: 'PUT', body: data }) } - public async request(config: RequestConfig) { - const response = await this.instance.request, D>( - this.obtainConfig(config) - ) - return this.processResponse(response, config) + public request( + config: RequestConfig & { url?: string; method?: string } + ) { + const { url = '', ...rest } = config + return this.send(url, rest) } - private obtainConfig(config?: AxiosRequestConfig): AxiosRequestConfig { - return merge({ cancelToken: this.cancelToken.token }, config) - } + private async send( + url: string, + config: RequestConfig + ): Promise> { + const response = await this.client.request(url, config) - private processResponse( - response: AxiosResponse, - config?: RequestConfig - ): AxiosResponse : T> { if (config?.schema) { - const data = config.schema.parse(response.data) - return { ...response, data } as AxiosResponse : T> + return { ...response, data: config.schema.parse(response.data) } as Resolved } - return response as AxiosResponse : T> - } - - private async internalRequest( - method: 'delete' | 'get' | 'head' | 'options', - url: string, - config: RequestConfig - ) { - const response = await this.instance[method], D>( - url, - this.obtainConfig(config) - ) - - return this.processResponse(response, config) - } - - private async internalRequestWithData( - method: 'post' | 'put' | 'patch' | 'delete', - url: string, - data: D, - config: RequestConfig - ) { - const response = await this.instance[method], D>( - url, - data, - this.obtainConfig(config) - ) - - return this.processResponse(response, config) + return response as Resolved } } diff --git a/web/packages/web-pkg/tests/unit/http/client.spec.ts b/web/packages/web-pkg/tests/unit/http/client.spec.ts index af5697d4622..c1ae6cd0a2b 100644 --- a/web/packages/web-pkg/tests/unit/http/client.spec.ts +++ b/web/packages/web-pkg/tests/unit/http/client.spec.ts @@ -1,7 +1,6 @@ import { HttpClient } from '../../../src/http' import { z } from 'zod' -import { mock, mockDeep } from 'vitest-mock-extended' -import axios, { AxiosInstance } from 'axios' +import { mock } from 'vitest-mock-extended' const schema = z.object({ someProperty: z.string() @@ -10,8 +9,18 @@ const schema = z.object({ type Schema = z.infer describe('HttpClient', () => { - const mockAxios = mockDeep() - vi.spyOn(axios, 'create').mockReturnValue(mockAxios) + let fetchMock: ReturnType + + beforeEach(() => { + fetchMock = vi + .fn() + .mockImplementation(() => + Promise.resolve( + new Response('{}', { status: 200, headers: { 'Content-Type': 'application/json' } }) + ) + ) + vi.stubGlobal('fetch', fetchMock) + }) test('types', async () => { const fn = vi.fn().mockReturnValue({ data: {} }) @@ -125,17 +134,43 @@ describe('HttpClient', () => { } expect(true).toBe(true) }) - test.each(['delete', 'get', 'head', 'options', 'patch', 'post', 'put'] as const)('%s', (m) => { + test.each([ + ['delete', 'DELETE'], + ['get', 'GET'], + ['head', 'HEAD'], + ['options', 'OPTIONS'], + ['patch', 'PATCH'], + ['post', 'POST'], + ['put', 'PUT'] + ] as const)('%s issues a %s request', async (method, verb) => { const client = new HttpClient() - client[m]('url') - mockAxios[m].mockResolvedValue({ data: undefined }) - expect(mockAxios[m]).toHaveBeenCalledTimes(1) + await client[method]('https://host/url') + + expect(fetchMock).toHaveBeenCalledTimes(1) + expect(fetchMock.mock.calls[0][1].method).toBe(verb) }) - test('request', () => { - const client = new HttpClient() - client.request({ method: 'get' }) - mockAxios.get.mockResolvedValue({ data: undefined }) - expect(mockAxios.request).toHaveBeenCalledTimes(1) + test('request takes url and method from the config', async () => { + await new HttpClient().request({ url: 'https://host/url', method: 'GET' }) + + expect(fetchMock).toHaveBeenCalledTimes(1) + expect(fetchMock.mock.calls[0][0]).toBe('https://host/url') + expect(fetchMock.mock.calls[0][1].method).toBe('GET') + }) + + test('applies a zod schema to the response data', async () => { + fetchMock.mockImplementation(() => + Promise.resolve(new Response(JSON.stringify({ someProperty: 'value' }), { status: 200 })) + ) + + const { data } = await new HttpClient().get('https://host/url', { schema }) + + expect(data.someProperty).toBe('value') + }) + + test('baseUrl is applied to relative urls', async () => { + await new HttpClient({ baseUrl: 'https://host/' }).get('some/path') + + expect(fetchMock.mock.calls[0][0]).toBe('https://host/some/path') }) }) From b97898574ac873f11a19f2c24ce8b9f8898a7a17 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 09:53:21 +0200 Subject: [PATCH 04/19] refactor(web-pkg): unify ClientService interceptors on the fetch core --- .../web-pkg/src/services/client/client.ts | 80 ++++++------- .../services/client-maintenance-mode.spec.ts | 112 ++++++++---------- .../tests/unit/services/client.spec.ts | 44 +++---- 3 files changed, 102 insertions(+), 134 deletions(-) diff --git a/web/packages/web-pkg/src/services/client/client.ts b/web/packages/web-pkg/src/services/client/client.ts index 1f62beaafbd..31ca1ca3567 100644 --- a/web/packages/web-pkg/src/services/client/client.ts +++ b/web/packages/web-pkg/src/services/client/client.ts @@ -3,7 +3,7 @@ import { graph, ocs, webdav } from '@ownclouders/web-client' import { Graph } from '@ownclouders/web-client/graph' import { OCS } from '@ownclouders/web-client/ocs' import { AuthParameters } from './auth' -import axios, { AxiosInstance, AxiosResponse } from 'axios' +import { FetchClient, type OnResponseArgs } from '@ownclouders/web-client' import { v4 as uuidV4 } from 'uuid' import { WebDAV } from '@ownclouders/web-client/webdav' import { Language } from 'vue3-gettext' @@ -38,7 +38,7 @@ export class ClientService { private httpUnAuthenticatedClient: HttpClient private graphClient: Graph - private graphAxiosClient: AxiosInstance + private graphHttpClient: FetchClient private ocsClient: OCS private webDavClient: WebDAV @@ -60,19 +60,16 @@ export class ClientService { this.initWebDavClient() this.httpAuthenticatedClient = new HttpClient({ - config: { baseURL: this.configStore.serverUrl, headers: this.staticHeaders }, - requestInterceptor: (config) => { - Object.assign(config.headers, this.getDynamicHeaders()) - return config - } + baseUrl: this.configStore.serverUrl, + staticHeaders: this.staticHeaders, + headers: () => this.getDynamicHeaders(), + onResponse: (args) => this.handleResponse(args) }) this.httpUnAuthenticatedClient = new HttpClient({ - config: { baseURL: this.configStore.serverUrl, headers: this.staticHeaders }, - requestInterceptor: (config) => { - Object.assign(config.headers, this.getDynamicHeaders({ useAuth: false })) - return config - }, - responseInterceptor: [this.#handleAxiosResponse.bind(this), this.#handleAxiosError.bind(this)] + baseUrl: this.configStore.serverUrl, + staticHeaders: this.staticHeaders, + headers: () => this.getDynamicHeaders({ useAuth: false }), + onResponse: (args) => this.handleResponse(args) }) } @@ -116,41 +113,31 @@ export class ClientService { } private initGraphClient(isInVault: boolean) { - if (!this.graphAxiosClient) { - const axiosClient = axios.create({ headers: this.staticHeaders }) - axiosClient.interceptors.request.use((config) => { - Object.assign(config.headers, this.getDynamicHeaders()) - return config + if (!this.graphHttpClient) { + this.graphHttpClient = new FetchClient({ + staticHeaders: this.staticHeaders, + headers: () => this.getDynamicHeaders(), + onResponse: (args) => this.handleResponse(args) }) - axiosClient.interceptors.response.use( - this.#handleAxiosResponse.bind(this), - this.#handleAxiosError.bind(this) - ) - this.graphAxiosClient = axiosClient } this.graphClient = graph( isInVault ? `${this.configStore.serverUrl}vault` : this.configStore.serverUrl, - this.graphAxiosClient + this.graphHttpClient ) } private initOcsClient(isInVault: boolean) { - const axiosClient = axios.create({ headers: this.staticHeaders }) - axiosClient.interceptors.request.use((config) => { - Object.assign(config.headers, this.getDynamicHeaders()) - return config + const httpClient = new FetchClient({ + staticHeaders: this.staticHeaders, + headers: () => this.getDynamicHeaders(), + onResponse: (args) => this.handleResponse(args) }) - axiosClient.interceptors.response.use( - this.#handleAxiosResponse.bind(this), - this.#handleAxiosError.bind(this) - ) - const baseUrl = isInVault ? `${this.configStore.serverUrl}?vault=true` : this.configStore.serverUrl - this.ocsClient = ocs(baseUrl, axiosClient) + this.ocsClient = ocs(baseUrl, httpClient) } private initWebDavClient() { @@ -191,21 +178,24 @@ export class ClientService { } } - #handleAxiosResponse(response: AxiosResponse) { - if (response.status !== 503) { + /** + * Replaces the former pair of axios response interceptors. The asymmetry is deliberate + * and matches the previous behaviour: only a successful response clears maintenance + * mode, and a non-2xx response never clears it. + * + * `args.requestUrl` is the caller's URL, not `response.url` — the maintenance + * allow-list is matched against relative paths. `args.status` is 500 when the transport + * failed and there is no response at all. + */ + public handleResponse({ response, status, requestUrl }: OnResponseArgs): void { + if (response?.ok) { this.configStore.setMaintenanceMode(false) + this.lastSuccessfulRequestTime = Math.floor(Date.now() / 1000) + return } - this.lastSuccessfulRequestTime = Math.floor(Date.now() / 1000) - - return response - } - - #handleAxiosError(error: any) { - if (shouldResponseTriggerMaintenance(error.response?.status || 500, error.config.url)) { + if (shouldResponseTriggerMaintenance(status, requestUrl)) { this.configStore.setMaintenanceMode(true) } - - return Promise.reject(error) } } diff --git a/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts b/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts index cbdfa47c7c7..5fa49ea4d53 100644 --- a/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts +++ b/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts @@ -1,9 +1,8 @@ import { ClientService, useAuthStore, useConfigStore } from '../../../src/' import { Language } from 'vue3-gettext' import { createTestingPinia, writable } from '@ownclouders/web-test-helpers' -import { AxiosError, AxiosResponse } from 'axios' import { shouldResponseTriggerMaintenance } from '@ownclouders/web-client' -import { mock } from 'vitest-mock-extended' +import type { OnResponseArgs } from '@ownclouders/web-client' vi.mock('@ownclouders/web-client', async (importOriginal) => ({ ...(await importOriginal()), @@ -13,99 +12,88 @@ vi.mock('@ownclouders/web-client', async (importOriginal) => ({ shouldResponseTriggerMaintenance: vi.fn() })) -let responseSuccessInterceptorFn: (response: AxiosResponse) => AxiosResponse -let responseErrorInterceptorFn: (error: AxiosError) => Promise - -vi.mock('axios', () => { - return { - default: { - create: vi.fn().mockReturnValue({ - interceptors: { - response: { - use: vi.fn().mockImplementation((successFn, errorFn) => { - responseSuccessInterceptorFn = successFn - responseErrorInterceptorFn = errorFn - }) - }, - request: { use: vi.fn() } - } - }), - CancelToken: { source: vi.fn() } - } - } -}) - describe('ClientService maintenance mode', () => { const language = { current: 'en' } const serverUrl = 'someUrl' let configStore: ReturnType let authStore: ReturnType + let onResponse: (args: OnResponseArgs) => void beforeEach(() => { createTestingPinia({ initialState: { auth: { accessToken: 'token' } } }) - vi.mocked(shouldResponseTriggerMaintenance).mockReset() + vi.stubGlobal('fetch', vi.fn()) authStore = useAuthStore() configStore = useConfigStore() writable(configStore).serverUrl = serverUrl configStore.setMaintenanceMode = vi.fn() - new ClientService({ + const service = new ClientService({ configStore, language: language as Language, authStore }) - }) - describe('handling axios responses', () => { - it('should turn off maintenance mode for successful responses', () => { - const response = mock({ - status: 200, - data: { some: 'data' } - }) + onResponse = service.handleResponse.bind(service) + }) - responseSuccessInterceptorFn(response) - expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(false) + it('clears maintenance mode and records the time for a successful response', () => { + onResponse({ + response: new Response('{}', { status: 200 }), + status: 200, + requestUrl: 'some/url' }) - it('should not turn off maintenance mode for 503 responses', () => { - const response = mock({ - status: 503, - data: { error: 'Service Unavailable' } - }) + expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(false) + }) + + it('sets maintenance mode when shouldResponseTriggerMaintenance returns true', () => { + vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(true) - responseSuccessInterceptorFn(response) - expect(configStore.setMaintenanceMode).not.toHaveBeenCalledWith(false) + onResponse({ + response: new Response('{}', { status: 503 }), + status: 503, + requestUrl: 'some/url' }) - }) - describe('handling axios errors', () => { - it('should turn on maintenance mode when shouldResponseTriggerMaintenance returns true', () => { - vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(true) + expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(503, 'some/url') + expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(true) + }) - const error = mock({ - response: { status: 503 }, - config: { url: 'some/url' } - }) + it('leaves maintenance state untouched for a 404', () => { + vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(false) - expect(responseErrorInterceptorFn(error)).rejects.toEqual(error) - expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(503, 'some/url') - expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(true) + onResponse({ + response: new Response('{}', { status: 404 }), + status: 404, + requestUrl: 'some/url' }) - it('should not turn on maintenance mode when shouldResponseTriggerMaintenance returns false', () => { - vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(false) + expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(404, 'some/url') + expect(configStore.setMaintenanceMode).not.toHaveBeenCalled() + }) + + it('trap 5: treats a transport failure as 503-eligible via status 500', () => { + vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(true) - const error = mock({ - response: { status: 404 }, - config: { url: 'some/url' } - }) + onResponse({ response: null, status: 500, requestUrl: 'some/url' }) - expect(responseErrorInterceptorFn(error)).rejects.toEqual(error) - expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(404, 'some/url') - expect(configStore.setMaintenanceMode).not.toHaveBeenCalled() + expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(500, 'some/url') + expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(true) + }) + + it('trap 4: forwards the relative request url to the maintenance check', () => { + vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(false) + const sseUrl = 'ocs/v2.php/apps/notifications/api/v1/notifications/sse' + + onResponse({ + response: new Response('{}', { status: 503 }), + status: 503, + requestUrl: sseUrl }) + + expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(503, sseUrl) }) }) diff --git a/web/packages/web-pkg/tests/unit/services/client.spec.ts b/web/packages/web-pkg/tests/unit/services/client.spec.ts index f1b02b4d0ed..a3e78e0a8ee 100644 --- a/web/packages/web-pkg/tests/unit/services/client.spec.ts +++ b/web/packages/web-pkg/tests/unit/services/client.spec.ts @@ -6,7 +6,7 @@ import { Graph } from '@ownclouders/web-client/graph' import { OCS } from '@ownclouders/web-client/ocs' import { WebDAV } from '@ownclouders/web-client/webdav' import { createTestingPinia, writable } from '@ownclouders/web-test-helpers' -import axios from 'axios' +import { FetchClient } from '@ownclouders/web-client' import { mock } from 'vitest-mock-extended' const language = { current: 'en' } @@ -41,18 +41,16 @@ describe('ClientService', () => { const clientService = getClientServiceMock() expect(clientService.httpAuthenticated).toBeInstanceOf(HttpClient) }) - it('initializes the http client with baseURL and static headers', () => { + it('initializes the http client with baseUrl and static headers', () => { vi.mock('../../../src/http') const mocky = vi.mocked(HttpClient) getClientServiceMock() expect(mocky).toHaveBeenCalledWith({ - config: { - baseURL: serverUrl, - headers: { 'Initiator-ID': v4uuid, 'X-Requested-With': 'XMLHttpRequest' } - }, - requestInterceptor: expect.anything(), - responseInterceptor: expect.anything() + baseUrl: serverUrl, + staticHeaders: { 'Initiator-ID': v4uuid, 'X-Requested-With': 'XMLHttpRequest' }, + headers: expect.any(Function), + onResponse: expect.any(Function) }) }) }) @@ -61,44 +59,36 @@ describe('ClientService', () => { const clientService = getClientServiceMock() expect(clientService.httpUnAuthenticated).toBeInstanceOf(HttpClient) }) - it('initializes the http client with baseURL and static headers', () => { + it('initializes the http client with baseUrl and static headers', () => { vi.mock('../../../src/http') const mocky = vi.mocked(HttpClient) getClientServiceMock() expect(mocky).toHaveBeenCalledWith({ - config: { - baseURL: serverUrl, - headers: { 'Initiator-ID': v4uuid, 'X-Requested-With': 'XMLHttpRequest' } - }, - requestInterceptor: expect.anything(), - responseInterceptor: expect.anything() + baseUrl: serverUrl, + staticHeaders: { 'Initiator-ID': v4uuid, 'X-Requested-With': 'XMLHttpRequest' }, + headers: expect.any(Function), + onResponse: expect.any(Function) }) }) }) describe('graph', () => { - it('initializes an axios client with static headers', () => { + it('initializes a fetch client with static headers', () => { const graphMock = mock() const graphSpy = vi.mocked(graph).mockReturnValue(graphMock) - const createSpy = vi.spyOn(axios, 'create') const clientService = getClientServiceMock() - expect(createSpy).toHaveBeenCalledWith({ - headers: { 'Initiator-ID': v4uuid, 'X-Requested-With': 'XMLHttpRequest' } - }) - expect(graphSpy).toHaveBeenCalledWith(serverUrl, expect.anything()) + + expect(graphSpy).toHaveBeenCalledWith(serverUrl, expect.any(FetchClient)) expect(clientService.graphAuthenticated).toEqual(graphMock) }) }) describe('ocs', () => { - it('initializes an axios client with static headers', () => { + it('initializes a fetch client with static headers', () => { const ocsMock = mock() const ocsSpy = vi.mocked(ocs).mockReturnValue(ocsMock) - const createSpy = vi.spyOn(axios, 'create') const clientService = getClientServiceMock() - expect(createSpy).toHaveBeenCalledWith({ - headers: { 'Initiator-ID': v4uuid, 'X-Requested-With': 'XMLHttpRequest' } - }) - expect(ocsSpy).toHaveBeenCalledWith(serverUrl, expect.anything()) + + expect(ocsSpy).toHaveBeenCalledWith(serverUrl, expect.any(FetchClient)) expect(clientService.ocs).toEqual(ocsMock) }) }) From 23b69e7fa73b639df98e97c32beb368fd98136be Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 09:54:29 +0200 Subject: [PATCH 05/19] refactor(web-pkg): drop axios types from useRequest --- web/packages/web-app-external/src/App.vue | 2 +- .../src/composables/authContext/useRequest.ts | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/web/packages/web-app-external/src/App.vue b/web/packages/web-app-external/src/App.vue index e0951946be1..283f7ec4c2f 100644 --- a/web/packages/web-app-external/src/App.vue +++ b/web/packages/web-app-external/src/App.vue @@ -292,7 +292,7 @@ const loadAppUrl = useTask(function* (signal, viewMode: string) { const url = `${baseUrl}?${query}` const response = yield makeRequest('POST', url, { - validateStatus: () => true, + throwOnError: false, signal }) diff --git a/web/packages/web-pkg/src/composables/authContext/useRequest.ts b/web/packages/web-pkg/src/composables/authContext/useRequest.ts index fc6069d3935..39dc6faffa3 100644 --- a/web/packages/web-pkg/src/composables/authContext/useRequest.ts +++ b/web/packages/web-pkg/src/composables/authContext/useRequest.ts @@ -1,6 +1,7 @@ import { useClientService } from '../clientService' import type { Router, RouteLocationNormalizedLoaded } from 'vue-router' -import type { Method, AxiosRequestConfig, AxiosResponse } from 'axios' +import type { HttpResponse } from '@ownclouders/web-client' +import type { RequestConfig } from '../../http' import { ClientService } from '../../services' import { AuthStore, useAuthStore } from '../piniaStores' @@ -12,7 +13,7 @@ interface RequestOptions { } export interface RequestResult { - makeRequest(method: Method, url: string, config?: AxiosRequestConfig): Promise + makeRequest(method: string, url: string, config?: RequestConfig): Promise } export function useRequest(options: RequestOptions = {}): RequestResult { @@ -20,10 +21,10 @@ export function useRequest(options: RequestOptions = {}): RequestResult { const authStore = options.authStore ?? useAuthStore() const makeRequest = ( - method: Method, + method: string, url: string, - config: AxiosRequestConfig = {} - ): Promise => { + config: RequestConfig = {} + ): Promise => { const httpClient = authStore.accessToken ? clientService.httpAuthenticated : clientService.httpUnAuthenticated @@ -41,10 +42,7 @@ export function useRequest(options: RequestOptions = {}): RequestResult { } } - config.method = method - config.url = url - - return httpClient.request(config) + return httpClient.request({ ...config, method, url }) } return { From f0017ed5c2e11fe084086f96e51106521e36a549 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 10:05:44 +0200 Subject: [PATCH 06/19] fix(web): align error and header access with the fetch core --- .../Groups/CreateGroupModal.spec.ts | 8 +++---- .../Groups/SideBar/EditPanel.spec.ts | 4 ++-- .../components/Users/CreateUserModal.spec.ts | 6 ++--- .../Users/SideBar/EditPanel.spec.ts | 4 ++-- .../useGeneralActionsResetLogo.spec.ts | 4 ++-- .../useGeneralActionsUploadLogo.spec.ts | 8 +++---- .../Modals/SetLinkPasswordModal.vue | 4 ++-- .../tests/unit/helpers/user/avatarUrl.spec.ts | 14 ++++------- .../web-app-webfinger/src/views/Resolve.vue | 2 +- .../components/AppTemplates/AppWrapper.vue | 2 +- .../src/components/CreateLinkModal.vue | 4 ++-- .../src/services/preview/previewService.ts | 8 +++---- .../components/CreateShortcutModal.spec.ts | 6 ++--- .../tests/unit/services/archiver.spec.ts | 8 +++---- .../unit/services/previewService.spec.ts | 23 +++++++++---------- .../src/components/Topbar/Notifications.vue | 3 +-- .../maintenanceMode/useMaintenanceMode.ts | 2 +- .../src/services/auth/userManager.ts | 2 +- .../web-runtime/tests/unit/App.spec.ts | 10 +++++--- .../tests/unit/components/Avatar.spec.ts | 17 +++++++------- .../components/Topbar/Notifications.spec.ts | 10 +++++--- .../tests/unit/pages/account.spec.ts | 18 +++++++-------- 22 files changed, 83 insertions(+), 84 deletions(-) diff --git a/web/packages/web-app-admin-settings/tests/unit/components/Groups/CreateGroupModal.spec.ts b/web/packages/web-app-admin-settings/tests/unit/components/Groups/CreateGroupModal.spec.ts index 735ddf9fa56..e080724532f 100644 --- a/web/packages/web-app-admin-settings/tests/unit/components/Groups/CreateGroupModal.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/components/Groups/CreateGroupModal.spec.ts @@ -2,8 +2,8 @@ import CreateGroupModal from '../../../../src/components/Groups/CreateGroupModal import { defaultComponentMocks, defaultPlugins, - mockAxiosReject, - mockAxiosResolve, + mockHttpError, + mockHttpResponse, shallowMount } from '@ownclouders/web-test-helpers' import { mock } from 'vitest-mock-extended' @@ -50,7 +50,7 @@ describe('CreateGroupModal', () => { it('should be true when displayName is valid', async () => { const { wrapper, mocks } = getWrapper() const graphMock = mocks.$clientService.graphAuthenticated - const getGroupSub = graphMock.groups.getGroup.mockRejectedValue(() => mockAxiosReject()) + const getGroupSub = graphMock.groups.getGroup.mockRejectedValue(() => mockHttpError()) wrapper.vm.group.displayName = 'users' expect(await wrapper.vm.validateDisplayName()).toBeTruthy() expect(getGroupSub).toHaveBeenCalled() @@ -99,7 +99,7 @@ describe('CreateGroupModal', () => { await wrapper.vm.validateDisplayName() mocks.$clientService.graphAuthenticated.groups.createGroup.mockRejectedValue( - mockAxiosResolve({ id: 'e3515ffb-d264-4dfc-8506-6c239f6673b5' }) + mockHttpResponse({ id: 'e3515ffb-d264-4dfc-8506-6c239f6673b5' }) ) await wrapper.vm.onConfirm() diff --git a/web/packages/web-app-admin-settings/tests/unit/components/Groups/SideBar/EditPanel.spec.ts b/web/packages/web-app-admin-settings/tests/unit/components/Groups/SideBar/EditPanel.spec.ts index 97c6e9c1330..b9496f0d515 100644 --- a/web/packages/web-app-admin-settings/tests/unit/components/Groups/SideBar/EditPanel.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/components/Groups/SideBar/EditPanel.spec.ts @@ -2,7 +2,7 @@ import EditPanel from '../../../../../src/components/Groups/SideBar/EditPanel.vu import { defaultComponentMocks, defaultPlugins, - mockAxiosReject, + mockHttpError, mount } from '@ownclouders/web-test-helpers' import { mock } from 'vitest-mock-extended' @@ -37,7 +37,7 @@ describe('EditPanel', () => { const { wrapper, mocks } = getWrapper() ;(wrapper.vm as any).editGroup.displayName = 'users' const graphMock = mocks.$clientService.graphAuthenticated - const getGroupStub = graphMock.groups.getGroup.mockRejectedValue(() => mockAxiosReject()) + const getGroupStub = graphMock.groups.getGroup.mockRejectedValue(() => mockHttpError()) expect(await (wrapper.vm as any).validateDisplayName()).toBeTruthy() expect(getGroupStub).toHaveBeenCalled() }) diff --git a/web/packages/web-app-admin-settings/tests/unit/components/Users/CreateUserModal.spec.ts b/web/packages/web-app-admin-settings/tests/unit/components/Users/CreateUserModal.spec.ts index 96e621549f5..7928c3a5520 100644 --- a/web/packages/web-app-admin-settings/tests/unit/components/Users/CreateUserModal.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/components/Users/CreateUserModal.spec.ts @@ -2,7 +2,7 @@ import CreateUserModal from '../../../../src/components/Users/CreateUserModal.vu import { defaultComponentMocks, defaultPlugins, - mockAxiosReject, + mockHttpError, shallowMount } from '@ownclouders/web-test-helpers' import { mock } from 'vitest-mock-extended' @@ -60,7 +60,7 @@ describe('CreateUserModal', () => { it('should be true when userName is valid', async () => { const { wrapper, mocks } = getWrapper() const graphMock = mocks.$clientService.graphAuthenticated - const getUserStub = graphMock.users.getUser.mockRejectedValue(() => mockAxiosReject()) + const getUserStub = graphMock.users.getUser.mockRejectedValue(() => mockHttpError()) ;(wrapper.vm as any).user.onPremisesSamAccountName = 'jana' expect(await (wrapper.vm as any).validateUserName()).toBeTruthy() expect(getUserStub).toHaveBeenCalled() @@ -68,7 +68,7 @@ describe('CreateUserModal', () => { it('should be true when userName is an email address', async () => { const { wrapper, mocks } = getWrapper() const graphMock = mocks.$clientService.graphAuthenticated - const getUserStub = graphMock.users.getUser.mockRejectedValue(() => mockAxiosReject()) + const getUserStub = graphMock.users.getUser.mockRejectedValue(() => mockHttpError()) ;(wrapper.vm as any).user.onPremisesSamAccountName = 'sk@domain.tld' expect(await (wrapper.vm as any).validateUserName()).toBeTruthy() expect(getUserStub).toHaveBeenCalled() diff --git a/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts b/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts index 065afe91543..53a67222b18 100644 --- a/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts @@ -2,7 +2,7 @@ import EditPanel from '../../../../../src/components/Users/SideBar/EditPanel.vue import { defaultComponentMocks, defaultPlugins, - mockAxiosReject, + mockHttpError, shallowMount } from '@ownclouders/web-test-helpers' import { mock } from 'vitest-mock-extended' @@ -101,7 +101,7 @@ describe('EditPanel', () => { it('should be true when userName is valid', async () => { const { wrapper, mocks } = getWrapper() const graphMock = mocks.$clientService.graphAuthenticated - const getUserStub = graphMock.users.getUser.mockRejectedValue(() => mockAxiosReject()) + const getUserStub = graphMock.users.getUser.mockRejectedValue(() => mockHttpError()) ;(wrapper.vm as any).editUser.onPremisesSamAccountName = 'jana' expect(await (wrapper.vm as any).validateUserName()).toBeTruthy() expect(getUserStub).toHaveBeenCalled() diff --git a/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsResetLogo.spec.ts b/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsResetLogo.spec.ts index d63d696ff80..4a9632b8c62 100644 --- a/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsResetLogo.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsResetLogo.spec.ts @@ -5,7 +5,7 @@ import { unref } from 'vue' import { defaultComponentMocks, RouteLocation, - mockAxiosResolve, + mockHttpResponse, getComposableWrapper } from '@ownclouders/web-test-helpers' @@ -22,7 +22,7 @@ describe('resetLogo', () => { it('should show message on request success', () => { getWrapper({ setup: async ({ actions }, { clientService, router }) => { - clientService.httpAuthenticated.delete.mockResolvedValue(mockAxiosResolve()) + clientService.httpAuthenticated.delete.mockResolvedValue(mockHttpResponse()) await unref(actions)[0].handler() vi.runAllTimers() expect(router.go).toHaveBeenCalledTimes(1) diff --git a/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsUploadLogo.spec.ts b/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsUploadLogo.spec.ts index 53da95c997b..2a9ff90a1bd 100644 --- a/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsUploadLogo.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/composables/actions/general/useGeneralActionsUploadLogo.spec.ts @@ -5,8 +5,8 @@ import { VNodeRef } from 'vue' import { defaultComponentMocks, RouteLocation, - mockAxiosResolve, - mockAxiosReject, + mockHttpResponse, + mockHttpError, getComposableWrapper } from '@ownclouders/web-test-helpers' @@ -23,7 +23,7 @@ describe('uploadImage', () => { it('should show message on request success', () => { getWrapper({ setup: async ({ uploadImage }, { clientService, router }) => { - clientService.httpAuthenticated.post.mockResolvedValue(mockAxiosResolve()) + clientService.httpAuthenticated.post.mockResolvedValue(mockHttpResponse()) await uploadImage({ currentTarget: { files: [{ name: 'image.png', type: 'image/png' }] @@ -41,7 +41,7 @@ describe('uploadImage', () => { vi.spyOn(console, 'error').mockImplementation(() => undefined) getWrapper({ setup: async ({ uploadImage }, { clientService, router }) => { - clientService.httpAuthenticated.post.mockRejectedValue(() => mockAxiosReject()) + clientService.httpAuthenticated.post.mockRejectedValue(() => mockHttpError()) await uploadImage({ currentTarget: { files: [{ name: 'image.png', type: 'image/png' }] diff --git a/web/packages/web-app-files/src/components/Modals/SetLinkPasswordModal.vue b/web/packages/web-app-files/src/components/Modals/SetLinkPasswordModal.vue index 300fbca703c..f5907c5ba83 100644 --- a/web/packages/web-app-files/src/components/Modals/SetLinkPasswordModal.vue +++ b/web/packages/web-app-files/src/components/Modals/SetLinkPasswordModal.vue @@ -72,8 +72,8 @@ const onConfirm = async () => { showMessage({ title: $gettext('Link was updated successfully') }) } catch (e) { // Human-readable error message is provided, for example when password is on banned list - if (e.response?.status === 400) { - const errorMsg = e.response.data.error.message + if (e.statusCode === 400) { + const errorMsg = (e.data as any).error.message errorMessage.value = $gettext(upperFirst(errorMsg)) return Promise.reject() } diff --git a/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts b/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts index 31c4b44be61..9f37529e5f9 100644 --- a/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts +++ b/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts @@ -2,7 +2,7 @@ import { avatarUrl } from '../../../../src/helpers/user' import { ImageDimension } from '@ownclouders/web-pkg' import { ClientService } from '@ownclouders/web-pkg' import { mockDeep } from 'vitest-mock-extended' -import { AxiosResponse } from 'axios' +import { mockHttpResponse } from '@ownclouders/web-test-helpers' const getDefaultOptions = () => ({ clientService: mockDeep(), @@ -14,9 +14,7 @@ const getDefaultOptions = () => ({ describe('avatarUrl', () => { it('throws an error', async () => { const defaultOptions = getDefaultOptions() - defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue({ - status: 200 - } as AxiosResponse) + defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue(mockHttpResponse({}, { status: 200 })) defaultOptions.clientService.ocs.signUrl.mockRejectedValue(new Error('error')) const avatarUrlPromise = avatarUrl(defaultOptions) await expect(avatarUrlPromise).rejects.toThrow(new Error('error')) @@ -26,9 +24,7 @@ describe('avatarUrl', () => { }) it('returns a signed url', async () => { const defaultOptions = getDefaultOptions() - defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue({ - status: 200 - } as AxiosResponse) + defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue(mockHttpResponse({}, { status: 200 })) defaultOptions.clientService.ocs.signUrl.mockImplementation((payload) => { return Promise.resolve(`${payload.url}?signed=true`) }) @@ -37,9 +33,7 @@ describe('avatarUrl', () => { }) it('handles caching', async () => { const defaultOptions = getDefaultOptions() - defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue({ - status: 200 - } as AxiosResponse) + defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue(mockHttpResponse({}, { status: 200 })) defaultOptions.clientService.ocs.signUrl.mockImplementation((payload) => Promise.resolve(payload.url) ) diff --git a/web/packages/web-app-webfinger/src/views/Resolve.vue b/web/packages/web-app-webfinger/src/views/Resolve.vue index 47ece4e8382..1289a2f0266 100644 --- a/web/packages/web-app-webfinger/src/views/Resolve.vue +++ b/web/packages/web-app-webfinger/src/views/Resolve.vue @@ -58,7 +58,7 @@ loadingService.addTask(async () => { } } catch (e) { console.error(e) - if (e.response?.status === 401) { + if (e.statusCode === 401) { return authService.handleAuthError(unref(route), { forceLogout: true }) } hasError.value = true diff --git a/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue b/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue index 7cedf1c12cc..f18e52525fa 100644 --- a/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue +++ b/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue @@ -299,7 +299,7 @@ const loadResourceTask = useTask(function* (signal) { return authService.handleAuthError(unref(router.currentRoute)) } - if (e?.response?.status === 404 && e?.message === 'Unknown error') { + if (e?.statusCode === 404 && e?.message === 'Unknown error') { console.error(e) loadingError.value = new Error( $gettext('The resource could not be located, it may not exist anymore.') diff --git a/web/packages/web-pkg/src/components/CreateLinkModal.vue b/web/packages/web-pkg/src/components/CreateLinkModal.vue index 2aee2d281ad..ee86ea7ed30 100644 --- a/web/packages/web-pkg/src/components/CreateLinkModal.vue +++ b/web/packages/web-pkg/src/components/CreateLinkModal.vue @@ -249,8 +249,8 @@ const onConfirm = async (options: { copyPassword?: boolean } = {}) => { .forEach((e) => { console.error(e) // Human-readable error message is provided, for example when password is on banned list - if (e.response?.status === 400) { - const error = e.response.data.error + if (e.statusCode === 400) { + const error = (e.data as any).error error.message = upperFirst(error.message) userFacingErrors.push(error) } diff --git a/web/packages/web-pkg/src/services/preview/previewService.ts b/web/packages/web-pkg/src/services/preview/previewService.ts index 2f1ac8c12c9..15ec8182bfb 100644 --- a/web/packages/web-pkg/src/services/preview/previewService.ts +++ b/web/packages/web-pkg/src/services/preview/previewService.ts @@ -180,8 +180,8 @@ export class PreviewService { }) return window.URL.createObjectURL(data) } catch (e) { - if ([425, 429].includes(e.status)) { - const retryAfter = e.response?.headers?.['retry-after'] || 5 + if ([425, 429].includes(e.statusCode)) { + const retryAfter = Number(e.response?.headers?.get('retry-after')) || 5 await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000)) return this.privatePreviewBlob(options, cached, silenceErrors, signal) } @@ -217,8 +217,8 @@ export class PreviewService { return previewUrl } } catch (e) { - if ([425, 429].includes(e.status)) { - const retryAfter = e.response?.headers?.['retry-after'] || 5 + if ([425, 429].includes(e.statusCode)) { + const retryAfter = Number(e.response?.headers?.get('retry-after')) || 5 await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000)) return this.publicPreviewUrl(options, signal) } diff --git a/web/packages/web-pkg/tests/unit/components/CreateShortcutModal.spec.ts b/web/packages/web-pkg/tests/unit/components/CreateShortcutModal.spec.ts index 8b54db17a02..fd6179e49e6 100644 --- a/web/packages/web-pkg/tests/unit/components/CreateShortcutModal.spec.ts +++ b/web/packages/web-pkg/tests/unit/components/CreateShortcutModal.spec.ts @@ -2,7 +2,7 @@ import CreateShortcutModal from '../../../src/components/CreateShortcutModal.vue import { defaultComponentMocks, defaultPlugins, - mockAxiosReject, + mockHttpError, RouteLocation, shallowMount } from '@ownclouders/web-test-helpers' @@ -57,13 +57,13 @@ function getWrapper({ rejectPutFileContents = false, rejectSearch = false } = {} } if (rejectPutFileContents) { - mocks.$clientService.webdav.putFileContents.mockRejectedValue(() => mockAxiosReject()) + mocks.$clientService.webdav.putFileContents.mockRejectedValue(() => mockHttpError()) } else { mocks.$clientService.webdav.putFileContents.mockResolvedValue(mock()) } if (rejectSearch) { - mocks.$clientService.webdav.search.mockRejectedValue(() => mockAxiosReject()) + mocks.$clientService.webdav.search.mockRejectedValue(() => mockHttpError()) } else { mocks.$clientService.webdav.search.mockResolvedValue({ resources: [ diff --git a/web/packages/web-pkg/tests/unit/services/archiver.spec.ts b/web/packages/web-pkg/tests/unit/services/archiver.spec.ts index 91e312fd629..6c086db10ca 100644 --- a/web/packages/web-pkg/tests/unit/services/archiver.spec.ts +++ b/web/packages/web-pkg/tests/unit/services/archiver.spec.ts @@ -3,9 +3,8 @@ import { RuntimeError } from '../../../src/errors' import { mock, mockDeep } from 'vitest-mock-extended' import { ClientService } from '../../../src/services' import { unref, ref, Ref } from 'vue' -import { AxiosResponse } from 'axios' import { ArchiverCapability } from '@ownclouders/web-client/ocs' -import { createTestingPinia } from '@ownclouders/web-test-helpers' +import { createTestingPinia, mockHttpResponse } from '@ownclouders/web-test-helpers' import { useUserStore } from '../../../src/composables/piniaStores' import { User } from '@ownclouders/web-client/graph/generated' @@ -15,10 +14,9 @@ const getArchiverServiceInstance = (capabilities: Ref) => const userStore = useUserStore() const clientServiceMock = mockDeep() - clientServiceMock.httpUnAuthenticated.get.mockResolvedValue({ - data: new ArrayBuffer(8), + clientServiceMock.httpUnAuthenticated.get.mockResolvedValue(mockHttpResponse(new ArrayBuffer(8), { headers: { 'content-disposition': 'filename="download.tar"' } - } as unknown as AxiosResponse) + })) clientServiceMock.ocs.signUrl.mockImplementation((payload) => Promise.resolve(payload.url)) Object.defineProperty(window, 'open', { diff --git a/web/packages/web-pkg/tests/unit/services/previewService.spec.ts b/web/packages/web-pkg/tests/unit/services/previewService.spec.ts index ac3a2fc34f0..1b866d1cad9 100644 --- a/web/packages/web-pkg/tests/unit/services/previewService.spec.ts +++ b/web/packages/web-pkg/tests/unit/services/previewService.spec.ts @@ -1,8 +1,7 @@ import { ClientService, PreviewService } from '../../../src/services' import { mock, mockDeep } from 'vitest-mock-extended' -import { createTestingPinia } from '@ownclouders/web-test-helpers' -import { Resource, SpaceResource } from '@ownclouders/web-client' -import { AxiosResponse } from 'axios' +import { createTestingPinia, mockHttpResponse } from '@ownclouders/web-test-helpers' +import { HttpError, Resource, SpaceResource } from '@ownclouders/web-client' import { useAuthStore, useUserStore, @@ -94,10 +93,13 @@ describe('PreviewService', () => { version: '1' }) - clientService.httpAuthenticated.get.mockRejectedValueOnce({ - response: { headers: { 'retry-after': 0.1 } }, - status: status - }) + clientService.httpAuthenticated.get.mockRejectedValueOnce( + new HttpError( + 'too many requests', + new Response(null, { status, headers: { 'retry-after': '0.1' } }), + status + ) + ) clientService.httpAuthenticated.get.mockResolvedValueOnce(undefined) await previewService.loadPreview({ @@ -189,11 +191,8 @@ const getWrapper = ({ accessToken = 'token' } = {}) => { const clientService = mockDeep() - clientService.httpAuthenticated.get.mockResolvedValue({ data: {}, status: 200 } as AxiosResponse) - clientService.httpUnAuthenticated.head.mockResolvedValue({ - data: {}, - status: 200 - } as AxiosResponse) + clientService.httpAuthenticated.get.mockResolvedValue(mockHttpResponse({})) + clientService.httpUnAuthenticated.head.mockResolvedValue(mockHttpResponse({})) createTestingPinia({ initialState: { user: { user: mock() }, auth: { accessToken } } }) const userStore = useUserStore() diff --git a/web/packages/web-runtime/src/components/Topbar/Notifications.vue b/web/packages/web-runtime/src/components/Topbar/Notifications.vue index f871e237e8c..24d0a3dfb56 100644 --- a/web/packages/web-runtime/src/components/Topbar/Notifications.vue +++ b/web/packages/web-runtime/src/components/Topbar/Notifications.vue @@ -93,7 +93,6 @@ import { useGettext } from 'vue3-gettext' import { useTask } from 'vue-concurrency' import { MESSAGE_TYPE } from '@ownclouders/web-client/sse' import { call } from '@ownclouders/web-client' -import { AxiosHeaders } from 'axios' const POLLING_INTERVAL = 30000 @@ -203,7 +202,7 @@ export default { ) ) - if ((response.headers as AxiosHeaders).get('Content-Length') === '0') { + if (response.headers.get('Content-Length') === '0') { return } diff --git a/web/packages/web-runtime/src/composables/maintenanceMode/useMaintenanceMode.ts b/web/packages/web-runtime/src/composables/maintenanceMode/useMaintenanceMode.ts index 5842076bf62..7889b5eb9a6 100644 --- a/web/packages/web-runtime/src/composables/maintenanceMode/useMaintenanceMode.ts +++ b/web/packages/web-runtime/src/composables/maintenanceMode/useMaintenanceMode.ts @@ -8,7 +8,7 @@ export function useMaintenanceMode() { /** * Starts a timer that checks for maintenance mode every minute. * Since the maintenance mode is asserted by a request that returns a 503 status code, we can just call any endpoint. - * Response is parsed in the axios response interceptor. + * The response is inspected by ClientService.handleResponse, the fetch core's onResponse hook. */ const startCheckingMaintenanceMode = async () => { try { diff --git a/web/packages/web-runtime/src/services/auth/userManager.ts b/web/packages/web-runtime/src/services/auth/userManager.ts index faf0dbf8b43..d7425b0b542 100644 --- a/web/packages/web-runtime/src/services/auth/userManager.ts +++ b/web/packages/web-runtime/src/services/auth/userManager.ts @@ -286,7 +286,7 @@ export class UserManager extends OidcUserManager { console.log('CERNBox: login successful, exchange sso token with reva token') const httpClient = this.clientService.httpAuthenticated const revaTokenReq = await httpClient.get('/ocs/v2.php/cloud/user') - const revaToken = revaTokenReq.headers['x-access-token'] + const revaToken = revaTokenReq.headers.get('x-access-token') const claims = JSON.parse(atob(revaToken.split('.')[1])) user.access_token = revaToken user.expires_at = claims.exp diff --git a/web/packages/web-runtime/tests/unit/App.spec.ts b/web/packages/web-runtime/tests/unit/App.spec.ts index 7c3ae9b71ad..63a2e1a7f39 100644 --- a/web/packages/web-runtime/tests/unit/App.spec.ts +++ b/web/packages/web-runtime/tests/unit/App.spec.ts @@ -1,9 +1,13 @@ import App from '../../src/App.vue' import { ref } from 'vue' -import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers' +import { + defaultComponentMocks, + defaultPlugins, + mockHttpResponse, + shallowMount +} from '@ownclouders/web-test-helpers' import { mock, mockDeep } from 'vitest-mock-extended' import { CapabilityStore, ClientService } from '@ownclouders/web-pkg' -import { AxiosResponse } from 'axios' import * as LanguageHelpderModule from '../../src/helpers/language' vi.spyOn(LanguageHelpderModule, 'setCurrentLanguage') @@ -52,7 +56,7 @@ function getShallowWrapper({ }) { if (!clientService) { clientService = mockDeep() - clientService.httpAuthenticated.get.mockResolvedValue(mock({ status: 200 })) + clientService.httpAuthenticated.get.mockResolvedValue(mockHttpResponse({}, { status: 200 })) } const mocks = { ...defaultComponentMocks(), $clientService: clientService } diff --git a/web/packages/web-runtime/tests/unit/components/Avatar.spec.ts b/web/packages/web-runtime/tests/unit/components/Avatar.spec.ts index 53b0a425b01..d41a9ac3df7 100644 --- a/web/packages/web-runtime/tests/unit/components/Avatar.spec.ts +++ b/web/packages/web-runtime/tests/unit/components/Avatar.spec.ts @@ -1,8 +1,12 @@ import Avatar from '../../../src/components/Avatar.vue' -import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers' -import { mock, mockDeep } from 'vitest-mock-extended' +import { + defaultComponentMocks, + defaultPlugins, + mockHttpResponse, + shallowMount +} from '@ownclouders/web-test-helpers' +import { mockDeep } from 'vitest-mock-extended' import { CapabilityStore, ClientService } from '@ownclouders/web-pkg' -import { AxiosResponse } from 'axios' import { nextTick } from 'vue' import { OcAvatar } from '@ownclouders/design-system/components' @@ -70,10 +74,7 @@ describe('Avatar component', () => { global.URL.createObjectURL = vi.fn(() => blob) const clientService = mockDeep() clientService.httpAuthenticated.get.mockResolvedValue( - mock({ - status: 200, - data: blob - }) + mockHttpResponse(blob, { status: 200 }) ) const { wrapper } = getShallowWrapper(false, clientService) await nextTick() @@ -94,7 +95,7 @@ function getShallowWrapper( ) { if (!clientService) { clientService = mockDeep() - clientService.httpAuthenticated.get.mockResolvedValue(mock({ status: 200 })) + clientService.httpAuthenticated.get.mockResolvedValue(mockHttpResponse({}, { status: 200 })) } const mocks = { ...defaultComponentMocks(), $clientService: clientService } diff --git a/web/packages/web-runtime/tests/unit/components/Topbar/Notifications.spec.ts b/web/packages/web-runtime/tests/unit/components/Topbar/Notifications.spec.ts index 2505d5791a5..0f330bce723 100644 --- a/web/packages/web-runtime/tests/unit/components/Topbar/Notifications.spec.ts +++ b/web/packages/web-runtime/tests/unit/components/Topbar/Notifications.spec.ts @@ -1,10 +1,14 @@ import Notifications from '../../../../src/components/Topbar/Notifications.vue' import { Notification } from '../../../../src/helpers/notifications' import { mock } from 'vitest-mock-extended' -import { defaultComponentMocks, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers' +import { + defaultComponentMocks, + defaultPlugins, + mockHttpResponse, + shallowMount +} from '@ownclouders/web-test-helpers' import { SpaceResource } from '@ownclouders/web-client' import { RouterLink, RouteLocationNamedRaw, RouteLocationNormalizedLoaded } from 'vue-router' -import { AxiosResponse } from 'axios' import Avatar from '../../../../src/components/Avatar.vue' const selectors = { @@ -321,7 +325,7 @@ function getWrapper({ } = {}) { const localMocks = { ...defaultComponentMocks(), ...mocks } localMocks.$clientService.httpAuthenticated.get.mockResolvedValue( - mock({ data: { ocs: { data: notifications } }, headers: {} }) + mockHttpResponse({ ocs: { data: notifications } }) ) return { diff --git a/web/packages/web-runtime/tests/unit/pages/account.spec.ts b/web/packages/web-runtime/tests/unit/pages/account.spec.ts index c7c018df27a..c785a7541fb 100644 --- a/web/packages/web-runtime/tests/unit/pages/account.spec.ts +++ b/web/packages/web-runtime/tests/unit/pages/account.spec.ts @@ -2,8 +2,8 @@ import account from '../../../src/pages/account.vue' import { defaultComponentMocks, defaultPlugins, - mockAxiosReject, - mockAxiosResolve, + mockHttpError, + mockHttpResponse, mount } from '@ownclouders/web-test-helpers' import { mock } from 'vitest-mock-extended' @@ -254,7 +254,7 @@ describe('account page', () => { await blockLoadingState(wrapper) mocks.$clientService.httpAuthenticated.post.mockResolvedValueOnce( - mockAxiosResolve({ value: { id: 'settings-language' } }) + mockHttpResponse({ value: { value: { id: 'settings-language' } } }) ) await wrapper.vm.updateDisableEmailNotifications(true) const { showMessage } = useMessages() @@ -266,7 +266,7 @@ describe('account page', () => { const { wrapper, mocks } = getWrapper() await blockLoadingState(wrapper) - mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockAxiosReject('err')) + mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockHttpError(500, undefined, 'err')) await wrapper.vm.updateDisableEmailNotifications(true) const { showErrorMessage } = useMessages() expect(showErrorMessage).toHaveBeenCalled() @@ -397,7 +397,7 @@ describe('account page', () => { await blockLoadingState(wrapper) mocks.$clientService.httpAuthenticated.post.mockResolvedValueOnce( - mockAxiosResolve({ + mockHttpResponse({ value: { identifier: { setting: 'setting-id' }, value: { id: 'value-id' } } }) ) @@ -412,7 +412,7 @@ describe('account page', () => { const { wrapper, mocks } = getWrapper({}) await blockLoadingState(wrapper) - mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockAxiosReject('err')) + mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockHttpError(500, undefined, 'err')) await wrapper.vm.updateMultiChoiceSettingsValue('setting-id', 'setting-key', true) const { showErrorMessage } = useMessages() expect(showErrorMessage).toHaveBeenCalled() @@ -425,7 +425,7 @@ describe('account page', () => { await blockLoadingState(wrapper) mocks.$clientService.httpAuthenticated.post.mockResolvedValueOnce( - mockAxiosResolve({ + mockHttpResponse({ value: { identifier: { setting: 'setting-id' }, value: { id: 'value-id' } } }) ) @@ -443,7 +443,7 @@ describe('account page', () => { const { wrapper, mocks } = getWrapper({}) await blockLoadingState(wrapper) - mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockAxiosReject('err')) + mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockHttpError(500, undefined, 'err')) await wrapper.vm.updateSingleChoiceValue('setting-id', { displayValue: 'Daily', value: { stringValue: 'daily' } @@ -530,7 +530,7 @@ function getWrapper({ response = { values: [mock()] } } - return Promise.resolve(mockAxiosResolve(response)) + return Promise.resolve(mockHttpResponse(response)) }) mocks.$clientService.graphAuthenticated.users.getMe.mockResolvedValue(mock({ id: '1' })) From 472e690804421e62fd1bd3ebe574598e96d8793c Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 10:07:33 +0200 Subject: [PATCH 07/19] refactor(web-client): move ocs onto the fetch core --- web/packages/web-client/src/ocs/capabilities.ts | 6 +++--- web/packages/web-client/src/ocs/index.ts | 8 ++++---- web/packages/web-client/src/ocs/urlSign.ts | 14 ++++++++------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/web/packages/web-client/src/ocs/capabilities.ts b/web/packages/web-client/src/ocs/capabilities.ts index 96bf04dcf66..893fb12d568 100644 --- a/web/packages/web-client/src/ocs/capabilities.ts +++ b/web/packages/web-client/src/ocs/capabilities.ts @@ -1,4 +1,4 @@ -import { AxiosInstance } from 'axios' +import { FetchClient } from '../http' import get from 'lodash-es/get' export interface AppProviderCapability { @@ -204,14 +204,14 @@ export interface Capabilities { } } -export const GetCapabilitiesFactory = (baseURI: string, axios: AxiosInstance) => { +export const GetCapabilitiesFactory = (baseURI: string, httpClient: FetchClient) => { const url = new URL(baseURI) url.pathname = [...url.pathname.split('/'), 'cloud', 'capabilities'].filter(Boolean).join('/') url.searchParams.append('format', 'json') const endpoint = url.href return { async getCapabilities(): Promise { - const response = await axios.get(endpoint) + const response = await httpClient.request(endpoint) return get(response, 'data.ocs.data', { capabilities: null, version: null }) } } diff --git a/web/packages/web-client/src/ocs/index.ts b/web/packages/web-client/src/ocs/index.ts index bb0df6e5e63..17dcdff4013 100644 --- a/web/packages/web-client/src/ocs/index.ts +++ b/web/packages/web-client/src/ocs/index.ts @@ -1,5 +1,5 @@ import { Capabilities, GetCapabilitiesFactory } from './capabilities' -import { AxiosInstance } from 'axios' +import { FetchClient } from '../http' import { SignUrlPayload, UrlSign } from './urlSign' export * from './capabilities' @@ -9,14 +9,14 @@ export interface OCS { signUrl: (payload: SignUrlPayload) => Promise } -export const ocs = (baseURI: string, axiosClient: AxiosInstance): OCS => { +export const ocs = (baseURI: string, httpClient: FetchClient): OCS => { const url = new URL(baseURI) url.pathname = [...url.pathname.split('/'), 'ocs', 'v2.php'].filter(Boolean).join('/') const ocsV2BaseURI = url.href - const capabilitiesFactory = GetCapabilitiesFactory(ocsV2BaseURI, axiosClient) + const capabilitiesFactory = GetCapabilitiesFactory(ocsV2BaseURI, httpClient) - const urlSign = new UrlSign({ baseURI, axiosClient }) + const urlSign = new UrlSign({ baseURI, httpClient }) return { getCapabilities: () => { diff --git a/web/packages/web-client/src/ocs/urlSign.ts b/web/packages/web-client/src/ocs/urlSign.ts index 26f6576e189..d8eb124c98e 100644 --- a/web/packages/web-client/src/ocs/urlSign.ts +++ b/web/packages/web-client/src/ocs/urlSign.ts @@ -1,10 +1,10 @@ -import { AxiosInstance } from 'axios' +import { FetchClient } from '../http' import { urlJoin } from '../utils' import convert from 'xml-js' import { pbkdf2Sync } from 'crypto' export interface UrlSignOptions { - axiosClient: AxiosInstance + httpClient: FetchClient baseURI: string } @@ -16,7 +16,7 @@ export type SignUrlPayload = { } export class UrlSign { - private axiosClient: AxiosInstance + private httpClient: FetchClient private baseURI: string private signingKey: string @@ -26,8 +26,8 @@ export class UrlSign { private HASH_LENGTH = 32 private ITERATION_COUNT = 10000 - constructor({ axiosClient, baseURI }: UrlSignOptions) { - this.axiosClient = axiosClient + constructor({ httpClient, baseURI }: UrlSignOptions) { + this.httpClient = httpClient this.baseURI = baseURI } @@ -55,9 +55,11 @@ export class UrlSign { return this.signingKey } - const data = await this.axiosClient.get( + const data = await this.httpClient.request( urlJoin(this.baseURI, 'ocs/v2.php/cloud/user/signing-key'), { + // the endpoint answers XML, so take the body verbatim instead of parsing it as JSON + responseType: 'text', params: { ...(publicToken && { 'public-token': publicToken }) }, From 28cb9df1a1e3643abd6dc7ff91df0535989c11a6 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 10:09:39 +0200 Subject: [PATCH 08/19] refactor(web-client): move webdav helpers onto the fetch core --- .../web-client/src/webdav/getFileContents.ts | 19 +++++----- .../web-client/src/webdav/getFileUrl.ts | 6 ++-- web/packages/web-client/src/webdav/index.ts | 35 ++++++------------- web/packages/web-client/src/webdav/types.ts | 4 +-- 4 files changed, 27 insertions(+), 37 deletions(-) diff --git a/web/packages/web-client/src/webdav/getFileContents.ts b/web/packages/web-client/src/webdav/getFileContents.ts index f0dcf290323..26b160fa15b 100644 --- a/web/packages/web-client/src/webdav/getFileContents.ts +++ b/web/packages/web-client/src/webdav/getFileContents.ts @@ -2,7 +2,7 @@ import { SpaceResource } from '../helpers' import { WebDavOptions } from './types' import { DAV, DAVRequestOptions } from './client' import { HttpError } from '../errors' -import { ResponseType } from 'axios' +import type { ResponseType } from '../http' import { getWebDavPath } from './utils' export type GetFileContentsResponse = { @@ -10,7 +10,7 @@ export type GetFileContentsResponse = { [key: string]: any } -export const GetFileContentsFactory = (dav: DAV, { axiosClient }: WebDavOptions) => { +export const GetFileContentsFactory = (dav: DAV, { httpClient }: WebDavOptions) => { return { async getFileContents( space: SpaceResource, @@ -27,7 +27,7 @@ export const GetFileContentsFactory = (dav: DAV, { axiosClient }: WebDavOptions) ): Promise { try { const webDavPath = getWebDavPath(space, { fileId, path }) - const response = await axiosClient.get(dav.getFileUrl(webDavPath), { + const response = await httpClient.request(dav.getFileUrl(webDavPath), { responseType, headers: { ...(noCache && { 'Cache-Control': 'no-cache' }), @@ -39,14 +39,17 @@ export const GetFileContentsFactory = (dav: DAV, { axiosClient }: WebDavOptions) response, body: response.data, headers: { - ETag: response.headers['etag'], - 'OC-ETag': response.headers['oc-etag'], - 'OC-FileId': response.headers['oc-fileid'] + ETag: response.headers.get('etag'), + 'OC-ETag': response.headers.get('oc-etag'), + 'OC-FileId': response.headers.get('oc-fileid') } } } catch (error) { - const { message, response } = error - throw new HttpError(message, response, response.status) + // the core already throws an HttpError carrying the response and status + if (error instanceof HttpError) { + throw error + } + throw new HttpError(error?.message, error?.response, error?.statusCode) } } } diff --git a/web/packages/web-client/src/webdav/getFileUrl.ts b/web/packages/web-client/src/webdav/getFileUrl.ts index a63e63047b4..57d6fa33071 100644 --- a/web/packages/web-client/src/webdav/getFileUrl.ts +++ b/web/packages/web-client/src/webdav/getFileUrl.ts @@ -8,7 +8,7 @@ import { ocs } from '../ocs' export const GetFileUrlFactory = ( dav: DAV, getFileContentsFactory: ReturnType, - { axiosClient, baseUrl }: WebDavOptions + { httpClient, baseUrl }: WebDavOptions ) => { return { async getFileUrl( @@ -42,12 +42,12 @@ export const GetFileUrlFactory = ( : dav.getFileUrl(resource.webDavPath) if (username && doHeadRequest) { - await axiosClient.head(downloadURL) + await httpClient.fetch(downloadURL, { method: 'HEAD' }) } // sign url if (isUrlSigningEnabled && username) { - const ocsClient = ocs(baseUrl, axiosClient) + const ocsClient = ocs(baseUrl, httpClient) downloadURL = await ocsClient.signUrl({ url: downloadURL, username }) } else { signed = false diff --git a/web/packages/web-client/src/webdav/index.ts b/web/packages/web-client/src/webdav/index.ts index db8fe3eef1a..7c6df7a0714 100644 --- a/web/packages/web-client/src/webdav/index.ts +++ b/web/packages/web-client/src/webdav/index.ts @@ -1,5 +1,5 @@ -import axios from 'axios' import { Headers } from 'webdav' +import { FetchClient } from '../http' import { WebDAV } from './types' import { CopyFilesFactory } from './copyFiles' import { CreateFolderFactory } from './createFolder' @@ -33,31 +33,18 @@ export const webdav = ( onSetMaintenance: (value: boolean) => void, headers?: () => Headers ): WebDAV => { - const axiosClient = axios.create() - if (headers) { - axiosClient.interceptors.request.use((config) => { - Object.assign(config.headers, headers()) - return config - }) - } - - axiosClient.interceptors.response.use( - (response) => { - onSetMaintenance(false) - return response - }, - (error) => { - const isInMaintenanceMode = shouldResponseTriggerMaintenance( - error.response?.status || 500, - error.config.url - ) - onSetMaintenance(isInMaintenanceMode) - - return Promise.reject(error) + const httpClient = new FetchClient({ + ...(headers && { headers }), + onResponse: ({ response, status, requestUrl }) => { + if (response?.ok) { + onSetMaintenance(false) + return + } + onSetMaintenance(shouldResponseTriggerMaintenance(status, requestUrl)) } - ) + }) - const options = { axiosClient, baseUrl: baseURI, headers } + const options = { httpClient, baseUrl: baseURI, headers } const dav = new DAV({ baseUrl: baseURI, headers, onSetMaintenance }) const registerExtraProp = (name: string) => { diff --git a/web/packages/web-client/src/webdav/types.ts b/web/packages/web-client/src/webdav/types.ts index 979d6f4d0c7..e8b04f682a8 100644 --- a/web/packages/web-client/src/webdav/types.ts +++ b/web/packages/web-client/src/webdav/types.ts @@ -16,11 +16,11 @@ import { SearchFactory } from './search' import { GetPathForFileIdFactory } from './getPathForFileId' import { SetFavoriteFactory } from './setFavorite' import { ListFavoriteFilesFactory } from './listFavoriteFiles' -import { AxiosInstance } from 'axios' import { Headers } from 'webdav' +import { FetchClient } from '../http' export interface WebDavOptions { - axiosClient: AxiosInstance + httpClient: FetchClient baseUrl: string headers?: () => Headers } From ea0c501cc738ef54b81d2351cbbc651ea618e010 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 10:13:44 +0200 Subject: [PATCH 09/19] chore(web-client): regenerate graph client with typescript-fetch --- web/packages/web-client/package.json | 2 +- .../web-client/src/graph/generated/.gitignore | 4 - .../web-client/src/graph/generated/.npmignore | 1 - .../graph/generated/.openapi-generator/FILES | 113 +- .../generated/.openapi-generator/VERSION | 2 +- .../web-client/src/graph/generated/api.ts | 9502 ----------------- .../src/graph/generated/apis/ActivitiesApi.ts | 83 + .../graph/generated/apis/ApplicationsApi.ts | 132 + .../src/graph/generated/apis/DriveItemApi.ts | 252 + .../src/graph/generated/apis/DrivesApi.ts | 523 + .../generated/apis/DrivesGetDrivesApi.ts | 150 + .../generated/apis/DrivesPermissionsApi.ts | 669 ++ .../src/graph/generated/apis/DrivesRootApi.ts | 709 ++ .../graph/generated/apis/EducationClassApi.ts | 558 + .../apis/EducationClassTeachersApi.ts | 241 + .../generated/apis/EducationSchoolApi.ts | 767 ++ .../graph/generated/apis/EducationUserApi.ts | 398 + .../src/graph/generated/apis/GroupApi.ts | 458 + .../src/graph/generated/apis/GroupsApi.ts | 196 + .../generated/apis/MeChangepasswordApi.ts | 88 + .../src/graph/generated/apis/MeDriveApi.ts | 161 + .../graph/generated/apis/MeDriveRootApi.ts | 72 + .../generated/apis/MeDriveRootChildrenApi.ts | 72 + .../src/graph/generated/apis/MeDrivesApi.ts | 150 + .../src/graph/generated/apis/MeUserApi.ts | 146 + .../graph/generated/apis/RoleManagementApi.ts | 131 + .../src/graph/generated/apis/TagsApi.ts | 180 + .../src/graph/generated/apis/UserApi.ts | 330 + .../apis/UserAppRoleAssignmentApi.ts | 239 + .../src/graph/generated/apis/UsersApi.ts | 212 + .../src/graph/generated/apis/index.ts | 26 + .../web-client/src/graph/generated/base.ts | 62 - .../web-client/src/graph/generated/common.ts | 126 - .../src/graph/generated/configuration.ts | 121 - .../src/graph/generated/docs/ActivitiesApi.md | 71 +- .../src/graph/generated/docs/Activity.md | 38 +- .../graph/generated/docs/ActivityTemplate.md | 34 +- .../src/graph/generated/docs/ActivityTimes.md | 30 +- .../src/graph/generated/docs/AppRole.md | 44 +- .../graph/generated/docs/AppRoleAssignment.md | 64 +- .../src/graph/generated/docs/Application.md | 38 +- .../graph/generated/docs/ApplicationsApi.md | 126 +- .../src/graph/generated/docs/Audio.md | 92 +- .../generated/docs/ClassMemberReference.md | 30 +- .../graph/generated/docs/ClassReference.md | 30 +- .../generated/docs/ClassTeacherReference.md | 30 +- .../generated/docs/CollectionOfActivities.md | 30 +- .../docs/CollectionOfAppRoleAssignments.md | 34 +- .../docs/CollectionOfApplications.md | 30 +- .../graph/generated/docs/CollectionOfClass.md | 30 +- .../generated/docs/CollectionOfDriveItems.md | 34 +- .../generated/docs/CollectionOfDriveItems1.md | 30 +- .../generated/docs/CollectionOfDrives.md | 34 +- .../generated/docs/CollectionOfDrives1.md | 30 +- .../docs/CollectionOfEducationClass.md | 30 +- .../docs/CollectionOfEducationUser.md | 30 +- .../graph/generated/docs/CollectionOfGroup.md | 34 +- .../generated/docs/CollectionOfPermissions.md | 30 +- ...ollectionOfPermissionsWithAllowedValues.md | 38 +- .../generated/docs/CollectionOfSchools.md | 30 +- .../graph/generated/docs/CollectionOfTags.md | 30 +- .../graph/generated/docs/CollectionOfUser.md | 34 +- .../graph/generated/docs/CollectionOfUsers.md | 30 +- .../src/graph/generated/docs/Deleted.md | 30 +- .../src/graph/generated/docs/Drive.md | 96 +- .../src/graph/generated/docs/DriveItem.md | 154 +- .../src/graph/generated/docs/DriveItemApi.md | 243 +- .../generated/docs/DriveItemCreateLink.md | 48 +- .../graph/generated/docs/DriveItemInvite.md | 44 +- .../graph/generated/docs/DriveRecipient.md | 34 +- .../src/graph/generated/docs/DriveUpdate.md | 96 +- .../src/graph/generated/docs/DrivesApi.md | 589 +- .../generated/docs/DrivesGetDrivesApi.md | 153 +- .../generated/docs/DrivesPermissionsApi.md | 622 +- .../src/graph/generated/docs/DrivesRootApi.md | 724 +- .../graph/generated/docs/EducationClass.md | 56 +- .../graph/generated/docs/EducationClassApi.md | 559 +- .../docs/EducationClassTeachersApi.md | 221 +- .../graph/generated/docs/EducationSchool.md | 44 +- .../generated/docs/EducationSchoolApi.md | 780 +- .../src/graph/generated/docs/EducationUser.md | 88 +- .../graph/generated/docs/EducationUserApi.md | 368 +- .../generated/docs/EducationUserReference.md | 30 +- .../docs/ExportPersonalDataRequest.md | 30 +- .../graph/generated/docs/FileSystemInfo.md | 38 +- .../src/graph/generated/docs/Folder.md | 34 +- .../src/graph/generated/docs/FolderView.md | 38 +- .../graph/generated/docs/GeoCoordinates.md | 38 +- .../src/graph/generated/docs/Group.md | 52 +- .../src/graph/generated/docs/GroupApi.md | 465 +- .../src/graph/generated/docs/GroupsApi.md | 160 +- .../src/graph/generated/docs/Hashes.md | 44 +- .../src/graph/generated/docs/Identity.md | 38 +- .../src/graph/generated/docs/IdentitySet.md | 44 +- .../src/graph/generated/docs/Image.md | 34 +- .../src/graph/generated/docs/Instance.md | 34 +- .../src/graph/generated/docs/ItemReference.md | 48 +- .../generated/docs/MeChangepasswordApi.md | 72 +- .../src/graph/generated/docs/MeDriveApi.md | 174 +- .../graph/generated/docs/MeDriveRootApi.md | 58 +- .../generated/docs/MeDriveRootChildrenApi.md | 58 +- .../src/graph/generated/docs/MeDrivesApi.md | 153 +- .../src/graph/generated/docs/MeUserApi.md | 142 +- .../graph/generated/docs/MemberReference.md | 30 +- .../graph/generated/docs/ObjectIdentity.md | 34 +- .../src/graph/generated/docs/OdataError.md | 30 +- .../graph/generated/docs/OdataErrorDetail.md | 38 +- .../graph/generated/docs/OdataErrorMain.md | 48 +- .../src/graph/generated/docs/OpenGraphFile.md | 38 +- .../graph/generated/docs/PasswordChange.md | 34 +- .../graph/generated/docs/PasswordProfile.md | 34 +- .../src/graph/generated/docs/Permission.md | 68 +- .../src/graph/generated/docs/Photo.md | 64 +- .../src/graph/generated/docs/Quota.md | 48 +- .../src/graph/generated/docs/RemoteItem.md | 116 +- .../graph/generated/docs/RoleManagementApi.md | 134 +- .../generated/docs/SharePointIdentitySet.md | 34 +- .../graph/generated/docs/SharingInvitation.md | 30 +- .../src/graph/generated/docs/SharingLink.md | 48 +- .../generated/docs/SharingLinkPassword.md | 30 +- .../graph/generated/docs/SharingLinkType.md | 30 +- .../graph/generated/docs/SignInActivity.md | 30 +- .../src/graph/generated/docs/SpecialFolder.md | 30 +- .../src/graph/generated/docs/TagAssignment.md | 34 +- .../graph/generated/docs/TagUnassignment.md | 34 +- .../src/graph/generated/docs/TagsApi.md | 198 +- .../src/graph/generated/docs/Thumbnail.md | 48 +- .../src/graph/generated/docs/ThumbnailSet.md | 48 +- .../src/graph/generated/docs/Trash.md | 34 +- .../generated/docs/UnifiedRoleDefinition.md | 48 +- .../generated/docs/UnifiedRolePermission.md | 34 +- .../src/graph/generated/docs/User.md | 104 +- .../src/graph/generated/docs/UserApi.md | 313 +- .../docs/UserAppRoleAssignmentApi.md | 234 +- .../src/graph/generated/docs/UserUpdate.md | 104 +- .../src/graph/generated/docs/UsersApi.md | 166 +- .../src/graph/generated/docs/Video.md | 68 +- .../src/graph/generated/git_push.sh | 57 - .../web-client/src/graph/generated/index.ts | 19 +- .../src/graph/generated/models/Activity.ts | 93 + .../generated/models/ActivityTemplate.ts | 70 + .../graph/generated/models/ActivityTimes.ts | 64 + .../src/graph/generated/models/AppRole.ts | 82 + .../generated/models/AppRoleAssignment.ts | 113 + .../src/graph/generated/models/Application.ts | 83 + .../src/graph/generated/models/Audio.ts | 156 + .../generated/models/ClassMemberReference.ts | 63 + .../graph/generated/models/ClassReference.ts | 63 + .../generated/models/ClassTeacherReference.ts | 63 + .../models/CollectionOfActivities.ts | 71 + .../models/CollectionOfAppRoleAssignments.ts | 77 + .../models/CollectionOfApplications.ts | 71 + .../generated/models/CollectionOfClass.ts | 71 + .../models/CollectionOfDriveItems.ts | 77 + .../models/CollectionOfDriveItems1.ts | 71 + .../generated/models/CollectionOfDrives.ts | 77 + .../generated/models/CollectionOfDrives1.ts | 71 + .../models/CollectionOfEducationClass.ts | 71 + .../models/CollectionOfEducationUser.ts | 71 + .../generated/models/CollectionOfGroup.ts | 77 + .../models/CollectionOfPermissions.ts | 71 + ...ollectionOfPermissionsWithAllowedValues.ts | 114 + .../generated/models/CollectionOfSchools.ts | 71 + .../generated/models/CollectionOfTags.ts | 63 + .../generated/models/CollectionOfUser.ts | 77 + .../generated/models/CollectionOfUsers.ts | 71 + .../src/graph/generated/models/Deleted.ts | 63 + .../src/graph/generated/models/Drive.ts | 182 + .../src/graph/generated/models/DriveItem.ts | 352 + .../generated/models/DriveItemCreateLink.ts | 97 + .../graph/generated/models/DriveItemInvite.ts | 89 + .../graph/generated/models/DriveRecipient.ts | 73 + .../src/graph/generated/models/DriveUpdate.ts | 181 + .../graph/generated/models/EducationClass.ts | 117 + .../graph/generated/models/EducationSchool.ts | 80 + .../graph/generated/models/EducationUser.ts | 174 + .../models/EducationUserReference.ts | 63 + .../models/ExportPersonalDataRequest.ts | 63 + .../graph/generated/models/FileSystemInfo.ts | 75 + .../src/graph/generated/models/Folder.ts | 77 + .../src/graph/generated/models/FolderView.ts | 75 + .../graph/generated/models/GeoCoordinates.ts | 77 + .../src/graph/generated/models/Group.ts | 100 + .../src/graph/generated/models/Hashes.ts | 81 + .../src/graph/generated/models/Identity.ts | 76 + .../src/graph/generated/models/IdentitySet.ts | 89 + .../src/graph/generated/models/Image.ts | 67 + .../src/graph/generated/models/Instance.ts | 71 + .../graph/generated/models/ItemReference.ts | 82 + .../graph/generated/models/MemberReference.ts | 63 + .../graph/generated/models/ObjectIdentity.ts | 69 + .../src/graph/generated/models/OdataError.ts | 72 + .../generated/models/OdataErrorDetail.ts | 77 + .../graph/generated/models/OdataErrorMain.ts | 97 + .../graph/generated/models/OpenGraphFile.ts | 82 + .../graph/generated/models/PasswordChange.ts | 71 + .../graph/generated/models/PasswordProfile.ts | 69 + .../src/graph/generated/models/Permission.ts | 156 + .../src/graph/generated/models/Photo.ts | 112 + .../src/graph/generated/models/Quota.ts | 82 + .../src/graph/generated/models/RemoteItem.ts | 243 + .../generated/models/SharePointIdentitySet.ts | 77 + .../generated/models/SharingInvitation.ts | 72 + .../src/graph/generated/models/SharingLink.ts | 98 + .../generated/models/SharingLinkPassword.ts | 64 + .../graph/generated/models/SharingLinkType.ts | 67 + .../graph/generated/models/SignInActivity.ts | 63 + .../graph/generated/models/SpecialFolder.ts | 63 + .../graph/generated/models/TagAssignment.ts | 71 + .../graph/generated/models/TagUnassignment.ts | 71 + .../src/graph/generated/models/Thumbnail.ts | 88 + .../graph/generated/models/ThumbnailSet.ts | 97 + .../src/graph/generated/models/Trash.ts | 77 + .../generated/models/UnifiedRoleDefinition.ts | 100 + .../generated/models/UnifiedRolePermission.ts | 146 + .../src/graph/generated/models/User.ts | 218 + .../src/graph/generated/models/UserUpdate.ts | 216 + .../src/graph/generated/models/Video.ts | 120 + .../src/graph/generated/models/index.ts | 81 + .../web-client/src/graph/generated/runtime.ts | 505 + 220 files changed, 21675 insertions(+), 13603 deletions(-) delete mode 100644 web/packages/web-client/src/graph/generated/.gitignore delete mode 100644 web/packages/web-client/src/graph/generated/.npmignore delete mode 100644 web/packages/web-client/src/graph/generated/api.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/ActivitiesApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/ApplicationsApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/DrivesApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/DrivesGetDrivesApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/EducationClassTeachersApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/GroupApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/GroupsApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/MeChangepasswordApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/MeDriveApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/MeDriveRootApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/MeDriveRootChildrenApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/MeDrivesApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/MeUserApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/RoleManagementApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/TagsApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/UserApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/UsersApi.ts create mode 100644 web/packages/web-client/src/graph/generated/apis/index.ts delete mode 100644 web/packages/web-client/src/graph/generated/base.ts delete mode 100644 web/packages/web-client/src/graph/generated/common.ts delete mode 100644 web/packages/web-client/src/graph/generated/configuration.ts delete mode 100644 web/packages/web-client/src/graph/generated/git_push.sh create mode 100644 web/packages/web-client/src/graph/generated/models/Activity.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ActivityTemplate.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ActivityTimes.ts create mode 100644 web/packages/web-client/src/graph/generated/models/AppRole.ts create mode 100644 web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Application.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Audio.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ClassMemberReference.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ClassReference.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ClassTeacherReference.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfActivities.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfAppRoleAssignments.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfApplications.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfClass.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems1.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfDrives.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfDrives1.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfEducationClass.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfEducationUser.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfGroup.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfPermissions.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfPermissionsWithAllowedValues.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfSchools.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfTags.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfUser.ts create mode 100644 web/packages/web-client/src/graph/generated/models/CollectionOfUsers.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Deleted.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Drive.ts create mode 100644 web/packages/web-client/src/graph/generated/models/DriveItem.ts create mode 100644 web/packages/web-client/src/graph/generated/models/DriveItemCreateLink.ts create mode 100644 web/packages/web-client/src/graph/generated/models/DriveItemInvite.ts create mode 100644 web/packages/web-client/src/graph/generated/models/DriveRecipient.ts create mode 100644 web/packages/web-client/src/graph/generated/models/DriveUpdate.ts create mode 100644 web/packages/web-client/src/graph/generated/models/EducationClass.ts create mode 100644 web/packages/web-client/src/graph/generated/models/EducationSchool.ts create mode 100644 web/packages/web-client/src/graph/generated/models/EducationUser.ts create mode 100644 web/packages/web-client/src/graph/generated/models/EducationUserReference.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ExportPersonalDataRequest.ts create mode 100644 web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Folder.ts create mode 100644 web/packages/web-client/src/graph/generated/models/FolderView.ts create mode 100644 web/packages/web-client/src/graph/generated/models/GeoCoordinates.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Group.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Hashes.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Identity.ts create mode 100644 web/packages/web-client/src/graph/generated/models/IdentitySet.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Image.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Instance.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ItemReference.ts create mode 100644 web/packages/web-client/src/graph/generated/models/MemberReference.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ObjectIdentity.ts create mode 100644 web/packages/web-client/src/graph/generated/models/OdataError.ts create mode 100644 web/packages/web-client/src/graph/generated/models/OdataErrorDetail.ts create mode 100644 web/packages/web-client/src/graph/generated/models/OdataErrorMain.ts create mode 100644 web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts create mode 100644 web/packages/web-client/src/graph/generated/models/PasswordChange.ts create mode 100644 web/packages/web-client/src/graph/generated/models/PasswordProfile.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Permission.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Photo.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Quota.ts create mode 100644 web/packages/web-client/src/graph/generated/models/RemoteItem.ts create mode 100644 web/packages/web-client/src/graph/generated/models/SharePointIdentitySet.ts create mode 100644 web/packages/web-client/src/graph/generated/models/SharingInvitation.ts create mode 100644 web/packages/web-client/src/graph/generated/models/SharingLink.ts create mode 100644 web/packages/web-client/src/graph/generated/models/SharingLinkPassword.ts create mode 100644 web/packages/web-client/src/graph/generated/models/SharingLinkType.ts create mode 100644 web/packages/web-client/src/graph/generated/models/SignInActivity.ts create mode 100644 web/packages/web-client/src/graph/generated/models/SpecialFolder.ts create mode 100644 web/packages/web-client/src/graph/generated/models/TagAssignment.ts create mode 100644 web/packages/web-client/src/graph/generated/models/TagUnassignment.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Thumbnail.ts create mode 100644 web/packages/web-client/src/graph/generated/models/ThumbnailSet.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Trash.ts create mode 100644 web/packages/web-client/src/graph/generated/models/UnifiedRoleDefinition.ts create mode 100644 web/packages/web-client/src/graph/generated/models/UnifiedRolePermission.ts create mode 100644 web/packages/web-client/src/graph/generated/models/User.ts create mode 100644 web/packages/web-client/src/graph/generated/models/UserUpdate.ts create mode 100644 web/packages/web-client/src/graph/generated/models/Video.ts create mode 100644 web/packages/web-client/src/graph/generated/models/index.ts create mode 100644 web/packages/web-client/src/graph/generated/runtime.ts diff --git a/web/packages/web-client/package.json b/web/packages/web-client/package.json index 1ae5814018d..aaf5c6ea804 100644 --- a/web/packages/web-client/package.json +++ b/web/packages/web-client/package.json @@ -75,7 +75,7 @@ } }, "scripts": { - "generate-openapi": "rm -rf src/graph/generated && docker run --rm -v \"${PWD}/src/graph:/local\" openapitools/openapi-generator-cli generate -i https://raw.githubusercontent.com/owncloud/libre-graph-api/main/api/openapi-spec/v1.0.yaml -g typescript-axios -o /local/generated", + "generate-openapi": "rm -rf src/graph/generated && docker run --rm -v \"${PWD}/src/graph:/local\" openapitools/openapi-generator-cli generate -i https://raw.githubusercontent.com/owncloud/libre-graph-api/main/api/openapi-spec/v1.0.yaml -g typescript-fetch -o /local/generated", "vite": "vite", "prepublishOnly": "rm -rf ./package && clean-publish && rm -rf package/dist/tests && find package && cat package/package.json", "postpublish": "rm -rf ./package", diff --git a/web/packages/web-client/src/graph/generated/.gitignore b/web/packages/web-client/src/graph/generated/.gitignore deleted file mode 100644 index 149b5765472..00000000000 --- a/web/packages/web-client/src/graph/generated/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -wwwroot/*.js -node_modules -typings -dist diff --git a/web/packages/web-client/src/graph/generated/.npmignore b/web/packages/web-client/src/graph/generated/.npmignore deleted file mode 100644 index 999d88df693..00000000000 --- a/web/packages/web-client/src/graph/generated/.npmignore +++ /dev/null @@ -1 +0,0 @@ -# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/web/packages/web-client/src/graph/generated/.openapi-generator/FILES b/web/packages/web-client/src/graph/generated/.openapi-generator/FILES index 1b72275f279..1eab1bf50bf 100644 --- a/web/packages/web-client/src/graph/generated/.openapi-generator/FILES +++ b/web/packages/web-client/src/graph/generated/.openapi-generator/FILES @@ -1,10 +1,29 @@ -.gitignore -.npmignore .openapi-generator-ignore -api.ts -base.ts -common.ts -configuration.ts +apis/ActivitiesApi.ts +apis/ApplicationsApi.ts +apis/DriveItemApi.ts +apis/DrivesApi.ts +apis/DrivesGetDrivesApi.ts +apis/DrivesPermissionsApi.ts +apis/DrivesRootApi.ts +apis/EducationClassApi.ts +apis/EducationClassTeachersApi.ts +apis/EducationSchoolApi.ts +apis/EducationUserApi.ts +apis/GroupApi.ts +apis/GroupsApi.ts +apis/MeChangepasswordApi.ts +apis/MeDriveApi.ts +apis/MeDriveRootApi.ts +apis/MeDriveRootChildrenApi.ts +apis/MeDrivesApi.ts +apis/MeUserApi.ts +apis/RoleManagementApi.ts +apis/TagsApi.ts +apis/UserApi.ts +apis/UserAppRoleAssignmentApi.ts +apis/UsersApi.ts +apis/index.ts docs/ActivitiesApi.md docs/Activity.md docs/ActivityTemplate.md @@ -108,5 +127,85 @@ docs/UserAppRoleAssignmentApi.md docs/UserUpdate.md docs/UsersApi.md docs/Video.md -git_push.sh index.ts +models/Activity.ts +models/ActivityTemplate.ts +models/ActivityTimes.ts +models/AppRole.ts +models/AppRoleAssignment.ts +models/Application.ts +models/Audio.ts +models/ClassMemberReference.ts +models/ClassReference.ts +models/ClassTeacherReference.ts +models/CollectionOfActivities.ts +models/CollectionOfAppRoleAssignments.ts +models/CollectionOfApplications.ts +models/CollectionOfClass.ts +models/CollectionOfDriveItems.ts +models/CollectionOfDriveItems1.ts +models/CollectionOfDrives.ts +models/CollectionOfDrives1.ts +models/CollectionOfEducationClass.ts +models/CollectionOfEducationUser.ts +models/CollectionOfGroup.ts +models/CollectionOfPermissions.ts +models/CollectionOfPermissionsWithAllowedValues.ts +models/CollectionOfSchools.ts +models/CollectionOfTags.ts +models/CollectionOfUser.ts +models/CollectionOfUsers.ts +models/Deleted.ts +models/Drive.ts +models/DriveItem.ts +models/DriveItemCreateLink.ts +models/DriveItemInvite.ts +models/DriveRecipient.ts +models/DriveUpdate.ts +models/EducationClass.ts +models/EducationSchool.ts +models/EducationUser.ts +models/EducationUserReference.ts +models/ExportPersonalDataRequest.ts +models/FileSystemInfo.ts +models/Folder.ts +models/FolderView.ts +models/GeoCoordinates.ts +models/Group.ts +models/Hashes.ts +models/Identity.ts +models/IdentitySet.ts +models/Image.ts +models/Instance.ts +models/ItemReference.ts +models/MemberReference.ts +models/ObjectIdentity.ts +models/OdataError.ts +models/OdataErrorDetail.ts +models/OdataErrorMain.ts +models/OpenGraphFile.ts +models/PasswordChange.ts +models/PasswordProfile.ts +models/Permission.ts +models/Photo.ts +models/Quota.ts +models/RemoteItem.ts +models/SharePointIdentitySet.ts +models/SharingInvitation.ts +models/SharingLink.ts +models/SharingLinkPassword.ts +models/SharingLinkType.ts +models/SignInActivity.ts +models/SpecialFolder.ts +models/TagAssignment.ts +models/TagUnassignment.ts +models/Thumbnail.ts +models/ThumbnailSet.ts +models/Trash.ts +models/UnifiedRoleDefinition.ts +models/UnifiedRolePermission.ts +models/User.ts +models/UserUpdate.ts +models/Video.ts +models/index.ts +runtime.ts diff --git a/web/packages/web-client/src/graph/generated/.openapi-generator/VERSION b/web/packages/web-client/src/graph/generated/.openapi-generator/VERSION index 193a12d6e89..32a8cfaceeb 100644 --- a/web/packages/web-client/src/graph/generated/.openapi-generator/VERSION +++ b/web/packages/web-client/src/graph/generated/.openapi-generator/VERSION @@ -1 +1 @@ -7.20.0-SNAPSHOT +7.26.0-SNAPSHOT diff --git a/web/packages/web-client/src/graph/generated/api.ts b/web/packages/web-client/src/graph/generated/api.ts deleted file mode 100644 index 17ec3ebad60..00000000000 --- a/web/packages/web-client/src/graph/generated/api.ts +++ /dev/null @@ -1,9502 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Libre Graph API - * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. - * - * The version of the OpenAPI document: v1.0.4 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from './configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from './common'; -import type { RequestArgs } from './base'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; - -/** - * Represents activity. - */ -export interface Activity { - /** - * Activity ID. - */ - 'id': string; - 'times': ActivityTimes; - 'template': ActivityTemplate; -} -export interface ActivityTemplate { - /** - * Activity description. - */ - 'message': string; - /** - * Activity description variables. - */ - 'variables'?: object; -} -export interface ActivityTimes { - /** - * Timestamp of the activity. - */ - 'recordedTime': string; -} -export interface AppRole { - /** - * Specifies whether this app role can be assigned to users and groups (by setting to [\'User\']), to other application\'s (by setting to [\'Application\'], or both (by setting to [\'User\', \'Application\']). App roles supporting assignment to other applications\' service principals are also known as application permissions. The \'Application\' value is only supported for app roles defined on application entities. - */ - 'allowedMemberTypes'?: Array; - /** - * The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. - */ - 'description'?: string | null; - /** - * Display name for the permission that appears in the app role assignment and consent experiences. - */ - 'displayName'?: string | null; - /** - * Unique role identifier inside the appRoles collection. When creating a new app role, a new GUID identifier must be provided. - */ - 'id': string; -} -export interface AppRoleAssignment { - /** - * The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. - */ - 'id'?: string; - 'deletedDateTime'?: string; - /** - * The identifier (id) for the app role which is assigned to the user. Required on create. - */ - 'appRoleId': string; - /** - * The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. - */ - 'createdDateTime'?: string | null; - /** - * The display name of the user, group, or service principal that was granted the app role assignment. Read-only. - */ - 'principalDisplayName'?: string | null; - /** - * The unique identifier (id) for the user, security group, or service principal being granted the app role. Security groups with dynamic memberships are supported. Required on create. - */ - 'principalId': string | null; - /** - * The type of the assigned principal. This can either be User, Group, or ServicePrincipal. Read-only. - */ - 'principalType'?: string | null; - /** - * The display name of the resource app\'s service principal to which the assignment is made. - */ - 'resourceDisplayName'?: string | null; - /** - * The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. - */ - 'resourceId': string | null; -} -export interface Application { - /** - * The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. - */ - 'id': string; - /** - * The collection of roles defined for the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. - */ - 'appRoles'?: Array; - /** - * The display name for the application. - */ - 'displayName'?: string | null; -} -/** - * The Audio resource groups audio-related properties on an item into a single structure. If a DriveItem has a non-null audio facet, the item represents an audio file. The properties of the Audio resource are populated by extracting metadata from the file. - */ -export interface Audio { - /** - * The title of the album for this audio file. - */ - 'album'?: string; - /** - * The artist named on the album for the audio file. - */ - 'albumArtist'?: string; - /** - * The performing artist for the audio file. - */ - 'artist'?: string; - /** - * Bitrate expressed in kbps. - */ - 'bitrate'?: number; - /** - * The name of the composer of the audio file. - */ - 'composers'?: string; - /** - * Copyright information for the audio file. - */ - 'copyright'?: string; - /** - * The number of the disc this audio file came from. - */ - 'disc'?: number; - /** - * The total number of discs in this album. - */ - 'discCount'?: number; - /** - * Duration of the audio file, expressed in milliseconds - */ - 'duration'?: number; - /** - * The genre of this audio file. - */ - 'genre'?: string; - /** - * Indicates if the file is protected with digital rights management. - */ - 'hasDrm'?: boolean; - /** - * Indicates if the file is encoded with a variable bitrate. - */ - 'isVariableBitrate'?: boolean; - /** - * The title of the audio file. - */ - 'title'?: string; - /** - * The number of the track on the original disc for this audio file. - */ - 'track'?: number; - /** - * The total number of tracks on the original disc for this audio file. - */ - 'trackCount'?: number; - /** - * The year the audio file was recorded. - */ - 'year'?: number; -} -export interface ClassMemberReference { - '@odata.id'?: string; -} -export interface ClassReference { - '@odata.id'?: string; -} -export interface ClassTeacherReference { - '@odata.id'?: string; -} -export interface CollectionOfActivities { - 'value'?: Array; -} -export interface CollectionOfAppRoleAssignments { - 'value'?: Array; - '@odata.nextLink'?: string; -} -export interface CollectionOfApplications { - 'value'?: Array; -} -export interface CollectionOfClass { - 'value'?: Array; -} -export interface CollectionOfDriveItems { - 'value'?: Array; - '@odata.nextLink'?: string; -} -export interface CollectionOfDriveItems1 { - 'value'?: Array; -} -export interface CollectionOfDrives { - 'value'?: Array; - '@odata.nextLink'?: string; -} -export interface CollectionOfDrives1 { - 'value'?: Array; -} -export interface CollectionOfEducationClass { - 'value'?: Array; -} -export interface CollectionOfEducationUser { - 'value'?: Array; -} -export interface CollectionOfGroup { - 'value'?: Array; - '@odata.nextLink'?: string; -} -export interface CollectionOfPermissions { - 'value'?: Array; -} -export interface CollectionOfPermissionsWithAllowedValues { - /** - * A list of role definitions that can be chosen for the resource. - */ - '@libre.graph.permissions.roles.allowedValues'?: Array; - /** - * A list of actions that can be chosen for a custom role. Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` | - */ - '@libre.graph.permissions.actions.allowedValues'?: Array; - 'value'?: Array; -} -export interface CollectionOfSchools { - 'value'?: Array; -} -export interface CollectionOfTags { - 'value'?: Array; -} -export interface CollectionOfUser { - 'value'?: Array; - '@odata.nextLink'?: string; -} -export interface CollectionOfUsers { - 'value'?: Array; -} -/** - * Information about the deleted state of the item. Read-only. - */ -export interface Deleted { - /** - * Represents the state of the deleted item. - */ - 'state'?: string; -} -/** - * The drive represents a space on the storage. - */ -export interface Drive { - /** - * The unique identifier for this drive. - */ - 'id'?: string; - 'createdBy'?: IdentitySet; - /** - * Date and time of item creation. Read-only. - */ - 'createdDateTime'?: string; - /** - * Provides a user-visible description of the item. Optional. - */ - 'description'?: string; - /** - * ETag for the item. Read-only. - */ - 'eTag'?: string; - 'lastModifiedBy'?: IdentitySet; - /** - * Date and time the item was last modified. Read-only. - */ - 'lastModifiedDateTime'?: string; - /** - * The name of the item. Read-write. - */ - 'name': string; - 'parentReference'?: ItemReference; - /** - * URL that displays the resource in the browser. Read-only. - */ - 'webUrl'?: string; - /** - * Describes the type of drive represented by this resource. Values are \"personal\" for users home spaces, \"project\", \"virtual\" or \"share\". Read-only. - */ - 'driveType'?: string; - /** - * The drive alias can be used in clients to make the urls user friendly. Example: \'personal/einstein\'. This will be used to resolve to the correct driveID. - */ - 'driveAlias'?: string; - 'owner'?: IdentitySet; - 'quota'?: Quota; - /** - * All items contained in the drive. Read-only. Nullable. - */ - 'items'?: Array; - 'root'?: DriveItem; - /** - * A collection of special drive resources. - */ - 'special'?: Array; -} -/** - * Represents a resource inside a drive. Read-only. - */ -export interface DriveItem { - /** - * Read-only. - */ - 'id'?: string; - 'createdBy'?: IdentitySet; - /** - * Date and time of item creation. Read-only. - */ - 'createdDateTime'?: string; - /** - * Provides a user-visible description of the item. Optional. - */ - 'description'?: string; - /** - * ETag for the item. Read-only. - */ - 'eTag'?: string; - 'lastModifiedBy'?: IdentitySet; - /** - * Date and time the item was last modified. Read-only. - */ - 'lastModifiedDateTime'?: string; - /** - * The name of the item. Read-write. - */ - 'name'?: string; - 'parentReference'?: ItemReference; - /** - * URL that displays the resource in the browser. Read-only. - */ - 'webUrl'?: string; - /** - * The content stream, if the item represents a file. - */ - 'content'?: string; - /** - * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. - */ - 'cTag'?: string; - 'deleted'?: Deleted; - 'file'?: OpenGraphFile; - 'fileSystemInfo'?: FileSystemInfo; - 'folder'?: Folder; - 'image'?: Image; - 'photo'?: Photo; - 'location'?: GeoCoordinates; - /** - * Collection containing ThumbnailSet objects associated with the item. Read-only. Nullable. - */ - 'thumbnails'?: Array; - /** - * If this property is non-null, it indicates that the driveItem is the top-most driveItem in the drive. - */ - 'root'?: object; - 'trash'?: Trash; - 'specialFolder'?: SpecialFolder; - 'remoteItem'?: RemoteItem; - /** - * Size of the item in bytes. Read-only. - */ - 'size'?: number; - /** - * WebDAV compatible URL for the item. Read-only. - */ - 'webDavUrl'?: string; - /** - * Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. - */ - 'children'?: Array; - /** - * The set of permissions for the item. Read-only. Nullable. - */ - 'permissions'?: Array; - 'audio'?: Audio; - 'video'?: Video; - /** - * Indicates if the item is synchronized with the underlying storage provider. Read-only. - */ - '@client.synchronize'?: boolean; - /** - * Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissions. - */ - '@UI.Hidden'?: boolean; -} -export interface DriveItemCreateLink { - 'type'?: SharingLinkType; - /** - * Optional. A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates the expiration time of the permission. - */ - 'expirationDateTime'?: string; - /** - * Optional.The password of the sharing link that is set by the creator. - */ - 'password'?: string; - /** - * Provides a user-visible display name of the link. Optional. Libregraph only. - */ - 'displayName'?: string; - /** - * The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only. - */ - '@libre.graph.quickLink'?: boolean; -} - - -export interface DriveItemInvite { - /** - * A collection of recipients who will receive access and the sharing invitation. Currently, only internal users or groups are supported. - */ - 'recipients'?: Array; - /** - * Specifies the roles that are to be granted to the recipients of the sharing invitation. - */ - 'roles'?: Array; - /** - * Specifies the actions that are to be granted to the recipients of the sharing invitation, in effect creating a custom role. - */ - '@libre.graph.permissions.actions'?: Array; - /** - * Specifies the dateTime after which the permission expires. - */ - 'expirationDateTime'?: string; -} -/** - * Represents a person, group, or other recipient to share a drive item with using the invite action. When using invite to add permissions, the `driveRecipient` object would specify the `email`, `alias`, or `objectId` of the recipient. Only one of these values is required; multiple values are not accepted. - */ -export interface DriveRecipient { - /** - * The unique identifier for the recipient in the directory. - */ - 'objectId'?: string; - /** - * When the recipient is referenced by objectId this annotation is used to differentiate `user` and `group` recipients. - */ - '@libre.graph.recipient.type'?: string; -} -/** - * The drive represents an update to a space on the storage. - */ -export interface DriveUpdate { - /** - * The unique identifier for this drive. - */ - 'id'?: string; - 'createdBy'?: IdentitySet; - /** - * Date and time of item creation. Read-only. - */ - 'createdDateTime'?: string; - /** - * Provides a user-visible description of the item. Optional. - */ - 'description'?: string; - /** - * ETag for the item. Read-only. - */ - 'eTag'?: string; - 'lastModifiedBy'?: IdentitySet; - /** - * Date and time the item was last modified. Read-only. - */ - 'lastModifiedDateTime'?: string; - /** - * The name of the item. Read-write. - */ - 'name'?: string; - 'parentReference'?: ItemReference; - /** - * URL that displays the resource in the browser. Read-only. - */ - 'webUrl'?: string; - /** - * Describes the type of drive represented by this resource. Values are \"personal\" for users home spaces, \"project\", \"virtual\" or \"share\". Read-only. - */ - 'driveType'?: string; - /** - * The drive alias can be used in clients to make the urls user friendly. Example: \'personal/einstein\'. This will be used to resolve to the correct driveID. - */ - 'driveAlias'?: string; - 'owner'?: IdentitySet; - 'quota'?: Quota; - /** - * All items contained in the drive. Read-only. Nullable. - */ - 'items'?: Array; - 'root'?: DriveItem; - /** - * A collection of special drive resources. - */ - 'special'?: Array; -} -/** - * And extension of group representing a class or course - */ -export interface EducationClass { - /** - * Read-only. - */ - 'id'?: string; - /** - * An optional description for the group. Returned by default. - */ - 'description'?: string; - /** - * The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy. - */ - 'displayName'?: string; - /** - * Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand. - */ - 'members'?: Array; - /** - * A list of member references to the members to be added. Up to 20 members can be added with a single request - */ - 'members@odata.bind'?: Set; - /** - * Classification of the group, i.e. \"class\" or \"course\" - */ - 'classification'?: EducationClassClassificationEnum; - /** - * An external unique ID for the class - */ - 'externalId'?: string; -} - -export const EducationClassClassificationEnum = { - Class: 'class', - Course: 'course' -} as const; - -export type EducationClassClassificationEnum = typeof EducationClassClassificationEnum[keyof typeof EducationClassClassificationEnum]; - -/** - * Represents a school - */ -export interface EducationSchool { - /** - * The unique identifier for an entity. Read-only. - */ - 'id'?: string; - /** - * The organization name - */ - 'displayName'?: string; - /** - * School number - */ - 'schoolNumber'?: string; - /** - * Date and time at which the service for this organization is scheduled to be terminated - */ - 'terminationDate'?: string | null; -} -/** - * An extension of user with education-specific attributes - */ -export interface EducationUser { - /** - * Read-only. - */ - 'id'?: string; - /** - * Set to \"true\" when the account is enabled. - */ - 'accountEnabled'?: boolean; - /** - * The name displayed in the address book for the user. This value is usually the combination of the user\'s first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. - */ - 'displayName'?: string; - /** - * A collection of drives available for this user. Read-only. - */ - 'drives'?: Array; - 'drive'?: Drive; - /** - * Identities associated with this account. - */ - 'identities'?: Array; - /** - * The SMTP address for the user, for example, \'jeff@contoso.onowncloud.com\'. Returned by default. - */ - 'mail'?: string; - /** - * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. - */ - 'memberOf'?: Array; - /** - * Contains the on-premises SAM account name synchronized from the on-premises directory. Read-only. - */ - 'onPremisesSamAccountName'?: string; - 'passwordProfile'?: PasswordProfile; - /** - * The user\'s surname (family name or last name). Returned by default. - */ - 'surname'?: string; - /** - * The user\'s givenName. Returned by default. - */ - 'givenName'?: string; - /** - * The user`s default role. Such as \"student\" or \"teacher\" - */ - 'primaryRole'?: string; - /** - * The user`s type. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. - */ - 'userType'?: string; - /** - * A unique identifier for the user assigned by the school or institution. - */ - 'externalID'?: string; -} -export interface EducationUserReference { - '@odata.id'?: string; -} -export interface ExportPersonalDataRequest { - /** - * the path where the file should be created in the users personal space - */ - 'storageLocation'?: string; -} -/** - * File system information on client. Read-write. - */ -export interface FileSystemInfo { - /** - * The UTC date and time the file was created on a client. - */ - 'createdDateTime'?: string; - /** - * The UTC date and time the file was last accessed. Available for the recent file list only. - */ - 'lastAccessedDateTime'?: string; - /** - * The UTC date and time the file was last modified on a client. - */ - 'lastModifiedDateTime'?: string; -} -/** - * Folder metadata, if the item is a folder. Read-only. - */ -export interface Folder { - /** - * Number of children contained immediately within this container. - */ - 'childCount'?: number; - 'view'?: FolderView; -} -/** - * A collection of properties defining the recommended view for the folder. - */ -export interface FolderView { - /** - * The method by which the folder should be sorted. - */ - 'sortBy'?: string; - /** - * If true, indicates that items should be sorted in descending order. Otherwise, items should be sorted ascending. - */ - 'sortOrder'?: string; - /** - * The type of view that should be used to represent the folder. - */ - 'viewType'?: string; -} -/** - * The GeoCoordinates resource provides geographic coordinates and elevation of a location based on metadata contained within the file. If a DriveItem has a non-null location facet, the item represents a file with a known location associated with it. - */ -export interface GeoCoordinates { - /** - * The altitude (height), in feet, above sea level for the item. Read-only. - */ - 'altitude'?: number; - /** - * The latitude, in decimal, for the item. Read-only. - */ - 'latitude'?: number; - /** - * The longitude, in decimal, for the item. Read-only. - */ - 'longitude'?: number; -} -export interface Group { - /** - * Read-only. - */ - 'id'?: string; - /** - * An optional description for the group. Returned by default. - */ - 'description'?: string; - /** - * The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy. - */ - 'displayName'?: string; - /** - * Specifies the group types. In MS Graph a group can have multiple types, so this is an array. In libreGraph the possible group types deviate from the MS Graph. The only group type that we currently support is \"ReadOnly\", which is set for groups that cannot be modified on the current instance. - */ - 'groupTypes'?: Array; - /** - * Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand. - */ - 'members'?: Array; - /** - * A list of member references to the members to be added. Up to 20 members can be added with a single request - */ - 'members@odata.bind'?: Set; -} -/** - * Hashes of the file\'s binary content, if available. Read-only. - */ -export interface Hashes { - /** - * The CRC32 value of the file (if available). Read-only. - */ - 'crc32Hash'?: string; - /** - * A proprietary hash of the file that can be used to determine if the contents of the file have changed (if available). Read-only. - */ - 'quickXorHash'?: string; - /** - * SHA1 hash for the contents of the file (if available). Read-only. - */ - 'sha1Hash'?: string; - /** - * SHA256 hash for the contents of the file (if available). Read-only. - */ - 'sha256Hash'?: string; -} -export interface Identity { - /** - * The identity\'s display name. Note that this may not always be available or up to date. For example, if a user changes their display name, the API may show the new value in a future response, but the items associated with the user won\'t show up as having changed when using delta. - */ - 'displayName': string; - /** - * Unique identifier for the identity. - */ - 'id'?: string; - /** - * The type of the identity. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. Can be used by clients to indicate the type of user. For more details, clients should look up and cache the user at the /users endpoint. - */ - '@libre.graph.userType'?: string; -} -/** - * Optional. User account. - */ -export interface IdentitySet { - 'application'?: Identity; - 'device'?: Identity; - 'user'?: Identity; - 'group'?: Identity; -} -/** - * Image metadata, if the item is an image. Read-only. - */ -export interface Image { - /** - * Optional. Height of the image, in pixels. Read-only. - */ - 'height'?: number; - /** - * Optional. Width of the image, in pixels. Read-only. - */ - 'width'?: number; -} -/** - * An oCIS instance that the user is either a member or a guest of. - */ -export interface Instance { - /** - * The URL of the oCIS instance. - */ - 'url'?: string; - /** - * Whether the instance is the user\'s primary instance. - */ - 'primary'?: boolean; -} -export interface ItemReference { - /** - * Unique identifier of the drive instance that contains the item. Read-only. - */ - 'driveId'?: string; - /** - * Identifies the type of drive. See [drive][] resource for values. Read-only. - */ - 'driveType'?: string; - /** - * Unique identifier of the item in the drive. Read-only. - */ - 'id'?: string; - /** - * The name of the item being referenced. Read-only. - */ - 'name'?: string; - /** - * Path that can be used to navigate to the item. Read-only. - */ - 'path'?: string; -} -export interface MemberReference { - '@odata.id'?: string; -} -/** - * Represents an identity used to sign in to a user account - */ -export interface ObjectIdentity { - /** - * domain of the Provider issuing the identity - */ - 'issuer'?: string; - /** - * The unique id assigned by the issuer to the account - */ - 'issuerAssignedId'?: string; -} -export interface OdataError { - 'error': OdataErrorMain; -} -export interface OdataErrorDetail { - 'code': string; - 'message': string; - 'target'?: string; -} -export interface OdataErrorMain { - 'code': string; - 'message': string; - 'target'?: string; - 'details'?: Array; - /** - * The structure of this object is service-specific - */ - 'innererror'?: object; -} -/** - * File metadata, if the item is a file. Read-only. - */ -export interface OpenGraphFile { - 'hashes'?: Hashes; - /** - * The MIME type for the file. This is determined by logic on the server and might not be the value provided when the file was uploaded. Read-only. - */ - 'mimeType'?: string; - 'processingMetadata'?: boolean; -} -export interface PasswordChange { - 'currentPassword': string; - 'newPassword': string; -} -/** - * Password Profile associated with a user - */ -export interface PasswordProfile { - /** - * If true the user is required to change their password upon the next login - */ - 'forceChangePasswordNextSignIn'?: boolean; - /** - * The user\'s password - */ - 'password'?: string; -} -/** - * The Permission resource provides information about a sharing permission granted for a DriveItem resource. ### Remarks The Permission resource uses *facets* to provide information about the kind of permission represented by the resource. Permissions with a `link` facet represent sharing links created on the item. Sharing links contain a unique token that provides access to the item for anyone with the link. Permissions with a `invitation` facet represent permissions added by inviting specific users or groups to have access to the file. - */ -export interface Permission { - /** - * The unique identifier of the permission among all permissions on the item. Read-only. - */ - 'id'?: string; - /** - * Indicates whether the password is set for this permission. This property only appears in the response. Optional. Read-only. - */ - 'hasPassword'?: boolean; - /** - * An optional expiration date which limits the permission in time. - */ - 'expirationDateTime'?: string | null; - /** - * An optional creation date. Libregraph only. - */ - 'createdDateTime'?: string | null; - 'grantedToV2'?: SharePointIdentitySet; - 'link'?: SharingLink; - 'roles'?: Array; - /** - * For link type permissions, the details of the identity to whom permission was granted. This could be used to grant access to a an external user that can be identified by email, aka guest accounts. - * @deprecated - */ - 'grantedToIdentities'?: Array; - /** - * Use this to create a permission with custom actions. - */ - '@libre.graph.permissions.actions'?: Array; - 'invitation'?: SharingInvitation; -} -/** - * The photo resource provides photo and camera properties, for example, EXIF metadata, on a driveItem. - */ -export interface Photo { - /** - * Camera manufacturer. Read-only. - */ - 'cameraMake'?: string; - /** - * Camera model. Read-only. - */ - 'cameraModel'?: string; - /** - * The denominator for the exposure time fraction from the camera. Read-only. - */ - 'exposureDenominator'?: number; - /** - * The numerator for the exposure time fraction from the camera. Read-only. - */ - 'exposureNumerator'?: number; - /** - * The F-stop value from the camera. Read-only. - */ - 'fNumber'?: number; - /** - * The focal length from the camera. Read-only. - */ - 'focalLength'?: number; - /** - * The ISO value from the camera. Read-only. - */ - 'iso'?: number; - /** - * The orientation value from the camera. Read-only. - */ - 'orientation'?: number; - /** - * Represents the date and time the photo was taken. Read-only. - */ - 'takenDateTime'?: string; -} -/** - * Optional. Information about the drive\'s storage space quota. Read-only. - */ -export interface Quota { - /** - * Total space consumed by files in the recycle bin, in bytes. Read-only. - */ - 'deleted'?: number; - /** - * Total space remaining before reaching the quota limit, in bytes. Read-only. - */ - 'remaining'?: number; - /** - * Enumeration value that indicates the state of the storage space. Either \"normal\", \"nearing\", \"critical\" or \"exceeded\". Read-only. - */ - 'state'?: string; - /** - * Total allowed storage space, in bytes. Read-only. - */ - 'total'?: number; - /** - * Total space used, in bytes. Read-only. - */ - 'used'?: number; -} -/** - * Remote item data, if the item is shared from a drive other than the one being accessed. Read-only. - */ -export interface RemoteItem { - 'createdBy'?: IdentitySet; - /** - * Date and time of item creation. Read-only. - */ - 'createdDateTime'?: string; - 'file'?: OpenGraphFile; - 'fileSystemInfo'?: FileSystemInfo; - 'folder'?: Folder; - /** - * The drive alias can be used in clients to make the urls user friendly. Example: \'personal/einstein\'. This will be used to resolve to the correct driveID. - */ - 'driveAlias'?: string; - /** - * The relative path of the item in relation to its drive root. - */ - 'path'?: string; - /** - * Unique identifier for the drive root of this item. Read-only. - */ - 'rootId'?: string; - /** - * Unique identifier for the remote item in its drive. Read-only. - */ - 'id'?: string; - 'image'?: Image; - 'lastModifiedBy'?: IdentitySet; - /** - * Date and time the item was last modified. Read-only. - */ - 'lastModifiedDateTime'?: string; - /** - * Optional. Filename of the remote item. Read-only. - */ - 'name'?: string; - /** - * ETag for the item. Read-only. - */ - 'eTag'?: string; - /** - * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. - */ - 'cTag'?: string; - 'parentReference'?: ItemReference; - /** - * The set of permissions for the item. Read-only. Nullable. - */ - 'permissions'?: Array; - /** - * Size of the remote item. Read-only. - */ - 'size'?: number; - 'specialFolder'?: SpecialFolder; - /** - * DAV compatible URL for the item. - */ - 'webDavUrl'?: string; - /** - * URL that displays the resource in the browser. Read-only. - */ - 'webUrl'?: string; - /** - * The UUID of the space that contains the item. - */ - 'spaceId'?: string; -} -/** - * This resource is used to represent a set of identities associated with various events for an item, such as created by or last modified by. - */ -export interface SharePointIdentitySet { - 'user'?: Identity; - 'group'?: Identity; -} -/** - * invitation-related data items - */ -export interface SharingInvitation { - 'invitedBy'?: IdentitySet; -} -/** - * The `SharingLink` resource groups link-related data items into a single structure. If a `permission` resource has a non-null `sharingLink` facet, the permission represents a sharing link (as opposed to permissions granted to a person or group). - */ -export interface SharingLink { - 'type'?: SharingLinkType; - /** - * If `true` then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item. - */ - 'preventsDownload'?: boolean; - /** - * A URL that opens the item in the browser on the website. - */ - 'webUrl'?: string; - /** - * Provides a user-visible display name of the link. Optional. Libregraph only. - */ - '@libre.graph.displayName'?: string; - /** - * The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only. - */ - '@libre.graph.quickLink'?: boolean; -} - - -/** - * The sharing link password which should be set. - */ -export interface SharingLinkPassword { - /** - * Password. It may require a password policy. - */ - 'password'?: string; -} -/** - * The type of the link created. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | internal | Internal | Creates an internal link without any permissions. | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - */ - -export const SharingLinkType = { - Internal: 'internal', - View: 'view', - Upload: 'upload', - Edit: 'edit', - CreateOnly: 'createOnly', - BlocksDownload: 'blocksDownload' -} as const; - -export type SharingLinkType = typeof SharingLinkType[keyof typeof SharingLinkType]; - - -/** - * Provides the last successful sign-in attempt for a user - */ -export interface SignInActivity { - /** - * The date and time of the last successful sign-in for the user. - */ - 'lastSuccessfulSignInDateTime'?: string; -} -/** - * If the current item is also available as a special folder, this facet is returned. Read-only - */ -export interface SpecialFolder { - /** - * The unique identifier for this item in the /drive/special collection - */ - 'name'?: string; -} -export interface TagAssignment { - 'resourceId': string; - 'tags': Array; -} -export interface TagUnassignment { - 'resourceId': string; - 'tags': Array; -} -/** - * The thumbnail resource type represents a thumbnail for an image, video, document, or any item that has a bitmap representation. - */ -export interface Thumbnail { - /** - * The content stream for the thumbnail. - */ - 'content'?: string; - /** - * The height of the thumbnail, in pixels. - */ - 'height'?: number; - /** - * The unique identifier of the item that provided the thumbnail. This is only available when a folder thumbnail is requested. - */ - 'sourceItemId'?: string; - /** - * The URL used to fetch the thumbnail content. - */ - 'url'?: string; - /** - * The width of the thumbnail, in pixels. - */ - 'width'?: number; -} -/** - * The ThumbnailSet resource is a keyed collection of thumbnail resources. It\'s used to represent a set of thumbnails associated with a DriveItem. - */ -export interface ThumbnailSet { - /** - * The ID within the item. Read-only. - */ - 'id'?: string; - 'large'?: Thumbnail; - 'medium'?: Thumbnail; - 'small'?: Thumbnail; - 'source'?: Thumbnail; -} -/** - * Metadata for trashed drive Items - */ -export interface Trash { - 'trashedBy'?: IdentitySet; - /** - * The UTC date and time the folder was marked as trashed. - */ - 'trashedDateTime'?: string; -} -/** - * A role definition is a collection of permissions in libre graph listing the operations that can be performed and the resources against which they can performed. - */ -export interface UnifiedRoleDefinition { - /** - * The description for the unifiedRoleDefinition. - */ - 'description'?: string; - /** - * The display name for the unifiedRoleDefinition. Required. Supports $filter (`eq`, `in`). - */ - 'displayName'?: string; - /** - * The unique identifier for the role definition. Key, not nullable, Read-only. Inherited from entity. Supports $filter (`eq`, `in`). - */ - 'id'?: string; - /** - * List of permissions included in the role. - */ - 'rolePermissions'?: Array; - /** - * When presenting a list of roles the weight can be used to order them in a meaningful way. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an unset weight. - */ - '@libre.graph.weight'?: number; -} -/** - * Represents a collection of allowed resource actions and the conditions that must be met for the action to be allowed. Resource actions are tasks that can be performed on a resource. For example, an application resource may support create, update, delete, and reset password actions. - */ -export interface UnifiedRolePermission { - /** - * Set of tasks that can be performed on a resource. Required. The following is the schema for resource actions: ``` {Namespace}/{Entity}/{PropertySet}/{Action} ``` For example: `libre.graph/applications/credentials/update` * *{Namespace}* - The services that exposes the task. For example, all tasks in libre graph use the namespace `libre.graph`. * *{Entity}* - The logical features or components exposed by the service in libre graph. For example, `applications`, `servicePrincipals`, or `groups`. * *{PropertySet}* - Optional. The specific properties or aspects of the entity for which access is being granted. For example, `libre.graph/applications/authentication/read` grants the ability to read the reply URL, logout URL, and implicit flow property on the **application** object in libre graph. The following are reserved names for common property sets: * `allProperties` - Designates all properties of the entity, including privileged properties. Examples include `libre.graph/applications/allProperties/read` and `libre.graph/applications/allProperties/update`. * `basic` - Designates common read properties but excludes privileged ones. For example, `libre.graph/applications/basic/update` includes the ability to update standard properties like display name. * `standard` - Designates common update properties but excludes privileged ones. For example, `libre.graph/applications/standard/read`. * *{Actions}* - The operations being granted. In most circumstances, permissions should be expressed in terms of CRUD operations or allTasks. Actions include: * `create` - The ability to create a new instance of the entity. * `read` - The ability to read a given property set (including allProperties). * `update` - The ability to update a given property set (including allProperties). * `delete` - The ability to delete a given entity. * `allTasks` - Represents all CRUD operations (create, read, update, and delete). Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` | Managing drives would be a different entity. A space manager role could be written as `libre.graph/drive/permission/allTasks`. - */ - 'allowedResourceActions'?: Array; - /** - * Optional constraints that must be met for the permission to be effective. Not supported for custom roles. Conditions define constraints that must be met. For example, a requirement that target resource must have a certain property. The following are the supported conditions: * Drive: `exists @Resource.Drive` - The target resource must be a drive/space * Folder: `exists @Resource.Folder` - The target resource must be a folder * File: `exists @Resource.File` - The target resource must be a file The following is an example of a role permission with a condition that the target resource is a folder: ```json \"rolePermissions\": [ { \"allowedResourceActions\": [ \"libre.graph/applications/basic/update\", \"libre.graph/applications/credentials/update\" ], \"condition\": \"exists @Resource.File\" } ] ``` Conditions aren\'t supported for custom roles. - */ - 'condition'?: string; -} -/** - * Represents an Active Directory user object. - */ -export interface User { - /** - * Read-only. - */ - 'id'?: string; - /** - * Set to \"true\" when the account is enabled. - */ - 'accountEnabled'?: boolean; - /** - * The apps and app roles which this user has been assigned. - */ - 'appRoleAssignments'?: Array; - /** - * The name displayed in the address book for the user. This value is usually the combination of the user\'s first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. - */ - 'displayName': string; - /** - * A collection of drives available for this user. Read-only. - */ - 'drives'?: Array; - 'drive'?: Drive; - /** - * Identities associated with this account. - */ - 'identities'?: Array; - /** - * The SMTP address for the user, for example, \'jeff@contoso.onowncloud.com\'. Returned by default. - */ - 'mail'?: string; - /** - * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. - */ - 'memberOf'?: Array; - /** - * Contains the on-premises SAM account name synchronized from the on-premises directory. - */ - 'onPremisesSamAccountName': string; - 'passwordProfile'?: PasswordProfile; - /** - * The user\'s surname (family name or last name). Returned by default. - */ - 'surname'?: string; - /** - * The user\'s givenName. Returned by default. - */ - 'givenName'?: string; - /** - * The user`s type. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. - */ - 'userType'?: string; - /** - * Represents the users language setting, ISO-639-1 Code - */ - 'preferredLanguage'?: string; - 'signInActivity'?: SignInActivity; - /** - * A unique identifier assigned to the user by the organization. - */ - 'externalID'?: string; - /** - * A unique reference to the user. This is used to query the user from a different oCIS instance connected to the same identity provider. - */ - 'crossInstanceReference'?: string; - /** - * oCIS instances that the user is either a member or a guest of. - */ - 'instances'?: Array; -} -/** - * Represents updates to an Active Directory user object. - */ -export interface UserUpdate { - /** - * Read-only. - */ - 'id'?: string; - /** - * Set to \"true\" when the account is enabled. - */ - 'accountEnabled'?: boolean; - /** - * The apps and app roles which this user has been assigned. - */ - 'appRoleAssignments'?: Array; - /** - * The name displayed in the address book for the user. This value is usually the combination of the user\'s first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. - */ - 'displayName'?: string; - /** - * A collection of drives available for this user. Read-only. - */ - 'drives'?: Array; - 'drive'?: Drive; - /** - * Identities associated with this account. - */ - 'identities'?: Array; - /** - * The SMTP address for the user, for example, \'jeff@contoso.onowncloud.com\'. Returned by default. - */ - 'mail'?: string; - /** - * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. - */ - 'memberOf'?: Array; - /** - * Contains the on-premises SAM account name synchronized from the on-premises directory. - */ - 'onPremisesSamAccountName'?: string; - 'passwordProfile'?: PasswordProfile; - /** - * The user\'s surname (family name or last name). Returned by default. - */ - 'surname'?: string; - /** - * The user\'s givenName. Returned by default. - */ - 'givenName'?: string; - /** - * The user`s type. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. - */ - 'userType'?: string; - /** - * Represents the users language setting, ISO-639-1 Code - */ - 'preferredLanguage'?: string; - 'signInActivity'?: SignInActivity; - /** - * A unique identifier assigned to the user by the organization. - */ - 'externalID'?: string; - /** - * A unique reference to the user. This is used to query the user from a different oCIS instance connected to the same identity provider. - */ - 'crossInstanceReference'?: string; - /** - * oCIS instances that the user is either a member or a guest of. - */ - 'instances'?: Array; -} -/** - * The video resource groups video-related data items into a single structure. If a driveItem has a non-null video facet, the item represents a video file. The properties of the video resource are populated by extracting metadata from the file. - */ -export interface Video { - /** - * Number of audio bits per sample. - */ - 'audioBitsPerSample'?: number; - /** - * Number of audio channels. - */ - 'audioChannels'?: number; - /** - * Name of the audio format (AAC, MP3, etc.). - */ - 'audioFormat'?: string; - /** - * Number of audio samples per second. - */ - 'audioSamplesPerSecond'?: number; - /** - * Bit rate of the video in bits per second. - */ - 'bitrate'?: number; - /** - * Duration of the file in milliseconds. - */ - 'duration'?: number; - /** - * \\\"Four character code\\\" name of the video format. - */ - 'fourCC'?: string; - /** - * Frame rate of the video. - */ - 'frameRate'?: number; - /** - * Height of the video, in pixels. - */ - 'height'?: number; - /** - * Width of the video, in pixels. - */ - 'width'?: number; -} - -/** - * ActivitiesApi - axios parameter creator - */ -export const ActivitiesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get activities - * @param {string} [kql] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivities: async (kql?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1beta1/extensions/org.libregraph/activities`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if (kql !== undefined) { - localVarQueryParameter['kql'] = kql; - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * ActivitiesApi - functional programming interface - */ -export const ActivitiesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = ActivitiesApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get activities - * @param {string} [kql] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getActivities(kql?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getActivities(kql, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ActivitiesApi.getActivities']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * ActivitiesApi - factory interface - */ -export const ActivitiesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = ActivitiesApiFp(configuration) - return { - /** - * - * @summary Get activities - * @param {string} [kql] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivities(kql?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getActivities(kql, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * ActivitiesApi - object-oriented interface - */ -export class ActivitiesApi extends BaseAPI { - /** - * - * @summary Get activities - * @param {string} [kql] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getActivities(kql?: string, options?: RawAxiosRequestConfig) { - return ActivitiesApiFp(this.configuration).getActivities(kql, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * ApplicationsApi - axios parameter creator - */ -export const ApplicationsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get application by id - * @param {string} applicationId key: id of application - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getApplication: async (applicationId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'applicationId' is not null or undefined - assertParamExists('getApplication', 'applicationId', applicationId) - const localVarPath = `/v1.0/applications/{application-id}` - .replace(`{${"application-id"}}`, encodeURIComponent(String(applicationId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get all applications - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listApplications: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/applications`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * ApplicationsApi - functional programming interface - */ -export const ApplicationsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = ApplicationsApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get application by id - * @param {string} applicationId key: id of application - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getApplication(applicationId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getApplication(applicationId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ApplicationsApi.getApplication']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get all applications - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listApplications(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listApplications(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ApplicationsApi.listApplications']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * ApplicationsApi - factory interface - */ -export const ApplicationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = ApplicationsApiFp(configuration) - return { - /** - * - * @summary Get application by id - * @param {string} applicationId key: id of application - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getApplication(applicationId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getApplication(applicationId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get all applications - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listApplications(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listApplications(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * ApplicationsApi - object-oriented interface - */ -export class ApplicationsApi extends BaseAPI { - /** - * - * @summary Get application by id - * @param {string} applicationId key: id of application - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getApplication(applicationId: string, options?: RawAxiosRequestConfig) { - return ApplicationsApiFp(this.configuration).getApplication(applicationId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get all applications - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listApplications(options?: RawAxiosRequestConfig) { - return ApplicationsApiFp(this.configuration).listApplications(options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * DriveItemApi - axios parameter creator - */ -export const DriveItemApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. - * @summary Delete a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteDriveItem: async (driveId: string, itemId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('deleteDriveItem', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('deleteDriveItem', 'itemId', itemId) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a DriveItem by using its ID. - * @summary Get a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDriveItem: async (driveId: string, itemId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('getDriveItem', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('getDriveItem', 'itemId', itemId) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. - * @summary Update a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItem} driveItem DriveItem properties to update - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateDriveItem: async (driveId: string, itemId: string, driveItem: DriveItem, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('updateDriveItem', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('updateDriveItem', 'itemId', itemId) - // verify required parameter 'driveItem' is not null or undefined - assertParamExists('updateDriveItem', 'driveItem', driveItem) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveItem, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DriveItemApi - functional programming interface - */ -export const DriveItemApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DriveItemApiAxiosParamCreator(configuration) - return { - /** - * Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. - * @summary Delete a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDriveItem(driveId, itemId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DriveItemApi.deleteDriveItem']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Get a DriveItem by using its ID. - * @summary Get a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDriveItem(driveId, itemId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DriveItemApi.getDriveItem']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. - * @summary Update a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItem} driveItem DriveItem properties to update - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateDriveItem(driveId: string, itemId: string, driveItem: DriveItem, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateDriveItem(driveId, itemId, driveItem, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DriveItemApi.updateDriveItem']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * DriveItemApi - factory interface - */ -export const DriveItemApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DriveItemApiFp(configuration) - return { - /** - * Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. - * @summary Delete a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteDriveItem(driveId, itemId, options).then((request) => request(axios, basePath)); - }, - /** - * Get a DriveItem by using its ID. - * @summary Get a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getDriveItem(driveId, itemId, options).then((request) => request(axios, basePath)); - }, - /** - * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. - * @summary Update a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItem} driveItem DriveItem properties to update - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateDriveItem(driveId: string, itemId: string, driveItem: DriveItem, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateDriveItem(driveId, itemId, driveItem, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DriveItemApi - object-oriented interface - */ -export class DriveItemApi extends BaseAPI { - /** - * Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. - * @summary Delete a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig) { - return DriveItemApiFp(this.configuration).deleteDriveItem(driveId, itemId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a DriveItem by using its ID. - * @summary Get a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig) { - return DriveItemApiFp(this.configuration).getDriveItem(driveId, itemId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. - * @summary Update a DriveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItem} driveItem DriveItem properties to update - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateDriveItem(driveId: string, itemId: string, driveItem: DriveItem, options?: RawAxiosRequestConfig) { - return DriveItemApiFp(this.configuration).updateDriveItem(driveId, itemId, driveItem, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * DrivesApi - axios parameter creator - */ -export const DrivesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Create a new drive of a specific type - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createDrive: async (drive: Drive, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'drive' is not null or undefined - assertParamExists('createDrive', 'drive', drive) - const localVarPath = `/v1.0/drives`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(drive, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createDriveBeta: async (drive: Drive, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'drive' is not null or undefined - assertParamExists('createDriveBeta', 'drive', drive) - const localVarPath = `/v1beta1/drives`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(drive, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Delete a specific space - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteDrive: async (driveId: string, ifMatch?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('deleteDrive', 'driveId', driveId) - const localVarPath = `/v1.0/drives/{drive-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - if (ifMatch != null) { - localVarHeaderParameter['If-Match'] = String(ifMatch); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Delete a specific space. Alias for \'/v1.0/drives\'. - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteDriveBeta: async (driveId: string, ifMatch?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('deleteDriveBeta', 'driveId', driveId) - const localVarPath = `/v1beta1/drives/{drive-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - if (ifMatch != null) { - localVarHeaderParameter['If-Match'] = String(ifMatch); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get drive by id - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDrive: async (driveId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('getDrive', 'driveId', driveId) - const localVarPath = `/v1.0/drives/{drive-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDriveBeta: async (driveId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('getDriveBeta', 'driveId', driveId) - const localVarPath = `/v1beta1/drives/{drive-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update the drive - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateDrive: async (driveId: string, driveUpdate: DriveUpdate, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('updateDrive', 'driveId', driveId) - // verify required parameter 'driveUpdate' is not null or undefined - assertParamExists('updateDrive', 'driveUpdate', driveUpdate) - const localVarPath = `/v1.0/drives/{drive-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveUpdate, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateDriveBeta: async (driveId: string, driveUpdate: DriveUpdate, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('updateDriveBeta', 'driveId', driveId) - // verify required parameter 'driveUpdate' is not null or undefined - assertParamExists('updateDriveBeta', 'driveUpdate', driveUpdate) - const localVarPath = `/v1beta1/drives/{drive-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveUpdate, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DrivesApi - functional programming interface - */ -export const DrivesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DrivesApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Create a new drive of a specific type - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createDrive(drive: Drive, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createDrive(drive, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.createDrive']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createDriveBeta(drive: Drive, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createDriveBeta(drive, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.createDriveBeta']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Delete a specific space - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteDrive(driveId: string, ifMatch?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDrive(driveId, ifMatch, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.deleteDrive']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Delete a specific space. Alias for \'/v1.0/drives\'. - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteDriveBeta(driveId: string, ifMatch?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDriveBeta(driveId, ifMatch, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.deleteDriveBeta']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get drive by id - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getDrive(driveId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDrive(driveId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.getDrive']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getDriveBeta(driveId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDriveBeta(driveId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.getDriveBeta']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update the drive - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateDrive(driveId: string, driveUpdate: DriveUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateDrive(driveId, driveUpdate, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.updateDrive']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateDriveBeta(driveId: string, driveUpdate: DriveUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateDriveBeta(driveId, driveUpdate, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesApi.updateDriveBeta']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * DrivesApi - factory interface - */ -export const DrivesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DrivesApiFp(configuration) - return { - /** - * - * @summary Create a new drive of a specific type - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createDrive(drive: Drive, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createDrive(drive, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createDriveBeta(drive: Drive, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createDriveBeta(drive, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Delete a specific space - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteDrive(driveId: string, ifMatch?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteDrive(driveId, ifMatch, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Delete a specific space. Alias for \'/v1.0/drives\'. - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteDriveBeta(driveId: string, ifMatch?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteDriveBeta(driveId, ifMatch, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get drive by id - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDrive(driveId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getDrive(driveId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDriveBeta(driveId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getDriveBeta(driveId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update the drive - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateDrive(driveId: string, driveUpdate: DriveUpdate, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateDrive(driveId, driveUpdate, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateDriveBeta(driveId: string, driveUpdate: DriveUpdate, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateDriveBeta(driveId, driveUpdate, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DrivesApi - object-oriented interface - */ -export class DrivesApi extends BaseAPI { - /** - * - * @summary Create a new drive of a specific type - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createDrive(drive: Drive, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).createDrive(drive, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. - * @param {Drive} drive New space property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createDriveBeta(drive: Drive, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).createDriveBeta(drive, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Delete a specific space - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteDrive(driveId: string, ifMatch?: string, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).deleteDrive(driveId, ifMatch, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Delete a specific space. Alias for \'/v1.0/drives\'. - * @param {string} driveId key: id of drive - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteDriveBeta(driveId: string, ifMatch?: string, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).deleteDriveBeta(driveId, ifMatch, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get drive by id - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getDrive(driveId: string, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).getDrive(driveId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getDriveBeta(driveId: string, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).getDriveBeta(driveId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update the drive - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateDrive(driveId: string, driveUpdate: DriveUpdate, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).updateDrive(driveId, driveUpdate, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} driveId key: id of drive - * @param {DriveUpdate} driveUpdate New space values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateDriveBeta(driveId: string, driveUpdate: DriveUpdate, options?: RawAxiosRequestConfig) { - return DrivesApiFp(this.configuration).updateDriveBeta(driveId, driveUpdate, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * DrivesGetDrivesApi - axios parameter creator - */ -export const DrivesGetDrivesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get all available drives - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listAllDrives: async ($orderby?: string, $filter?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/drives`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($orderby !== undefined) { - localVarQueryParameter['$orderby'] = $orderby; - } - - if ($filter !== undefined) { - localVarQueryParameter['$filter'] = $filter; - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listAllDrivesBeta: async ($orderby?: string, $filter?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1beta1/drives`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($orderby !== undefined) { - localVarQueryParameter['$orderby'] = $orderby; - } - - if ($filter !== undefined) { - localVarQueryParameter['$filter'] = $filter; - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DrivesGetDrivesApi - functional programming interface - */ -export const DrivesGetDrivesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DrivesGetDrivesApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get all available drives - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listAllDrives($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listAllDrives($orderby, $filter, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesGetDrivesApi.listAllDrives']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listAllDrivesBeta($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listAllDrivesBeta($orderby, $filter, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesGetDrivesApi.listAllDrivesBeta']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * DrivesGetDrivesApi - factory interface - */ -export const DrivesGetDrivesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DrivesGetDrivesApiFp(configuration) - return { - /** - * - * @summary Get all available drives - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listAllDrives($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listAllDrives($orderby, $filter, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listAllDrivesBeta($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listAllDrivesBeta($orderby, $filter, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DrivesGetDrivesApi - object-oriented interface - */ -export class DrivesGetDrivesApi extends BaseAPI { - /** - * - * @summary Get all available drives - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listAllDrives($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig) { - return DrivesGetDrivesApiFp(this.configuration).listAllDrives($orderby, $filter, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listAllDrivesBeta($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig) { - return DrivesGetDrivesApiFp(this.configuration).listAllDrivesBeta($orderby, $filter, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * DrivesPermissionsApi - axios parameter creator - */ -export const DrivesPermissionsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createLink: async (driveId: string, itemId: string, driveItemCreateLink?: DriveItemCreateLink, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('createLink', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('createLink', 'itemId', itemId) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}/createLink` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveItemCreateLink, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePermission: async (driveId: string, itemId: string, permId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('deletePermission', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('deletePermission', 'itemId', itemId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('deletePermission', 'permId', permId) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get sharing permission for a file or folder - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPermission: async (driveId: string, itemId: string, permId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('getPermission', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('getPermission', 'itemId', itemId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('getPermission', 'permId', permId) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - invite: async (driveId: string, itemId: string, driveItemInvite?: DriveItemInvite, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('invite', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('invite', 'itemId', itemId) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}/invite` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveItemInvite, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective sharing permissions on a driveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPermissions: async (driveId: string, itemId: string, $filter?: string, $select?: Set, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('listPermissions', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('listPermissions', 'itemId', itemId) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($filter !== undefined) { - localVarQueryParameter['$filter'] = $filter; - } - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - setPermissionPassword: async (driveId: string, itemId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('setPermissionPassword', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('setPermissionPassword', 'itemId', itemId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('setPermissionPassword', 'permId', permId) - // verify required parameter 'sharingLinkPassword' is not null or undefined - assertParamExists('setPermissionPassword', 'sharingLinkPassword', sharingLinkPassword) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(sharingLinkPassword, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePermission: async (driveId: string, itemId: string, permId: string, permission: Permission, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('updatePermission', 'driveId', driveId) - // verify required parameter 'itemId' is not null or undefined - assertParamExists('updatePermission', 'itemId', itemId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('updatePermission', 'permId', permId) - // verify required parameter 'permission' is not null or undefined - assertParamExists('updatePermission', 'permission', permission) - const localVarPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"item-id"}}`, encodeURIComponent(String(itemId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(permission, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DrivesPermissionsApi - functional programming interface - */ -export const DrivesPermissionsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DrivesPermissionsApiAxiosParamCreator(configuration) - return { - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createLink(driveId: string, itemId: string, driveItemCreateLink?: DriveItemCreateLink, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createLink(driveId, itemId, driveItemCreateLink, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesPermissionsApi.createLink']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deletePermission(driveId: string, itemId: string, permId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deletePermission(driveId, itemId, permId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesPermissionsApi.deletePermission']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get sharing permission for a file or folder - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getPermission(driveId: string, itemId: string, permId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPermission(driveId, itemId, permId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesPermissionsApi.getPermission']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async invite(driveId: string, itemId: string, driveItemInvite?: DriveItemInvite, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.invite(driveId, itemId, driveItemInvite, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesPermissionsApi.invite']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective sharing permissions on a driveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listPermissions(driveId: string, itemId: string, $filter?: string, $select?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listPermissions(driveId, itemId, $filter, $select, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesPermissionsApi.listPermissions']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async setPermissionPassword(driveId: string, itemId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.setPermissionPassword(driveId, itemId, permId, sharingLinkPassword, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesPermissionsApi.setPermissionPassword']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updatePermission(driveId: string, itemId: string, permId: string, permission: Permission, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updatePermission(driveId, itemId, permId, permission, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesPermissionsApi.updatePermission']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * DrivesPermissionsApi - factory interface - */ -export const DrivesPermissionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DrivesPermissionsApiFp(configuration) - return { - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createLink(driveId: string, itemId: string, driveItemCreateLink?: DriveItemCreateLink, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createLink(driveId, itemId, driveItemCreateLink, options).then((request) => request(axios, basePath)); - }, - /** - * Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePermission(driveId: string, itemId: string, permId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deletePermission(driveId, itemId, permId, options).then((request) => request(axios, basePath)); - }, - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get sharing permission for a file or folder - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPermission(driveId: string, itemId: string, permId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getPermission(driveId, itemId, permId, options).then((request) => request(axios, basePath)); - }, - /** - * Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - invite(driveId: string, itemId: string, driveItemInvite?: DriveItemInvite, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.invite(driveId, itemId, driveItemInvite, options).then((request) => request(axios, basePath)); - }, - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective sharing permissions on a driveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPermissions(driveId: string, itemId: string, $filter?: string, $select?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listPermissions(driveId, itemId, $filter, $select, options).then((request) => request(axios, basePath)); - }, - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - setPermissionPassword(driveId: string, itemId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.setPermissionPassword(driveId, itemId, permId, sharingLinkPassword, options).then((request) => request(axios, basePath)); - }, - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePermission(driveId: string, itemId: string, permId: string, permission: Permission, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updatePermission(driveId, itemId, permId, permission, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DrivesPermissionsApi - object-oriented interface - */ -export class DrivesPermissionsApi extends BaseAPI { - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createLink(driveId: string, itemId: string, driveItemCreateLink?: DriveItemCreateLink, options?: RawAxiosRequestConfig) { - return DrivesPermissionsApiFp(this.configuration).createLink(driveId, itemId, driveItemCreateLink, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a DriveItem - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deletePermission(driveId: string, itemId: string, permId: string, options?: RawAxiosRequestConfig) { - return DrivesPermissionsApiFp(this.configuration).deletePermission(driveId, itemId, permId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get sharing permission for a file or folder - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getPermission(driveId: string, itemId: string, permId: string, options?: RawAxiosRequestConfig) { - return DrivesPermissionsApiFp(this.configuration).getPermission(driveId, itemId, permId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public invite(driveId: string, itemId: string, driveItemInvite?: DriveItemInvite, options?: RawAxiosRequestConfig) { - return DrivesPermissionsApiFp(this.configuration).invite(driveId, itemId, driveItemInvite, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective sharing permissions on a driveItem. - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listPermissions(driveId: string, itemId: string, $filter?: string, $select?: Set, options?: RawAxiosRequestConfig) { - return DrivesPermissionsApiFp(this.configuration).listPermissions(driveId, itemId, $filter, $select, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public setPermissionPassword(driveId: string, itemId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options?: RawAxiosRequestConfig) { - return DrivesPermissionsApiFp(this.configuration).setPermissionPassword(driveId, itemId, permId, sharingLinkPassword, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} itemId key: id of item - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updatePermission(driveId: string, itemId: string, permId: string, permission: Permission, options?: RawAxiosRequestConfig) { - return DrivesPermissionsApiFp(this.configuration).updatePermission(driveId, itemId, permId, permission, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const ListPermissionsSelectEnum = { - LibreGraphPermissionsActionsAllowedValues: '@libre.graph.permissions.actions.allowedValues', - LibreGraphPermissionsRolesAllowedValues: '@libre.graph.permissions.roles.allowedValues', - Value: 'value' -} as const; -export type ListPermissionsSelectEnum = typeof ListPermissionsSelectEnum[keyof typeof ListPermissionsSelectEnum]; - - -/** - * DrivesRootApi - axios parameter creator - */ -export const DrivesRootApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. - * @summary Create a drive item - * @param {string} driveId key: id of drive - * @param {DriveItem} [driveItem] In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createDriveItem: async (driveId: string, driveItem?: DriveItem, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('createDriveItem', 'driveId', driveId) - const localVarPath = `/v1beta1/drives/{drive-id}/root/children` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveItem, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for the root item of a Drive - * @param {string} driveId key: id of drive - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createLinkSpaceRoot: async (driveId: string, driveItemCreateLink?: DriveItemCreateLink, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('createLinkSpaceRoot', 'driveId', driveId) - const localVarPath = `/v1beta1/drives/{drive-id}/root/createLink` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveItemCreateLink, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a Drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePermissionSpaceRoot: async (driveId: string, permId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('deletePermissionSpaceRoot', 'driveId', driveId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('deletePermissionSpaceRoot', 'permId', permId) - const localVarPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get a single sharing permission for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPermissionSpaceRoot: async (driveId: string, permId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('getPermissionSpaceRoot', 'driveId', driveId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('getPermissionSpaceRoot', 'permId', permId) - const localVarPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get root from arbitrary space - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRoot: async (driveId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('getRoot', 'driveId', driveId) - const localVarPath = `/v1.0/drives/{drive-id}/root` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - inviteSpaceRoot: async (driveId: string, driveItemInvite?: DriveItemInvite, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('inviteSpaceRoot', 'driveId', driveId) - const localVarPath = `/v1beta1/drives/{drive-id}/root/invite` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(driveItemInvite, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective permissions on the root item of a drive. - * @param {string} driveId key: id of drive - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPermissionsSpaceRoot: async (driveId: string, $filter?: string, $select?: Set, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('listPermissionsSpaceRoot', 'driveId', driveId) - const localVarPath = `/v1beta1/drives/{drive-id}/root/permissions` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($filter !== undefined) { - localVarQueryParameter['$filter'] = $filter; - } - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - setPermissionPasswordSpaceRoot: async (driveId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('setPermissionPasswordSpaceRoot', 'driveId', driveId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('setPermissionPasswordSpaceRoot', 'permId', permId) - // verify required parameter 'sharingLinkPassword' is not null or undefined - assertParamExists('setPermissionPasswordSpaceRoot', 'sharingLinkPassword', sharingLinkPassword) - const localVarPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}/setPassword` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(sharingLinkPassword, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePermissionSpaceRoot: async (driveId: string, permId: string, permission: Permission, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'driveId' is not null or undefined - assertParamExists('updatePermissionSpaceRoot', 'driveId', driveId) - // verify required parameter 'permId' is not null or undefined - assertParamExists('updatePermissionSpaceRoot', 'permId', permId) - // verify required parameter 'permission' is not null or undefined - assertParamExists('updatePermissionSpaceRoot', 'permission', permission) - const localVarPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}` - .replace(`{${"drive-id"}}`, encodeURIComponent(String(driveId))) - .replace(`{${"perm-id"}}`, encodeURIComponent(String(permId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(permission, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DrivesRootApi - functional programming interface - */ -export const DrivesRootApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DrivesRootApiAxiosParamCreator(configuration) - return { - /** - * You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. - * @summary Create a drive item - * @param {string} driveId key: id of drive - * @param {DriveItem} [driveItem] In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createDriveItem(driveId: string, driveItem?: DriveItem, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createDriveItem(driveId, driveItem, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.createDriveItem']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for the root item of a Drive - * @param {string} driveId key: id of drive - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createLinkSpaceRoot(driveId: string, driveItemCreateLink?: DriveItemCreateLink, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createLinkSpaceRoot(driveId, driveItemCreateLink, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.createLinkSpaceRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a Drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deletePermissionSpaceRoot(driveId: string, permId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deletePermissionSpaceRoot(driveId, permId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.deletePermissionSpaceRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get a single sharing permission for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getPermissionSpaceRoot(driveId: string, permId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionSpaceRoot(driveId, permId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.getPermissionSpaceRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get root from arbitrary space - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getRoot(driveId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getRoot(driveId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.getRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async inviteSpaceRoot(driveId: string, driveItemInvite?: DriveItemInvite, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.inviteSpaceRoot(driveId, driveItemInvite, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.inviteSpaceRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective permissions on the root item of a drive. - * @param {string} driveId key: id of drive - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listPermissionsSpaceRoot(driveId: string, $filter?: string, $select?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listPermissionsSpaceRoot(driveId, $filter, $select, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.listPermissionsSpaceRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async setPermissionPasswordSpaceRoot(driveId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.setPermissionPasswordSpaceRoot(driveId, permId, sharingLinkPassword, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.setPermissionPasswordSpaceRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updatePermissionSpaceRoot(driveId: string, permId: string, permission: Permission, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updatePermissionSpaceRoot(driveId, permId, permission, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DrivesRootApi.updatePermissionSpaceRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * DrivesRootApi - factory interface - */ -export const DrivesRootApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DrivesRootApiFp(configuration) - return { - /** - * You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. - * @summary Create a drive item - * @param {string} driveId key: id of drive - * @param {DriveItem} [driveItem] In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createDriveItem(driveId: string, driveItem?: DriveItem, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createDriveItem(driveId, driveItem, options).then((request) => request(axios, basePath)); - }, - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for the root item of a Drive - * @param {string} driveId key: id of drive - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createLinkSpaceRoot(driveId: string, driveItemCreateLink?: DriveItemCreateLink, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createLinkSpaceRoot(driveId, driveItemCreateLink, options).then((request) => request(axios, basePath)); - }, - /** - * Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a Drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePermissionSpaceRoot(driveId: string, permId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deletePermissionSpaceRoot(driveId, permId, options).then((request) => request(axios, basePath)); - }, - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get a single sharing permission for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPermissionSpaceRoot(driveId: string, permId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getPermissionSpaceRoot(driveId, permId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get root from arbitrary space - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRoot(driveId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getRoot(driveId, options).then((request) => request(axios, basePath)); - }, - /** - * Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - inviteSpaceRoot(driveId: string, driveItemInvite?: DriveItemInvite, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.inviteSpaceRoot(driveId, driveItemInvite, options).then((request) => request(axios, basePath)); - }, - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective permissions on the root item of a drive. - * @param {string} driveId key: id of drive - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPermissionsSpaceRoot(driveId: string, $filter?: string, $select?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listPermissionsSpaceRoot(driveId, $filter, $select, options).then((request) => request(axios, basePath)); - }, - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - setPermissionPasswordSpaceRoot(driveId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.setPermissionPasswordSpaceRoot(driveId, permId, sharingLinkPassword, options).then((request) => request(axios, basePath)); - }, - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePermissionSpaceRoot(driveId: string, permId: string, permission: Permission, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updatePermissionSpaceRoot(driveId, permId, permission, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DrivesRootApi - object-oriented interface - */ -export class DrivesRootApi extends BaseAPI { - /** - * You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. - * @summary Create a drive item - * @param {string} driveId key: id of drive - * @param {DriveItem} [driveItem] In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createDriveItem(driveId: string, driveItem?: DriveItem, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).createDriveItem(driveId, driveItem, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | - * @summary Create a sharing link for the root item of a Drive - * @param {string} driveId key: id of drive - * @param {DriveItemCreateLink} [driveItemCreateLink] In the request body, provide a JSON object with the following parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createLinkSpaceRoot(driveId: string, driveItemCreateLink?: DriveItemCreateLink, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).createLinkSpaceRoot(driveId, driveItemCreateLink, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. - * @summary Remove access to a Drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deletePermissionSpaceRoot(driveId: string, permId: string, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).deletePermissionSpaceRoot(driveId, permId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Return the effective sharing permission for a particular permission resource. - * @summary Get a single sharing permission for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getPermissionSpaceRoot(driveId: string, permId: string, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).getPermissionSpaceRoot(driveId, permId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get root from arbitrary space - * @param {string} driveId key: id of drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getRoot(driveId: string, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).getRoot(driveId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. - * @summary Send a sharing invitation - * @param {string} driveId key: id of drive - * @param {DriveItemInvite} [driveItemInvite] In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public inviteSpaceRoot(driveId: string, driveItemInvite?: DriveItemInvite, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).inviteSpaceRoot(driveId, driveItemInvite, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. - * @summary List the effective permissions on the root item of a drive. - * @param {string} driveId key: id of drive - * @param {string} [$filter] Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. - * @param {Set} [$select] Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listPermissionsSpaceRoot(driveId: string, $filter?: string, $select?: Set, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).listPermissionsSpaceRoot(driveId, $filter, $select, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Set the password of a sharing permission. Only the `password` property can be modified this way. - * @summary Set sharing link password for the root item of a drive - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {SharingLinkPassword} sharingLinkPassword New password value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public setPermissionPasswordSpaceRoot(driveId: string, permId: string, sharingLinkPassword: SharingLinkPassword, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).setPermissionPasswordSpaceRoot(driveId, permId, sharingLinkPassword, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. - * @summary Update sharing permission - * @param {string} driveId key: id of drive - * @param {string} permId key: id of permission - * @param {Permission} permission New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updatePermissionSpaceRoot(driveId: string, permId: string, permission: Permission, options?: RawAxiosRequestConfig) { - return DrivesRootApiFp(this.configuration).updatePermissionSpaceRoot(driveId, permId, permission, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const ListPermissionsSpaceRootSelectEnum = { - LibreGraphPermissionsActionsAllowedValues: '@libre.graph.permissions.actions.allowedValues', - LibreGraphPermissionsRolesAllowedValues: '@libre.graph.permissions.roles.allowedValues', - Value: 'value' -} as const; -export type ListPermissionsSpaceRootSelectEnum = typeof ListPermissionsSpaceRootSelectEnum[keyof typeof ListPermissionsSpaceRootSelectEnum]; - - -/** - * EducationClassApi - axios parameter creator - */ -export const EducationClassApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Assign a user to a class - * @param {string} classId key: id or externalId of class - * @param {ClassMemberReference} classMemberReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addUserToClass: async (classId: string, classMemberReference: ClassMemberReference, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('addUserToClass', 'classId', classId) - // verify required parameter 'classMemberReference' is not null or undefined - assertParamExists('addUserToClass', 'classMemberReference', classMemberReference) - const localVarPath = `/v1.0/education/classes/{class-id}/members/$ref` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(classMemberReference, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Add new education class - * @param {EducationClass} educationClass New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createClass: async (educationClass: EducationClass, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'educationClass' is not null or undefined - assertParamExists('createClass', 'educationClass', educationClass) - const localVarPath = `/v1.0/education/classes`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(educationClass, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Delete education class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteClass: async (classId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('deleteClass', 'classId', classId) - const localVarPath = `/v1.0/education/classes/{class-id}` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Unassign user from a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign from class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUserFromClass: async (classId: string, userId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('deleteUserFromClass', 'classId', classId) - // verify required parameter 'userId' is not null or undefined - assertParamExists('deleteUserFromClass', 'userId', userId) - const localVarPath = `/v1.0/education/classes/{class-id}/members/{user-id}/$ref` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))) - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get class by key - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getClass: async (classId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('getClass', 'classId', classId) - const localVarPath = `/v1.0/education/classes/{class-id}` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listClassMembers: async (classId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('listClassMembers', 'classId', classId) - const localVarPath = `/v1.0/education/classes/{class-id}/members` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary list education classes - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listClasses: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/education/classes`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update properties of a education class - * @param {string} classId key: id or externalId of class - * @param {EducationClass} educationClass New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateClass: async (classId: string, educationClass: EducationClass, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('updateClass', 'classId', classId) - // verify required parameter 'educationClass' is not null or undefined - assertParamExists('updateClass', 'educationClass', educationClass) - const localVarPath = `/v1.0/education/classes/{class-id}` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(educationClass, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * EducationClassApi - functional programming interface - */ -export const EducationClassApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EducationClassApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Assign a user to a class - * @param {string} classId key: id or externalId of class - * @param {ClassMemberReference} classMemberReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addUserToClass(classId: string, classMemberReference: ClassMemberReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addUserToClass(classId, classMemberReference, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.addUserToClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Add new education class - * @param {EducationClass} educationClass New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createClass(educationClass: EducationClass, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createClass(educationClass, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.createClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Delete education class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteClass(classId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteClass(classId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.deleteClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Unassign user from a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign from class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteUserFromClass(classId: string, userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUserFromClass(classId, userId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.deleteUserFromClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get class by key - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getClass(classId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getClass(classId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.getClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listClassMembers(classId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listClassMembers(classId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.listClassMembers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary list education classes - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listClasses(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listClasses(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.listClasses']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update properties of a education class - * @param {string} classId key: id or externalId of class - * @param {EducationClass} educationClass New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateClass(classId: string, educationClass: EducationClass, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateClass(classId, educationClass, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassApi.updateClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * EducationClassApi - factory interface - */ -export const EducationClassApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = EducationClassApiFp(configuration) - return { - /** - * - * @summary Assign a user to a class - * @param {string} classId key: id or externalId of class - * @param {ClassMemberReference} classMemberReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addUserToClass(classId: string, classMemberReference: ClassMemberReference, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addUserToClass(classId, classMemberReference, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Add new education class - * @param {EducationClass} educationClass New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createClass(educationClass: EducationClass, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createClass(educationClass, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Delete education class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteClass(classId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteClass(classId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Unassign user from a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign from class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUserFromClass(classId: string, userId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteUserFromClass(classId, userId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get class by key - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getClass(classId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getClass(classId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listClassMembers(classId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listClassMembers(classId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary list education classes - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listClasses(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listClasses(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update properties of a education class - * @param {string} classId key: id or externalId of class - * @param {EducationClass} educationClass New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateClass(classId: string, educationClass: EducationClass, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateClass(classId, educationClass, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * EducationClassApi - object-oriented interface - */ -export class EducationClassApi extends BaseAPI { - /** - * - * @summary Assign a user to a class - * @param {string} classId key: id or externalId of class - * @param {ClassMemberReference} classMemberReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public addUserToClass(classId: string, classMemberReference: ClassMemberReference, options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).addUserToClass(classId, classMemberReference, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Add new education class - * @param {EducationClass} educationClass New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createClass(educationClass: EducationClass, options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).createClass(educationClass, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Delete education class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteClass(classId: string, options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).deleteClass(classId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Unassign user from a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign from class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteUserFromClass(classId: string, userId: string, options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).deleteUserFromClass(classId, userId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get class by key - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getClass(classId: string, options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).getClass(classId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listClassMembers(classId: string, options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).listClassMembers(classId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary list education classes - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listClasses(options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).listClasses(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update properties of a education class - * @param {string} classId key: id or externalId of class - * @param {EducationClass} educationClass New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateClass(classId: string, educationClass: EducationClass, options?: RawAxiosRequestConfig) { - return EducationClassApiFp(this.configuration).updateClass(classId, educationClass, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * EducationClassTeachersApi - axios parameter creator - */ -export const EducationClassTeachersApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Assign a teacher to a class - * @param {string} classId key: id or externalId of class - * @param {ClassTeacherReference} classTeacherReference educationUser to be added as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addTeacherToClass: async (classId: string, classTeacherReference: ClassTeacherReference, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('addTeacherToClass', 'classId', classId) - // verify required parameter 'classTeacherReference' is not null or undefined - assertParamExists('addTeacherToClass', 'classTeacherReference', classTeacherReference) - const localVarPath = `/v1.0/education/classes/{class-id}/teachers/$ref` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(classTeacherReference, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Unassign user as teacher of a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteTeacherFromClass: async (classId: string, userId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('deleteTeacherFromClass', 'classId', classId) - // verify required parameter 'userId' is not null or undefined - assertParamExists('deleteTeacherFromClass', 'userId', userId) - const localVarPath = `/v1.0/education/classes/{class-id}/teachers/{user-id}/$ref` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))) - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get the teachers for a class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTeachers: async (classId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'classId' is not null or undefined - assertParamExists('getTeachers', 'classId', classId) - const localVarPath = `/v1.0/education/classes/{class-id}/teachers` - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * EducationClassTeachersApi - functional programming interface - */ -export const EducationClassTeachersApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EducationClassTeachersApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Assign a teacher to a class - * @param {string} classId key: id or externalId of class - * @param {ClassTeacherReference} classTeacherReference educationUser to be added as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addTeacherToClass(classId: string, classTeacherReference: ClassTeacherReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addTeacherToClass(classId, classTeacherReference, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassTeachersApi.addTeacherToClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Unassign user as teacher of a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteTeacherFromClass(classId: string, userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTeacherFromClass(classId, userId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassTeachersApi.deleteTeacherFromClass']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the teachers for a class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getTeachers(classId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getTeachers(classId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationClassTeachersApi.getTeachers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * EducationClassTeachersApi - factory interface - */ -export const EducationClassTeachersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = EducationClassTeachersApiFp(configuration) - return { - /** - * - * @summary Assign a teacher to a class - * @param {string} classId key: id or externalId of class - * @param {ClassTeacherReference} classTeacherReference educationUser to be added as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addTeacherToClass(classId: string, classTeacherReference: ClassTeacherReference, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addTeacherToClass(classId, classTeacherReference, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Unassign user as teacher of a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteTeacherFromClass(classId: string, userId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteTeacherFromClass(classId, userId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the teachers for a class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTeachers(classId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getTeachers(classId, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * EducationClassTeachersApi - object-oriented interface - */ -export class EducationClassTeachersApi extends BaseAPI { - /** - * - * @summary Assign a teacher to a class - * @param {string} classId key: id or externalId of class - * @param {ClassTeacherReference} classTeacherReference educationUser to be added as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public addTeacherToClass(classId: string, classTeacherReference: ClassTeacherReference, options?: RawAxiosRequestConfig) { - return EducationClassTeachersApiFp(this.configuration).addTeacherToClass(classId, classTeacherReference, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Unassign user as teacher of a class - * @param {string} classId key: id or externalId of class - * @param {string} userId key: id or username of the user to unassign as teacher - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteTeacherFromClass(classId: string, userId: string, options?: RawAxiosRequestConfig) { - return EducationClassTeachersApiFp(this.configuration).deleteTeacherFromClass(classId, userId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the teachers for a class - * @param {string} classId key: id or externalId of class - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getTeachers(classId: string, options?: RawAxiosRequestConfig) { - return EducationClassTeachersApiFp(this.configuration).getTeachers(classId, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * EducationSchoolApi - axios parameter creator - */ -export const EducationSchoolApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Assign a class to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {ClassReference} classReference educationClass to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addClassToSchool: async (schoolId: string, classReference: ClassReference, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('addClassToSchool', 'schoolId', schoolId) - // verify required parameter 'classReference' is not null or undefined - assertParamExists('addClassToSchool', 'classReference', classReference) - const localVarPath = `/v1.0/education/schools/{school-id}/classes/$ref` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(classReference, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Assign a user to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationUserReference} educationUserReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addUserToSchool: async (schoolId: string, educationUserReference: EducationUserReference, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('addUserToSchool', 'schoolId', schoolId) - // verify required parameter 'educationUserReference' is not null or undefined - assertParamExists('addUserToSchool', 'educationUserReference', educationUserReference) - const localVarPath = `/v1.0/education/schools/{school-id}/users/$ref` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(educationUserReference, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Add new school - * @param {EducationSchool} educationSchool New school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSchool: async (educationSchool: EducationSchool, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'educationSchool' is not null or undefined - assertParamExists('createSchool', 'educationSchool', educationSchool) - const localVarPath = `/v1.0/education/schools`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(educationSchool, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Unassign class from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} classId key: id or externalId of the class to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteClassFromSchool: async (schoolId: string, classId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('deleteClassFromSchool', 'schoolId', schoolId) - // verify required parameter 'classId' is not null or undefined - assertParamExists('deleteClassFromSchool', 'classId', classId) - const localVarPath = `/v1.0/education/schools/{school-id}/classes/{class-id}/$ref` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))) - .replace(`{${"class-id"}}`, encodeURIComponent(String(classId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. - * @summary Delete school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSchool: async (schoolId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('deleteSchool', 'schoolId', schoolId) - const localVarPath = `/v1.0/education/schools/{school-id}` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Unassign user from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} userId key: id or username of the user to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUserFromSchool: async (schoolId: string, userId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('deleteUserFromSchool', 'schoolId', schoolId) - // verify required parameter 'userId' is not null or undefined - assertParamExists('deleteUserFromSchool', 'userId', userId) - const localVarPath = `/v1.0/education/schools/{school-id}/users/{user-id}/$ref` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))) - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get the properties of a specific school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSchool: async (schoolId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('getSchool', 'schoolId', schoolId) - const localVarPath = `/v1.0/education/schools/{school-id}` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSchoolClasses: async (schoolId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('listSchoolClasses', 'schoolId', schoolId) - const localVarPath = `/v1.0/education/schools/{school-id}/classes` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get the educationUser resources associated with an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSchoolUsers: async (schoolId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('listSchoolUsers', 'schoolId', schoolId) - const localVarPath = `/v1.0/education/schools/{school-id}/users` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get a list of schools and their properties - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSchools: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/education/schools`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update properties of a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationSchool} educationSchool New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSchool: async (schoolId: string, educationSchool: EducationSchool, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'schoolId' is not null or undefined - assertParamExists('updateSchool', 'schoolId', schoolId) - // verify required parameter 'educationSchool' is not null or undefined - assertParamExists('updateSchool', 'educationSchool', educationSchool) - const localVarPath = `/v1.0/education/schools/{school-id}` - .replace(`{${"school-id"}}`, encodeURIComponent(String(schoolId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(educationSchool, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * EducationSchoolApi - functional programming interface - */ -export const EducationSchoolApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EducationSchoolApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Assign a class to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {ClassReference} classReference educationClass to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addClassToSchool(schoolId: string, classReference: ClassReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addClassToSchool(schoolId, classReference, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.addClassToSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Assign a user to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationUserReference} educationUserReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addUserToSchool(schoolId: string, educationUserReference: EducationUserReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addUserToSchool(schoolId, educationUserReference, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.addUserToSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Add new school - * @param {EducationSchool} educationSchool New school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createSchool(educationSchool: EducationSchool, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createSchool(educationSchool, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.createSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Unassign class from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} classId key: id or externalId of the class to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteClassFromSchool(schoolId: string, classId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteClassFromSchool(schoolId, classId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.deleteClassFromSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. - * @summary Delete school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteSchool(schoolId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteSchool(schoolId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.deleteSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Unassign user from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} userId key: id or username of the user to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteUserFromSchool(schoolId: string, userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUserFromSchool(schoolId, userId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.deleteUserFromSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the properties of a specific school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getSchool(schoolId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getSchool(schoolId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.getSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listSchoolClasses(schoolId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listSchoolClasses(schoolId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.listSchoolClasses']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the educationUser resources associated with an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listSchoolUsers(schoolId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listSchoolUsers(schoolId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.listSchoolUsers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get a list of schools and their properties - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listSchools(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listSchools(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.listSchools']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update properties of a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationSchool} educationSchool New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateSchool(schoolId: string, educationSchool: EducationSchool, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateSchool(schoolId, educationSchool, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationSchoolApi.updateSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * EducationSchoolApi - factory interface - */ -export const EducationSchoolApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = EducationSchoolApiFp(configuration) - return { - /** - * - * @summary Assign a class to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {ClassReference} classReference educationClass to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addClassToSchool(schoolId: string, classReference: ClassReference, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addClassToSchool(schoolId, classReference, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Assign a user to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationUserReference} educationUserReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addUserToSchool(schoolId: string, educationUserReference: EducationUserReference, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addUserToSchool(schoolId, educationUserReference, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Add new school - * @param {EducationSchool} educationSchool New school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSchool(educationSchool: EducationSchool, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createSchool(educationSchool, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Unassign class from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} classId key: id or externalId of the class to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteClassFromSchool(schoolId: string, classId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteClassFromSchool(schoolId, classId, options).then((request) => request(axios, basePath)); - }, - /** - * Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. - * @summary Delete school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSchool(schoolId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteSchool(schoolId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Unassign user from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} userId key: id or username of the user to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUserFromSchool(schoolId: string, userId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteUserFromSchool(schoolId, userId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the properties of a specific school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSchool(schoolId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getSchool(schoolId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSchoolClasses(schoolId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listSchoolClasses(schoolId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the educationUser resources associated with an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSchoolUsers(schoolId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listSchoolUsers(schoolId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get a list of schools and their properties - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSchools(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listSchools(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update properties of a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationSchool} educationSchool New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSchool(schoolId: string, educationSchool: EducationSchool, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateSchool(schoolId, educationSchool, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * EducationSchoolApi - object-oriented interface - */ -export class EducationSchoolApi extends BaseAPI { - /** - * - * @summary Assign a class to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {ClassReference} classReference educationClass to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public addClassToSchool(schoolId: string, classReference: ClassReference, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).addClassToSchool(schoolId, classReference, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Assign a user to a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationUserReference} educationUserReference educationUser to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public addUserToSchool(schoolId: string, educationUserReference: EducationUserReference, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).addUserToSchool(schoolId, educationUserReference, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Add new school - * @param {EducationSchool} educationSchool New school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createSchool(educationSchool: EducationSchool, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).createSchool(educationSchool, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Unassign class from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} classId key: id or externalId of the class to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteClassFromSchool(schoolId: string, classId: string, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).deleteClassFromSchool(schoolId, classId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. - * @summary Delete school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteSchool(schoolId: string, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).deleteSchool(schoolId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Unassign user from a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {string} userId key: id or username of the user to unassign from school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteUserFromSchool(schoolId: string, userId: string, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).deleteUserFromSchool(schoolId, userId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the properties of a specific school - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getSchool(schoolId: string, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).getSchool(schoolId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the educationClass resources owned by an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listSchoolClasses(schoolId: string, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).listSchoolClasses(schoolId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the educationUser resources associated with an educationSchool - * @param {string} schoolId key: id or schoolNumber of school - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listSchoolUsers(schoolId: string, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).listSchoolUsers(schoolId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get a list of schools and their properties - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listSchools(options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).listSchools(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update properties of a school - * @param {string} schoolId key: id or schoolNumber of school - * @param {EducationSchool} educationSchool New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateSchool(schoolId: string, educationSchool: EducationSchool, options?: RawAxiosRequestConfig) { - return EducationSchoolApiFp(this.configuration).updateSchool(schoolId, educationSchool, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * EducationUserApi - axios parameter creator - */ -export const EducationUserApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Add new education user - * @param {EducationUser} educationUser New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createEducationUser: async (educationUser: EducationUser, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'educationUser' is not null or undefined - assertParamExists('createEducationUser', 'educationUser', educationUser) - const localVarPath = `/v1.0/education/users`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(educationUser, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Delete educationUser - * @param {string} userId key: id or username of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteEducationUser: async (userId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('deleteEducationUser', 'userId', userId) - const localVarPath = `/v1.0/education/users/{user-id}` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get properties of educationUser - * @param {string} userId key: id or username of user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getEducationUser: async (userId: string, $expand?: Set, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('getEducationUser', 'userId', userId) - const localVarPath = `/v1.0/education/users/{user-id}` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get entities from education users - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listEducationUsers: async ($orderby?: Set, $expand?: Set, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/education/users`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if ($orderby) { - localVarQueryParameter['$orderby'] = Array.from($orderby).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update properties of educationUser - * @param {string} userId key: id or username of user - * @param {EducationUser} educationUser New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateEducationUser: async (userId: string, educationUser: EducationUser, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('updateEducationUser', 'userId', userId) - // verify required parameter 'educationUser' is not null or undefined - assertParamExists('updateEducationUser', 'educationUser', educationUser) - const localVarPath = `/v1.0/education/users/{user-id}` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(educationUser, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * EducationUserApi - functional programming interface - */ -export const EducationUserApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EducationUserApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Add new education user - * @param {EducationUser} educationUser New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createEducationUser(educationUser: EducationUser, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createEducationUser(educationUser, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationUserApi.createEducationUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Delete educationUser - * @param {string} userId key: id or username of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteEducationUser(userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteEducationUser(userId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationUserApi.deleteEducationUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get properties of educationUser - * @param {string} userId key: id or username of user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getEducationUser(userId: string, $expand?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getEducationUser(userId, $expand, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationUserApi.getEducationUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get entities from education users - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listEducationUsers($orderby?: Set, $expand?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listEducationUsers($orderby, $expand, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationUserApi.listEducationUsers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update properties of educationUser - * @param {string} userId key: id or username of user - * @param {EducationUser} educationUser New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateEducationUser(userId: string, educationUser: EducationUser, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateEducationUser(userId, educationUser, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationUserApi.updateEducationUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * EducationUserApi - factory interface - */ -export const EducationUserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = EducationUserApiFp(configuration) - return { - /** - * - * @summary Add new education user - * @param {EducationUser} educationUser New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createEducationUser(educationUser: EducationUser, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createEducationUser(educationUser, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Delete educationUser - * @param {string} userId key: id or username of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteEducationUser(userId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteEducationUser(userId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get properties of educationUser - * @param {string} userId key: id or username of user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getEducationUser(userId: string, $expand?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getEducationUser(userId, $expand, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get entities from education users - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listEducationUsers($orderby?: Set, $expand?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listEducationUsers($orderby, $expand, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update properties of educationUser - * @param {string} userId key: id or username of user - * @param {EducationUser} educationUser New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateEducationUser(userId: string, educationUser: EducationUser, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateEducationUser(userId, educationUser, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * EducationUserApi - object-oriented interface - */ -export class EducationUserApi extends BaseAPI { - /** - * - * @summary Add new education user - * @param {EducationUser} educationUser New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createEducationUser(educationUser: EducationUser, options?: RawAxiosRequestConfig) { - return EducationUserApiFp(this.configuration).createEducationUser(educationUser, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Delete educationUser - * @param {string} userId key: id or username of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteEducationUser(userId: string, options?: RawAxiosRequestConfig) { - return EducationUserApiFp(this.configuration).deleteEducationUser(userId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get properties of educationUser - * @param {string} userId key: id or username of user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getEducationUser(userId: string, $expand?: Set, options?: RawAxiosRequestConfig) { - return EducationUserApiFp(this.configuration).getEducationUser(userId, $expand, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get entities from education users - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listEducationUsers($orderby?: Set, $expand?: Set, options?: RawAxiosRequestConfig) { - return EducationUserApiFp(this.configuration).listEducationUsers($orderby, $expand, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update properties of educationUser - * @param {string} userId key: id or username of user - * @param {EducationUser} educationUser New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateEducationUser(userId: string, educationUser: EducationUser, options?: RawAxiosRequestConfig) { - return EducationUserApiFp(this.configuration).updateEducationUser(userId, educationUser, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const GetEducationUserExpandEnum = { - MemberOf: 'memberOf' -} as const; -export type GetEducationUserExpandEnum = typeof GetEducationUserExpandEnum[keyof typeof GetEducationUserExpandEnum]; -export const ListEducationUsersOrderbyEnum = { - DisplayName: 'displayName', - DisplayNameDesc: 'displayName desc', - Mail: 'mail', - MailDesc: 'mail desc', - OnPremisesSamAccountName: 'onPremisesSamAccountName', - OnPremisesSamAccountNameDesc: 'onPremisesSamAccountName desc' -} as const; -export type ListEducationUsersOrderbyEnum = typeof ListEducationUsersOrderbyEnum[keyof typeof ListEducationUsersOrderbyEnum]; -export const ListEducationUsersExpandEnum = { - MemberOf: 'memberOf' -} as const; -export type ListEducationUsersExpandEnum = typeof ListEducationUsersExpandEnum[keyof typeof ListEducationUsersExpandEnum]; - - -/** - * GroupApi - axios parameter creator - */ -export const GroupApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Add a member to a group - * @param {string} groupId key: id of group - * @param {MemberReference} memberReference Object to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addMember: async (groupId: string, memberReference: MemberReference, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'groupId' is not null or undefined - assertParamExists('addMember', 'groupId', groupId) - // verify required parameter 'memberReference' is not null or undefined - assertParamExists('addMember', 'memberReference', memberReference) - const localVarPath = `/v1.0/groups/{group-id}/members/$ref` - .replace(`{${"group-id"}}`, encodeURIComponent(String(groupId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(memberReference, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Delete entity from groups - * @param {string} groupId key: id of group - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteGroup: async (groupId: string, ifMatch?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'groupId' is not null or undefined - assertParamExists('deleteGroup', 'groupId', groupId) - const localVarPath = `/v1.0/groups/{group-id}` - .replace(`{${"group-id"}}`, encodeURIComponent(String(groupId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - if (ifMatch != null) { - localVarHeaderParameter['If-Match'] = String(ifMatch); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Delete member from a group - * @param {string} groupId key: id of group - * @param {string} directoryObjectId key: id of group member to remove - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteMember: async (groupId: string, directoryObjectId: string, ifMatch?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'groupId' is not null or undefined - assertParamExists('deleteMember', 'groupId', groupId) - // verify required parameter 'directoryObjectId' is not null or undefined - assertParamExists('deleteMember', 'directoryObjectId', directoryObjectId) - const localVarPath = `/v1.0/groups/{group-id}/members/{directory-object-id}/$ref` - .replace(`{${"group-id"}}`, encodeURIComponent(String(groupId))) - .replace(`{${"directory-object-id"}}`, encodeURIComponent(String(directoryObjectId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - if (ifMatch != null) { - localVarHeaderParameter['If-Match'] = String(ifMatch); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get entity from groups by key - * @param {string} groupId key: id or name of group - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getGroup: async (groupId: string, $select?: Set, $expand?: Set, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'groupId' is not null or undefined - assertParamExists('getGroup', 'groupId', groupId) - const localVarPath = `/v1.0/groups/{group-id}` - .replace(`{${"group-id"}}`, encodeURIComponent(String(groupId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get a list of the group\'s direct members - * @param {string} groupId key: id or name of group - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMembers: async (groupId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'groupId' is not null or undefined - assertParamExists('listMembers', 'groupId', groupId) - const localVarPath = `/v1.0/groups/{group-id}/members` - .replace(`{${"group-id"}}`, encodeURIComponent(String(groupId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update entity in groups - * @param {string} groupId key: id of group - * @param {Group} group New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateGroup: async (groupId: string, group: Group, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'groupId' is not null or undefined - assertParamExists('updateGroup', 'groupId', groupId) - // verify required parameter 'group' is not null or undefined - assertParamExists('updateGroup', 'group', group) - const localVarPath = `/v1.0/groups/{group-id}` - .replace(`{${"group-id"}}`, encodeURIComponent(String(groupId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * GroupApi - functional programming interface - */ -export const GroupApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GroupApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Add a member to a group - * @param {string} groupId key: id of group - * @param {MemberReference} memberReference Object to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async addMember(groupId: string, memberReference: MemberReference, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addMember(groupId, memberReference, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupApi.addMember']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Delete entity from groups - * @param {string} groupId key: id of group - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteGroup(groupId: string, ifMatch?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGroup(groupId, ifMatch, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupApi.deleteGroup']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Delete member from a group - * @param {string} groupId key: id of group - * @param {string} directoryObjectId key: id of group member to remove - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteMember(groupId: string, directoryObjectId: string, ifMatch?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMember(groupId, directoryObjectId, ifMatch, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupApi.deleteMember']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get entity from groups by key - * @param {string} groupId key: id or name of group - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getGroup(groupId: string, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getGroup(groupId, $select, $expand, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupApi.getGroup']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get a list of the group\'s direct members - * @param {string} groupId key: id or name of group - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listMembers(groupId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listMembers(groupId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupApi.listMembers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update entity in groups - * @param {string} groupId key: id of group - * @param {Group} group New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateGroup(groupId: string, group: Group, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateGroup(groupId, group, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupApi.updateGroup']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * GroupApi - factory interface - */ -export const GroupApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GroupApiFp(configuration) - return { - /** - * - * @summary Add a member to a group - * @param {string} groupId key: id of group - * @param {MemberReference} memberReference Object to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addMember(groupId: string, memberReference: MemberReference, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.addMember(groupId, memberReference, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Delete entity from groups - * @param {string} groupId key: id of group - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteGroup(groupId: string, ifMatch?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteGroup(groupId, ifMatch, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Delete member from a group - * @param {string} groupId key: id of group - * @param {string} directoryObjectId key: id of group member to remove - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteMember(groupId: string, directoryObjectId: string, ifMatch?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteMember(groupId, directoryObjectId, ifMatch, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get entity from groups by key - * @param {string} groupId key: id or name of group - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getGroup(groupId: string, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getGroup(groupId, $select, $expand, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get a list of the group\'s direct members - * @param {string} groupId key: id or name of group - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMembers(groupId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listMembers(groupId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update entity in groups - * @param {string} groupId key: id of group - * @param {Group} group New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateGroup(groupId: string, group: Group, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateGroup(groupId, group, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GroupApi - object-oriented interface - */ -export class GroupApi extends BaseAPI { - /** - * - * @summary Add a member to a group - * @param {string} groupId key: id of group - * @param {MemberReference} memberReference Object to be added as member - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public addMember(groupId: string, memberReference: MemberReference, options?: RawAxiosRequestConfig) { - return GroupApiFp(this.configuration).addMember(groupId, memberReference, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Delete entity from groups - * @param {string} groupId key: id of group - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteGroup(groupId: string, ifMatch?: string, options?: RawAxiosRequestConfig) { - return GroupApiFp(this.configuration).deleteGroup(groupId, ifMatch, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Delete member from a group - * @param {string} groupId key: id of group - * @param {string} directoryObjectId key: id of group member to remove - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteMember(groupId: string, directoryObjectId: string, ifMatch?: string, options?: RawAxiosRequestConfig) { - return GroupApiFp(this.configuration).deleteMember(groupId, directoryObjectId, ifMatch, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get entity from groups by key - * @param {string} groupId key: id or name of group - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getGroup(groupId: string, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig) { - return GroupApiFp(this.configuration).getGroup(groupId, $select, $expand, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get a list of the group\'s direct members - * @param {string} groupId key: id or name of group - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listMembers(groupId: string, options?: RawAxiosRequestConfig) { - return GroupApiFp(this.configuration).listMembers(groupId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update entity in groups - * @param {string} groupId key: id of group - * @param {Group} group New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateGroup(groupId: string, group: Group, options?: RawAxiosRequestConfig) { - return GroupApiFp(this.configuration).updateGroup(groupId, group, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const GetGroupSelectEnum = { - Id: 'id', - Description: 'description', - DisplayName: 'displayName', - Members: 'members' -} as const; -export type GetGroupSelectEnum = typeof GetGroupSelectEnum[keyof typeof GetGroupSelectEnum]; -export const GetGroupExpandEnum = { - Members: 'members' -} as const; -export type GetGroupExpandEnum = typeof GetGroupExpandEnum[keyof typeof GetGroupExpandEnum]; - - -/** - * GroupsApi - axios parameter creator - */ -export const GroupsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Add new entity to groups - * @param {Group} group New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createGroup: async (group: Group, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'group' is not null or undefined - assertParamExists('createGroup', 'group', group) - const localVarPath = `/v1.0/groups`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get entities from groups - * @param {string} [$search] Search items by search phrases - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listGroups: async ($search?: string, $orderby?: Set, $select?: Set, $expand?: Set, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/groups`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($search !== undefined) { - localVarQueryParameter['$search'] = $search; - } - - if ($orderby) { - localVarQueryParameter['$orderby'] = Array.from($orderby).join(COLLECTION_FORMATS.csv); - } - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * GroupsApi - functional programming interface - */ -export const GroupsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = GroupsApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Add new entity to groups - * @param {Group} group New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createGroup(group: Group, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createGroup(group, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupsApi.createGroup']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get entities from groups - * @param {string} [$search] Search items by search phrases - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listGroups($search?: string, $orderby?: Set, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listGroups($search, $orderby, $select, $expand, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['GroupsApi.listGroups']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * GroupsApi - factory interface - */ -export const GroupsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = GroupsApiFp(configuration) - return { - /** - * - * @summary Add new entity to groups - * @param {Group} group New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createGroup(group: Group, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createGroup(group, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get entities from groups - * @param {string} [$search] Search items by search phrases - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listGroups($search?: string, $orderby?: Set, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listGroups($search, $orderby, $select, $expand, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * GroupsApi - object-oriented interface - */ -export class GroupsApi extends BaseAPI { - /** - * - * @summary Add new entity to groups - * @param {Group} group New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createGroup(group: Group, options?: RawAxiosRequestConfig) { - return GroupsApiFp(this.configuration).createGroup(group, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get entities from groups - * @param {string} [$search] Search items by search phrases - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listGroups($search?: string, $orderby?: Set, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig) { - return GroupsApiFp(this.configuration).listGroups($search, $orderby, $select, $expand, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const ListGroupsOrderbyEnum = { - DisplayName: 'displayName', - DisplayNameDesc: 'displayName desc' -} as const; -export type ListGroupsOrderbyEnum = typeof ListGroupsOrderbyEnum[keyof typeof ListGroupsOrderbyEnum]; -export const ListGroupsSelectEnum = { - Id: 'id', - Description: 'description', - DisplayName: 'displayName', - Mail: 'mail', - Members: 'members' -} as const; -export type ListGroupsSelectEnum = typeof ListGroupsSelectEnum[keyof typeof ListGroupsSelectEnum]; -export const ListGroupsExpandEnum = { - Members: 'members' -} as const; -export type ListGroupsExpandEnum = typeof ListGroupsExpandEnum[keyof typeof ListGroupsExpandEnum]; - - -/** - * MeChangepasswordApi - axios parameter creator - */ -export const MeChangepasswordApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Change your own password - * @param {PasswordChange} passwordChange Password change request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - changeOwnPassword: async (passwordChange: PasswordChange, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'passwordChange' is not null or undefined - assertParamExists('changeOwnPassword', 'passwordChange', passwordChange) - const localVarPath = `/v1.0/me/changePassword`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(passwordChange, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * MeChangepasswordApi - functional programming interface - */ -export const MeChangepasswordApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = MeChangepasswordApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Change your own password - * @param {PasswordChange} passwordChange Password change request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async changeOwnPassword(passwordChange: PasswordChange, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.changeOwnPassword(passwordChange, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeChangepasswordApi.changeOwnPassword']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * MeChangepasswordApi - factory interface - */ -export const MeChangepasswordApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = MeChangepasswordApiFp(configuration) - return { - /** - * - * @summary Change your own password - * @param {PasswordChange} passwordChange Password change request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - changeOwnPassword(passwordChange: PasswordChange, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.changeOwnPassword(passwordChange, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * MeChangepasswordApi - object-oriented interface - */ -export class MeChangepasswordApi extends BaseAPI { - /** - * - * @summary Change your own password - * @param {PasswordChange} passwordChange Password change request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public changeOwnPassword(passwordChange: PasswordChange, options?: RawAxiosRequestConfig) { - return MeChangepasswordApiFp(this.configuration).changeOwnPassword(passwordChange, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * MeDriveApi - axios parameter creator - */ -export const MeDriveApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get personal space for user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getHome: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/me/drive`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. - * @summary Get a list of driveItem objects shared by the current user. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSharedByMe: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1beta1/me/drive/sharedByMe`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. - * @summary Get a list of driveItem objects shared with the owner of a drive. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSharedWithMe: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1beta1/me/drive/sharedWithMe`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * MeDriveApi - functional programming interface - */ -export const MeDriveApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = MeDriveApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get personal space for user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getHome(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getHome(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeDriveApi.getHome']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. - * @summary Get a list of driveItem objects shared by the current user. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listSharedByMe(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listSharedByMe(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeDriveApi.listSharedByMe']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. - * @summary Get a list of driveItem objects shared with the owner of a drive. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listSharedWithMe(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listSharedWithMe(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeDriveApi.listSharedWithMe']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * MeDriveApi - factory interface - */ -export const MeDriveApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = MeDriveApiFp(configuration) - return { - /** - * - * @summary Get personal space for user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getHome(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getHome(options).then((request) => request(axios, basePath)); - }, - /** - * The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. - * @summary Get a list of driveItem objects shared by the current user. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSharedByMe(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listSharedByMe(options).then((request) => request(axios, basePath)); - }, - /** - * The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. - * @summary Get a list of driveItem objects shared with the owner of a drive. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSharedWithMe(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listSharedWithMe(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * MeDriveApi - object-oriented interface - */ -export class MeDriveApi extends BaseAPI { - /** - * - * @summary Get personal space for user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getHome(options?: RawAxiosRequestConfig) { - return MeDriveApiFp(this.configuration).getHome(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. - * @summary Get a list of driveItem objects shared by the current user. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listSharedByMe(options?: RawAxiosRequestConfig) { - return MeDriveApiFp(this.configuration).listSharedByMe(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. - * @summary Get a list of driveItem objects shared with the owner of a drive. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listSharedWithMe(options?: RawAxiosRequestConfig) { - return MeDriveApiFp(this.configuration).listSharedWithMe(options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * MeDriveRootApi - axios parameter creator - */ -export const MeDriveRootApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get root from personal space - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - homeGetRoot: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/me/drive/root`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * MeDriveRootApi - functional programming interface - */ -export const MeDriveRootApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = MeDriveRootApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get root from personal space - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async homeGetRoot(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.homeGetRoot(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeDriveRootApi.homeGetRoot']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * MeDriveRootApi - factory interface - */ -export const MeDriveRootApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = MeDriveRootApiFp(configuration) - return { - /** - * - * @summary Get root from personal space - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - homeGetRoot(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.homeGetRoot(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * MeDriveRootApi - object-oriented interface - */ -export class MeDriveRootApi extends BaseAPI { - /** - * - * @summary Get root from personal space - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public homeGetRoot(options?: RawAxiosRequestConfig) { - return MeDriveRootApiFp(this.configuration).homeGetRoot(options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * MeDriveRootChildrenApi - axios parameter creator - */ -export const MeDriveRootChildrenApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get children from drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - homeGetChildren: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/me/drive/root/children`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * MeDriveRootChildrenApi - functional programming interface - */ -export const MeDriveRootChildrenApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = MeDriveRootChildrenApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get children from drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async homeGetChildren(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.homeGetChildren(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeDriveRootChildrenApi.homeGetChildren']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * MeDriveRootChildrenApi - factory interface - */ -export const MeDriveRootChildrenApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = MeDriveRootChildrenApiFp(configuration) - return { - /** - * - * @summary Get children from drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - homeGetChildren(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.homeGetChildren(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * MeDriveRootChildrenApi - object-oriented interface - */ -export class MeDriveRootChildrenApi extends BaseAPI { - /** - * - * @summary Get children from drive - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public homeGetChildren(options?: RawAxiosRequestConfig) { - return MeDriveRootChildrenApiFp(this.configuration).homeGetChildren(options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * MeDrivesApi - axios parameter creator - */ -export const MeDrivesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get all drives where the current user is a regular member of - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMyDrives: async ($orderby?: string, $filter?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/me/drives`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($orderby !== undefined) { - localVarQueryParameter['$orderby'] = $orderby; - } - - if ($filter !== undefined) { - localVarQueryParameter['$filter'] = $filter; - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMyDrivesBeta: async ($orderby?: string, $filter?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1beta1/me/drives`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($orderby !== undefined) { - localVarQueryParameter['$orderby'] = $orderby; - } - - if ($filter !== undefined) { - localVarQueryParameter['$filter'] = $filter; - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * MeDrivesApi - functional programming interface - */ -export const MeDrivesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = MeDrivesApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get all drives where the current user is a regular member of - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listMyDrives($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listMyDrives($orderby, $filter, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeDrivesApi.listMyDrives']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listMyDrivesBeta($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listMyDrivesBeta($orderby, $filter, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeDrivesApi.listMyDrivesBeta']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * MeDrivesApi - factory interface - */ -export const MeDrivesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = MeDrivesApiFp(configuration) - return { - /** - * - * @summary Get all drives where the current user is a regular member of - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMyDrives($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listMyDrives($orderby, $filter, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMyDrivesBeta($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listMyDrivesBeta($orderby, $filter, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * MeDrivesApi - object-oriented interface - */ -export class MeDrivesApi extends BaseAPI { - /** - * - * @summary Get all drives where the current user is a regular member of - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listMyDrives($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig) { - return MeDrivesApiFp(this.configuration).listMyDrives($orderby, $filter, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles - * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. - * @param {string} [$filter] Filter items by property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listMyDrivesBeta($orderby?: string, $filter?: string, options?: RawAxiosRequestConfig) { - return MeDrivesApiFp(this.configuration).listMyDrivesBeta($orderby, $filter, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * MeUserApi - axios parameter creator - */ -export const MeUserApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Get current user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOwnUser: async ($expand?: Set, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/me`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update the current user - * @param {UserUpdate} [userUpdate] New user values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateOwnUser: async (userUpdate?: UserUpdate, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/me`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(userUpdate, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * MeUserApi - functional programming interface - */ -export const MeUserApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = MeUserApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Get current user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getOwnUser($expand?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOwnUser($expand, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeUserApi.getOwnUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update the current user - * @param {UserUpdate} [userUpdate] New user values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateOwnUser(userUpdate?: UserUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateOwnUser(userUpdate, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['MeUserApi.updateOwnUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * MeUserApi - factory interface - */ -export const MeUserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = MeUserApiFp(configuration) - return { - /** - * - * @summary Get current user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOwnUser($expand?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getOwnUser($expand, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update the current user - * @param {UserUpdate} [userUpdate] New user values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateOwnUser(userUpdate?: UserUpdate, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateOwnUser(userUpdate, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * MeUserApi - object-oriented interface - */ -export class MeUserApi extends BaseAPI { - /** - * - * @summary Get current user - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getOwnUser($expand?: Set, options?: RawAxiosRequestConfig) { - return MeUserApiFp(this.configuration).getOwnUser($expand, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update the current user - * @param {UserUpdate} [userUpdate] New user values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateOwnUser(userUpdate?: UserUpdate, options?: RawAxiosRequestConfig) { - return MeUserApiFp(this.configuration).updateOwnUser(userUpdate, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const GetOwnUserExpandEnum = { - MemberOf: 'memberOf' -} as const; -export type GetOwnUserExpandEnum = typeof GetOwnUserExpandEnum[keyof typeof GetOwnUserExpandEnum]; - - -/** - * RoleManagementApi - axios parameter creator - */ -export const RoleManagementApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Read the properties and relationships of a `unifiedRoleDefinition` object. - * @summary Get unifiedRoleDefinition - * @param {string} roleId key: id of roleDefinition - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPermissionRoleDefinition: async (roleId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'roleId' is not null or undefined - assertParamExists('getPermissionRoleDefinition', 'roleId', roleId) - const localVarPath = `/v1beta1/roleManagement/permissions/roleDefinitions/{role-id}` - .replace(`{${"role-id"}}`, encodeURIComponent(String(roleId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. - * @summary List roleDefinitions - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPermissionRoleDefinitions: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1beta1/roleManagement/permissions/roleDefinitions`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * RoleManagementApi - functional programming interface - */ -export const RoleManagementApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = RoleManagementApiAxiosParamCreator(configuration) - return { - /** - * Read the properties and relationships of a `unifiedRoleDefinition` object. - * @summary Get unifiedRoleDefinition - * @param {string} roleId key: id of roleDefinition - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getPermissionRoleDefinition(roleId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionRoleDefinition(roleId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['RoleManagementApi.getPermissionRoleDefinition']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. - * @summary List roleDefinitions - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listPermissionRoleDefinitions(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listPermissionRoleDefinitions(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['RoleManagementApi.listPermissionRoleDefinitions']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * RoleManagementApi - factory interface - */ -export const RoleManagementApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = RoleManagementApiFp(configuration) - return { - /** - * Read the properties and relationships of a `unifiedRoleDefinition` object. - * @summary Get unifiedRoleDefinition - * @param {string} roleId key: id of roleDefinition - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPermissionRoleDefinition(roleId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getPermissionRoleDefinition(roleId, options).then((request) => request(axios, basePath)); - }, - /** - * Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. - * @summary List roleDefinitions - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listPermissionRoleDefinitions(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listPermissionRoleDefinitions(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * RoleManagementApi - object-oriented interface - */ -export class RoleManagementApi extends BaseAPI { - /** - * Read the properties and relationships of a `unifiedRoleDefinition` object. - * @summary Get unifiedRoleDefinition - * @param {string} roleId key: id of roleDefinition - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getPermissionRoleDefinition(roleId: string, options?: RawAxiosRequestConfig) { - return RoleManagementApiFp(this.configuration).getPermissionRoleDefinition(roleId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. - * @summary List roleDefinitions - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listPermissionRoleDefinitions(options?: RawAxiosRequestConfig) { - return RoleManagementApiFp(this.configuration).listPermissionRoleDefinitions(options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * TagsApi - axios parameter creator - */ -export const TagsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Assign tags to a resource - * @param {TagAssignment} [tagAssignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - assignTags: async (tagAssignment?: TagAssignment, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/extensions/org.libregraph/tags`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(tagAssignment, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get all known tags - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTags: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/extensions/org.libregraph/tags`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Unassign tags from a resource - * @param {TagUnassignment} [tagUnassignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - unassignTags: async (tagUnassignment?: TagUnassignment, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/extensions/org.libregraph/tags`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(tagUnassignment, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * TagsApi - functional programming interface - */ -export const TagsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = TagsApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Assign tags to a resource - * @param {TagAssignment} [tagAssignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async assignTags(tagAssignment?: TagAssignment, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.assignTags(tagAssignment, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TagsApi.assignTags']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get all known tags - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getTags(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getTags(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TagsApi.getTags']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Unassign tags from a resource - * @param {TagUnassignment} [tagUnassignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async unassignTags(tagUnassignment?: TagUnassignment, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.unassignTags(tagUnassignment, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TagsApi.unassignTags']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * TagsApi - factory interface - */ -export const TagsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = TagsApiFp(configuration) - return { - /** - * - * @summary Assign tags to a resource - * @param {TagAssignment} [tagAssignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - assignTags(tagAssignment?: TagAssignment, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.assignTags(tagAssignment, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get all known tags - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTags(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getTags(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Unassign tags from a resource - * @param {TagUnassignment} [tagUnassignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - unassignTags(tagUnassignment?: TagUnassignment, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.unassignTags(tagUnassignment, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * TagsApi - object-oriented interface - */ -export class TagsApi extends BaseAPI { - /** - * - * @summary Assign tags to a resource - * @param {TagAssignment} [tagAssignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public assignTags(tagAssignment?: TagAssignment, options?: RawAxiosRequestConfig) { - return TagsApiFp(this.configuration).assignTags(tagAssignment, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get all known tags - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getTags(options?: RawAxiosRequestConfig) { - return TagsApiFp(this.configuration).getTags(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Unassign tags from a resource - * @param {TagUnassignment} [tagUnassignment] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public unassignTags(tagUnassignment?: TagUnassignment, options?: RawAxiosRequestConfig) { - return TagsApiFp(this.configuration).unassignTags(tagUnassignment, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * UserApi - axios parameter creator - */ -export const UserApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Delete entity from users - * @param {string} userId key: id or name of user - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUser: async (userId: string, ifMatch?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('deleteUser', 'userId', userId) - const localVarPath = `/v1.0/users/{user-id}` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - if (ifMatch != null) { - localVarHeaderParameter['If-Match'] = String(ifMatch); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary export personal data of a user - * @param {string} userId key: id or name of user - * @param {ExportPersonalDataRequest} [exportPersonalDataRequest] destination the file should be created at - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - exportPersonalData: async (userId: string, exportPersonalDataRequest?: ExportPersonalDataRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('exportPersonalData', 'userId', userId) - const localVarPath = `/v1.0/users/{user-id}/exportPersonalData` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(exportPersonalDataRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get entity from users by key - * @param {string} userId key: id or name of user - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getUser: async (userId: string, $select?: Set, $expand?: Set, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('getUser', 'userId', userId) - const localVarPath = `/v1.0/users/{user-id}` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update entity in users - * @param {string} userId key: id of user - * @param {UserUpdate} userUpdate New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser: async (userId: string, userUpdate: UserUpdate, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('updateUser', 'userId', userId) - // verify required parameter 'userUpdate' is not null or undefined - assertParamExists('updateUser', 'userUpdate', userUpdate) - const localVarPath = `/v1.0/users/{user-id}` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(userUpdate, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * UserApi - functional programming interface - */ -export const UserApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Delete entity from users - * @param {string} userId key: id or name of user - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async deleteUser(userId: string, ifMatch?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(userId, ifMatch, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.deleteUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary export personal data of a user - * @param {string} userId key: id or name of user - * @param {ExportPersonalDataRequest} [exportPersonalDataRequest] destination the file should be created at - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async exportPersonalData(userId: string, exportPersonalDataRequest?: ExportPersonalDataRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.exportPersonalData(userId, exportPersonalDataRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.exportPersonalData']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get entity from users by key - * @param {string} userId key: id or name of user - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getUser(userId: string, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getUser(userId, $select, $expand, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.getUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update entity in users - * @param {string} userId key: id of user - * @param {UserUpdate} userUpdate New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateUser(userId: string, userUpdate: UserUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(userId, userUpdate, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserApi.updateUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * UserApi - factory interface - */ -export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = UserApiFp(configuration) - return { - /** - * - * @summary Delete entity from users - * @param {string} userId key: id or name of user - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUser(userId: string, ifMatch?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.deleteUser(userId, ifMatch, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary export personal data of a user - * @param {string} userId key: id or name of user - * @param {ExportPersonalDataRequest} [exportPersonalDataRequest] destination the file should be created at - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - exportPersonalData(userId: string, exportPersonalDataRequest?: ExportPersonalDataRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.exportPersonalData(userId, exportPersonalDataRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get entity from users by key - * @param {string} userId key: id or name of user - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getUser(userId: string, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getUser(userId, $select, $expand, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update entity in users - * @param {string} userId key: id of user - * @param {UserUpdate} userUpdate New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser(userId: string, userUpdate: UserUpdate, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.updateUser(userId, userUpdate, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * UserApi - object-oriented interface - */ -export class UserApi extends BaseAPI { - /** - * - * @summary Delete entity from users - * @param {string} userId key: id or name of user - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public deleteUser(userId: string, ifMatch?: string, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).deleteUser(userId, ifMatch, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary export personal data of a user - * @param {string} userId key: id or name of user - * @param {ExportPersonalDataRequest} [exportPersonalDataRequest] destination the file should be created at - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public exportPersonalData(userId: string, exportPersonalDataRequest?: ExportPersonalDataRequest, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).exportPersonalData(userId, exportPersonalDataRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get entity from users by key - * @param {string} userId key: id or name of user - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public getUser(userId: string, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).getUser(userId, $select, $expand, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update entity in users - * @param {string} userId key: id of user - * @param {UserUpdate} userUpdate New property values - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public updateUser(userId: string, userUpdate: UserUpdate, options?: RawAxiosRequestConfig) { - return UserApiFp(this.configuration).updateUser(userId, userUpdate, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const GetUserSelectEnum = { - Id: 'id', - DisplayName: 'displayName', - Drive: 'drive', - Drives: 'drives', - Mail: 'mail', - MemberOf: 'memberOf', - OnPremisesSamAccountName: 'onPremisesSamAccountName', - Surname: 'surname' -} as const; -export type GetUserSelectEnum = typeof GetUserSelectEnum[keyof typeof GetUserSelectEnum]; -export const GetUserExpandEnum = { - Drive: 'drive', - Drives: 'drives', - MemberOf: 'memberOf', - AppRoleAssignments: 'appRoleAssignments' -} as const; -export type GetUserExpandEnum = typeof GetUserExpandEnum[keyof typeof GetUserExpandEnum]; - - -/** - * UserAppRoleAssignmentApi - axios parameter creator - */ -export const UserAppRoleAssignmentApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. - * @summary Grant an appRoleAssignment to a user - * @param {string} userId key: id of user - * @param {AppRoleAssignment} appRoleAssignment New app role assignment value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userCreateAppRoleAssignments: async (userId: string, appRoleAssignment: AppRoleAssignment, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('userCreateAppRoleAssignments', 'userId', userId) - // verify required parameter 'appRoleAssignment' is not null or undefined - assertParamExists('userCreateAppRoleAssignments', 'appRoleAssignment', appRoleAssignment) - const localVarPath = `/v1.0/users/{user-id}/appRoleAssignments` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(appRoleAssignment, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Delete the appRoleAssignment from a user - * @param {string} userId key: id of user - * @param {string} appRoleAssignmentId key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userDeleteAppRoleAssignments: async (userId: string, appRoleAssignmentId: string, ifMatch?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('userDeleteAppRoleAssignments', 'userId', userId) - // verify required parameter 'appRoleAssignmentId' is not null or undefined - assertParamExists('userDeleteAppRoleAssignments', 'appRoleAssignmentId', appRoleAssignmentId) - const localVarPath = `/v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id}` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))) - .replace(`{${"appRoleAssignment-id"}}`, encodeURIComponent(String(appRoleAssignmentId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - if (ifMatch != null) { - localVarHeaderParameter['If-Match'] = String(ifMatch); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Represents the global roles a user has been granted for an application. - * @summary Get appRoleAssignments from a user - * @param {string} userId key: id of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userListAppRoleAssignments: async (userId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userId' is not null or undefined - assertParamExists('userListAppRoleAssignments', 'userId', userId) - const localVarPath = `/v1.0/users/{user-id}/appRoleAssignments` - .replace(`{${"user-id"}}`, encodeURIComponent(String(userId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * UserAppRoleAssignmentApi - functional programming interface - */ -export const UserAppRoleAssignmentApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UserAppRoleAssignmentApiAxiosParamCreator(configuration) - return { - /** - * Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. - * @summary Grant an appRoleAssignment to a user - * @param {string} userId key: id of user - * @param {AppRoleAssignment} appRoleAssignment New app role assignment value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userCreateAppRoleAssignments(userId: string, appRoleAssignment: AppRoleAssignment, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userCreateAppRoleAssignments(userId, appRoleAssignment, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserAppRoleAssignmentApi.userCreateAppRoleAssignments']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Delete the appRoleAssignment from a user - * @param {string} userId key: id of user - * @param {string} appRoleAssignmentId key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userDeleteAppRoleAssignments(userId: string, appRoleAssignmentId: string, ifMatch?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userDeleteAppRoleAssignments(userId, appRoleAssignmentId, ifMatch, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserAppRoleAssignmentApi.userDeleteAppRoleAssignments']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Represents the global roles a user has been granted for an application. - * @summary Get appRoleAssignments from a user - * @param {string} userId key: id of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async userListAppRoleAssignments(userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.userListAppRoleAssignments(userId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UserAppRoleAssignmentApi.userListAppRoleAssignments']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * UserAppRoleAssignmentApi - factory interface - */ -export const UserAppRoleAssignmentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = UserAppRoleAssignmentApiFp(configuration) - return { - /** - * Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. - * @summary Grant an appRoleAssignment to a user - * @param {string} userId key: id of user - * @param {AppRoleAssignment} appRoleAssignment New app role assignment value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userCreateAppRoleAssignments(userId: string, appRoleAssignment: AppRoleAssignment, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userCreateAppRoleAssignments(userId, appRoleAssignment, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Delete the appRoleAssignment from a user - * @param {string} userId key: id of user - * @param {string} appRoleAssignmentId key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userDeleteAppRoleAssignments(userId: string, appRoleAssignmentId: string, ifMatch?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userDeleteAppRoleAssignments(userId, appRoleAssignmentId, ifMatch, options).then((request) => request(axios, basePath)); - }, - /** - * Represents the global roles a user has been granted for an application. - * @summary Get appRoleAssignments from a user - * @param {string} userId key: id of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - userListAppRoleAssignments(userId: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.userListAppRoleAssignments(userId, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * UserAppRoleAssignmentApi - object-oriented interface - */ -export class UserAppRoleAssignmentApi extends BaseAPI { - /** - * Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. - * @summary Grant an appRoleAssignment to a user - * @param {string} userId key: id of user - * @param {AppRoleAssignment} appRoleAssignment New app role assignment value - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public userCreateAppRoleAssignments(userId: string, appRoleAssignment: AppRoleAssignment, options?: RawAxiosRequestConfig) { - return UserAppRoleAssignmentApiFp(this.configuration).userCreateAppRoleAssignments(userId, appRoleAssignment, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Delete the appRoleAssignment from a user - * @param {string} userId key: id of user - * @param {string} appRoleAssignmentId key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. - * @param {string} [ifMatch] ETag - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public userDeleteAppRoleAssignments(userId: string, appRoleAssignmentId: string, ifMatch?: string, options?: RawAxiosRequestConfig) { - return UserAppRoleAssignmentApiFp(this.configuration).userDeleteAppRoleAssignments(userId, appRoleAssignmentId, ifMatch, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Represents the global roles a user has been granted for an application. - * @summary Get appRoleAssignments from a user - * @param {string} userId key: id of user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public userListAppRoleAssignments(userId: string, options?: RawAxiosRequestConfig) { - return UserAppRoleAssignmentApiFp(this.configuration).userListAppRoleAssignments(userId, options).then((request) => request(this.axios, this.basePath)); - } -} - - - -/** - * UsersApi - axios parameter creator - */ -export const UsersApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Add new entity to users - * @param {User} user New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUser: async (user: User, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'user' is not null or undefined - assertParamExists('createUser', 'user', user) - const localVarPath = `/v1.0/users`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get entities from users - * @param {string} [$search] Search items by search phrases - * @param {string} [$filter] Filter users by property values and relationship attributes - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listUsers: async ($search?: string, $filter?: string, $orderby?: Set, $select?: Set, $expand?: Set, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/users`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication openId required - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - if ($search !== undefined) { - localVarQueryParameter['$search'] = $search; - } - - if ($filter !== undefined) { - localVarQueryParameter['$filter'] = $filter; - } - - if ($orderby) { - localVarQueryParameter['$orderby'] = Array.from($orderby).join(COLLECTION_FORMATS.csv); - } - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - - localVarHeaderParameter['Accept'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * UsersApi - functional programming interface - */ -export const UsersApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration) - return { - /** - * - * @summary Add new entity to users - * @param {User} user New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async createUser(user: User, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(user, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UsersApi.createUser']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get entities from users - * @param {string} [$search] Search items by search phrases - * @param {string} [$filter] Filter users by property values and relationship attributes - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async listUsers($search?: string, $filter?: string, $orderby?: Set, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listUsers($search, $filter, $orderby, $select, $expand, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['UsersApi.listUsers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * UsersApi - factory interface - */ -export const UsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = UsersApiFp(configuration) - return { - /** - * - * @summary Add new entity to users - * @param {User} user New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUser(user: User, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.createUser(user, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get entities from users - * @param {string} [$search] Search items by search phrases - * @param {string} [$filter] Filter users by property values and relationship attributes - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listUsers($search?: string, $filter?: string, $orderby?: Set, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listUsers($search, $filter, $orderby, $select, $expand, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * UsersApi - object-oriented interface - */ -export class UsersApi extends BaseAPI { - /** - * - * @summary Add new entity to users - * @param {User} user New entity - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public createUser(user: User, options?: RawAxiosRequestConfig) { - return UsersApiFp(this.configuration).createUser(user, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get entities from users - * @param {string} [$search] Search items by search phrases - * @param {string} [$filter] Filter users by property values and relationship attributes - * @param {Set} [$orderby] Order items by property values - * @param {Set} [$select] Select properties to be returned - * @param {Set} [$expand] Expand related entities - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public listUsers($search?: string, $filter?: string, $orderby?: Set, $select?: Set, $expand?: Set, options?: RawAxiosRequestConfig) { - return UsersApiFp(this.configuration).listUsers($search, $filter, $orderby, $select, $expand, options).then((request) => request(this.axios, this.basePath)); - } -} - -export const ListUsersOrderbyEnum = { - DisplayName: 'displayName', - DisplayNameDesc: 'displayName desc', - Mail: 'mail', - MailDesc: 'mail desc', - OnPremisesSamAccountName: 'onPremisesSamAccountName', - OnPremisesSamAccountNameDesc: 'onPremisesSamAccountName desc' -} as const; -export type ListUsersOrderbyEnum = typeof ListUsersOrderbyEnum[keyof typeof ListUsersOrderbyEnum]; -export const ListUsersSelectEnum = { - Id: 'id', - DisplayName: 'displayName', - Mail: 'mail', - MemberOf: 'memberOf', - OnPremisesSamAccountName: 'onPremisesSamAccountName', - Surname: 'surname' -} as const; -export type ListUsersSelectEnum = typeof ListUsersSelectEnum[keyof typeof ListUsersSelectEnum]; -export const ListUsersExpandEnum = { - Drive: 'drive', - Drives: 'drives', - MemberOf: 'memberOf', - AppRoleAssignments: 'appRoleAssignments' -} as const; -export type ListUsersExpandEnum = typeof ListUsersExpandEnum[keyof typeof ListUsersExpandEnum]; - - diff --git a/web/packages/web-client/src/graph/generated/apis/ActivitiesApi.ts b/web/packages/web-client/src/graph/generated/apis/ActivitiesApi.ts new file mode 100644 index 00000000000..94bfa222812 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/ActivitiesApi.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfActivities, + CollectionOfActivitiesFromJSON, + CollectionOfActivitiesToJSON, +} from '../models/CollectionOfActivities'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface GetActivitiesRequest { + /** + * + */ + kql?: string; +} + +/** + * + */ +export class ActivitiesApi extends runtime.BaseAPI { + + /** + * Creates request options for getActivities without sending the request + */ + async getActivitiesRequestOpts(requestParameters: GetActivitiesRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['kql'] != null) { + queryParameters['kql'] = requestParameters['kql']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/extensions/org.libregraph/activities`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get activities + */ + async getActivitiesRaw(requestParameters: GetActivitiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getActivitiesRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfActivitiesFromJSON(jsonValue)); + } + + /** + * Get activities + */ + async getActivities(requestParameters: GetActivitiesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getActivitiesRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/ApplicationsApi.ts b/web/packages/web-client/src/graph/generated/apis/ApplicationsApi.ts new file mode 100644 index 00000000000..48bf0f25f98 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/ApplicationsApi.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type Application, + ApplicationFromJSON, + ApplicationToJSON, +} from '../models/Application'; +import { + type CollectionOfApplications, + CollectionOfApplicationsFromJSON, + CollectionOfApplicationsToJSON, +} from '../models/CollectionOfApplications'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface GetApplicationRequest { + /** + * key: id of application + */ + applicationId: string; +} + +/** + * + */ +export class ApplicationsApi extends runtime.BaseAPI { + + /** + * Creates request options for getApplication without sending the request + */ + async getApplicationRequestOpts(requestParameters: GetApplicationRequest): Promise { + if (requestParameters['applicationId'] == null) { + throw new runtime.RequiredError( + 'applicationId', + 'Required parameter "applicationId" was null or undefined when calling getApplication().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/applications/{application-id}`; + urlPath = urlPath.replace('{application-id}', encodeURIComponent(String(requestParameters['applicationId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get application by id + */ + async getApplicationRaw(requestParameters: GetApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getApplicationRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ApplicationFromJSON(jsonValue)); + } + + /** + * Get application by id + */ + async getApplication(requestParameters: GetApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getApplicationRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listApplications without sending the request + */ + async listApplicationsRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/applications`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get all applications + */ + async listApplicationsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listApplicationsRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfApplicationsFromJSON(jsonValue)); + } + + /** + * Get all applications + */ + async listApplications(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listApplicationsRaw(initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts b/web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts new file mode 100644 index 00000000000..276c81745de --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts @@ -0,0 +1,252 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type DriveItem, + DriveItemFromJSON, + DriveItemToJSON, +} from '../models/DriveItem'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface DeleteDriveItemRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; +} + +export interface GetDriveItemRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; +} + +export interface UpdateDriveItemRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * + */ + driveItem: Omit; +} + +/** + * + */ +export class DriveItemApi extends runtime.BaseAPI { + + /** + * Creates request options for deleteDriveItem without sending the request + */ + async deleteDriveItemRequestOpts(requestParameters: DeleteDriveItemRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling deleteDriveItem().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling deleteDriveItem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. + * Delete a DriveItem. + */ + async deleteDriveItemRaw(requestParameters: DeleteDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteDriveItemRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. + * Delete a DriveItem. + */ + async deleteDriveItem(requestParameters: DeleteDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteDriveItemRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getDriveItem without sending the request + */ + async getDriveItemRequestOpts(requestParameters: GetDriveItemRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling getDriveItem().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling getDriveItem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get a DriveItem by using its ID. + * Get a DriveItem. + */ + async getDriveItemRaw(requestParameters: GetDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getDriveItemRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveItemFromJSON(jsonValue)); + } + + /** + * Get a DriveItem by using its ID. + * Get a DriveItem. + */ + async getDriveItem(requestParameters: GetDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDriveItemRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateDriveItem without sending the request + */ + async updateDriveItemRequestOpts(requestParameters: UpdateDriveItemRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling updateDriveItem().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling updateDriveItem().' + ); + } + + if (requestParameters['driveItem'] == null) { + throw new runtime.RequiredError( + 'driveItem', + 'Required parameter "driveItem" was null or undefined when calling updateDriveItem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: DriveItemToJSON(requestParameters['driveItem']), + }; + } + + /** + * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. + * Update a DriveItem. + */ + async updateDriveItemRaw(requestParameters: UpdateDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateDriveItemRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveItemFromJSON(jsonValue)); + } + + /** + * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. + * Update a DriveItem. + */ + async updateDriveItem(requestParameters: UpdateDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateDriveItemRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/DrivesApi.ts b/web/packages/web-client/src/graph/generated/apis/DrivesApi.ts new file mode 100644 index 00000000000..6d8e2376cb9 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/DrivesApi.ts @@ -0,0 +1,523 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type Drive, + DriveFromJSON, + DriveToJSON, +} from '../models/Drive'; +import { + type DriveUpdate, + DriveUpdateFromJSON, + DriveUpdateToJSON, +} from '../models/DriveUpdate'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface CreateDriveRequest { + /** + * + */ + drive: Drive; +} + +export interface CreateDriveBetaRequest { + /** + * + */ + drive: Drive; +} + +export interface DeleteDriveRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * ETag + */ + ifMatch?: string; +} + +export interface DeleteDriveBetaRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * ETag + */ + ifMatch?: string; +} + +export interface GetDriveRequest { + /** + * key: id of drive + */ + driveId: string; +} + +export interface GetDriveBetaRequest { + /** + * key: id of drive + */ + driveId: string; +} + +export interface UpdateDriveRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * + */ + driveUpdate: Omit; +} + +export interface UpdateDriveBetaRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * + */ + driveUpdate: Omit; +} + +/** + * + */ +export class DrivesApi extends runtime.BaseAPI { + + /** + * Creates request options for createDrive without sending the request + */ + async createDriveRequestOpts(requestParameters: CreateDriveRequest): Promise { + if (requestParameters['drive'] == null) { + throw new runtime.RequiredError( + 'drive', + 'Required parameter "drive" was null or undefined when calling createDrive().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/drives`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DriveToJSON(requestParameters['drive']), + }; + } + + /** + * Create a new drive of a specific type + */ + async createDriveRaw(requestParameters: CreateDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createDriveRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveFromJSON(jsonValue)); + } + + /** + * Create a new drive of a specific type + */ + async createDrive(requestParameters: CreateDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createDriveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for createDriveBeta without sending the request + */ + async createDriveBetaRequestOpts(requestParameters: CreateDriveBetaRequest): Promise { + if (requestParameters['drive'] == null) { + throw new runtime.RequiredError( + 'drive', + 'Required parameter "drive" was null or undefined when calling createDriveBeta().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DriveToJSON(requestParameters['drive']), + }; + } + + /** + * Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. + */ + async createDriveBetaRaw(requestParameters: CreateDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createDriveBetaRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveFromJSON(jsonValue)); + } + + /** + * Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. + */ + async createDriveBeta(requestParameters: CreateDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createDriveBetaRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for deleteDrive without sending the request + */ + async deleteDriveRequestOpts(requestParameters: DeleteDriveRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling deleteDrive().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['ifMatch'] != null) { + headerParameters['If-Match'] = String(requestParameters['ifMatch']); + } + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/drives/{drive-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete a specific space + */ + async deleteDriveRaw(requestParameters: DeleteDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteDriveRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a specific space + */ + async deleteDrive(requestParameters: DeleteDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteDriveRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteDriveBeta without sending the request + */ + async deleteDriveBetaRequestOpts(requestParameters: DeleteDriveBetaRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling deleteDriveBeta().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['ifMatch'] != null) { + headerParameters['If-Match'] = String(requestParameters['ifMatch']); + } + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete a specific space. Alias for \'/v1.0/drives\'. + */ + async deleteDriveBetaRaw(requestParameters: DeleteDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteDriveBetaRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete a specific space. Alias for \'/v1.0/drives\'. + */ + async deleteDriveBeta(requestParameters: DeleteDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteDriveBetaRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getDrive without sending the request + */ + async getDriveRequestOpts(requestParameters: GetDriveRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling getDrive().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/drives/{drive-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get drive by id + */ + async getDriveRaw(requestParameters: GetDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getDriveRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveFromJSON(jsonValue)); + } + + /** + * Get drive by id + */ + async getDrive(requestParameters: GetDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDriveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for getDriveBeta without sending the request + */ + async getDriveBetaRequestOpts(requestParameters: GetDriveBetaRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling getDriveBeta().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async getDriveBetaRaw(requestParameters: GetDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getDriveBetaRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveFromJSON(jsonValue)); + } + + /** + * Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async getDriveBeta(requestParameters: GetDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getDriveBetaRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateDrive without sending the request + */ + async updateDriveRequestOpts(requestParameters: UpdateDriveRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling updateDrive().' + ); + } + + if (requestParameters['driveUpdate'] == null) { + throw new runtime.RequiredError( + 'driveUpdate', + 'Required parameter "driveUpdate" was null or undefined when calling updateDrive().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/drives/{drive-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: DriveUpdateToJSON(requestParameters['driveUpdate']), + }; + } + + /** + * Update the drive + */ + async updateDriveRaw(requestParameters: UpdateDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateDriveRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveFromJSON(jsonValue)); + } + + /** + * Update the drive + */ + async updateDrive(requestParameters: UpdateDriveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateDriveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateDriveBeta without sending the request + */ + async updateDriveBetaRequestOpts(requestParameters: UpdateDriveBetaRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling updateDriveBeta().' + ); + } + + if (requestParameters['driveUpdate'] == null) { + throw new runtime.RequiredError( + 'driveUpdate', + 'Required parameter "driveUpdate" was null or undefined when calling updateDriveBeta().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: DriveUpdateToJSON(requestParameters['driveUpdate']), + }; + } + + /** + * Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async updateDriveBetaRaw(requestParameters: UpdateDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateDriveBetaRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveFromJSON(jsonValue)); + } + + /** + * Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async updateDriveBeta(requestParameters: UpdateDriveBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateDriveBetaRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/DrivesGetDrivesApi.ts b/web/packages/web-client/src/graph/generated/apis/DrivesGetDrivesApi.ts new file mode 100644 index 00000000000..daa92b5987f --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/DrivesGetDrivesApi.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfDrives1, + CollectionOfDrives1FromJSON, + CollectionOfDrives1ToJSON, +} from '../models/CollectionOfDrives1'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface ListAllDrivesRequest { + /** + * The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. + */ + $orderby?: string; + /** + * Filter items by property values + */ + $filter?: string; +} + +export interface ListAllDrivesBetaRequest { + /** + * The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. + */ + $orderby?: string; + /** + * Filter items by property values + */ + $filter?: string; +} + +/** + * + */ +export class DrivesGetDrivesApi extends runtime.BaseAPI { + + /** + * Creates request options for listAllDrives without sending the request + */ + async listAllDrivesRequestOpts(requestParameters: ListAllDrivesRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$orderby'] != null) { + queryParameters['$orderby'] = requestParameters['$orderby']; + } + + if (requestParameters['$filter'] != null) { + queryParameters['$filter'] = requestParameters['$filter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/drives`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get all available drives + */ + async listAllDrivesRaw(requestParameters: ListAllDrivesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listAllDrivesRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfDrives1FromJSON(jsonValue)); + } + + /** + * Get all available drives + */ + async listAllDrives(requestParameters: ListAllDrivesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAllDrivesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listAllDrivesBeta without sending the request + */ + async listAllDrivesBetaRequestOpts(requestParameters: ListAllDrivesBetaRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$orderby'] != null) { + queryParameters['$orderby'] = requestParameters['$orderby']; + } + + if (requestParameters['$filter'] != null) { + queryParameters['$filter'] = requestParameters['$filter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async listAllDrivesBetaRaw(requestParameters: ListAllDrivesBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listAllDrivesBetaRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfDrives1FromJSON(jsonValue)); + } + + /** + * Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async listAllDrivesBeta(requestParameters: ListAllDrivesBetaRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAllDrivesBetaRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts b/web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts new file mode 100644 index 00000000000..4e923203c56 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts @@ -0,0 +1,669 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfPermissions, + CollectionOfPermissionsFromJSON, + CollectionOfPermissionsToJSON, +} from '../models/CollectionOfPermissions'; +import { + type CollectionOfPermissionsWithAllowedValues, + CollectionOfPermissionsWithAllowedValuesFromJSON, + CollectionOfPermissionsWithAllowedValuesToJSON, +} from '../models/CollectionOfPermissionsWithAllowedValues'; +import { + type DriveItemCreateLink, + DriveItemCreateLinkFromJSON, + DriveItemCreateLinkToJSON, +} from '../models/DriveItemCreateLink'; +import { + type DriveItemInvite, + DriveItemInviteFromJSON, + DriveItemInviteToJSON, +} from '../models/DriveItemInvite'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type Permission, + PermissionFromJSON, + PermissionToJSON, +} from '../models/Permission'; +import { + type SharingLinkPassword, + SharingLinkPasswordFromJSON, + SharingLinkPasswordToJSON, +} from '../models/SharingLinkPassword'; + +export interface CreateLinkRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * + */ + driveItemCreateLink?: DriveItemCreateLink; +} + +export interface DeletePermissionRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * key: id of permission + */ + permId: string; +} + +export interface GetPermissionRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * key: id of permission + */ + permId: string; +} + +export interface InviteRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * + */ + driveItemInvite?: DriveItemInvite; +} + +export interface ListPermissionsRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. + */ + $filter?: string; + /** + * Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. + */ + $select?: Set; +} + +export interface SetPermissionPasswordRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * key: id of permission + */ + permId: string; + /** + * + */ + sharingLinkPassword: SharingLinkPassword; +} + +export interface UpdatePermissionRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of item + */ + itemId: string; + /** + * key: id of permission + */ + permId: string; + /** + * + */ + permission: Omit; +} + +/** + * + */ +export class DrivesPermissionsApi extends runtime.BaseAPI { + + /** + * Creates request options for createLink without sending the request + */ + async createLinkRequestOpts(requestParameters: CreateLinkRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling createLink().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling createLink().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}/createLink`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DriveItemCreateLinkToJSON(requestParameters['driveItemCreateLink']), + }; + } + + /** + * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | + * Create a sharing link for a DriveItem + */ + async createLinkRaw(requestParameters: CreateLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createLinkRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | + * Create a sharing link for a DriveItem + */ + async createLink(requestParameters: CreateLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createLinkRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 207: + return null; + default: + return await response.value(); + } + } + + /** + * Creates request options for deletePermission without sending the request + */ + async deletePermissionRequestOpts(requestParameters: DeletePermissionRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling deletePermission().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling deletePermission().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling deletePermission().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. + * Remove access to a DriveItem + */ + async deletePermissionRaw(requestParameters: DeletePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deletePermissionRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. + * Remove access to a DriveItem + */ + async deletePermission(requestParameters: DeletePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deletePermissionRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getPermission without sending the request + */ + async getPermissionRequestOpts(requestParameters: GetPermissionRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling getPermission().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling getPermission().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling getPermission().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Return the effective sharing permission for a particular permission resource. + * Get sharing permission for a file or folder + */ + async getPermissionRaw(requestParameters: GetPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getPermissionRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * Return the effective sharing permission for a particular permission resource. + * Get sharing permission for a file or folder + */ + async getPermission(requestParameters: GetPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for invite without sending the request + */ + async inviteRequestOpts(requestParameters: InviteRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling invite().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling invite().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}/invite`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DriveItemInviteToJSON(requestParameters['driveItemInvite']), + }; + } + + /** + * Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. + * Send a sharing invitation + */ + async inviteRaw(requestParameters: InviteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.inviteRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfPermissionsFromJSON(jsonValue)); + } + + /** + * Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. + * Send a sharing invitation + */ + async invite(requestParameters: InviteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.inviteRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 207: + return null; + default: + return await response.value(); + } + } + + /** + * Creates request options for listPermissions without sending the request + */ + async listPermissionsRequestOpts(requestParameters: ListPermissionsRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling listPermissions().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling listPermissions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['$filter'] != null) { + queryParameters['$filter'] = requestParameters['$filter']; + } + + if (requestParameters['$select'] != null) { + queryParameters['$select'] = Array.from(requestParameters['$select'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. + * List the effective sharing permissions on a driveItem. + */ + async listPermissionsRaw(requestParameters: ListPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listPermissionsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfPermissionsWithAllowedValuesFromJSON(jsonValue)); + } + + /** + * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. + * List the effective sharing permissions on a driveItem. + */ + async listPermissions(requestParameters: ListPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPermissionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for setPermissionPassword without sending the request + */ + async setPermissionPasswordRequestOpts(requestParameters: SetPermissionPasswordRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling setPermissionPassword().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling setPermissionPassword().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling setPermissionPassword().' + ); + } + + if (requestParameters['sharingLinkPassword'] == null) { + throw new runtime.RequiredError( + 'sharingLinkPassword', + 'Required parameter "sharingLinkPassword" was null or undefined when calling setPermissionPassword().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SharingLinkPasswordToJSON(requestParameters['sharingLinkPassword']), + }; + } + + /** + * Set the password of a sharing permission. Only the `password` property can be modified this way. + * Set sharing link password + */ + async setPermissionPasswordRaw(requestParameters: SetPermissionPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.setPermissionPasswordRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * Set the password of a sharing permission. Only the `password` property can be modified this way. + * Set sharing link password + */ + async setPermissionPassword(requestParameters: SetPermissionPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.setPermissionPasswordRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updatePermission without sending the request + */ + async updatePermissionRequestOpts(requestParameters: UpdatePermissionRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling updatePermission().' + ); + } + + if (requestParameters['itemId'] == null) { + throw new runtime.RequiredError( + 'itemId', + 'Required parameter "itemId" was null or undefined when calling updatePermission().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling updatePermission().' + ); + } + + if (requestParameters['permission'] == null) { + throw new runtime.RequiredError( + 'permission', + 'Required parameter "permission" was null or undefined when calling updatePermission().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{item-id}', encodeURIComponent(String(requestParameters['itemId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: PermissionToJSON(requestParameters['permission']), + }; + } + + /** + * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. + * Update sharing permission + */ + async updatePermissionRaw(requestParameters: UpdatePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updatePermissionRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. + * Update sharing permission + */ + async updatePermission(requestParameters: UpdatePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updatePermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const ListPermissionsSelectEnum = { + LibreGraphPermissionsActionsAllowedValues: '@libre.graph.permissions.actions.allowedValues', + LibreGraphPermissionsRolesAllowedValues: '@libre.graph.permissions.roles.allowedValues', + Value: 'value', +} as const; +export type ListPermissionsSelectEnum = typeof ListPermissionsSelectEnum[keyof typeof ListPermissionsSelectEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts b/web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts new file mode 100644 index 00000000000..569c5855925 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts @@ -0,0 +1,709 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfPermissions, + CollectionOfPermissionsFromJSON, + CollectionOfPermissionsToJSON, +} from '../models/CollectionOfPermissions'; +import { + type CollectionOfPermissionsWithAllowedValues, + CollectionOfPermissionsWithAllowedValuesFromJSON, + CollectionOfPermissionsWithAllowedValuesToJSON, +} from '../models/CollectionOfPermissionsWithAllowedValues'; +import { + type DriveItem, + DriveItemFromJSON, + DriveItemToJSON, +} from '../models/DriveItem'; +import { + type DriveItemCreateLink, + DriveItemCreateLinkFromJSON, + DriveItemCreateLinkToJSON, +} from '../models/DriveItemCreateLink'; +import { + type DriveItemInvite, + DriveItemInviteFromJSON, + DriveItemInviteToJSON, +} from '../models/DriveItemInvite'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type Permission, + PermissionFromJSON, + PermissionToJSON, +} from '../models/Permission'; +import { + type SharingLinkPassword, + SharingLinkPasswordFromJSON, + SharingLinkPasswordToJSON, +} from '../models/SharingLinkPassword'; + +export interface CreateDriveItemRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * + */ + driveItem?: Omit; +} + +export interface CreateLinkSpaceRootRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * + */ + driveItemCreateLink?: DriveItemCreateLink; +} + +export interface DeletePermissionSpaceRootRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of permission + */ + permId: string; +} + +export interface GetPermissionSpaceRootRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of permission + */ + permId: string; +} + +export interface GetRootRequest { + /** + * key: id of drive + */ + driveId: string; +} + +export interface InviteSpaceRootRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * + */ + driveItemInvite?: DriveItemInvite; +} + +export interface ListPermissionsSpaceRootRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. + */ + $filter?: string; + /** + * Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. + */ + $select?: Set; +} + +export interface SetPermissionPasswordSpaceRootRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of permission + */ + permId: string; + /** + * + */ + sharingLinkPassword: SharingLinkPassword; +} + +export interface UpdatePermissionSpaceRootRequest { + /** + * key: id of drive + */ + driveId: string; + /** + * key: id of permission + */ + permId: string; + /** + * + */ + permission: Omit; +} + +/** + * + */ +export class DrivesRootApi extends runtime.BaseAPI { + + /** + * Creates request options for createDriveItem without sending the request + */ + async createDriveItemRequestOpts(requestParameters: CreateDriveItemRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling createDriveItem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/children`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DriveItemToJSON(requestParameters['driveItem']), + }; + } + + /** + * You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. + * Create a drive item + */ + async createDriveItemRaw(requestParameters: CreateDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createDriveItemRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveItemFromJSON(jsonValue)); + } + + /** + * You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. + * Create a drive item + */ + async createDriveItem(requestParameters: CreateDriveItemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createDriveItemRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for createLinkSpaceRoot without sending the request + */ + async createLinkSpaceRootRequestOpts(requestParameters: CreateLinkSpaceRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling createLinkSpaceRoot().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/createLink`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DriveItemCreateLinkToJSON(requestParameters['driveItemCreateLink']), + }; + } + + /** + * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | + * Create a sharing link for the root item of a Drive + */ + async createLinkSpaceRootRaw(requestParameters: CreateLinkSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createLinkSpaceRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | + * Create a sharing link for the root item of a Drive + */ + async createLinkSpaceRoot(requestParameters: CreateLinkSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createLinkSpaceRootRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 207: + return null; + default: + return await response.value(); + } + } + + /** + * Creates request options for deletePermissionSpaceRoot without sending the request + */ + async deletePermissionSpaceRootRequestOpts(requestParameters: DeletePermissionSpaceRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling deletePermissionSpaceRoot().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling deletePermissionSpaceRoot().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. + * Remove access to a Drive + */ + async deletePermissionSpaceRootRaw(requestParameters: DeletePermissionSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deletePermissionSpaceRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. + * Remove access to a Drive + */ + async deletePermissionSpaceRoot(requestParameters: DeletePermissionSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deletePermissionSpaceRootRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getPermissionSpaceRoot without sending the request + */ + async getPermissionSpaceRootRequestOpts(requestParameters: GetPermissionSpaceRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling getPermissionSpaceRoot().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling getPermissionSpaceRoot().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Return the effective sharing permission for a particular permission resource. + * Get a single sharing permission for the root item of a drive + */ + async getPermissionSpaceRootRaw(requestParameters: GetPermissionSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getPermissionSpaceRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * Return the effective sharing permission for a particular permission resource. + * Get a single sharing permission for the root item of a drive + */ + async getPermissionSpaceRoot(requestParameters: GetPermissionSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPermissionSpaceRootRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for getRoot without sending the request + */ + async getRootRequestOpts(requestParameters: GetRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling getRoot().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/drives/{drive-id}/root`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get root from arbitrary space + */ + async getRootRaw(requestParameters: GetRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveItemFromJSON(jsonValue)); + } + + /** + * Get root from arbitrary space + */ + async getRoot(requestParameters: GetRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getRootRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for inviteSpaceRoot without sending the request + */ + async inviteSpaceRootRequestOpts(requestParameters: InviteSpaceRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling inviteSpaceRoot().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/invite`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DriveItemInviteToJSON(requestParameters['driveItemInvite']), + }; + } + + /** + * Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. + * Send a sharing invitation + */ + async inviteSpaceRootRaw(requestParameters: InviteSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.inviteSpaceRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfPermissionsFromJSON(jsonValue)); + } + + /** + * Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. + * Send a sharing invitation + */ + async inviteSpaceRoot(requestParameters: InviteSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.inviteSpaceRootRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 207: + return null; + default: + return await response.value(); + } + } + + /** + * Creates request options for listPermissionsSpaceRoot without sending the request + */ + async listPermissionsSpaceRootRequestOpts(requestParameters: ListPermissionsSpaceRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling listPermissionsSpaceRoot().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['$filter'] != null) { + queryParameters['$filter'] = requestParameters['$filter']; + } + + if (requestParameters['$select'] != null) { + queryParameters['$select'] = Array.from(requestParameters['$select'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/permissions`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. + * List the effective permissions on the root item of a drive. + */ + async listPermissionsSpaceRootRaw(requestParameters: ListPermissionsSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listPermissionsSpaceRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfPermissionsWithAllowedValuesFromJSON(jsonValue)); + } + + /** + * The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. + * List the effective permissions on the root item of a drive. + */ + async listPermissionsSpaceRoot(requestParameters: ListPermissionsSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPermissionsSpaceRootRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for setPermissionPasswordSpaceRoot without sending the request + */ + async setPermissionPasswordSpaceRootRequestOpts(requestParameters: SetPermissionPasswordSpaceRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling setPermissionPasswordSpaceRoot().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling setPermissionPasswordSpaceRoot().' + ); + } + + if (requestParameters['sharingLinkPassword'] == null) { + throw new runtime.RequiredError( + 'sharingLinkPassword', + 'Required parameter "sharingLinkPassword" was null or undefined when calling setPermissionPasswordSpaceRoot().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}/setPassword`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SharingLinkPasswordToJSON(requestParameters['sharingLinkPassword']), + }; + } + + /** + * Set the password of a sharing permission. Only the `password` property can be modified this way. + * Set sharing link password for the root item of a drive + */ + async setPermissionPasswordSpaceRootRaw(requestParameters: SetPermissionPasswordSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.setPermissionPasswordSpaceRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * Set the password of a sharing permission. Only the `password` property can be modified this way. + * Set sharing link password for the root item of a drive + */ + async setPermissionPasswordSpaceRoot(requestParameters: SetPermissionPasswordSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.setPermissionPasswordSpaceRootRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updatePermissionSpaceRoot without sending the request + */ + async updatePermissionSpaceRootRequestOpts(requestParameters: UpdatePermissionSpaceRootRequest): Promise { + if (requestParameters['driveId'] == null) { + throw new runtime.RequiredError( + 'driveId', + 'Required parameter "driveId" was null or undefined when calling updatePermissionSpaceRoot().' + ); + } + + if (requestParameters['permId'] == null) { + throw new runtime.RequiredError( + 'permId', + 'Required parameter "permId" was null or undefined when calling updatePermissionSpaceRoot().' + ); + } + + if (requestParameters['permission'] == null) { + throw new runtime.RequiredError( + 'permission', + 'Required parameter "permission" was null or undefined when calling updatePermissionSpaceRoot().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/drives/{drive-id}/root/permissions/{perm-id}`; + urlPath = urlPath.replace('{drive-id}', encodeURIComponent(String(requestParameters['driveId']))); + urlPath = urlPath.replace('{perm-id}', encodeURIComponent(String(requestParameters['permId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: PermissionToJSON(requestParameters['permission']), + }; + } + + /** + * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. + * Update sharing permission + */ + async updatePermissionSpaceRootRaw(requestParameters: UpdatePermissionSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updatePermissionSpaceRootRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PermissionFromJSON(jsonValue)); + } + + /** + * Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. + * Update sharing permission + */ + async updatePermissionSpaceRoot(requestParameters: UpdatePermissionSpaceRootRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updatePermissionSpaceRootRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const ListPermissionsSpaceRootSelectEnum = { + LibreGraphPermissionsActionsAllowedValues: '@libre.graph.permissions.actions.allowedValues', + LibreGraphPermissionsRolesAllowedValues: '@libre.graph.permissions.roles.allowedValues', + Value: 'value', +} as const; +export type ListPermissionsSpaceRootSelectEnum = typeof ListPermissionsSpaceRootSelectEnum[keyof typeof ListPermissionsSpaceRootSelectEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts b/web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts new file mode 100644 index 00000000000..79bfb1a2d55 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts @@ -0,0 +1,558 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type ClassMemberReference, + ClassMemberReferenceFromJSON, + ClassMemberReferenceToJSON, +} from '../models/ClassMemberReference'; +import { + type CollectionOfClass, + CollectionOfClassFromJSON, + CollectionOfClassToJSON, +} from '../models/CollectionOfClass'; +import { + type CollectionOfEducationUser, + CollectionOfEducationUserFromJSON, + CollectionOfEducationUserToJSON, +} from '../models/CollectionOfEducationUser'; +import { + type EducationClass, + EducationClassFromJSON, + EducationClassToJSON, +} from '../models/EducationClass'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface AddUserToClassRequest { + /** + * key: id or externalId of class + */ + classId: string; + /** + * + */ + classMemberReference: ClassMemberReference; +} + +export interface CreateClassRequest { + /** + * + */ + educationClass: Omit; +} + +export interface DeleteClassRequest { + /** + * key: id or externalId of class + */ + classId: string; +} + +export interface DeleteUserFromClassRequest { + /** + * key: id or externalId of class + */ + classId: string; + /** + * key: id or username of the user to unassign from class + */ + userId: string; +} + +export interface GetClassRequest { + /** + * key: id or externalId of class + */ + classId: string; +} + +export interface ListClassMembersRequest { + /** + * key: id or externalId of class + */ + classId: string; +} + +export interface UpdateClassRequest { + /** + * key: id or externalId of class + */ + classId: string; + /** + * + */ + educationClass: Omit; +} + +/** + * + */ +export class EducationClassApi extends runtime.BaseAPI { + + /** + * Creates request options for addUserToClass without sending the request + */ + async addUserToClassRequestOpts(requestParameters: AddUserToClassRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling addUserToClass().' + ); + } + + if (requestParameters['classMemberReference'] == null) { + throw new runtime.RequiredError( + 'classMemberReference', + 'Required parameter "classMemberReference" was null or undefined when calling addUserToClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}/members/$ref`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ClassMemberReferenceToJSON(requestParameters['classMemberReference']), + }; + } + + /** + * Assign a user to a class + */ + async addUserToClassRaw(requestParameters: AddUserToClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.addUserToClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Assign a user to a class + */ + async addUserToClass(requestParameters: AddUserToClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addUserToClassRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for createClass without sending the request + */ + async createClassRequestOpts(requestParameters: CreateClassRequest): Promise { + if (requestParameters['educationClass'] == null) { + throw new runtime.RequiredError( + 'educationClass', + 'Required parameter "educationClass" was null or undefined when calling createClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EducationClassToJSON(requestParameters['educationClass']), + }; + } + + /** + * Add new education class + */ + async createClassRaw(requestParameters: CreateClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationClassFromJSON(jsonValue)); + } + + /** + * Add new education class + */ + async createClass(requestParameters: CreateClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createClassRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for deleteClass without sending the request + */ + async deleteClassRequestOpts(requestParameters: DeleteClassRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling deleteClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete education class + */ + async deleteClassRaw(requestParameters: DeleteClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete education class + */ + async deleteClass(requestParameters: DeleteClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteClassRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteUserFromClass without sending the request + */ + async deleteUserFromClassRequestOpts(requestParameters: DeleteUserFromClassRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling deleteUserFromClass().' + ); + } + + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling deleteUserFromClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}/members/{user-id}/$ref`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Unassign user from a class + */ + async deleteUserFromClassRaw(requestParameters: DeleteUserFromClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteUserFromClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Unassign user from a class + */ + async deleteUserFromClass(requestParameters: DeleteUserFromClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteUserFromClassRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getClass without sending the request + */ + async getClassRequestOpts(requestParameters: GetClassRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling getClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get class by key + */ + async getClassRaw(requestParameters: GetClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationClassFromJSON(jsonValue)); + } + + /** + * Get class by key + */ + async getClass(requestParameters: GetClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getClassRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listClassMembers without sending the request + */ + async listClassMembersRequestOpts(requestParameters: ListClassMembersRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling listClassMembers().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}/members`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get the educationClass resources owned by an educationSchool + */ + async listClassMembersRaw(requestParameters: ListClassMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listClassMembersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfEducationUserFromJSON(jsonValue)); + } + + /** + * Get the educationClass resources owned by an educationSchool + */ + async listClassMembers(requestParameters: ListClassMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listClassMembersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listClasses without sending the request + */ + async listClassesRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * list education classes + */ + async listClassesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listClassesRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfClassFromJSON(jsonValue)); + } + + /** + * list education classes + */ + async listClasses(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listClassesRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateClass without sending the request + */ + async updateClassRequestOpts(requestParameters: UpdateClassRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling updateClass().' + ); + } + + if (requestParameters['educationClass'] == null) { + throw new runtime.RequiredError( + 'educationClass', + 'Required parameter "educationClass" was null or undefined when calling updateClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: EducationClassToJSON(requestParameters['educationClass']), + }; + } + + /** + * Update properties of a education class + */ + async updateClassRaw(requestParameters: UpdateClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationClassFromJSON(jsonValue)); + } + + /** + * Update properties of a education class + */ + async updateClass(requestParameters: UpdateClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateClassRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 204: + return null; + default: + return await response.value(); + } + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/EducationClassTeachersApi.ts b/web/packages/web-client/src/graph/generated/apis/EducationClassTeachersApi.ts new file mode 100644 index 00000000000..aaefc2a208f --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/EducationClassTeachersApi.ts @@ -0,0 +1,241 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type ClassTeacherReference, + ClassTeacherReferenceFromJSON, + ClassTeacherReferenceToJSON, +} from '../models/ClassTeacherReference'; +import { + type CollectionOfEducationUser, + CollectionOfEducationUserFromJSON, + CollectionOfEducationUserToJSON, +} from '../models/CollectionOfEducationUser'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface AddTeacherToClassRequest { + /** + * key: id or externalId of class + */ + classId: string; + /** + * + */ + classTeacherReference: ClassTeacherReference; +} + +export interface DeleteTeacherFromClassRequest { + /** + * key: id or externalId of class + */ + classId: string; + /** + * key: id or username of the user to unassign as teacher + */ + userId: string; +} + +export interface GetTeachersRequest { + /** + * key: id or externalId of class + */ + classId: string; +} + +/** + * + */ +export class EducationClassTeachersApi extends runtime.BaseAPI { + + /** + * Creates request options for addTeacherToClass without sending the request + */ + async addTeacherToClassRequestOpts(requestParameters: AddTeacherToClassRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling addTeacherToClass().' + ); + } + + if (requestParameters['classTeacherReference'] == null) { + throw new runtime.RequiredError( + 'classTeacherReference', + 'Required parameter "classTeacherReference" was null or undefined when calling addTeacherToClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}/teachers/$ref`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ClassTeacherReferenceToJSON(requestParameters['classTeacherReference']), + }; + } + + /** + * Assign a teacher to a class + */ + async addTeacherToClassRaw(requestParameters: AddTeacherToClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.addTeacherToClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Assign a teacher to a class + */ + async addTeacherToClass(requestParameters: AddTeacherToClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addTeacherToClassRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteTeacherFromClass without sending the request + */ + async deleteTeacherFromClassRequestOpts(requestParameters: DeleteTeacherFromClassRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling deleteTeacherFromClass().' + ); + } + + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling deleteTeacherFromClass().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}/teachers/{user-id}/$ref`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Unassign user as teacher of a class + */ + async deleteTeacherFromClassRaw(requestParameters: DeleteTeacherFromClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteTeacherFromClassRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Unassign user as teacher of a class + */ + async deleteTeacherFromClass(requestParameters: DeleteTeacherFromClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteTeacherFromClassRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getTeachers without sending the request + */ + async getTeachersRequestOpts(requestParameters: GetTeachersRequest): Promise { + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling getTeachers().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/classes/{class-id}/teachers`; + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get the teachers for a class + */ + async getTeachersRaw(requestParameters: GetTeachersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getTeachersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfEducationUserFromJSON(jsonValue)); + } + + /** + * Get the teachers for a class + */ + async getTeachers(requestParameters: GetTeachersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTeachersRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts b/web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts new file mode 100644 index 00000000000..54952b5088b --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts @@ -0,0 +1,767 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type ClassReference, + ClassReferenceFromJSON, + ClassReferenceToJSON, +} from '../models/ClassReference'; +import { + type CollectionOfEducationClass, + CollectionOfEducationClassFromJSON, + CollectionOfEducationClassToJSON, +} from '../models/CollectionOfEducationClass'; +import { + type CollectionOfEducationUser, + CollectionOfEducationUserFromJSON, + CollectionOfEducationUserToJSON, +} from '../models/CollectionOfEducationUser'; +import { + type CollectionOfSchools, + CollectionOfSchoolsFromJSON, + CollectionOfSchoolsToJSON, +} from '../models/CollectionOfSchools'; +import { + type EducationSchool, + EducationSchoolFromJSON, + EducationSchoolToJSON, +} from '../models/EducationSchool'; +import { + type EducationUserReference, + EducationUserReferenceFromJSON, + EducationUserReferenceToJSON, +} from '../models/EducationUserReference'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface AddClassToSchoolRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; + /** + * + */ + classReference: ClassReference; +} + +export interface AddUserToSchoolRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; + /** + * + */ + educationUserReference: EducationUserReference; +} + +export interface CreateSchoolRequest { + /** + * + */ + educationSchool: Omit; +} + +export interface DeleteClassFromSchoolRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; + /** + * key: id or externalId of the class to unassign from school + */ + classId: string; +} + +export interface DeleteSchoolRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; +} + +export interface DeleteUserFromSchoolRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; + /** + * key: id or username of the user to unassign from school + */ + userId: string; +} + +export interface GetSchoolRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; +} + +export interface ListSchoolClassesRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; +} + +export interface ListSchoolUsersRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; +} + +export interface UpdateSchoolRequest { + /** + * key: id or schoolNumber of school + */ + schoolId: string; + /** + * + */ + educationSchool: Omit; +} + +/** + * + */ +export class EducationSchoolApi extends runtime.BaseAPI { + + /** + * Creates request options for addClassToSchool without sending the request + */ + async addClassToSchoolRequestOpts(requestParameters: AddClassToSchoolRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling addClassToSchool().' + ); + } + + if (requestParameters['classReference'] == null) { + throw new runtime.RequiredError( + 'classReference', + 'Required parameter "classReference" was null or undefined when calling addClassToSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}/classes/$ref`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ClassReferenceToJSON(requestParameters['classReference']), + }; + } + + /** + * Assign a class to a school + */ + async addClassToSchoolRaw(requestParameters: AddClassToSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.addClassToSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Assign a class to a school + */ + async addClassToSchool(requestParameters: AddClassToSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addClassToSchoolRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for addUserToSchool without sending the request + */ + async addUserToSchoolRequestOpts(requestParameters: AddUserToSchoolRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling addUserToSchool().' + ); + } + + if (requestParameters['educationUserReference'] == null) { + throw new runtime.RequiredError( + 'educationUserReference', + 'Required parameter "educationUserReference" was null or undefined when calling addUserToSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}/users/$ref`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EducationUserReferenceToJSON(requestParameters['educationUserReference']), + }; + } + + /** + * Assign a user to a school + */ + async addUserToSchoolRaw(requestParameters: AddUserToSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.addUserToSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Assign a user to a school + */ + async addUserToSchool(requestParameters: AddUserToSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addUserToSchoolRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for createSchool without sending the request + */ + async createSchoolRequestOpts(requestParameters: CreateSchoolRequest): Promise { + if (requestParameters['educationSchool'] == null) { + throw new runtime.RequiredError( + 'educationSchool', + 'Required parameter "educationSchool" was null or undefined when calling createSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EducationSchoolToJSON(requestParameters['educationSchool']), + }; + } + + /** + * Add new school + */ + async createSchoolRaw(requestParameters: CreateSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationSchoolFromJSON(jsonValue)); + } + + /** + * Add new school + */ + async createSchool(requestParameters: CreateSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createSchoolRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for deleteClassFromSchool without sending the request + */ + async deleteClassFromSchoolRequestOpts(requestParameters: DeleteClassFromSchoolRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling deleteClassFromSchool().' + ); + } + + if (requestParameters['classId'] == null) { + throw new runtime.RequiredError( + 'classId', + 'Required parameter "classId" was null or undefined when calling deleteClassFromSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}/classes/{class-id}/$ref`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + urlPath = urlPath.replace('{class-id}', encodeURIComponent(String(requestParameters['classId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Unassign class from a school + */ + async deleteClassFromSchoolRaw(requestParameters: DeleteClassFromSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteClassFromSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Unassign class from a school + */ + async deleteClassFromSchool(requestParameters: DeleteClassFromSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteClassFromSchoolRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteSchool without sending the request + */ + async deleteSchoolRequestOpts(requestParameters: DeleteSchoolRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling deleteSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. + * Delete school + */ + async deleteSchoolRaw(requestParameters: DeleteSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. + * Delete school + */ + async deleteSchool(requestParameters: DeleteSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteSchoolRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteUserFromSchool without sending the request + */ + async deleteUserFromSchoolRequestOpts(requestParameters: DeleteUserFromSchoolRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling deleteUserFromSchool().' + ); + } + + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling deleteUserFromSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}/users/{user-id}/$ref`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Unassign user from a school + */ + async deleteUserFromSchoolRaw(requestParameters: DeleteUserFromSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteUserFromSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Unassign user from a school + */ + async deleteUserFromSchool(requestParameters: DeleteUserFromSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteUserFromSchoolRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getSchool without sending the request + */ + async getSchoolRequestOpts(requestParameters: GetSchoolRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling getSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get the properties of a specific school + */ + async getSchoolRaw(requestParameters: GetSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationSchoolFromJSON(jsonValue)); + } + + /** + * Get the properties of a specific school + */ + async getSchool(requestParameters: GetSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getSchoolRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listSchoolClasses without sending the request + */ + async listSchoolClassesRequestOpts(requestParameters: ListSchoolClassesRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling listSchoolClasses().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}/classes`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get the educationClass resources owned by an educationSchool + */ + async listSchoolClassesRaw(requestParameters: ListSchoolClassesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listSchoolClassesRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfEducationClassFromJSON(jsonValue)); + } + + /** + * Get the educationClass resources owned by an educationSchool + */ + async listSchoolClasses(requestParameters: ListSchoolClassesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listSchoolClassesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listSchoolUsers without sending the request + */ + async listSchoolUsersRequestOpts(requestParameters: ListSchoolUsersRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling listSchoolUsers().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}/users`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get the educationUser resources associated with an educationSchool + */ + async listSchoolUsersRaw(requestParameters: ListSchoolUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listSchoolUsersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfEducationUserFromJSON(jsonValue)); + } + + /** + * Get the educationUser resources associated with an educationSchool + */ + async listSchoolUsers(requestParameters: ListSchoolUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listSchoolUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listSchools without sending the request + */ + async listSchoolsRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get a list of schools and their properties + */ + async listSchoolsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listSchoolsRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfSchoolsFromJSON(jsonValue)); + } + + /** + * Get a list of schools and their properties + */ + async listSchools(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listSchoolsRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateSchool without sending the request + */ + async updateSchoolRequestOpts(requestParameters: UpdateSchoolRequest): Promise { + if (requestParameters['schoolId'] == null) { + throw new runtime.RequiredError( + 'schoolId', + 'Required parameter "schoolId" was null or undefined when calling updateSchool().' + ); + } + + if (requestParameters['educationSchool'] == null) { + throw new runtime.RequiredError( + 'educationSchool', + 'Required parameter "educationSchool" was null or undefined when calling updateSchool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/schools/{school-id}`; + urlPath = urlPath.replace('{school-id}', encodeURIComponent(String(requestParameters['schoolId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: EducationSchoolToJSON(requestParameters['educationSchool']), + }; + } + + /** + * Update properties of a school + */ + async updateSchoolRaw(requestParameters: UpdateSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateSchoolRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationSchoolFromJSON(jsonValue)); + } + + /** + * Update properties of a school + */ + async updateSchool(requestParameters: UpdateSchoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateSchoolRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts b/web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts new file mode 100644 index 00000000000..f8411bce336 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts @@ -0,0 +1,398 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfEducationUser, + CollectionOfEducationUserFromJSON, + CollectionOfEducationUserToJSON, +} from '../models/CollectionOfEducationUser'; +import { + type EducationUser, + EducationUserFromJSON, + EducationUserToJSON, +} from '../models/EducationUser'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface CreateEducationUserRequest { + /** + * + */ + educationUser: Omit; +} + +export interface DeleteEducationUserRequest { + /** + * key: id or username of user + */ + userId: string; +} + +export interface GetEducationUserRequest { + /** + * key: id or username of user + */ + userId: string; + /** + * Expand related entities + */ + $expand?: Set; +} + +export interface ListEducationUsersRequest { + /** + * Order items by property values + */ + $orderby?: Set; + /** + * Expand related entities + */ + $expand?: Set; +} + +export interface UpdateEducationUserRequest { + /** + * key: id or username of user + */ + userId: string; + /** + * + */ + educationUser: Omit; +} + +/** + * + */ +export class EducationUserApi extends runtime.BaseAPI { + + /** + * Creates request options for createEducationUser without sending the request + */ + async createEducationUserRequestOpts(requestParameters: CreateEducationUserRequest): Promise { + if (requestParameters['educationUser'] == null) { + throw new runtime.RequiredError( + 'educationUser', + 'Required parameter "educationUser" was null or undefined when calling createEducationUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/users`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EducationUserToJSON(requestParameters['educationUser']), + }; + } + + /** + * Add new education user + */ + async createEducationUserRaw(requestParameters: CreateEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createEducationUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationUserFromJSON(jsonValue)); + } + + /** + * Add new education user + */ + async createEducationUser(requestParameters: CreateEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createEducationUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for deleteEducationUser without sending the request + */ + async deleteEducationUserRequestOpts(requestParameters: DeleteEducationUserRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling deleteEducationUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/users/{user-id}`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete educationUser + */ + async deleteEducationUserRaw(requestParameters: DeleteEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteEducationUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete educationUser + */ + async deleteEducationUser(requestParameters: DeleteEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteEducationUserRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getEducationUser without sending the request + */ + async getEducationUserRequestOpts(requestParameters: GetEducationUserRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling getEducationUser().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['$expand'] != null) { + queryParameters['$expand'] = Array.from(requestParameters['$expand'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/users/{user-id}`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get properties of educationUser + */ + async getEducationUserRaw(requestParameters: GetEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getEducationUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationUserFromJSON(jsonValue)); + } + + /** + * Get properties of educationUser + */ + async getEducationUser(requestParameters: GetEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getEducationUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listEducationUsers without sending the request + */ + async listEducationUsersRequestOpts(requestParameters: ListEducationUsersRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$orderby'] != null) { + queryParameters['$orderby'] = Array.from(requestParameters['$orderby'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['$expand'] != null) { + queryParameters['$expand'] = Array.from(requestParameters['$expand'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/users`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get entities from education users + */ + async listEducationUsersRaw(requestParameters: ListEducationUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listEducationUsersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfEducationUserFromJSON(jsonValue)); + } + + /** + * Get entities from education users + */ + async listEducationUsers(requestParameters: ListEducationUsersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listEducationUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateEducationUser without sending the request + */ + async updateEducationUserRequestOpts(requestParameters: UpdateEducationUserRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling updateEducationUser().' + ); + } + + if (requestParameters['educationUser'] == null) { + throw new runtime.RequiredError( + 'educationUser', + 'Required parameter "educationUser" was null or undefined when calling updateEducationUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/v1.0/education/users/{user-id}`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: EducationUserToJSON(requestParameters['educationUser']), + }; + } + + /** + * Update properties of educationUser + */ + async updateEducationUserRaw(requestParameters: UpdateEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateEducationUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EducationUserFromJSON(jsonValue)); + } + + /** + * Update properties of educationUser + */ + async updateEducationUser(requestParameters: UpdateEducationUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateEducationUserRaw(requestParameters, initOverrides); + switch (response.raw.status) { + case 200: + return await response.value(); + case 204: + return null; + default: + return await response.value(); + } + } + +} + +/** + * @export + */ +export const GetEducationUserExpandEnum = { + MemberOf: 'memberOf', +} as const; +export type GetEducationUserExpandEnum = typeof GetEducationUserExpandEnum[keyof typeof GetEducationUserExpandEnum]; +/** + * @export + */ +export const ListEducationUsersOrderbyEnum = { + DisplayName: 'displayName', + DisplayNameDesc: 'displayName desc', + Mail: 'mail', + MailDesc: 'mail desc', + OnPremisesSamAccountName: 'onPremisesSamAccountName', + OnPremisesSamAccountNameDesc: 'onPremisesSamAccountName desc', +} as const; +export type ListEducationUsersOrderbyEnum = typeof ListEducationUsersOrderbyEnum[keyof typeof ListEducationUsersOrderbyEnum]; +/** + * @export + */ +export const ListEducationUsersExpandEnum = { + MemberOf: 'memberOf', +} as const; +export type ListEducationUsersExpandEnum = typeof ListEducationUsersExpandEnum[keyof typeof ListEducationUsersExpandEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/GroupApi.ts b/web/packages/web-client/src/graph/generated/apis/GroupApi.ts new file mode 100644 index 00000000000..5cc1fcd7e81 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/GroupApi.ts @@ -0,0 +1,458 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfUsers, + CollectionOfUsersFromJSON, + CollectionOfUsersToJSON, +} from '../models/CollectionOfUsers'; +import { + type Group, + GroupFromJSON, + GroupToJSON, +} from '../models/Group'; +import { + type MemberReference, + MemberReferenceFromJSON, + MemberReferenceToJSON, +} from '../models/MemberReference'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface AddMemberRequest { + /** + * key: id of group + */ + groupId: string; + /** + * + */ + memberReference: MemberReference; +} + +export interface DeleteGroupRequest { + /** + * key: id of group + */ + groupId: string; + /** + * ETag + */ + ifMatch?: string; +} + +export interface DeleteMemberRequest { + /** + * key: id of group + */ + groupId: string; + /** + * key: id of group member to remove + */ + directoryObjectId: string; + /** + * ETag + */ + ifMatch?: string; +} + +export interface GetGroupRequest { + /** + * key: id or name of group + */ + groupId: string; + /** + * Select properties to be returned + */ + $select?: Set; + /** + * Expand related entities + */ + $expand?: Set; +} + +export interface ListMembersRequest { + /** + * key: id or name of group + */ + groupId: string; +} + +export interface UpdateGroupRequest { + /** + * key: id of group + */ + groupId: string; + /** + * + */ + group: Omit; +} + +/** + * + */ +export class GroupApi extends runtime.BaseAPI { + + /** + * Creates request options for addMember without sending the request + */ + async addMemberRequestOpts(requestParameters: AddMemberRequest): Promise { + if (requestParameters['groupId'] == null) { + throw new runtime.RequiredError( + 'groupId', + 'Required parameter "groupId" was null or undefined when calling addMember().' + ); + } + + if (requestParameters['memberReference'] == null) { + throw new runtime.RequiredError( + 'memberReference', + 'Required parameter "memberReference" was null or undefined when calling addMember().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups/{group-id}/members/$ref`; + urlPath = urlPath.replace('{group-id}', encodeURIComponent(String(requestParameters['groupId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: MemberReferenceToJSON(requestParameters['memberReference']), + }; + } + + /** + * Add a member to a group + */ + async addMemberRaw(requestParameters: AddMemberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.addMemberRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Add a member to a group + */ + async addMember(requestParameters: AddMemberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addMemberRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteGroup without sending the request + */ + async deleteGroupRequestOpts(requestParameters: DeleteGroupRequest): Promise { + if (requestParameters['groupId'] == null) { + throw new runtime.RequiredError( + 'groupId', + 'Required parameter "groupId" was null or undefined when calling deleteGroup().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['ifMatch'] != null) { + headerParameters['If-Match'] = String(requestParameters['ifMatch']); + } + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups/{group-id}`; + urlPath = urlPath.replace('{group-id}', encodeURIComponent(String(requestParameters['groupId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete entity from groups + */ + async deleteGroupRaw(requestParameters: DeleteGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteGroupRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete entity from groups + */ + async deleteGroup(requestParameters: DeleteGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteGroupRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteMember without sending the request + */ + async deleteMemberRequestOpts(requestParameters: DeleteMemberRequest): Promise { + if (requestParameters['groupId'] == null) { + throw new runtime.RequiredError( + 'groupId', + 'Required parameter "groupId" was null or undefined when calling deleteMember().' + ); + } + + if (requestParameters['directoryObjectId'] == null) { + throw new runtime.RequiredError( + 'directoryObjectId', + 'Required parameter "directoryObjectId" was null or undefined when calling deleteMember().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['ifMatch'] != null) { + headerParameters['If-Match'] = String(requestParameters['ifMatch']); + } + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups/{group-id}/members/{directory-object-id}/$ref`; + urlPath = urlPath.replace('{group-id}', encodeURIComponent(String(requestParameters['groupId']))); + urlPath = urlPath.replace('{directory-object-id}', encodeURIComponent(String(requestParameters['directoryObjectId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete member from a group + */ + async deleteMemberRaw(requestParameters: DeleteMemberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteMemberRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete member from a group + */ + async deleteMember(requestParameters: DeleteMemberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteMemberRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getGroup without sending the request + */ + async getGroupRequestOpts(requestParameters: GetGroupRequest): Promise { + if (requestParameters['groupId'] == null) { + throw new runtime.RequiredError( + 'groupId', + 'Required parameter "groupId" was null or undefined when calling getGroup().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['$select'] != null) { + queryParameters['$select'] = Array.from(requestParameters['$select'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['$expand'] != null) { + queryParameters['$expand'] = Array.from(requestParameters['$expand'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups/{group-id}`; + urlPath = urlPath.replace('{group-id}', encodeURIComponent(String(requestParameters['groupId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get entity from groups by key + */ + async getGroupRaw(requestParameters: GetGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getGroupRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupFromJSON(jsonValue)); + } + + /** + * Get entity from groups by key + */ + async getGroup(requestParameters: GetGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listMembers without sending the request + */ + async listMembersRequestOpts(requestParameters: ListMembersRequest): Promise { + if (requestParameters['groupId'] == null) { + throw new runtime.RequiredError( + 'groupId', + 'Required parameter "groupId" was null or undefined when calling listMembers().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups/{group-id}/members`; + urlPath = urlPath.replace('{group-id}', encodeURIComponent(String(requestParameters['groupId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get a list of the group\'s direct members + */ + async listMembersRaw(requestParameters: ListMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listMembersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfUsersFromJSON(jsonValue)); + } + + /** + * Get a list of the group\'s direct members + */ + async listMembers(requestParameters: ListMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listMembersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateGroup without sending the request + */ + async updateGroupRequestOpts(requestParameters: UpdateGroupRequest): Promise { + if (requestParameters['groupId'] == null) { + throw new runtime.RequiredError( + 'groupId', + 'Required parameter "groupId" was null or undefined when calling updateGroup().' + ); + } + + if (requestParameters['group'] == null) { + throw new runtime.RequiredError( + 'group', + 'Required parameter "group" was null or undefined when calling updateGroup().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups/{group-id}`; + urlPath = urlPath.replace('{group-id}', encodeURIComponent(String(requestParameters['groupId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: GroupToJSON(requestParameters['group']), + }; + } + + /** + * Update entity in groups + */ + async updateGroupRaw(requestParameters: UpdateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateGroupRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update entity in groups + */ + async updateGroup(requestParameters: UpdateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.updateGroupRaw(requestParameters, initOverrides); + } + +} + +/** + * @export + */ +export const GetGroupSelectEnum = { + Id: 'id', + Description: 'description', + DisplayName: 'displayName', + Members: 'members', +} as const; +export type GetGroupSelectEnum = typeof GetGroupSelectEnum[keyof typeof GetGroupSelectEnum]; +/** + * @export + */ +export const GetGroupExpandEnum = { + Members: 'members', +} as const; +export type GetGroupExpandEnum = typeof GetGroupExpandEnum[keyof typeof GetGroupExpandEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/GroupsApi.ts b/web/packages/web-client/src/graph/generated/apis/GroupsApi.ts new file mode 100644 index 00000000000..584bd108e4e --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/GroupsApi.ts @@ -0,0 +1,196 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfGroup, + CollectionOfGroupFromJSON, + CollectionOfGroupToJSON, +} from '../models/CollectionOfGroup'; +import { + type Group, + GroupFromJSON, + GroupToJSON, +} from '../models/Group'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface CreateGroupRequest { + /** + * + */ + group: Omit; +} + +export interface ListGroupsRequest { + /** + * Search items by search phrases + */ + $search?: string; + /** + * Order items by property values + */ + $orderby?: Set; + /** + * Select properties to be returned + */ + $select?: Set; + /** + * Expand related entities + */ + $expand?: Set; +} + +/** + * + */ +export class GroupsApi extends runtime.BaseAPI { + + /** + * Creates request options for createGroup without sending the request + */ + async createGroupRequestOpts(requestParameters: CreateGroupRequest): Promise { + if (requestParameters['group'] == null) { + throw new runtime.RequiredError( + 'group', + 'Required parameter "group" was null or undefined when calling createGroup().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GroupToJSON(requestParameters['group']), + }; + } + + /** + * Add new entity to groups + */ + async createGroupRaw(requestParameters: CreateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createGroupRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupFromJSON(jsonValue)); + } + + /** + * Add new entity to groups + */ + async createGroup(requestParameters: CreateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listGroups without sending the request + */ + async listGroupsRequestOpts(requestParameters: ListGroupsRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$search'] != null) { + queryParameters['$search'] = requestParameters['$search']; + } + + if (requestParameters['$orderby'] != null) { + queryParameters['$orderby'] = Array.from(requestParameters['$orderby'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['$select'] != null) { + queryParameters['$select'] = Array.from(requestParameters['$select'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['$expand'] != null) { + queryParameters['$expand'] = Array.from(requestParameters['$expand'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/groups`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get entities from groups + */ + async listGroupsRaw(requestParameters: ListGroupsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listGroupsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfGroupFromJSON(jsonValue)); + } + + /** + * Get entities from groups + */ + async listGroups(requestParameters: ListGroupsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listGroupsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const ListGroupsOrderbyEnum = { + DisplayName: 'displayName', + DisplayNameDesc: 'displayName desc', +} as const; +export type ListGroupsOrderbyEnum = typeof ListGroupsOrderbyEnum[keyof typeof ListGroupsOrderbyEnum]; +/** + * @export + */ +export const ListGroupsSelectEnum = { + Id: 'id', + Description: 'description', + DisplayName: 'displayName', + Mail: 'mail', + Members: 'members', +} as const; +export type ListGroupsSelectEnum = typeof ListGroupsSelectEnum[keyof typeof ListGroupsSelectEnum]; +/** + * @export + */ +export const ListGroupsExpandEnum = { + Members: 'members', +} as const; +export type ListGroupsExpandEnum = typeof ListGroupsExpandEnum[keyof typeof ListGroupsExpandEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/MeChangepasswordApi.ts b/web/packages/web-client/src/graph/generated/apis/MeChangepasswordApi.ts new file mode 100644 index 00000000000..d2d500311c3 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/MeChangepasswordApi.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type PasswordChange, + PasswordChangeFromJSON, + PasswordChangeToJSON, +} from '../models/PasswordChange'; + +export interface ChangeOwnPasswordRequest { + /** + * + */ + passwordChange: PasswordChange; +} + +/** + * + */ +export class MeChangepasswordApi extends runtime.BaseAPI { + + /** + * Creates request options for changeOwnPassword without sending the request + */ + async changeOwnPasswordRequestOpts(requestParameters: ChangeOwnPasswordRequest): Promise { + if (requestParameters['passwordChange'] == null) { + throw new runtime.RequiredError( + 'passwordChange', + 'Required parameter "passwordChange" was null or undefined when calling changeOwnPassword().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/me/changePassword`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PasswordChangeToJSON(requestParameters['passwordChange']), + }; + } + + /** + * Change your own password + */ + async changeOwnPasswordRaw(requestParameters: ChangeOwnPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.changeOwnPasswordRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Change your own password + */ + async changeOwnPassword(requestParameters: ChangeOwnPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.changeOwnPasswordRaw(requestParameters, initOverrides); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/MeDriveApi.ts b/web/packages/web-client/src/graph/generated/apis/MeDriveApi.ts new file mode 100644 index 00000000000..d30b8cfed79 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/MeDriveApi.ts @@ -0,0 +1,161 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfDriveItems1, + CollectionOfDriveItems1FromJSON, + CollectionOfDriveItems1ToJSON, +} from '../models/CollectionOfDriveItems1'; +import { + type Drive, + DriveFromJSON, + DriveToJSON, +} from '../models/Drive'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +/** + * + */ +export class MeDriveApi extends runtime.BaseAPI { + + /** + * Creates request options for getHome without sending the request + */ + async getHomeRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/me/drive`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get personal space for user + */ + async getHomeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getHomeRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveFromJSON(jsonValue)); + } + + /** + * Get personal space for user + */ + async getHome(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getHomeRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for listSharedByMe without sending the request + */ + async listSharedByMeRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/me/drive/sharedByMe`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. + * Get a list of driveItem objects shared by the current user. + */ + async listSharedByMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listSharedByMeRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfDriveItems1FromJSON(jsonValue)); + } + + /** + * The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. + * Get a list of driveItem objects shared by the current user. + */ + async listSharedByMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listSharedByMeRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for listSharedWithMe without sending the request + */ + async listSharedWithMeRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/me/drive/sharedWithMe`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. + * Get a list of driveItem objects shared with the owner of a drive. + */ + async listSharedWithMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listSharedWithMeRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfDriveItems1FromJSON(jsonValue)); + } + + /** + * The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. + * Get a list of driveItem objects shared with the owner of a drive. + */ + async listSharedWithMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listSharedWithMeRaw(initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/MeDriveRootApi.ts b/web/packages/web-client/src/graph/generated/apis/MeDriveRootApi.ts new file mode 100644 index 00000000000..d11182fd947 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/MeDriveRootApi.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type DriveItem, + DriveItemFromJSON, + DriveItemToJSON, +} from '../models/DriveItem'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +/** + * + */ +export class MeDriveRootApi extends runtime.BaseAPI { + + /** + * Creates request options for homeGetRoot without sending the request + */ + async homeGetRootRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/me/drive/root`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get root from personal space + */ + async homeGetRootRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.homeGetRootRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DriveItemFromJSON(jsonValue)); + } + + /** + * Get root from personal space + */ + async homeGetRoot(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.homeGetRootRaw(initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/MeDriveRootChildrenApi.ts b/web/packages/web-client/src/graph/generated/apis/MeDriveRootChildrenApi.ts new file mode 100644 index 00000000000..579d68d3947 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/MeDriveRootChildrenApi.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfDriveItems, + CollectionOfDriveItemsFromJSON, + CollectionOfDriveItemsToJSON, +} from '../models/CollectionOfDriveItems'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +/** + * + */ +export class MeDriveRootChildrenApi extends runtime.BaseAPI { + + /** + * Creates request options for homeGetChildren without sending the request + */ + async homeGetChildrenRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/me/drive/root/children`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get children from drive + */ + async homeGetChildrenRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.homeGetChildrenRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfDriveItemsFromJSON(jsonValue)); + } + + /** + * Get children from drive + */ + async homeGetChildren(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.homeGetChildrenRaw(initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/MeDrivesApi.ts b/web/packages/web-client/src/graph/generated/apis/MeDrivesApi.ts new file mode 100644 index 00000000000..63f7546fdc2 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/MeDrivesApi.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfDrives, + CollectionOfDrivesFromJSON, + CollectionOfDrivesToJSON, +} from '../models/CollectionOfDrives'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface ListMyDrivesRequest { + /** + * The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. + */ + $orderby?: string; + /** + * Filter items by property values + */ + $filter?: string; +} + +export interface ListMyDrivesBetaRequest { + /** + * The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. + */ + $orderby?: string; + /** + * Filter items by property values + */ + $filter?: string; +} + +/** + * + */ +export class MeDrivesApi extends runtime.BaseAPI { + + /** + * Creates request options for listMyDrives without sending the request + */ + async listMyDrivesRequestOpts(requestParameters: ListMyDrivesRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$orderby'] != null) { + queryParameters['$orderby'] = requestParameters['$orderby']; + } + + if (requestParameters['$filter'] != null) { + queryParameters['$filter'] = requestParameters['$filter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/me/drives`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get all drives where the current user is a regular member of + */ + async listMyDrivesRaw(requestParameters: ListMyDrivesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listMyDrivesRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfDrivesFromJSON(jsonValue)); + } + + /** + * Get all drives where the current user is a regular member of + */ + async listMyDrives(requestParameters: ListMyDrivesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listMyDrivesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listMyDrivesBeta without sending the request + */ + async listMyDrivesBetaRequestOpts(requestParameters: ListMyDrivesBetaRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$orderby'] != null) { + queryParameters['$orderby'] = requestParameters['$orderby']; + } + + if (requestParameters['$filter'] != null) { + queryParameters['$filter'] = requestParameters['$filter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/me/drives`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async listMyDrivesBetaRaw(requestParameters: ListMyDrivesBetaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listMyDrivesBetaRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfDrivesFromJSON(jsonValue)); + } + + /** + * Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles + */ + async listMyDrivesBeta(requestParameters: ListMyDrivesBetaRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listMyDrivesBetaRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/MeUserApi.ts b/web/packages/web-client/src/graph/generated/apis/MeUserApi.ts new file mode 100644 index 00000000000..4c4b664368d --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/MeUserApi.ts @@ -0,0 +1,146 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type User, + UserFromJSON, + UserToJSON, +} from '../models/User'; +import { + type UserUpdate, + UserUpdateFromJSON, + UserUpdateToJSON, +} from '../models/UserUpdate'; + +export interface GetOwnUserRequest { + /** + * Expand related entities + */ + $expand?: Set; +} + +export interface UpdateOwnUserRequest { + /** + * + */ + userUpdate?: Omit; +} + +/** + * + */ +export class MeUserApi extends runtime.BaseAPI { + + /** + * Creates request options for getOwnUser without sending the request + */ + async getOwnUserRequestOpts(requestParameters: GetOwnUserRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$expand'] != null) { + queryParameters['$expand'] = Array.from(requestParameters['$expand'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/me`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get current user + */ + async getOwnUserRaw(requestParameters: GetOwnUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getOwnUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * Get current user + */ + async getOwnUser(requestParameters: GetOwnUserRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getOwnUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateOwnUser without sending the request + */ + async updateOwnUserRequestOpts(requestParameters: UpdateOwnUserRequest): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/me`; + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: UserUpdateToJSON(requestParameters['userUpdate']), + }; + } + + /** + * Update the current user + */ + async updateOwnUserRaw(requestParameters: UpdateOwnUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateOwnUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * Update the current user + */ + async updateOwnUser(requestParameters: UpdateOwnUserRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateOwnUserRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const GetOwnUserExpandEnum = { + MemberOf: 'memberOf', +} as const; +export type GetOwnUserExpandEnum = typeof GetOwnUserExpandEnum[keyof typeof GetOwnUserExpandEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/RoleManagementApi.ts b/web/packages/web-client/src/graph/generated/apis/RoleManagementApi.ts new file mode 100644 index 00000000000..2fb18101f4b --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/RoleManagementApi.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type UnifiedRoleDefinition, + UnifiedRoleDefinitionFromJSON, + UnifiedRoleDefinitionToJSON, +} from '../models/UnifiedRoleDefinition'; + +export interface GetPermissionRoleDefinitionRequest { + /** + * key: id of roleDefinition + */ + roleId: string; +} + +/** + * + */ +export class RoleManagementApi extends runtime.BaseAPI { + + /** + * Creates request options for getPermissionRoleDefinition without sending the request + */ + async getPermissionRoleDefinitionRequestOpts(requestParameters: GetPermissionRoleDefinitionRequest): Promise { + if (requestParameters['roleId'] == null) { + throw new runtime.RequiredError( + 'roleId', + 'Required parameter "roleId" was null or undefined when calling getPermissionRoleDefinition().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/roleManagement/permissions/roleDefinitions/{role-id}`; + urlPath = urlPath.replace('{role-id}', encodeURIComponent(String(requestParameters['roleId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Read the properties and relationships of a `unifiedRoleDefinition` object. + * Get unifiedRoleDefinition + */ + async getPermissionRoleDefinitionRaw(requestParameters: GetPermissionRoleDefinitionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getPermissionRoleDefinitionRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UnifiedRoleDefinitionFromJSON(jsonValue)); + } + + /** + * Read the properties and relationships of a `unifiedRoleDefinition` object. + * Get unifiedRoleDefinition + */ + async getPermissionRoleDefinition(requestParameters: GetPermissionRoleDefinitionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPermissionRoleDefinitionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listPermissionRoleDefinitions without sending the request + */ + async listPermissionRoleDefinitionsRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1beta1/roleManagement/permissions/roleDefinitions`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. + * List roleDefinitions + */ + async listPermissionRoleDefinitionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const requestOptions = await this.listPermissionRoleDefinitionsRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UnifiedRoleDefinitionFromJSON)); + } + + /** + * Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. + * List roleDefinitions + */ + async listPermissionRoleDefinitions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listPermissionRoleDefinitionsRaw(initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/TagsApi.ts b/web/packages/web-client/src/graph/generated/apis/TagsApi.ts new file mode 100644 index 00000000000..b5f89594108 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/TagsApi.ts @@ -0,0 +1,180 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfTags, + CollectionOfTagsFromJSON, + CollectionOfTagsToJSON, +} from '../models/CollectionOfTags'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type TagAssignment, + TagAssignmentFromJSON, + TagAssignmentToJSON, +} from '../models/TagAssignment'; +import { + type TagUnassignment, + TagUnassignmentFromJSON, + TagUnassignmentToJSON, +} from '../models/TagUnassignment'; + +export interface AssignTagsRequest { + /** + * + */ + tagAssignment?: TagAssignment; +} + +export interface UnassignTagsRequest { + /** + * + */ + tagUnassignment?: TagUnassignment; +} + +/** + * + */ +export class TagsApi extends runtime.BaseAPI { + + /** + * Creates request options for assignTags without sending the request + */ + async assignTagsRequestOpts(requestParameters: AssignTagsRequest): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/extensions/org.libregraph/tags`; + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: TagAssignmentToJSON(requestParameters['tagAssignment']), + }; + } + + /** + * Assign tags to a resource + */ + async assignTagsRaw(requestParameters: AssignTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.assignTagsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Assign tags to a resource + */ + async assignTags(requestParameters: AssignTagsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.assignTagsRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getTags without sending the request + */ + async getTagsRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/extensions/org.libregraph/tags`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get all known tags + */ + async getTagsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getTagsRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfTagsFromJSON(jsonValue)); + } + + /** + * Get all known tags + */ + async getTags(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTagsRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for unassignTags without sending the request + */ + async unassignTagsRequestOpts(requestParameters: UnassignTagsRequest): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/extensions/org.libregraph/tags`; + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + body: TagUnassignmentToJSON(requestParameters['tagUnassignment']), + }; + } + + /** + * Unassign tags from a resource + */ + async unassignTagsRaw(requestParameters: UnassignTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.unassignTagsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Unassign tags from a resource + */ + async unassignTags(requestParameters: UnassignTagsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.unassignTagsRaw(requestParameters, initOverrides); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/UserApi.ts b/web/packages/web-client/src/graph/generated/apis/UserApi.ts new file mode 100644 index 00000000000..ab29095b17f --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/UserApi.ts @@ -0,0 +1,330 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type ExportPersonalDataRequest, + ExportPersonalDataRequestFromJSON, + ExportPersonalDataRequestToJSON, +} from '../models/ExportPersonalDataRequest'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type User, + UserFromJSON, + UserToJSON, +} from '../models/User'; +import { + type UserUpdate, + UserUpdateFromJSON, + UserUpdateToJSON, +} from '../models/UserUpdate'; + +export interface DeleteUserRequest { + /** + * key: id or name of user + */ + userId: string; + /** + * ETag + */ + ifMatch?: string; +} + +export interface ExportPersonalDataOperationRequest { + /** + * key: id or name of user + */ + userId: string; + /** + * + */ + exportPersonalDataRequest?: ExportPersonalDataRequest; +} + +export interface GetUserRequest { + /** + * key: id or name of user + */ + userId: string; + /** + * Select properties to be returned + */ + $select?: Set; + /** + * Expand related entities + */ + $expand?: Set; +} + +export interface UpdateUserRequest { + /** + * key: id of user + */ + userId: string; + /** + * + */ + userUpdate: Omit; +} + +/** + * + */ +export class UserApi extends runtime.BaseAPI { + + /** + * Creates request options for deleteUser without sending the request + */ + async deleteUserRequestOpts(requestParameters: DeleteUserRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling deleteUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['ifMatch'] != null) { + headerParameters['If-Match'] = String(requestParameters['ifMatch']); + } + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users/{user-id}`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete entity from users + */ + async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete entity from users + */ + async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteUserRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for exportPersonalData without sending the request + */ + async exportPersonalDataRequestOpts(requestParameters: ExportPersonalDataOperationRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling exportPersonalData().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users/{user-id}/exportPersonalData`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ExportPersonalDataRequestToJSON(requestParameters['exportPersonalDataRequest']), + }; + } + + /** + * export personal data of a user + */ + async exportPersonalDataRaw(requestParameters: ExportPersonalDataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.exportPersonalDataRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * export personal data of a user + */ + async exportPersonalData(requestParameters: ExportPersonalDataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.exportPersonalDataRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getUser without sending the request + */ + async getUserRequestOpts(requestParameters: GetUserRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling getUser().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['$select'] != null) { + queryParameters['$select'] = Array.from(requestParameters['$select'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['$expand'] != null) { + queryParameters['$expand'] = Array.from(requestParameters['$expand'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users/{user-id}`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get entity from users by key + */ + async getUserRaw(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * Get entity from users by key + */ + async getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updateUser without sending the request + */ + async updateUserRequestOpts(requestParameters: UpdateUserRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling updateUser().' + ); + } + + if (requestParameters['userUpdate'] == null) { + throw new runtime.RequiredError( + 'userUpdate', + 'Required parameter "userUpdate" was null or undefined when calling updateUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users/{user-id}`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: UserUpdateToJSON(requestParameters['userUpdate']), + }; + } + + /** + * Update entity in users + */ + async updateUserRaw(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * Update entity in users + */ + async updateUser(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateUserRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const GetUserSelectEnum = { + Id: 'id', + DisplayName: 'displayName', + Drive: 'drive', + Drives: 'drives', + Mail: 'mail', + MemberOf: 'memberOf', + OnPremisesSamAccountName: 'onPremisesSamAccountName', + Surname: 'surname', +} as const; +export type GetUserSelectEnum = typeof GetUserSelectEnum[keyof typeof GetUserSelectEnum]; +/** + * @export + */ +export const GetUserExpandEnum = { + Drive: 'drive', + Drives: 'drives', + MemberOf: 'memberOf', + AppRoleAssignments: 'appRoleAssignments', +} as const; +export type GetUserExpandEnum = typeof GetUserExpandEnum[keyof typeof GetUserExpandEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts b/web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts new file mode 100644 index 00000000000..69df6ec295b --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts @@ -0,0 +1,239 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type AppRoleAssignment, + AppRoleAssignmentFromJSON, + AppRoleAssignmentToJSON, +} from '../models/AppRoleAssignment'; +import { + type CollectionOfAppRoleAssignments, + CollectionOfAppRoleAssignmentsFromJSON, + CollectionOfAppRoleAssignmentsToJSON, +} from '../models/CollectionOfAppRoleAssignments'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; + +export interface UserCreateAppRoleAssignmentsRequest { + /** + * key: id of user + */ + userId: string; + /** + * + */ + appRoleAssignment: Omit; +} + +export interface UserDeleteAppRoleAssignmentsRequest { + /** + * key: id of user + */ + userId: string; + /** + * key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. + */ + appRoleAssignmentId: string; + /** + * ETag + */ + ifMatch?: string; +} + +export interface UserListAppRoleAssignmentsRequest { + /** + * key: id of user + */ + userId: string; +} + +/** + * + */ +export class UserAppRoleAssignmentApi extends runtime.BaseAPI { + + /** + * Creates request options for userCreateAppRoleAssignments without sending the request + */ + async userCreateAppRoleAssignmentsRequestOpts(requestParameters: UserCreateAppRoleAssignmentsRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling userCreateAppRoleAssignments().' + ); + } + + if (requestParameters['appRoleAssignment'] == null) { + throw new runtime.RequiredError( + 'appRoleAssignment', + 'Required parameter "appRoleAssignment" was null or undefined when calling userCreateAppRoleAssignments().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users/{user-id}/appRoleAssignments`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AppRoleAssignmentToJSON(requestParameters['appRoleAssignment']), + }; + } + + /** + * Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. + * Grant an appRoleAssignment to a user + */ + async userCreateAppRoleAssignmentsRaw(requestParameters: UserCreateAppRoleAssignmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.userCreateAppRoleAssignmentsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AppRoleAssignmentFromJSON(jsonValue)); + } + + /** + * Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. + * Grant an appRoleAssignment to a user + */ + async userCreateAppRoleAssignments(requestParameters: UserCreateAppRoleAssignmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userCreateAppRoleAssignmentsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for userDeleteAppRoleAssignments without sending the request + */ + async userDeleteAppRoleAssignmentsRequestOpts(requestParameters: UserDeleteAppRoleAssignmentsRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling userDeleteAppRoleAssignments().' + ); + } + + if (requestParameters['appRoleAssignmentId'] == null) { + throw new runtime.RequiredError( + 'appRoleAssignmentId', + 'Required parameter "appRoleAssignmentId" was null or undefined when calling userDeleteAppRoleAssignments().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['ifMatch'] != null) { + headerParameters['If-Match'] = String(requestParameters['ifMatch']); + } + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id}`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + urlPath = urlPath.replace('{appRoleAssignment-id}', encodeURIComponent(String(requestParameters['appRoleAssignmentId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Delete the appRoleAssignment from a user + */ + async userDeleteAppRoleAssignmentsRaw(requestParameters: UserDeleteAppRoleAssignmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.userDeleteAppRoleAssignmentsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Delete the appRoleAssignment from a user + */ + async userDeleteAppRoleAssignments(requestParameters: UserDeleteAppRoleAssignmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.userDeleteAppRoleAssignmentsRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for userListAppRoleAssignments without sending the request + */ + async userListAppRoleAssignmentsRequestOpts(requestParameters: UserListAppRoleAssignmentsRequest): Promise { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling userListAppRoleAssignments().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users/{user-id}/appRoleAssignments`; + urlPath = urlPath.replace('{user-id}', encodeURIComponent(String(requestParameters['userId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Represents the global roles a user has been granted for an application. + * Get appRoleAssignments from a user + */ + async userListAppRoleAssignmentsRaw(requestParameters: UserListAppRoleAssignmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.userListAppRoleAssignmentsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfAppRoleAssignmentsFromJSON(jsonValue)); + } + + /** + * Represents the global roles a user has been granted for an application. + * Get appRoleAssignments from a user + */ + async userListAppRoleAssignments(requestParameters: UserListAppRoleAssignmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userListAppRoleAssignmentsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/web/packages/web-client/src/graph/generated/apis/UsersApi.ts b/web/packages/web-client/src/graph/generated/apis/UsersApi.ts new file mode 100644 index 00000000000..38eb2044192 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/UsersApi.ts @@ -0,0 +1,212 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime'; +import { + type CollectionOfUser, + CollectionOfUserFromJSON, + CollectionOfUserToJSON, +} from '../models/CollectionOfUser'; +import { + type OdataError, + OdataErrorFromJSON, + OdataErrorToJSON, +} from '../models/OdataError'; +import { + type User, + UserFromJSON, + UserToJSON, +} from '../models/User'; + +export interface CreateUserRequest { + /** + * + */ + user: User; +} + +export interface ListUsersRequest { + /** + * Search items by search phrases + */ + $search?: string; + /** + * Filter users by property values and relationship attributes + */ + $filter?: string; + /** + * Order items by property values + */ + $orderby?: Set; + /** + * Select properties to be returned + */ + $select?: Set; + /** + * Expand related entities + */ + $expand?: Set; +} + +/** + * + */ +export class UsersApi extends runtime.BaseAPI { + + /** + * Creates request options for createUser without sending the request + */ + async createUserRequestOpts(requestParameters: CreateUserRequest): Promise { + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling createUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters['user']), + }; + } + + /** + * Add new entity to users + */ + async createUserRaw(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * Add new entity to users + */ + async createUser(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for listUsers without sending the request + */ + async listUsersRequestOpts(requestParameters: ListUsersRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['$search'] != null) { + queryParameters['$search'] = requestParameters['$search']; + } + + if (requestParameters['$filter'] != null) { + queryParameters['$filter'] = requestParameters['$filter']; + } + + if (requestParameters['$orderby'] != null) { + queryParameters['$orderby'] = Array.from(requestParameters['$orderby'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['$select'] != null) { + queryParameters['$select'] = Array.from(requestParameters['$select'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['$expand'] != null) { + queryParameters['$expand'] = Array.from(requestParameters['$expand'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + + let urlPath = `/v1.0/users`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Get entities from users + */ + async listUsersRaw(requestParameters: ListUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.listUsersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOfUserFromJSON(jsonValue)); + } + + /** + * Get entities from users + */ + async listUsers(requestParameters: ListUsersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const ListUsersOrderbyEnum = { + DisplayName: 'displayName', + DisplayNameDesc: 'displayName desc', + Mail: 'mail', + MailDesc: 'mail desc', + OnPremisesSamAccountName: 'onPremisesSamAccountName', + OnPremisesSamAccountNameDesc: 'onPremisesSamAccountName desc', +} as const; +export type ListUsersOrderbyEnum = typeof ListUsersOrderbyEnum[keyof typeof ListUsersOrderbyEnum]; +/** + * @export + */ +export const ListUsersSelectEnum = { + Id: 'id', + DisplayName: 'displayName', + Mail: 'mail', + MemberOf: 'memberOf', + OnPremisesSamAccountName: 'onPremisesSamAccountName', + Surname: 'surname', +} as const; +export type ListUsersSelectEnum = typeof ListUsersSelectEnum[keyof typeof ListUsersSelectEnum]; +/** + * @export + */ +export const ListUsersExpandEnum = { + Drive: 'drive', + Drives: 'drives', + MemberOf: 'memberOf', + AppRoleAssignments: 'appRoleAssignments', +} as const; +export type ListUsersExpandEnum = typeof ListUsersExpandEnum[keyof typeof ListUsersExpandEnum]; diff --git a/web/packages/web-client/src/graph/generated/apis/index.ts b/web/packages/web-client/src/graph/generated/apis/index.ts new file mode 100644 index 00000000000..d9671272f63 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/apis/index.ts @@ -0,0 +1,26 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './ActivitiesApi'; +export * from './ApplicationsApi'; +export * from './DriveItemApi'; +export * from './DrivesApi'; +export * from './DrivesGetDrivesApi'; +export * from './DrivesPermissionsApi'; +export * from './DrivesRootApi'; +export * from './EducationClassApi'; +export * from './EducationClassTeachersApi'; +export * from './EducationSchoolApi'; +export * from './EducationUserApi'; +export * from './GroupApi'; +export * from './GroupsApi'; +export * from './MeChangepasswordApi'; +export * from './MeDriveApi'; +export * from './MeDriveRootApi'; +export * from './MeDriveRootChildrenApi'; +export * from './MeDrivesApi'; +export * from './MeUserApi'; +export * from './RoleManagementApi'; +export * from './TagsApi'; +export * from './UserApi'; +export * from './UserAppRoleAssignmentApi'; +export * from './UsersApi'; diff --git a/web/packages/web-client/src/graph/generated/base.ts b/web/packages/web-client/src/graph/generated/base.ts deleted file mode 100644 index 8cf1026c20b..00000000000 --- a/web/packages/web-client/src/graph/generated/base.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Libre Graph API - * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. - * - * The version of the OpenAPI document: v1.0.4 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from './configuration'; -// Some imports not used depending on template conditions -// @ts-ignore -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; - -export const BASE_PATH = "https://ocis.ocis.rolling.owncloud.works/graph".replace(/\/+$/, ""); - -export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -}; - -export interface RequestArgs { - url: string; - options: RawAxiosRequestConfig; -} - -export class BaseAPI { - protected configuration: Configuration | undefined; - - constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { - if (configuration) { - this.configuration = configuration; - this.basePath = configuration.basePath ?? basePath; - } - } -}; - -export class RequiredError extends Error { - constructor(public field: string, msg?: string) { - super(msg); - this.name = "RequiredError" - } -} - -interface ServerMap { - [key: string]: { - url: string, - description: string, - }[]; -} - -export const operationServerMap: ServerMap = { -} diff --git a/web/packages/web-client/src/graph/generated/common.ts b/web/packages/web-client/src/graph/generated/common.ts deleted file mode 100644 index 473307ea46a..00000000000 --- a/web/packages/web-client/src/graph/generated/common.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Libre Graph API - * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. - * - * The version of the OpenAPI document: v1.0.4 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import type { Configuration } from "./configuration"; -import type { RequestArgs } from "./base"; -import type { AxiosInstance, AxiosResponse } from 'axios'; -import { RequiredError } from "./base"; - -export const DUMMY_BASE_URL = 'https://example.com' - -/** - * - * @throws {RequiredError} - */ -export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } -} - -export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } -} - -export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } -} - -export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } -} - -export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } -} - - -function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { - if (parameter == null) return; - if (typeof parameter === "object") { - if (Array.isArray(parameter) || parameter instanceof Set) { - (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); - } - else { - Object.keys(parameter).forEach(currentKey => - setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) - ); - } - } - else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } - else { - urlSearchParams.set(key, parameter); - } - } -} - -export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); -} - -/** - * JSON serialization helper function which replaces instances of unserializable types with serializable ones. - * This function will run for every key-value pair encountered by JSON.stringify while traversing an object. - * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required. - */ -export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) { - if (value instanceof Set) { - return Array.from(value); - } else { - return value; - } -} - -export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { - const nonString = typeof value !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers['Content-Type']) - : nonString; - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded) - : (value || ""); -} - -export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash -} - -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); - }; -} diff --git a/web/packages/web-client/src/graph/generated/configuration.ts b/web/packages/web-client/src/graph/generated/configuration.ts deleted file mode 100644 index 90150673840..00000000000 --- a/web/packages/web-client/src/graph/generated/configuration.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* tslint:disable */ -/** - * Libre Graph API - * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. - * - * The version of the OpenAPI document: v1.0.4 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -interface AWSv4Configuration { - options?: { - region?: string - service?: string - } - credentials?: { - accessKeyId?: string - secretAccessKey?: string, - sessionToken?: string - } -} - -export interface ConfigurationParameters { - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - username?: string; - password?: string; - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - awsv4?: AWSv4Configuration; - basePath?: string; - serverIndex?: number; - baseOptions?: any; - formDataCtor?: new () => any; -} - -export class Configuration { - /** - * parameter for apiKey security - * @param name security name - */ - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - /** - * parameter for basic security - */ - username?: string; - /** - * parameter for basic security - */ - password?: string; - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - */ - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - /** - * parameter for aws4 signature security - * @param {Object} AWS4Signature - AWS4 Signature security - * @param {string} options.region - aws region - * @param {string} options.service - name of the service. - * @param {string} credentials.accessKeyId - aws access key id - * @param {string} credentials.secretAccessKey - aws access key - * @param {string} credentials.sessionToken - aws session token - * @memberof Configuration - */ - awsv4?: AWSv4Configuration; - /** - * override base path - */ - basePath?: string; - /** - * override server index - */ - serverIndex?: number; - /** - * base options for axios calls - */ - baseOptions?: any; - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any; - - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.awsv4 = param.awsv4; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = { - ...param.baseOptions, - headers: { - ...param.baseOptions?.headers, - }, - }; - this.formDataCtor = param.formDataCtor; - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } -} diff --git a/web/packages/web-client/src/graph/generated/docs/ActivitiesApi.md b/web/packages/web-client/src/graph/generated/docs/ActivitiesApi.md index 32251a578d0..33a64a6c73e 100644 --- a/web/packages/web-client/src/graph/generated/docs/ActivitiesApi.md +++ b/web/packages/web-client/src/graph/generated/docs/ActivitiesApi.md @@ -2,42 +2,63 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**getActivities**](#getactivities) | **GET** /v1beta1/extensions/org.libregraph/activities | Get activities| +| [**getActivities**](ActivitiesApi.md#getactivities) | **GET** /v1beta1/extensions/org.libregraph/activities | Get activities | -# **getActivities** -> CollectionOfActivities getActivities() -### Example +## getActivities -```typescript -import { - ActivitiesApi, - Configuration -} from './api'; +> CollectionOfActivities getActivities(kql) -const configuration = new Configuration(); -const apiInstance = new ActivitiesApi(configuration); +Get activities -let kql: string; // (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.getActivities( - kql -); +```ts +import { + Configuration, + ActivitiesApi, +} from ''; +import type { GetActivitiesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new ActivitiesApi(config); + + const body = { + // string (optional) + kql: resourceid:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668 depth:2, + } satisfies GetActivitiesRequest; + + try { + const data = await api.getActivities(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **kql** | [**string**] | | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **kql** | `string` | | [Optional] [Defaults to `undefined`] | ### Return type -**CollectionOfActivities** +[**CollectionOfActivities**](CollectionOfActivities.md) ### Authorization @@ -45,15 +66,15 @@ const { status, data } = await apiInstance.getActivities( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Found activities | - | -|**0** | error | - | +| **200** | Found activities | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/Activity.md b/web/packages/web-client/src/graph/generated/docs/Activity.md index f4b5a37d31c..ce3dd543cae 100644 --- a/web/packages/web-client/src/graph/generated/docs/Activity.md +++ b/web/packages/web-client/src/graph/generated/docs/Activity.md @@ -1,25 +1,39 @@ + # Activity Represents activity. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Activity ID. | [default to undefined] -**times** | [**ActivityTimes**](ActivityTimes.md) | | [default to undefined] -**template** | [**ActivityTemplate**](ActivityTemplate.md) | | [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`times` | [ActivityTimes](ActivityTimes.md) +`template` | [ActivityTemplate](ActivityTemplate.md) ## Example ```typescript -import { Activity } from './api'; +import type { Activity } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "times": null, + "template": null, +} satisfies Activity + +console.log(example) -const instance: Activity = { - id, - times, - template, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Activity +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ActivityTemplate.md b/web/packages/web-client/src/graph/generated/docs/ActivityTemplate.md index 759bdd7cc61..d50b52ad80b 100644 --- a/web/packages/web-client/src/graph/generated/docs/ActivityTemplate.md +++ b/web/packages/web-client/src/graph/generated/docs/ActivityTemplate.md @@ -1,22 +1,36 @@ + # ActivityTemplate ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **string** | Activity description. | [default to undefined] -**variables** | **object** | Activity description variables. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`message` | string +`variables` | object ## Example ```typescript -import { ActivityTemplate } from './api'; +import type { ActivityTemplate } from '' + +// TODO: Update the object below with actual values +const example = { + "message": null, + "variables": null, +} satisfies ActivityTemplate + +console.log(example) -const instance: ActivityTemplate = { - message, - variables, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ActivityTemplate +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md b/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md index 097380c8888..beca76ff325 100644 --- a/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md +++ b/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md @@ -1,20 +1,34 @@ + # ActivityTimes ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**recordedTime** | **string** | Timestamp of the activity. | [default to undefined] +Name | Type +------------ | ------------- +`recordedTime` | Date ## Example ```typescript -import { ActivityTimes } from './api'; +import type { ActivityTimes } from '' + +// TODO: Update the object below with actual values +const example = { + "recordedTime": null, +} satisfies ActivityTimes + +console.log(example) -const instance: ActivityTimes = { - recordedTime, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ActivityTimes +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/AppRole.md b/web/packages/web-client/src/graph/generated/docs/AppRole.md index d475c7d8d12..1952b1fa62b 100644 --- a/web/packages/web-client/src/graph/generated/docs/AppRole.md +++ b/web/packages/web-client/src/graph/generated/docs/AppRole.md @@ -1,26 +1,40 @@ + # AppRole ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allowedMemberTypes** | **Array<string>** | Specifies whether this app role can be assigned to users and groups (by setting to [\'User\']), to other application\'s (by setting to [\'Application\'], or both (by setting to [\'User\', \'Application\']). App roles supporting assignment to other applications\' service principals are also known as application permissions. The \'Application\' value is only supported for app roles defined on application entities. | [optional] [default to undefined] -**description** | **string** | The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. | [optional] [default to undefined] -**displayName** | **string** | Display name for the permission that appears in the app role assignment and consent experiences. | [optional] [default to undefined] -**id** | **string** | Unique role identifier inside the appRoles collection. When creating a new app role, a new GUID identifier must be provided. | [default to undefined] +Name | Type +------------ | ------------- +`allowedMemberTypes` | Array<string> +`description` | string +`displayName` | string +`id` | string ## Example ```typescript -import { AppRole } from './api'; - -const instance: AppRole = { - allowedMemberTypes, - description, - displayName, - id, -}; +import type { AppRole } from '' + +// TODO: Update the object below with actual values +const example = { + "allowedMemberTypes": null, + "description": null, + "displayName": null, + "id": null, +} satisfies AppRole + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AppRole +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md b/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md index a79d18eb25c..45e0b2f0732 100644 --- a/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md +++ b/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md @@ -1,36 +1,50 @@ + # AppRoleAssignment ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. | [optional] [readonly] [default to undefined] -**deletedDateTime** | **string** | | [optional] [default to undefined] -**appRoleId** | **string** | The identifier (id) for the app role which is assigned to the user. Required on create. | [default to undefined] -**createdDateTime** | **string** | The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. | [optional] [default to undefined] -**principalDisplayName** | **string** | The display name of the user, group, or service principal that was granted the app role assignment. Read-only. | [optional] [default to undefined] -**principalId** | **string** | The unique identifier (id) for the user, security group, or service principal being granted the app role. Security groups with dynamic memberships are supported. Required on create. | [default to undefined] -**principalType** | **string** | The type of the assigned principal. This can either be User, Group, or ServicePrincipal. Read-only. | [optional] [default to undefined] -**resourceDisplayName** | **string** | The display name of the resource app\'s service principal to which the assignment is made. | [optional] [default to undefined] -**resourceId** | **string** | The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. | [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`deletedDateTime` | Date +`appRoleId` | string +`createdDateTime` | Date +`principalDisplayName` | string +`principalId` | string +`principalType` | string +`resourceDisplayName` | string +`resourceId` | string ## Example ```typescript -import { AppRoleAssignment } from './api'; - -const instance: AppRoleAssignment = { - id, - deletedDateTime, - appRoleId, - createdDateTime, - principalDisplayName, - principalId, - principalType, - resourceDisplayName, - resourceId, -}; +import type { AppRoleAssignment } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "deletedDateTime": null, + "appRoleId": null, + "createdDateTime": null, + "principalDisplayName": null, + "principalId": null, + "principalType": null, + "resourceDisplayName": null, + "resourceId": null, +} satisfies AppRoleAssignment + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AppRoleAssignment +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Application.md b/web/packages/web-client/src/graph/generated/docs/Application.md index c70b86930b7..e69bfe3b8d1 100644 --- a/web/packages/web-client/src/graph/generated/docs/Application.md +++ b/web/packages/web-client/src/graph/generated/docs/Application.md @@ -1,24 +1,38 @@ + # Application ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. | [readonly] [default to undefined] -**appRoles** | [**Array<AppRole>**](AppRole.md) | The collection of roles defined for the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. | [optional] [default to undefined] -**displayName** | **string** | The display name for the application. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`appRoles` | [Array<AppRole>](AppRole.md) +`displayName` | string ## Example ```typescript -import { Application } from './api'; +import type { Application } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "appRoles": null, + "displayName": null, +} satisfies Application + +console.log(example) -const instance: Application = { - id, - appRoles, - displayName, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Application +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ApplicationsApi.md b/web/packages/web-client/src/graph/generated/docs/ApplicationsApi.md index 89cf4c62e1d..e8ce5e2c236 100644 --- a/web/packages/web-client/src/graph/generated/docs/ApplicationsApi.md +++ b/web/packages/web-client/src/graph/generated/docs/ApplicationsApi.md @@ -2,43 +2,64 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**getApplication**](#getapplication) | **GET** /v1.0/applications/{application-id} | Get application by id| -|[**listApplications**](#listapplications) | **GET** /v1.0/applications | Get all applications| +| [**getApplication**](ApplicationsApi.md#getapplication) | **GET** /v1.0/applications/{application-id} | Get application by id | +| [**listApplications**](ApplicationsApi.md#listapplications) | **GET** /v1.0/applications | Get all applications | -# **getApplication** -> Application getApplication() -### Example +## getApplication -```typescript -import { - ApplicationsApi, - Configuration -} from './api'; +> Application getApplication(applicationId) -const configuration = new Configuration(); -const apiInstance = new ApplicationsApi(configuration); +Get application by id -let applicationId: string; //key: id of application (default to undefined) +### Example -const { status, data } = await apiInstance.getApplication( - applicationId -); +```ts +import { + Configuration, + ApplicationsApi, +} from ''; +import type { GetApplicationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new ApplicationsApi(config); + + const body = { + // string | key: id of application + applicationId: applicationId_example, + } satisfies GetApplicationRequest; + + try { + const data = await api.getApplication(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **applicationId** | [**string**] | key: id of application | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **applicationId** | `string` | key: id of application | [Defaults to `undefined`] | ### Return type -**Application** +[**Application**](Application.md) ### Authorization @@ -46,43 +67,62 @@ const { status, data } = await apiInstance.getApplication( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | OK | - | -|**0** | error | - | +| **200** | OK | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## listApplications -# **listApplications** > CollectionOfApplications listApplications() +Get all applications ### Example -```typescript +```ts import { - ApplicationsApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new ApplicationsApi(configuration); - -const { status, data } = await apiInstance.listApplications(); + Configuration, + ApplicationsApi, +} from ''; +import type { ListApplicationsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new ApplicationsApi(config); + + try { + const data = await api.listApplications(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**CollectionOfApplications** +[**CollectionOfApplications**](CollectionOfApplications.md) ### Authorization @@ -90,15 +130,15 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entities | - | -|**0** | error | - | +| **200** | Retrieved entities | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/Audio.md b/web/packages/web-client/src/graph/generated/docs/Audio.md index 326bbdd5b23..fe467243178 100644 --- a/web/packages/web-client/src/graph/generated/docs/Audio.md +++ b/web/packages/web-client/src/graph/generated/docs/Audio.md @@ -1,51 +1,65 @@ + # Audio The Audio resource groups audio-related properties on an item into a single structure. If a DriveItem has a non-null audio facet, the item represents an audio file. The properties of the Audio resource are populated by extracting metadata from the file. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**album** | **string** | The title of the album for this audio file. | [optional] [default to undefined] -**albumArtist** | **string** | The artist named on the album for the audio file. | [optional] [default to undefined] -**artist** | **string** | The performing artist for the audio file. | [optional] [default to undefined] -**bitrate** | **number** | Bitrate expressed in kbps. | [optional] [default to undefined] -**composers** | **string** | The name of the composer of the audio file. | [optional] [default to undefined] -**copyright** | **string** | Copyright information for the audio file. | [optional] [default to undefined] -**disc** | **number** | The number of the disc this audio file came from. | [optional] [default to undefined] -**discCount** | **number** | The total number of discs in this album. | [optional] [default to undefined] -**duration** | **number** | Duration of the audio file, expressed in milliseconds | [optional] [default to undefined] -**genre** | **string** | The genre of this audio file. | [optional] [default to undefined] -**hasDrm** | **boolean** | Indicates if the file is protected with digital rights management. | [optional] [default to undefined] -**isVariableBitrate** | **boolean** | Indicates if the file is encoded with a variable bitrate. | [optional] [default to undefined] -**title** | **string** | The title of the audio file. | [optional] [default to undefined] -**track** | **number** | The number of the track on the original disc for this audio file. | [optional] [default to undefined] -**trackCount** | **number** | The total number of tracks on the original disc for this audio file. | [optional] [default to undefined] -**year** | **number** | The year the audio file was recorded. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`album` | string +`albumArtist` | string +`artist` | string +`bitrate` | number +`composers` | string +`copyright` | string +`disc` | number +`discCount` | number +`duration` | number +`genre` | string +`hasDrm` | boolean +`isVariableBitrate` | boolean +`title` | string +`track` | number +`trackCount` | number +`year` | number ## Example ```typescript -import { Audio } from './api'; - -const instance: Audio = { - album, - albumArtist, - artist, - bitrate, - composers, - copyright, - disc, - discCount, - duration, - genre, - hasDrm, - isVariableBitrate, - title, - track, - trackCount, - year, -}; +import type { Audio } from '' + +// TODO: Update the object below with actual values +const example = { + "album": null, + "albumArtist": null, + "artist": null, + "bitrate": null, + "composers": null, + "copyright": null, + "disc": null, + "discCount": null, + "duration": null, + "genre": null, + "hasDrm": null, + "isVariableBitrate": null, + "title": null, + "track": null, + "trackCount": null, + "year": null, +} satisfies Audio + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Audio +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ClassMemberReference.md b/web/packages/web-client/src/graph/generated/docs/ClassMemberReference.md index 0257c44728c..f2c2b0045ef 100644 --- a/web/packages/web-client/src/graph/generated/docs/ClassMemberReference.md +++ b/web/packages/web-client/src/graph/generated/docs/ClassMemberReference.md @@ -1,20 +1,34 @@ + # ClassMemberReference ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**odata_id** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`atOdataId` | string ## Example ```typescript -import { ClassMemberReference } from './api'; +import type { ClassMemberReference } from '' + +// TODO: Update the object below with actual values +const example = { + "atOdataId": https:///graph/v1.0/education/users/90eedea1-dea1-90ee-a1de-ee90a1deee90, +} satisfies ClassMemberReference + +console.log(example) -const instance: ClassMemberReference = { - odata_id, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ClassMemberReference +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ClassReference.md b/web/packages/web-client/src/graph/generated/docs/ClassReference.md index fc90649be2b..fb374be6f37 100644 --- a/web/packages/web-client/src/graph/generated/docs/ClassReference.md +++ b/web/packages/web-client/src/graph/generated/docs/ClassReference.md @@ -1,20 +1,34 @@ + # ClassReference ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**odata_id** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`atOdataId` | string ## Example ```typescript -import { ClassReference } from './api'; +import type { ClassReference } from '' + +// TODO: Update the object below with actual values +const example = { + "atOdataId": https:///graph/v1.0/education/classes/7e84a069-f374-479b-817d-71590117d443, +} satisfies ClassReference + +console.log(example) -const instance: ClassReference = { - odata_id, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ClassReference +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ClassTeacherReference.md b/web/packages/web-client/src/graph/generated/docs/ClassTeacherReference.md index 9cac4b51e79..0a5ab6daf71 100644 --- a/web/packages/web-client/src/graph/generated/docs/ClassTeacherReference.md +++ b/web/packages/web-client/src/graph/generated/docs/ClassTeacherReference.md @@ -1,20 +1,34 @@ + # ClassTeacherReference ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**odata_id** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`atOdataId` | string ## Example ```typescript -import { ClassTeacherReference } from './api'; +import type { ClassTeacherReference } from '' + +// TODO: Update the object below with actual values +const example = { + "atOdataId": https:///graph/v1.0/education/users/90eedea1-dea1-90ee-a1de-ee90a1deee90, +} satisfies ClassTeacherReference + +console.log(example) -const instance: ClassTeacherReference = { - odata_id, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ClassTeacherReference +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfActivities.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfActivities.md index bf5e72ced28..e084da8cac9 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfActivities.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfActivities.md @@ -1,20 +1,34 @@ + # CollectionOfActivities ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<Activity>**](Activity.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<Activity>](Activity.md) ## Example ```typescript -import { CollectionOfActivities } from './api'; +import type { CollectionOfActivities } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfActivities + +console.log(example) -const instance: CollectionOfActivities = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfActivities +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfAppRoleAssignments.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfAppRoleAssignments.md index 93cb8490cb1..dcd56b9a74b 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfAppRoleAssignments.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfAppRoleAssignments.md @@ -1,22 +1,36 @@ + # CollectionOfAppRoleAssignments ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<AppRoleAssignment>**](AppRoleAssignment.md) | | [optional] [default to undefined] -**odata_nextLink** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<AppRoleAssignment>](AppRoleAssignment.md) +`atOdataNextLink` | string ## Example ```typescript -import { CollectionOfAppRoleAssignments } from './api'; +import type { CollectionOfAppRoleAssignments } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, + "atOdataNextLink": null, +} satisfies CollectionOfAppRoleAssignments + +console.log(example) -const instance: CollectionOfAppRoleAssignments = { - value, - odata_nextLink, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfAppRoleAssignments +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfApplications.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfApplications.md index bef89f9314b..f2e995aedf0 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfApplications.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfApplications.md @@ -1,20 +1,34 @@ + # CollectionOfApplications ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<Application>**](Application.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<Application>](Application.md) ## Example ```typescript -import { CollectionOfApplications } from './api'; +import type { CollectionOfApplications } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfApplications + +console.log(example) -const instance: CollectionOfApplications = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfApplications +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfClass.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfClass.md index c2fe363fc42..27747b230e3 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfClass.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfClass.md @@ -1,20 +1,34 @@ + # CollectionOfClass ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<EducationClass>**](EducationClass.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<EducationClass>](EducationClass.md) ## Example ```typescript -import { CollectionOfClass } from './api'; +import type { CollectionOfClass } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfClass + +console.log(example) -const instance: CollectionOfClass = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfClass +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems.md index 4e53f85c1e5..79240e7b415 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems.md @@ -1,22 +1,36 @@ + # CollectionOfDriveItems ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<DriveItem>**](DriveItem.md) | | [optional] [default to undefined] -**odata_nextLink** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<DriveItem>](DriveItem.md) +`atOdataNextLink` | string ## Example ```typescript -import { CollectionOfDriveItems } from './api'; +import type { CollectionOfDriveItems } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, + "atOdataNextLink": null, +} satisfies CollectionOfDriveItems + +console.log(example) -const instance: CollectionOfDriveItems = { - value, - odata_nextLink, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfDriveItems +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems1.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems1.md index 8eb62f121e0..d49546250f3 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems1.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfDriveItems1.md @@ -1,20 +1,34 @@ + # CollectionOfDriveItems1 ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<DriveItem>**](DriveItem.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<DriveItem>](DriveItem.md) ## Example ```typescript -import { CollectionOfDriveItems1 } from './api'; +import type { CollectionOfDriveItems1 } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfDriveItems1 + +console.log(example) -const instance: CollectionOfDriveItems1 = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfDriveItems1 +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives.md index 9402bff5a85..d9cf3079e48 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives.md @@ -1,22 +1,36 @@ + # CollectionOfDrives ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<Drive>**](Drive.md) | | [optional] [default to undefined] -**odata_nextLink** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<Drive>](Drive.md) +`atOdataNextLink` | string ## Example ```typescript -import { CollectionOfDrives } from './api'; +import type { CollectionOfDrives } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, + "atOdataNextLink": null, +} satisfies CollectionOfDrives + +console.log(example) -const instance: CollectionOfDrives = { - value, - odata_nextLink, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfDrives +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives1.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives1.md index b5ab307dfa6..af9e890a97c 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives1.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfDrives1.md @@ -1,20 +1,34 @@ + # CollectionOfDrives1 ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<Drive>**](Drive.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<Drive>](Drive.md) ## Example ```typescript -import { CollectionOfDrives1 } from './api'; +import type { CollectionOfDrives1 } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfDrives1 + +console.log(example) -const instance: CollectionOfDrives1 = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfDrives1 +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationClass.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationClass.md index 3f8e7864f56..b8ab91d1180 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationClass.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationClass.md @@ -1,20 +1,34 @@ + # CollectionOfEducationClass ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<EducationClass>**](EducationClass.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<EducationClass>](EducationClass.md) ## Example ```typescript -import { CollectionOfEducationClass } from './api'; +import type { CollectionOfEducationClass } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfEducationClass + +console.log(example) -const instance: CollectionOfEducationClass = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfEducationClass +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationUser.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationUser.md index 03c7a437da8..15f6585dc69 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationUser.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfEducationUser.md @@ -1,20 +1,34 @@ + # CollectionOfEducationUser ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<EducationUser>**](EducationUser.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<EducationUser>](EducationUser.md) ## Example ```typescript -import { CollectionOfEducationUser } from './api'; +import type { CollectionOfEducationUser } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfEducationUser + +console.log(example) -const instance: CollectionOfEducationUser = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfEducationUser +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfGroup.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfGroup.md index e4109472b49..882c7e254d8 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfGroup.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfGroup.md @@ -1,22 +1,36 @@ + # CollectionOfGroup ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<Group>**](Group.md) | | [optional] [default to undefined] -**odata_nextLink** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<Group>](Group.md) +`atOdataNextLink` | string ## Example ```typescript -import { CollectionOfGroup } from './api'; +import type { CollectionOfGroup } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, + "atOdataNextLink": null, +} satisfies CollectionOfGroup + +console.log(example) -const instance: CollectionOfGroup = { - value, - odata_nextLink, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfGroup +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissions.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissions.md index e34766a3e49..b0b15dc12ff 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissions.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissions.md @@ -1,20 +1,34 @@ + # CollectionOfPermissions ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<Permission>**](Permission.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<Permission>](Permission.md) ## Example ```typescript -import { CollectionOfPermissions } from './api'; +import type { CollectionOfPermissions } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfPermissions + +console.log(example) -const instance: CollectionOfPermissions = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfPermissions +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissionsWithAllowedValues.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissionsWithAllowedValues.md index 2c4c4ce3afa..5f235da9756 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissionsWithAllowedValues.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfPermissionsWithAllowedValues.md @@ -1,24 +1,38 @@ + # CollectionOfPermissionsWithAllowedValues ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**libre_graph_permissions_roles_allowedValues** | [**Array<UnifiedRoleDefinition>**](UnifiedRoleDefinition.md) | A list of role definitions that can be chosen for the resource. | [optional] [default to undefined] -**libre_graph_permissions_actions_allowedValues** | **Array<string>** | A list of actions that can be chosen for a custom role. Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` | | [optional] [default to undefined] -**value** | [**Array<Permission>**](Permission.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`atLibreGraphPermissionsRolesAllowedValues` | [Array<UnifiedRoleDefinition>](UnifiedRoleDefinition.md) +`atLibreGraphPermissionsActionsAllowedValues` | Array<string> +`value` | [Array<Permission>](Permission.md) ## Example ```typescript -import { CollectionOfPermissionsWithAllowedValues } from './api'; +import type { CollectionOfPermissionsWithAllowedValues } from '' + +// TODO: Update the object below with actual values +const example = { + "atLibreGraphPermissionsRolesAllowedValues": null, + "atLibreGraphPermissionsActionsAllowedValues": null, + "value": null, +} satisfies CollectionOfPermissionsWithAllowedValues + +console.log(example) -const instance: CollectionOfPermissionsWithAllowedValues = { - libre_graph_permissions_roles_allowedValues, - libre_graph_permissions_actions_allowedValues, - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfPermissionsWithAllowedValues +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfSchools.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfSchools.md index 6cacd338b2d..c56c93d6399 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfSchools.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfSchools.md @@ -1,20 +1,34 @@ + # CollectionOfSchools ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<EducationSchool>**](EducationSchool.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<EducationSchool>](EducationSchool.md) ## Example ```typescript -import { CollectionOfSchools } from './api'; +import type { CollectionOfSchools } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfSchools + +console.log(example) -const instance: CollectionOfSchools = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfSchools +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfTags.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfTags.md index 742ce5f3725..e9f9e533157 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfTags.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfTags.md @@ -1,20 +1,34 @@ + # CollectionOfTags ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **Array<string>** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | Array<string> ## Example ```typescript -import { CollectionOfTags } from './api'; +import type { CollectionOfTags } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfTags + +console.log(example) -const instance: CollectionOfTags = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfTags +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfUser.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfUser.md index b697ae76880..bb78a44a6b6 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfUser.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfUser.md @@ -1,22 +1,36 @@ + # CollectionOfUser ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<User>**](User.md) | | [optional] [default to undefined] -**odata_nextLink** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<User>](User.md) +`atOdataNextLink` | string ## Example ```typescript -import { CollectionOfUser } from './api'; +import type { CollectionOfUser } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, + "atOdataNextLink": null, +} satisfies CollectionOfUser + +console.log(example) -const instance: CollectionOfUser = { - value, - odata_nextLink, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfUser +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/CollectionOfUsers.md b/web/packages/web-client/src/graph/generated/docs/CollectionOfUsers.md index 0e4b064e7be..9990d8dcff9 100644 --- a/web/packages/web-client/src/graph/generated/docs/CollectionOfUsers.md +++ b/web/packages/web-client/src/graph/generated/docs/CollectionOfUsers.md @@ -1,20 +1,34 @@ + # CollectionOfUsers ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**Array<User>**](User.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`value` | [Array<User>](User.md) ## Example ```typescript -import { CollectionOfUsers } from './api'; +import type { CollectionOfUsers } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies CollectionOfUsers + +console.log(example) -const instance: CollectionOfUsers = { - value, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as CollectionOfUsers +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Deleted.md b/web/packages/web-client/src/graph/generated/docs/Deleted.md index 7529adc90da..b07173d95da 100644 --- a/web/packages/web-client/src/graph/generated/docs/Deleted.md +++ b/web/packages/web-client/src/graph/generated/docs/Deleted.md @@ -1,21 +1,35 @@ + # Deleted Information about the deleted state of the item. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**state** | **string** | Represents the state of the deleted item. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`state` | string ## Example ```typescript -import { Deleted } from './api'; +import type { Deleted } from '' + +// TODO: Update the object below with actual values +const example = { + "state": null, +} satisfies Deleted + +console.log(example) -const instance: Deleted = { - state, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Deleted +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Drive.md b/web/packages/web-client/src/graph/generated/docs/Drive.md index 34abe5c37ef..0a28dfaf355 100644 --- a/web/packages/web-client/src/graph/generated/docs/Drive.md +++ b/web/packages/web-client/src/graph/generated/docs/Drive.md @@ -1,53 +1,67 @@ + # Drive The drive represents a space on the storage. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The unique identifier for this drive. | [optional] [readonly] [default to undefined] -**createdBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**createdDateTime** | **string** | Date and time of item creation. Read-only. | [optional] [readonly] [default to undefined] -**description** | **string** | Provides a user-visible description of the item. Optional. | [optional] [default to undefined] -**eTag** | **string** | ETag for the item. Read-only. | [optional] [readonly] [default to undefined] -**lastModifiedBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**lastModifiedDateTime** | **string** | Date and time the item was last modified. Read-only. | [optional] [readonly] [default to undefined] -**name** | **string** | The name of the item. Read-write. | [default to undefined] -**parentReference** | [**ItemReference**](ItemReference.md) | | [optional] [default to undefined] -**webUrl** | **string** | URL that displays the resource in the browser. Read-only. | [optional] [readonly] [default to undefined] -**driveType** | **string** | Describes the type of drive represented by this resource. Values are \"personal\" for users home spaces, \"project\", \"virtual\" or \"share\". Read-only. | [optional] [readonly] [default to undefined] -**driveAlias** | **string** | The drive alias can be used in clients to make the urls user friendly. Example: \'personal/einstein\'. This will be used to resolve to the correct driveID. | [optional] [default to undefined] -**owner** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**quota** | [**Quota**](Quota.md) | | [optional] [default to undefined] -**items** | [**Array<DriveItem>**](DriveItem.md) | All items contained in the drive. Read-only. Nullable. | [optional] [readonly] [default to undefined] -**root** | [**DriveItem**](DriveItem.md) | | [optional] [default to undefined] -**special** | [**Array<DriveItem>**](DriveItem.md) | A collection of special drive resources. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`createdBy` | [IdentitySet](IdentitySet.md) +`createdDateTime` | Date +`description` | string +`eTag` | string +`lastModifiedBy` | [IdentitySet](IdentitySet.md) +`lastModifiedDateTime` | Date +`name` | string +`parentReference` | [ItemReference](ItemReference.md) +`webUrl` | string +`driveType` | string +`driveAlias` | string +`owner` | [IdentitySet](IdentitySet.md) +`quota` | [Quota](Quota.md) +`items` | [Array<DriveItem>](DriveItem.md) +`root` | [DriveItem](DriveItem.md) +`special` | [Array<DriveItem>](DriveItem.md) ## Example ```typescript -import { Drive } from './api'; - -const instance: Drive = { - id, - createdBy, - createdDateTime, - description, - eTag, - lastModifiedBy, - lastModifiedDateTime, - name, - parentReference, - webUrl, - driveType, - driveAlias, - owner, - quota, - items, - root, - special, -}; +import type { Drive } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "createdBy": null, + "createdDateTime": null, + "description": null, + "eTag": null, + "lastModifiedBy": null, + "lastModifiedDateTime": null, + "name": null, + "parentReference": null, + "webUrl": null, + "driveType": null, + "driveAlias": null, + "owner": null, + "quota": null, + "items": null, + "root": null, + "special": null, +} satisfies Drive + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Drive +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/DriveItem.md b/web/packages/web-client/src/graph/generated/docs/DriveItem.md index afb8d18feb0..4b318e3259b 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveItem.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveItem.md @@ -1,83 +1,97 @@ + # DriveItem Represents a resource inside a drive. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Read-only. | [optional] [readonly] [default to undefined] -**createdBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**createdDateTime** | **string** | Date and time of item creation. Read-only. | [optional] [readonly] [default to undefined] -**description** | **string** | Provides a user-visible description of the item. Optional. | [optional] [default to undefined] -**eTag** | **string** | ETag for the item. Read-only. | [optional] [readonly] [default to undefined] -**lastModifiedBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**lastModifiedDateTime** | **string** | Date and time the item was last modified. Read-only. | [optional] [readonly] [default to undefined] -**name** | **string** | The name of the item. Read-write. | [optional] [default to undefined] -**parentReference** | [**ItemReference**](ItemReference.md) | | [optional] [default to undefined] -**webUrl** | **string** | URL that displays the resource in the browser. Read-only. | [optional] [readonly] [default to undefined] -**content** | **string** | The content stream, if the item represents a file. | [optional] [default to undefined] -**cTag** | **string** | An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. | [optional] [readonly] [default to undefined] -**deleted** | [**Deleted**](Deleted.md) | | [optional] [default to undefined] -**file** | [**OpenGraphFile**](OpenGraphFile.md) | | [optional] [default to undefined] -**fileSystemInfo** | [**FileSystemInfo**](FileSystemInfo.md) | | [optional] [default to undefined] -**folder** | [**Folder**](Folder.md) | | [optional] [default to undefined] -**image** | [**Image**](Image.md) | | [optional] [default to undefined] -**photo** | [**Photo**](Photo.md) | | [optional] [default to undefined] -**location** | [**GeoCoordinates**](GeoCoordinates.md) | | [optional] [default to undefined] -**thumbnails** | [**Array<ThumbnailSet>**](ThumbnailSet.md) | Collection containing ThumbnailSet objects associated with the item. Read-only. Nullable. | [optional] [default to undefined] -**root** | **object** | If this property is non-null, it indicates that the driveItem is the top-most driveItem in the drive. | [optional] [default to undefined] -**trash** | [**Trash**](Trash.md) | | [optional] [default to undefined] -**specialFolder** | [**SpecialFolder**](SpecialFolder.md) | | [optional] [default to undefined] -**remoteItem** | [**RemoteItem**](RemoteItem.md) | | [optional] [default to undefined] -**size** | **number** | Size of the item in bytes. Read-only. | [optional] [readonly] [default to undefined] -**webDavUrl** | **string** | WebDAV compatible URL for the item. Read-only. | [optional] [readonly] [default to undefined] -**children** | [**Array<DriveItem>**](DriveItem.md) | Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. | [optional] [readonly] [default to undefined] -**permissions** | [**Array<Permission>**](Permission.md) | The set of permissions for the item. Read-only. Nullable. | [optional] [readonly] [default to undefined] -**audio** | [**Audio**](Audio.md) | | [optional] [default to undefined] -**video** | [**Video**](Video.md) | | [optional] [default to undefined] -**client_synchronize** | **boolean** | Indicates if the item is synchronized with the underlying storage provider. Read-only. | [optional] [default to undefined] -**UI_Hidden** | **boolean** | Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissions. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`createdBy` | [IdentitySet](IdentitySet.md) +`createdDateTime` | Date +`description` | string +`eTag` | string +`lastModifiedBy` | [IdentitySet](IdentitySet.md) +`lastModifiedDateTime` | Date +`name` | string +`parentReference` | [ItemReference](ItemReference.md) +`webUrl` | string +`content` | string +`cTag` | string +`deleted` | [Deleted](Deleted.md) +`file` | [OpenGraphFile](OpenGraphFile.md) +`fileSystemInfo` | [FileSystemInfo](FileSystemInfo.md) +`folder` | [Folder](Folder.md) +`image` | [Image](Image.md) +`photo` | [Photo](Photo.md) +`location` | [GeoCoordinates](GeoCoordinates.md) +`thumbnails` | [Array<ThumbnailSet>](ThumbnailSet.md) +`root` | object +`trash` | [Trash](Trash.md) +`specialFolder` | [SpecialFolder](SpecialFolder.md) +`remoteItem` | [RemoteItem](RemoteItem.md) +`size` | number +`webDavUrl` | string +`children` | [Array<DriveItem>](DriveItem.md) +`permissions` | [Array<Permission>](Permission.md) +`audio` | [Audio](Audio.md) +`video` | [Video](Video.md) +`atClientSynchronize` | boolean +`atUIHidden` | boolean ## Example ```typescript -import { DriveItem } from './api'; +import type { DriveItem } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "createdBy": null, + "createdDateTime": null, + "description": null, + "eTag": null, + "lastModifiedBy": null, + "lastModifiedDateTime": null, + "name": null, + "parentReference": null, + "webUrl": null, + "content": null, + "cTag": null, + "deleted": null, + "file": null, + "fileSystemInfo": null, + "folder": null, + "image": null, + "photo": null, + "location": null, + "thumbnails": null, + "root": null, + "trash": null, + "specialFolder": null, + "remoteItem": null, + "size": null, + "webDavUrl": null, + "children": null, + "permissions": null, + "audio": null, + "video": null, + "atClientSynchronize": null, + "atUIHidden": null, +} satisfies DriveItem + +console.log(example) -const instance: DriveItem = { - id, - createdBy, - createdDateTime, - description, - eTag, - lastModifiedBy, - lastModifiedDateTime, - name, - parentReference, - webUrl, - content, - cTag, - deleted, - file, - fileSystemInfo, - folder, - image, - photo, - location, - thumbnails, - root, - trash, - specialFolder, - remoteItem, - size, - webDavUrl, - children, - permissions, - audio, - video, - client_synchronize, - UI_Hidden, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DriveItem +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/DriveItemApi.md b/web/packages/web-client/src/graph/generated/docs/DriveItemApi.md index 1d7ed0a0eab..60b4b577e24 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveItemApi.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveItemApi.md @@ -2,48 +2,70 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**deleteDriveItem**](#deletedriveitem) | **DELETE** /v1beta1/drives/{drive-id}/items/{item-id} | Delete a DriveItem.| -|[**getDriveItem**](#getdriveitem) | **GET** /v1beta1/drives/{drive-id}/items/{item-id} | Get a DriveItem.| -|[**updateDriveItem**](#updatedriveitem) | **PATCH** /v1beta1/drives/{drive-id}/items/{item-id} | Update a DriveItem.| +| [**deleteDriveItem**](DriveItemApi.md#deletedriveitem) | **DELETE** /v1beta1/drives/{drive-id}/items/{item-id} | Delete a DriveItem. | +| [**getDriveItem**](DriveItemApi.md#getdriveitem) | **GET** /v1beta1/drives/{drive-id}/items/{item-id} | Get a DriveItem. | +| [**updateDriveItem**](DriveItemApi.md#updatedriveitem) | **PATCH** /v1beta1/drives/{drive-id}/items/{item-id} | Update a DriveItem. | -# **deleteDriveItem** -> deleteDriveItem() -Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. -### Example +## deleteDriveItem -```typescript -import { - DriveItemApi, - Configuration -} from './api'; +> deleteDriveItem(driveId, itemId) -const configuration = new Configuration(); -const apiInstance = new DriveItemApi(configuration); +Delete a DriveItem. -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) +Delete a DriveItem by using its ID. Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item. Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false. -const { status, data } = await apiInstance.deleteDriveItem( - driveId, - itemId -); +### Example + +```ts +import { + Configuration, + DriveItemApi, +} from ''; +import type { DeleteDriveItemRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DriveItemApi(config); + + const body = { + // string | key: id of drive + driveId: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668, + // string | key: id of item + itemId: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id, + } satisfies DeleteDriveItemRequest; + + try { + const data = await api.deleteDriveItem(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -51,54 +73,75 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **getDriveItem** -> DriveItem getDriveItem() -Get a DriveItem by using its ID. +## getDriveItem -### Example +> DriveItem getDriveItem(driveId, itemId) -```typescript -import { - DriveItemApi, - Configuration -} from './api'; +Get a DriveItem. -const configuration = new Configuration(); -const apiInstance = new DriveItemApi(configuration); +Get a DriveItem by using its ID. -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) +### Example -const { status, data } = await apiInstance.getDriveItem( - driveId, - itemId -); +```ts +import { + Configuration, + DriveItemApi, +} from ''; +import type { GetDriveItemRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DriveItemApi(config); + + const body = { + // string | key: id of drive + driveId: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668, + // string | key: id of item + itemId: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id, + } satisfies GetDriveItemRequest; + + try { + const data = await api.getDriveItem(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | ### Return type -**DriveItem** +[**DriveItem**](DriveItem.md) ### Authorization @@ -106,58 +149,78 @@ const { status, data } = await apiInstance.getDriveItem( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved driveItem | - | -|**0** | error | - | +| **200** | Retrieved driveItem | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **updateDriveItem** -> DriveItem updateDriveItem(driveItem) -Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. +## updateDriveItem + +> DriveItem updateDriveItem(driveId, itemId, driveItem) + +Update a DriveItem. + +Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI. ### Example -```typescript +```ts import { - DriveItemApi, - Configuration, - DriveItem -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DriveItemApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let driveItem: DriveItem; //DriveItem properties to update - -const { status, data } = await apiInstance.updateDriveItem( - driveId, - itemId, - driveItem -); + Configuration, + DriveItemApi, +} from ''; +import type { UpdateDriveItemRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DriveItemApi(config); + + const body = { + // string | key: id of drive + driveId: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668, + // string | key: id of item + itemId: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id, + // DriveItem | DriveItem properties to update + driveItem: {"@UI.Hidden":true}, + } satisfies UpdateDriveItemRequest; + + try { + const data = await api.updateDriveItem(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveItem** | **DriveItem**| DriveItem properties to update | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **driveItem** | [DriveItem](DriveItem.md) | DriveItem properties to update | | ### Return type -**DriveItem** +[**DriveItem**](DriveItem.md) ### Authorization @@ -165,15 +228,15 @@ const { status, data } = await apiInstance.updateDriveItem( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Success | - | -|**0** | error | - | +| **200** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md b/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md index cb7fdd24836..afbe0593d8f 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md @@ -1,28 +1,42 @@ + # DriveItemCreateLink ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**SharingLinkType**](SharingLinkType.md) | | [optional] [default to undefined] -**expirationDateTime** | **string** | Optional. A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates the expiration time of the permission. | [optional] [default to undefined] -**password** | **string** | Optional.The password of the sharing link that is set by the creator. | [optional] [default to undefined] -**displayName** | **string** | Provides a user-visible display name of the link. Optional. Libregraph only. | [optional] [default to undefined] -**libre_graph_quickLink** | **boolean** | The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`type` | [SharingLinkType](SharingLinkType.md) +`expirationDateTime` | Date +`password` | string +`displayName` | string +`atLibreGraphQuickLink` | boolean ## Example ```typescript -import { DriveItemCreateLink } from './api'; - -const instance: DriveItemCreateLink = { - type, - expirationDateTime, - password, - displayName, - libre_graph_quickLink, -}; +import type { DriveItemCreateLink } from '' + +// TODO: Update the object below with actual values +const example = { + "type": null, + "expirationDateTime": null, + "password": null, + "displayName": null, + "atLibreGraphQuickLink": null, +} satisfies DriveItemCreateLink + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DriveItemCreateLink +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md b/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md index ecc59ecaf70..4d22e06ca31 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md @@ -1,26 +1,40 @@ + # DriveItemInvite ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**recipients** | [**Array<DriveRecipient>**](DriveRecipient.md) | A collection of recipients who will receive access and the sharing invitation. Currently, only internal users or groups are supported. | [optional] [default to undefined] -**roles** | **Array<string>** | Specifies the roles that are to be granted to the recipients of the sharing invitation. | [optional] [default to undefined] -**libre_graph_permissions_actions** | **Array<string>** | Specifies the actions that are to be granted to the recipients of the sharing invitation, in effect creating a custom role. | [optional] [default to undefined] -**expirationDateTime** | **string** | Specifies the dateTime after which the permission expires. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`recipients` | [Array<DriveRecipient>](DriveRecipient.md) +`roles` | Array<string> +`atLibreGraphPermissionsActions` | Array<string> +`expirationDateTime` | Date ## Example ```typescript -import { DriveItemInvite } from './api'; - -const instance: DriveItemInvite = { - recipients, - roles, - libre_graph_permissions_actions, - expirationDateTime, -}; +import type { DriveItemInvite } from '' + +// TODO: Update the object below with actual values +const example = { + "recipients": null, + "roles": null, + "atLibreGraphPermissionsActions": null, + "expirationDateTime": null, +} satisfies DriveItemInvite + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DriveItemInvite +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/DriveRecipient.md b/web/packages/web-client/src/graph/generated/docs/DriveRecipient.md index 8b14366d6fc..47b33d007ea 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveRecipient.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveRecipient.md @@ -1,23 +1,37 @@ + # DriveRecipient Represents a person, group, or other recipient to share a drive item with using the invite action. When using invite to add permissions, the `driveRecipient` object would specify the `email`, `alias`, or `objectId` of the recipient. Only one of these values is required; multiple values are not accepted. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectId** | **string** | The unique identifier for the recipient in the directory. | [optional] [default to undefined] -**libre_graph_recipient_type** | **string** | When the recipient is referenced by objectId this annotation is used to differentiate `user` and `group` recipients. | [optional] [default to 'user'] +Name | Type +------------ | ------------- +`objectId` | string +`atLibreGraphRecipientType` | string ## Example ```typescript -import { DriveRecipient } from './api'; +import type { DriveRecipient } from '' + +// TODO: Update the object below with actual values +const example = { + "objectId": null, + "atLibreGraphRecipientType": null, +} satisfies DriveRecipient + +console.log(example) -const instance: DriveRecipient = { - objectId, - libre_graph_recipient_type, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DriveRecipient +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md b/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md index 61010dceea3..682b1cb447b 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md @@ -1,53 +1,67 @@ + # DriveUpdate The drive represents an update to a space on the storage. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The unique identifier for this drive. | [optional] [readonly] [default to undefined] -**createdBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**createdDateTime** | **string** | Date and time of item creation. Read-only. | [optional] [readonly] [default to undefined] -**description** | **string** | Provides a user-visible description of the item. Optional. | [optional] [default to undefined] -**eTag** | **string** | ETag for the item. Read-only. | [optional] [readonly] [default to undefined] -**lastModifiedBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**lastModifiedDateTime** | **string** | Date and time the item was last modified. Read-only. | [optional] [readonly] [default to undefined] -**name** | **string** | The name of the item. Read-write. | [optional] [default to undefined] -**parentReference** | [**ItemReference**](ItemReference.md) | | [optional] [default to undefined] -**webUrl** | **string** | URL that displays the resource in the browser. Read-only. | [optional] [readonly] [default to undefined] -**driveType** | **string** | Describes the type of drive represented by this resource. Values are \"personal\" for users home spaces, \"project\", \"virtual\" or \"share\". Read-only. | [optional] [readonly] [default to undefined] -**driveAlias** | **string** | The drive alias can be used in clients to make the urls user friendly. Example: \'personal/einstein\'. This will be used to resolve to the correct driveID. | [optional] [default to undefined] -**owner** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**quota** | [**Quota**](Quota.md) | | [optional] [default to undefined] -**items** | [**Array<DriveItem>**](DriveItem.md) | All items contained in the drive. Read-only. Nullable. | [optional] [readonly] [default to undefined] -**root** | [**DriveItem**](DriveItem.md) | | [optional] [default to undefined] -**special** | [**Array<DriveItem>**](DriveItem.md) | A collection of special drive resources. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`createdBy` | [IdentitySet](IdentitySet.md) +`createdDateTime` | Date +`description` | string +`eTag` | string +`lastModifiedBy` | [IdentitySet](IdentitySet.md) +`lastModifiedDateTime` | Date +`name` | string +`parentReference` | [ItemReference](ItemReference.md) +`webUrl` | string +`driveType` | string +`driveAlias` | string +`owner` | [IdentitySet](IdentitySet.md) +`quota` | [Quota](Quota.md) +`items` | [Array<DriveItem>](DriveItem.md) +`root` | [DriveItem](DriveItem.md) +`special` | [Array<DriveItem>](DriveItem.md) ## Example ```typescript -import { DriveUpdate } from './api'; - -const instance: DriveUpdate = { - id, - createdBy, - createdDateTime, - description, - eTag, - lastModifiedBy, - lastModifiedDateTime, - name, - parentReference, - webUrl, - driveType, - driveAlias, - owner, - quota, - items, - root, - special, -}; +import type { DriveUpdate } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "createdBy": null, + "createdDateTime": null, + "description": null, + "eTag": null, + "lastModifiedBy": null, + "lastModifiedDateTime": null, + "name": null, + "parentReference": null, + "webUrl": null, + "driveType": null, + "driveAlias": null, + "owner": null, + "quota": null, + "items": null, + "root": null, + "special": null, +} satisfies DriveUpdate + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DriveUpdate +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/DrivesApi.md b/web/packages/web-client/src/graph/generated/docs/DrivesApi.md index fe26e216e68..7de8a9cf380 100644 --- a/web/packages/web-client/src/graph/generated/docs/DrivesApi.md +++ b/web/packages/web-client/src/graph/generated/docs/DrivesApi.md @@ -2,50 +2,70 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**createDrive**](#createdrive) | **POST** /v1.0/drives | Create a new drive of a specific type| -|[**createDriveBeta**](#createdrivebeta) | **POST** /v1beta1/drives | Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles.| -|[**deleteDrive**](#deletedrive) | **DELETE** /v1.0/drives/{drive-id} | Delete a specific space| -|[**deleteDriveBeta**](#deletedrivebeta) | **DELETE** /v1beta1/drives/{drive-id} | Delete a specific space. Alias for \'/v1.0/drives\'.| -|[**getDrive**](#getdrive) | **GET** /v1.0/drives/{drive-id} | Get drive by id| -|[**getDriveBeta**](#getdrivebeta) | **GET** /v1beta1/drives/{drive-id} | Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles| -|[**updateDrive**](#updatedrive) | **PATCH** /v1.0/drives/{drive-id} | Update the drive| -|[**updateDriveBeta**](#updatedrivebeta) | **PATCH** /v1beta1/drives/{drive-id} | Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles| - -# **createDrive** -> Drive createDrive(drive) +| [**createDrive**](DrivesApi.md#createdrive) | **POST** /v1.0/drives | Create a new drive of a specific type | +| [**createDriveBeta**](DrivesApi.md#createdrivebeta) | **POST** /v1beta1/drives | Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. | +| [**deleteDrive**](DrivesApi.md#deletedrive) | **DELETE** /v1.0/drives/{drive-id} | Delete a specific space | +| [**deleteDriveBeta**](DrivesApi.md#deletedrivebeta) | **DELETE** /v1beta1/drives/{drive-id} | Delete a specific space. Alias for \'/v1.0/drives\'. | +| [**getDrive**](DrivesApi.md#getdrive) | **GET** /v1.0/drives/{drive-id} | Get drive by id | +| [**getDriveBeta**](DrivesApi.md#getdrivebeta) | **GET** /v1beta1/drives/{drive-id} | Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles | +| [**updateDrive**](DrivesApi.md#updatedrive) | **PATCH** /v1.0/drives/{drive-id} | Update the drive | +| [**updateDriveBeta**](DrivesApi.md#updatedrivebeta) | **PATCH** /v1beta1/drives/{drive-id} | Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles | -### Example -```typescript -import { - DrivesApi, - Configuration, - Drive -} from './api'; +## createDrive + +> Drive createDrive(drive) -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); +Create a new drive of a specific type -let drive: Drive; //New space property values +### Example -const { status, data } = await apiInstance.createDrive( - drive -); +```ts +import { + Configuration, + DrivesApi, +} from ''; +import type { CreateDriveRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // Drive | New space property values + drive: {"name":"Mars","quota":{"total":1000000000},"description":"Team space mars project"}, + } satisfies CreateDriveRequest; + + try { + const data = await api.createDrive(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **drive** | **Drive**| New space property values | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **drive** | [Drive](Drive.md) | New space property values | | ### Return type -**Drive** +[**Drive**](Drive.md) ### Authorization @@ -53,51 +73,70 @@ const { status, data } = await apiInstance.createDrive( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**201** | Created | - | -|**0** | error | - | +| **201** | Created | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **createDriveBeta** +## createDriveBeta + > Drive createDriveBeta(drive) +Create a new drive of a specific type. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles. ### Example -```typescript +```ts import { - DrivesApi, - Configuration, - Drive -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); - -let drive: Drive; //New space property values - -const { status, data } = await apiInstance.createDriveBeta( - drive -); + Configuration, + DrivesApi, +} from ''; +import type { CreateDriveBetaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // Drive | New space property values + drive: {"name":"Mars","quota":{"total":1000000000},"description":"Team space mars project"}, + } satisfies CreateDriveBetaRequest; + + try { + const data = await api.createDriveBeta(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **drive** | **Drive**| New space property values | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **drive** | [Drive](Drive.md) | New space property values | | ### Return type -**Drive** +[**Drive**](Drive.md) ### Authorization @@ -105,53 +144,73 @@ const { status, data } = await apiInstance.createDriveBeta( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**201** | Created | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **201** | Created | - | +| **0** | error | - | -# **deleteDrive** -> deleteDrive() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## deleteDrive -```typescript -import { - DrivesApi, - Configuration -} from './api'; +> deleteDrive(driveId, ifMatch) -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); +Delete a specific space -let driveId: string; //key: id of drive (default to undefined) -let ifMatch: string; //ETag (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.deleteDrive( - driveId, - ifMatch -); +```ts +import { + Configuration, + DrivesApi, +} from ''; +import type { DeleteDriveRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | ETag (optional) + ifMatch: ifMatch_example, + } satisfies DeleteDriveRequest; + + try { + const data = await api.deleteDrive(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **ifMatch** | [**string**] | ETag | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **ifMatch** | `string` | ETag | [Optional] [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -159,53 +218,73 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **204** | Success | - | +| **0** | error | - | -# **deleteDriveBeta** -> deleteDriveBeta() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## deleteDriveBeta -```typescript -import { - DrivesApi, - Configuration -} from './api'; +> deleteDriveBeta(driveId, ifMatch) -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); +Delete a specific space. Alias for \'/v1.0/drives\'. -let driveId: string; //key: id of drive (default to undefined) -let ifMatch: string; //ETag (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.deleteDriveBeta( - driveId, - ifMatch -); +```ts +import { + Configuration, + DrivesApi, +} from ''; +import type { DeleteDriveBetaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | ETag (optional) + ifMatch: ifMatch_example, + } satisfies DeleteDriveBetaRequest; + + try { + const data = await api.deleteDriveBeta(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **ifMatch** | [**string**] | ETag | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **ifMatch** | `string` | ETag | [Optional] [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -213,50 +292,70 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **204** | Success | - | +| **0** | error | - | -# **getDrive** -> Drive getDrive() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## getDrive -```typescript -import { - DrivesApi, - Configuration -} from './api'; +> Drive getDrive(driveId) -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); +Get drive by id -let driveId: string; //key: id of drive (default to undefined) +### Example -const { status, data } = await apiInstance.getDrive( - driveId -); +```ts +import { + Configuration, + DrivesApi, +} from ''; +import type { GetDriveRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + } satisfies GetDriveRequest; + + try { + const data = await api.getDrive(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | ### Return type -**Drive** +[**Drive**](Drive.md) ### Authorization @@ -264,50 +363,70 @@ const { status, data } = await apiInstance.getDrive( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved drive | - | -|**0** | error | - | +| **200** | Retrieved drive | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **getDriveBeta** -> Drive getDriveBeta() +## getDriveBeta -### Example - -```typescript -import { - DrivesApi, - Configuration -} from './api'; +> Drive getDriveBeta(driveId) -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); +Get drive by id. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles -let driveId: string; //key: id of drive (default to undefined) +### Example -const { status, data } = await apiInstance.getDriveBeta( - driveId -); +```ts +import { + Configuration, + DrivesApi, +} from ''; +import type { GetDriveBetaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + } satisfies GetDriveBetaRequest; + + try { + const data = await api.getDriveBeta(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | ### Return type -**Drive** +[**Drive**](Drive.md) ### Authorization @@ -315,54 +434,73 @@ const { status, data } = await apiInstance.getDriveBeta( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved drive | - | -|**0** | error | - | +| **200** | Retrieved drive | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **updateDrive** -> Drive updateDrive(driveUpdate) +## updateDrive -### Example - -```typescript -import { - DrivesApi, - Configuration, - DriveUpdate -} from './api'; +> Drive updateDrive(driveId, driveUpdate) -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); +Update the drive -let driveId: string; //key: id of drive (default to undefined) -let driveUpdate: DriveUpdate; //New space values +### Example -const { status, data } = await apiInstance.updateDrive( - driveId, - driveUpdate -); +```ts +import { + Configuration, + DrivesApi, +} from ''; +import type { UpdateDriveRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // DriveUpdate | New space values + driveUpdate: {"quota":{"total":1000000000}}, + } satisfies UpdateDriveRequest; + + try { + const data = await api.updateDrive(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveUpdate** | **DriveUpdate**| New space values | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **driveUpdate** | [DriveUpdate](DriveUpdate.md) | New space values | | ### Return type -**Drive** +[**Drive**](Drive.md) ### Authorization @@ -370,54 +508,73 @@ const { status, data } = await apiInstance.updateDrive( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Success | - | -|**0** | error | - | +| **200** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **updateDriveBeta** -> Drive updateDriveBeta(driveUpdate) +## updateDriveBeta -### Example - -```typescript -import { - DrivesApi, - Configuration, - DriveUpdate -} from './api'; +> Drive updateDriveBeta(driveId, driveUpdate) -const configuration = new Configuration(); -const apiInstance = new DrivesApi(configuration); +Update the drive. Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles -let driveId: string; //key: id of drive (default to undefined) -let driveUpdate: DriveUpdate; //New space values +### Example -const { status, data } = await apiInstance.updateDriveBeta( - driveId, - driveUpdate -); +```ts +import { + Configuration, + DrivesApi, +} from ''; +import type { UpdateDriveBetaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // DriveUpdate | New space values + driveUpdate: {"quota":{"total":1000000000}}, + } satisfies UpdateDriveBetaRequest; + + try { + const data = await api.updateDriveBeta(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveUpdate** | **DriveUpdate**| New space values | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **driveUpdate** | [DriveUpdate](DriveUpdate.md) | New space values | | ### Return type -**Drive** +[**Drive**](Drive.md) ### Authorization @@ -425,15 +582,15 @@ const { status, data } = await apiInstance.updateDriveBeta( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Success | - | -|**0** | error | - | +| **200** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/DrivesGetDrivesApi.md b/web/packages/web-client/src/graph/generated/docs/DrivesGetDrivesApi.md index 1f5d2149e34..2e77ee944ed 100644 --- a/web/packages/web-client/src/graph/generated/docs/DrivesGetDrivesApi.md +++ b/web/packages/web-client/src/graph/generated/docs/DrivesGetDrivesApi.md @@ -2,46 +2,67 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**listAllDrives**](#listalldrives) | **GET** /v1.0/drives | Get all available drives| -|[**listAllDrivesBeta**](#listalldrivesbeta) | **GET** /v1beta1/drives | Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles| +| [**listAllDrives**](DrivesGetDrivesApi.md#listalldrives) | **GET** /v1.0/drives | Get all available drives | +| [**listAllDrivesBeta**](DrivesGetDrivesApi.md#listalldrivesbeta) | **GET** /v1beta1/drives | Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles | -# **listAllDrives** -> CollectionOfDrives1 listAllDrives() -### Example +## listAllDrives -```typescript -import { - DrivesGetDrivesApi, - Configuration -} from './api'; +> CollectionOfDrives1 listAllDrives($orderby, $filter) -const configuration = new Configuration(); -const apiInstance = new DrivesGetDrivesApi(configuration); +Get all available drives -let $orderby: string; //The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) (default to undefined) -let $filter: string; //Filter items by property values (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.listAllDrives( - $orderby, - $filter -); +```ts +import { + Configuration, + DrivesGetDrivesApi, +} from ''; +import type { ListAllDrivesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesGetDrivesApi(config); + + const body = { + // string | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) + $orderby: lastModifiedDateTime desc, + // string | Filter items by property values (optional) + $filter: driveType eq 'project', + } satisfies ListAllDrivesRequest; + + try { + const data = await api.listAllDrives(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$orderby** | [**string**] | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | (optional) defaults to undefined| -| **$filter** | [**string**] | Filter items by property values | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$orderby** | `string` | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | [Optional] [Defaults to `undefined`] | +| **$filter** | `string` | Filter items by property values | [Optional] [Defaults to `undefined`] | ### Return type -**CollectionOfDrives1** +[**CollectionOfDrives1**](CollectionOfDrives1.md) ### Authorization @@ -49,53 +70,73 @@ const { status, data } = await apiInstance.listAllDrives( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved spaces | - | -|**0** | error | - | +| **200** | Retrieved spaces | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **listAllDrivesBeta** -> CollectionOfDrives1 listAllDrivesBeta() +## listAllDrivesBeta -### Example +> CollectionOfDrives1 listAllDrivesBeta($orderby, $filter) -```typescript -import { - DrivesGetDrivesApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesGetDrivesApi(configuration); +Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles -let $orderby: string; //The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) (default to undefined) -let $filter: string; //Filter items by property values (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.listAllDrivesBeta( - $orderby, - $filter -); +```ts +import { + Configuration, + DrivesGetDrivesApi, +} from ''; +import type { ListAllDrivesBetaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesGetDrivesApi(config); + + const body = { + // string | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) + $orderby: lastModifiedDateTime desc, + // string | Filter items by property values (optional) + $filter: driveType eq 'project', + } satisfies ListAllDrivesBetaRequest; + + try { + const data = await api.listAllDrivesBeta(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$orderby** | [**string**] | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | (optional) defaults to undefined| -| **$filter** | [**string**] | Filter items by property values | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$orderby** | `string` | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | [Optional] [Defaults to `undefined`] | +| **$filter** | `string` | Filter items by property values | [Optional] [Defaults to `undefined`] | ### Return type -**CollectionOfDrives1** +[**CollectionOfDrives1**](CollectionOfDrives1.md) ### Authorization @@ -103,15 +144,15 @@ const { status, data } = await apiInstance.listAllDrivesBeta( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved spaces | - | -|**0** | error | - | +| **200** | Retrieved spaces | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/DrivesPermissionsApi.md b/web/packages/web-client/src/graph/generated/docs/DrivesPermissionsApi.md index e60aee2b94c..64432916130 100644 --- a/web/packages/web-client/src/graph/generated/docs/DrivesPermissionsApi.md +++ b/web/packages/web-client/src/graph/generated/docs/DrivesPermissionsApi.md @@ -2,56 +2,77 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**createLink**](#createlink) | **POST** /v1beta1/drives/{drive-id}/items/{item-id}/createLink | Create a sharing link for a DriveItem| -|[**deletePermission**](#deletepermission) | **DELETE** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Remove access to a DriveItem| -|[**getPermission**](#getpermission) | **GET** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Get sharing permission for a file or folder| -|[**invite**](#invite) | **POST** /v1beta1/drives/{drive-id}/items/{item-id}/invite | Send a sharing invitation| -|[**listPermissions**](#listpermissions) | **GET** /v1beta1/drives/{drive-id}/items/{item-id}/permissions | List the effective sharing permissions on a driveItem.| -|[**setPermissionPassword**](#setpermissionpassword) | **POST** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword | Set sharing link password| -|[**updatePermission**](#updatepermission) | **PATCH** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Update sharing permission| +| [**createLink**](DrivesPermissionsApi.md#createlink) | **POST** /v1beta1/drives/{drive-id}/items/{item-id}/createLink | Create a sharing link for a DriveItem | +| [**deletePermission**](DrivesPermissionsApi.md#deletepermission) | **DELETE** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Remove access to a DriveItem | +| [**getPermission**](DrivesPermissionsApi.md#getpermission) | **GET** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Get sharing permission for a file or folder | +| [**invite**](DrivesPermissionsApi.md#invite) | **POST** /v1beta1/drives/{drive-id}/items/{item-id}/invite | Send a sharing invitation | +| [**listPermissions**](DrivesPermissionsApi.md#listpermissions) | **GET** /v1beta1/drives/{drive-id}/items/{item-id}/permissions | List the effective sharing permissions on a driveItem. | +| [**setPermissionPassword**](DrivesPermissionsApi.md#setpermissionpassword) | **POST** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword | Set sharing link password | +| [**updatePermission**](DrivesPermissionsApi.md#updatepermission) | **PATCH** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Update sharing permission | -# **createLink** -> Permission createLink() + + +## createLink + +> Permission createLink(driveId, itemId, driveItemCreateLink) + +Create a sharing link for a DriveItem You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | ### Example -```typescript +```ts import { - DrivesPermissionsApi, - Configuration, - DriveItemCreateLink -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesPermissionsApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let driveItemCreateLink: DriveItemCreateLink; //In the request body, provide a JSON object with the following parameters. (optional) - -const { status, data } = await apiInstance.createLink( - driveId, - itemId, - driveItemCreateLink -); + Configuration, + DrivesPermissionsApi, +} from ''; +import type { CreateLinkRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesPermissionsApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of item + itemId: itemId_example, + // DriveItemCreateLink | In the request body, provide a JSON object with the following parameters. (optional) + driveItemCreateLink: {"type":"view"}, + } satisfies CreateLinkRequest; + + try { + const data = await api.createLink(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveItemCreateLink** | **DriveItemCreateLink**| In the request body, provide a JSON object with the following parameters. | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **driveItemCreateLink** | [DriveItemCreateLink](DriveItemCreateLink.md) | In the request body, provide a JSON object with the following parameters. | [Optional] | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -59,58 +80,79 @@ const { status, data } = await apiInstance.createLink( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Response | - | -|**207** | Partial success response TODO | - | -|**0** | error | - | +| **200** | Response | - | +| **207** | Partial success response TODO | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePermission -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +> deletePermission(driveId, itemId, permId) -# **deletePermission** -> deletePermission() +Remove access to a DriveItem -Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. +Remove access to a DriveItem. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. ### Example -```typescript +```ts import { - DrivesPermissionsApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesPermissionsApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let permId: string; //key: id of permission (default to undefined) - -const { status, data } = await apiInstance.deletePermission( - driveId, - itemId, - permId -); + Configuration, + DrivesPermissionsApi, +} from ''; +import type { DeletePermissionRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesPermissionsApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of item + itemId: itemId_example, + // string | key: id of permission + permId: permId_example, + } satisfies DeletePermissionRequest; + + try { + const data = await api.deletePermission(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -118,57 +160,78 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPermission -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +> Permission getPermission(driveId, itemId, permId) -# **getPermission** -> Permission getPermission() +Get sharing permission for a file or folder Return the effective sharing permission for a particular permission resource. ### Example -```typescript +```ts import { - DrivesPermissionsApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesPermissionsApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let permId: string; //key: id of permission (default to undefined) - -const { status, data } = await apiInstance.getPermission( - driveId, - itemId, - permId -); + Configuration, + DrivesPermissionsApi, +} from ''; +import type { GetPermissionRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesPermissionsApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of item + itemId: itemId_example, + // string | key: id of permission + permId: permId_example, + } satisfies GetPermissionRequest; + + try { + const data = await api.getPermission(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -176,58 +239,78 @@ const { status, data } = await apiInstance.getPermission( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved resource | - | -|**0** | error | - | +| **200** | Retrieved resource | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## invite -# **invite** -> CollectionOfPermissions invite() +> CollectionOfPermissions invite(driveId, itemId, driveItemInvite) -Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. +Send a sharing invitation + +Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. ### Example -```typescript +```ts import { - DrivesPermissionsApi, - Configuration, - DriveItemInvite -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesPermissionsApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let driveItemInvite: DriveItemInvite; //In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. (optional) - -const { status, data } = await apiInstance.invite( - driveId, - itemId, - driveItemInvite -); + Configuration, + DrivesPermissionsApi, +} from ''; +import type { InviteRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesPermissionsApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of item + itemId: itemId_example, + // DriveItemInvite | In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. (optional) + driveItemInvite: {"recipients":[{"@libre.graph.recipient.type":"user","objectId":"4c510ada-c86b-4815-8820-42cdf82c3d51"}],"roles":["b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"]}, + } satisfies InviteRequest; + + try { + const data = await api.invite(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveItemInvite** | **DriveItemInvite**| In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **driveItemInvite** | [DriveItemInvite](DriveItemInvite.md) | In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. | [Optional] | ### Return type -**CollectionOfPermissions** +[**CollectionOfPermissions**](CollectionOfPermissions.md) ### Authorization @@ -235,62 +318,83 @@ const { status, data } = await apiInstance.invite( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Response | - | -|**207** | Partial success response TODO | - | -|**400** | Bad request | - | -|**0** | error | - | +| **200** | Response | - | +| **207** | Partial success response TODO | - | +| **400** | Bad request | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## listPermissions -# **listPermissions** -> CollectionOfPermissionsWithAllowedValues listPermissions() +> CollectionOfPermissionsWithAllowedValues listPermissions(driveId, itemId, $filter, $select) -The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. +List the effective sharing permissions on a driveItem. + +The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. ### Example -```typescript +```ts import { - DrivesPermissionsApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesPermissionsApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let $filter: string; //Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. (optional) (default to undefined) -let $select: Set<'@libre.graph.permissions.actions.allowedValues' | '@libre.graph.permissions.roles.allowedValues' | 'value'>; //Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. (optional) (default to undefined) - -const { status, data } = await apiInstance.listPermissions( - driveId, - itemId, - $filter, - $select -); + Configuration, + DrivesPermissionsApi, +} from ''; +import type { ListPermissionsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesPermissionsApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of item + itemId: itemId_example, + // string | Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. (optional) + $filter: @libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"')), + // Set<'@libre.graph.permissions.actions.allowedValues' | '@libre.graph.permissions.roles.allowedValues' | 'value'> | Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. (optional) + $select: ..., + } satisfies ListPermissionsRequest; + + try { + const data = await api.listPermissions(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| -| **$filter** | [**string**] | Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. | (optional) defaults to undefined| -| **$select** | **Array<'@libre.graph.permissions.actions.allowedValues' | '@libre.graph.permissions.roles.allowedValues' | 'value'>** | Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **$filter** | `string` | Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. | [Optional] [Defaults to `undefined`] | +| **$select** | `@libre.graph.permissions.actions.allowedValues`, `@libre.graph.permissions.roles.allowedValues`, `value` | Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. | [Optional] [Enum: @libre.graph.permissions.actions.allowedValues, @libre.graph.permissions.roles.allowedValues, value] | ### Return type -**CollectionOfPermissionsWithAllowedValues** +[**CollectionOfPermissionsWithAllowedValues**](CollectionOfPermissionsWithAllowedValues.md) ### Authorization @@ -298,61 +402,81 @@ const { status, data } = await apiInstance.listPermissions( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved resource | - | -|**0** | error | - | +| **200** | Retrieved resource | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **setPermissionPassword** -> Permission setPermissionPassword(sharingLinkPassword) +## setPermissionPassword -Set the password of a sharing permission. Only the `password` property can be modified this way. +> Permission setPermissionPassword(driveId, itemId, permId, sharingLinkPassword) + +Set sharing link password + +Set the password of a sharing permission. Only the `password` property can be modified this way. ### Example -```typescript +```ts import { - DrivesPermissionsApi, - Configuration, - SharingLinkPassword -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesPermissionsApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let permId: string; //key: id of permission (default to undefined) -let sharingLinkPassword: SharingLinkPassword; //New password value - -const { status, data } = await apiInstance.setPermissionPassword( - driveId, - itemId, - permId, - sharingLinkPassword -); + Configuration, + DrivesPermissionsApi, +} from ''; +import type { SetPermissionPasswordRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesPermissionsApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of item + itemId: itemId_example, + // string | key: id of permission + permId: permId_example, + // SharingLinkPassword | New password value + sharingLinkPassword: {"password":"TestPassword123!"}, + } satisfies SetPermissionPasswordRequest; + + try { + const data = await api.setPermissionPassword(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **sharingLinkPassword** | **SharingLinkPassword**| New password value | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | +| **sharingLinkPassword** | [SharingLinkPassword](SharingLinkPassword.md) | New password value | | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -360,61 +484,81 @@ const { status, data } = await apiInstance.setPermissionPassword( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Updated permission | - | -|**0** | error | - | +| **200** | Updated permission | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **updatePermission** -> Permission updatePermission(permission) +## updatePermission -Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. +> Permission updatePermission(driveId, itemId, permId, permission) + +Update sharing permission + +Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. ### Example -```typescript +```ts import { - DrivesPermissionsApi, - Configuration, - Permission -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesPermissionsApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let itemId: string; //key: id of item (default to undefined) -let permId: string; //key: id of permission (default to undefined) -let permission: Permission; //New property values - -const { status, data } = await apiInstance.updatePermission( - driveId, - itemId, - permId, - permission -); + Configuration, + DrivesPermissionsApi, +} from ''; +import type { UpdatePermissionRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesPermissionsApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of item + itemId: itemId_example, + // string | key: id of permission + permId: permId_example, + // Permission | New property values + permission: {"link":{"type":"edit"}}, + } satisfies UpdatePermissionRequest; + + try { + const data = await api.updatePermission(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **permission** | **Permission**| New property values | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **itemId** | [**string**] | key: id of item | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **itemId** | `string` | key: id of item | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | +| **permission** | [Permission](Permission.md) | New property values | | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -422,15 +566,15 @@ const { status, data } = await apiInstance.updatePermission( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Updated permission | - | -|**0** | error | - | +| **200** | Updated permission | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/DrivesRootApi.md b/web/packages/web-client/src/graph/generated/docs/DrivesRootApi.md index cd32aeaec0e..f666c0bbff2 100644 --- a/web/packages/web-client/src/graph/generated/docs/DrivesRootApi.md +++ b/web/packages/web-client/src/graph/generated/docs/DrivesRootApi.md @@ -2,55 +2,76 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**createDriveItem**](#createdriveitem) | **POST** /v1beta1/drives/{drive-id}/root/children | Create a drive item| -|[**createLinkSpaceRoot**](#createlinkspaceroot) | **POST** /v1beta1/drives/{drive-id}/root/createLink | Create a sharing link for the root item of a Drive| -|[**deletePermissionSpaceRoot**](#deletepermissionspaceroot) | **DELETE** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Remove access to a Drive| -|[**getPermissionSpaceRoot**](#getpermissionspaceroot) | **GET** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Get a single sharing permission for the root item of a drive| -|[**getRoot**](#getroot) | **GET** /v1.0/drives/{drive-id}/root | Get root from arbitrary space| -|[**inviteSpaceRoot**](#invitespaceroot) | **POST** /v1beta1/drives/{drive-id}/root/invite | Send a sharing invitation| -|[**listPermissionsSpaceRoot**](#listpermissionsspaceroot) | **GET** /v1beta1/drives/{drive-id}/root/permissions | List the effective permissions on the root item of a drive.| -|[**setPermissionPasswordSpaceRoot**](#setpermissionpasswordspaceroot) | **POST** /v1beta1/drives/{drive-id}/root/permissions/{perm-id}/setPassword | Set sharing link password for the root item of a drive| -|[**updatePermissionSpaceRoot**](#updatepermissionspaceroot) | **PATCH** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Update sharing permission| +| [**createDriveItem**](DrivesRootApi.md#createdriveitem) | **POST** /v1beta1/drives/{drive-id}/root/children | Create a drive item | +| [**createLinkSpaceRoot**](DrivesRootApi.md#createlinkspaceroot) | **POST** /v1beta1/drives/{drive-id}/root/createLink | Create a sharing link for the root item of a Drive | +| [**deletePermissionSpaceRoot**](DrivesRootApi.md#deletepermissionspaceroot) | **DELETE** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Remove access to a Drive | +| [**getPermissionSpaceRoot**](DrivesRootApi.md#getpermissionspaceroot) | **GET** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Get a single sharing permission for the root item of a drive | +| [**getRoot**](DrivesRootApi.md#getroot) | **GET** /v1.0/drives/{drive-id}/root | Get root from arbitrary space | +| [**inviteSpaceRoot**](DrivesRootApi.md#invitespaceroot) | **POST** /v1beta1/drives/{drive-id}/root/invite | Send a sharing invitation | +| [**listPermissionsSpaceRoot**](DrivesRootApi.md#listpermissionsspaceroot) | **GET** /v1beta1/drives/{drive-id}/root/permissions | List the effective permissions on the root item of a drive. | +| [**setPermissionPasswordSpaceRoot**](DrivesRootApi.md#setpermissionpasswordspaceroot) | **POST** /v1beta1/drives/{drive-id}/root/permissions/{perm-id}/setPassword | Set sharing link password for the root item of a drive | +| [**updatePermissionSpaceRoot**](DrivesRootApi.md#updatepermissionspaceroot) | **PATCH** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Update sharing permission | -# **createDriveItem** -> DriveItem createDriveItem() -You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. -### Example +## createDriveItem -```typescript -import { - DrivesRootApi, - Configuration, - DriveItem -} from './api'; +> DriveItem createDriveItem(driveId, driveItem) -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); +Create a drive item -let driveId: string; //key: id of drive (default to undefined) -let driveItem: DriveItem; //In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. (optional) +You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true. + +### Example -const { status, data } = await apiInstance.createDriveItem( - driveId, - driveItem -); +```ts +import { + Configuration, + DrivesRootApi, +} from ''; +import type { CreateDriveItemRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668, + // DriveItem | In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. (optional) + driveItem: {"name":"Einsteins project share","remoteItem":{"id":"a-storage-provider-id$a-space-id!a-node-id"}}, + } satisfies CreateDriveItemRequest; + + try { + const data = await api.createDriveItem(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveItem** | **DriveItem**| In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **driveItem** | [DriveItem](DriveItem.md) | In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint. | [Optional] | ### Return type -**DriveItem** +[**DriveItem**](DriveItem.md) ### Authorization @@ -58,55 +79,75 @@ const { status, data } = await apiInstance.createDriveItem( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Response | - | -|**0** | error | - | +| **200** | Response | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **createLinkSpaceRoot** -> Permission createLinkSpaceRoot() -You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | +## createLinkSpaceRoot -### Example +> Permission createLinkSpaceRoot(driveId, driveItemCreateLink) -```typescript -import { - DrivesRootApi, - Configuration, - DriveItemCreateLink -} from './api'; +Create a sharing link for the root item of a Drive -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); +You can use the createLink action to share a driveItem via a sharing link. The response will be a permission object with the link facet containing the created link details. ## Link types For now, The following values are allowed for the type parameter. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | -let driveId: string; //key: id of drive (default to undefined) -let driveItemCreateLink: DriveItemCreateLink; //In the request body, provide a JSON object with the following parameters. (optional) +### Example -const { status, data } = await apiInstance.createLinkSpaceRoot( - driveId, - driveItemCreateLink -); +```ts +import { + Configuration, + DrivesRootApi, +} from ''; +import type { CreateLinkSpaceRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // DriveItemCreateLink | In the request body, provide a JSON object with the following parameters. (optional) + driveItemCreateLink: {"type":"view"}, + } satisfies CreateLinkSpaceRootRequest; + + try { + const data = await api.createLinkSpaceRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveItemCreateLink** | **DriveItemCreateLink**| In the request body, provide a JSON object with the following parameters. | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **driveItemCreateLink** | [DriveItemCreateLink](DriveItemCreateLink.md) | In the request body, provide a JSON object with the following parameters. | [Optional] | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -114,55 +155,76 @@ const { status, data } = await apiInstance.createLinkSpaceRoot( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Response | - | -|**207** | Partial success response TODO | - | -|**0** | error | - | +| **200** | Response | - | +| **207** | Partial success response TODO | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **deletePermissionSpaceRoot** -> deletePermissionSpaceRoot() -Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. +## deletePermissionSpaceRoot -### Example +> deletePermissionSpaceRoot(driveId, permId) -```typescript -import { - DrivesRootApi, - Configuration -} from './api'; +Remove access to a Drive -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); +Remove access to the root item of a drive. Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`. -let driveId: string; //key: id of drive (default to undefined) -let permId: string; //key: id of permission (default to undefined) +### Example -const { status, data } = await apiInstance.deletePermissionSpaceRoot( - driveId, - permId -); +```ts +import { + Configuration, + DrivesRootApi, +} from ''; +import type { DeletePermissionSpaceRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of permission + permId: permId_example, + } satisfies DeletePermissionSpaceRootRequest; + + try { + const data = await api.deletePermissionSpaceRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -170,54 +232,75 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **getPermissionSpaceRoot** -> Permission getPermissionSpaceRoot() -Return the effective sharing permission for a particular permission resource. +## getPermissionSpaceRoot -### Example +> Permission getPermissionSpaceRoot(driveId, permId) -```typescript -import { - DrivesRootApi, - Configuration -} from './api'; +Get a single sharing permission for the root item of a drive -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); +Return the effective sharing permission for a particular permission resource. -let driveId: string; //key: id of drive (default to undefined) -let permId: string; //key: id of permission (default to undefined) +### Example -const { status, data } = await apiInstance.getPermissionSpaceRoot( - driveId, - permId -); +```ts +import { + Configuration, + DrivesRootApi, +} from ''; +import type { GetPermissionSpaceRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of permission + permId: permId_example, + } satisfies GetPermissionSpaceRootRequest; + + try { + const data = await api.getPermissionSpaceRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -225,50 +308,70 @@ const { status, data } = await apiInstance.getPermissionSpaceRoot( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved resource | - | -|**0** | error | - | +| **200** | Retrieved resource | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **getRoot** -> DriveItem getRoot() +## getRoot -### Example - -```typescript -import { - DrivesRootApi, - Configuration -} from './api'; +> DriveItem getRoot(driveId) -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); +Get root from arbitrary space -let driveId: string; //key: id of drive (default to undefined) +### Example -const { status, data } = await apiInstance.getRoot( - driveId -); +```ts +import { + Configuration, + DrivesRootApi, +} from ''; +import type { GetRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + } satisfies GetRootRequest; + + try { + const data = await api.getRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | ### Return type -**DriveItem** +[**DriveItem**](DriveItem.md) ### Authorization @@ -276,55 +379,75 @@ const { status, data } = await apiInstance.getRoot( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved resource | - | -|**0** | error | - | +| **200** | Retrieved resource | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **inviteSpaceRoot** -> CollectionOfPermissions inviteSpaceRoot() -Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. +## inviteSpaceRoot -### Example +> CollectionOfPermissions inviteSpaceRoot(driveId, driveItemInvite) -```typescript -import { - DrivesRootApi, - Configuration, - DriveItemInvite -} from './api'; +Send a sharing invitation -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); +Sends a sharing invitation for the root of a `drive`. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. The response will be a permission object with the grantedToV2 property containing the created grant details. ## Roles property values For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized. -let driveId: string; //key: id of drive (default to undefined) -let driveItemInvite: DriveItemInvite; //In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. (optional) +### Example -const { status, data } = await apiInstance.inviteSpaceRoot( - driveId, - driveItemInvite -); +```ts +import { + Configuration, + DrivesRootApi, +} from ''; +import type { InviteSpaceRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // DriveItemInvite | In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. (optional) + driveItemInvite: {"recipients":[{"@libre.graph.recipient.type":"user","objectId":"4c510ada-c86b-4815-8820-42cdf82c3d51"}],"roles":["b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"]}, + } satisfies InviteSpaceRootRequest; + + try { + const data = await api.inviteSpaceRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveItemInvite** | **DriveItemInvite**| In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **driveItemInvite** | [DriveItemInvite](DriveItemInvite.md) | In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles. | [Optional] | ### Return type -**CollectionOfPermissions** +[**CollectionOfPermissions**](CollectionOfPermissions.md) ### Authorization @@ -332,59 +455,80 @@ const { status, data } = await apiInstance.inviteSpaceRoot( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Response | - | -|**207** | Partial success response TODO | - | -|**400** | Bad request | - | -|**0** | error | - | +| **200** | Response | - | +| **207** | Partial success response TODO | - | +| **400** | Bad request | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **listPermissionsSpaceRoot** -> CollectionOfPermissionsWithAllowedValues listPermissionsSpaceRoot() +## listPermissionsSpaceRoot -The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. +> CollectionOfPermissionsWithAllowedValues listPermissionsSpaceRoot(driveId, $filter, $select) + +List the effective permissions on the root item of a drive. + +The permissions collection includes potentially sensitive information and may not be available for every caller. * For the owner of the item, all sharing permissions will be returned. This includes co-owners. * For a non-owner caller, only the sharing permissions that apply to the caller are returned. * Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission. All permission objects have an `id`. A permission representing * a link has the `link` facet filled with details. * a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details. ### Example -```typescript +```ts import { - DrivesRootApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let $filter: string; //Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. (optional) (default to undefined) -let $select: Set<'@libre.graph.permissions.actions.allowedValues' | '@libre.graph.permissions.roles.allowedValues' | 'value'>; //Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. (optional) (default to undefined) - -const { status, data } = await apiInstance.listPermissionsSpaceRoot( - driveId, - $filter, - $select -); + Configuration, + DrivesRootApi, +} from ''; +import type { ListPermissionsSpaceRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. (optional) + $filter: @libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"')), + // Set<'@libre.graph.permissions.actions.allowedValues' | '@libre.graph.permissions.roles.allowedValues' | 'value'> | Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. (optional) + $select: ..., + } satisfies ListPermissionsSpaceRootRequest; + + try { + const data = await api.listPermissionsSpaceRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **$filter** | [**string**] | Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. | (optional) defaults to undefined| -| **$select** | **Array<'@libre.graph.permissions.actions.allowedValues' | '@libre.graph.permissions.roles.allowedValues' | 'value'>** | Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **$filter** | `string` | Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions. | [Optional] [Defaults to `undefined`] | +| **$select** | `@libre.graph.permissions.actions.allowedValues`, `@libre.graph.permissions.roles.allowedValues`, `value` | Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users. | [Optional] [Enum: @libre.graph.permissions.actions.allowedValues, @libre.graph.permissions.roles.allowedValues, value] | ### Return type -**CollectionOfPermissionsWithAllowedValues** +[**CollectionOfPermissionsWithAllowedValues**](CollectionOfPermissionsWithAllowedValues.md) ### Authorization @@ -392,58 +536,78 @@ const { status, data } = await apiInstance.listPermissionsSpaceRoot( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved resource | - | -|**0** | error | - | +| **200** | Retrieved resource | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## setPermissionPasswordSpaceRoot -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +> Permission setPermissionPasswordSpaceRoot(driveId, permId, sharingLinkPassword) -# **setPermissionPasswordSpaceRoot** -> Permission setPermissionPasswordSpaceRoot(sharingLinkPassword) +Set sharing link password for the root item of a drive -Set the password of a sharing permission. Only the `password` property can be modified this way. +Set the password of a sharing permission. Only the `password` property can be modified this way. ### Example -```typescript +```ts import { - DrivesRootApi, - Configuration, - SharingLinkPassword -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let permId: string; //key: id of permission (default to undefined) -let sharingLinkPassword: SharingLinkPassword; //New password value - -const { status, data } = await apiInstance.setPermissionPasswordSpaceRoot( - driveId, - permId, - sharingLinkPassword -); + Configuration, + DrivesRootApi, +} from ''; +import type { SetPermissionPasswordSpaceRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of permission + permId: permId_example, + // SharingLinkPassword | New password value + sharingLinkPassword: {"password":"TestPassword123!"}, + } satisfies SetPermissionPasswordSpaceRootRequest; + + try { + const data = await api.setPermissionPasswordSpaceRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **sharingLinkPassword** | **SharingLinkPassword**| New password value | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | +| **sharingLinkPassword** | [SharingLinkPassword](SharingLinkPassword.md) | New password value | | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -451,58 +615,78 @@ const { status, data } = await apiInstance.setPermissionPasswordSpaceRoot( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Updated permission | - | -|**0** | error | - | +| **200** | Updated permission | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## updatePermissionSpaceRoot -# **updatePermissionSpaceRoot** -> Permission updatePermissionSpaceRoot(permission) +> Permission updatePermissionSpaceRoot(driveId, permId, permission) -Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. +Update sharing permission + +Update the properties of a sharing permission by patching the permission resource. Only the `roles`, `expirationDateTime` and `password` properties can be modified this way. ### Example -```typescript +```ts import { - DrivesRootApi, - Configuration, - Permission -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new DrivesRootApi(configuration); - -let driveId: string; //key: id of drive (default to undefined) -let permId: string; //key: id of permission (default to undefined) -let permission: Permission; //New property values - -const { status, data } = await apiInstance.updatePermissionSpaceRoot( - driveId, - permId, - permission -); + Configuration, + DrivesRootApi, +} from ''; +import type { UpdatePermissionSpaceRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new DrivesRootApi(config); + + const body = { + // string | key: id of drive + driveId: driveId_example, + // string | key: id of permission + permId: permId_example, + // Permission | New property values + permission: {"link":{"type":"edit"}}, + } satisfies UpdatePermissionSpaceRootRequest; + + try { + const data = await api.updatePermissionSpaceRoot(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **permission** | **Permission**| New property values | | -| **driveId** | [**string**] | key: id of drive | defaults to undefined| -| **permId** | [**string**] | key: id of permission | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **driveId** | `string` | key: id of drive | [Defaults to `undefined`] | +| **permId** | `string` | key: id of permission | [Defaults to `undefined`] | +| **permission** | [Permission](Permission.md) | New property values | | ### Return type -**Permission** +[**Permission**](Permission.md) ### Authorization @@ -510,15 +694,15 @@ const { status, data } = await apiInstance.updatePermissionSpaceRoot( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Updated permission | - | -|**0** | error | - | +| **200** | Updated permission | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/EducationClass.md b/web/packages/web-client/src/graph/generated/docs/EducationClass.md index 8e42b8200f3..64989a4299b 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationClass.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationClass.md @@ -1,33 +1,47 @@ + # EducationClass And extension of group representing a class or course ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Read-only. | [optional] [readonly] [default to undefined] -**description** | **string** | An optional description for the group. Returned by default. | [optional] [default to undefined] -**displayName** | **string** | The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy. | [optional] [default to undefined] -**members** | [**Array<User>**](User.md) | Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand. | [optional] [default to undefined] -**membersodata_bind** | **Set<string>** | A list of member references to the members to be added. Up to 20 members can be added with a single request | [optional] [default to undefined] -**classification** | **string** | Classification of the group, i.e. \"class\" or \"course\" | [optional] [default to undefined] -**externalId** | **string** | An external unique ID for the class | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`description` | string +`displayName` | string +`members` | [Array<User>](User.md) +`membersodataBind` | Set<string> +`classification` | string +`externalId` | string ## Example ```typescript -import { EducationClass } from './api'; - -const instance: EducationClass = { - id, - description, - displayName, - members, - membersodata_bind, - classification, - externalId, -}; +import type { EducationClass } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "description": null, + "displayName": null, + "members": null, + "membersodataBind": null, + "classification": null, + "externalId": null, +} satisfies EducationClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EducationClass +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/EducationClassApi.md b/web/packages/web-client/src/graph/generated/docs/EducationClassApi.md index 07c326e5fe5..e46495b4821 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationClassApi.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationClassApi.md @@ -2,53 +2,72 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**addUserToClass**](#addusertoclass) | **POST** /v1.0/education/classes/{class-id}/members/$ref | Assign a user to a class| -|[**createClass**](#createclass) | **POST** /v1.0/education/classes | Add new education class| -|[**deleteClass**](#deleteclass) | **DELETE** /v1.0/education/classes/{class-id} | Delete education class| -|[**deleteUserFromClass**](#deleteuserfromclass) | **DELETE** /v1.0/education/classes/{class-id}/members/{user-id}/$ref | Unassign user from a class| -|[**getClass**](#getclass) | **GET** /v1.0/education/classes/{class-id} | Get class by key| -|[**listClassMembers**](#listclassmembers) | **GET** /v1.0/education/classes/{class-id}/members | Get the educationClass resources owned by an educationSchool| -|[**listClasses**](#listclasses) | **GET** /v1.0/education/classes | list education classes| -|[**updateClass**](#updateclass) | **PATCH** /v1.0/education/classes/{class-id} | Update properties of a education class| +| [**addUserToClass**](EducationClassApi.md#addusertoclass) | **POST** /v1.0/education/classes/{class-id}/members/$ref | Assign a user to a class | +| [**createClass**](EducationClassApi.md#createclass) | **POST** /v1.0/education/classes | Add new education class | +| [**deleteClass**](EducationClassApi.md#deleteclass) | **DELETE** /v1.0/education/classes/{class-id} | Delete education class | +| [**deleteUserFromClass**](EducationClassApi.md#deleteuserfromclass) | **DELETE** /v1.0/education/classes/{class-id}/members/{user-id}/$ref | Unassign user from a class | +| [**getClass**](EducationClassApi.md#getclass) | **GET** /v1.0/education/classes/{class-id} | Get class by key | +| [**listClassMembers**](EducationClassApi.md#listclassmembers) | **GET** /v1.0/education/classes/{class-id}/members | Get the educationClass resources owned by an educationSchool | +| [**listClasses**](EducationClassApi.md#listclasses) | **GET** /v1.0/education/classes | list education classes | +| [**updateClass**](EducationClassApi.md#updateclass) | **PATCH** /v1.0/education/classes/{class-id} | Update properties of a education class | -# **addUserToClass** -> addUserToClass(classMemberReference) -### Example +## addUserToClass -```typescript -import { - EducationClassApi, - Configuration, - ClassMemberReference -} from './api'; +> addUserToClass(classId, classMemberReference) -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); +Assign a user to a class -let classId: string; //key: id or externalId of class (default to undefined) -let classMemberReference: ClassMemberReference; //educationUser to be added as member +### Example -const { status, data } = await apiInstance.addUserToClass( - classId, - classMemberReference -); +```ts +import { + Configuration, + EducationClassApi, +} from ''; +import type { AddUserToClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + const body = { + // string | key: id or externalId of class + classId: 86948e45-96a6-43df-b83d-46e92afd30de, + // ClassMemberReference | educationUser to be added as member + classMemberReference: ..., + } satisfies AddUserToClassRequest; + + try { + const data = await api.addUserToClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classMemberReference** | **ClassMemberReference**| educationUser to be added as member | | -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | +| **classMemberReference** | [ClassMemberReference](ClassMemberReference.md) | educationUser to be added as member | | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -56,51 +75,69 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **createClass** +## createClass + > EducationClass createClass(educationClass) +Add new education class ### Example -```typescript +```ts import { - EducationClassApi, - Configuration, - EducationClass -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); - -let educationClass: EducationClass; //New entity - -const { status, data } = await apiInstance.createClass( - educationClass -); + Configuration, + EducationClassApi, +} from ''; +import type { CreateClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + const body = { + // EducationClass | New entity + educationClass: ..., + } satisfies CreateClassRequest; + + try { + const data = await api.createClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **educationClass** | **EducationClass**| New entity | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **educationClass** | [EducationClass](EducationClass.md) | New entity | | ### Return type -**EducationClass** +[**EducationClass**](EducationClass.md) ### Authorization @@ -108,50 +145,69 @@ const { status, data } = await apiInstance.createClass( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**201** | Created entity | - | -|**0** | error | - | +| **201** | Created entity | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **deleteClass** -> deleteClass() +## deleteClass -### Example - -```typescript -import { - EducationClassApi, - Configuration -} from './api'; +> deleteClass(classId) -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); +Delete education class -let classId: string; //key: id or externalId of class (default to undefined) +### Example -const { status, data } = await apiInstance.deleteClass( - classId -); +```ts +import { + Configuration, + EducationClassApi, +} from ''; +import type { DeleteClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + const body = { + // string | key: id or externalId of class + classId: 86948e45-96a6-43df-b83d-46e92afd30de, + } satisfies DeleteClassRequest; + + try { + const data = await api.deleteClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -159,53 +215,72 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **deleteUserFromClass** -> deleteUserFromClass() +## deleteUserFromClass -### Example - -```typescript -import { - EducationClassApi, - Configuration -} from './api'; +> deleteUserFromClass(classId, userId) -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); +Unassign user from a class -let classId: string; //key: id or externalId of class (default to undefined) -let userId: string; //key: id or username of the user to unassign from class (default to undefined) +### Example -const { status, data } = await apiInstance.deleteUserFromClass( - classId, - userId -); +```ts +import { + Configuration, + EducationClassApi, +} from ''; +import type { DeleteUserFromClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + const body = { + // string | key: id or externalId of class + classId: classId_example, + // string | key: id or username of the user to unassign from class + userId: 90eedea1-dea1-90ee-a1de-ee90a1deee90, + } satisfies DeleteUserFromClassRequest; + + try { + const data = await api.deleteUserFromClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| -| **userId** | [**string**] | key: id or username of the user to unassign from class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | +| **userId** | `string` | key: id or username of the user to unassign from class | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -213,50 +288,69 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **204** | Success | - | +| **0** | error | - | -# **getClass** -> EducationClass getClass() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## getClass -```typescript -import { - EducationClassApi, - Configuration -} from './api'; +> EducationClass getClass(classId) -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); +Get class by key -let classId: string; //key: id or externalId of class (default to undefined) +### Example -const { status, data } = await apiInstance.getClass( - classId -); +```ts +import { + Configuration, + EducationClassApi, +} from ''; +import type { GetClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + const body = { + // string | key: id or externalId of class + classId: 86948e45-96a6-43df-b83d-46e92afd30de, + } satisfies GetClassRequest; + + try { + const data = await api.getClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | ### Return type -**EducationClass** +[**EducationClass**](EducationClass.md) ### Authorization @@ -264,50 +358,69 @@ const { status, data } = await apiInstance.getClass( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entity | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **200** | Retrieved entity | - | +| **0** | error | - | -# **listClassMembers** -> CollectionOfEducationUser listClassMembers() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## listClassMembers -```typescript -import { - EducationClassApi, - Configuration -} from './api'; +> CollectionOfEducationUser listClassMembers(classId) -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); +Get the educationClass resources owned by an educationSchool -let classId: string; //key: id or externalId of class (default to undefined) +### Example -const { status, data } = await apiInstance.listClassMembers( - classId -); +```ts +import { + Configuration, + EducationClassApi, +} from ''; +import type { ListClassMembersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + const body = { + // string | key: id or externalId of class + classId: 86948e45-96a6-43df-b83d-46e92afd30de, + } satisfies ListClassMembersRequest; + + try { + const data = await api.listClassMembers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | ### Return type -**CollectionOfEducationUser** +[**CollectionOfEducationUser**](CollectionOfEducationUser.md) ### Authorization @@ -315,43 +428,61 @@ const { status, data } = await apiInstance.listClassMembers( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved class members | - | -|**0** | error | - | +| **200** | Retrieved class members | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## listClasses -# **listClasses** > CollectionOfClass listClasses() +list education classes ### Example -```typescript +```ts import { - EducationClassApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); - -const { status, data } = await apiInstance.listClasses(); + Configuration, + EducationClassApi, +} from ''; +import type { ListClassesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + try { + const data = await api.listClasses(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**CollectionOfClass** +[**CollectionOfClass**](CollectionOfClass.md) ### Authorization @@ -359,54 +490,72 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entities | - | -|**0** | error | - | +| **200** | Retrieved entities | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **updateClass** -> EducationClass updateClass(educationClass) +## updateClass -### Example +> EducationClass updateClass(classId, educationClass) -```typescript -import { - EducationClassApi, - Configuration, - EducationClass -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new EducationClassApi(configuration); +Update properties of a education class -let classId: string; //key: id or externalId of class (default to undefined) -let educationClass: EducationClass; //New property values +### Example -const { status, data } = await apiInstance.updateClass( - classId, - educationClass -); +```ts +import { + Configuration, + EducationClassApi, +} from ''; +import type { UpdateClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassApi(config); + + const body = { + // string | key: id or externalId of class + classId: 86948e45-96a6-43df-b83d-46e92afd30de, + // EducationClass | New property values + educationClass: {"displayName":"Musik"}, + } satisfies UpdateClassRequest; + + try { + const data = await api.updateClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **educationClass** | **EducationClass**| New property values | | -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | +| **educationClass** | [EducationClass](EducationClass.md) | New property values | | ### Return type -**EducationClass** +[**EducationClass**](EducationClass.md) ### Authorization @@ -414,16 +563,16 @@ const { status, data } = await apiInstance.updateClass( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | New property values | - | -|**204** | Success | - | -|**0** | error | - | +| **200** | New property values | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/EducationClassTeachersApi.md b/web/packages/web-client/src/graph/generated/docs/EducationClassTeachersApi.md index c9610b8b08b..55753d9d6e2 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationClassTeachersApi.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationClassTeachersApi.md @@ -2,48 +2,67 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**addTeacherToClass**](#addteachertoclass) | **POST** /v1.0/education/classes/{class-id}/teachers/$ref | Assign a teacher to a class| -|[**deleteTeacherFromClass**](#deleteteacherfromclass) | **DELETE** /v1.0/education/classes/{class-id}/teachers/{user-id}/$ref | Unassign user as teacher of a class| -|[**getTeachers**](#getteachers) | **GET** /v1.0/education/classes/{class-id}/teachers | Get the teachers for a class| +| [**addTeacherToClass**](EducationClassTeachersApi.md#addteachertoclass) | **POST** /v1.0/education/classes/{class-id}/teachers/$ref | Assign a teacher to a class | +| [**deleteTeacherFromClass**](EducationClassTeachersApi.md#deleteteacherfromclass) | **DELETE** /v1.0/education/classes/{class-id}/teachers/{user-id}/$ref | Unassign user as teacher of a class | +| [**getTeachers**](EducationClassTeachersApi.md#getteachers) | **GET** /v1.0/education/classes/{class-id}/teachers | Get the teachers for a class | -# **addTeacherToClass** -> addTeacherToClass(classTeacherReference) -### Example +## addTeacherToClass -```typescript -import { - EducationClassTeachersApi, - Configuration, - ClassTeacherReference -} from './api'; +> addTeacherToClass(classId, classTeacherReference) -const configuration = new Configuration(); -const apiInstance = new EducationClassTeachersApi(configuration); +Assign a teacher to a class -let classId: string; //key: id or externalId of class (default to undefined) -let classTeacherReference: ClassTeacherReference; //educationUser to be added as teacher +### Example -const { status, data } = await apiInstance.addTeacherToClass( - classId, - classTeacherReference -); +```ts +import { + Configuration, + EducationClassTeachersApi, +} from ''; +import type { AddTeacherToClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassTeachersApi(config); + + const body = { + // string | key: id or externalId of class + classId: 86948e45-96a6-43df-b83d-46e92afd30de, + // ClassTeacherReference | educationUser to be added as teacher + classTeacherReference: ..., + } satisfies AddTeacherToClassRequest; + + try { + const data = await api.addTeacherToClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classTeacherReference** | **ClassTeacherReference**| educationUser to be added as teacher | | -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | +| **classTeacherReference** | [ClassTeacherReference](ClassTeacherReference.md) | educationUser to be added as teacher | | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -51,53 +70,72 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **deleteTeacherFromClass** -> deleteTeacherFromClass() +## deleteTeacherFromClass -### Example +> deleteTeacherFromClass(classId, userId) -```typescript -import { - EducationClassTeachersApi, - Configuration -} from './api'; +Unassign user as teacher of a class -const configuration = new Configuration(); -const apiInstance = new EducationClassTeachersApi(configuration); - -let classId: string; //key: id or externalId of class (default to undefined) -let userId: string; //key: id or username of the user to unassign as teacher (default to undefined) +### Example -const { status, data } = await apiInstance.deleteTeacherFromClass( - classId, - userId -); +```ts +import { + Configuration, + EducationClassTeachersApi, +} from ''; +import type { DeleteTeacherFromClassRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassTeachersApi(config); + + const body = { + // string | key: id or externalId of class + classId: classId_example, + // string | key: id or username of the user to unassign as teacher + userId: 90eedea1-dea1-90ee-a1de-ee90a1deee90, + } satisfies DeleteTeacherFromClassRequest; + + try { + const data = await api.deleteTeacherFromClass(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| -| **userId** | [**string**] | key: id or username of the user to unassign as teacher | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | +| **userId** | `string` | key: id or username of the user to unassign as teacher | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -105,50 +143,69 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **getTeachers** -> CollectionOfEducationUser getTeachers() +## getTeachers -### Example - -```typescript -import { - EducationClassTeachersApi, - Configuration -} from './api'; +> CollectionOfEducationUser getTeachers(classId) -const configuration = new Configuration(); -const apiInstance = new EducationClassTeachersApi(configuration); +Get the teachers for a class -let classId: string; //key: id or externalId of class (default to undefined) +### Example -const { status, data } = await apiInstance.getTeachers( - classId -); +```ts +import { + Configuration, + EducationClassTeachersApi, +} from ''; +import type { GetTeachersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationClassTeachersApi(config); + + const body = { + // string | key: id or externalId of class + classId: 86948e45-96a6-43df-b83d-46e92afd30de, + } satisfies GetTeachersRequest; + + try { + const data = await api.getTeachers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classId** | [**string**] | key: id or externalId of class | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **classId** | `string` | key: id or externalId of class | [Defaults to `undefined`] | ### Return type -**CollectionOfEducationUser** +[**CollectionOfEducationUser**](CollectionOfEducationUser.md) ### Authorization @@ -156,15 +213,15 @@ const { status, data } = await apiInstance.getTeachers( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved class teachers | - | -|**0** | error | - | +| **200** | Retrieved class teachers | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/EducationSchool.md b/web/packages/web-client/src/graph/generated/docs/EducationSchool.md index 13d3f71cfcf..a0f7f28b5ea 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationSchool.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationSchool.md @@ -1,27 +1,41 @@ + # EducationSchool Represents a school ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The unique identifier for an entity. Read-only. | [optional] [readonly] [default to undefined] -**displayName** | **string** | The organization name | [optional] [default to undefined] -**schoolNumber** | **string** | School number | [optional] [default to undefined] -**terminationDate** | **string** | Date and time at which the service for this organization is scheduled to be terminated | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`displayName` | string +`schoolNumber` | string +`terminationDate` | Date ## Example ```typescript -import { EducationSchool } from './api'; - -const instance: EducationSchool = { - id, - displayName, - schoolNumber, - terminationDate, -}; +import type { EducationSchool } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "displayName": null, + "schoolNumber": null, + "terminationDate": null, +} satisfies EducationSchool + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EducationSchool +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/EducationSchoolApi.md b/web/packages/web-client/src/graph/generated/docs/EducationSchoolApi.md index 0a840576c92..3ebb2df68bc 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationSchoolApi.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationSchoolApi.md @@ -2,56 +2,75 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**addClassToSchool**](#addclasstoschool) | **POST** /v1.0/education/schools/{school-id}/classes/$ref | Assign a class to a school| -|[**addUserToSchool**](#addusertoschool) | **POST** /v1.0/education/schools/{school-id}/users/$ref | Assign a user to a school| -|[**createSchool**](#createschool) | **POST** /v1.0/education/schools | Add new school| -|[**deleteClassFromSchool**](#deleteclassfromschool) | **DELETE** /v1.0/education/schools/{school-id}/classes/{class-id}/$ref | Unassign class from a school| -|[**deleteSchool**](#deleteschool) | **DELETE** /v1.0/education/schools/{school-id} | Delete school| -|[**deleteUserFromSchool**](#deleteuserfromschool) | **DELETE** /v1.0/education/schools/{school-id}/users/{user-id}/$ref | Unassign user from a school| -|[**getSchool**](#getschool) | **GET** /v1.0/education/schools/{school-id} | Get the properties of a specific school| -|[**listSchoolClasses**](#listschoolclasses) | **GET** /v1.0/education/schools/{school-id}/classes | Get the educationClass resources owned by an educationSchool| -|[**listSchoolUsers**](#listschoolusers) | **GET** /v1.0/education/schools/{school-id}/users | Get the educationUser resources associated with an educationSchool| -|[**listSchools**](#listschools) | **GET** /v1.0/education/schools | Get a list of schools and their properties| -|[**updateSchool**](#updateschool) | **PATCH** /v1.0/education/schools/{school-id} | Update properties of a school| - -# **addClassToSchool** -> addClassToSchool(classReference) +| [**addClassToSchool**](EducationSchoolApi.md#addclasstoschool) | **POST** /v1.0/education/schools/{school-id}/classes/$ref | Assign a class to a school | +| [**addUserToSchool**](EducationSchoolApi.md#addusertoschool) | **POST** /v1.0/education/schools/{school-id}/users/$ref | Assign a user to a school | +| [**createSchool**](EducationSchoolApi.md#createschool) | **POST** /v1.0/education/schools | Add new school | +| [**deleteClassFromSchool**](EducationSchoolApi.md#deleteclassfromschool) | **DELETE** /v1.0/education/schools/{school-id}/classes/{class-id}/$ref | Unassign class from a school | +| [**deleteSchool**](EducationSchoolApi.md#deleteschool) | **DELETE** /v1.0/education/schools/{school-id} | Delete school | +| [**deleteUserFromSchool**](EducationSchoolApi.md#deleteuserfromschool) | **DELETE** /v1.0/education/schools/{school-id}/users/{user-id}/$ref | Unassign user from a school | +| [**getSchool**](EducationSchoolApi.md#getschool) | **GET** /v1.0/education/schools/{school-id} | Get the properties of a specific school | +| [**listSchoolClasses**](EducationSchoolApi.md#listschoolclasses) | **GET** /v1.0/education/schools/{school-id}/classes | Get the educationClass resources owned by an educationSchool | +| [**listSchoolUsers**](EducationSchoolApi.md#listschoolusers) | **GET** /v1.0/education/schools/{school-id}/users | Get the educationUser resources associated with an educationSchool | +| [**listSchools**](EducationSchoolApi.md#listschools) | **GET** /v1.0/education/schools | Get a list of schools and their properties | +| [**updateSchool**](EducationSchoolApi.md#updateschool) | **PATCH** /v1.0/education/schools/{school-id} | Update properties of a school | -### Example -```typescript -import { - EducationSchoolApi, - Configuration, - ClassReference -} from './api'; +## addClassToSchool -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +> addClassToSchool(schoolId, classReference) -let schoolId: string; //key: id or schoolNumber of school (default to undefined) -let classReference: ClassReference; //educationClass to be added as member +Assign a class to a school -const { status, data } = await apiInstance.addClassToSchool( - schoolId, - classReference -); +### Example + +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { AddClassToSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + // ClassReference | educationClass to be added as member + classReference: ..., + } satisfies AddClassToSchoolRequest; + + try { + const data = await api.addClassToSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **classReference** | **ClassReference**| educationClass to be added as member | | -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | +| **classReference** | [ClassReference](ClassReference.md) | educationClass to be added as member | | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -59,54 +78,72 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **addUserToSchool** -> addUserToSchool(educationUserReference) +## addUserToSchool -### Example - -```typescript -import { - EducationSchoolApi, - Configuration, - EducationUserReference -} from './api'; +> addUserToSchool(schoolId, educationUserReference) -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +Assign a user to a school -let schoolId: string; //key: id or schoolNumber of school (default to undefined) -let educationUserReference: EducationUserReference; //educationUser to be added as member +### Example -const { status, data } = await apiInstance.addUserToSchool( - schoolId, - educationUserReference -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { AddUserToSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + // EducationUserReference | educationUser to be added as member + educationUserReference: ..., + } satisfies AddUserToSchoolRequest; + + try { + const data = await api.addUserToSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **educationUserReference** | **EducationUserReference**| educationUser to be added as member | | -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | +| **educationUserReference** | [EducationUserReference](EducationUserReference.md) | educationUser to be added as member | | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -114,51 +151,69 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **createSchool** +## createSchool + > EducationSchool createSchool(educationSchool) +Add new school ### Example -```typescript +```ts import { - EducationSchoolApi, - Configuration, - EducationSchool -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); - -let educationSchool: EducationSchool; //New school - -const { status, data } = await apiInstance.createSchool( - educationSchool -); + Configuration, + EducationSchoolApi, +} from ''; +import type { CreateSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // EducationSchool | New school + educationSchool: ..., + } satisfies CreateSchoolRequest; + + try { + const data = await api.createSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **educationSchool** | **EducationSchool**| New school | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **educationSchool** | [EducationSchool](EducationSchool.md) | New school | | ### Return type -**EducationSchool** +[**EducationSchool**](EducationSchool.md) ### Authorization @@ -166,53 +221,72 @@ const { status, data } = await apiInstance.createSchool( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**201** | Created entity | - | -|**0** | error | - | +| **201** | Created entity | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **deleteClassFromSchool** -> deleteClassFromSchool() +## deleteClassFromSchool -### Example - -```typescript -import { - EducationSchoolApi, - Configuration -} from './api'; +> deleteClassFromSchool(schoolId, classId) -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +Unassign class from a school -let schoolId: string; //key: id or schoolNumber of school (default to undefined) -let classId: string; //key: id or externalId of the class to unassign from school (default to undefined) +### Example -const { status, data } = await apiInstance.deleteClassFromSchool( - schoolId, - classId -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { DeleteClassFromSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + // string | key: id or externalId of the class to unassign from school + classId: 7e84a069-f374-479b-817d-71590117d443, + } satisfies DeleteClassFromSchoolRequest; + + try { + const data = await api.deleteClassFromSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| -| **classId** | [**string**] | key: id or externalId of the class to unassign from school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | +| **classId** | `string` | key: id or externalId of the class to unassign from school | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -220,51 +294,71 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **deleteSchool** -> deleteSchool() -Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. +## deleteSchool -### Example +> deleteSchool(schoolId) -```typescript -import { - EducationSchoolApi, - Configuration -} from './api'; +Delete school -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +Deletes a school. A school can only be delete if it has the terminationDate property set. And if that termination Date is in the past. -let schoolId: string; //key: id or schoolNumber of school (default to undefined) +### Example -const { status, data } = await apiInstance.deleteSchool( - schoolId -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { DeleteSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + } satisfies DeleteSchoolRequest; + + try { + const data = await api.deleteSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -272,53 +366,72 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **deleteUserFromSchool** -> deleteUserFromSchool() +## deleteUserFromSchool -### Example +> deleteUserFromSchool(schoolId, userId) -```typescript -import { - EducationSchoolApi, - Configuration -} from './api'; +Unassign user from a school -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); - -let schoolId: string; //key: id or schoolNumber of school (default to undefined) -let userId: string; //key: id or username of the user to unassign from school (default to undefined) +### Example -const { status, data } = await apiInstance.deleteUserFromSchool( - schoolId, - userId -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { DeleteUserFromSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + // string | key: id or username of the user to unassign from school + userId: 90eedea1-dea1-90ee-a1de-ee90a1deee90, + } satisfies DeleteUserFromSchoolRequest; + + try { + const data = await api.deleteUserFromSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| -| **userId** | [**string**] | key: id or username of the user to unassign from school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | +| **userId** | `string` | key: id or username of the user to unassign from school | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -326,50 +439,69 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **getSchool** -> EducationSchool getSchool() +## getSchool -### Example - -```typescript -import { - EducationSchoolApi, - Configuration -} from './api'; +> EducationSchool getSchool(schoolId) -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +Get the properties of a specific school -let schoolId: string; //key: id or schoolNumber of school (default to undefined) +### Example -const { status, data } = await apiInstance.getSchool( - schoolId -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { GetSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + } satisfies GetSchoolRequest; + + try { + const data = await api.getSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | ### Return type -**EducationSchool** +[**EducationSchool**](EducationSchool.md) ### Authorization @@ -377,50 +509,69 @@ const { status, data } = await apiInstance.getSchool( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entity | - | -|**0** | error | - | +| **200** | Retrieved entity | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **listSchoolClasses** -> CollectionOfEducationClass listSchoolClasses() +## listSchoolClasses -### Example - -```typescript -import { - EducationSchoolApi, - Configuration -} from './api'; +> CollectionOfEducationClass listSchoolClasses(schoolId) -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +Get the educationClass resources owned by an educationSchool -let schoolId: string; //key: id or schoolNumber of school (default to undefined) +### Example -const { status, data } = await apiInstance.listSchoolClasses( - schoolId -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { ListSchoolClassesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + } satisfies ListSchoolClassesRequest; + + try { + const data = await api.listSchoolClasses(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | ### Return type -**CollectionOfEducationClass** +[**CollectionOfEducationClass**](CollectionOfEducationClass.md) ### Authorization @@ -428,50 +579,69 @@ const { status, data } = await apiInstance.listSchoolClasses( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved classes | - | -|**0** | error | - | +| **200** | Retrieved classes | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **listSchoolUsers** -> CollectionOfEducationUser listSchoolUsers() +## listSchoolUsers -### Example - -```typescript -import { - EducationSchoolApi, - Configuration -} from './api'; +> CollectionOfEducationUser listSchoolUsers(schoolId) -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +Get the educationUser resources associated with an educationSchool -let schoolId: string; //key: id or schoolNumber of school (default to undefined) +### Example -const { status, data } = await apiInstance.listSchoolUsers( - schoolId -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { ListSchoolUsersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + } satisfies ListSchoolUsersRequest; + + try { + const data = await api.listSchoolUsers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | ### Return type -**CollectionOfEducationUser** +[**CollectionOfEducationUser**](CollectionOfEducationUser.md) ### Authorization @@ -479,43 +649,61 @@ const { status, data } = await apiInstance.listSchoolUsers( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved educationUser | - | -|**0** | error | - | +| **200** | Retrieved educationUser | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## listSchools -# **listSchools** > CollectionOfSchools listSchools() +Get a list of schools and their properties ### Example -```typescript +```ts import { - EducationSchoolApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); - -const { status, data } = await apiInstance.listSchools(); + Configuration, + EducationSchoolApi, +} from ''; +import type { ListSchoolsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + try { + const data = await api.listSchools(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**CollectionOfSchools** +[**CollectionOfSchools**](CollectionOfSchools.md) ### Authorization @@ -523,54 +711,72 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entities | - | -|**0** | error | - | +| **200** | Retrieved entities | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **updateSchool** -> EducationSchool updateSchool(educationSchool) +## updateSchool -### Example - -```typescript -import { - EducationSchoolApi, - Configuration, - EducationSchool -} from './api'; +> EducationSchool updateSchool(schoolId, educationSchool) -const configuration = new Configuration(); -const apiInstance = new EducationSchoolApi(configuration); +Update properties of a school -let schoolId: string; //key: id or schoolNumber of school (default to undefined) -let educationSchool: EducationSchool; //New property values +### Example -const { status, data } = await apiInstance.updateSchool( - schoolId, - educationSchool -); +```ts +import { + Configuration, + EducationSchoolApi, +} from ''; +import type { UpdateSchoolRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationSchoolApi(config); + + const body = { + // string | key: id or schoolNumber of school + schoolId: 43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4, + // EducationSchool | New property values + educationSchool: ..., + } satisfies UpdateSchoolRequest; + + try { + const data = await api.updateSchool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **educationSchool** | **EducationSchool**| New property values | | -| **schoolId** | [**string**] | key: id or schoolNumber of school | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **schoolId** | `string` | key: id or schoolNumber of school | [Defaults to `undefined`] | +| **educationSchool** | [EducationSchool](EducationSchool.md) | New property values | | ### Return type -**EducationSchool** +[**EducationSchool**](EducationSchool.md) ### Authorization @@ -578,15 +784,15 @@ const { status, data } = await apiInstance.updateSchool( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Success | - | -|**0** | error | - | +| **200** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/EducationUser.md b/web/packages/web-client/src/graph/generated/docs/EducationUser.md index 4856d2c3514..dc6e8ad892f 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationUser.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationUser.md @@ -1,49 +1,63 @@ + # EducationUser An extension of user with education-specific attributes ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Read-only. | [optional] [readonly] [default to undefined] -**accountEnabled** | **boolean** | Set to \"true\" when the account is enabled. | [optional] [default to undefined] -**displayName** | **string** | The name displayed in the address book for the user. This value is usually the combination of the user\'s first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. | [optional] [default to undefined] -**drives** | [**Array<Drive>**](Drive.md) | A collection of drives available for this user. Read-only. | [optional] [readonly] [default to undefined] -**drive** | [**Drive**](Drive.md) | | [optional] [default to undefined] -**identities** | [**Array<ObjectIdentity>**](ObjectIdentity.md) | Identities associated with this account. | [optional] [default to undefined] -**mail** | **string** | The SMTP address for the user, for example, \'jeff@contoso.onowncloud.com\'. Returned by default. | [optional] [default to undefined] -**memberOf** | [**Array<Group>**](Group.md) | Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. | [optional] [default to undefined] -**onPremisesSamAccountName** | **string** | Contains the on-premises SAM account name synchronized from the on-premises directory. Read-only. | [optional] [default to undefined] -**passwordProfile** | [**PasswordProfile**](PasswordProfile.md) | | [optional] [default to undefined] -**surname** | **string** | The user\'s surname (family name or last name). Returned by default. | [optional] [default to undefined] -**givenName** | **string** | The user\'s givenName. Returned by default. | [optional] [default to undefined] -**primaryRole** | **string** | The user`s default role. Such as \"student\" or \"teacher\" | [optional] [default to undefined] -**userType** | **string** | The user`s type. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. | [optional] [default to undefined] -**externalID** | **string** | A unique identifier for the user assigned by the school or institution. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`accountEnabled` | boolean +`displayName` | string +`drives` | [Array<Drive>](Drive.md) +`drive` | [Drive](Drive.md) +`identities` | [Array<ObjectIdentity>](ObjectIdentity.md) +`mail` | string +`memberOf` | [Array<Group>](Group.md) +`onPremisesSamAccountName` | string +`passwordProfile` | [PasswordProfile](PasswordProfile.md) +`surname` | string +`givenName` | string +`primaryRole` | string +`userType` | string +`externalID` | string ## Example ```typescript -import { EducationUser } from './api'; - -const instance: EducationUser = { - id, - accountEnabled, - displayName, - drives, - drive, - identities, - mail, - memberOf, - onPremisesSamAccountName, - passwordProfile, - surname, - givenName, - primaryRole, - userType, - externalID, -}; +import type { EducationUser } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "accountEnabled": null, + "displayName": null, + "drives": null, + "drive": null, + "identities": null, + "mail": null, + "memberOf": null, + "onPremisesSamAccountName": null, + "passwordProfile": null, + "surname": null, + "givenName": null, + "primaryRole": null, + "userType": null, + "externalID": null, +} satisfies EducationUser + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EducationUser +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/EducationUserApi.md b/web/packages/web-client/src/graph/generated/docs/EducationUserApi.md index 5309d112241..8835844cbb2 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationUserApi.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationUserApi.md @@ -2,47 +2,66 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**createEducationUser**](#createeducationuser) | **POST** /v1.0/education/users | Add new education user| -|[**deleteEducationUser**](#deleteeducationuser) | **DELETE** /v1.0/education/users/{user-id} | Delete educationUser| -|[**getEducationUser**](#geteducationuser) | **GET** /v1.0/education/users/{user-id} | Get properties of educationUser| -|[**listEducationUsers**](#listeducationusers) | **GET** /v1.0/education/users | Get entities from education users| -|[**updateEducationUser**](#updateeducationuser) | **PATCH** /v1.0/education/users/{user-id} | Update properties of educationUser| +| [**createEducationUser**](EducationUserApi.md#createeducationuser) | **POST** /v1.0/education/users | Add new education user | +| [**deleteEducationUser**](EducationUserApi.md#deleteeducationuser) | **DELETE** /v1.0/education/users/{user-id} | Delete educationUser | +| [**getEducationUser**](EducationUserApi.md#geteducationuser) | **GET** /v1.0/education/users/{user-id} | Get properties of educationUser | +| [**listEducationUsers**](EducationUserApi.md#listeducationusers) | **GET** /v1.0/education/users | Get entities from education users | +| [**updateEducationUser**](EducationUserApi.md#updateeducationuser) | **PATCH** /v1.0/education/users/{user-id} | Update properties of educationUser | -# **createEducationUser** -> EducationUser createEducationUser(educationUser) -### Example +## createEducationUser -```typescript -import { - EducationUserApi, - Configuration, - EducationUser -} from './api'; +> EducationUser createEducationUser(educationUser) -const configuration = new Configuration(); -const apiInstance = new EducationUserApi(configuration); +Add new education user -let educationUser: EducationUser; //New entity +### Example -const { status, data } = await apiInstance.createEducationUser( - educationUser -); +```ts +import { + Configuration, + EducationUserApi, +} from ''; +import type { CreateEducationUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationUserApi(config); + + const body = { + // EducationUser | New entity + educationUser: ..., + } satisfies CreateEducationUserRequest; + + try { + const data = await api.createEducationUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **educationUser** | **EducationUser**| New entity | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **educationUser** | [EducationUser](EducationUser.md) | New entity | | ### Return type -**EducationUser** +[**EducationUser**](EducationUser.md) ### Authorization @@ -50,50 +69,69 @@ const { status, data } = await apiInstance.createEducationUser( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**201** | Created entity | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **201** | Created entity | - | +| **0** | error | - | -# **deleteEducationUser** -> deleteEducationUser() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## deleteEducationUser -```typescript -import { - EducationUserApi, - Configuration -} from './api'; +> deleteEducationUser(userId) -const configuration = new Configuration(); -const apiInstance = new EducationUserApi(configuration); +Delete educationUser -let userId: string; //key: id or username of user (default to undefined) +### Example -const { status, data } = await apiInstance.deleteEducationUser( - userId -); +```ts +import { + Configuration, + EducationUserApi, +} from ''; +import type { DeleteEducationUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationUserApi(config); + + const body = { + // string | key: id or username of user + userId: 90eedea1-dea1-90ee-a1de-ee90a1deee90, + } satisfies DeleteEducationUserRequest; + + try { + const data = await api.deleteEducationUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userId** | [**string**] | key: id or username of user | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id or username of user | [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -101,53 +139,72 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **204** | Success | - | +| **0** | error | - | -# **getEducationUser** -> EducationUser getEducationUser() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## getEducationUser -```typescript -import { - EducationUserApi, - Configuration -} from './api'; +> EducationUser getEducationUser(userId, $expand) -const configuration = new Configuration(); -const apiInstance = new EducationUserApi(configuration); +Get properties of educationUser -let userId: string; //key: id or username of user (default to undefined) -let $expand: Set<'memberOf'>; //Expand related entities (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.getEducationUser( - userId, - $expand -); +```ts +import { + Configuration, + EducationUserApi, +} from ''; +import type { GetEducationUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationUserApi(config); + + const body = { + // string | key: id or username of user + userId: 90eedea1-dea1-90ee-a1de-ee90a1deee90, + // Set<'memberOf'> | Expand related entities (optional) + $expand: ..., + } satisfies GetEducationUserRequest; + + try { + const data = await api.getEducationUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userId** | [**string**] | key: id or username of user | defaults to undefined| -| **$expand** | **Array<'memberOf'>** | Expand related entities | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id or username of user | [Defaults to `undefined`] | +| **$expand** | `memberOf` | Expand related entities | [Optional] [Enum: memberOf] | ### Return type -**EducationUser** +[**EducationUser**](EducationUser.md) ### Authorization @@ -155,53 +212,72 @@ const { status, data } = await apiInstance.getEducationUser( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entity | - | -|**0** | error | - | +| **200** | Retrieved entity | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **listEducationUsers** -> CollectionOfEducationUser listEducationUsers() +## listEducationUsers -### Example +> CollectionOfEducationUser listEducationUsers($orderby, $expand) -```typescript -import { - EducationUserApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new EducationUserApi(configuration); +Get entities from education users -let $orderby: Set<'displayName' | 'displayName desc' | 'mail' | 'mail desc' | 'onPremisesSamAccountName' | 'onPremisesSamAccountName desc'>; //Order items by property values (optional) (default to undefined) -let $expand: Set<'memberOf'>; //Expand related entities (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.listEducationUsers( - $orderby, - $expand -); +```ts +import { + Configuration, + EducationUserApi, +} from ''; +import type { ListEducationUsersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationUserApi(config); + + const body = { + // Set<'displayName' | 'displayName desc' | 'mail' | 'mail desc' | 'onPremisesSamAccountName' | 'onPremisesSamAccountName desc'> | Order items by property values (optional) + $orderby: ..., + // Set<'memberOf'> | Expand related entities (optional) + $expand: ..., + } satisfies ListEducationUsersRequest; + + try { + const data = await api.listEducationUsers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$orderby** | **Array<'displayName' | 'displayName desc' | 'mail' | 'mail desc' | 'onPremisesSamAccountName' | 'onPremisesSamAccountName desc'>** | Order items by property values | (optional) defaults to undefined| -| **$expand** | **Array<'memberOf'>** | Expand related entities | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$orderby** | `displayName`, `displayName desc`, `mail`, `mail desc`, `onPremisesSamAccountName`, `onPremisesSamAccountName desc` | Order items by property values | [Optional] [Enum: displayName, displayName desc, mail, mail desc, onPremisesSamAccountName, onPremisesSamAccountName desc] | +| **$expand** | `memberOf` | Expand related entities | [Optional] [Enum: memberOf] | ### Return type -**CollectionOfEducationUser** +[**CollectionOfEducationUser**](CollectionOfEducationUser.md) ### Authorization @@ -209,54 +285,72 @@ const { status, data } = await apiInstance.listEducationUsers( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entities | - | -|**0** | error | - | +| **200** | Retrieved entities | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **updateEducationUser** -> EducationUser updateEducationUser(educationUser) +## updateEducationUser -### Example - -```typescript -import { - EducationUserApi, - Configuration, - EducationUser -} from './api'; +> EducationUser updateEducationUser(userId, educationUser) -const configuration = new Configuration(); -const apiInstance = new EducationUserApi(configuration); +Update properties of educationUser -let userId: string; //key: id or username of user (default to undefined) -let educationUser: EducationUser; //New property values +### Example -const { status, data } = await apiInstance.updateEducationUser( - userId, - educationUser -); +```ts +import { + Configuration, + EducationUserApi, +} from ''; +import type { UpdateEducationUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new EducationUserApi(config); + + const body = { + // string | key: id or username of user + userId: 90eedea1-dea1-90ee-a1de-ee90a1deee90, + // EducationUser | New property values + educationUser: {"mail":"max.mustermann@new.domain"}, + } satisfies UpdateEducationUserRequest; + + try { + const data = await api.updateEducationUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **educationUser** | **EducationUser**| New property values | | -| **userId** | [**string**] | key: id or username of user | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id or username of user | [Defaults to `undefined`] | +| **educationUser** | [EducationUser](EducationUser.md) | New property values | | ### Return type -**EducationUser** +[**EducationUser**](EducationUser.md) ### Authorization @@ -264,16 +358,16 @@ const { status, data } = await apiInstance.updateEducationUser( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Success | - | -|**204** | Success | - | -|**0** | error | - | +| **200** | Success | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/EducationUserReference.md b/web/packages/web-client/src/graph/generated/docs/EducationUserReference.md index 9564e7af870..349b8ecdeb0 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationUserReference.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationUserReference.md @@ -1,20 +1,34 @@ + # EducationUserReference ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**odata_id** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`atOdataId` | string ## Example ```typescript -import { EducationUserReference } from './api'; +import type { EducationUserReference } from '' + +// TODO: Update the object below with actual values +const example = { + "atOdataId": https:///graph/v1.0/education/users/90eedea1-dea1-90ee-a1de-ee90a1deee90, +} satisfies EducationUserReference + +console.log(example) -const instance: EducationUserReference = { - odata_id, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EducationUserReference +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ExportPersonalDataRequest.md b/web/packages/web-client/src/graph/generated/docs/ExportPersonalDataRequest.md index b6a5bcf2335..a8b36fd1222 100644 --- a/web/packages/web-client/src/graph/generated/docs/ExportPersonalDataRequest.md +++ b/web/packages/web-client/src/graph/generated/docs/ExportPersonalDataRequest.md @@ -1,20 +1,34 @@ + # ExportPersonalDataRequest ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**storageLocation** | **string** | the path where the file should be created in the users personal space | [optional] [default to undefined] +Name | Type +------------ | ------------- +`storageLocation` | string ## Example ```typescript -import { ExportPersonalDataRequest } from './api'; +import type { ExportPersonalDataRequest } from '' + +// TODO: Update the object below with actual values +const example = { + "storageLocation": null, +} satisfies ExportPersonalDataRequest + +console.log(example) -const instance: ExportPersonalDataRequest = { - storageLocation, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ExportPersonalDataRequest +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md b/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md index db9d7789662..071098e16b3 100644 --- a/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md +++ b/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md @@ -1,25 +1,39 @@ + # FileSystemInfo File system information on client. Read-write. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createdDateTime** | **string** | The UTC date and time the file was created on a client. | [optional] [default to undefined] -**lastAccessedDateTime** | **string** | The UTC date and time the file was last accessed. Available for the recent file list only. | [optional] [default to undefined] -**lastModifiedDateTime** | **string** | The UTC date and time the file was last modified on a client. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`createdDateTime` | Date +`lastAccessedDateTime` | Date +`lastModifiedDateTime` | Date ## Example ```typescript -import { FileSystemInfo } from './api'; +import type { FileSystemInfo } from '' + +// TODO: Update the object below with actual values +const example = { + "createdDateTime": null, + "lastAccessedDateTime": null, + "lastModifiedDateTime": null, +} satisfies FileSystemInfo + +console.log(example) -const instance: FileSystemInfo = { - createdDateTime, - lastAccessedDateTime, - lastModifiedDateTime, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FileSystemInfo +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Folder.md b/web/packages/web-client/src/graph/generated/docs/Folder.md index 41a8ecc8290..9faabd6f4b1 100644 --- a/web/packages/web-client/src/graph/generated/docs/Folder.md +++ b/web/packages/web-client/src/graph/generated/docs/Folder.md @@ -1,23 +1,37 @@ + # Folder Folder metadata, if the item is a folder. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**childCount** | **number** | Number of children contained immediately within this container. | [optional] [default to undefined] -**view** | [**FolderView**](FolderView.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`childCount` | number +`view` | [FolderView](FolderView.md) ## Example ```typescript -import { Folder } from './api'; +import type { Folder } from '' + +// TODO: Update the object below with actual values +const example = { + "childCount": null, + "view": null, +} satisfies Folder + +console.log(example) -const instance: Folder = { - childCount, - view, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Folder +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/FolderView.md b/web/packages/web-client/src/graph/generated/docs/FolderView.md index 288e2046edb..84d9fe8b3f3 100644 --- a/web/packages/web-client/src/graph/generated/docs/FolderView.md +++ b/web/packages/web-client/src/graph/generated/docs/FolderView.md @@ -1,25 +1,39 @@ + # FolderView A collection of properties defining the recommended view for the folder. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sortBy** | **string** | The method by which the folder should be sorted. | [optional] [default to undefined] -**sortOrder** | **string** | If true, indicates that items should be sorted in descending order. Otherwise, items should be sorted ascending. | [optional] [default to undefined] -**viewType** | **string** | The type of view that should be used to represent the folder. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`sortBy` | string +`sortOrder` | string +`viewType` | string ## Example ```typescript -import { FolderView } from './api'; +import type { FolderView } from '' + +// TODO: Update the object below with actual values +const example = { + "sortBy": null, + "sortOrder": null, + "viewType": null, +} satisfies FolderView + +console.log(example) -const instance: FolderView = { - sortBy, - sortOrder, - viewType, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FolderView +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/GeoCoordinates.md b/web/packages/web-client/src/graph/generated/docs/GeoCoordinates.md index 17f10184516..e038a48e9e0 100644 --- a/web/packages/web-client/src/graph/generated/docs/GeoCoordinates.md +++ b/web/packages/web-client/src/graph/generated/docs/GeoCoordinates.md @@ -1,25 +1,39 @@ + # GeoCoordinates The GeoCoordinates resource provides geographic coordinates and elevation of a location based on metadata contained within the file. If a DriveItem has a non-null location facet, the item represents a file with a known location associated with it. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**altitude** | **number** | The altitude (height), in feet, above sea level for the item. Read-only. | [optional] [default to undefined] -**latitude** | **number** | The latitude, in decimal, for the item. Read-only. | [optional] [default to undefined] -**longitude** | **number** | The longitude, in decimal, for the item. Read-only. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`altitude` | number +`latitude` | number +`longitude` | number ## Example ```typescript -import { GeoCoordinates } from './api'; +import type { GeoCoordinates } from '' + +// TODO: Update the object below with actual values +const example = { + "altitude": null, + "latitude": null, + "longitude": null, +} satisfies GeoCoordinates + +console.log(example) -const instance: GeoCoordinates = { - altitude, - latitude, - longitude, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as GeoCoordinates +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Group.md b/web/packages/web-client/src/graph/generated/docs/Group.md index b2ac53223aa..dce44b33c9d 100644 --- a/web/packages/web-client/src/graph/generated/docs/Group.md +++ b/web/packages/web-client/src/graph/generated/docs/Group.md @@ -1,30 +1,44 @@ + # Group ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Read-only. | [optional] [readonly] [default to undefined] -**description** | **string** | An optional description for the group. Returned by default. | [optional] [default to undefined] -**displayName** | **string** | The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy. | [optional] [default to undefined] -**groupTypes** | **Array<string>** | Specifies the group types. In MS Graph a group can have multiple types, so this is an array. In libreGraph the possible group types deviate from the MS Graph. The only group type that we currently support is \"ReadOnly\", which is set for groups that cannot be modified on the current instance. | [optional] [default to undefined] -**members** | [**Array<User>**](User.md) | Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand. | [optional] [default to undefined] -**membersodata_bind** | **Set<string>** | A list of member references to the members to be added. Up to 20 members can be added with a single request | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`description` | string +`displayName` | string +`groupTypes` | Array<string> +`members` | [Array<User>](User.md) +`membersodataBind` | Set<string> ## Example ```typescript -import { Group } from './api'; - -const instance: Group = { - id, - description, - displayName, - groupTypes, - members, - membersodata_bind, -}; +import type { Group } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "description": null, + "displayName": null, + "groupTypes": null, + "members": null, + "membersodataBind": null, +} satisfies Group + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Group +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/GroupApi.md b/web/packages/web-client/src/graph/generated/docs/GroupApi.md index 0844add24af..0cce1730f45 100644 --- a/web/packages/web-client/src/graph/generated/docs/GroupApi.md +++ b/web/packages/web-client/src/graph/generated/docs/GroupApi.md @@ -2,51 +2,71 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**addMember**](#addmember) | **POST** /v1.0/groups/{group-id}/members/$ref | Add a member to a group| -|[**deleteGroup**](#deletegroup) | **DELETE** /v1.0/groups/{group-id} | Delete entity from groups| -|[**deleteMember**](#deletemember) | **DELETE** /v1.0/groups/{group-id}/members/{directory-object-id}/$ref | Delete member from a group| -|[**getGroup**](#getgroup) | **GET** /v1.0/groups/{group-id} | Get entity from groups by key| -|[**listMembers**](#listmembers) | **GET** /v1.0/groups/{group-id}/members | Get a list of the group\'s direct members| -|[**updateGroup**](#updategroup) | **PATCH** /v1.0/groups/{group-id} | Update entity in groups| +| [**addMember**](GroupApi.md#addmember) | **POST** /v1.0/groups/{group-id}/members/$ref | Add a member to a group | +| [**deleteGroup**](GroupApi.md#deletegroup) | **DELETE** /v1.0/groups/{group-id} | Delete entity from groups | +| [**deleteMember**](GroupApi.md#deletemember) | **DELETE** /v1.0/groups/{group-id}/members/{directory-object-id}/$ref | Delete member from a group | +| [**getGroup**](GroupApi.md#getgroup) | **GET** /v1.0/groups/{group-id} | Get entity from groups by key | +| [**listMembers**](GroupApi.md#listmembers) | **GET** /v1.0/groups/{group-id}/members | Get a list of the group\'s direct members | +| [**updateGroup**](GroupApi.md#updategroup) | **PATCH** /v1.0/groups/{group-id} | Update entity in groups | -# **addMember** -> addMember(memberReference) -### Example +## addMember -```typescript -import { - GroupApi, - Configuration, - MemberReference -} from './api'; +> addMember(groupId, memberReference) -const configuration = new Configuration(); -const apiInstance = new GroupApi(configuration); +Add a member to a group -let groupId: string; //key: id of group (default to undefined) -let memberReference: MemberReference; //Object to be added as member +### Example -const { status, data } = await apiInstance.addMember( - groupId, - memberReference -); +```ts +import { + Configuration, + GroupApi, +} from ''; +import type { AddMemberRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupApi(config); + + const body = { + // string | key: id of group + groupId: groupId_example, + // MemberReference | Object to be added as member + memberReference: ..., + } satisfies AddMemberRequest; + + try { + const data = await api.addMember(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **memberReference** | **MemberReference**| Object to be added as member | | -| **groupId** | [**string**] | key: id of group | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | `string` | key: id of group | [Defaults to `undefined`] | +| **memberReference** | [MemberReference](MemberReference.md) | Object to be added as member | | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -54,53 +74,73 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **204** | Success | - | +| **0** | error | - | -# **deleteGroup** -> deleteGroup() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## deleteGroup -```typescript -import { - GroupApi, - Configuration -} from './api'; +> deleteGroup(groupId, ifMatch) -const configuration = new Configuration(); -const apiInstance = new GroupApi(configuration); +Delete entity from groups -let groupId: string; //key: id of group (default to undefined) -let ifMatch: string; //ETag (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.deleteGroup( - groupId, - ifMatch -); +```ts +import { + Configuration, + GroupApi, +} from ''; +import type { DeleteGroupRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupApi(config); + + const body = { + // string | key: id of group + groupId: groupId_example, + // string | ETag (optional) + ifMatch: ifMatch_example, + } satisfies DeleteGroupRequest; + + try { + const data = await api.deleteGroup(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **groupId** | [**string**] | key: id of group | defaults to undefined| -| **ifMatch** | [**string**] | ETag | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | `string` | key: id of group | [Defaults to `undefined`] | +| **ifMatch** | `string` | ETag | [Optional] [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -108,56 +148,76 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **deleteMember** -> deleteMember() +## deleteMember +> deleteMember(groupId, directoryObjectId, ifMatch) + +Delete member from a group ### Example -```typescript +```ts import { - GroupApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new GroupApi(configuration); - -let groupId: string; //key: id of group (default to undefined) -let directoryObjectId: string; //key: id of group member to remove (default to undefined) -let ifMatch: string; //ETag (optional) (default to undefined) - -const { status, data } = await apiInstance.deleteMember( - groupId, - directoryObjectId, - ifMatch -); + Configuration, + GroupApi, +} from ''; +import type { DeleteMemberRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupApi(config); + + const body = { + // string | key: id of group + groupId: groupId_example, + // string | key: id of group member to remove + directoryObjectId: directoryObjectId_example, + // string | ETag (optional) + ifMatch: ifMatch_example, + } satisfies DeleteMemberRequest; + + try { + const data = await api.deleteMember(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **groupId** | [**string**] | key: id of group | defaults to undefined| -| **directoryObjectId** | [**string**] | key: id of group member to remove | defaults to undefined| -| **ifMatch** | [**string**] | ETag | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | `string` | key: id of group | [Defaults to `undefined`] | +| **directoryObjectId** | `string` | key: id of group member to remove | [Defaults to `undefined`] | +| **ifMatch** | `string` | ETag | [Optional] [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -165,56 +225,76 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **getGroup** -> Group getGroup() +## getGroup +> Group getGroup(groupId, $select, $expand) + +Get entity from groups by key ### Example -```typescript +```ts import { - GroupApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new GroupApi(configuration); - -let groupId: string; //key: id or name of group (default to undefined) -let $select: Set<'id' | 'description' | 'displayName' | 'members'>; //Select properties to be returned (optional) (default to undefined) -let $expand: Set<'members'>; //Expand related entities (optional) (default to undefined) - -const { status, data } = await apiInstance.getGroup( - groupId, - $select, - $expand -); + Configuration, + GroupApi, +} from ''; +import type { GetGroupRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupApi(config); + + const body = { + // string | key: id or name of group + groupId: groupId_example, + // Set<'id' | 'description' | 'displayName' | 'members'> | Select properties to be returned (optional) + $select: ..., + // Set<'members'> | Expand related entities (optional) + $expand: ..., + } satisfies GetGroupRequest; + + try { + const data = await api.getGroup(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **groupId** | [**string**] | key: id or name of group | defaults to undefined| -| **$select** | **Array<'id' | 'description' | 'displayName' | 'members'>** | Select properties to be returned | (optional) defaults to undefined| -| **$expand** | **Array<'members'>** | Expand related entities | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | `string` | key: id or name of group | [Defaults to `undefined`] | +| **$select** | `id`, `description`, `displayName`, `members` | Select properties to be returned | [Optional] [Enum: id, description, displayName, members] | +| **$expand** | `members` | Expand related entities | [Optional] [Enum: members] | ### Return type -**Group** +[**Group**](Group.md) ### Authorization @@ -222,50 +302,70 @@ const { status, data } = await apiInstance.getGroup( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entity | - | -|**0** | error | - | +| **200** | Retrieved entity | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **listMembers** -> CollectionOfUsers listMembers() +## listMembers -### Example +> CollectionOfUsers listMembers(groupId) -```typescript -import { - GroupApi, - Configuration -} from './api'; +Get a list of the group\'s direct members -const configuration = new Configuration(); -const apiInstance = new GroupApi(configuration); - -let groupId: string; //key: id or name of group (default to undefined) +### Example -const { status, data } = await apiInstance.listMembers( - groupId -); +```ts +import { + Configuration, + GroupApi, +} from ''; +import type { ListMembersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupApi(config); + + const body = { + // string | key: id or name of group + groupId: 86948e45-96a6-43df-b83d-46e92afd30de, + } satisfies ListMembersRequest; + + try { + const data = await api.listMembers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **groupId** | [**string**] | key: id or name of group | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | `string` | key: id or name of group | [Defaults to `undefined`] | ### Return type -**CollectionOfUsers** +[**CollectionOfUsers**](CollectionOfUsers.md) ### Authorization @@ -273,54 +373,73 @@ const { status, data } = await apiInstance.listMembers( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved group members | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **200** | Retrieved group members | - | +| **0** | error | - | -# **updateGroup** -> updateGroup(group) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## updateGroup -```typescript -import { - GroupApi, - Configuration, - Group -} from './api'; +> updateGroup(groupId, group) -const configuration = new Configuration(); -const apiInstance = new GroupApi(configuration); +Update entity in groups -let groupId: string; //key: id of group (default to undefined) -let group: Group; //New property values +### Example -const { status, data } = await apiInstance.updateGroup( - groupId, - group -); +```ts +import { + Configuration, + GroupApi, +} from ''; +import type { UpdateGroupRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupApi(config); + + const body = { + // string | key: id of group + groupId: groupId_example, + // Group | New property values + group: {"displayName":"GroupName"}, + } satisfies UpdateGroupRequest; + + try { + const data = await api.updateGroup(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **group** | **Group**| New property values | | -| **groupId** | [**string**] | key: id of group | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **groupId** | `string` | key: id of group | [Defaults to `undefined`] | +| **group** | [Group](Group.md) | New property values | | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -328,15 +447,15 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/GroupsApi.md b/web/packages/web-client/src/graph/generated/docs/GroupsApi.md index 44238940900..65e1dafe216 100644 --- a/web/packages/web-client/src/graph/generated/docs/GroupsApi.md +++ b/web/packages/web-client/src/graph/generated/docs/GroupsApi.md @@ -2,44 +2,64 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**createGroup**](#creategroup) | **POST** /v1.0/groups | Add new entity to groups| -|[**listGroups**](#listgroups) | **GET** /v1.0/groups | Get entities from groups| +| [**createGroup**](GroupsApi.md#creategroup) | **POST** /v1.0/groups | Add new entity to groups | +| [**listGroups**](GroupsApi.md#listgroups) | **GET** /v1.0/groups | Get entities from groups | -# **createGroup** -> Group createGroup(group) -### Example +## createGroup -```typescript -import { - GroupsApi, - Configuration, - Group -} from './api'; +> Group createGroup(group) -const configuration = new Configuration(); -const apiInstance = new GroupsApi(configuration); +Add new entity to groups -let group: Group; //New entity +### Example -const { status, data } = await apiInstance.createGroup( - group -); +```ts +import { + Configuration, + GroupsApi, +} from ''; +import type { CreateGroupRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupsApi(config); + + const body = { + // Group | New entity + group: ..., + } satisfies CreateGroupRequest; + + try { + const data = await api.createGroup(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **group** | **Group**| New entity | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **group** | [Group](Group.md) | New entity | | ### Return type -**Group** +[**Group**](Group.md) ### Authorization @@ -47,59 +67,79 @@ const { status, data } = await apiInstance.createGroup( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**201** | Created entity | - | -|**0** | error | - | +| **201** | Created entity | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **listGroups** -> CollectionOfGroup listGroups() +## listGroups +> CollectionOfGroup listGroups($search, $orderby, $select, $expand) + +Get entities from groups ### Example -```typescript +```ts import { - GroupsApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new GroupsApi(configuration); - -let $search: string; //Search items by search phrases (optional) (default to undefined) -let $orderby: Set<'displayName' | 'displayName desc'>; //Order items by property values (optional) (default to undefined) -let $select: Set<'id' | 'description' | 'displayName' | 'mail' | 'members'>; //Select properties to be returned (optional) (default to undefined) -let $expand: Set<'members'>; //Expand related entities (optional) (default to undefined) - -const { status, data } = await apiInstance.listGroups( - $search, - $orderby, - $select, - $expand -); + Configuration, + GroupsApi, +} from ''; +import type { ListGroupsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new GroupsApi(config); + + const body = { + // string | Search items by search phrases (optional) + $search: $search_example, + // Set<'displayName' | 'displayName desc'> | Order items by property values (optional) + $orderby: ..., + // Set<'id' | 'description' | 'displayName' | 'mail' | 'members'> | Select properties to be returned (optional) + $select: ..., + // Set<'members'> | Expand related entities (optional) + $expand: ..., + } satisfies ListGroupsRequest; + + try { + const data = await api.listGroups(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$search** | [**string**] | Search items by search phrases | (optional) defaults to undefined| -| **$orderby** | **Array<'displayName' | 'displayName desc'>** | Order items by property values | (optional) defaults to undefined| -| **$select** | **Array<'id' | 'description' | 'displayName' | 'mail' | 'members'>** | Select properties to be returned | (optional) defaults to undefined| -| **$expand** | **Array<'members'>** | Expand related entities | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$search** | `string` | Search items by search phrases | [Optional] [Defaults to `undefined`] | +| **$orderby** | `displayName`, `displayName desc` | Order items by property values | [Optional] [Enum: displayName, displayName desc] | +| **$select** | `id`, `description`, `displayName`, `mail`, `members` | Select properties to be returned | [Optional] [Enum: id, description, displayName, mail, members] | +| **$expand** | `members` | Expand related entities | [Optional] [Enum: members] | ### Return type -**CollectionOfGroup** +[**CollectionOfGroup**](CollectionOfGroup.md) ### Authorization @@ -107,15 +147,15 @@ const { status, data } = await apiInstance.listGroups( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entities | - | -|**0** | error | - | +| **200** | Retrieved entities | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/Hashes.md b/web/packages/web-client/src/graph/generated/docs/Hashes.md index 8d3aa870b46..d926a60881b 100644 --- a/web/packages/web-client/src/graph/generated/docs/Hashes.md +++ b/web/packages/web-client/src/graph/generated/docs/Hashes.md @@ -1,27 +1,41 @@ + # Hashes Hashes of the file\'s binary content, if available. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**crc32Hash** | **string** | The CRC32 value of the file (if available). Read-only. | [optional] [default to undefined] -**quickXorHash** | **string** | A proprietary hash of the file that can be used to determine if the contents of the file have changed (if available). Read-only. | [optional] [default to undefined] -**sha1Hash** | **string** | SHA1 hash for the contents of the file (if available). Read-only. | [optional] [default to undefined] -**sha256Hash** | **string** | SHA256 hash for the contents of the file (if available). Read-only. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`crc32Hash` | string +`quickXorHash` | string +`sha1Hash` | string +`sha256Hash` | string ## Example ```typescript -import { Hashes } from './api'; - -const instance: Hashes = { - crc32Hash, - quickXorHash, - sha1Hash, - sha256Hash, -}; +import type { Hashes } from '' + +// TODO: Update the object below with actual values +const example = { + "crc32Hash": null, + "quickXorHash": null, + "sha1Hash": null, + "sha256Hash": null, +} satisfies Hashes + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Hashes +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Identity.md b/web/packages/web-client/src/graph/generated/docs/Identity.md index c7fdad08b41..998bc8b16ea 100644 --- a/web/packages/web-client/src/graph/generated/docs/Identity.md +++ b/web/packages/web-client/src/graph/generated/docs/Identity.md @@ -1,24 +1,38 @@ + # Identity ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**displayName** | **string** | The identity\'s display name. Note that this may not always be available or up to date. For example, if a user changes their display name, the API may show the new value in a future response, but the items associated with the user won\'t show up as having changed when using delta. | [default to undefined] -**id** | **string** | Unique identifier for the identity. | [optional] [default to undefined] -**libre_graph_userType** | **string** | The type of the identity. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. Can be used by clients to indicate the type of user. For more details, clients should look up and cache the user at the /users endpoint. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`displayName` | string +`id` | string +`atLibreGraphUserType` | string ## Example ```typescript -import { Identity } from './api'; +import type { Identity } from '' + +// TODO: Update the object below with actual values +const example = { + "displayName": null, + "id": null, + "atLibreGraphUserType": null, +} satisfies Identity + +console.log(example) -const instance: Identity = { - displayName, - id, - libre_graph_userType, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Identity +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/IdentitySet.md b/web/packages/web-client/src/graph/generated/docs/IdentitySet.md index cb163af757f..0476afa03f1 100644 --- a/web/packages/web-client/src/graph/generated/docs/IdentitySet.md +++ b/web/packages/web-client/src/graph/generated/docs/IdentitySet.md @@ -1,27 +1,41 @@ + # IdentitySet Optional. User account. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**application** | [**Identity**](Identity.md) | | [optional] [default to undefined] -**device** | [**Identity**](Identity.md) | | [optional] [default to undefined] -**user** | [**Identity**](Identity.md) | | [optional] [default to undefined] -**group** | [**Identity**](Identity.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`application` | [Identity](Identity.md) +`device` | [Identity](Identity.md) +`user` | [Identity](Identity.md) +`group` | [Identity](Identity.md) ## Example ```typescript -import { IdentitySet } from './api'; - -const instance: IdentitySet = { - application, - device, - user, - group, -}; +import type { IdentitySet } from '' + +// TODO: Update the object below with actual values +const example = { + "application": null, + "device": null, + "user": null, + "group": null, +} satisfies IdentitySet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as IdentitySet +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Image.md b/web/packages/web-client/src/graph/generated/docs/Image.md index 3370053befb..e7fdc02e7ec 100644 --- a/web/packages/web-client/src/graph/generated/docs/Image.md +++ b/web/packages/web-client/src/graph/generated/docs/Image.md @@ -1,23 +1,37 @@ + # Image Image metadata, if the item is an image. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**height** | **number** | Optional. Height of the image, in pixels. Read-only. | [optional] [readonly] [default to undefined] -**width** | **number** | Optional. Width of the image, in pixels. Read-only. | [optional] [readonly] [default to undefined] +Name | Type +------------ | ------------- +`height` | number +`width` | number ## Example ```typescript -import { Image } from './api'; +import type { Image } from '' + +// TODO: Update the object below with actual values +const example = { + "height": null, + "width": null, +} satisfies Image + +console.log(example) -const instance: Image = { - height, - width, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Image +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Instance.md b/web/packages/web-client/src/graph/generated/docs/Instance.md index a74d6d3afdb..cee2985ac91 100644 --- a/web/packages/web-client/src/graph/generated/docs/Instance.md +++ b/web/packages/web-client/src/graph/generated/docs/Instance.md @@ -1,23 +1,37 @@ + # Instance An oCIS instance that the user is either a member or a guest of. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **string** | The URL of the oCIS instance. | [optional] [default to undefined] -**primary** | **boolean** | Whether the instance is the user\'s primary instance. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`url` | string +`primary` | boolean ## Example ```typescript -import { Instance } from './api'; +import type { Instance } from '' + +// TODO: Update the object below with actual values +const example = { + "url": null, + "primary": null, +} satisfies Instance + +console.log(example) -const instance: Instance = { - url, - primary, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Instance +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ItemReference.md b/web/packages/web-client/src/graph/generated/docs/ItemReference.md index a9aad5261b9..671e8206d90 100644 --- a/web/packages/web-client/src/graph/generated/docs/ItemReference.md +++ b/web/packages/web-client/src/graph/generated/docs/ItemReference.md @@ -1,28 +1,42 @@ + # ItemReference ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**driveId** | **string** | Unique identifier of the drive instance that contains the item. Read-only. | [optional] [readonly] [default to undefined] -**driveType** | **string** | Identifies the type of drive. See [drive][] resource for values. Read-only. | [optional] [readonly] [default to undefined] -**id** | **string** | Unique identifier of the item in the drive. Read-only. | [optional] [readonly] [default to undefined] -**name** | **string** | The name of the item being referenced. Read-only. | [optional] [readonly] [default to undefined] -**path** | **string** | Path that can be used to navigate to the item. Read-only. | [optional] [readonly] [default to undefined] +Name | Type +------------ | ------------- +`driveId` | string +`driveType` | string +`id` | string +`name` | string +`path` | string ## Example ```typescript -import { ItemReference } from './api'; - -const instance: ItemReference = { - driveId, - driveType, - id, - name, - path, -}; +import type { ItemReference } from '' + +// TODO: Update the object below with actual values +const example = { + "driveId": null, + "driveType": null, + "id": null, + "name": null, + "path": null, +} satisfies ItemReference + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ItemReference +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/MeChangepasswordApi.md b/web/packages/web-client/src/graph/generated/docs/MeChangepasswordApi.md index aa2c47d685f..7f58e1f6b24 100644 --- a/web/packages/web-client/src/graph/generated/docs/MeChangepasswordApi.md +++ b/web/packages/web-client/src/graph/generated/docs/MeChangepasswordApi.md @@ -2,43 +2,63 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**changeOwnPassword**](#changeownpassword) | **POST** /v1.0/me/changePassword | Change your own password| +| [**changeOwnPassword**](MeChangepasswordApi.md#changeownpassword) | **POST** /v1.0/me/changePassword | Change your own password | -# **changeOwnPassword** -> changeOwnPassword(passwordChange) -### Example +## changeOwnPassword -```typescript -import { - MeChangepasswordApi, - Configuration, - PasswordChange -} from './api'; +> changeOwnPassword(passwordChange) -const configuration = new Configuration(); -const apiInstance = new MeChangepasswordApi(configuration); +Change your own password -let passwordChange: PasswordChange; //Password change request +### Example -const { status, data } = await apiInstance.changeOwnPassword( - passwordChange -); +```ts +import { + Configuration, + MeChangepasswordApi, +} from ''; +import type { ChangeOwnPasswordRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeChangepasswordApi(config); + + const body = { + // PasswordChange | Password change request + passwordChange: ..., + } satisfies ChangeOwnPasswordRequest; + + try { + const data = await api.changeOwnPassword(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **passwordChange** | **PasswordChange**| Password change request | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **passwordChange** | [PasswordChange](PasswordChange.md) | Password change request | | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -46,15 +66,15 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/MeDriveApi.md b/web/packages/web-client/src/graph/generated/docs/MeDriveApi.md index 7cb52ca12e5..6f369a5783e 100644 --- a/web/packages/web-client/src/graph/generated/docs/MeDriveApi.md +++ b/web/packages/web-client/src/graph/generated/docs/MeDriveApi.md @@ -2,37 +2,57 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**getHome**](#gethome) | **GET** /v1.0/me/drive | Get personal space for user| -|[**listSharedByMe**](#listsharedbyme) | **GET** /v1beta1/me/drive/sharedByMe | Get a list of driveItem objects shared by the current user.| -|[**listSharedWithMe**](#listsharedwithme) | **GET** /v1beta1/me/drive/sharedWithMe | Get a list of driveItem objects shared with the owner of a drive.| +| [**getHome**](MeDriveApi.md#gethome) | **GET** /v1.0/me/drive | Get personal space for user | +| [**listSharedByMe**](MeDriveApi.md#listsharedbyme) | **GET** /v1beta1/me/drive/sharedByMe | Get a list of driveItem objects shared by the current user. | +| [**listSharedWithMe**](MeDriveApi.md#listsharedwithme) | **GET** /v1beta1/me/drive/sharedWithMe | Get a list of driveItem objects shared with the owner of a drive. | + + + +## getHome -# **getHome** > Drive getHome() +Get personal space for user ### Example -```typescript +```ts import { - MeDriveApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new MeDriveApi(configuration); - -const { status, data } = await apiInstance.getHome(); + Configuration, + MeDriveApi, +} from ''; +import type { GetHomeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeDriveApi(config); + + try { + const data = await api.getHome(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**Drive** +[**Drive**](Drive.md) ### Authorization @@ -40,44 +60,64 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved personal space | - | -|**0** | error | - | +| **200** | Retrieved personal space | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **listSharedByMe** +## listSharedByMe + > CollectionOfDriveItems1 listSharedByMe() -The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. +Get a list of driveItem objects shared by the current user. + +The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items. ### Example -```typescript +```ts import { - MeDriveApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new MeDriveApi(configuration); - -const { status, data } = await apiInstance.listSharedByMe(); + Configuration, + MeDriveApi, +} from ''; +import type { ListSharedByMeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeDriveApi(config); + + try { + const data = await api.listSharedByMe(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**CollectionOfDriveItems1** +[**CollectionOfDriveItems1**](CollectionOfDriveItems1.md) ### Authorization @@ -85,44 +125,64 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | OK | - | -|**0** | error | - | +| **200** | OK | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## listSharedWithMe -# **listSharedWithMe** > CollectionOfDriveItems1 listSharedWithMe() -The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. +Get a list of driveItem objects shared with the owner of a drive. + +The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive. ### Example -```typescript +```ts import { - MeDriveApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new MeDriveApi(configuration); - -const { status, data } = await apiInstance.listSharedWithMe(); + Configuration, + MeDriveApi, +} from ''; +import type { ListSharedWithMeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeDriveApi(config); + + try { + const data = await api.listSharedWithMe(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**CollectionOfDriveItems1** +[**CollectionOfDriveItems1**](CollectionOfDriveItems1.md) ### Authorization @@ -130,15 +190,15 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | OK | - | -|**0** | error | - | +| **200** | OK | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/MeDriveRootApi.md b/web/packages/web-client/src/graph/generated/docs/MeDriveRootApi.md index 6815b716027..c0abb6d129b 100644 --- a/web/packages/web-client/src/graph/generated/docs/MeDriveRootApi.md +++ b/web/packages/web-client/src/graph/generated/docs/MeDriveRootApi.md @@ -2,35 +2,55 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**homeGetRoot**](#homegetroot) | **GET** /v1.0/me/drive/root | Get root from personal space| +| [**homeGetRoot**](MeDriveRootApi.md#homegetroot) | **GET** /v1.0/me/drive/root | Get root from personal space | + + + +## homeGetRoot -# **homeGetRoot** > DriveItem homeGetRoot() +Get root from personal space ### Example -```typescript +```ts import { - MeDriveRootApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new MeDriveRootApi(configuration); - -const { status, data } = await apiInstance.homeGetRoot(); + Configuration, + MeDriveRootApi, +} from ''; +import type { HomeGetRootRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeDriveRootApi(config); + + try { + const data = await api.homeGetRoot(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**DriveItem** +[**DriveItem**](DriveItem.md) ### Authorization @@ -38,15 +58,15 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved resource | - | -|**0** | error | - | +| **200** | Retrieved resource | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/MeDriveRootChildrenApi.md b/web/packages/web-client/src/graph/generated/docs/MeDriveRootChildrenApi.md index 0372670bac3..9798df0ff78 100644 --- a/web/packages/web-client/src/graph/generated/docs/MeDriveRootChildrenApi.md +++ b/web/packages/web-client/src/graph/generated/docs/MeDriveRootChildrenApi.md @@ -2,35 +2,55 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**homeGetChildren**](#homegetchildren) | **GET** /v1.0/me/drive/root/children | Get children from drive| +| [**homeGetChildren**](MeDriveRootChildrenApi.md#homegetchildren) | **GET** /v1.0/me/drive/root/children | Get children from drive | + + + +## homeGetChildren -# **homeGetChildren** > CollectionOfDriveItems homeGetChildren() +Get children from drive ### Example -```typescript +```ts import { - MeDriveRootChildrenApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new MeDriveRootChildrenApi(configuration); - -const { status, data } = await apiInstance.homeGetChildren(); + Configuration, + MeDriveRootChildrenApi, +} from ''; +import type { HomeGetChildrenRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeDriveRootChildrenApi(config); + + try { + const data = await api.homeGetChildren(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**CollectionOfDriveItems** +[**CollectionOfDriveItems**](CollectionOfDriveItems.md) ### Authorization @@ -38,15 +58,15 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved resource list | - | -|**0** | error | - | +| **200** | Retrieved resource list | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/MeDrivesApi.md b/web/packages/web-client/src/graph/generated/docs/MeDrivesApi.md index f536a46418c..4a556d7d3ac 100644 --- a/web/packages/web-client/src/graph/generated/docs/MeDrivesApi.md +++ b/web/packages/web-client/src/graph/generated/docs/MeDrivesApi.md @@ -2,46 +2,67 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**listMyDrives**](#listmydrives) | **GET** /v1.0/me/drives | Get all drives where the current user is a regular member of| -|[**listMyDrivesBeta**](#listmydrivesbeta) | **GET** /v1beta1/me/drives | Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles| +| [**listMyDrives**](MeDrivesApi.md#listmydrives) | **GET** /v1.0/me/drives | Get all drives where the current user is a regular member of | +| [**listMyDrivesBeta**](MeDrivesApi.md#listmydrivesbeta) | **GET** /v1beta1/me/drives | Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles | -# **listMyDrives** -> CollectionOfDrives listMyDrives() -### Example +## listMyDrives -```typescript -import { - MeDrivesApi, - Configuration -} from './api'; +> CollectionOfDrives listMyDrives($orderby, $filter) -const configuration = new Configuration(); -const apiInstance = new MeDrivesApi(configuration); +Get all drives where the current user is a regular member of -let $orderby: string; //The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) (default to undefined) -let $filter: string; //Filter items by property values (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.listMyDrives( - $orderby, - $filter -); +```ts +import { + Configuration, + MeDrivesApi, +} from ''; +import type { ListMyDrivesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeDrivesApi(config); + + const body = { + // string | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) + $orderby: lastModifiedDateTime desc, + // string | Filter items by property values (optional) + $filter: driveType eq 'project', + } satisfies ListMyDrivesRequest; + + try { + const data = await api.listMyDrives(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$orderby** | [**string**] | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | (optional) defaults to undefined| -| **$filter** | [**string**] | Filter items by property values | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$orderby** | `string` | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | [Optional] [Defaults to `undefined`] | +| **$filter** | `string` | Filter items by property values | [Optional] [Defaults to `undefined`] | ### Return type -**CollectionOfDrives** +[**CollectionOfDrives**](CollectionOfDrives.md) ### Authorization @@ -49,53 +70,73 @@ const { status, data } = await apiInstance.listMyDrives( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved spaces | - | -|**0** | error | - | +| **200** | Retrieved spaces | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **listMyDrivesBeta** -> CollectionOfDrives listMyDrivesBeta() +## listMyDrivesBeta -### Example +> CollectionOfDrives listMyDrivesBeta($orderby, $filter) -```typescript -import { - MeDrivesApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new MeDrivesApi(configuration); +Alias for \'/v1.0/drives\', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles -let $orderby: string; //The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) (default to undefined) -let $filter: string; //Filter items by property values (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.listMyDrivesBeta( - $orderby, - $filter -); +```ts +import { + Configuration, + MeDrivesApi, +} from ''; +import type { ListMyDrivesBetaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeDrivesApi(config); + + const body = { + // string | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. (optional) + $orderby: lastModifiedDateTime desc, + // string | Filter items by property values (optional) + $filter: driveType eq 'project', + } satisfies ListMyDrivesBetaRequest; + + try { + const data = await api.listMyDrivesBeta(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$orderby** | [**string**] | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | (optional) defaults to undefined| -| **$filter** | [**string**] | Filter items by property values | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$orderby** | `string` | The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. | [Optional] [Defaults to `undefined`] | +| **$filter** | `string` | Filter items by property values | [Optional] [Defaults to `undefined`] | ### Return type -**CollectionOfDrives** +[**CollectionOfDrives**](CollectionOfDrives.md) ### Authorization @@ -103,15 +144,15 @@ const { status, data } = await apiInstance.listMyDrivesBeta( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved spaces | - | -|**0** | error | - | +| **200** | Retrieved spaces | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/MeUserApi.md b/web/packages/web-client/src/graph/generated/docs/MeUserApi.md index 9f10cf762c7..0433ca8cee8 100644 --- a/web/packages/web-client/src/graph/generated/docs/MeUserApi.md +++ b/web/packages/web-client/src/graph/generated/docs/MeUserApi.md @@ -2,43 +2,64 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**getOwnUser**](#getownuser) | **GET** /v1.0/me | Get current user| -|[**updateOwnUser**](#updateownuser) | **PATCH** /v1.0/me | Update the current user| +| [**getOwnUser**](MeUserApi.md#getownuser) | **GET** /v1.0/me | Get current user | +| [**updateOwnUser**](MeUserApi.md#updateownuser) | **PATCH** /v1.0/me | Update the current user | -# **getOwnUser** -> User getOwnUser() -### Example +## getOwnUser -```typescript -import { - MeUserApi, - Configuration -} from './api'; +> User getOwnUser($expand) -const configuration = new Configuration(); -const apiInstance = new MeUserApi(configuration); +Get current user -let $expand: Set<'memberOf'>; //Expand related entities (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.getOwnUser( - $expand -); +```ts +import { + Configuration, + MeUserApi, +} from ''; +import type { GetOwnUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeUserApi(config); + + const body = { + // Set<'memberOf'> | Expand related entities (optional) + $expand: ..., + } satisfies GetOwnUserRequest; + + try { + const data = await api.getOwnUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$expand** | **Array<'memberOf'>** | Expand related entities | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$expand** | `memberOf` | Expand related entities | [Optional] [Enum: memberOf] | ### Return type -**User** +[**User**](User.md) ### Authorization @@ -46,51 +67,70 @@ const { status, data } = await apiInstance.getOwnUser( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entity | - | -|**0** | error | - | +| **200** | Retrieved entity | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **updateOwnUser** -> User updateOwnUser() +## updateOwnUser -### Example +> User updateOwnUser(userUpdate) -```typescript -import { - MeUserApi, - Configuration, - UserUpdate -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new MeUserApi(configuration); +Update the current user -let userUpdate: UserUpdate; //New user values (optional) +### Example -const { status, data } = await apiInstance.updateOwnUser( - userUpdate -); +```ts +import { + Configuration, + MeUserApi, +} from ''; +import type { UpdateOwnUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new MeUserApi(config); + + const body = { + // UserUpdate | New user values (optional) + userUpdate: {"preferredLanguage":"en"}, + } satisfies UpdateOwnUserRequest; + + try { + const data = await api.updateOwnUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userUpdate** | **UserUpdate**| New user values | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userUpdate** | [UserUpdate](UserUpdate.md) | New user values | [Optional] | ### Return type -**User** +[**User**](User.md) ### Authorization @@ -98,15 +138,15 @@ const { status, data } = await apiInstance.updateOwnUser( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Success | - | -|**0** | error | - | +| **200** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/MemberReference.md b/web/packages/web-client/src/graph/generated/docs/MemberReference.md index 43ee0d75c62..c728f794aca 100644 --- a/web/packages/web-client/src/graph/generated/docs/MemberReference.md +++ b/web/packages/web-client/src/graph/generated/docs/MemberReference.md @@ -1,20 +1,34 @@ + # MemberReference ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**odata_id** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`atOdataId` | string ## Example ```typescript -import { MemberReference } from './api'; +import type { MemberReference } from '' + +// TODO: Update the object below with actual values +const example = { + "atOdataId": null, +} satisfies MemberReference + +console.log(example) -const instance: MemberReference = { - odata_id, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MemberReference +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ObjectIdentity.md b/web/packages/web-client/src/graph/generated/docs/ObjectIdentity.md index 4ea13ee2faa..6714e9243b4 100644 --- a/web/packages/web-client/src/graph/generated/docs/ObjectIdentity.md +++ b/web/packages/web-client/src/graph/generated/docs/ObjectIdentity.md @@ -1,23 +1,37 @@ + # ObjectIdentity Represents an identity used to sign in to a user account ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**issuer** | **string** | domain of the Provider issuing the identity | [optional] [default to undefined] -**issuerAssignedId** | **string** | The unique id assigned by the issuer to the account | [optional] [default to undefined] +Name | Type +------------ | ------------- +`issuer` | string +`issuerAssignedId` | string ## Example ```typescript -import { ObjectIdentity } from './api'; +import type { ObjectIdentity } from '' + +// TODO: Update the object below with actual values +const example = { + "issuer": null, + "issuerAssignedId": null, +} satisfies ObjectIdentity + +console.log(example) -const instance: ObjectIdentity = { - issuer, - issuerAssignedId, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ObjectIdentity +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/OdataError.md b/web/packages/web-client/src/graph/generated/docs/OdataError.md index 768d640c5c3..68ccc2c571f 100644 --- a/web/packages/web-client/src/graph/generated/docs/OdataError.md +++ b/web/packages/web-client/src/graph/generated/docs/OdataError.md @@ -1,20 +1,34 @@ + # OdataError ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | [**OdataErrorMain**](OdataErrorMain.md) | | [default to undefined] +Name | Type +------------ | ------------- +`error` | [OdataErrorMain](OdataErrorMain.md) ## Example ```typescript -import { OdataError } from './api'; +import type { OdataError } from '' + +// TODO: Update the object below with actual values +const example = { + "error": null, +} satisfies OdataError + +console.log(example) -const instance: OdataError = { - error, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OdataError +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/OdataErrorDetail.md b/web/packages/web-client/src/graph/generated/docs/OdataErrorDetail.md index 9e0cdcd42dd..48a68587183 100644 --- a/web/packages/web-client/src/graph/generated/docs/OdataErrorDetail.md +++ b/web/packages/web-client/src/graph/generated/docs/OdataErrorDetail.md @@ -1,24 +1,38 @@ + # OdataErrorDetail ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **string** | | [default to undefined] -**message** | **string** | | [default to undefined] -**target** | **string** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`code` | string +`message` | string +`target` | string ## Example ```typescript -import { OdataErrorDetail } from './api'; +import type { OdataErrorDetail } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "message": null, + "target": null, +} satisfies OdataErrorDetail + +console.log(example) -const instance: OdataErrorDetail = { - code, - message, - target, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OdataErrorDetail +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/OdataErrorMain.md b/web/packages/web-client/src/graph/generated/docs/OdataErrorMain.md index b448c0d4797..7c0b787ce59 100644 --- a/web/packages/web-client/src/graph/generated/docs/OdataErrorMain.md +++ b/web/packages/web-client/src/graph/generated/docs/OdataErrorMain.md @@ -1,28 +1,42 @@ + # OdataErrorMain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **string** | | [default to undefined] -**message** | **string** | | [default to undefined] -**target** | **string** | | [optional] [default to undefined] -**details** | [**Array<OdataErrorDetail>**](OdataErrorDetail.md) | | [optional] [default to undefined] -**innererror** | **object** | The structure of this object is service-specific | [optional] [default to undefined] +Name | Type +------------ | ------------- +`code` | string +`message` | string +`target` | string +`details` | [Array<OdataErrorDetail>](OdataErrorDetail.md) +`innererror` | object ## Example ```typescript -import { OdataErrorMain } from './api'; - -const instance: OdataErrorMain = { - code, - message, - target, - details, - innererror, -}; +import type { OdataErrorMain } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "message": null, + "target": null, + "details": null, + "innererror": null, +} satisfies OdataErrorMain + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OdataErrorMain +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/OpenGraphFile.md b/web/packages/web-client/src/graph/generated/docs/OpenGraphFile.md index 7d665fabc42..2b7f78e8460 100644 --- a/web/packages/web-client/src/graph/generated/docs/OpenGraphFile.md +++ b/web/packages/web-client/src/graph/generated/docs/OpenGraphFile.md @@ -1,25 +1,39 @@ + # OpenGraphFile File metadata, if the item is a file. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hashes** | [**Hashes**](Hashes.md) | | [optional] [default to undefined] -**mimeType** | **string** | The MIME type for the file. This is determined by logic on the server and might not be the value provided when the file was uploaded. Read-only. | [optional] [readonly] [default to undefined] -**processingMetadata** | **boolean** | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`hashes` | [Hashes](Hashes.md) +`mimeType` | string +`processingMetadata` | boolean ## Example ```typescript -import { OpenGraphFile } from './api'; +import type { OpenGraphFile } from '' + +// TODO: Update the object below with actual values +const example = { + "hashes": null, + "mimeType": null, + "processingMetadata": null, +} satisfies OpenGraphFile + +console.log(example) -const instance: OpenGraphFile = { - hashes, - mimeType, - processingMetadata, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OpenGraphFile +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/PasswordChange.md b/web/packages/web-client/src/graph/generated/docs/PasswordChange.md index f98cb685da6..188de618cd8 100644 --- a/web/packages/web-client/src/graph/generated/docs/PasswordChange.md +++ b/web/packages/web-client/src/graph/generated/docs/PasswordChange.md @@ -1,22 +1,36 @@ + # PasswordChange ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currentPassword** | **string** | | [default to undefined] -**newPassword** | **string** | | [default to undefined] +Name | Type +------------ | ------------- +`currentPassword` | string +`newPassword` | string ## Example ```typescript -import { PasswordChange } from './api'; +import type { PasswordChange } from '' + +// TODO: Update the object below with actual values +const example = { + "currentPassword": null, + "newPassword": null, +} satisfies PasswordChange + +console.log(example) -const instance: PasswordChange = { - currentPassword, - newPassword, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as PasswordChange +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/PasswordProfile.md b/web/packages/web-client/src/graph/generated/docs/PasswordProfile.md index cc47c839007..62b9fdbdb03 100644 --- a/web/packages/web-client/src/graph/generated/docs/PasswordProfile.md +++ b/web/packages/web-client/src/graph/generated/docs/PasswordProfile.md @@ -1,23 +1,37 @@ + # PasswordProfile Password Profile associated with a user ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**forceChangePasswordNextSignIn** | **boolean** | If true the user is required to change their password upon the next login | [optional] [default to false] -**password** | **string** | The user\'s password | [optional] [default to undefined] +Name | Type +------------ | ------------- +`forceChangePasswordNextSignIn` | boolean +`password` | string ## Example ```typescript -import { PasswordProfile } from './api'; +import type { PasswordProfile } from '' + +// TODO: Update the object below with actual values +const example = { + "forceChangePasswordNextSignIn": null, + "password": null, +} satisfies PasswordProfile + +console.log(example) -const instance: PasswordProfile = { - forceChangePasswordNextSignIn, - password, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as PasswordProfile +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Permission.md b/web/packages/web-client/src/graph/generated/docs/Permission.md index 997219baad3..f1a043b0072 100644 --- a/web/packages/web-client/src/graph/generated/docs/Permission.md +++ b/web/packages/web-client/src/graph/generated/docs/Permission.md @@ -1,39 +1,53 @@ + # Permission The Permission resource provides information about a sharing permission granted for a DriveItem resource. ### Remarks The Permission resource uses *facets* to provide information about the kind of permission represented by the resource. Permissions with a `link` facet represent sharing links created on the item. Sharing links contain a unique token that provides access to the item for anyone with the link. Permissions with a `invitation` facet represent permissions added by inviting specific users or groups to have access to the file. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The unique identifier of the permission among all permissions on the item. Read-only. | [optional] [readonly] [default to undefined] -**hasPassword** | **boolean** | Indicates whether the password is set for this permission. This property only appears in the response. Optional. Read-only. | [optional] [readonly] [default to undefined] -**expirationDateTime** | **string** | An optional expiration date which limits the permission in time. | [optional] [default to undefined] -**createdDateTime** | **string** | An optional creation date. Libregraph only. | [optional] [default to undefined] -**grantedToV2** | [**SharePointIdentitySet**](SharePointIdentitySet.md) | | [optional] [default to undefined] -**link** | [**SharingLink**](SharingLink.md) | | [optional] [default to undefined] -**roles** | **Array<string>** | | [optional] [default to undefined] -**grantedToIdentities** | [**Array<IdentitySet>**](IdentitySet.md) | For link type permissions, the details of the identity to whom permission was granted. This could be used to grant access to a an external user that can be identified by email, aka guest accounts. | [optional] [default to undefined] -**libre_graph_permissions_actions** | **Array<string>** | Use this to create a permission with custom actions. | [optional] [default to undefined] -**invitation** | [**SharingInvitation**](SharingInvitation.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`hasPassword` | boolean +`expirationDateTime` | Date +`createdDateTime` | Date +`grantedToV2` | [SharePointIdentitySet](SharePointIdentitySet.md) +`link` | [SharingLink](SharingLink.md) +`roles` | Array<string> +`grantedToIdentities` | [Array<IdentitySet>](IdentitySet.md) +`atLibreGraphPermissionsActions` | Array<string> +`invitation` | [SharingInvitation](SharingInvitation.md) ## Example ```typescript -import { Permission } from './api'; - -const instance: Permission = { - id, - hasPassword, - expirationDateTime, - createdDateTime, - grantedToV2, - link, - roles, - grantedToIdentities, - libre_graph_permissions_actions, - invitation, -}; +import type { Permission } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "hasPassword": null, + "expirationDateTime": null, + "createdDateTime": null, + "grantedToV2": null, + "link": null, + "roles": null, + "grantedToIdentities": null, + "atLibreGraphPermissionsActions": null, + "invitation": null, +} satisfies Permission + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Permission +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Photo.md b/web/packages/web-client/src/graph/generated/docs/Photo.md index f101222bd32..9c015e8a189 100644 --- a/web/packages/web-client/src/graph/generated/docs/Photo.md +++ b/web/packages/web-client/src/graph/generated/docs/Photo.md @@ -1,37 +1,51 @@ + # Photo The photo resource provides photo and camera properties, for example, EXIF metadata, on a driveItem. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cameraMake** | **string** | Camera manufacturer. Read-only. | [optional] [default to undefined] -**cameraModel** | **string** | Camera model. Read-only. | [optional] [default to undefined] -**exposureDenominator** | **number** | The denominator for the exposure time fraction from the camera. Read-only. | [optional] [default to undefined] -**exposureNumerator** | **number** | The numerator for the exposure time fraction from the camera. Read-only. | [optional] [default to undefined] -**fNumber** | **number** | The F-stop value from the camera. Read-only. | [optional] [default to undefined] -**focalLength** | **number** | The focal length from the camera. Read-only. | [optional] [default to undefined] -**iso** | **number** | The ISO value from the camera. Read-only. | [optional] [default to undefined] -**orientation** | **number** | The orientation value from the camera. Read-only. | [optional] [default to undefined] -**takenDateTime** | **string** | Represents the date and time the photo was taken. Read-only. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`cameraMake` | string +`cameraModel` | string +`exposureDenominator` | number +`exposureNumerator` | number +`fNumber` | number +`focalLength` | number +`iso` | number +`orientation` | number +`takenDateTime` | Date ## Example ```typescript -import { Photo } from './api'; - -const instance: Photo = { - cameraMake, - cameraModel, - exposureDenominator, - exposureNumerator, - fNumber, - focalLength, - iso, - orientation, - takenDateTime, -}; +import type { Photo } from '' + +// TODO: Update the object below with actual values +const example = { + "cameraMake": null, + "cameraModel": null, + "exposureDenominator": null, + "exposureNumerator": null, + "fNumber": null, + "focalLength": null, + "iso": null, + "orientation": null, + "takenDateTime": null, +} satisfies Photo + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Photo +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Quota.md b/web/packages/web-client/src/graph/generated/docs/Quota.md index 0edbe1c3ddd..3e69e5e40d0 100644 --- a/web/packages/web-client/src/graph/generated/docs/Quota.md +++ b/web/packages/web-client/src/graph/generated/docs/Quota.md @@ -1,29 +1,43 @@ + # Quota Optional. Information about the drive\'s storage space quota. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deleted** | **number** | Total space consumed by files in the recycle bin, in bytes. Read-only. | [optional] [readonly] [default to undefined] -**remaining** | **number** | Total space remaining before reaching the quota limit, in bytes. Read-only. | [optional] [readonly] [default to undefined] -**state** | **string** | Enumeration value that indicates the state of the storage space. Either \"normal\", \"nearing\", \"critical\" or \"exceeded\". Read-only. | [optional] [readonly] [default to undefined] -**total** | **number** | Total allowed storage space, in bytes. Read-only. | [optional] [readonly] [default to undefined] -**used** | **number** | Total space used, in bytes. Read-only. | [optional] [readonly] [default to undefined] +Name | Type +------------ | ------------- +`deleted` | number +`remaining` | number +`state` | string +`total` | number +`used` | number ## Example ```typescript -import { Quota } from './api'; - -const instance: Quota = { - deleted, - remaining, - state, - total, - used, -}; +import type { Quota } from '' + +// TODO: Update the object below with actual values +const example = { + "deleted": null, + "remaining": null, + "state": null, + "total": null, + "used": null, +} satisfies Quota + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Quota +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/RemoteItem.md b/web/packages/web-client/src/graph/generated/docs/RemoteItem.md index c6257e3cefd..76b466e7287 100644 --- a/web/packages/web-client/src/graph/generated/docs/RemoteItem.md +++ b/web/packages/web-client/src/graph/generated/docs/RemoteItem.md @@ -1,63 +1,77 @@ + # RemoteItem Remote item data, if the item is shared from a drive other than the one being accessed. Read-only. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createdBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**createdDateTime** | **string** | Date and time of item creation. Read-only. | [optional] [default to undefined] -**file** | [**OpenGraphFile**](OpenGraphFile.md) | | [optional] [default to undefined] -**fileSystemInfo** | [**FileSystemInfo**](FileSystemInfo.md) | | [optional] [default to undefined] -**folder** | [**Folder**](Folder.md) | | [optional] [default to undefined] -**driveAlias** | **string** | The drive alias can be used in clients to make the urls user friendly. Example: \'personal/einstein\'. This will be used to resolve to the correct driveID. | [optional] [default to undefined] -**path** | **string** | The relative path of the item in relation to its drive root. | [optional] [default to undefined] -**rootId** | **string** | Unique identifier for the drive root of this item. Read-only. | [optional] [default to undefined] -**id** | **string** | Unique identifier for the remote item in its drive. Read-only. | [optional] [default to undefined] -**image** | [**Image**](Image.md) | | [optional] [default to undefined] -**lastModifiedBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**lastModifiedDateTime** | **string** | Date and time the item was last modified. Read-only. | [optional] [default to undefined] -**name** | **string** | Optional. Filename of the remote item. Read-only. | [optional] [default to undefined] -**eTag** | **string** | ETag for the item. Read-only. | [optional] [readonly] [default to undefined] -**cTag** | **string** | An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. | [optional] [readonly] [default to undefined] -**parentReference** | [**ItemReference**](ItemReference.md) | | [optional] [default to undefined] -**permissions** | [**Array<Permission>**](Permission.md) | The set of permissions for the item. Read-only. Nullable. | [optional] [readonly] [default to undefined] -**size** | **number** | Size of the remote item. Read-only. | [optional] [default to undefined] -**specialFolder** | [**SpecialFolder**](SpecialFolder.md) | | [optional] [default to undefined] -**webDavUrl** | **string** | DAV compatible URL for the item. | [optional] [default to undefined] -**webUrl** | **string** | URL that displays the resource in the browser. Read-only. | [optional] [default to undefined] -**spaceId** | **string** | The UUID of the space that contains the item. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`createdBy` | [IdentitySet](IdentitySet.md) +`createdDateTime` | Date +`file` | [OpenGraphFile](OpenGraphFile.md) +`fileSystemInfo` | [FileSystemInfo](FileSystemInfo.md) +`folder` | [Folder](Folder.md) +`driveAlias` | string +`path` | string +`rootId` | string +`id` | string +`image` | [Image](Image.md) +`lastModifiedBy` | [IdentitySet](IdentitySet.md) +`lastModifiedDateTime` | Date +`name` | string +`eTag` | string +`cTag` | string +`parentReference` | [ItemReference](ItemReference.md) +`permissions` | [Array<Permission>](Permission.md) +`size` | number +`specialFolder` | [SpecialFolder](SpecialFolder.md) +`webDavUrl` | string +`webUrl` | string +`spaceId` | string ## Example ```typescript -import { RemoteItem } from './api'; - -const instance: RemoteItem = { - createdBy, - createdDateTime, - file, - fileSystemInfo, - folder, - driveAlias, - path, - rootId, - id, - image, - lastModifiedBy, - lastModifiedDateTime, - name, - eTag, - cTag, - parentReference, - permissions, - size, - specialFolder, - webDavUrl, - webUrl, - spaceId, -}; +import type { RemoteItem } from '' + +// TODO: Update the object below with actual values +const example = { + "createdBy": null, + "createdDateTime": null, + "file": null, + "fileSystemInfo": null, + "folder": null, + "driveAlias": null, + "path": null, + "rootId": null, + "id": null, + "image": null, + "lastModifiedBy": null, + "lastModifiedDateTime": null, + "name": null, + "eTag": null, + "cTag": null, + "parentReference": null, + "permissions": null, + "size": null, + "specialFolder": null, + "webDavUrl": null, + "webUrl": null, + "spaceId": null, +} satisfies RemoteItem + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as RemoteItem +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/RoleManagementApi.md b/web/packages/web-client/src/graph/generated/docs/RoleManagementApi.md index fd330c0e80b..1a654192ad7 100644 --- a/web/packages/web-client/src/graph/generated/docs/RoleManagementApi.md +++ b/web/packages/web-client/src/graph/generated/docs/RoleManagementApi.md @@ -2,44 +2,66 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**getPermissionRoleDefinition**](#getpermissionroledefinition) | **GET** /v1beta1/roleManagement/permissions/roleDefinitions/{role-id} | Get unifiedRoleDefinition| -|[**listPermissionRoleDefinitions**](#listpermissionroledefinitions) | **GET** /v1beta1/roleManagement/permissions/roleDefinitions | List roleDefinitions| +| [**getPermissionRoleDefinition**](RoleManagementApi.md#getpermissionroledefinition) | **GET** /v1beta1/roleManagement/permissions/roleDefinitions/{role-id} | Get unifiedRoleDefinition | +| [**listPermissionRoleDefinitions**](RoleManagementApi.md#listpermissionroledefinitions) | **GET** /v1beta1/roleManagement/permissions/roleDefinitions | List roleDefinitions | -# **getPermissionRoleDefinition** -> UnifiedRoleDefinition getPermissionRoleDefinition() -Read the properties and relationships of a `unifiedRoleDefinition` object. -### Example +## getPermissionRoleDefinition -```typescript -import { - RoleManagementApi, - Configuration -} from './api'; +> UnifiedRoleDefinition getPermissionRoleDefinition(roleId) + +Get unifiedRoleDefinition -const configuration = new Configuration(); -const apiInstance = new RoleManagementApi(configuration); +Read the properties and relationships of a `unifiedRoleDefinition` object. -let roleId: string; //key: id of roleDefinition (default to undefined) +### Example -const { status, data } = await apiInstance.getPermissionRoleDefinition( - roleId -); +```ts +import { + Configuration, + RoleManagementApi, +} from ''; +import type { GetPermissionRoleDefinitionRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new RoleManagementApi(config); + + const body = { + // string | key: id of roleDefinition + roleId: roleId_example, + } satisfies GetPermissionRoleDefinitionRequest; + + try { + const data = await api.getPermissionRoleDefinition(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **roleId** | [**string**] | key: id of roleDefinition | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **roleId** | `string` | key: id of roleDefinition | [Defaults to `undefined`] | ### Return type -**UnifiedRoleDefinition** +[**UnifiedRoleDefinition**](UnifiedRoleDefinition.md) ### Authorization @@ -47,44 +69,64 @@ const { status, data } = await apiInstance.getPermissionRoleDefinition( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | OK | - | -|**0** | error | - | +| **200** | OK | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **listPermissionRoleDefinitions** -> UnifiedRoleDefinition listPermissionRoleDefinitions() -Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. +## listPermissionRoleDefinitions -### Example +> Array<UnifiedRoleDefinition> listPermissionRoleDefinitions() -```typescript -import { - RoleManagementApi, - Configuration -} from './api'; +List roleDefinitions -const configuration = new Configuration(); -const apiInstance = new RoleManagementApi(configuration); +Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites. -const { status, data } = await apiInstance.listPermissionRoleDefinitions(); +### Example + +```ts +import { + Configuration, + RoleManagementApi, +} from ''; +import type { ListPermissionRoleDefinitionsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new RoleManagementApi(config); + + try { + const data = await api.listPermissionRoleDefinitions(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**UnifiedRoleDefinition** +[**Array<UnifiedRoleDefinition>**](UnifiedRoleDefinition.md) ### Authorization @@ -92,15 +134,15 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | A list of permission roles than can be used when sharing with users or groups. | - | -|**0** | error | - | +| **200** | A list of permission roles than can be used when sharing with users or groups. | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/SharePointIdentitySet.md b/web/packages/web-client/src/graph/generated/docs/SharePointIdentitySet.md index 4de4fb4cb42..bee02a1294b 100644 --- a/web/packages/web-client/src/graph/generated/docs/SharePointIdentitySet.md +++ b/web/packages/web-client/src/graph/generated/docs/SharePointIdentitySet.md @@ -1,23 +1,37 @@ + # SharePointIdentitySet This resource is used to represent a set of identities associated with various events for an item, such as created by or last modified by. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user** | [**Identity**](Identity.md) | | [optional] [default to undefined] -**group** | [**Identity**](Identity.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`user` | [Identity](Identity.md) +`group` | [Identity](Identity.md) ## Example ```typescript -import { SharePointIdentitySet } from './api'; +import type { SharePointIdentitySet } from '' + +// TODO: Update the object below with actual values +const example = { + "user": null, + "group": null, +} satisfies SharePointIdentitySet + +console.log(example) -const instance: SharePointIdentitySet = { - user, - group, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SharePointIdentitySet +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/SharingInvitation.md b/web/packages/web-client/src/graph/generated/docs/SharingInvitation.md index 869cb938fdc..c033a0bc92f 100644 --- a/web/packages/web-client/src/graph/generated/docs/SharingInvitation.md +++ b/web/packages/web-client/src/graph/generated/docs/SharingInvitation.md @@ -1,21 +1,35 @@ + # SharingInvitation invitation-related data items ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invitedBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`invitedBy` | [IdentitySet](IdentitySet.md) ## Example ```typescript -import { SharingInvitation } from './api'; +import type { SharingInvitation } from '' + +// TODO: Update the object below with actual values +const example = { + "invitedBy": null, +} satisfies SharingInvitation + +console.log(example) -const instance: SharingInvitation = { - invitedBy, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SharingInvitation +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/SharingLink.md b/web/packages/web-client/src/graph/generated/docs/SharingLink.md index 0d2cd85e50d..7543e2a8cac 100644 --- a/web/packages/web-client/src/graph/generated/docs/SharingLink.md +++ b/web/packages/web-client/src/graph/generated/docs/SharingLink.md @@ -1,29 +1,43 @@ + # SharingLink The `SharingLink` resource groups link-related data items into a single structure. If a `permission` resource has a non-null `sharingLink` facet, the permission represents a sharing link (as opposed to permissions granted to a person or group). ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**SharingLinkType**](SharingLinkType.md) | | [optional] [default to undefined] -**preventsDownload** | **boolean** | If `true` then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item. | [optional] [readonly] [default to undefined] -**webUrl** | **string** | A URL that opens the item in the browser on the website. | [optional] [readonly] [default to undefined] -**libre_graph_displayName** | **string** | Provides a user-visible display name of the link. Optional. Libregraph only. | [optional] [default to undefined] -**libre_graph_quickLink** | **boolean** | The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`type` | [SharingLinkType](SharingLinkType.md) +`preventsDownload` | boolean +`webUrl` | string +`atLibreGraphDisplayName` | string +`atLibreGraphQuickLink` | boolean ## Example ```typescript -import { SharingLink } from './api'; - -const instance: SharingLink = { - type, - preventsDownload, - webUrl, - libre_graph_displayName, - libre_graph_quickLink, -}; +import type { SharingLink } from '' + +// TODO: Update the object below with actual values +const example = { + "type": null, + "preventsDownload": null, + "webUrl": null, + "atLibreGraphDisplayName": null, + "atLibreGraphQuickLink": null, +} satisfies SharingLink + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SharingLink +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/SharingLinkPassword.md b/web/packages/web-client/src/graph/generated/docs/SharingLinkPassword.md index 6ebe5a70a89..b43ddff8866 100644 --- a/web/packages/web-client/src/graph/generated/docs/SharingLinkPassword.md +++ b/web/packages/web-client/src/graph/generated/docs/SharingLinkPassword.md @@ -1,21 +1,35 @@ + # SharingLinkPassword The sharing link password which should be set. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**password** | **string** | Password. It may require a password policy. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`password` | string ## Example ```typescript -import { SharingLinkPassword } from './api'; +import type { SharingLinkPassword } from '' + +// TODO: Update the object below with actual values +const example = { + "password": null, +} satisfies SharingLinkPassword + +console.log(example) -const instance: SharingLinkPassword = { - password, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SharingLinkPassword +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/SharingLinkType.md b/web/packages/web-client/src/graph/generated/docs/SharingLinkType.md index 1068f1c8dfa..a14ef32aee2 100644 --- a/web/packages/web-client/src/graph/generated/docs/SharingLinkType.md +++ b/web/packages/web-client/src/graph/generated/docs/SharingLinkType.md @@ -1,19 +1,33 @@ + # SharingLinkType The type of the link created. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | internal | Internal | Creates an internal link without any permissions. | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | -## Enum +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { SharingLinkType } from '' -* `Internal` (value: `'internal'`) +// TODO: Update the object below with actual values +const example = { +} satisfies SharingLinkType -* `View` (value: `'view'`) +console.log(example) -* `Upload` (value: `'upload'`) +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) -* `Edit` (value: `'edit'`) +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SharingLinkType +console.log(exampleParsed) +``` -* `CreateOnly` (value: `'createOnly'`) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -* `BlocksDownload` (value: `'blocksDownload'`) -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/SignInActivity.md b/web/packages/web-client/src/graph/generated/docs/SignInActivity.md index 427361052cc..f55385a4922 100644 --- a/web/packages/web-client/src/graph/generated/docs/SignInActivity.md +++ b/web/packages/web-client/src/graph/generated/docs/SignInActivity.md @@ -1,21 +1,35 @@ + # SignInActivity Provides the last successful sign-in attempt for a user ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lastSuccessfulSignInDateTime** | **string** | The date and time of the last successful sign-in for the user. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`lastSuccessfulSignInDateTime` | Date ## Example ```typescript -import { SignInActivity } from './api'; +import type { SignInActivity } from '' + +// TODO: Update the object below with actual values +const example = { + "lastSuccessfulSignInDateTime": null, +} satisfies SignInActivity + +console.log(example) -const instance: SignInActivity = { - lastSuccessfulSignInDateTime, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SignInActivity +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/SpecialFolder.md b/web/packages/web-client/src/graph/generated/docs/SpecialFolder.md index fe08adda280..125b38b3984 100644 --- a/web/packages/web-client/src/graph/generated/docs/SpecialFolder.md +++ b/web/packages/web-client/src/graph/generated/docs/SpecialFolder.md @@ -1,21 +1,35 @@ + # SpecialFolder If the current item is also available as a special folder, this facet is returned. Read-only ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | The unique identifier for this item in the /drive/special collection | [optional] [default to undefined] +Name | Type +------------ | ------------- +`name` | string ## Example ```typescript -import { SpecialFolder } from './api'; +import type { SpecialFolder } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, +} satisfies SpecialFolder + +console.log(example) -const instance: SpecialFolder = { - name, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SpecialFolder +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/TagAssignment.md b/web/packages/web-client/src/graph/generated/docs/TagAssignment.md index 185f0ab7102..bb55ca587d7 100644 --- a/web/packages/web-client/src/graph/generated/docs/TagAssignment.md +++ b/web/packages/web-client/src/graph/generated/docs/TagAssignment.md @@ -1,22 +1,36 @@ + # TagAssignment ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**resourceId** | **string** | | [default to undefined] -**tags** | **Array<string>** | | [default to undefined] +Name | Type +------------ | ------------- +`resourceId` | string +`tags` | Array<string> ## Example ```typescript -import { TagAssignment } from './api'; +import type { TagAssignment } from '' + +// TODO: Update the object below with actual values +const example = { + "resourceId": null, + "tags": null, +} satisfies TagAssignment + +console.log(example) -const instance: TagAssignment = { - resourceId, - tags, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TagAssignment +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/TagUnassignment.md b/web/packages/web-client/src/graph/generated/docs/TagUnassignment.md index f258f52784c..cfafc4bd940 100644 --- a/web/packages/web-client/src/graph/generated/docs/TagUnassignment.md +++ b/web/packages/web-client/src/graph/generated/docs/TagUnassignment.md @@ -1,22 +1,36 @@ + # TagUnassignment ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**resourceId** | **string** | | [default to undefined] -**tags** | **Array<string>** | | [default to undefined] +Name | Type +------------ | ------------- +`resourceId` | string +`tags` | Array<string> ## Example ```typescript -import { TagUnassignment } from './api'; +import type { TagUnassignment } from '' + +// TODO: Update the object below with actual values +const example = { + "resourceId": null, + "tags": null, +} satisfies TagUnassignment + +console.log(example) -const instance: TagUnassignment = { - resourceId, - tags, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TagUnassignment +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/TagsApi.md b/web/packages/web-client/src/graph/generated/docs/TagsApi.md index 2a01e3a9bd6..fc4a604e227 100644 --- a/web/packages/web-client/src/graph/generated/docs/TagsApi.md +++ b/web/packages/web-client/src/graph/generated/docs/TagsApi.md @@ -2,45 +2,65 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**assignTags**](#assigntags) | **PUT** /v1.0/extensions/org.libregraph/tags | Assign tags to a resource| -|[**getTags**](#gettags) | **GET** /v1.0/extensions/org.libregraph/tags | Get all known tags| -|[**unassignTags**](#unassigntags) | **DELETE** /v1.0/extensions/org.libregraph/tags | Unassign tags from a resource| +| [**assignTags**](TagsApi.md#assigntags) | **PUT** /v1.0/extensions/org.libregraph/tags | Assign tags to a resource | +| [**getTags**](TagsApi.md#gettags) | **GET** /v1.0/extensions/org.libregraph/tags | Get all known tags | +| [**unassignTags**](TagsApi.md#unassigntags) | **DELETE** /v1.0/extensions/org.libregraph/tags | Unassign tags from a resource | -# **assignTags** -> assignTags() -### Example +## assignTags -```typescript -import { - TagsApi, - Configuration, - TagAssignment -} from './api'; +> assignTags(tagAssignment) -const configuration = new Configuration(); -const apiInstance = new TagsApi(configuration); +Assign tags to a resource -let tagAssignment: TagAssignment; // (optional) +### Example -const { status, data } = await apiInstance.assignTags( - tagAssignment -); +```ts +import { + Configuration, + TagsApi, +} from ''; +import type { AssignTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new TagsApi(config); + + const body = { + // TagAssignment (optional) + tagAssignment: ..., + } satisfies AssignTagsRequest; + + try { + const data = await api.assignTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **tagAssignment** | **TagAssignment**| | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tagAssignment** | [TagAssignment](TagAssignment.md) | | [Optional] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -48,43 +68,62 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | No content | - | -|**0** | error | - | +| **200** | No content | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **getTags** +## getTags + > CollectionOfTags getTags() +Get all known tags ### Example -```typescript +```ts import { - TagsApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new TagsApi(configuration); - -const { status, data } = await apiInstance.getTags(); + Configuration, + TagsApi, +} from ''; +import type { GetTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new TagsApi(config); + + try { + const data = await api.getTags(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -This endpoint does not have any parameters. +This endpoint does not need any parameter. ### Return type -**CollectionOfTags** +[**CollectionOfTags**](CollectionOfTags.md) ### Authorization @@ -92,51 +131,70 @@ This endpoint does not have any parameters. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved tags | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **200** | Retrieved tags | - | +| **0** | error | - | -# **unassignTags** -> unassignTags() +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## unassignTags -```typescript -import { - TagsApi, - Configuration, - TagUnassignment -} from './api'; +> unassignTags(tagUnassignment) -const configuration = new Configuration(); -const apiInstance = new TagsApi(configuration); +Unassign tags from a resource -let tagUnassignment: TagUnassignment; // (optional) +### Example -const { status, data } = await apiInstance.unassignTags( - tagUnassignment -); +```ts +import { + Configuration, + TagsApi, +} from ''; +import type { UnassignTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new TagsApi(config); + + const body = { + // TagUnassignment (optional) + tagUnassignment: ..., + } satisfies UnassignTagsRequest; + + try { + const data = await api.unassignTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **tagUnassignment** | **TagUnassignment**| | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tagUnassignment** | [TagUnassignment](TagUnassignment.md) | | [Optional] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -144,15 +202,15 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | No content | - | -|**0** | error | - | +| **200** | No content | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/Thumbnail.md b/web/packages/web-client/src/graph/generated/docs/Thumbnail.md index 9cb0039a090..138ec1d312a 100644 --- a/web/packages/web-client/src/graph/generated/docs/Thumbnail.md +++ b/web/packages/web-client/src/graph/generated/docs/Thumbnail.md @@ -1,29 +1,43 @@ + # Thumbnail The thumbnail resource type represents a thumbnail for an image, video, document, or any item that has a bitmap representation. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | **string** | The content stream for the thumbnail. | [optional] [default to undefined] -**height** | **number** | The height of the thumbnail, in pixels. | [optional] [default to undefined] -**sourceItemId** | **string** | The unique identifier of the item that provided the thumbnail. This is only available when a folder thumbnail is requested. | [optional] [default to undefined] -**url** | **string** | The URL used to fetch the thumbnail content. | [optional] [default to undefined] -**width** | **number** | The width of the thumbnail, in pixels. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`content` | string +`height` | number +`sourceItemId` | string +`url` | string +`width` | number ## Example ```typescript -import { Thumbnail } from './api'; - -const instance: Thumbnail = { - content, - height, - sourceItemId, - url, - width, -}; +import type { Thumbnail } from '' + +// TODO: Update the object below with actual values +const example = { + "content": null, + "height": null, + "sourceItemId": null, + "url": null, + "width": null, +} satisfies Thumbnail + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Thumbnail +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/ThumbnailSet.md b/web/packages/web-client/src/graph/generated/docs/ThumbnailSet.md index 49bebf231e6..83904c2d6e8 100644 --- a/web/packages/web-client/src/graph/generated/docs/ThumbnailSet.md +++ b/web/packages/web-client/src/graph/generated/docs/ThumbnailSet.md @@ -1,29 +1,43 @@ + # ThumbnailSet The ThumbnailSet resource is a keyed collection of thumbnail resources. It\'s used to represent a set of thumbnails associated with a DriveItem. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | The ID within the item. Read-only. | [optional] [default to undefined] -**large** | [**Thumbnail**](Thumbnail.md) | | [optional] [default to undefined] -**medium** | [**Thumbnail**](Thumbnail.md) | | [optional] [default to undefined] -**small** | [**Thumbnail**](Thumbnail.md) | | [optional] [default to undefined] -**source** | [**Thumbnail**](Thumbnail.md) | | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`large` | [Thumbnail](Thumbnail.md) +`medium` | [Thumbnail](Thumbnail.md) +`small` | [Thumbnail](Thumbnail.md) +`source` | [Thumbnail](Thumbnail.md) ## Example ```typescript -import { ThumbnailSet } from './api'; - -const instance: ThumbnailSet = { - id, - large, - medium, - small, - source, -}; +import type { ThumbnailSet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "large": null, + "medium": null, + "small": null, + "source": null, +} satisfies ThumbnailSet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ThumbnailSet +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/Trash.md b/web/packages/web-client/src/graph/generated/docs/Trash.md index 1ec4a438726..7466da10925 100644 --- a/web/packages/web-client/src/graph/generated/docs/Trash.md +++ b/web/packages/web-client/src/graph/generated/docs/Trash.md @@ -1,23 +1,37 @@ + # Trash Metadata for trashed drive Items ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**trashedBy** | [**IdentitySet**](IdentitySet.md) | | [optional] [default to undefined] -**trashedDateTime** | **string** | The UTC date and time the folder was marked as trashed. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`trashedBy` | [IdentitySet](IdentitySet.md) +`trashedDateTime` | Date ## Example ```typescript -import { Trash } from './api'; +import type { Trash } from '' + +// TODO: Update the object below with actual values +const example = { + "trashedBy": null, + "trashedDateTime": null, +} satisfies Trash + +console.log(example) -const instance: Trash = { - trashedBy, - trashedDateTime, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Trash +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/UnifiedRoleDefinition.md b/web/packages/web-client/src/graph/generated/docs/UnifiedRoleDefinition.md index 3e02c57faa2..fbc885493ce 100644 --- a/web/packages/web-client/src/graph/generated/docs/UnifiedRoleDefinition.md +++ b/web/packages/web-client/src/graph/generated/docs/UnifiedRoleDefinition.md @@ -1,29 +1,43 @@ + # UnifiedRoleDefinition A role definition is a collection of permissions in libre graph listing the operations that can be performed and the resources against which they can performed. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | **string** | The description for the unifiedRoleDefinition. | [optional] [default to undefined] -**displayName** | **string** | The display name for the unifiedRoleDefinition. Required. Supports $filter (`eq`, `in`). | [optional] [default to undefined] -**id** | **string** | The unique identifier for the role definition. Key, not nullable, Read-only. Inherited from entity. Supports $filter (`eq`, `in`). | [optional] [default to undefined] -**rolePermissions** | [**Array<UnifiedRolePermission>**](UnifiedRolePermission.md) | List of permissions included in the role. | [optional] [default to undefined] -**libre_graph_weight** | **number** | When presenting a list of roles the weight can be used to order them in a meaningful way. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an unset weight. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`description` | string +`displayName` | string +`id` | string +`rolePermissions` | [Array<UnifiedRolePermission>](UnifiedRolePermission.md) +`atLibreGraphWeight` | number ## Example ```typescript -import { UnifiedRoleDefinition } from './api'; - -const instance: UnifiedRoleDefinition = { - description, - displayName, - id, - rolePermissions, - libre_graph_weight, -}; +import type { UnifiedRoleDefinition } from '' + +// TODO: Update the object below with actual values +const example = { + "description": null, + "displayName": null, + "id": null, + "rolePermissions": null, + "atLibreGraphWeight": null, +} satisfies UnifiedRoleDefinition + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as UnifiedRoleDefinition +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/UnifiedRolePermission.md b/web/packages/web-client/src/graph/generated/docs/UnifiedRolePermission.md index ae817935572..72af7984cfd 100644 --- a/web/packages/web-client/src/graph/generated/docs/UnifiedRolePermission.md +++ b/web/packages/web-client/src/graph/generated/docs/UnifiedRolePermission.md @@ -1,23 +1,37 @@ + # UnifiedRolePermission Represents a collection of allowed resource actions and the conditions that must be met for the action to be allowed. Resource actions are tasks that can be performed on a resource. For example, an application resource may support create, update, delete, and reset password actions. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allowedResourceActions** | **Array<string>** | Set of tasks that can be performed on a resource. Required. The following is the schema for resource actions: ``` {Namespace}/{Entity}/{PropertySet}/{Action} ``` For example: `libre.graph/applications/credentials/update` * *{Namespace}* - The services that exposes the task. For example, all tasks in libre graph use the namespace `libre.graph`. * *{Entity}* - The logical features or components exposed by the service in libre graph. For example, `applications`, `servicePrincipals`, or `groups`. * *{PropertySet}* - Optional. The specific properties or aspects of the entity for which access is being granted. For example, `libre.graph/applications/authentication/read` grants the ability to read the reply URL, logout URL, and implicit flow property on the **application** object in libre graph. The following are reserved names for common property sets: * `allProperties` - Designates all properties of the entity, including privileged properties. Examples include `libre.graph/applications/allProperties/read` and `libre.graph/applications/allProperties/update`. * `basic` - Designates common read properties but excludes privileged ones. For example, `libre.graph/applications/basic/update` includes the ability to update standard properties like display name. * `standard` - Designates common update properties but excludes privileged ones. For example, `libre.graph/applications/standard/read`. * *{Actions}* - The operations being granted. In most circumstances, permissions should be expressed in terms of CRUD operations or allTasks. Actions include: * `create` - The ability to create a new instance of the entity. * `read` - The ability to read a given property set (including allProperties). * `update` - The ability to update a given property set (including allProperties). * `delete` - The ability to delete a given entity. * `allTasks` - Represents all CRUD operations (create, read, update, and delete). Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` | Managing drives would be a different entity. A space manager role could be written as `libre.graph/drive/permission/allTasks`. | [optional] [default to undefined] -**condition** | **string** | Optional constraints that must be met for the permission to be effective. Not supported for custom roles. Conditions define constraints that must be met. For example, a requirement that target resource must have a certain property. The following are the supported conditions: * Drive: `exists @Resource.Drive` - The target resource must be a drive/space * Folder: `exists @Resource.Folder` - The target resource must be a folder * File: `exists @Resource.File` - The target resource must be a file The following is an example of a role permission with a condition that the target resource is a folder: ```json \"rolePermissions\": [ { \"allowedResourceActions\": [ \"libre.graph/applications/basic/update\", \"libre.graph/applications/credentials/update\" ], \"condition\": \"exists @Resource.File\" } ] ``` Conditions aren\'t supported for custom roles. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`allowedResourceActions` | Array<string> +`condition` | string ## Example ```typescript -import { UnifiedRolePermission } from './api'; +import type { UnifiedRolePermission } from '' + +// TODO: Update the object below with actual values +const example = { + "allowedResourceActions": null, + "condition": null, +} satisfies UnifiedRolePermission + +console.log(example) -const instance: UnifiedRolePermission = { - allowedResourceActions, - condition, -}; +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as UnifiedRolePermission +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/User.md b/web/packages/web-client/src/graph/generated/docs/User.md index 99e83d2eb83..47429fcda4f 100644 --- a/web/packages/web-client/src/graph/generated/docs/User.md +++ b/web/packages/web-client/src/graph/generated/docs/User.md @@ -1,57 +1,71 @@ + # User Represents an Active Directory user object. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Read-only. | [optional] [readonly] [default to undefined] -**accountEnabled** | **boolean** | Set to \"true\" when the account is enabled. | [optional] [default to undefined] -**appRoleAssignments** | [**Array<AppRoleAssignment>**](AppRoleAssignment.md) | The apps and app roles which this user has been assigned. | [optional] [readonly] [default to undefined] -**displayName** | **string** | The name displayed in the address book for the user. This value is usually the combination of the user\'s first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. | [default to undefined] -**drives** | [**Array<Drive>**](Drive.md) | A collection of drives available for this user. Read-only. | [optional] [readonly] [default to undefined] -**drive** | [**Drive**](Drive.md) | | [optional] [default to undefined] -**identities** | [**Array<ObjectIdentity>**](ObjectIdentity.md) | Identities associated with this account. | [optional] [default to undefined] -**mail** | **string** | The SMTP address for the user, for example, \'jeff@contoso.onowncloud.com\'. Returned by default. | [optional] [default to undefined] -**memberOf** | [**Array<Group>**](Group.md) | Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. | [optional] [readonly] [default to undefined] -**onPremisesSamAccountName** | **string** | Contains the on-premises SAM account name synchronized from the on-premises directory. | [default to undefined] -**passwordProfile** | [**PasswordProfile**](PasswordProfile.md) | | [optional] [default to undefined] -**surname** | **string** | The user\'s surname (family name or last name). Returned by default. | [optional] [default to undefined] -**givenName** | **string** | The user\'s givenName. Returned by default. | [optional] [default to undefined] -**userType** | **string** | The user`s type. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. | [optional] [readonly] [default to undefined] -**preferredLanguage** | **string** | Represents the users language setting, ISO-639-1 Code | [optional] [default to undefined] -**signInActivity** | [**SignInActivity**](SignInActivity.md) | | [optional] [default to undefined] -**externalID** | **string** | A unique identifier assigned to the user by the organization. | [optional] [default to undefined] -**crossInstanceReference** | **string** | A unique reference to the user. This is used to query the user from a different oCIS instance connected to the same identity provider. | [optional] [default to undefined] -**instances** | [**Array<Instance>**](Instance.md) | oCIS instances that the user is either a member or a guest of. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`accountEnabled` | boolean +`appRoleAssignments` | [Array<AppRoleAssignment>](AppRoleAssignment.md) +`displayName` | string +`drives` | [Array<Drive>](Drive.md) +`drive` | [Drive](Drive.md) +`identities` | [Array<ObjectIdentity>](ObjectIdentity.md) +`mail` | string +`memberOf` | [Array<Group>](Group.md) +`onPremisesSamAccountName` | string +`passwordProfile` | [PasswordProfile](PasswordProfile.md) +`surname` | string +`givenName` | string +`userType` | string +`preferredLanguage` | string +`signInActivity` | [SignInActivity](SignInActivity.md) +`externalID` | string +`crossInstanceReference` | string +`instances` | [Array<Instance>](Instance.md) ## Example ```typescript -import { User } from './api'; - -const instance: User = { - id, - accountEnabled, - appRoleAssignments, - displayName, - drives, - drive, - identities, - mail, - memberOf, - onPremisesSamAccountName, - passwordProfile, - surname, - givenName, - userType, - preferredLanguage, - signInActivity, - externalID, - crossInstanceReference, - instances, -}; +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "accountEnabled": null, + "appRoleAssignments": null, + "displayName": null, + "drives": null, + "drive": null, + "identities": null, + "mail": null, + "memberOf": null, + "onPremisesSamAccountName": null, + "passwordProfile": null, + "surname": null, + "givenName": null, + "userType": null, + "preferredLanguage": null, + "signInActivity": null, + "externalID": null, + "crossInstanceReference": null, + "instances": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/UserApi.md b/web/packages/web-client/src/graph/generated/docs/UserApi.md index 62ca90a780a..8fba9cac957 100644 --- a/web/packages/web-client/src/graph/generated/docs/UserApi.md +++ b/web/packages/web-client/src/graph/generated/docs/UserApi.md @@ -2,48 +2,69 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**deleteUser**](#deleteuser) | **DELETE** /v1.0/users/{user-id} | Delete entity from users| -|[**exportPersonalData**](#exportpersonaldata) | **POST** /v1.0/users/{user-id}/exportPersonalData | export personal data of a user| -|[**getUser**](#getuser) | **GET** /v1.0/users/{user-id} | Get entity from users by key| -|[**updateUser**](#updateuser) | **PATCH** /v1.0/users/{user-id} | Update entity in users| +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /v1.0/users/{user-id} | Delete entity from users | +| [**exportPersonalData**](UserApi.md#exportpersonaldataoperation) | **POST** /v1.0/users/{user-id}/exportPersonalData | export personal data of a user | +| [**getUser**](UserApi.md#getuser) | **GET** /v1.0/users/{user-id} | Get entity from users by key | +| [**updateUser**](UserApi.md#updateuser) | **PATCH** /v1.0/users/{user-id} | Update entity in users | -# **deleteUser** -> deleteUser() -### Example +## deleteUser -```typescript -import { - UserApi, - Configuration -} from './api'; +> deleteUser(userId, ifMatch) -const configuration = new Configuration(); -const apiInstance = new UserApi(configuration); +Delete entity from users -let userId: string; //key: id or name of user (default to undefined) -let ifMatch: string; //ETag (optional) (default to undefined) +### Example -const { status, data } = await apiInstance.deleteUser( - userId, - ifMatch -); +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UserApi(config); + + const body = { + // string | key: id or name of user + userId: userId_example, + // string | ETag (optional) + ifMatch: ifMatch_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userId** | [**string**] | key: id or name of user | defaults to undefined| -| **ifMatch** | [**string**] | ETag | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id or name of user | [Defaults to `undefined`] | +| **ifMatch** | `string` | ETag | [Optional] [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -51,54 +72,73 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **exportPersonalData** -> exportPersonalData() +## exportPersonalData -### Example - -```typescript -import { - UserApi, - Configuration, - ExportPersonalDataRequest -} from './api'; +> exportPersonalData(userId, exportPersonalDataRequest) -const configuration = new Configuration(); -const apiInstance = new UserApi(configuration); +export personal data of a user -let userId: string; //key: id or name of user (default to undefined) -let exportPersonalDataRequest: ExportPersonalDataRequest; //destination the file should be created at (optional) +### Example -const { status, data } = await apiInstance.exportPersonalData( - userId, - exportPersonalDataRequest -); +```ts +import { + Configuration, + UserApi, +} from ''; +import type { ExportPersonalDataOperationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UserApi(config); + + const body = { + // string | key: id or name of user + userId: userId_example, + // ExportPersonalDataRequest | destination the file should be created at (optional) + exportPersonalDataRequest: ..., + } satisfies ExportPersonalDataOperationRequest; + + try { + const data = await api.exportPersonalData(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **exportPersonalDataRequest** | **ExportPersonalDataRequest**| destination the file should be created at | | -| **userId** | [**string**] | key: id or name of user | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id or name of user | [Defaults to `undefined`] | +| **exportPersonalDataRequest** | [ExportPersonalDataRequest](ExportPersonalDataRequest.md) | destination the file should be created at | [Optional] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -106,56 +146,76 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**202** | success | - | -|**0** | error | - | +| **202** | success | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## getUser -# **getUser** -> User getUser() +> User getUser(userId, $select, $expand) +Get entity from users by key ### Example -```typescript +```ts import { - UserApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new UserApi(configuration); - -let userId: string; //key: id or name of user (default to undefined) -let $select: Set<'id' | 'displayName' | 'drive' | 'drives' | 'mail' | 'memberOf' | 'onPremisesSamAccountName' | 'surname'>; //Select properties to be returned (optional) (default to undefined) -let $expand: Set<'drive' | 'drives' | 'memberOf' | 'appRoleAssignments'>; //Expand related entities (optional) (default to undefined) - -const { status, data } = await apiInstance.getUser( - userId, - $select, - $expand -); + Configuration, + UserApi, +} from ''; +import type { GetUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UserApi(config); + + const body = { + // string | key: id or name of user + userId: userId_example, + // Set<'id' | 'displayName' | 'drive' | 'drives' | 'mail' | 'memberOf' | 'onPremisesSamAccountName' | 'surname'> | Select properties to be returned (optional) + $select: ..., + // Set<'drive' | 'drives' | 'memberOf' | 'appRoleAssignments'> | Expand related entities (optional) + $expand: ..., + } satisfies GetUserRequest; + + try { + const data = await api.getUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userId** | [**string**] | key: id or name of user | defaults to undefined| -| **$select** | **Array<'id' | 'displayName' | 'drive' | 'drives' | 'mail' | 'memberOf' | 'onPremisesSamAccountName' | 'surname'>** | Select properties to be returned | (optional) defaults to undefined| -| **$expand** | **Array<'drive' | 'drives' | 'memberOf' | 'appRoleAssignments'>** | Expand related entities | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id or name of user | [Defaults to `undefined`] | +| **$select** | `id`, `displayName`, `drive`, `drives`, `mail`, `memberOf`, `onPremisesSamAccountName`, `surname` | Select properties to be returned | [Optional] [Enum: id, displayName, drive, drives, mail, memberOf, onPremisesSamAccountName, surname] | +| **$expand** | `drive`, `drives`, `memberOf`, `appRoleAssignments` | Expand related entities | [Optional] [Enum: drive, drives, memberOf, appRoleAssignments] | ### Return type -**User** +[**User**](User.md) ### Authorization @@ -163,54 +223,73 @@ const { status, data } = await apiInstance.getUser( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entity | - | -|**0** | error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +| **200** | Retrieved entity | - | +| **0** | error | - | -# **updateUser** -> User updateUser(userUpdate) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -### Example +## updateUser -```typescript -import { - UserApi, - Configuration, - UserUpdate -} from './api'; +> User updateUser(userId, userUpdate) -const configuration = new Configuration(); -const apiInstance = new UserApi(configuration); +Update entity in users -let userId: string; //key: id of user (default to undefined) -let userUpdate: UserUpdate; //New property values +### Example -const { status, data } = await apiInstance.updateUser( - userId, - userUpdate -); +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UserApi(config); + + const body = { + // string | key: id of user + userId: userId_example, + // UserUpdate | New property values + userUpdate: {"displayName":"Marie Skłodowska Curie"}, + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userUpdate** | **UserUpdate**| New property values | | -| **userId** | [**string**] | key: id of user | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id of user | [Defaults to `undefined`] | +| **userUpdate** | [UserUpdate](UserUpdate.md) | New property values | | ### Return type -**User** +[**User**](User.md) ### Authorization @@ -218,15 +297,15 @@ const { status, data } = await apiInstance.updateUser( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Success | - | -|**0** | error | - | +| **200** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/UserAppRoleAssignmentApi.md b/web/packages/web-client/src/graph/generated/docs/UserAppRoleAssignmentApi.md index d7a591ca6f2..47f11db9f09 100644 --- a/web/packages/web-client/src/graph/generated/docs/UserAppRoleAssignmentApi.md +++ b/web/packages/web-client/src/graph/generated/docs/UserAppRoleAssignmentApi.md @@ -2,49 +2,70 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**userCreateAppRoleAssignments**](#usercreateapproleassignments) | **POST** /v1.0/users/{user-id}/appRoleAssignments | Grant an appRoleAssignment to a user| -|[**userDeleteAppRoleAssignments**](#userdeleteapproleassignments) | **DELETE** /v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id} | Delete the appRoleAssignment from a user| -|[**userListAppRoleAssignments**](#userlistapproleassignments) | **GET** /v1.0/users/{user-id}/appRoleAssignments | Get appRoleAssignments from a user| +| [**userCreateAppRoleAssignments**](UserAppRoleAssignmentApi.md#usercreateapproleassignments) | **POST** /v1.0/users/{user-id}/appRoleAssignments | Grant an appRoleAssignment to a user | +| [**userDeleteAppRoleAssignments**](UserAppRoleAssignmentApi.md#userdeleteapproleassignments) | **DELETE** /v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id} | Delete the appRoleAssignment from a user | +| [**userListAppRoleAssignments**](UserAppRoleAssignmentApi.md#userlistapproleassignments) | **GET** /v1.0/users/{user-id}/appRoleAssignments | Get appRoleAssignments from a user | -# **userCreateAppRoleAssignments** -> AppRoleAssignment userCreateAppRoleAssignments(appRoleAssignment) -Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. -### Example +## userCreateAppRoleAssignments -```typescript -import { - UserAppRoleAssignmentApi, - Configuration, - AppRoleAssignment -} from './api'; +> AppRoleAssignment userCreateAppRoleAssignments(userId, appRoleAssignment) -const configuration = new Configuration(); -const apiInstance = new UserAppRoleAssignmentApi(configuration); +Grant an appRoleAssignment to a user -let userId: string; //key: id of user (default to undefined) -let appRoleAssignment: AppRoleAssignment; //New app role assignment value +Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers: * `principalId`: The `id` of the user to whom you are assigning the app role. * `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role. * `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user. -const { status, data } = await apiInstance.userCreateAppRoleAssignments( - userId, - appRoleAssignment -); +### Example + +```ts +import { + Configuration, + UserAppRoleAssignmentApi, +} from ''; +import type { UserCreateAppRoleAssignmentsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UserAppRoleAssignmentApi(config); + + const body = { + // string | key: id of user + userId: userId_example, + // AppRoleAssignment | New app role assignment value + appRoleAssignment: ..., + } satisfies UserCreateAppRoleAssignmentsRequest; + + try { + const data = await api.userCreateAppRoleAssignments(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **appRoleAssignment** | **AppRoleAssignment**| New app role assignment value | | -| **userId** | [**string**] | key: id of user | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id of user | [Defaults to `undefined`] | +| **appRoleAssignment** | [AppRoleAssignment](AppRoleAssignment.md) | New app role assignment value | | ### Return type -**AppRoleAssignment** +[**AppRoleAssignment**](AppRoleAssignment.md) ### Authorization @@ -52,56 +73,76 @@ const { status, data } = await apiInstance.userCreateAppRoleAssignments( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Created new app role assignment. | - | -|**0** | error | - | +| **200** | Created new app role assignment. | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **userDeleteAppRoleAssignments** -> userDeleteAppRoleAssignments() +## userDeleteAppRoleAssignments +> userDeleteAppRoleAssignments(userId, appRoleAssignmentId, ifMatch) + +Delete the appRoleAssignment from a user ### Example -```typescript +```ts import { - UserAppRoleAssignmentApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new UserAppRoleAssignmentApi(configuration); - -let userId: string; //key: id of user (default to undefined) -let appRoleAssignmentId: string; //key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. (default to undefined) -let ifMatch: string; //ETag (optional) (default to undefined) - -const { status, data } = await apiInstance.userDeleteAppRoleAssignments( - userId, - appRoleAssignmentId, - ifMatch -); + Configuration, + UserAppRoleAssignmentApi, +} from ''; +import type { UserDeleteAppRoleAssignmentsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UserAppRoleAssignmentApi(config); + + const body = { + // string | key: id of user + userId: userId_example, + // string | key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. + appRoleAssignmentId: appRoleAssignmentId_example, + // string | ETag (optional) + ifMatch: ifMatch_example, + } satisfies UserDeleteAppRoleAssignmentsRequest; + + try { + const data = await api.userDeleteAppRoleAssignments(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userId** | [**string**] | key: id of user | defaults to undefined| -| **appRoleAssignmentId** | [**string**] | key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. | defaults to undefined| -| **ifMatch** | [**string**] | ETag | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id of user | [Defaults to `undefined`] | +| **appRoleAssignmentId** | `string` | key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon. | [Defaults to `undefined`] | +| **ifMatch** | `string` | ETag | [Optional] [Defaults to `undefined`] | ### Return type -void (empty response body) +`void` (Empty response body) ### Authorization @@ -109,51 +150,72 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**204** | Success | - | -|**0** | error | - | +| **204** | Success | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -# **userListAppRoleAssignments** -> CollectionOfAppRoleAssignments userListAppRoleAssignments() -Represents the global roles a user has been granted for an application. +## userListAppRoleAssignments -### Example +> CollectionOfAppRoleAssignments userListAppRoleAssignments(userId) -```typescript -import { - UserAppRoleAssignmentApi, - Configuration -} from './api'; +Get appRoleAssignments from a user -const configuration = new Configuration(); -const apiInstance = new UserAppRoleAssignmentApi(configuration); +Represents the global roles a user has been granted for an application. -let userId: string; //key: id of user (default to undefined) +### Example -const { status, data } = await apiInstance.userListAppRoleAssignments( - userId -); +```ts +import { + Configuration, + UserAppRoleAssignmentApi, +} from ''; +import type { UserListAppRoleAssignmentsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UserAppRoleAssignmentApi(config); + + const body = { + // string | key: id of user + userId: userId_example, + } satisfies UserListAppRoleAssignmentsRequest; + + try { + const data = await api.userListAppRoleAssignments(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userId** | [**string**] | key: id of user | defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | `string` | key: id of user | [Defaults to `undefined`] | ### Return type -**CollectionOfAppRoleAssignments** +[**CollectionOfAppRoleAssignments**](CollectionOfAppRoleAssignments.md) ### Authorization @@ -161,15 +223,15 @@ const { status, data } = await apiInstance.userListAppRoleAssignments( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved appRoleAssignments | - | -|**0** | error | - | +| **200** | Retrieved appRoleAssignments | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/UserUpdate.md b/web/packages/web-client/src/graph/generated/docs/UserUpdate.md index 24bd9ebb677..5c902f31622 100644 --- a/web/packages/web-client/src/graph/generated/docs/UserUpdate.md +++ b/web/packages/web-client/src/graph/generated/docs/UserUpdate.md @@ -1,57 +1,71 @@ + # UserUpdate Represents updates to an Active Directory user object. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | Read-only. | [optional] [readonly] [default to undefined] -**accountEnabled** | **boolean** | Set to \"true\" when the account is enabled. | [optional] [default to undefined] -**appRoleAssignments** | [**Array<AppRoleAssignment>**](AppRoleAssignment.md) | The apps and app roles which this user has been assigned. | [optional] [readonly] [default to undefined] -**displayName** | **string** | The name displayed in the address book for the user. This value is usually the combination of the user\'s first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. | [optional] [default to undefined] -**drives** | [**Array<Drive>**](Drive.md) | A collection of drives available for this user. Read-only. | [optional] [readonly] [default to undefined] -**drive** | [**Drive**](Drive.md) | | [optional] [default to undefined] -**identities** | [**Array<ObjectIdentity>**](ObjectIdentity.md) | Identities associated with this account. | [optional] [default to undefined] -**mail** | **string** | The SMTP address for the user, for example, \'jeff@contoso.onowncloud.com\'. Returned by default. | [optional] [default to undefined] -**memberOf** | [**Array<Group>**](Group.md) | Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. | [optional] [readonly] [default to undefined] -**onPremisesSamAccountName** | **string** | Contains the on-premises SAM account name synchronized from the on-premises directory. | [optional] [default to undefined] -**passwordProfile** | [**PasswordProfile**](PasswordProfile.md) | | [optional] [default to undefined] -**surname** | **string** | The user\'s surname (family name or last name). Returned by default. | [optional] [default to undefined] -**givenName** | **string** | The user\'s givenName. Returned by default. | [optional] [default to undefined] -**userType** | **string** | The user`s type. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. | [optional] [readonly] [default to undefined] -**preferredLanguage** | **string** | Represents the users language setting, ISO-639-1 Code | [optional] [default to undefined] -**signInActivity** | [**SignInActivity**](SignInActivity.md) | | [optional] [default to undefined] -**externalID** | **string** | A unique identifier assigned to the user by the organization. | [optional] [default to undefined] -**crossInstanceReference** | **string** | A unique reference to the user. This is used to query the user from a different oCIS instance connected to the same identity provider. | [optional] [default to undefined] -**instances** | [**Array<Instance>**](Instance.md) | oCIS instances that the user is either a member or a guest of. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`id` | string +`accountEnabled` | boolean +`appRoleAssignments` | [Array<AppRoleAssignment>](AppRoleAssignment.md) +`displayName` | string +`drives` | [Array<Drive>](Drive.md) +`drive` | [Drive](Drive.md) +`identities` | [Array<ObjectIdentity>](ObjectIdentity.md) +`mail` | string +`memberOf` | [Array<Group>](Group.md) +`onPremisesSamAccountName` | string +`passwordProfile` | [PasswordProfile](PasswordProfile.md) +`surname` | string +`givenName` | string +`userType` | string +`preferredLanguage` | string +`signInActivity` | [SignInActivity](SignInActivity.md) +`externalID` | string +`crossInstanceReference` | string +`instances` | [Array<Instance>](Instance.md) ## Example ```typescript -import { UserUpdate } from './api'; - -const instance: UserUpdate = { - id, - accountEnabled, - appRoleAssignments, - displayName, - drives, - drive, - identities, - mail, - memberOf, - onPremisesSamAccountName, - passwordProfile, - surname, - givenName, - userType, - preferredLanguage, - signInActivity, - externalID, - crossInstanceReference, - instances, -}; +import type { UserUpdate } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "accountEnabled": null, + "appRoleAssignments": null, + "displayName": null, + "drives": null, + "drive": null, + "identities": null, + "mail": null, + "memberOf": null, + "onPremisesSamAccountName": null, + "passwordProfile": null, + "surname": null, + "givenName": null, + "userType": null, + "preferredLanguage": null, + "signInActivity": null, + "externalID": null, + "crossInstanceReference": null, + "instances": null, +} satisfies UserUpdate + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as UserUpdate +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/docs/UsersApi.md b/web/packages/web-client/src/graph/generated/docs/UsersApi.md index 813f15ee331..bc4ab92a4fa 100644 --- a/web/packages/web-client/src/graph/generated/docs/UsersApi.md +++ b/web/packages/web-client/src/graph/generated/docs/UsersApi.md @@ -2,44 +2,64 @@ All URIs are relative to *https://ocis.ocis.rolling.owncloud.works/graph* -|Method | HTTP request | Description| +| Method | HTTP request | Description | |------------- | ------------- | -------------| -|[**createUser**](#createuser) | **POST** /v1.0/users | Add new entity to users| -|[**listUsers**](#listusers) | **GET** /v1.0/users | Get entities from users| +| [**createUser**](UsersApi.md#createuser) | **POST** /v1.0/users | Add new entity to users | +| [**listUsers**](UsersApi.md#listusers) | **GET** /v1.0/users | Get entities from users | -# **createUser** -> User createUser(user) -### Example +## createUser -```typescript -import { - UsersApi, - Configuration, - User -} from './api'; +> User createUser(user) -const configuration = new Configuration(); -const apiInstance = new UsersApi(configuration); +Add new entity to users -let user: User; //New entity +### Example -const { status, data } = await apiInstance.createUser( - user -); +```ts +import { + Configuration, + UsersApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UsersApi(config); + + const body = { + // User | New entity + user: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **user** | **User**| New entity | | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [User](User.md) | New entity | | ### Return type -**User** +[**User**](User.md) ### Authorization @@ -47,62 +67,82 @@ const { status, data } = await apiInstance.createUser( ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**201** | Created entity | - | -|**0** | error | - | +| **201** | Created entity | - | +| **0** | error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **listUsers** -> CollectionOfUser listUsers() +## listUsers +> CollectionOfUser listUsers($search, $filter, $orderby, $select, $expand) + +Get entities from users ### Example -```typescript +```ts import { - UsersApi, - Configuration -} from './api'; - -const configuration = new Configuration(); -const apiInstance = new UsersApi(configuration); - -let $search: string; //Search items by search phrases (optional) (default to undefined) -let $filter: string; //Filter users by property values and relationship attributes (optional) (default to undefined) -let $orderby: Set<'displayName' | 'displayName desc' | 'mail' | 'mail desc' | 'onPremisesSamAccountName' | 'onPremisesSamAccountName desc'>; //Order items by property values (optional) (default to undefined) -let $select: Set<'id' | 'displayName' | 'mail' | 'memberOf' | 'onPremisesSamAccountName' | 'surname'>; //Select properties to be returned (optional) (default to undefined) -let $expand: Set<'drive' | 'drives' | 'memberOf' | 'appRoleAssignments'>; //Expand related entities (optional) (default to undefined) - -const { status, data } = await apiInstance.listUsers( - $search, - $filter, - $orderby, - $select, - $expand -); + Configuration, + UsersApi, +} from ''; +import type { ListUsersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: basicAuth + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new UsersApi(config); + + const body = { + // string | Search items by search phrases (optional) + $search: $search_example, + // string | Filter users by property values and relationship attributes (optional) + $filter: memberOf/any(x:x/id eq 910367f9-4041-4db1-961b-d1e98f708eaf), + // Set<'displayName' | 'displayName desc' | 'mail' | 'mail desc' | 'onPremisesSamAccountName' | 'onPremisesSamAccountName desc'> | Order items by property values (optional) + $orderby: ..., + // Set<'id' | 'displayName' | 'mail' | 'memberOf' | 'onPremisesSamAccountName' | 'surname'> | Select properties to be returned (optional) + $select: ..., + // Set<'drive' | 'drives' | 'memberOf' | 'appRoleAssignments'> | Expand related entities (optional) + $expand: ..., + } satisfies ListUsersRequest; + + try { + const data = await api.listUsers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` ### Parameters -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **$search** | [**string**] | Search items by search phrases | (optional) defaults to undefined| -| **$filter** | [**string**] | Filter users by property values and relationship attributes | (optional) defaults to undefined| -| **$orderby** | **Array<'displayName' | 'displayName desc' | 'mail' | 'mail desc' | 'onPremisesSamAccountName' | 'onPremisesSamAccountName desc'>** | Order items by property values | (optional) defaults to undefined| -| **$select** | **Array<'id' | 'displayName' | 'mail' | 'memberOf' | 'onPremisesSamAccountName' | 'surname'>** | Select properties to be returned | (optional) defaults to undefined| -| **$expand** | **Array<'drive' | 'drives' | 'memberOf' | 'appRoleAssignments'>** | Expand related entities | (optional) defaults to undefined| +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **$search** | `string` | Search items by search phrases | [Optional] [Defaults to `undefined`] | +| **$filter** | `string` | Filter users by property values and relationship attributes | [Optional] [Defaults to `undefined`] | +| **$orderby** | `displayName`, `displayName desc`, `mail`, `mail desc`, `onPremisesSamAccountName`, `onPremisesSamAccountName desc` | Order items by property values | [Optional] [Enum: displayName, displayName desc, mail, mail desc, onPremisesSamAccountName, onPremisesSamAccountName desc] | +| **$select** | `id`, `displayName`, `mail`, `memberOf`, `onPremisesSamAccountName`, `surname` | Select properties to be returned | [Optional] [Enum: id, displayName, mail, memberOf, onPremisesSamAccountName, surname] | +| **$expand** | `drive`, `drives`, `memberOf`, `appRoleAssignments` | Expand related entities | [Optional] [Enum: drive, drives, memberOf, appRoleAssignments] | ### Return type -**CollectionOfUser** +[**CollectionOfUser**](CollectionOfUser.md) ### Authorization @@ -110,15 +150,15 @@ const { status, data } = await apiInstance.listUsers( ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -|**200** | Retrieved entities | - | -|**0** | error | - | +| **200** | Retrieved entities | - | +| **0** | error | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/web/packages/web-client/src/graph/generated/docs/Video.md b/web/packages/web-client/src/graph/generated/docs/Video.md index 5f890ec69b5..44efd405555 100644 --- a/web/packages/web-client/src/graph/generated/docs/Video.md +++ b/web/packages/web-client/src/graph/generated/docs/Video.md @@ -1,39 +1,53 @@ + # Video The video resource groups video-related data items into a single structure. If a driveItem has a non-null video facet, the item represents a video file. The properties of the video resource are populated by extracting metadata from the file. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**audioBitsPerSample** | **number** | Number of audio bits per sample. | [optional] [default to undefined] -**audioChannels** | **number** | Number of audio channels. | [optional] [default to undefined] -**audioFormat** | **string** | Name of the audio format (AAC, MP3, etc.). | [optional] [default to undefined] -**audioSamplesPerSecond** | **number** | Number of audio samples per second. | [optional] [default to undefined] -**bitrate** | **number** | Bit rate of the video in bits per second. | [optional] [default to undefined] -**duration** | **number** | Duration of the file in milliseconds. | [optional] [default to undefined] -**fourCC** | **string** | \\\"Four character code\\\" name of the video format. | [optional] [default to undefined] -**frameRate** | **number** | Frame rate of the video. | [optional] [default to undefined] -**height** | **number** | Height of the video, in pixels. | [optional] [default to undefined] -**width** | **number** | Width of the video, in pixels. | [optional] [default to undefined] +Name | Type +------------ | ------------- +`audioBitsPerSample` | number +`audioChannels` | number +`audioFormat` | string +`audioSamplesPerSecond` | number +`bitrate` | number +`duration` | number +`fourCC` | string +`frameRate` | number +`height` | number +`width` | number ## Example ```typescript -import { Video } from './api'; - -const instance: Video = { - audioBitsPerSample, - audioChannels, - audioFormat, - audioSamplesPerSecond, - bitrate, - duration, - fourCC, - frameRate, - height, - width, -}; +import type { Video } from '' + +// TODO: Update the object below with actual values +const example = { + "audioBitsPerSample": null, + "audioChannels": null, + "audioFormat": null, + "audioSamplesPerSecond": null, + "bitrate": null, + "duration": null, + "fourCC": null, + "frameRate": null, + "height": null, + "width": null, +} satisfies Video + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Video +console.log(exampleParsed) ``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/web/packages/web-client/src/graph/generated/git_push.sh b/web/packages/web-client/src/graph/generated/git_push.sh deleted file mode 100644 index f53a75d4fab..00000000000 --- a/web/packages/web-client/src/graph/generated/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/web/packages/web-client/src/graph/generated/index.ts b/web/packages/web-client/src/graph/generated/index.ts index 73136f71175..bebe8bbbe20 100644 --- a/web/packages/web-client/src/graph/generated/index.ts +++ b/web/packages/web-client/src/graph/generated/index.ts @@ -1,18 +1,5 @@ /* tslint:disable */ /* eslint-disable */ -/** - * Libre Graph API - * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. - * - * The version of the OpenAPI document: v1.0.4 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export * from "./api"; -export * from "./configuration"; - +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/web/packages/web-client/src/graph/generated/models/Activity.ts b/web/packages/web-client/src/graph/generated/models/Activity.ts new file mode 100644 index 00000000000..492ca43c89e --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Activity.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { ActivityTimes } from './ActivityTimes'; +import { + ActivityTimesFromJSON, + ActivityTimesFromJSONTyped, + ActivityTimesToJSON, + ActivityTimesToJSONTyped, +} from './ActivityTimes'; +import type { ActivityTemplate } from './ActivityTemplate'; +import { + ActivityTemplateFromJSON, + ActivityTemplateFromJSONTyped, + ActivityTemplateToJSON, + ActivityTemplateToJSONTyped, +} from './ActivityTemplate'; + +/** + * Represents activity. + * @export + * @interface Activity + */ +export interface Activity { + /** + * Activity ID. + */ + id: string; + /** + * + */ + times: ActivityTimes; + /** + * + */ + template: ActivityTemplate; +} + +/** + * Check if a given object implements the Activity interface. + */ +export function instanceOfActivity(value: object): value is Activity { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('times' in value) || value['times'] === undefined) return false; + if (!('template' in value) || value['template'] === undefined) return false; + return true; +} + +export function ActivityFromJSON(json: any): Activity { + return ActivityFromJSONTyped(json, false); +} + +export function ActivityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Activity { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'times': ActivityTimesFromJSON(json['times']), + 'template': ActivityTemplateFromJSON(json['template']), + }; +} + +export function ActivityToJSON(json: any): Activity { + return ActivityToJSONTyped(json, false); +} + +export function ActivityToJSONTyped(value?: Activity | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'times': ActivityTimesToJSON(value['times']), + 'template': ActivityTemplateToJSON(value['template']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ActivityTemplate.ts b/web/packages/web-client/src/graph/generated/models/ActivityTemplate.ts new file mode 100644 index 00000000000..7bc63bbfbe1 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ActivityTemplate.ts @@ -0,0 +1,70 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ActivityTemplate + */ +export interface ActivityTemplate { + /** + * Activity description. + */ + message: string; + /** + * Activity description variables. + */ + variables?: object; +} + +/** + * Check if a given object implements the ActivityTemplate interface. + */ +export function instanceOfActivityTemplate(value: object): value is ActivityTemplate { + if (!('message' in value) || value['message'] === undefined) return false; + return true; +} + +export function ActivityTemplateFromJSON(json: any): ActivityTemplate { + return ActivityTemplateFromJSONTyped(json, false); +} + +export function ActivityTemplateFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActivityTemplate { + if (json == null) { + return json; + } + return { + + 'message': json['message'], + 'variables': json['variables'] == null ? undefined : json['variables'], + }; +} + +export function ActivityTemplateToJSON(json: any): ActivityTemplate { + return ActivityTemplateToJSONTyped(json, false); +} + +export function ActivityTemplateToJSONTyped(value?: ActivityTemplate | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'message': value['message'], + 'variables': value['variables'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ActivityTimes.ts b/web/packages/web-client/src/graph/generated/models/ActivityTimes.ts new file mode 100644 index 00000000000..72487095af2 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ActivityTimes.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +/** + * + * @export + * @interface ActivityTimes + */ +export interface ActivityTimes { + /** + * Timestamp of the activity. + */ + recordedTime: Date; +} + +/** + * Check if a given object implements the ActivityTimes interface. + */ +export function instanceOfActivityTimes(value: object): value is ActivityTimes { + if (!('recordedTime' in value) || value['recordedTime'] === undefined) return false; + return true; +} + +export function ActivityTimesFromJSON(json: any): ActivityTimes { + return ActivityTimesFromJSONTyped(json, false); +} + +export function ActivityTimesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActivityTimes { + if (json == null) { + return json; + } + return { + + 'recordedTime': (json['recordedTime'] == null ? json['recordedTime'] : parseDateTime(json['recordedTime'])), + }; +} + +export function ActivityTimesToJSON(json: any): ActivityTimes { + return ActivityTimesToJSONTyped(json, false); +} + +export function ActivityTimesToJSONTyped(value?: ActivityTimes | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'recordedTime': value['recordedTime'] == null ? value['recordedTime'] : serializeDateTime(value['recordedTime']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/AppRole.ts b/web/packages/web-client/src/graph/generated/models/AppRole.ts new file mode 100644 index 00000000000..9ec10c0944d --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/AppRole.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AppRole + */ +export interface AppRole { + /** + * Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. + */ + allowedMemberTypes?: Array; + /** + * The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. + */ + description?: string | null; + /** + * Display name for the permission that appears in the app role assignment and consent experiences. + */ + displayName?: string | null; + /** + * Unique role identifier inside the appRoles collection. When creating a new app role, a new GUID identifier must be provided. + */ + id: string; +} + +/** + * Check if a given object implements the AppRole interface. + */ +export function instanceOfAppRole(value: object): value is AppRole { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function AppRoleFromJSON(json: any): AppRole { + return AppRoleFromJSONTyped(json, false); +} + +export function AppRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AppRole { + if (json == null) { + return json; + } + return { + + 'allowedMemberTypes': json['allowedMemberTypes'] == null ? undefined : json['allowedMemberTypes'], + 'description': json['description'] === undefined ? undefined : json['description'] === null ? null : json['description'], + 'displayName': json['displayName'] === undefined ? undefined : json['displayName'] === null ? null : json['displayName'], + 'id': json['id'], + }; +} + +export function AppRoleToJSON(json: any): AppRole { + return AppRoleToJSONTyped(json, false); +} + +export function AppRoleToJSONTyped(value?: AppRole | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'allowedMemberTypes': value['allowedMemberTypes'], + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts b/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts new file mode 100644 index 00000000000..a4cc6e17b6e --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +/** + * + * @export + * @interface AppRoleAssignment + */ +export interface AppRoleAssignment { + /** + * The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. + */ + readonly id?: string; + /** + * + */ + deletedDateTime?: Date; + /** + * The identifier (id) for the app role which is assigned to the user. Required on create. + */ + appRoleId: string; + /** + * The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. + */ + createdDateTime?: Date | null; + /** + * The display name of the user, group, or service principal that was granted the app role assignment. Read-only. + */ + principalDisplayName?: string | null; + /** + * The unique identifier (id) for the user, security group, or service principal being granted the app role. Security groups with dynamic memberships are supported. Required on create. + */ + principalId: string | null; + /** + * The type of the assigned principal. This can either be User, Group, or ServicePrincipal. Read-only. + */ + principalType?: string | null; + /** + * The display name of the resource app's service principal to which the assignment is made. + */ + resourceDisplayName?: string | null; + /** + * The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. + */ + resourceId: string | null; +} + +/** + * Check if a given object implements the AppRoleAssignment interface. + */ +export function instanceOfAppRoleAssignment(value: object): value is AppRoleAssignment { + if (!('appRoleId' in value) || value['appRoleId'] === undefined) return false; + if (!('principalId' in value) || value['principalId'] === undefined) return false; + if (!('resourceId' in value) || value['resourceId'] === undefined) return false; + return true; +} + +export function AppRoleAssignmentFromJSON(json: any): AppRoleAssignment { + return AppRoleAssignmentFromJSONTyped(json, false); +} + +export function AppRoleAssignmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): AppRoleAssignment { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'deletedDateTime': json['deletedDateTime'] == null ? undefined : (parseDateTime(json['deletedDateTime'])), + 'appRoleId': json['appRoleId'], + 'createdDateTime': json['createdDateTime'] === undefined ? undefined : json['createdDateTime'] === null ? null : (parseDateTime(json['createdDateTime'])), + 'principalDisplayName': json['principalDisplayName'] === undefined ? undefined : json['principalDisplayName'] === null ? null : json['principalDisplayName'], + 'principalId': json['principalId'], + 'principalType': json['principalType'] === undefined ? undefined : json['principalType'] === null ? null : json['principalType'], + 'resourceDisplayName': json['resourceDisplayName'] === undefined ? undefined : json['resourceDisplayName'] === null ? null : json['resourceDisplayName'], + 'resourceId': json['resourceId'], + }; +} + +export function AppRoleAssignmentToJSON(json: any): AppRoleAssignment { + return AppRoleAssignmentToJSONTyped(json, false); +} + +export function AppRoleAssignmentToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'deletedDateTime': value['deletedDateTime'] == null ? value['deletedDateTime'] : serializeDateTime(value['deletedDateTime']), + 'appRoleId': value['appRoleId'], + 'createdDateTime': value['createdDateTime'] == null ? value['createdDateTime'] : serializeDateTime(value['createdDateTime']), + 'principalDisplayName': value['principalDisplayName'], + 'principalId': value['principalId'], + 'principalType': value['principalType'], + 'resourceDisplayName': value['resourceDisplayName'], + 'resourceId': value['resourceId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Application.ts b/web/packages/web-client/src/graph/generated/models/Application.ts new file mode 100644 index 00000000000..2e16c780d39 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Application.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AppRole } from './AppRole'; +import { + AppRoleFromJSON, + AppRoleFromJSONTyped, + AppRoleToJSON, + AppRoleToJSONTyped, +} from './AppRole'; + +/** + * + * @export + * @interface Application + */ +export interface Application { + /** + * The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. + */ + readonly id: string; + /** + * The collection of roles defined for the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. + */ + appRoles?: Array; + /** + * The display name for the application. + */ + displayName?: string | null; +} + +/** + * Check if a given object implements the Application interface. + */ +export function instanceOfApplication(value: object): value is Application { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function ApplicationFromJSON(json: any): Application { + return ApplicationFromJSONTyped(json, false); +} + +export function ApplicationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Application { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'appRoles': json['appRoles'] == null ? undefined : ((json['appRoles'] as Array).map(AppRoleFromJSON)), + 'displayName': json['displayName'] === undefined ? undefined : json['displayName'] === null ? null : json['displayName'], + }; +} + +export function ApplicationToJSON(json: any): Application { + return ApplicationToJSONTyped(json, false); +} + +export function ApplicationToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'appRoles': value['appRoles'] == null ? undefined : ((value['appRoles'] as Array).map(AppRoleToJSON)), + 'displayName': value['displayName'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Audio.ts b/web/packages/web-client/src/graph/generated/models/Audio.ts new file mode 100644 index 00000000000..4e80f2487ad --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Audio.ts @@ -0,0 +1,156 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * The Audio resource groups audio-related properties on an item into a single structure. + * + * If a DriveItem has a non-null audio facet, the item represents an audio file. The properties of the Audio resource are populated by extracting metadata from the file. + * + * @export + * @interface Audio + */ +export interface Audio { + /** + * The title of the album for this audio file. + */ + album?: string; + /** + * The artist named on the album for the audio file. + */ + albumArtist?: string; + /** + * The performing artist for the audio file. + */ + artist?: string; + /** + * Bitrate expressed in kbps. + */ + bitrate?: number; + /** + * The name of the composer of the audio file. + */ + composers?: string; + /** + * Copyright information for the audio file. + */ + copyright?: string; + /** + * The number of the disc this audio file came from. + */ + disc?: number; + /** + * The total number of discs in this album. + */ + discCount?: number; + /** + * Duration of the audio file, expressed in milliseconds + */ + duration?: number; + /** + * The genre of this audio file. + */ + genre?: string; + /** + * Indicates if the file is protected with digital rights management. + */ + hasDrm?: boolean; + /** + * Indicates if the file is encoded with a variable bitrate. + */ + isVariableBitrate?: boolean; + /** + * The title of the audio file. + */ + title?: string; + /** + * The number of the track on the original disc for this audio file. + */ + track?: number; + /** + * The total number of tracks on the original disc for this audio file. + */ + trackCount?: number; + /** + * The year the audio file was recorded. + */ + year?: number; +} + +/** + * Check if a given object implements the Audio interface. + */ +export function instanceOfAudio(value: object): value is Audio { + return true; +} + +export function AudioFromJSON(json: any): Audio { + return AudioFromJSONTyped(json, false); +} + +export function AudioFromJSONTyped(json: any, ignoreDiscriminator: boolean): Audio { + if (json == null) { + return json; + } + return { + + 'album': json['album'] == null ? undefined : json['album'], + 'albumArtist': json['albumArtist'] == null ? undefined : json['albumArtist'], + 'artist': json['artist'] == null ? undefined : json['artist'], + 'bitrate': json['bitrate'] == null ? undefined : json['bitrate'], + 'composers': json['composers'] == null ? undefined : json['composers'], + 'copyright': json['copyright'] == null ? undefined : json['copyright'], + 'disc': json['disc'] == null ? undefined : json['disc'], + 'discCount': json['discCount'] == null ? undefined : json['discCount'], + 'duration': json['duration'] == null ? undefined : json['duration'], + 'genre': json['genre'] == null ? undefined : json['genre'], + 'hasDrm': json['hasDrm'] == null ? undefined : json['hasDrm'], + 'isVariableBitrate': json['isVariableBitrate'] == null ? undefined : json['isVariableBitrate'], + 'title': json['title'] == null ? undefined : json['title'], + 'track': json['track'] == null ? undefined : json['track'], + 'trackCount': json['trackCount'] == null ? undefined : json['trackCount'], + 'year': json['year'] == null ? undefined : json['year'], + }; +} + +export function AudioToJSON(json: any): Audio { + return AudioToJSONTyped(json, false); +} + +export function AudioToJSONTyped(value?: Audio | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'album': value['album'], + 'albumArtist': value['albumArtist'], + 'artist': value['artist'], + 'bitrate': value['bitrate'], + 'composers': value['composers'], + 'copyright': value['copyright'], + 'disc': value['disc'], + 'discCount': value['discCount'], + 'duration': value['duration'], + 'genre': value['genre'], + 'hasDrm': value['hasDrm'], + 'isVariableBitrate': value['isVariableBitrate'], + 'title': value['title'], + 'track': value['track'], + 'trackCount': value['trackCount'], + 'year': value['year'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ClassMemberReference.ts b/web/packages/web-client/src/graph/generated/models/ClassMemberReference.ts new file mode 100644 index 00000000000..5d64be8a5e4 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ClassMemberReference.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ClassMemberReference + */ +export interface ClassMemberReference { + /** + * + */ + atOdataId?: string; +} + +/** + * Check if a given object implements the ClassMemberReference interface. + */ +export function instanceOfClassMemberReference(value: object): value is ClassMemberReference { + return true; +} + +export function ClassMemberReferenceFromJSON(json: any): ClassMemberReference { + return ClassMemberReferenceFromJSONTyped(json, false); +} + +export function ClassMemberReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassMemberReference { + if (json == null) { + return json; + } + return { + + 'atOdataId': json['@odata.id'] == null ? undefined : json['@odata.id'], + }; +} + +export function ClassMemberReferenceToJSON(json: any): ClassMemberReference { + return ClassMemberReferenceToJSONTyped(json, false); +} + +export function ClassMemberReferenceToJSONTyped(value?: ClassMemberReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '@odata.id': value['atOdataId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ClassReference.ts b/web/packages/web-client/src/graph/generated/models/ClassReference.ts new file mode 100644 index 00000000000..f4035a19236 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ClassReference.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ClassReference + */ +export interface ClassReference { + /** + * + */ + atOdataId?: string; +} + +/** + * Check if a given object implements the ClassReference interface. + */ +export function instanceOfClassReference(value: object): value is ClassReference { + return true; +} + +export function ClassReferenceFromJSON(json: any): ClassReference { + return ClassReferenceFromJSONTyped(json, false); +} + +export function ClassReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassReference { + if (json == null) { + return json; + } + return { + + 'atOdataId': json['@odata.id'] == null ? undefined : json['@odata.id'], + }; +} + +export function ClassReferenceToJSON(json: any): ClassReference { + return ClassReferenceToJSONTyped(json, false); +} + +export function ClassReferenceToJSONTyped(value?: ClassReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '@odata.id': value['atOdataId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ClassTeacherReference.ts b/web/packages/web-client/src/graph/generated/models/ClassTeacherReference.ts new file mode 100644 index 00000000000..d11961fa9ae --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ClassTeacherReference.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ClassTeacherReference + */ +export interface ClassTeacherReference { + /** + * + */ + atOdataId?: string; +} + +/** + * Check if a given object implements the ClassTeacherReference interface. + */ +export function instanceOfClassTeacherReference(value: object): value is ClassTeacherReference { + return true; +} + +export function ClassTeacherReferenceFromJSON(json: any): ClassTeacherReference { + return ClassTeacherReferenceFromJSONTyped(json, false); +} + +export function ClassTeacherReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassTeacherReference { + if (json == null) { + return json; + } + return { + + 'atOdataId': json['@odata.id'] == null ? undefined : json['@odata.id'], + }; +} + +export function ClassTeacherReferenceToJSON(json: any): ClassTeacherReference { + return ClassTeacherReferenceToJSONTyped(json, false); +} + +export function ClassTeacherReferenceToJSONTyped(value?: ClassTeacherReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '@odata.id': value['atOdataId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfActivities.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfActivities.ts new file mode 100644 index 00000000000..774f806b6e2 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfActivities.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Activity } from './Activity'; +import { + ActivityFromJSON, + ActivityFromJSONTyped, + ActivityToJSON, + ActivityToJSONTyped, +} from './Activity'; + +/** + * + * @export + * @interface CollectionOfActivities + */ +export interface CollectionOfActivities { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfActivities interface. + */ +export function instanceOfCollectionOfActivities(value: object): value is CollectionOfActivities { + return true; +} + +export function CollectionOfActivitiesFromJSON(json: any): CollectionOfActivities { + return CollectionOfActivitiesFromJSONTyped(json, false); +} + +export function CollectionOfActivitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfActivities { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(ActivityFromJSON)), + }; +} + +export function CollectionOfActivitiesToJSON(json: any): CollectionOfActivities { + return CollectionOfActivitiesToJSONTyped(json, false); +} + +export function CollectionOfActivitiesToJSONTyped(value?: CollectionOfActivities | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(ActivityToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfAppRoleAssignments.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfAppRoleAssignments.ts new file mode 100644 index 00000000000..5df85124139 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfAppRoleAssignments.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AppRoleAssignment } from './AppRoleAssignment'; +import { + AppRoleAssignmentFromJSON, + AppRoleAssignmentFromJSONTyped, + AppRoleAssignmentToJSON, + AppRoleAssignmentToJSONTyped, +} from './AppRoleAssignment'; + +/** + * + * @export + * @interface CollectionOfAppRoleAssignments + */ +export interface CollectionOfAppRoleAssignments { + /** + * + */ + value?: Array; + /** + * + */ + atOdataNextLink?: string; +} + +/** + * Check if a given object implements the CollectionOfAppRoleAssignments interface. + */ +export function instanceOfCollectionOfAppRoleAssignments(value: object): value is CollectionOfAppRoleAssignments { + return true; +} + +export function CollectionOfAppRoleAssignmentsFromJSON(json: any): CollectionOfAppRoleAssignments { + return CollectionOfAppRoleAssignmentsFromJSONTyped(json, false); +} + +export function CollectionOfAppRoleAssignmentsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfAppRoleAssignments { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(AppRoleAssignmentFromJSON)), + 'atOdataNextLink': json['@odata.nextLink'] == null ? undefined : json['@odata.nextLink'], + }; +} + +export function CollectionOfAppRoleAssignmentsToJSON(json: any): CollectionOfAppRoleAssignments { + return CollectionOfAppRoleAssignmentsToJSONTyped(json, false); +} + +export function CollectionOfAppRoleAssignmentsToJSONTyped(value?: CollectionOfAppRoleAssignments | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(AppRoleAssignmentToJSON)), + '@odata.nextLink': value['atOdataNextLink'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfApplications.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfApplications.ts new file mode 100644 index 00000000000..9abdbf9bda6 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfApplications.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Application } from './Application'; +import { + ApplicationFromJSON, + ApplicationFromJSONTyped, + ApplicationToJSON, + ApplicationToJSONTyped, +} from './Application'; + +/** + * + * @export + * @interface CollectionOfApplications + */ +export interface CollectionOfApplications { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfApplications interface. + */ +export function instanceOfCollectionOfApplications(value: object): value is CollectionOfApplications { + return true; +} + +export function CollectionOfApplicationsFromJSON(json: any): CollectionOfApplications { + return CollectionOfApplicationsFromJSONTyped(json, false); +} + +export function CollectionOfApplicationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfApplications { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(ApplicationFromJSON)), + }; +} + +export function CollectionOfApplicationsToJSON(json: any): CollectionOfApplications { + return CollectionOfApplicationsToJSONTyped(json, false); +} + +export function CollectionOfApplicationsToJSONTyped(value?: CollectionOfApplications | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(ApplicationToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfClass.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfClass.ts new file mode 100644 index 00000000000..3727e157304 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfClass.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { EducationClass } from './EducationClass'; +import { + EducationClassFromJSON, + EducationClassFromJSONTyped, + EducationClassToJSON, + EducationClassToJSONTyped, +} from './EducationClass'; + +/** + * + * @export + * @interface CollectionOfClass + */ +export interface CollectionOfClass { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfClass interface. + */ +export function instanceOfCollectionOfClass(value: object): value is CollectionOfClass { + return true; +} + +export function CollectionOfClassFromJSON(json: any): CollectionOfClass { + return CollectionOfClassFromJSONTyped(json, false); +} + +export function CollectionOfClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfClass { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(EducationClassFromJSON)), + }; +} + +export function CollectionOfClassToJSON(json: any): CollectionOfClass { + return CollectionOfClassToJSONTyped(json, false); +} + +export function CollectionOfClassToJSONTyped(value?: CollectionOfClass | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(EducationClassToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems.ts new file mode 100644 index 00000000000..0eb0ade4709 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { DriveItem } from './DriveItem'; +import { + DriveItemFromJSON, + DriveItemFromJSONTyped, + DriveItemToJSON, + DriveItemToJSONTyped, +} from './DriveItem'; + +/** + * + * @export + * @interface CollectionOfDriveItems + */ +export interface CollectionOfDriveItems { + /** + * + */ + value?: Array; + /** + * + */ + atOdataNextLink?: string; +} + +/** + * Check if a given object implements the CollectionOfDriveItems interface. + */ +export function instanceOfCollectionOfDriveItems(value: object): value is CollectionOfDriveItems { + return true; +} + +export function CollectionOfDriveItemsFromJSON(json: any): CollectionOfDriveItems { + return CollectionOfDriveItemsFromJSONTyped(json, false); +} + +export function CollectionOfDriveItemsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfDriveItems { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(DriveItemFromJSON)), + 'atOdataNextLink': json['@odata.nextLink'] == null ? undefined : json['@odata.nextLink'], + }; +} + +export function CollectionOfDriveItemsToJSON(json: any): CollectionOfDriveItems { + return CollectionOfDriveItemsToJSONTyped(json, false); +} + +export function CollectionOfDriveItemsToJSONTyped(value?: CollectionOfDriveItems | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(DriveItemToJSON)), + '@odata.nextLink': value['atOdataNextLink'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems1.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems1.ts new file mode 100644 index 00000000000..220037ff354 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfDriveItems1.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { DriveItem } from './DriveItem'; +import { + DriveItemFromJSON, + DriveItemFromJSONTyped, + DriveItemToJSON, + DriveItemToJSONTyped, +} from './DriveItem'; + +/** + * + * @export + * @interface CollectionOfDriveItems1 + */ +export interface CollectionOfDriveItems1 { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfDriveItems1 interface. + */ +export function instanceOfCollectionOfDriveItems1(value: object): value is CollectionOfDriveItems1 { + return true; +} + +export function CollectionOfDriveItems1FromJSON(json: any): CollectionOfDriveItems1 { + return CollectionOfDriveItems1FromJSONTyped(json, false); +} + +export function CollectionOfDriveItems1FromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfDriveItems1 { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(DriveItemFromJSON)), + }; +} + +export function CollectionOfDriveItems1ToJSON(json: any): CollectionOfDriveItems1 { + return CollectionOfDriveItems1ToJSONTyped(json, false); +} + +export function CollectionOfDriveItems1ToJSONTyped(value?: CollectionOfDriveItems1 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(DriveItemToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfDrives.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfDrives.ts new file mode 100644 index 00000000000..d0f623e53cb --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfDrives.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Drive } from './Drive'; +import { + DriveFromJSON, + DriveFromJSONTyped, + DriveToJSON, + DriveToJSONTyped, +} from './Drive'; + +/** + * + * @export + * @interface CollectionOfDrives + */ +export interface CollectionOfDrives { + /** + * + */ + value?: Array; + /** + * + */ + atOdataNextLink?: string; +} + +/** + * Check if a given object implements the CollectionOfDrives interface. + */ +export function instanceOfCollectionOfDrives(value: object): value is CollectionOfDrives { + return true; +} + +export function CollectionOfDrivesFromJSON(json: any): CollectionOfDrives { + return CollectionOfDrivesFromJSONTyped(json, false); +} + +export function CollectionOfDrivesFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfDrives { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(DriveFromJSON)), + 'atOdataNextLink': json['@odata.nextLink'] == null ? undefined : json['@odata.nextLink'], + }; +} + +export function CollectionOfDrivesToJSON(json: any): CollectionOfDrives { + return CollectionOfDrivesToJSONTyped(json, false); +} + +export function CollectionOfDrivesToJSONTyped(value?: CollectionOfDrives | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(DriveToJSON)), + '@odata.nextLink': value['atOdataNextLink'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfDrives1.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfDrives1.ts new file mode 100644 index 00000000000..d0debe8f469 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfDrives1.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Drive } from './Drive'; +import { + DriveFromJSON, + DriveFromJSONTyped, + DriveToJSON, + DriveToJSONTyped, +} from './Drive'; + +/** + * + * @export + * @interface CollectionOfDrives1 + */ +export interface CollectionOfDrives1 { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfDrives1 interface. + */ +export function instanceOfCollectionOfDrives1(value: object): value is CollectionOfDrives1 { + return true; +} + +export function CollectionOfDrives1FromJSON(json: any): CollectionOfDrives1 { + return CollectionOfDrives1FromJSONTyped(json, false); +} + +export function CollectionOfDrives1FromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfDrives1 { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(DriveFromJSON)), + }; +} + +export function CollectionOfDrives1ToJSON(json: any): CollectionOfDrives1 { + return CollectionOfDrives1ToJSONTyped(json, false); +} + +export function CollectionOfDrives1ToJSONTyped(value?: CollectionOfDrives1 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(DriveToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfEducationClass.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfEducationClass.ts new file mode 100644 index 00000000000..74ebef87f45 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfEducationClass.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { EducationClass } from './EducationClass'; +import { + EducationClassFromJSON, + EducationClassFromJSONTyped, + EducationClassToJSON, + EducationClassToJSONTyped, +} from './EducationClass'; + +/** + * + * @export + * @interface CollectionOfEducationClass + */ +export interface CollectionOfEducationClass { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfEducationClass interface. + */ +export function instanceOfCollectionOfEducationClass(value: object): value is CollectionOfEducationClass { + return true; +} + +export function CollectionOfEducationClassFromJSON(json: any): CollectionOfEducationClass { + return CollectionOfEducationClassFromJSONTyped(json, false); +} + +export function CollectionOfEducationClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfEducationClass { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(EducationClassFromJSON)), + }; +} + +export function CollectionOfEducationClassToJSON(json: any): CollectionOfEducationClass { + return CollectionOfEducationClassToJSONTyped(json, false); +} + +export function CollectionOfEducationClassToJSONTyped(value?: CollectionOfEducationClass | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(EducationClassToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfEducationUser.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfEducationUser.ts new file mode 100644 index 00000000000..e1cdba92157 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfEducationUser.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { EducationUser } from './EducationUser'; +import { + EducationUserFromJSON, + EducationUserFromJSONTyped, + EducationUserToJSON, + EducationUserToJSONTyped, +} from './EducationUser'; + +/** + * + * @export + * @interface CollectionOfEducationUser + */ +export interface CollectionOfEducationUser { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfEducationUser interface. + */ +export function instanceOfCollectionOfEducationUser(value: object): value is CollectionOfEducationUser { + return true; +} + +export function CollectionOfEducationUserFromJSON(json: any): CollectionOfEducationUser { + return CollectionOfEducationUserFromJSONTyped(json, false); +} + +export function CollectionOfEducationUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfEducationUser { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(EducationUserFromJSON)), + }; +} + +export function CollectionOfEducationUserToJSON(json: any): CollectionOfEducationUser { + return CollectionOfEducationUserToJSONTyped(json, false); +} + +export function CollectionOfEducationUserToJSONTyped(value?: CollectionOfEducationUser | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(EducationUserToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfGroup.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfGroup.ts new file mode 100644 index 00000000000..2add5b61bad --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfGroup.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; + +/** + * + * @export + * @interface CollectionOfGroup + */ +export interface CollectionOfGroup { + /** + * + */ + value?: Array; + /** + * + */ + atOdataNextLink?: string; +} + +/** + * Check if a given object implements the CollectionOfGroup interface. + */ +export function instanceOfCollectionOfGroup(value: object): value is CollectionOfGroup { + return true; +} + +export function CollectionOfGroupFromJSON(json: any): CollectionOfGroup { + return CollectionOfGroupFromJSONTyped(json, false); +} + +export function CollectionOfGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfGroup { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(GroupFromJSON)), + 'atOdataNextLink': json['@odata.nextLink'] == null ? undefined : json['@odata.nextLink'], + }; +} + +export function CollectionOfGroupToJSON(json: any): CollectionOfGroup { + return CollectionOfGroupToJSONTyped(json, false); +} + +export function CollectionOfGroupToJSONTyped(value?: CollectionOfGroup | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(GroupToJSON)), + '@odata.nextLink': value['atOdataNextLink'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfPermissions.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfPermissions.ts new file mode 100644 index 00000000000..e3d9c1745e9 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfPermissions.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionOfPermissions + */ +export interface CollectionOfPermissions { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfPermissions interface. + */ +export function instanceOfCollectionOfPermissions(value: object): value is CollectionOfPermissions { + return true; +} + +export function CollectionOfPermissionsFromJSON(json: any): CollectionOfPermissions { + return CollectionOfPermissionsFromJSONTyped(json, false); +} + +export function CollectionOfPermissionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfPermissions { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(PermissionFromJSON)), + }; +} + +export function CollectionOfPermissionsToJSON(json: any): CollectionOfPermissions { + return CollectionOfPermissionsToJSONTyped(json, false); +} + +export function CollectionOfPermissionsToJSONTyped(value?: CollectionOfPermissions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(PermissionToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfPermissionsWithAllowedValues.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfPermissionsWithAllowedValues.ts new file mode 100644 index 00000000000..f7e1af3e674 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfPermissionsWithAllowedValues.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; +import type { UnifiedRoleDefinition } from './UnifiedRoleDefinition'; +import { + UnifiedRoleDefinitionFromJSON, + UnifiedRoleDefinitionFromJSONTyped, + UnifiedRoleDefinitionToJSON, + UnifiedRoleDefinitionToJSONTyped, +} from './UnifiedRoleDefinition'; + +/** + * + * @export + * @interface CollectionOfPermissionsWithAllowedValues + */ +export interface CollectionOfPermissionsWithAllowedValues { + /** + * A list of role definitions that can be chosen for the resource. + */ + atLibreGraphPermissionsRolesAllowedValues?: Array; + /** + * A list of actions that can be chosen for a custom role. + * + * Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: + * | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | + * | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | + * | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | + * | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | + * | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | + * | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | + * | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | + * | `list_container` | `libre.graph/driveItem/children/read` | | + * | `create_container` | `libre.graph/driveItem/children/create` | | + * | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | + * | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | + * | `add_grant` | `libre.graph/driveItem/permissions/create` | | + * | `list_grant` | `libre.graph/driveItem/permissions/read` | | + * | `update_grant` | `libre.graph/driveItem/permissions/update` | | + * | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | + * | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | + * | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | + * | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | + * | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | + * | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | + * | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` | + * + */ + atLibreGraphPermissionsActionsAllowedValues?: Array; + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfPermissionsWithAllowedValues interface. + */ +export function instanceOfCollectionOfPermissionsWithAllowedValues(value: object): value is CollectionOfPermissionsWithAllowedValues { + return true; +} + +export function CollectionOfPermissionsWithAllowedValuesFromJSON(json: any): CollectionOfPermissionsWithAllowedValues { + return CollectionOfPermissionsWithAllowedValuesFromJSONTyped(json, false); +} + +export function CollectionOfPermissionsWithAllowedValuesFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfPermissionsWithAllowedValues { + if (json == null) { + return json; + } + return { + + 'atLibreGraphPermissionsRolesAllowedValues': json['@libre.graph.permissions.roles.allowedValues'] == null ? undefined : ((json['@libre.graph.permissions.roles.allowedValues'] as Array).map(UnifiedRoleDefinitionFromJSON)), + 'atLibreGraphPermissionsActionsAllowedValues': json['@libre.graph.permissions.actions.allowedValues'] == null ? undefined : json['@libre.graph.permissions.actions.allowedValues'], + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(PermissionFromJSON)), + }; +} + +export function CollectionOfPermissionsWithAllowedValuesToJSON(json: any): CollectionOfPermissionsWithAllowedValues { + return CollectionOfPermissionsWithAllowedValuesToJSONTyped(json, false); +} + +export function CollectionOfPermissionsWithAllowedValuesToJSONTyped(value?: CollectionOfPermissionsWithAllowedValues | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '@libre.graph.permissions.roles.allowedValues': value['atLibreGraphPermissionsRolesAllowedValues'] == null ? undefined : ((value['atLibreGraphPermissionsRolesAllowedValues'] as Array).map(UnifiedRoleDefinitionToJSON)), + '@libre.graph.permissions.actions.allowedValues': value['atLibreGraphPermissionsActionsAllowedValues'], + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(PermissionToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfSchools.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfSchools.ts new file mode 100644 index 00000000000..fc65aa37471 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfSchools.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { EducationSchool } from './EducationSchool'; +import { + EducationSchoolFromJSON, + EducationSchoolFromJSONTyped, + EducationSchoolToJSON, + EducationSchoolToJSONTyped, +} from './EducationSchool'; + +/** + * + * @export + * @interface CollectionOfSchools + */ +export interface CollectionOfSchools { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfSchools interface. + */ +export function instanceOfCollectionOfSchools(value: object): value is CollectionOfSchools { + return true; +} + +export function CollectionOfSchoolsFromJSON(json: any): CollectionOfSchools { + return CollectionOfSchoolsFromJSONTyped(json, false); +} + +export function CollectionOfSchoolsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfSchools { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(EducationSchoolFromJSON)), + }; +} + +export function CollectionOfSchoolsToJSON(json: any): CollectionOfSchools { + return CollectionOfSchoolsToJSONTyped(json, false); +} + +export function CollectionOfSchoolsToJSONTyped(value?: CollectionOfSchools | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(EducationSchoolToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfTags.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfTags.ts new file mode 100644 index 00000000000..0be78b9c657 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfTags.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CollectionOfTags + */ +export interface CollectionOfTags { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfTags interface. + */ +export function instanceOfCollectionOfTags(value: object): value is CollectionOfTags { + return true; +} + +export function CollectionOfTagsFromJSON(json: any): CollectionOfTags { + return CollectionOfTagsFromJSONTyped(json, false); +} + +export function CollectionOfTagsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfTags { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : json['value'], + }; +} + +export function CollectionOfTagsToJSON(json: any): CollectionOfTags { + return CollectionOfTagsToJSONTyped(json, false); +} + +export function CollectionOfTagsToJSONTyped(value?: CollectionOfTags | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfUser.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfUser.ts new file mode 100644 index 00000000000..32f0037ea06 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfUser.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface CollectionOfUser + */ +export interface CollectionOfUser { + /** + * + */ + value?: Array; + /** + * + */ + atOdataNextLink?: string; +} + +/** + * Check if a given object implements the CollectionOfUser interface. + */ +export function instanceOfCollectionOfUser(value: object): value is CollectionOfUser { + return true; +} + +export function CollectionOfUserFromJSON(json: any): CollectionOfUser { + return CollectionOfUserFromJSONTyped(json, false); +} + +export function CollectionOfUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfUser { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(UserFromJSON)), + 'atOdataNextLink': json['@odata.nextLink'] == null ? undefined : json['@odata.nextLink'], + }; +} + +export function CollectionOfUserToJSON(json: any): CollectionOfUser { + return CollectionOfUserToJSONTyped(json, false); +} + +export function CollectionOfUserToJSONTyped(value?: CollectionOfUser | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(UserToJSON)), + '@odata.nextLink': value['atOdataNextLink'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/CollectionOfUsers.ts b/web/packages/web-client/src/graph/generated/models/CollectionOfUsers.ts new file mode 100644 index 00000000000..e14fb327e32 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/CollectionOfUsers.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface CollectionOfUsers + */ +export interface CollectionOfUsers { + /** + * + */ + value?: Array; +} + +/** + * Check if a given object implements the CollectionOfUsers interface. + */ +export function instanceOfCollectionOfUsers(value: object): value is CollectionOfUsers { + return true; +} + +export function CollectionOfUsersFromJSON(json: any): CollectionOfUsers { + return CollectionOfUsersFromJSONTyped(json, false); +} + +export function CollectionOfUsersFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionOfUsers { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : ((json['value'] as Array).map(UserFromJSON)), + }; +} + +export function CollectionOfUsersToJSON(json: any): CollectionOfUsers { + return CollectionOfUsersToJSONTyped(json, false); +} + +export function CollectionOfUsersToJSONTyped(value?: CollectionOfUsers | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'] == null ? undefined : ((value['value'] as Array).map(UserToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Deleted.ts b/web/packages/web-client/src/graph/generated/models/Deleted.ts new file mode 100644 index 00000000000..782781106ce --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Deleted.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Information about the deleted state of the item. Read-only. + * @export + * @interface Deleted + */ +export interface Deleted { + /** + * Represents the state of the deleted item. + */ + state?: string; +} + +/** + * Check if a given object implements the Deleted interface. + */ +export function instanceOfDeleted(value: object): value is Deleted { + return true; +} + +export function DeletedFromJSON(json: any): Deleted { + return DeletedFromJSONTyped(json, false); +} + +export function DeletedFromJSONTyped(json: any, ignoreDiscriminator: boolean): Deleted { + if (json == null) { + return json; + } + return { + + 'state': json['state'] == null ? undefined : json['state'], + }; +} + +export function DeletedToJSON(json: any): Deleted { + return DeletedToJSONTyped(json, false); +} + +export function DeletedToJSONTyped(value?: Deleted | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'state': value['state'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Drive.ts b/web/packages/web-client/src/graph/generated/models/Drive.ts new file mode 100644 index 00000000000..2c083aa517c --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Drive.ts @@ -0,0 +1,182 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { ItemReference } from './ItemReference'; +import { + ItemReferenceFromJSON, + ItemReferenceFromJSONTyped, + ItemReferenceToJSON, + ItemReferenceToJSONTyped, +} from './ItemReference'; +import type { DriveItem } from './DriveItem'; +import { + DriveItemFromJSON, + DriveItemFromJSONTyped, + DriveItemToJSON, + DriveItemToJSONTyped, +} from './DriveItem'; +import type { Quota } from './Quota'; +import { + QuotaFromJSON, + QuotaFromJSONTyped, + QuotaToJSON, + QuotaToJSONTyped, +} from './Quota'; +import type { IdentitySet } from './IdentitySet'; +import { + IdentitySetFromJSON, + IdentitySetFromJSONTyped, + IdentitySetToJSON, + IdentitySetToJSONTyped, +} from './IdentitySet'; + +/** + * The drive represents a space on the storage. + * @export + * @interface Drive + */ +export interface Drive { + /** + * The unique identifier for this drive. + */ + readonly id?: string; + /** + * + */ + createdBy?: IdentitySet; + /** + * Date and time of item creation. Read-only. + */ + readonly createdDateTime?: Date; + /** + * Provides a user-visible description of the item. Optional. + */ + description?: string; + /** + * ETag for the item. Read-only. + */ + readonly eTag?: string; + /** + * + */ + lastModifiedBy?: IdentitySet; + /** + * Date and time the item was last modified. Read-only. + */ + readonly lastModifiedDateTime?: Date; + /** + * The name of the item. Read-write. + */ + name: string; + /** + * + */ + parentReference?: ItemReference; + /** + * URL that displays the resource in the browser. Read-only. + */ + readonly webUrl?: string; + /** + * Describes the type of drive represented by this resource. Values are "personal" for users home spaces, "project", "virtual" or "share". Read-only. + */ + readonly driveType?: string; + /** + * The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID. + */ + driveAlias?: string; + /** + * + */ + owner?: IdentitySet; + /** + * + */ + quota?: Quota; + /** + * All items contained in the drive. Read-only. Nullable. + */ + readonly items?: Array; + /** + * + */ + root?: DriveItem; + /** + * A collection of special drive resources. + */ + special?: Array; +} + +/** + * Check if a given object implements the Drive interface. + */ +export function instanceOfDrive(value: object): value is Drive { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function DriveFromJSON(json: any): Drive { + return DriveFromJSONTyped(json, false); +} + +export function DriveFromJSONTyped(json: any, ignoreDiscriminator: boolean): Drive { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'createdBy': json['createdBy'] == null ? undefined : IdentitySetFromJSON(json['createdBy']), + 'createdDateTime': json['createdDateTime'] == null ? undefined : (parseDateTime(json['createdDateTime'])), + 'description': json['description'] == null ? undefined : json['description'], + 'eTag': json['eTag'] == null ? undefined : json['eTag'], + 'lastModifiedBy': json['lastModifiedBy'] == null ? undefined : IdentitySetFromJSON(json['lastModifiedBy']), + 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : (parseDateTime(json['lastModifiedDateTime'])), + 'name': json['name'], + 'parentReference': json['parentReference'] == null ? undefined : ItemReferenceFromJSON(json['parentReference']), + 'webUrl': json['webUrl'] == null ? undefined : json['webUrl'], + 'driveType': json['driveType'] == null ? undefined : json['driveType'], + 'driveAlias': json['driveAlias'] == null ? undefined : json['driveAlias'], + 'owner': json['owner'] == null ? undefined : IdentitySetFromJSON(json['owner']), + 'quota': json['quota'] == null ? undefined : QuotaFromJSON(json['quota']), + 'items': json['items'] == null ? undefined : ((json['items'] as Array).map(DriveItemFromJSON)), + 'root': json['root'] == null ? undefined : DriveItemFromJSON(json['root']), + 'special': json['special'] == null ? undefined : ((json['special'] as Array).map(DriveItemFromJSON)), + }; +} + +export function DriveToJSON(json: any): Drive { + return DriveToJSONTyped(json, false); +} + +export function DriveToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'createdBy': IdentitySetToJSON(value['createdBy']), + 'description': value['description'], + 'lastModifiedBy': IdentitySetToJSON(value['lastModifiedBy']), + 'name': value['name'], + 'parentReference': ItemReferenceToJSON(value['parentReference']), + 'driveAlias': value['driveAlias'], + 'owner': IdentitySetToJSON(value['owner']), + 'quota': QuotaToJSON(value['quota']), + 'root': DriveItemToJSON(value['root']), + 'special': value['special'] == null ? undefined : ((value['special'] as Array).map(DriveItemToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/DriveItem.ts b/web/packages/web-client/src/graph/generated/models/DriveItem.ts new file mode 100644 index 00000000000..c5ed30504fe --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/DriveItem.ts @@ -0,0 +1,352 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { IdentitySet } from './IdentitySet'; +import { + IdentitySetFromJSON, + IdentitySetFromJSONTyped, + IdentitySetToJSON, + IdentitySetToJSONTyped, +} from './IdentitySet'; +import type { OpenGraphFile } from './OpenGraphFile'; +import { + OpenGraphFileFromJSON, + OpenGraphFileFromJSONTyped, + OpenGraphFileToJSON, + OpenGraphFileToJSONTyped, +} from './OpenGraphFile'; +import type { RemoteItem } from './RemoteItem'; +import { + RemoteItemFromJSON, + RemoteItemFromJSONTyped, + RemoteItemToJSON, + RemoteItemToJSONTyped, +} from './RemoteItem'; +import type { Photo } from './Photo'; +import { + PhotoFromJSON, + PhotoFromJSONTyped, + PhotoToJSON, + PhotoToJSONTyped, +} from './Photo'; +import type { Folder } from './Folder'; +import { + FolderFromJSON, + FolderFromJSONTyped, + FolderToJSON, + FolderToJSONTyped, +} from './Folder'; +import type { Image } from './Image'; +import { + ImageFromJSON, + ImageFromJSONTyped, + ImageToJSON, + ImageToJSONTyped, +} from './Image'; +import type { Trash } from './Trash'; +import { + TrashFromJSON, + TrashFromJSONTyped, + TrashToJSON, + TrashToJSONTyped, +} from './Trash'; +import type { ItemReference } from './ItemReference'; +import { + ItemReferenceFromJSON, + ItemReferenceFromJSONTyped, + ItemReferenceToJSON, + ItemReferenceToJSONTyped, +} from './ItemReference'; +import type { ThumbnailSet } from './ThumbnailSet'; +import { + ThumbnailSetFromJSON, + ThumbnailSetFromJSONTyped, + ThumbnailSetToJSON, + ThumbnailSetToJSONTyped, +} from './ThumbnailSet'; +import type { GeoCoordinates } from './GeoCoordinates'; +import { + GeoCoordinatesFromJSON, + GeoCoordinatesFromJSONTyped, + GeoCoordinatesToJSON, + GeoCoordinatesToJSONTyped, +} from './GeoCoordinates'; +import type { FileSystemInfo } from './FileSystemInfo'; +import { + FileSystemInfoFromJSON, + FileSystemInfoFromJSONTyped, + FileSystemInfoToJSON, + FileSystemInfoToJSONTyped, +} from './FileSystemInfo'; +import type { Video } from './Video'; +import { + VideoFromJSON, + VideoFromJSONTyped, + VideoToJSON, + VideoToJSONTyped, +} from './Video'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; +import type { Deleted } from './Deleted'; +import { + DeletedFromJSON, + DeletedFromJSONTyped, + DeletedToJSON, + DeletedToJSONTyped, +} from './Deleted'; +import type { Audio } from './Audio'; +import { + AudioFromJSON, + AudioFromJSONTyped, + AudioToJSON, + AudioToJSONTyped, +} from './Audio'; +import type { SpecialFolder } from './SpecialFolder'; +import { + SpecialFolderFromJSON, + SpecialFolderFromJSONTyped, + SpecialFolderToJSON, + SpecialFolderToJSONTyped, +} from './SpecialFolder'; + +/** + * Represents a resource inside a drive. Read-only. + * @export + * @interface DriveItem + */ +export interface DriveItem { + /** + * Read-only. + */ + readonly id?: string; + /** + * + */ + createdBy?: IdentitySet; + /** + * Date and time of item creation. Read-only. + */ + readonly createdDateTime?: Date; + /** + * Provides a user-visible description of the item. Optional. + */ + description?: string; + /** + * ETag for the item. Read-only. + */ + readonly eTag?: string; + /** + * + */ + lastModifiedBy?: IdentitySet; + /** + * Date and time the item was last modified. Read-only. + */ + readonly lastModifiedDateTime?: Date; + /** + * The name of the item. Read-write. + */ + name?: string; + /** + * + */ + parentReference?: ItemReference; + /** + * URL that displays the resource in the browser. Read-only. + */ + readonly webUrl?: string; + /** + * The content stream, if the item represents a file. + */ + content?: string; + /** + * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. + */ + readonly cTag?: string; + /** + * + */ + deleted?: Deleted; + /** + * + */ + file?: OpenGraphFile; + /** + * + */ + fileSystemInfo?: FileSystemInfo; + /** + * + */ + folder?: Folder; + /** + * + */ + image?: Image; + /** + * + */ + photo?: Photo; + /** + * + */ + location?: GeoCoordinates; + /** + * Collection containing ThumbnailSet objects associated with the item. Read-only. Nullable. + */ + thumbnails?: Array; + /** + * If this property is non-null, it indicates that the driveItem is the top-most driveItem in the drive. + */ + root?: object; + /** + * + */ + trash?: Trash; + /** + * + */ + specialFolder?: SpecialFolder; + /** + * + */ + remoteItem?: RemoteItem; + /** + * Size of the item in bytes. Read-only. + */ + readonly size?: number; + /** + * WebDAV compatible URL for the item. Read-only. + */ + readonly webDavUrl?: string; + /** + * Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. + */ + readonly children?: Array; + /** + * The set of permissions for the item. Read-only. Nullable. + */ + readonly permissions?: Array; + /** + * + */ + audio?: Audio; + /** + * + */ + video?: Video; + /** + * Indicates if the item is synchronized with the underlying storage provider. Read-only. + */ + atClientSynchronize?: boolean; + /** + * Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissions. + */ + atUIHidden?: boolean; +} + +/** + * Check if a given object implements the DriveItem interface. + */ +export function instanceOfDriveItem(value: object): value is DriveItem { + return true; +} + +export function DriveItemFromJSON(json: any): DriveItem { + return DriveItemFromJSONTyped(json, false); +} + +export function DriveItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): DriveItem { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'createdBy': json['createdBy'] == null ? undefined : IdentitySetFromJSON(json['createdBy']), + 'createdDateTime': json['createdDateTime'] == null ? undefined : (parseDateTime(json['createdDateTime'])), + 'description': json['description'] == null ? undefined : json['description'], + 'eTag': json['eTag'] == null ? undefined : json['eTag'], + 'lastModifiedBy': json['lastModifiedBy'] == null ? undefined : IdentitySetFromJSON(json['lastModifiedBy']), + 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : (parseDateTime(json['lastModifiedDateTime'])), + 'name': json['name'] == null ? undefined : json['name'], + 'parentReference': json['parentReference'] == null ? undefined : ItemReferenceFromJSON(json['parentReference']), + 'webUrl': json['webUrl'] == null ? undefined : json['webUrl'], + 'content': json['content'] == null ? undefined : json['content'], + 'cTag': json['cTag'] == null ? undefined : json['cTag'], + 'deleted': json['deleted'] == null ? undefined : DeletedFromJSON(json['deleted']), + 'file': json['file'] == null ? undefined : OpenGraphFileFromJSON(json['file']), + 'fileSystemInfo': json['fileSystemInfo'] == null ? undefined : FileSystemInfoFromJSON(json['fileSystemInfo']), + 'folder': json['folder'] == null ? undefined : FolderFromJSON(json['folder']), + 'image': json['image'] == null ? undefined : ImageFromJSON(json['image']), + 'photo': json['photo'] == null ? undefined : PhotoFromJSON(json['photo']), + 'location': json['location'] == null ? undefined : GeoCoordinatesFromJSON(json['location']), + 'thumbnails': json['thumbnails'] == null ? undefined : ((json['thumbnails'] as Array).map(ThumbnailSetFromJSON)), + 'root': json['root'] == null ? undefined : json['root'], + 'trash': json['trash'] == null ? undefined : TrashFromJSON(json['trash']), + 'specialFolder': json['specialFolder'] == null ? undefined : SpecialFolderFromJSON(json['specialFolder']), + 'remoteItem': json['remoteItem'] == null ? undefined : RemoteItemFromJSON(json['remoteItem']), + 'size': json['size'] == null ? undefined : json['size'], + 'webDavUrl': json['webDavUrl'] == null ? undefined : json['webDavUrl'], + 'children': json['children'] == null ? undefined : ((json['children'] as Array).map(DriveItemFromJSON)), + 'permissions': json['permissions'] == null ? undefined : ((json['permissions'] as Array).map(PermissionFromJSON)), + 'audio': json['audio'] == null ? undefined : AudioFromJSON(json['audio']), + 'video': json['video'] == null ? undefined : VideoFromJSON(json['video']), + 'atClientSynchronize': json['@client.synchronize'] == null ? undefined : json['@client.synchronize'], + 'atUIHidden': json['@UI.Hidden'] == null ? undefined : json['@UI.Hidden'], + }; +} + +export function DriveItemToJSON(json: any): DriveItem { + return DriveItemToJSONTyped(json, false); +} + +export function DriveItemToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'createdBy': IdentitySetToJSON(value['createdBy']), + 'description': value['description'], + 'lastModifiedBy': IdentitySetToJSON(value['lastModifiedBy']), + 'name': value['name'], + 'parentReference': ItemReferenceToJSON(value['parentReference']), + 'content': value['content'], + 'deleted': DeletedToJSON(value['deleted']), + 'file': OpenGraphFileToJSON(value['file']), + 'fileSystemInfo': FileSystemInfoToJSON(value['fileSystemInfo']), + 'folder': FolderToJSON(value['folder']), + 'image': ImageToJSON(value['image']), + 'photo': PhotoToJSON(value['photo']), + 'location': GeoCoordinatesToJSON(value['location']), + 'thumbnails': value['thumbnails'] == null ? undefined : ((value['thumbnails'] as Array).map(ThumbnailSetToJSON)), + 'root': value['root'], + 'trash': TrashToJSON(value['trash']), + 'specialFolder': SpecialFolderToJSON(value['specialFolder']), + 'remoteItem': RemoteItemToJSON(value['remoteItem']), + 'audio': AudioToJSON(value['audio']), + 'video': VideoToJSON(value['video']), + '@client.synchronize': value['atClientSynchronize'], + '@UI.Hidden': value['atUIHidden'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/DriveItemCreateLink.ts b/web/packages/web-client/src/graph/generated/models/DriveItemCreateLink.ts new file mode 100644 index 00000000000..dcc7130a048 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/DriveItemCreateLink.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { SharingLinkType } from './SharingLinkType'; +import { + SharingLinkTypeFromJSON, + SharingLinkTypeFromJSONTyped, + SharingLinkTypeToJSON, + SharingLinkTypeToJSONTyped, +} from './SharingLinkType'; + +/** + * + * @export + * @interface DriveItemCreateLink + */ +export interface DriveItemCreateLink { + /** + * + */ + type?: SharingLinkType; + /** + * Optional. A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates the expiration time of the permission. + */ + expirationDateTime?: Date; + /** + * Optional.The password of the sharing link that is set by the creator. + */ + password?: string; + /** + * Provides a user-visible display name of the link. Optional. Libregraph only. + */ + displayName?: string; + /** + * The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only. + */ + atLibreGraphQuickLink?: boolean; +} + + + +/** + * Check if a given object implements the DriveItemCreateLink interface. + */ +export function instanceOfDriveItemCreateLink(value: object): value is DriveItemCreateLink { + return true; +} + +export function DriveItemCreateLinkFromJSON(json: any): DriveItemCreateLink { + return DriveItemCreateLinkFromJSONTyped(json, false); +} + +export function DriveItemCreateLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): DriveItemCreateLink { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : SharingLinkTypeFromJSON(json['type']), + 'expirationDateTime': json['expirationDateTime'] == null ? undefined : (parseDateTime(json['expirationDateTime'])), + 'password': json['password'] == null ? undefined : json['password'], + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'atLibreGraphQuickLink': json['@libre.graph.quickLink'] == null ? undefined : json['@libre.graph.quickLink'], + }; +} + +export function DriveItemCreateLinkToJSON(json: any): DriveItemCreateLink { + return DriveItemCreateLinkToJSONTyped(json, false); +} + +export function DriveItemCreateLinkToJSONTyped(value?: DriveItemCreateLink | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': SharingLinkTypeToJSON(value['type']), + 'expirationDateTime': value['expirationDateTime'] == null ? value['expirationDateTime'] : serializeDateTime(value['expirationDateTime']), + 'password': value['password'], + 'displayName': value['displayName'], + '@libre.graph.quickLink': value['atLibreGraphQuickLink'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/DriveItemInvite.ts b/web/packages/web-client/src/graph/generated/models/DriveItemInvite.ts new file mode 100644 index 00000000000..3b50bdcc927 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/DriveItemInvite.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { DriveRecipient } from './DriveRecipient'; +import { + DriveRecipientFromJSON, + DriveRecipientFromJSONTyped, + DriveRecipientToJSON, + DriveRecipientToJSONTyped, +} from './DriveRecipient'; + +/** + * + * @export + * @interface DriveItemInvite + */ +export interface DriveItemInvite { + /** + * A collection of recipients who will receive access and the sharing invitation. Currently, only internal users or groups are supported. + */ + recipients?: Array; + /** + * Specifies the roles that are to be granted to the recipients of the sharing invitation. + */ + roles?: Array; + /** + * Specifies the actions that are to be granted to the recipients of the sharing invitation, in effect creating a custom role. + */ + atLibreGraphPermissionsActions?: Array; + /** + * Specifies the dateTime after which the permission expires. + */ + expirationDateTime?: Date; +} + +/** + * Check if a given object implements the DriveItemInvite interface. + */ +export function instanceOfDriveItemInvite(value: object): value is DriveItemInvite { + return true; +} + +export function DriveItemInviteFromJSON(json: any): DriveItemInvite { + return DriveItemInviteFromJSONTyped(json, false); +} + +export function DriveItemInviteFromJSONTyped(json: any, ignoreDiscriminator: boolean): DriveItemInvite { + if (json == null) { + return json; + } + return { + + 'recipients': json['recipients'] == null ? undefined : ((json['recipients'] as Array).map(DriveRecipientFromJSON)), + 'roles': json['roles'] == null ? undefined : json['roles'], + 'atLibreGraphPermissionsActions': json['@libre.graph.permissions.actions'] == null ? undefined : json['@libre.graph.permissions.actions'], + 'expirationDateTime': json['expirationDateTime'] == null ? undefined : (parseDateTime(json['expirationDateTime'])), + }; +} + +export function DriveItemInviteToJSON(json: any): DriveItemInvite { + return DriveItemInviteToJSONTyped(json, false); +} + +export function DriveItemInviteToJSONTyped(value?: DriveItemInvite | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'recipients': value['recipients'] == null ? undefined : ((value['recipients'] as Array).map(DriveRecipientToJSON)), + 'roles': value['roles'], + '@libre.graph.permissions.actions': value['atLibreGraphPermissionsActions'], + 'expirationDateTime': value['expirationDateTime'] == null ? value['expirationDateTime'] : serializeDateTime(value['expirationDateTime']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/DriveRecipient.ts b/web/packages/web-client/src/graph/generated/models/DriveRecipient.ts new file mode 100644 index 00000000000..fc3aea53b3f --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/DriveRecipient.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Represents a person, group, or other recipient to share a drive item with using the invite action. + * + * When using invite to add permissions, the `driveRecipient` object would specify the `email`, `alias`, + * or `objectId` of the recipient. Only one of these values is required; multiple values are not accepted. + * + * @export + * @interface DriveRecipient + */ +export interface DriveRecipient { + /** + * The unique identifier for the recipient in the directory. + */ + objectId?: string; + /** + * When the recipient is referenced by objectId this annotation is used to differentiate `user` and `group` recipients. + */ + atLibreGraphRecipientType?: string; +} + +/** + * Check if a given object implements the DriveRecipient interface. + */ +export function instanceOfDriveRecipient(value: object): value is DriveRecipient { + return true; +} + +export function DriveRecipientFromJSON(json: any): DriveRecipient { + return DriveRecipientFromJSONTyped(json, false); +} + +export function DriveRecipientFromJSONTyped(json: any, ignoreDiscriminator: boolean): DriveRecipient { + if (json == null) { + return json; + } + return { + + 'objectId': json['objectId'] == null ? undefined : json['objectId'], + 'atLibreGraphRecipientType': json['@libre.graph.recipient.type'] == null ? undefined : json['@libre.graph.recipient.type'], + }; +} + +export function DriveRecipientToJSON(json: any): DriveRecipient { + return DriveRecipientToJSONTyped(json, false); +} + +export function DriveRecipientToJSONTyped(value?: DriveRecipient | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'objectId': value['objectId'], + '@libre.graph.recipient.type': value['atLibreGraphRecipientType'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts b/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts new file mode 100644 index 00000000000..7f6b6251465 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts @@ -0,0 +1,181 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { ItemReference } from './ItemReference'; +import { + ItemReferenceFromJSON, + ItemReferenceFromJSONTyped, + ItemReferenceToJSON, + ItemReferenceToJSONTyped, +} from './ItemReference'; +import type { DriveItem } from './DriveItem'; +import { + DriveItemFromJSON, + DriveItemFromJSONTyped, + DriveItemToJSON, + DriveItemToJSONTyped, +} from './DriveItem'; +import type { Quota } from './Quota'; +import { + QuotaFromJSON, + QuotaFromJSONTyped, + QuotaToJSON, + QuotaToJSONTyped, +} from './Quota'; +import type { IdentitySet } from './IdentitySet'; +import { + IdentitySetFromJSON, + IdentitySetFromJSONTyped, + IdentitySetToJSON, + IdentitySetToJSONTyped, +} from './IdentitySet'; + +/** + * The drive represents an update to a space on the storage. + * @export + * @interface DriveUpdate + */ +export interface DriveUpdate { + /** + * The unique identifier for this drive. + */ + readonly id?: string; + /** + * + */ + createdBy?: IdentitySet; + /** + * Date and time of item creation. Read-only. + */ + readonly createdDateTime?: Date; + /** + * Provides a user-visible description of the item. Optional. + */ + description?: string; + /** + * ETag for the item. Read-only. + */ + readonly eTag?: string; + /** + * + */ + lastModifiedBy?: IdentitySet; + /** + * Date and time the item was last modified. Read-only. + */ + readonly lastModifiedDateTime?: Date; + /** + * The name of the item. Read-write. + */ + name?: string; + /** + * + */ + parentReference?: ItemReference; + /** + * URL that displays the resource in the browser. Read-only. + */ + readonly webUrl?: string; + /** + * Describes the type of drive represented by this resource. Values are "personal" for users home spaces, "project", "virtual" or "share". Read-only. + */ + readonly driveType?: string; + /** + * The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID. + */ + driveAlias?: string; + /** + * + */ + owner?: IdentitySet; + /** + * + */ + quota?: Quota; + /** + * All items contained in the drive. Read-only. Nullable. + */ + readonly items?: Array; + /** + * + */ + root?: DriveItem; + /** + * A collection of special drive resources. + */ + special?: Array; +} + +/** + * Check if a given object implements the DriveUpdate interface. + */ +export function instanceOfDriveUpdate(value: object): value is DriveUpdate { + return true; +} + +export function DriveUpdateFromJSON(json: any): DriveUpdate { + return DriveUpdateFromJSONTyped(json, false); +} + +export function DriveUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): DriveUpdate { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'createdBy': json['createdBy'] == null ? undefined : IdentitySetFromJSON(json['createdBy']), + 'createdDateTime': json['createdDateTime'] == null ? undefined : (parseDateTime(json['createdDateTime'])), + 'description': json['description'] == null ? undefined : json['description'], + 'eTag': json['eTag'] == null ? undefined : json['eTag'], + 'lastModifiedBy': json['lastModifiedBy'] == null ? undefined : IdentitySetFromJSON(json['lastModifiedBy']), + 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : (parseDateTime(json['lastModifiedDateTime'])), + 'name': json['name'] == null ? undefined : json['name'], + 'parentReference': json['parentReference'] == null ? undefined : ItemReferenceFromJSON(json['parentReference']), + 'webUrl': json['webUrl'] == null ? undefined : json['webUrl'], + 'driveType': json['driveType'] == null ? undefined : json['driveType'], + 'driveAlias': json['driveAlias'] == null ? undefined : json['driveAlias'], + 'owner': json['owner'] == null ? undefined : IdentitySetFromJSON(json['owner']), + 'quota': json['quota'] == null ? undefined : QuotaFromJSON(json['quota']), + 'items': json['items'] == null ? undefined : ((json['items'] as Array).map(DriveItemFromJSON)), + 'root': json['root'] == null ? undefined : DriveItemFromJSON(json['root']), + 'special': json['special'] == null ? undefined : ((json['special'] as Array).map(DriveItemFromJSON)), + }; +} + +export function DriveUpdateToJSON(json: any): DriveUpdate { + return DriveUpdateToJSONTyped(json, false); +} + +export function DriveUpdateToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'createdBy': IdentitySetToJSON(value['createdBy']), + 'description': value['description'], + 'lastModifiedBy': IdentitySetToJSON(value['lastModifiedBy']), + 'name': value['name'], + 'parentReference': ItemReferenceToJSON(value['parentReference']), + 'driveAlias': value['driveAlias'], + 'owner': IdentitySetToJSON(value['owner']), + 'quota': QuotaToJSON(value['quota']), + 'root': DriveItemToJSON(value['root']), + 'special': value['special'] == null ? undefined : ((value['special'] as Array).map(DriveItemToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/EducationClass.ts b/web/packages/web-client/src/graph/generated/models/EducationClass.ts new file mode 100644 index 00000000000..9b39dfbd637 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/EducationClass.ts @@ -0,0 +1,117 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * And extension of group representing a class or course + * @export + * @interface EducationClass + */ +export interface EducationClass { + /** + * Read-only. + */ + readonly id?: string; + /** + * An optional description for the group. Returned by default. + */ + description?: string; + /** + * The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy. + */ + displayName?: string; + /** + * Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand. + */ + members?: Array; + /** + * A list of member references to the members to be added. Up to 20 members can be added with a single request + */ + membersodataBind?: Set; + /** + * Classification of the group, i.e. "class" or "course" + */ + classification?: EducationClassClassificationEnum; + /** + * An external unique ID for the class + */ + externalId?: string; +} + + +/** + * @export + */ +export const EducationClassClassificationEnum = { + Class: 'class', + Course: 'course', +} as const; +export type EducationClassClassificationEnum = typeof EducationClassClassificationEnum[keyof typeof EducationClassClassificationEnum]; + + +/** + * Check if a given object implements the EducationClass interface. + */ +export function instanceOfEducationClass(value: object): value is EducationClass { + return true; +} + +export function EducationClassFromJSON(json: any): EducationClass { + return EducationClassFromJSONTyped(json, false); +} + +export function EducationClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): EducationClass { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'description': json['description'] == null ? undefined : json['description'], + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'members': json['members'] == null ? undefined : ((json['members'] as Array).map(UserFromJSON)), + 'membersodataBind': json['members@odata.bind'] == null ? undefined : new Set(json['members@odata.bind']), + 'classification': json['classification'] == null ? undefined : json['classification'], + 'externalId': json['externalId'] == null ? undefined : json['externalId'], + }; +} + +export function EducationClassToJSON(json: any): EducationClass { + return EducationClassToJSONTyped(json, false); +} + +export function EducationClassToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'description': value['description'], + 'displayName': value['displayName'], + 'members': value['members'] == null ? undefined : ((value['members'] as Array).map(UserToJSON)), + 'members@odata.bind': value['membersodataBind'] == null ? undefined : Array.from(value['membersodataBind'] as Set), + 'classification': value['classification'], + 'externalId': value['externalId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/EducationSchool.ts b/web/packages/web-client/src/graph/generated/models/EducationSchool.ts new file mode 100644 index 00000000000..293678c9ae2 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/EducationSchool.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +/** + * Represents a school + * @export + * @interface EducationSchool + */ +export interface EducationSchool { + /** + * The unique identifier for an entity. Read-only. + */ + readonly id?: string; + /** + * The organization name + */ + displayName?: string; + /** + * School number + */ + schoolNumber?: string; + /** + * Date and time at which the service for this organization is scheduled to be terminated + */ + terminationDate?: Date | null; +} + +/** + * Check if a given object implements the EducationSchool interface. + */ +export function instanceOfEducationSchool(value: object): value is EducationSchool { + return true; +} + +export function EducationSchoolFromJSON(json: any): EducationSchool { + return EducationSchoolFromJSONTyped(json, false); +} + +export function EducationSchoolFromJSONTyped(json: any, ignoreDiscriminator: boolean): EducationSchool { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'schoolNumber': json['schoolNumber'] == null ? undefined : json['schoolNumber'], + 'terminationDate': json['terminationDate'] === undefined ? undefined : json['terminationDate'] === null ? null : (parseDateTime(json['terminationDate'])), + }; +} + +export function EducationSchoolToJSON(json: any): EducationSchool { + return EducationSchoolToJSONTyped(json, false); +} + +export function EducationSchoolToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'displayName': value['displayName'], + 'schoolNumber': value['schoolNumber'], + 'terminationDate': value['terminationDate'] == null ? value['terminationDate'] : serializeDateTime(value['terminationDate']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/EducationUser.ts b/web/packages/web-client/src/graph/generated/models/EducationUser.ts new file mode 100644 index 00000000000..ed044d44430 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/EducationUser.ts @@ -0,0 +1,174 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; +import type { ObjectIdentity } from './ObjectIdentity'; +import { + ObjectIdentityFromJSON, + ObjectIdentityFromJSONTyped, + ObjectIdentityToJSON, + ObjectIdentityToJSONTyped, +} from './ObjectIdentity'; +import type { Drive } from './Drive'; +import { + DriveFromJSON, + DriveFromJSONTyped, + DriveToJSON, + DriveToJSONTyped, +} from './Drive'; +import type { PasswordProfile } from './PasswordProfile'; +import { + PasswordProfileFromJSON, + PasswordProfileFromJSONTyped, + PasswordProfileToJSON, + PasswordProfileToJSONTyped, +} from './PasswordProfile'; + +/** + * An extension of user with education-specific attributes + * @export + * @interface EducationUser + */ +export interface EducationUser { + /** + * Read-only. + */ + readonly id?: string; + /** + * Set to "true" when the account is enabled. + */ + accountEnabled?: boolean; + /** + * The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. + */ + displayName?: string; + /** + * A collection of drives available for this user. Read-only. + */ + readonly drives?: Array; + /** + * + */ + drive?: Drive; + /** + * Identities associated with this account. + */ + identities?: Array; + /** + * The SMTP address for the user, for example, 'jeff@contoso.onowncloud.com'. Returned by default. + */ + mail?: string; + /** + * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + */ + memberOf?: Array; + /** + * Contains the on-premises SAM account name synchronized from the on-premises directory. Read-only. + */ + onPremisesSamAccountName?: string; + /** + * + */ + passwordProfile?: PasswordProfile; + /** + * The user's surname (family name or last name). Returned by default. + */ + surname?: string; + /** + * The user's givenName. Returned by default. + */ + givenName?: string; + /** + * The user`s default role. Such as "student" or "teacher" + */ + primaryRole?: string; + /** + * The user`s type. This can be either "Member" for regular user, "Guest" for guest users or "Federated" for users imported from a federated instance. + */ + userType?: string; + /** + * A unique identifier for the user assigned by the school or institution. + */ + externalID?: string; +} + +/** + * Check if a given object implements the EducationUser interface. + */ +export function instanceOfEducationUser(value: object): value is EducationUser { + return true; +} + +export function EducationUserFromJSON(json: any): EducationUser { + return EducationUserFromJSONTyped(json, false); +} + +export function EducationUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): EducationUser { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'accountEnabled': json['accountEnabled'] == null ? undefined : json['accountEnabled'], + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'drives': json['drives'] == null ? undefined : ((json['drives'] as Array).map(DriveFromJSON)), + 'drive': json['drive'] == null ? undefined : DriveFromJSON(json['drive']), + 'identities': json['identities'] == null ? undefined : ((json['identities'] as Array).map(ObjectIdentityFromJSON)), + 'mail': json['mail'] == null ? undefined : json['mail'], + 'memberOf': json['memberOf'] == null ? undefined : ((json['memberOf'] as Array).map(GroupFromJSON)), + 'onPremisesSamAccountName': json['onPremisesSamAccountName'] == null ? undefined : json['onPremisesSamAccountName'], + 'passwordProfile': json['passwordProfile'] == null ? undefined : PasswordProfileFromJSON(json['passwordProfile']), + 'surname': json['surname'] == null ? undefined : json['surname'], + 'givenName': json['givenName'] == null ? undefined : json['givenName'], + 'primaryRole': json['primaryRole'] == null ? undefined : json['primaryRole'], + 'userType': json['userType'] == null ? undefined : json['userType'], + 'externalID': json['externalID'] == null ? undefined : json['externalID'], + }; +} + +export function EducationUserToJSON(json: any): EducationUser { + return EducationUserToJSONTyped(json, false); +} + +export function EducationUserToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountEnabled': value['accountEnabled'], + 'displayName': value['displayName'], + 'drive': DriveToJSON(value['drive']), + 'identities': value['identities'] == null ? undefined : ((value['identities'] as Array).map(ObjectIdentityToJSON)), + 'mail': value['mail'], + 'memberOf': value['memberOf'] == null ? undefined : ((value['memberOf'] as Array).map(GroupToJSON)), + 'onPremisesSamAccountName': value['onPremisesSamAccountName'], + 'passwordProfile': PasswordProfileToJSON(value['passwordProfile']), + 'surname': value['surname'], + 'givenName': value['givenName'], + 'primaryRole': value['primaryRole'], + 'userType': value['userType'], + 'externalID': value['externalID'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/EducationUserReference.ts b/web/packages/web-client/src/graph/generated/models/EducationUserReference.ts new file mode 100644 index 00000000000..422801d5399 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/EducationUserReference.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface EducationUserReference + */ +export interface EducationUserReference { + /** + * + */ + atOdataId?: string; +} + +/** + * Check if a given object implements the EducationUserReference interface. + */ +export function instanceOfEducationUserReference(value: object): value is EducationUserReference { + return true; +} + +export function EducationUserReferenceFromJSON(json: any): EducationUserReference { + return EducationUserReferenceFromJSONTyped(json, false); +} + +export function EducationUserReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): EducationUserReference { + if (json == null) { + return json; + } + return { + + 'atOdataId': json['@odata.id'] == null ? undefined : json['@odata.id'], + }; +} + +export function EducationUserReferenceToJSON(json: any): EducationUserReference { + return EducationUserReferenceToJSONTyped(json, false); +} + +export function EducationUserReferenceToJSONTyped(value?: EducationUserReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '@odata.id': value['atOdataId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ExportPersonalDataRequest.ts b/web/packages/web-client/src/graph/generated/models/ExportPersonalDataRequest.ts new file mode 100644 index 00000000000..e14de2859d5 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ExportPersonalDataRequest.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ExportPersonalDataRequest + */ +export interface ExportPersonalDataRequest { + /** + * the path where the file should be created in the users personal space + */ + storageLocation?: string; +} + +/** + * Check if a given object implements the ExportPersonalDataRequest interface. + */ +export function instanceOfExportPersonalDataRequest(value: object): value is ExportPersonalDataRequest { + return true; +} + +export function ExportPersonalDataRequestFromJSON(json: any): ExportPersonalDataRequest { + return ExportPersonalDataRequestFromJSONTyped(json, false); +} + +export function ExportPersonalDataRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExportPersonalDataRequest { + if (json == null) { + return json; + } + return { + + 'storageLocation': json['storageLocation'] == null ? undefined : json['storageLocation'], + }; +} + +export function ExportPersonalDataRequestToJSON(json: any): ExportPersonalDataRequest { + return ExportPersonalDataRequestToJSONTyped(json, false); +} + +export function ExportPersonalDataRequestToJSONTyped(value?: ExportPersonalDataRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'storageLocation': value['storageLocation'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts b/web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts new file mode 100644 index 00000000000..c912e1be55e --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +/** + * File system information on client. Read-write. + * @export + * @interface FileSystemInfo + */ +export interface FileSystemInfo { + /** + * The UTC date and time the file was created on a client. + */ + createdDateTime?: Date; + /** + * The UTC date and time the file was last accessed. Available for the recent file list only. + */ + lastAccessedDateTime?: Date; + /** + * The UTC date and time the file was last modified on a client. + */ + lastModifiedDateTime?: Date; +} + +/** + * Check if a given object implements the FileSystemInfo interface. + */ +export function instanceOfFileSystemInfo(value: object): value is FileSystemInfo { + return true; +} + +export function FileSystemInfoFromJSON(json: any): FileSystemInfo { + return FileSystemInfoFromJSONTyped(json, false); +} + +export function FileSystemInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileSystemInfo { + if (json == null) { + return json; + } + return { + + 'createdDateTime': json['createdDateTime'] == null ? undefined : (parseDateTime(json['createdDateTime'])), + 'lastAccessedDateTime': json['lastAccessedDateTime'] == null ? undefined : (parseDateTime(json['lastAccessedDateTime'])), + 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : (parseDateTime(json['lastModifiedDateTime'])), + }; +} + +export function FileSystemInfoToJSON(json: any): FileSystemInfo { + return FileSystemInfoToJSONTyped(json, false); +} + +export function FileSystemInfoToJSONTyped(value?: FileSystemInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'createdDateTime': value['createdDateTime'] == null ? value['createdDateTime'] : serializeDateTime(value['createdDateTime']), + 'lastAccessedDateTime': value['lastAccessedDateTime'] == null ? value['lastAccessedDateTime'] : serializeDateTime(value['lastAccessedDateTime']), + 'lastModifiedDateTime': value['lastModifiedDateTime'] == null ? value['lastModifiedDateTime'] : serializeDateTime(value['lastModifiedDateTime']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Folder.ts b/web/packages/web-client/src/graph/generated/models/Folder.ts new file mode 100644 index 00000000000..a625f711dfc --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Folder.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FolderView } from './FolderView'; +import { + FolderViewFromJSON, + FolderViewFromJSONTyped, + FolderViewToJSON, + FolderViewToJSONTyped, +} from './FolderView'; + +/** + * Folder metadata, if the item is a folder. Read-only. + * @export + * @interface Folder + */ +export interface Folder { + /** + * Number of children contained immediately within this container. + */ + childCount?: number; + /** + * + */ + view?: FolderView; +} + +/** + * Check if a given object implements the Folder interface. + */ +export function instanceOfFolder(value: object): value is Folder { + return true; +} + +export function FolderFromJSON(json: any): Folder { + return FolderFromJSONTyped(json, false); +} + +export function FolderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Folder { + if (json == null) { + return json; + } + return { + + 'childCount': json['childCount'] == null ? undefined : json['childCount'], + 'view': json['view'] == null ? undefined : FolderViewFromJSON(json['view']), + }; +} + +export function FolderToJSON(json: any): Folder { + return FolderToJSONTyped(json, false); +} + +export function FolderToJSONTyped(value?: Folder | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'childCount': value['childCount'], + 'view': FolderViewToJSON(value['view']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/FolderView.ts b/web/packages/web-client/src/graph/generated/models/FolderView.ts new file mode 100644 index 00000000000..25b0dc4552a --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/FolderView.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * A collection of properties defining the recommended view for the folder. + * @export + * @interface FolderView + */ +export interface FolderView { + /** + * The method by which the folder should be sorted. + */ + sortBy?: string; + /** + * If true, indicates that items should be sorted in descending order. Otherwise, items should be sorted ascending. + */ + sortOrder?: string; + /** + * The type of view that should be used to represent the folder. + */ + viewType?: string; +} + +/** + * Check if a given object implements the FolderView interface. + */ +export function instanceOfFolderView(value: object): value is FolderView { + return true; +} + +export function FolderViewFromJSON(json: any): FolderView { + return FolderViewFromJSONTyped(json, false); +} + +export function FolderViewFromJSONTyped(json: any, ignoreDiscriminator: boolean): FolderView { + if (json == null) { + return json; + } + return { + + 'sortBy': json['sortBy'] == null ? undefined : json['sortBy'], + 'sortOrder': json['sortOrder'] == null ? undefined : json['sortOrder'], + 'viewType': json['viewType'] == null ? undefined : json['viewType'], + }; +} + +export function FolderViewToJSON(json: any): FolderView { + return FolderViewToJSONTyped(json, false); +} + +export function FolderViewToJSONTyped(value?: FolderView | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sortBy': value['sortBy'], + 'sortOrder': value['sortOrder'], + 'viewType': value['viewType'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/GeoCoordinates.ts b/web/packages/web-client/src/graph/generated/models/GeoCoordinates.ts new file mode 100644 index 00000000000..d93436a6973 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/GeoCoordinates.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * The GeoCoordinates resource provides geographic coordinates and elevation of a location based on metadata contained within the file. + * If a DriveItem has a non-null location facet, the item represents a file with a known location associated with it. + * + * @export + * @interface GeoCoordinates + */ +export interface GeoCoordinates { + /** + * The altitude (height), in feet, above sea level for the item. Read-only. + */ + altitude?: number; + /** + * The latitude, in decimal, for the item. Read-only. + */ + latitude?: number; + /** + * The longitude, in decimal, for the item. Read-only. + */ + longitude?: number; +} + +/** + * Check if a given object implements the GeoCoordinates interface. + */ +export function instanceOfGeoCoordinates(value: object): value is GeoCoordinates { + return true; +} + +export function GeoCoordinatesFromJSON(json: any): GeoCoordinates { + return GeoCoordinatesFromJSONTyped(json, false); +} + +export function GeoCoordinatesFromJSONTyped(json: any, ignoreDiscriminator: boolean): GeoCoordinates { + if (json == null) { + return json; + } + return { + + 'altitude': json['altitude'] == null ? undefined : json['altitude'], + 'latitude': json['latitude'] == null ? undefined : json['latitude'], + 'longitude': json['longitude'] == null ? undefined : json['longitude'], + }; +} + +export function GeoCoordinatesToJSON(json: any): GeoCoordinates { + return GeoCoordinatesToJSONTyped(json, false); +} + +export function GeoCoordinatesToJSONTyped(value?: GeoCoordinates | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'altitude': value['altitude'], + 'latitude': value['latitude'], + 'longitude': value['longitude'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Group.ts b/web/packages/web-client/src/graph/generated/models/Group.ts new file mode 100644 index 00000000000..eb593839b7c --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Group.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface Group + */ +export interface Group { + /** + * Read-only. + */ + readonly id?: string; + /** + * An optional description for the group. Returned by default. + */ + description?: string; + /** + * The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy. + */ + displayName?: string; + /** + * Specifies the group types. In MS Graph a group can have multiple types, so this is an array. In libreGraph the possible group types deviate from the MS Graph. The only group type that we currently support is "ReadOnly", which is set for groups that cannot be modified on the current instance. + */ + groupTypes?: Array; + /** + * Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand. + */ + members?: Array; + /** + * A list of member references to the members to be added. Up to 20 members can be added with a single request + */ + membersodataBind?: Set; +} + +/** + * Check if a given object implements the Group interface. + */ +export function instanceOfGroup(value: object): value is Group { + return true; +} + +export function GroupFromJSON(json: any): Group { + return GroupFromJSONTyped(json, false); +} + +export function GroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): Group { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'description': json['description'] == null ? undefined : json['description'], + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'groupTypes': json['groupTypes'] == null ? undefined : json['groupTypes'], + 'members': json['members'] == null ? undefined : ((json['members'] as Array).map(UserFromJSON)), + 'membersodataBind': json['members@odata.bind'] == null ? undefined : new Set(json['members@odata.bind']), + }; +} + +export function GroupToJSON(json: any): Group { + return GroupToJSONTyped(json, false); +} + +export function GroupToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'description': value['description'], + 'displayName': value['displayName'], + 'groupTypes': value['groupTypes'], + 'members': value['members'] == null ? undefined : ((value['members'] as Array).map(UserToJSON)), + 'members@odata.bind': value['membersodataBind'] == null ? undefined : Array.from(value['membersodataBind'] as Set), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Hashes.ts b/web/packages/web-client/src/graph/generated/models/Hashes.ts new file mode 100644 index 00000000000..2f5ec43a143 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Hashes.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Hashes of the file's binary content, if available. Read-only. + * @export + * @interface Hashes + */ +export interface Hashes { + /** + * The CRC32 value of the file (if available). Read-only. + */ + crc32Hash?: string; + /** + * A proprietary hash of the file that can be used to determine if the contents of the file have changed (if available). Read-only. + */ + quickXorHash?: string; + /** + * SHA1 hash for the contents of the file (if available). Read-only. + */ + sha1Hash?: string; + /** + * SHA256 hash for the contents of the file (if available). Read-only. + */ + sha256Hash?: string; +} + +/** + * Check if a given object implements the Hashes interface. + */ +export function instanceOfHashes(value: object): value is Hashes { + return true; +} + +export function HashesFromJSON(json: any): Hashes { + return HashesFromJSONTyped(json, false); +} + +export function HashesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Hashes { + if (json == null) { + return json; + } + return { + + 'crc32Hash': json['crc32Hash'] == null ? undefined : json['crc32Hash'], + 'quickXorHash': json['quickXorHash'] == null ? undefined : json['quickXorHash'], + 'sha1Hash': json['sha1Hash'] == null ? undefined : json['sha1Hash'], + 'sha256Hash': json['sha256Hash'] == null ? undefined : json['sha256Hash'], + }; +} + +export function HashesToJSON(json: any): Hashes { + return HashesToJSONTyped(json, false); +} + +export function HashesToJSONTyped(value?: Hashes | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'crc32Hash': value['crc32Hash'], + 'quickXorHash': value['quickXorHash'], + 'sha1Hash': value['sha1Hash'], + 'sha256Hash': value['sha256Hash'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Identity.ts b/web/packages/web-client/src/graph/generated/models/Identity.ts new file mode 100644 index 00000000000..5946b5f31f8 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Identity.ts @@ -0,0 +1,76 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface Identity + */ +export interface Identity { + /** + * The identity's display name. Note that this may not always be available or up to date. For example, if a user changes their display name, the API may show the new value in a future response, but the items associated with the user won't show up as having changed when using delta. + */ + displayName: string; + /** + * Unique identifier for the identity. + */ + id?: string; + /** + * The type of the identity. This can be either "Member" for regular user, "Guest" for guest users or "Federated" for users imported from a federated instance. Can be used by clients to indicate the type of user. For more details, clients should look up and cache the user at the /users endpoint. + */ + atLibreGraphUserType?: string; +} + +/** + * Check if a given object implements the Identity interface. + */ +export function instanceOfIdentity(value: object): value is Identity { + if (!('displayName' in value) || value['displayName'] === undefined) return false; + return true; +} + +export function IdentityFromJSON(json: any): Identity { + return IdentityFromJSONTyped(json, false); +} + +export function IdentityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Identity { + if (json == null) { + return json; + } + return { + + 'displayName': json['displayName'], + 'id': json['id'] == null ? undefined : json['id'], + 'atLibreGraphUserType': json['@libre.graph.userType'] == null ? undefined : json['@libre.graph.userType'], + }; +} + +export function IdentityToJSON(json: any): Identity { + return IdentityToJSONTyped(json, false); +} + +export function IdentityToJSONTyped(value?: Identity | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'displayName': value['displayName'], + 'id': value['id'], + '@libre.graph.userType': value['atLibreGraphUserType'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/IdentitySet.ts b/web/packages/web-client/src/graph/generated/models/IdentitySet.ts new file mode 100644 index 00000000000..bc0ec63b77d --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/IdentitySet.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Optional. User account. + * @export + * @interface IdentitySet + */ +export interface IdentitySet { + /** + * + */ + application?: Identity; + /** + * + */ + device?: Identity; + /** + * + */ + user?: Identity; + /** + * + */ + group?: Identity; +} + +/** + * Check if a given object implements the IdentitySet interface. + */ +export function instanceOfIdentitySet(value: object): value is IdentitySet { + return true; +} + +export function IdentitySetFromJSON(json: any): IdentitySet { + return IdentitySetFromJSONTyped(json, false); +} + +export function IdentitySetFromJSONTyped(json: any, ignoreDiscriminator: boolean): IdentitySet { + if (json == null) { + return json; + } + return { + + 'application': json['application'] == null ? undefined : IdentityFromJSON(json['application']), + 'device': json['device'] == null ? undefined : IdentityFromJSON(json['device']), + 'user': json['user'] == null ? undefined : IdentityFromJSON(json['user']), + 'group': json['group'] == null ? undefined : IdentityFromJSON(json['group']), + }; +} + +export function IdentitySetToJSON(json: any): IdentitySet { + return IdentitySetToJSONTyped(json, false); +} + +export function IdentitySetToJSONTyped(value?: IdentitySet | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'application': IdentityToJSON(value['application']), + 'device': IdentityToJSON(value['device']), + 'user': IdentityToJSON(value['user']), + 'group': IdentityToJSON(value['group']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Image.ts b/web/packages/web-client/src/graph/generated/models/Image.ts new file mode 100644 index 00000000000..827c62c30bb --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Image.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Image metadata, if the item is an image. Read-only. + * @export + * @interface Image + */ +export interface Image { + /** + * Optional. Height of the image, in pixels. Read-only. + */ + readonly height?: number; + /** + * Optional. Width of the image, in pixels. Read-only. + */ + readonly width?: number; +} + +/** + * Check if a given object implements the Image interface. + */ +export function instanceOfImage(value: object): value is Image { + return true; +} + +export function ImageFromJSON(json: any): Image { + return ImageFromJSONTyped(json, false); +} + +export function ImageFromJSONTyped(json: any, ignoreDiscriminator: boolean): Image { + if (json == null) { + return json; + } + return { + + 'height': json['height'] == null ? undefined : json['height'], + 'width': json['width'] == null ? undefined : json['width'], + }; +} + +export function ImageToJSON(json: any): Image { + return ImageToJSONTyped(json, false); +} + +export function ImageToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Instance.ts b/web/packages/web-client/src/graph/generated/models/Instance.ts new file mode 100644 index 00000000000..e8375304764 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Instance.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * An oCIS instance that the user is either a member or a guest of. + * @export + * @interface Instance + */ +export interface Instance { + /** + * The URL of the oCIS instance. + */ + url: string; + /** + * Whether the instance is the user's primary instance. + */ + primary: boolean; +} + +/** + * Check if a given object implements the Instance interface. + */ +export function instanceOfInstance(value: object): value is Instance { + if (!('url' in value) || value['url'] === undefined) return false; + if (!('primary' in value) || value['primary'] === undefined) return false; + return true; +} + +export function InstanceFromJSON(json: any): Instance { + return InstanceFromJSONTyped(json, false); +} + +export function InstanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Instance { + if (json == null) { + return json; + } + return { + + 'url': json['url'], + 'primary': json['primary'], + }; +} + +export function InstanceToJSON(json: any): Instance { + return InstanceToJSONTyped(json, false); +} + +export function InstanceToJSONTyped(value?: Instance | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'url': value['url'], + 'primary': value['primary'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ItemReference.ts b/web/packages/web-client/src/graph/generated/models/ItemReference.ts new file mode 100644 index 00000000000..26d6c178f6d --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ItemReference.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ItemReference + */ +export interface ItemReference { + /** + * Unique identifier of the drive instance that contains the item. Read-only. + */ + readonly driveId?: string; + /** + * Identifies the type of drive. See [drive][] resource for values. Read-only. + */ + readonly driveType?: string; + /** + * Unique identifier of the item in the drive. Read-only. + */ + readonly id?: string; + /** + * The name of the item being referenced. Read-only. + */ + readonly name?: string; + /** + * Path that can be used to navigate to the item. Read-only. + */ + readonly path?: string; +} + +/** + * Check if a given object implements the ItemReference interface. + */ +export function instanceOfItemReference(value: object): value is ItemReference { + return true; +} + +export function ItemReferenceFromJSON(json: any): ItemReference { + return ItemReferenceFromJSONTyped(json, false); +} + +export function ItemReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ItemReference { + if (json == null) { + return json; + } + return { + + 'driveId': json['driveId'] == null ? undefined : json['driveId'], + 'driveType': json['driveType'] == null ? undefined : json['driveType'], + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'path': json['path'] == null ? undefined : json['path'], + }; +} + +export function ItemReferenceToJSON(json: any): ItemReference { + return ItemReferenceToJSONTyped(json, false); +} + +export function ItemReferenceToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/MemberReference.ts b/web/packages/web-client/src/graph/generated/models/MemberReference.ts new file mode 100644 index 00000000000..d602a1fb271 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/MemberReference.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface MemberReference + */ +export interface MemberReference { + /** + * + */ + atOdataId?: string; +} + +/** + * Check if a given object implements the MemberReference interface. + */ +export function instanceOfMemberReference(value: object): value is MemberReference { + return true; +} + +export function MemberReferenceFromJSON(json: any): MemberReference { + return MemberReferenceFromJSONTyped(json, false); +} + +export function MemberReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): MemberReference { + if (json == null) { + return json; + } + return { + + 'atOdataId': json['@odata.id'] == null ? undefined : json['@odata.id'], + }; +} + +export function MemberReferenceToJSON(json: any): MemberReference { + return MemberReferenceToJSONTyped(json, false); +} + +export function MemberReferenceToJSONTyped(value?: MemberReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '@odata.id': value['atOdataId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ObjectIdentity.ts b/web/packages/web-client/src/graph/generated/models/ObjectIdentity.ts new file mode 100644 index 00000000000..5978ac5b734 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ObjectIdentity.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Represents an identity used to sign in to a user account + * @export + * @interface ObjectIdentity + */ +export interface ObjectIdentity { + /** + * domain of the Provider issuing the identity + */ + issuer?: string; + /** + * The unique id assigned by the issuer to the account + */ + issuerAssignedId?: string; +} + +/** + * Check if a given object implements the ObjectIdentity interface. + */ +export function instanceOfObjectIdentity(value: object): value is ObjectIdentity { + return true; +} + +export function ObjectIdentityFromJSON(json: any): ObjectIdentity { + return ObjectIdentityFromJSONTyped(json, false); +} + +export function ObjectIdentityFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectIdentity { + if (json == null) { + return json; + } + return { + + 'issuer': json['issuer'] == null ? undefined : json['issuer'], + 'issuerAssignedId': json['issuerAssignedId'] == null ? undefined : json['issuerAssignedId'], + }; +} + +export function ObjectIdentityToJSON(json: any): ObjectIdentity { + return ObjectIdentityToJSONTyped(json, false); +} + +export function ObjectIdentityToJSONTyped(value?: ObjectIdentity | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'issuer': value['issuer'], + 'issuerAssignedId': value['issuerAssignedId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/OdataError.ts b/web/packages/web-client/src/graph/generated/models/OdataError.ts new file mode 100644 index 00000000000..9fd3e1aad86 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/OdataError.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { OdataErrorMain } from './OdataErrorMain'; +import { + OdataErrorMainFromJSON, + OdataErrorMainFromJSONTyped, + OdataErrorMainToJSON, + OdataErrorMainToJSONTyped, +} from './OdataErrorMain'; + +/** + * + * @export + * @interface OdataError + */ +export interface OdataError { + /** + * + */ + error: OdataErrorMain; +} + +/** + * Check if a given object implements the OdataError interface. + */ +export function instanceOfOdataError(value: object): value is OdataError { + if (!('error' in value) || value['error'] === undefined) return false; + return true; +} + +export function OdataErrorFromJSON(json: any): OdataError { + return OdataErrorFromJSONTyped(json, false); +} + +export function OdataErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): OdataError { + if (json == null) { + return json; + } + return { + + 'error': OdataErrorMainFromJSON(json['error']), + }; +} + +export function OdataErrorToJSON(json: any): OdataError { + return OdataErrorToJSONTyped(json, false); +} + +export function OdataErrorToJSONTyped(value?: OdataError | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'error': OdataErrorMainToJSON(value['error']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/OdataErrorDetail.ts b/web/packages/web-client/src/graph/generated/models/OdataErrorDetail.ts new file mode 100644 index 00000000000..80b1d76d781 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/OdataErrorDetail.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface OdataErrorDetail + */ +export interface OdataErrorDetail { + /** + * + */ + code: string; + /** + * + */ + message: string; + /** + * + */ + target?: string; +} + +/** + * Check if a given object implements the OdataErrorDetail interface. + */ +export function instanceOfOdataErrorDetail(value: object): value is OdataErrorDetail { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('message' in value) || value['message'] === undefined) return false; + return true; +} + +export function OdataErrorDetailFromJSON(json: any): OdataErrorDetail { + return OdataErrorDetailFromJSONTyped(json, false); +} + +export function OdataErrorDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): OdataErrorDetail { + if (json == null) { + return json; + } + return { + + 'code': json['code'], + 'message': json['message'], + 'target': json['target'] == null ? undefined : json['target'], + }; +} + +export function OdataErrorDetailToJSON(json: any): OdataErrorDetail { + return OdataErrorDetailToJSONTyped(json, false); +} + +export function OdataErrorDetailToJSONTyped(value?: OdataErrorDetail | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'code': value['code'], + 'message': value['message'], + 'target': value['target'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/OdataErrorMain.ts b/web/packages/web-client/src/graph/generated/models/OdataErrorMain.ts new file mode 100644 index 00000000000..7f55e603d4a --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/OdataErrorMain.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { OdataErrorDetail } from './OdataErrorDetail'; +import { + OdataErrorDetailFromJSON, + OdataErrorDetailFromJSONTyped, + OdataErrorDetailToJSON, + OdataErrorDetailToJSONTyped, +} from './OdataErrorDetail'; + +/** + * + * @export + * @interface OdataErrorMain + */ +export interface OdataErrorMain { + /** + * + */ + code: string; + /** + * + */ + message: string; + /** + * + */ + target?: string; + /** + * + */ + details?: Array; + /** + * The structure of this object is service-specific + */ + innererror?: object; +} + +/** + * Check if a given object implements the OdataErrorMain interface. + */ +export function instanceOfOdataErrorMain(value: object): value is OdataErrorMain { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('message' in value) || value['message'] === undefined) return false; + return true; +} + +export function OdataErrorMainFromJSON(json: any): OdataErrorMain { + return OdataErrorMainFromJSONTyped(json, false); +} + +export function OdataErrorMainFromJSONTyped(json: any, ignoreDiscriminator: boolean): OdataErrorMain { + if (json == null) { + return json; + } + return { + + 'code': json['code'], + 'message': json['message'], + 'target': json['target'] == null ? undefined : json['target'], + 'details': json['details'] == null ? undefined : ((json['details'] as Array).map(OdataErrorDetailFromJSON)), + 'innererror': json['innererror'] == null ? undefined : json['innererror'], + }; +} + +export function OdataErrorMainToJSON(json: any): OdataErrorMain { + return OdataErrorMainToJSONTyped(json, false); +} + +export function OdataErrorMainToJSONTyped(value?: OdataErrorMain | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'code': value['code'], + 'message': value['message'], + 'target': value['target'], + 'details': value['details'] == null ? undefined : ((value['details'] as Array).map(OdataErrorDetailToJSON)), + 'innererror': value['innererror'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts b/web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts new file mode 100644 index 00000000000..75b39b9cb6b --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Hashes } from './Hashes'; +import { + HashesFromJSON, + HashesFromJSONTyped, + HashesToJSON, + HashesToJSONTyped, +} from './Hashes'; + +/** + * File metadata, if the item is a file. Read-only. + * @export + * @interface OpenGraphFile + */ +export interface OpenGraphFile { + /** + * + */ + hashes?: Hashes; + /** + * The MIME type for the file. This is determined by logic on the server and might not be the value provided when the file was uploaded. Read-only. + */ + readonly mimeType?: string; + /** + * + */ + processingMetadata?: boolean; +} + +/** + * Check if a given object implements the OpenGraphFile interface. + */ +export function instanceOfOpenGraphFile(value: object): value is OpenGraphFile { + return true; +} + +export function OpenGraphFileFromJSON(json: any): OpenGraphFile { + return OpenGraphFileFromJSONTyped(json, false); +} + +export function OpenGraphFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenGraphFile { + if (json == null) { + return json; + } + return { + + 'hashes': json['hashes'] == null ? undefined : HashesFromJSON(json['hashes']), + 'mimeType': json['mimeType'] == null ? undefined : json['mimeType'], + 'processingMetadata': json['processingMetadata'] == null ? undefined : json['processingMetadata'], + }; +} + +export function OpenGraphFileToJSON(json: any): OpenGraphFile { + return OpenGraphFileToJSONTyped(json, false); +} + +export function OpenGraphFileToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'hashes': HashesToJSON(value['hashes']), + 'processingMetadata': value['processingMetadata'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/PasswordChange.ts b/web/packages/web-client/src/graph/generated/models/PasswordChange.ts new file mode 100644 index 00000000000..6b7a68b723f --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/PasswordChange.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface PasswordChange + */ +export interface PasswordChange { + /** + * + */ + currentPassword: string; + /** + * + */ + newPassword: string; +} + +/** + * Check if a given object implements the PasswordChange interface. + */ +export function instanceOfPasswordChange(value: object): value is PasswordChange { + if (!('currentPassword' in value) || value['currentPassword'] === undefined) return false; + if (!('newPassword' in value) || value['newPassword'] === undefined) return false; + return true; +} + +export function PasswordChangeFromJSON(json: any): PasswordChange { + return PasswordChangeFromJSONTyped(json, false); +} + +export function PasswordChangeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordChange { + if (json == null) { + return json; + } + return { + + 'currentPassword': json['currentPassword'], + 'newPassword': json['newPassword'], + }; +} + +export function PasswordChangeToJSON(json: any): PasswordChange { + return PasswordChangeToJSONTyped(json, false); +} + +export function PasswordChangeToJSONTyped(value?: PasswordChange | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'currentPassword': value['currentPassword'], + 'newPassword': value['newPassword'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/PasswordProfile.ts b/web/packages/web-client/src/graph/generated/models/PasswordProfile.ts new file mode 100644 index 00000000000..08f5a33a73a --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/PasswordProfile.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Password Profile associated with a user + * @export + * @interface PasswordProfile + */ +export interface PasswordProfile { + /** + * If true the user is required to change their password upon the next login + */ + forceChangePasswordNextSignIn?: boolean; + /** + * The user's password + */ + password?: string; +} + +/** + * Check if a given object implements the PasswordProfile interface. + */ +export function instanceOfPasswordProfile(value: object): value is PasswordProfile { + return true; +} + +export function PasswordProfileFromJSON(json: any): PasswordProfile { + return PasswordProfileFromJSONTyped(json, false); +} + +export function PasswordProfileFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordProfile { + if (json == null) { + return json; + } + return { + + 'forceChangePasswordNextSignIn': json['forceChangePasswordNextSignIn'] == null ? undefined : json['forceChangePasswordNextSignIn'], + 'password': json['password'] == null ? undefined : json['password'], + }; +} + +export function PasswordProfileToJSON(json: any): PasswordProfile { + return PasswordProfileToJSONTyped(json, false); +} + +export function PasswordProfileToJSONTyped(value?: PasswordProfile | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'forceChangePasswordNextSignIn': value['forceChangePasswordNextSignIn'], + 'password': value['password'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Permission.ts b/web/packages/web-client/src/graph/generated/models/Permission.ts new file mode 100644 index 00000000000..1e99aea747b --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Permission.ts @@ -0,0 +1,156 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { SharingInvitation } from './SharingInvitation'; +import { + SharingInvitationFromJSON, + SharingInvitationFromJSONTyped, + SharingInvitationToJSON, + SharingInvitationToJSONTyped, +} from './SharingInvitation'; +import type { SharingLink } from './SharingLink'; +import { + SharingLinkFromJSON, + SharingLinkFromJSONTyped, + SharingLinkToJSON, + SharingLinkToJSONTyped, +} from './SharingLink'; +import type { IdentitySet } from './IdentitySet'; +import { + IdentitySetFromJSON, + IdentitySetFromJSONTyped, + IdentitySetToJSON, + IdentitySetToJSONTyped, +} from './IdentitySet'; +import type { SharePointIdentitySet } from './SharePointIdentitySet'; +import { + SharePointIdentitySetFromJSON, + SharePointIdentitySetFromJSONTyped, + SharePointIdentitySetToJSON, + SharePointIdentitySetToJSONTyped, +} from './SharePointIdentitySet'; + +/** + * The Permission resource provides information about a sharing permission granted for a DriveItem resource. + * + * ### Remarks + * + * The Permission resource uses *facets* to provide information about the kind of permission represented by the resource. + * + * Permissions with a `link` facet represent sharing links created on the item. Sharing links contain a unique token that provides access to the item for anyone with the link. + * + * Permissions with a `invitation` facet represent permissions added by inviting specific users or groups to have access to the file. + * + * @export + * @interface Permission + */ +export interface Permission { + /** + * The unique identifier of the permission among all permissions on the item. Read-only. + */ + readonly id?: string; + /** + * Indicates whether the password is set for this permission. This property only + * appears in the response. Optional. Read-only. + * + */ + readonly hasPassword?: boolean; + /** + * An optional expiration date which limits the permission in time. + */ + expirationDateTime?: Date | null; + /** + * An optional creation date. Libregraph only. + */ + createdDateTime?: Date | null; + /** + * + */ + grantedToV2?: SharePointIdentitySet; + /** + * + */ + link?: SharingLink; + /** + * + */ + roles?: Array; + /** + * For link type permissions, the details of the identity to whom permission was granted. This could be used to grant access to a an external user that can be identified by email, aka guest accounts. + * @deprecated + */ + grantedToIdentities?: Array; + /** + * Use this to create a permission with custom actions. + */ + atLibreGraphPermissionsActions?: Array; + /** + * + */ + invitation?: SharingInvitation; +} + +/** + * Check if a given object implements the Permission interface. + */ +export function instanceOfPermission(value: object): value is Permission { + return true; +} + +export function PermissionFromJSON(json: any): Permission { + return PermissionFromJSONTyped(json, false); +} + +export function PermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Permission { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'hasPassword': json['hasPassword'] == null ? undefined : json['hasPassword'], + 'expirationDateTime': json['expirationDateTime'] === undefined ? undefined : json['expirationDateTime'] === null ? null : (parseDateTime(json['expirationDateTime'])), + 'createdDateTime': json['createdDateTime'] === undefined ? undefined : json['createdDateTime'] === null ? null : (parseDateTime(json['createdDateTime'])), + 'grantedToV2': json['grantedToV2'] == null ? undefined : SharePointIdentitySetFromJSON(json['grantedToV2']), + 'link': json['link'] == null ? undefined : SharingLinkFromJSON(json['link']), + 'roles': json['roles'] == null ? undefined : json['roles'], + 'grantedToIdentities': json['grantedToIdentities'] == null ? undefined : ((json['grantedToIdentities'] as Array).map(IdentitySetFromJSON)), + 'atLibreGraphPermissionsActions': json['@libre.graph.permissions.actions'] == null ? undefined : json['@libre.graph.permissions.actions'], + 'invitation': json['invitation'] == null ? undefined : SharingInvitationFromJSON(json['invitation']), + }; +} + +export function PermissionToJSON(json: any): Permission { + return PermissionToJSONTyped(json, false); +} + +export function PermissionToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'expirationDateTime': value['expirationDateTime'] == null ? value['expirationDateTime'] : serializeDateTime(value['expirationDateTime']), + 'createdDateTime': value['createdDateTime'] == null ? value['createdDateTime'] : serializeDateTime(value['createdDateTime']), + 'grantedToV2': SharePointIdentitySetToJSON(value['grantedToV2']), + 'link': SharingLinkToJSON(value['link']), + 'roles': value['roles'], + 'grantedToIdentities': value['grantedToIdentities'] == null ? undefined : ((value['grantedToIdentities'] as Array).map(IdentitySetToJSON)), + '@libre.graph.permissions.actions': value['atLibreGraphPermissionsActions'], + 'invitation': SharingInvitationToJSON(value['invitation']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Photo.ts b/web/packages/web-client/src/graph/generated/models/Photo.ts new file mode 100644 index 00000000000..6393d6c3ad7 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Photo.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +/** + * The photo resource provides photo and camera properties, for example, EXIF metadata, on a driveItem. + * + * @export + * @interface Photo + */ +export interface Photo { + /** + * Camera manufacturer. Read-only. + */ + cameraMake?: string; + /** + * Camera model. Read-only. + */ + cameraModel?: string; + /** + * The denominator for the exposure time fraction from the camera. Read-only. + */ + exposureDenominator?: number; + /** + * The numerator for the exposure time fraction from the camera. Read-only. + */ + exposureNumerator?: number; + /** + * The F-stop value from the camera. Read-only. + */ + fNumber?: number; + /** + * The focal length from the camera. Read-only. + */ + focalLength?: number; + /** + * The ISO value from the camera. Read-only. + */ + iso?: number; + /** + * The orientation value from the camera. Read-only. + */ + orientation?: number; + /** + * Represents the date and time the photo was taken. Read-only. + */ + takenDateTime?: Date; +} + +/** + * Check if a given object implements the Photo interface. + */ +export function instanceOfPhoto(value: object): value is Photo { + return true; +} + +export function PhotoFromJSON(json: any): Photo { + return PhotoFromJSONTyped(json, false); +} + +export function PhotoFromJSONTyped(json: any, ignoreDiscriminator: boolean): Photo { + if (json == null) { + return json; + } + return { + + 'cameraMake': json['cameraMake'] == null ? undefined : json['cameraMake'], + 'cameraModel': json['cameraModel'] == null ? undefined : json['cameraModel'], + 'exposureDenominator': json['exposureDenominator'] == null ? undefined : json['exposureDenominator'], + 'exposureNumerator': json['exposureNumerator'] == null ? undefined : json['exposureNumerator'], + 'fNumber': json['fNumber'] == null ? undefined : json['fNumber'], + 'focalLength': json['focalLength'] == null ? undefined : json['focalLength'], + 'iso': json['iso'] == null ? undefined : json['iso'], + 'orientation': json['orientation'] == null ? undefined : json['orientation'], + 'takenDateTime': json['takenDateTime'] == null ? undefined : (parseDateTime(json['takenDateTime'])), + }; +} + +export function PhotoToJSON(json: any): Photo { + return PhotoToJSONTyped(json, false); +} + +export function PhotoToJSONTyped(value?: Photo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'cameraMake': value['cameraMake'], + 'cameraModel': value['cameraModel'], + 'exposureDenominator': value['exposureDenominator'], + 'exposureNumerator': value['exposureNumerator'], + 'fNumber': value['fNumber'], + 'focalLength': value['focalLength'], + 'iso': value['iso'], + 'orientation': value['orientation'], + 'takenDateTime': value['takenDateTime'] == null ? value['takenDateTime'] : serializeDateTime(value['takenDateTime']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Quota.ts b/web/packages/web-client/src/graph/generated/models/Quota.ts new file mode 100644 index 00000000000..c63586c9860 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Quota.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Optional. Information about the drive's storage space quota. Read-only. + * @export + * @interface Quota + */ +export interface Quota { + /** + * Total space consumed by files in the recycle bin, in bytes. Read-only. + */ + readonly deleted?: number; + /** + * Total space remaining before reaching the quota limit, in bytes. Read-only. + */ + readonly remaining?: number; + /** + * Enumeration value that indicates the state of the storage space. Either "normal", "nearing", "critical" or "exceeded". Read-only. + */ + readonly state?: string; + /** + * Total allowed storage space, in bytes. Read-only. + */ + readonly total?: number; + /** + * Total space used, in bytes. Read-only. + */ + readonly used?: number; +} + +/** + * Check if a given object implements the Quota interface. + */ +export function instanceOfQuota(value: object): value is Quota { + return true; +} + +export function QuotaFromJSON(json: any): Quota { + return QuotaFromJSONTyped(json, false); +} + +export function QuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): Quota { + if (json == null) { + return json; + } + return { + + 'deleted': json['deleted'] == null ? undefined : json['deleted'], + 'remaining': json['remaining'] == null ? undefined : json['remaining'], + 'state': json['state'] == null ? undefined : json['state'], + 'total': json['total'] == null ? undefined : json['total'], + 'used': json['used'] == null ? undefined : json['used'], + }; +} + +export function QuotaToJSON(json: any): Quota { + return QuotaToJSONTyped(json, false); +} + +export function QuotaToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/RemoteItem.ts b/web/packages/web-client/src/graph/generated/models/RemoteItem.ts new file mode 100644 index 00000000000..4b58d75a274 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/RemoteItem.ts @@ -0,0 +1,243 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { ItemReference } from './ItemReference'; +import { + ItemReferenceFromJSON, + ItemReferenceFromJSONTyped, + ItemReferenceToJSON, + ItemReferenceToJSONTyped, +} from './ItemReference'; +import type { FileSystemInfo } from './FileSystemInfo'; +import { + FileSystemInfoFromJSON, + FileSystemInfoFromJSONTyped, + FileSystemInfoToJSON, + FileSystemInfoToJSONTyped, +} from './FileSystemInfo'; +import type { IdentitySet } from './IdentitySet'; +import { + IdentitySetFromJSON, + IdentitySetFromJSONTyped, + IdentitySetToJSON, + IdentitySetToJSONTyped, +} from './IdentitySet'; +import type { OpenGraphFile } from './OpenGraphFile'; +import { + OpenGraphFileFromJSON, + OpenGraphFileFromJSONTyped, + OpenGraphFileToJSON, + OpenGraphFileToJSONTyped, +} from './OpenGraphFile'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; +import type { Folder } from './Folder'; +import { + FolderFromJSON, + FolderFromJSONTyped, + FolderToJSON, + FolderToJSONTyped, +} from './Folder'; +import type { Image } from './Image'; +import { + ImageFromJSON, + ImageFromJSONTyped, + ImageToJSON, + ImageToJSONTyped, +} from './Image'; +import type { SpecialFolder } from './SpecialFolder'; +import { + SpecialFolderFromJSON, + SpecialFolderFromJSONTyped, + SpecialFolderToJSON, + SpecialFolderToJSONTyped, +} from './SpecialFolder'; + +/** + * Remote item data, if the item is shared from a drive other than the one being accessed. Read-only. + * @export + * @interface RemoteItem + */ +export interface RemoteItem { + /** + * + */ + createdBy?: IdentitySet; + /** + * Date and time of item creation. Read-only. + */ + createdDateTime?: Date; + /** + * + */ + file?: OpenGraphFile; + /** + * + */ + fileSystemInfo?: FileSystemInfo; + /** + * + */ + folder?: Folder; + /** + * The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID. + */ + driveAlias?: string; + /** + * The relative path of the item in relation to its drive root. + */ + path?: string; + /** + * Unique identifier for the drive root of this item. Read-only. + */ + rootId?: string; + /** + * Unique identifier for the remote item in its drive. Read-only. + */ + id?: string; + /** + * + */ + image?: Image; + /** + * + */ + lastModifiedBy?: IdentitySet; + /** + * Date and time the item was last modified. Read-only. + */ + lastModifiedDateTime?: Date; + /** + * Optional. Filename of the remote item. Read-only. + */ + name?: string; + /** + * ETag for the item. Read-only. + */ + readonly eTag?: string; + /** + * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. + */ + readonly cTag?: string; + /** + * + */ + parentReference?: ItemReference; + /** + * The set of permissions for the item. Read-only. Nullable. + */ + readonly permissions?: Array; + /** + * Size of the remote item. Read-only. + */ + size?: number; + /** + * + */ + specialFolder?: SpecialFolder; + /** + * DAV compatible URL for the item. + */ + webDavUrl?: string; + /** + * URL that displays the resource in the browser. Read-only. + */ + webUrl?: string; + /** + * The UUID of the space that contains the item. + */ + spaceId?: string; +} + +/** + * Check if a given object implements the RemoteItem interface. + */ +export function instanceOfRemoteItem(value: object): value is RemoteItem { + return true; +} + +export function RemoteItemFromJSON(json: any): RemoteItem { + return RemoteItemFromJSONTyped(json, false); +} + +export function RemoteItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteItem { + if (json == null) { + return json; + } + return { + + 'createdBy': json['createdBy'] == null ? undefined : IdentitySetFromJSON(json['createdBy']), + 'createdDateTime': json['createdDateTime'] == null ? undefined : (parseDateTime(json['createdDateTime'])), + 'file': json['file'] == null ? undefined : OpenGraphFileFromJSON(json['file']), + 'fileSystemInfo': json['fileSystemInfo'] == null ? undefined : FileSystemInfoFromJSON(json['fileSystemInfo']), + 'folder': json['folder'] == null ? undefined : FolderFromJSON(json['folder']), + 'driveAlias': json['driveAlias'] == null ? undefined : json['driveAlias'], + 'path': json['path'] == null ? undefined : json['path'], + 'rootId': json['rootId'] == null ? undefined : json['rootId'], + 'id': json['id'] == null ? undefined : json['id'], + 'image': json['image'] == null ? undefined : ImageFromJSON(json['image']), + 'lastModifiedBy': json['lastModifiedBy'] == null ? undefined : IdentitySetFromJSON(json['lastModifiedBy']), + 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : (parseDateTime(json['lastModifiedDateTime'])), + 'name': json['name'] == null ? undefined : json['name'], + 'eTag': json['eTag'] == null ? undefined : json['eTag'], + 'cTag': json['cTag'] == null ? undefined : json['cTag'], + 'parentReference': json['parentReference'] == null ? undefined : ItemReferenceFromJSON(json['parentReference']), + 'permissions': json['permissions'] == null ? undefined : ((json['permissions'] as Array).map(PermissionFromJSON)), + 'size': json['size'] == null ? undefined : json['size'], + 'specialFolder': json['specialFolder'] == null ? undefined : SpecialFolderFromJSON(json['specialFolder']), + 'webDavUrl': json['webDavUrl'] == null ? undefined : json['webDavUrl'], + 'webUrl': json['webUrl'] == null ? undefined : json['webUrl'], + 'spaceId': json['spaceId'] == null ? undefined : json['spaceId'], + }; +} + +export function RemoteItemToJSON(json: any): RemoteItem { + return RemoteItemToJSONTyped(json, false); +} + +export function RemoteItemToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'createdBy': IdentitySetToJSON(value['createdBy']), + 'createdDateTime': value['createdDateTime'] == null ? value['createdDateTime'] : serializeDateTime(value['createdDateTime']), + 'file': OpenGraphFileToJSON(value['file']), + 'fileSystemInfo': FileSystemInfoToJSON(value['fileSystemInfo']), + 'folder': FolderToJSON(value['folder']), + 'driveAlias': value['driveAlias'], + 'path': value['path'], + 'rootId': value['rootId'], + 'id': value['id'], + 'image': ImageToJSON(value['image']), + 'lastModifiedBy': IdentitySetToJSON(value['lastModifiedBy']), + 'lastModifiedDateTime': value['lastModifiedDateTime'] == null ? value['lastModifiedDateTime'] : serializeDateTime(value['lastModifiedDateTime']), + 'name': value['name'], + 'parentReference': ItemReferenceToJSON(value['parentReference']), + 'size': value['size'], + 'specialFolder': SpecialFolderToJSON(value['specialFolder']), + 'webDavUrl': value['webDavUrl'], + 'webUrl': value['webUrl'], + 'spaceId': value['spaceId'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/SharePointIdentitySet.ts b/web/packages/web-client/src/graph/generated/models/SharePointIdentitySet.ts new file mode 100644 index 00000000000..19c59a641e3 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/SharePointIdentitySet.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * This resource is used to represent a set of identities associated with various events for an item, such as created by or last modified by. + * @export + * @interface SharePointIdentitySet + */ +export interface SharePointIdentitySet { + /** + * + */ + user?: Identity; + /** + * + */ + group?: Identity; +} + +/** + * Check if a given object implements the SharePointIdentitySet interface. + */ +export function instanceOfSharePointIdentitySet(value: object): value is SharePointIdentitySet { + return true; +} + +export function SharePointIdentitySetFromJSON(json: any): SharePointIdentitySet { + return SharePointIdentitySetFromJSONTyped(json, false); +} + +export function SharePointIdentitySetFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharePointIdentitySet { + if (json == null) { + return json; + } + return { + + 'user': json['user'] == null ? undefined : IdentityFromJSON(json['user']), + 'group': json['group'] == null ? undefined : IdentityFromJSON(json['group']), + }; +} + +export function SharePointIdentitySetToJSON(json: any): SharePointIdentitySet { + return SharePointIdentitySetToJSONTyped(json, false); +} + +export function SharePointIdentitySetToJSONTyped(value?: SharePointIdentitySet | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'user': IdentityToJSON(value['user']), + 'group': IdentityToJSON(value['group']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/SharingInvitation.ts b/web/packages/web-client/src/graph/generated/models/SharingInvitation.ts new file mode 100644 index 00000000000..5980ed578bc --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/SharingInvitation.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { IdentitySet } from './IdentitySet'; +import { + IdentitySetFromJSON, + IdentitySetFromJSONTyped, + IdentitySetToJSON, + IdentitySetToJSONTyped, +} from './IdentitySet'; + +/** + * invitation-related data items + * + * @export + * @interface SharingInvitation + */ +export interface SharingInvitation { + /** + * + */ + invitedBy?: IdentitySet; +} + +/** + * Check if a given object implements the SharingInvitation interface. + */ +export function instanceOfSharingInvitation(value: object): value is SharingInvitation { + return true; +} + +export function SharingInvitationFromJSON(json: any): SharingInvitation { + return SharingInvitationFromJSONTyped(json, false); +} + +export function SharingInvitationFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharingInvitation { + if (json == null) { + return json; + } + return { + + 'invitedBy': json['invitedBy'] == null ? undefined : IdentitySetFromJSON(json['invitedBy']), + }; +} + +export function SharingInvitationToJSON(json: any): SharingInvitation { + return SharingInvitationToJSONTyped(json, false); +} + +export function SharingInvitationToJSONTyped(value?: SharingInvitation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'invitedBy': IdentitySetToJSON(value['invitedBy']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/SharingLink.ts b/web/packages/web-client/src/graph/generated/models/SharingLink.ts new file mode 100644 index 00000000000..8fa133431bc --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/SharingLink.ts @@ -0,0 +1,98 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { SharingLinkType } from './SharingLinkType'; +import { + SharingLinkTypeFromJSON, + SharingLinkTypeFromJSONTyped, + SharingLinkTypeToJSON, + SharingLinkTypeToJSONTyped, +} from './SharingLinkType'; + +/** + * The `SharingLink` resource groups link-related data items into a single structure. + * + * If a `permission` resource has a non-null `sharingLink` facet, the permission represents a sharing link (as opposed to permissions granted to a person or group). + * + * @export + * @interface SharingLink + */ +export interface SharingLink { + /** + * + */ + type?: SharingLinkType; + /** + * If `true` then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item. + */ + readonly preventsDownload?: boolean; + /** + * A URL that opens the item in the browser on the website. + */ + readonly webUrl?: string; + /** + * Provides a user-visible display name of the link. Optional. Libregraph only. + */ + atLibreGraphDisplayName?: string; + /** + * The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only. + */ + atLibreGraphQuickLink?: boolean; +} + + + +/** + * Check if a given object implements the SharingLink interface. + */ +export function instanceOfSharingLink(value: object): value is SharingLink { + return true; +} + +export function SharingLinkFromJSON(json: any): SharingLink { + return SharingLinkFromJSONTyped(json, false); +} + +export function SharingLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharingLink { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : SharingLinkTypeFromJSON(json['type']), + 'preventsDownload': json['preventsDownload'] == null ? undefined : json['preventsDownload'], + 'webUrl': json['webUrl'] == null ? undefined : json['webUrl'], + 'atLibreGraphDisplayName': json['@libre.graph.displayName'] == null ? undefined : json['@libre.graph.displayName'], + 'atLibreGraphQuickLink': json['@libre.graph.quickLink'] == null ? undefined : json['@libre.graph.quickLink'], + }; +} + +export function SharingLinkToJSON(json: any): SharingLink { + return SharingLinkToJSONTyped(json, false); +} + +export function SharingLinkToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': SharingLinkTypeToJSON(value['type']), + '@libre.graph.displayName': value['atLibreGraphDisplayName'], + '@libre.graph.quickLink': value['atLibreGraphQuickLink'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/SharingLinkPassword.ts b/web/packages/web-client/src/graph/generated/models/SharingLinkPassword.ts new file mode 100644 index 00000000000..48fafad8f47 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/SharingLinkPassword.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * The sharing link password which should be set. + * + * @export + * @interface SharingLinkPassword + */ +export interface SharingLinkPassword { + /** + * Password. It may require a password policy. + */ + password?: string; +} + +/** + * Check if a given object implements the SharingLinkPassword interface. + */ +export function instanceOfSharingLinkPassword(value: object): value is SharingLinkPassword { + return true; +} + +export function SharingLinkPasswordFromJSON(json: any): SharingLinkPassword { + return SharingLinkPasswordFromJSONTyped(json, false); +} + +export function SharingLinkPasswordFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharingLinkPassword { + if (json == null) { + return json; + } + return { + + 'password': json['password'] == null ? undefined : json['password'], + }; +} + +export function SharingLinkPasswordToJSON(json: any): SharingLinkPassword { + return SharingLinkPasswordToJSONTyped(json, false); +} + +export function SharingLinkPasswordToJSONTyped(value?: SharingLinkPassword | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'password': value['password'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/SharingLinkType.ts b/web/packages/web-client/src/graph/generated/models/SharingLinkType.ts new file mode 100644 index 00000000000..721afce0278 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/SharingLinkType.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * The type of the link created. + * + * | Value | Display name | Description | + * | -------------- | ----------------- | --------------------------------------------------------------- | + * | internal | Internal | Creates an internal link without any permissions. | + * | view | View | Creates a read-only link to the driveItem. | + * | upload | Upload | Creates a read-write link to the folder driveItem. | + * | edit | Edit | Creates a read-write link to the driveItem. | + * | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | + * | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. | + * + * @export + */ +export const SharingLinkType = { + Internal: 'internal', + View: 'view', + Upload: 'upload', + Edit: 'edit', + CreateOnly: 'createOnly', + BlocksDownload: 'blocksDownload', +} as const; +export type SharingLinkType = typeof SharingLinkType[keyof typeof SharingLinkType]; + + +export function instanceOfSharingLinkType(value: any): boolean { + for (const key in SharingLinkType) { + if (Object.prototype.hasOwnProperty.call(SharingLinkType, key)) { + if (SharingLinkType[key as keyof typeof SharingLinkType] === value) { + return true; + } + } + } + return false; +} + +export function SharingLinkTypeFromJSON(json: any): SharingLinkType { + return SharingLinkTypeFromJSONTyped(json, false); +} + +export function SharingLinkTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharingLinkType { + return json as SharingLinkType; +} + +export function SharingLinkTypeToJSON(value?: SharingLinkType | null): any { + return value as any; +} + +export function SharingLinkTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SharingLinkType { + return value as SharingLinkType; +} + diff --git a/web/packages/web-client/src/graph/generated/models/SignInActivity.ts b/web/packages/web-client/src/graph/generated/models/SignInActivity.ts new file mode 100644 index 00000000000..869f01a922c --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/SignInActivity.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +/** + * Provides the last successful sign-in attempt for a user + * @export + * @interface SignInActivity + */ +export interface SignInActivity { + /** + * The date and time of the last successful sign-in for the user. + */ + lastSuccessfulSignInDateTime?: Date; +} + +/** + * Check if a given object implements the SignInActivity interface. + */ +export function instanceOfSignInActivity(value: object): value is SignInActivity { + return true; +} + +export function SignInActivityFromJSON(json: any): SignInActivity { + return SignInActivityFromJSONTyped(json, false); +} + +export function SignInActivityFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignInActivity { + if (json == null) { + return json; + } + return { + + 'lastSuccessfulSignInDateTime': json['lastSuccessfulSignInDateTime'] == null ? undefined : (parseDateTime(json['lastSuccessfulSignInDateTime'])), + }; +} + +export function SignInActivityToJSON(json: any): SignInActivity { + return SignInActivityToJSONTyped(json, false); +} + +export function SignInActivityToJSONTyped(value?: SignInActivity | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'lastSuccessfulSignInDateTime': value['lastSuccessfulSignInDateTime'] == null ? value['lastSuccessfulSignInDateTime'] : serializeDateTime(value['lastSuccessfulSignInDateTime']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/SpecialFolder.ts b/web/packages/web-client/src/graph/generated/models/SpecialFolder.ts new file mode 100644 index 00000000000..294ceb5f227 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/SpecialFolder.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * If the current item is also available as a special folder, this facet is returned. Read-only + * @export + * @interface SpecialFolder + */ +export interface SpecialFolder { + /** + * The unique identifier for this item in the /drive/special collection + */ + name?: string; +} + +/** + * Check if a given object implements the SpecialFolder interface. + */ +export function instanceOfSpecialFolder(value: object): value is SpecialFolder { + return true; +} + +export function SpecialFolderFromJSON(json: any): SpecialFolder { + return SpecialFolderFromJSONTyped(json, false); +} + +export function SpecialFolderFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpecialFolder { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function SpecialFolderToJSON(json: any): SpecialFolder { + return SpecialFolderToJSONTyped(json, false); +} + +export function SpecialFolderToJSONTyped(value?: SpecialFolder | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/TagAssignment.ts b/web/packages/web-client/src/graph/generated/models/TagAssignment.ts new file mode 100644 index 00000000000..7af6e2f1cfd --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/TagAssignment.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TagAssignment + */ +export interface TagAssignment { + /** + * + */ + resourceId: string; + /** + * + */ + tags: Array; +} + +/** + * Check if a given object implements the TagAssignment interface. + */ +export function instanceOfTagAssignment(value: object): value is TagAssignment { + if (!('resourceId' in value) || value['resourceId'] === undefined) return false; + if (!('tags' in value) || value['tags'] === undefined) return false; + return true; +} + +export function TagAssignmentFromJSON(json: any): TagAssignment { + return TagAssignmentFromJSONTyped(json, false); +} + +export function TagAssignmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagAssignment { + if (json == null) { + return json; + } + return { + + 'resourceId': json['resourceId'], + 'tags': json['tags'], + }; +} + +export function TagAssignmentToJSON(json: any): TagAssignment { + return TagAssignmentToJSONTyped(json, false); +} + +export function TagAssignmentToJSONTyped(value?: TagAssignment | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'resourceId': value['resourceId'], + 'tags': value['tags'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/TagUnassignment.ts b/web/packages/web-client/src/graph/generated/models/TagUnassignment.ts new file mode 100644 index 00000000000..979e636906e --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/TagUnassignment.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TagUnassignment + */ +export interface TagUnassignment { + /** + * + */ + resourceId: string; + /** + * + */ + tags: Array; +} + +/** + * Check if a given object implements the TagUnassignment interface. + */ +export function instanceOfTagUnassignment(value: object): value is TagUnassignment { + if (!('resourceId' in value) || value['resourceId'] === undefined) return false; + if (!('tags' in value) || value['tags'] === undefined) return false; + return true; +} + +export function TagUnassignmentFromJSON(json: any): TagUnassignment { + return TagUnassignmentFromJSONTyped(json, false); +} + +export function TagUnassignmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagUnassignment { + if (json == null) { + return json; + } + return { + + 'resourceId': json['resourceId'], + 'tags': json['tags'], + }; +} + +export function TagUnassignmentToJSON(json: any): TagUnassignment { + return TagUnassignmentToJSONTyped(json, false); +} + +export function TagUnassignmentToJSONTyped(value?: TagUnassignment | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'resourceId': value['resourceId'], + 'tags': value['tags'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Thumbnail.ts b/web/packages/web-client/src/graph/generated/models/Thumbnail.ts new file mode 100644 index 00000000000..99e6ff57383 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Thumbnail.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * The thumbnail resource type represents a thumbnail for an image, video, document, or any item that has a bitmap representation. + * + * @export + * @interface Thumbnail + */ +export interface Thumbnail { + /** + * The content stream for the thumbnail. + */ + content?: string; + /** + * The height of the thumbnail, in pixels. + */ + height?: number; + /** + * The unique identifier of the item that provided the thumbnail. This is only available when a folder thumbnail is requested. + */ + sourceItemId?: string; + /** + * The URL used to fetch the thumbnail content. + */ + url?: string; + /** + * The width of the thumbnail, in pixels. + */ + width?: number; +} + +/** + * Check if a given object implements the Thumbnail interface. + */ +export function instanceOfThumbnail(value: object): value is Thumbnail { + return true; +} + +export function ThumbnailFromJSON(json: any): Thumbnail { + return ThumbnailFromJSONTyped(json, false); +} + +export function ThumbnailFromJSONTyped(json: any, ignoreDiscriminator: boolean): Thumbnail { + if (json == null) { + return json; + } + return { + + 'content': json['content'] == null ? undefined : json['content'], + 'height': json['height'] == null ? undefined : json['height'], + 'sourceItemId': json['sourceItemId'] == null ? undefined : json['sourceItemId'], + 'url': json['url'] == null ? undefined : json['url'], + 'width': json['width'] == null ? undefined : json['width'], + }; +} + +export function ThumbnailToJSON(json: any): Thumbnail { + return ThumbnailToJSONTyped(json, false); +} + +export function ThumbnailToJSONTyped(value?: Thumbnail | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'content': value['content'], + 'height': value['height'], + 'sourceItemId': value['sourceItemId'], + 'url': value['url'], + 'width': value['width'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/ThumbnailSet.ts b/web/packages/web-client/src/graph/generated/models/ThumbnailSet.ts new file mode 100644 index 00000000000..3ba96fed775 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/ThumbnailSet.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Thumbnail } from './Thumbnail'; +import { + ThumbnailFromJSON, + ThumbnailFromJSONTyped, + ThumbnailToJSON, + ThumbnailToJSONTyped, +} from './Thumbnail'; + +/** + * The ThumbnailSet resource is a keyed collection of thumbnail resources. + * It's used to represent a set of thumbnails associated with a DriveItem. + * + * @export + * @interface ThumbnailSet + */ +export interface ThumbnailSet { + /** + * The ID within the item. Read-only. + */ + id?: string; + /** + * + */ + large?: Thumbnail; + /** + * + */ + medium?: Thumbnail; + /** + * + */ + small?: Thumbnail; + /** + * + */ + source?: Thumbnail; +} + +/** + * Check if a given object implements the ThumbnailSet interface. + */ +export function instanceOfThumbnailSet(value: object): value is ThumbnailSet { + return true; +} + +export function ThumbnailSetFromJSON(json: any): ThumbnailSet { + return ThumbnailSetFromJSONTyped(json, false); +} + +export function ThumbnailSetFromJSONTyped(json: any, ignoreDiscriminator: boolean): ThumbnailSet { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'large': json['large'] == null ? undefined : ThumbnailFromJSON(json['large']), + 'medium': json['medium'] == null ? undefined : ThumbnailFromJSON(json['medium']), + 'small': json['small'] == null ? undefined : ThumbnailFromJSON(json['small']), + 'source': json['source'] == null ? undefined : ThumbnailFromJSON(json['source']), + }; +} + +export function ThumbnailSetToJSON(json: any): ThumbnailSet { + return ThumbnailSetToJSONTyped(json, false); +} + +export function ThumbnailSetToJSONTyped(value?: ThumbnailSet | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'large': ThumbnailToJSON(value['large']), + 'medium': ThumbnailToJSON(value['medium']), + 'small': ThumbnailToJSON(value['small']), + 'source': ThumbnailToJSON(value['source']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Trash.ts b/web/packages/web-client/src/graph/generated/models/Trash.ts new file mode 100644 index 00000000000..56a0860b5ca --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Trash.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import type { IdentitySet } from './IdentitySet'; +import { + IdentitySetFromJSON, + IdentitySetFromJSONTyped, + IdentitySetToJSON, + IdentitySetToJSONTyped, +} from './IdentitySet'; + +/** + * Metadata for trashed drive Items + * @export + * @interface Trash + */ +export interface Trash { + /** + * + */ + trashedBy?: IdentitySet; + /** + * The UTC date and time the folder was marked as trashed. + */ + trashedDateTime?: Date; +} + +/** + * Check if a given object implements the Trash interface. + */ +export function instanceOfTrash(value: object): value is Trash { + return true; +} + +export function TrashFromJSON(json: any): Trash { + return TrashFromJSONTyped(json, false); +} + +export function TrashFromJSONTyped(json: any, ignoreDiscriminator: boolean): Trash { + if (json == null) { + return json; + } + return { + + 'trashedBy': json['trashedBy'] == null ? undefined : IdentitySetFromJSON(json['trashedBy']), + 'trashedDateTime': json['trashedDateTime'] == null ? undefined : (parseDateTime(json['trashedDateTime'])), + }; +} + +export function TrashToJSON(json: any): Trash { + return TrashToJSONTyped(json, false); +} + +export function TrashToJSONTyped(value?: Trash | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'trashedBy': IdentitySetToJSON(value['trashedBy']), + 'trashedDateTime': value['trashedDateTime'] == null ? value['trashedDateTime'] : serializeDateTime(value['trashedDateTime']), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/UnifiedRoleDefinition.ts b/web/packages/web-client/src/graph/generated/models/UnifiedRoleDefinition.ts new file mode 100644 index 00000000000..1453159878f --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/UnifiedRoleDefinition.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UnifiedRolePermission } from './UnifiedRolePermission'; +import { + UnifiedRolePermissionFromJSON, + UnifiedRolePermissionFromJSONTyped, + UnifiedRolePermissionToJSON, + UnifiedRolePermissionToJSONTyped, +} from './UnifiedRolePermission'; + +/** + * A role definition is a collection of permissions in libre graph listing the operations that can be performed + * and the resources against which they can performed. + * + * @export + * @interface UnifiedRoleDefinition + */ +export interface UnifiedRoleDefinition { + /** + * The description for the unifiedRoleDefinition. + */ + description?: string; + /** + * The display name for the unifiedRoleDefinition. Required. Supports $filter (`eq`, `in`). + */ + displayName?: string; + /** + * The unique identifier for the role definition. Key, not nullable, Read-only. Inherited from entity. Supports $filter (`eq`, `in`). + */ + id?: string; + /** + * List of permissions included in the role. + */ + rolePermissions?: Array; + /** + * When presenting a list of roles the weight can be used to order them in a meaningful way. + * Lower weight gets higher precedence. So content with lower weight will come first. If set, + * weights should be non-zero, as 0 is interpreted as an unset weight. + * + */ + atLibreGraphWeight?: number; +} + +/** + * Check if a given object implements the UnifiedRoleDefinition interface. + */ +export function instanceOfUnifiedRoleDefinition(value: object): value is UnifiedRoleDefinition { + return true; +} + +export function UnifiedRoleDefinitionFromJSON(json: any): UnifiedRoleDefinition { + return UnifiedRoleDefinitionFromJSONTyped(json, false); +} + +export function UnifiedRoleDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnifiedRoleDefinition { + if (json == null) { + return json; + } + return { + + 'description': json['description'] == null ? undefined : json['description'], + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'id': json['id'] == null ? undefined : json['id'], + 'rolePermissions': json['rolePermissions'] == null ? undefined : ((json['rolePermissions'] as Array).map(UnifiedRolePermissionFromJSON)), + 'atLibreGraphWeight': json['@libre.graph.weight'] == null ? undefined : json['@libre.graph.weight'], + }; +} + +export function UnifiedRoleDefinitionToJSON(json: any): UnifiedRoleDefinition { + return UnifiedRoleDefinitionToJSONTyped(json, false); +} + +export function UnifiedRoleDefinitionToJSONTyped(value?: UnifiedRoleDefinition | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + 'rolePermissions': value['rolePermissions'] == null ? undefined : ((value['rolePermissions'] as Array).map(UnifiedRolePermissionToJSON)), + '@libre.graph.weight': value['atLibreGraphWeight'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/UnifiedRolePermission.ts b/web/packages/web-client/src/graph/generated/models/UnifiedRolePermission.ts new file mode 100644 index 00000000000..78bdc605a67 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/UnifiedRolePermission.ts @@ -0,0 +1,146 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Represents a collection of allowed resource actions and the conditions that must be met for the action to be allowed. + * Resource actions are tasks that can be performed on a resource. For example, an application resource may support + * create, update, delete, and reset password actions. + * + * @export + * @interface UnifiedRolePermission + */ +export interface UnifiedRolePermission { + /** + * Set of tasks that can be performed on a resource. Required. + * + * The following is the schema for resource actions: + * + * ``` + * {Namespace}/{Entity}/{PropertySet}/{Action} + * ``` + * + * For example: `libre.graph/applications/credentials/update` + * + * * *{Namespace}* - The services that exposes the task. For example, all tasks in libre graph use the namespace `libre.graph`. + * * *{Entity}* - The logical features or components exposed by the service in libre graph. For example, `applications`, `servicePrincipals`, or `groups`. + * * *{PropertySet}* - Optional. The specific properties or aspects of the entity for which access is being granted. + * For example, `libre.graph/applications/authentication/read` grants the ability to read the reply URL, logout URL, + * and implicit flow property on the **application** object in libre graph. The following are reserved names for common property sets: + * * `allProperties` - Designates all properties of the entity, including privileged properties. + * Examples include `libre.graph/applications/allProperties/read` and `libre.graph/applications/allProperties/update`. + * * `basic` - Designates common read properties but excludes privileged ones. + * For example, `libre.graph/applications/basic/update` includes the ability to update standard properties like display name. + * * `standard` - Designates common update properties but excludes privileged ones. + * For example, `libre.graph/applications/standard/read`. + * * *{Actions}* - The operations being granted. In most circumstances, permissions should be expressed in terms of CRUD operations or allTasks. Actions include: + * * `create` - The ability to create a new instance of the entity. + * * `read` - The ability to read a given property set (including allProperties). + * * `update` - The ability to update a given property set (including allProperties). + * * `delete` - The ability to delete a given entity. + * * `allTasks` - Represents all CRUD operations (create, read, update, and delete). + * + * Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: + * | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | + * | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | + * | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | + * | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | + * | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | + * | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | + * | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | + * | `list_container` | `libre.graph/driveItem/children/read` | | + * | `create_container` | `libre.graph/driveItem/children/create` | | + * | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | + * | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | + * | `add_grant` | `libre.graph/driveItem/permissions/create` | | + * | `list_grant` | `libre.graph/driveItem/permissions/read` | | + * | `update_grant` | `libre.graph/driveItem/permissions/update` | | + * | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | + * | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | + * | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | + * | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | + * | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | + * | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | + * | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` | + * + * Managing drives would be a different entity. A space manager role could be written as `libre.graph/drive/permission/allTasks`. + * + */ + allowedResourceActions?: Array; + /** + * Optional constraints that must be met for the permission to be effective. Not supported for custom roles. + * + * Conditions define constraints that must be met. For example, a requirement that target resource must have a certain property. + * The following are the supported conditions: + * + * * Drive: `exists @Resource.Drive` - The target resource must be a drive/space + * * Folder: `exists @Resource.Folder` - The target resource must be a folder + * * File: `exists @Resource.File` - The target resource must be a file + * + * The following is an example of a role permission with a condition that the target resource is a folder: + * ```json + * "rolePermissions": [ + * { + * "allowedResourceActions": [ + * "libre.graph/applications/basic/update", + * "libre.graph/applications/credentials/update" + * ], + * "condition": "exists @Resource.File" + * } + * ] + * ``` + * Conditions aren't supported for custom roles. + * + */ + condition?: string; +} + +/** + * Check if a given object implements the UnifiedRolePermission interface. + */ +export function instanceOfUnifiedRolePermission(value: object): value is UnifiedRolePermission { + return true; +} + +export function UnifiedRolePermissionFromJSON(json: any): UnifiedRolePermission { + return UnifiedRolePermissionFromJSONTyped(json, false); +} + +export function UnifiedRolePermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnifiedRolePermission { + if (json == null) { + return json; + } + return { + + 'allowedResourceActions': json['allowedResourceActions'] == null ? undefined : json['allowedResourceActions'], + 'condition': json['condition'] == null ? undefined : json['condition'], + }; +} + +export function UnifiedRolePermissionToJSON(json: any): UnifiedRolePermission { + return UnifiedRolePermissionToJSONTyped(json, false); +} + +export function UnifiedRolePermissionToJSONTyped(value?: UnifiedRolePermission | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'allowedResourceActions': value['allowedResourceActions'], + 'condition': value['condition'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/User.ts b/web/packages/web-client/src/graph/generated/models/User.ts new file mode 100644 index 00000000000..e84ba07f4d1 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/User.ts @@ -0,0 +1,218 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AppRoleAssignment } from './AppRoleAssignment'; +import { + AppRoleAssignmentFromJSON, + AppRoleAssignmentFromJSONTyped, + AppRoleAssignmentToJSON, + AppRoleAssignmentToJSONTyped, +} from './AppRoleAssignment'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; +import type { SignInActivity } from './SignInActivity'; +import { + SignInActivityFromJSON, + SignInActivityFromJSONTyped, + SignInActivityToJSON, + SignInActivityToJSONTyped, +} from './SignInActivity'; +import type { ObjectIdentity } from './ObjectIdentity'; +import { + ObjectIdentityFromJSON, + ObjectIdentityFromJSONTyped, + ObjectIdentityToJSON, + ObjectIdentityToJSONTyped, +} from './ObjectIdentity'; +import type { Instance } from './Instance'; +import { + InstanceFromJSON, + InstanceFromJSONTyped, + InstanceToJSON, + InstanceToJSONTyped, +} from './Instance'; +import type { Drive } from './Drive'; +import { + DriveFromJSON, + DriveFromJSONTyped, + DriveToJSON, + DriveToJSONTyped, +} from './Drive'; +import type { PasswordProfile } from './PasswordProfile'; +import { + PasswordProfileFromJSON, + PasswordProfileFromJSONTyped, + PasswordProfileToJSON, + PasswordProfileToJSONTyped, +} from './PasswordProfile'; + +/** + * Represents an Active Directory user object. + * @export + * @interface User + */ +export interface User { + /** + * Read-only. + */ + readonly id?: string; + /** + * Set to "true" when the account is enabled. + */ + accountEnabled?: boolean; + /** + * The apps and app roles which this user has been assigned. + */ + readonly appRoleAssignments?: Array; + /** + * The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. + */ + displayName: string; + /** + * A collection of drives available for this user. Read-only. + */ + readonly drives?: Array; + /** + * + */ + drive?: Drive; + /** + * Identities associated with this account. + */ + identities?: Array; + /** + * The SMTP address for the user, for example, 'jeff@contoso.onowncloud.com'. Returned by default. + */ + mail?: string; + /** + * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + */ + readonly memberOf?: Array; + /** + * Contains the on-premises SAM account name synchronized from the on-premises directory. + */ + onPremisesSamAccountName: string; + /** + * + */ + passwordProfile?: PasswordProfile; + /** + * The user's surname (family name or last name). Returned by default. + */ + surname?: string; + /** + * The user's givenName. Returned by default. + */ + givenName?: string; + /** + * The user`s type. This can be either "Member" for regular user, "Guest" for guest users or "Federated" for users imported from a federated instance. + */ + readonly userType?: string; + /** + * Represents the users language setting, ISO-639-1 Code + */ + preferredLanguage?: string; + /** + * + */ + signInActivity?: SignInActivity; + /** + * A unique identifier assigned to the user by the organization. + */ + externalID?: string; + /** + * A unique reference to the user. This is used to query the user from a different oCIS instance connected to the same identity provider. + */ + crossInstanceReference?: string; + /** + * oCIS instances that the user is either a member or a guest of. + */ + instances?: Array; +} + +/** + * Check if a given object implements the User interface. + */ +export function instanceOfUser(value: object): value is User { + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('onPremisesSamAccountName' in value) || value['onPremisesSamAccountName'] === undefined) return false; + return true; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'accountEnabled': json['accountEnabled'] == null ? undefined : json['accountEnabled'], + 'appRoleAssignments': json['appRoleAssignments'] == null ? undefined : ((json['appRoleAssignments'] as Array).map(AppRoleAssignmentFromJSON)), + 'displayName': json['displayName'], + 'drives': json['drives'] == null ? undefined : ((json['drives'] as Array).map(DriveFromJSON)), + 'drive': json['drive'] == null ? undefined : DriveFromJSON(json['drive']), + 'identities': json['identities'] == null ? undefined : ((json['identities'] as Array).map(ObjectIdentityFromJSON)), + 'mail': json['mail'] == null ? undefined : json['mail'], + 'memberOf': json['memberOf'] == null ? undefined : ((json['memberOf'] as Array).map(GroupFromJSON)), + 'onPremisesSamAccountName': json['onPremisesSamAccountName'], + 'passwordProfile': json['passwordProfile'] == null ? undefined : PasswordProfileFromJSON(json['passwordProfile']), + 'surname': json['surname'] == null ? undefined : json['surname'], + 'givenName': json['givenName'] == null ? undefined : json['givenName'], + 'userType': json['userType'] == null ? undefined : json['userType'], + 'preferredLanguage': json['preferredLanguage'] == null ? undefined : json['preferredLanguage'], + 'signInActivity': json['signInActivity'] == null ? undefined : SignInActivityFromJSON(json['signInActivity']), + 'externalID': json['externalID'] == null ? undefined : json['externalID'], + 'crossInstanceReference': json['crossInstanceReference'] == null ? undefined : json['crossInstanceReference'], + 'instances': json['instances'] == null ? undefined : ((json['instances'] as Array).map(InstanceFromJSON)), + }; +} + +export function UserToJSON(json: any): User { + return UserToJSONTyped(json, false); +} + +export function UserToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountEnabled': value['accountEnabled'], + 'displayName': value['displayName'], + 'drive': DriveToJSON(value['drive']), + 'identities': value['identities'] == null ? undefined : ((value['identities'] as Array).map(ObjectIdentityToJSON)), + 'mail': value['mail'], + 'onPremisesSamAccountName': value['onPremisesSamAccountName'], + 'passwordProfile': PasswordProfileToJSON(value['passwordProfile']), + 'surname': value['surname'], + 'givenName': value['givenName'], + 'preferredLanguage': value['preferredLanguage'], + 'signInActivity': SignInActivityToJSON(value['signInActivity']), + 'externalID': value['externalID'], + 'crossInstanceReference': value['crossInstanceReference'], + 'instances': value['instances'] == null ? undefined : ((value['instances'] as Array).map(InstanceToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/UserUpdate.ts b/web/packages/web-client/src/graph/generated/models/UserUpdate.ts new file mode 100644 index 00000000000..7da85958b9e --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/UserUpdate.ts @@ -0,0 +1,216 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AppRoleAssignment } from './AppRoleAssignment'; +import { + AppRoleAssignmentFromJSON, + AppRoleAssignmentFromJSONTyped, + AppRoleAssignmentToJSON, + AppRoleAssignmentToJSONTyped, +} from './AppRoleAssignment'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; +import type { SignInActivity } from './SignInActivity'; +import { + SignInActivityFromJSON, + SignInActivityFromJSONTyped, + SignInActivityToJSON, + SignInActivityToJSONTyped, +} from './SignInActivity'; +import type { ObjectIdentity } from './ObjectIdentity'; +import { + ObjectIdentityFromJSON, + ObjectIdentityFromJSONTyped, + ObjectIdentityToJSON, + ObjectIdentityToJSONTyped, +} from './ObjectIdentity'; +import type { Instance } from './Instance'; +import { + InstanceFromJSON, + InstanceFromJSONTyped, + InstanceToJSON, + InstanceToJSONTyped, +} from './Instance'; +import type { Drive } from './Drive'; +import { + DriveFromJSON, + DriveFromJSONTyped, + DriveToJSON, + DriveToJSONTyped, +} from './Drive'; +import type { PasswordProfile } from './PasswordProfile'; +import { + PasswordProfileFromJSON, + PasswordProfileFromJSONTyped, + PasswordProfileToJSON, + PasswordProfileToJSONTyped, +} from './PasswordProfile'; + +/** + * Represents updates to an Active Directory user object. + * @export + * @interface UserUpdate + */ +export interface UserUpdate { + /** + * Read-only. + */ + readonly id?: string; + /** + * Set to "true" when the account is enabled. + */ + accountEnabled?: boolean; + /** + * The apps and app roles which this user has been assigned. + */ + readonly appRoleAssignments?: Array; + /** + * The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. + */ + displayName?: string; + /** + * A collection of drives available for this user. Read-only. + */ + readonly drives?: Array; + /** + * + */ + drive?: Drive; + /** + * Identities associated with this account. + */ + identities?: Array; + /** + * The SMTP address for the user, for example, 'jeff@contoso.onowncloud.com'. Returned by default. + */ + mail?: string; + /** + * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. + */ + readonly memberOf?: Array; + /** + * Contains the on-premises SAM account name synchronized from the on-premises directory. + */ + onPremisesSamAccountName?: string; + /** + * + */ + passwordProfile?: PasswordProfile; + /** + * The user's surname (family name or last name). Returned by default. + */ + surname?: string; + /** + * The user's givenName. Returned by default. + */ + givenName?: string; + /** + * The user`s type. This can be either "Member" for regular user, "Guest" for guest users or "Federated" for users imported from a federated instance. + */ + readonly userType?: string; + /** + * Represents the users language setting, ISO-639-1 Code + */ + preferredLanguage?: string; + /** + * + */ + signInActivity?: SignInActivity; + /** + * A unique identifier assigned to the user by the organization. + */ + externalID?: string; + /** + * A unique reference to the user. This is used to query the user from a different oCIS instance connected to the same identity provider. + */ + crossInstanceReference?: string; + /** + * oCIS instances that the user is either a member or a guest of. + */ + instances?: Array; +} + +/** + * Check if a given object implements the UserUpdate interface. + */ +export function instanceOfUserUpdate(value: object): value is UserUpdate { + return true; +} + +export function UserUpdateFromJSON(json: any): UserUpdate { + return UserUpdateFromJSONTyped(json, false); +} + +export function UserUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserUpdate { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'accountEnabled': json['accountEnabled'] == null ? undefined : json['accountEnabled'], + 'appRoleAssignments': json['appRoleAssignments'] == null ? undefined : ((json['appRoleAssignments'] as Array).map(AppRoleAssignmentFromJSON)), + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'drives': json['drives'] == null ? undefined : ((json['drives'] as Array).map(DriveFromJSON)), + 'drive': json['drive'] == null ? undefined : DriveFromJSON(json['drive']), + 'identities': json['identities'] == null ? undefined : ((json['identities'] as Array).map(ObjectIdentityFromJSON)), + 'mail': json['mail'] == null ? undefined : json['mail'], + 'memberOf': json['memberOf'] == null ? undefined : ((json['memberOf'] as Array).map(GroupFromJSON)), + 'onPremisesSamAccountName': json['onPremisesSamAccountName'] == null ? undefined : json['onPremisesSamAccountName'], + 'passwordProfile': json['passwordProfile'] == null ? undefined : PasswordProfileFromJSON(json['passwordProfile']), + 'surname': json['surname'] == null ? undefined : json['surname'], + 'givenName': json['givenName'] == null ? undefined : json['givenName'], + 'userType': json['userType'] == null ? undefined : json['userType'], + 'preferredLanguage': json['preferredLanguage'] == null ? undefined : json['preferredLanguage'], + 'signInActivity': json['signInActivity'] == null ? undefined : SignInActivityFromJSON(json['signInActivity']), + 'externalID': json['externalID'] == null ? undefined : json['externalID'], + 'crossInstanceReference': json['crossInstanceReference'] == null ? undefined : json['crossInstanceReference'], + 'instances': json['instances'] == null ? undefined : ((json['instances'] as Array).map(InstanceFromJSON)), + }; +} + +export function UserUpdateToJSON(json: any): UserUpdate { + return UserUpdateToJSONTyped(json, false); +} + +export function UserUpdateToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountEnabled': value['accountEnabled'], + 'displayName': value['displayName'], + 'drive': DriveToJSON(value['drive']), + 'identities': value['identities'] == null ? undefined : ((value['identities'] as Array).map(ObjectIdentityToJSON)), + 'mail': value['mail'], + 'onPremisesSamAccountName': value['onPremisesSamAccountName'], + 'passwordProfile': PasswordProfileToJSON(value['passwordProfile']), + 'surname': value['surname'], + 'givenName': value['givenName'], + 'preferredLanguage': value['preferredLanguage'], + 'signInActivity': SignInActivityToJSON(value['signInActivity']), + 'externalID': value['externalID'], + 'crossInstanceReference': value['crossInstanceReference'], + 'instances': value['instances'] == null ? undefined : ((value['instances'] as Array).map(InstanceToJSON)), + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/Video.ts b/web/packages/web-client/src/graph/generated/models/Video.ts new file mode 100644 index 00000000000..8f7be25d7e7 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/Video.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * The video resource groups video-related data items into a single structure. + * + * If a driveItem has a non-null video facet, the item represents a video file. The properties of the video resource are populated by extracting metadata from the file. + * + * @export + * @interface Video + */ +export interface Video { + /** + * Number of audio bits per sample. + */ + audioBitsPerSample?: number; + /** + * Number of audio channels. + */ + audioChannels?: number; + /** + * Name of the audio format (AAC, MP3, etc.). + */ + audioFormat?: string; + /** + * Number of audio samples per second. + */ + audioSamplesPerSecond?: number; + /** + * Bit rate of the video in bits per second. + */ + bitrate?: number; + /** + * Duration of the file in milliseconds. + */ + duration?: number; + /** + * \"Four character code\" name of the video format. + */ + fourCC?: string; + /** + * Frame rate of the video. + */ + frameRate?: number; + /** + * Height of the video, in pixels. + */ + height?: number; + /** + * Width of the video, in pixels. + */ + width?: number; +} + +/** + * Check if a given object implements the Video interface. + */ +export function instanceOfVideo(value: object): value is Video { + return true; +} + +export function VideoFromJSON(json: any): Video { + return VideoFromJSONTyped(json, false); +} + +export function VideoFromJSONTyped(json: any, ignoreDiscriminator: boolean): Video { + if (json == null) { + return json; + } + return { + + 'audioBitsPerSample': json['audioBitsPerSample'] == null ? undefined : json['audioBitsPerSample'], + 'audioChannels': json['audioChannels'] == null ? undefined : json['audioChannels'], + 'audioFormat': json['audioFormat'] == null ? undefined : json['audioFormat'], + 'audioSamplesPerSecond': json['audioSamplesPerSecond'] == null ? undefined : json['audioSamplesPerSecond'], + 'bitrate': json['bitrate'] == null ? undefined : json['bitrate'], + 'duration': json['duration'] == null ? undefined : json['duration'], + 'fourCC': json['fourCC'] == null ? undefined : json['fourCC'], + 'frameRate': json['frameRate'] == null ? undefined : json['frameRate'], + 'height': json['height'] == null ? undefined : json['height'], + 'width': json['width'] == null ? undefined : json['width'], + }; +} + +export function VideoToJSON(json: any): Video { + return VideoToJSONTyped(json, false); +} + +export function VideoToJSONTyped(value?: Video | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'audioBitsPerSample': value['audioBitsPerSample'], + 'audioChannels': value['audioChannels'], + 'audioFormat': value['audioFormat'], + 'audioSamplesPerSecond': value['audioSamplesPerSecond'], + 'bitrate': value['bitrate'], + 'duration': value['duration'], + 'fourCC': value['fourCC'], + 'frameRate': value['frameRate'], + 'height': value['height'], + 'width': value['width'], + }; +} + diff --git a/web/packages/web-client/src/graph/generated/models/index.ts b/web/packages/web-client/src/graph/generated/models/index.ts new file mode 100644 index 00000000000..fb6b864dbe8 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/models/index.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './Activity'; +export * from './ActivityTemplate'; +export * from './ActivityTimes'; +export * from './AppRole'; +export * from './AppRoleAssignment'; +export * from './Application'; +export * from './Audio'; +export * from './ClassMemberReference'; +export * from './ClassReference'; +export * from './ClassTeacherReference'; +export * from './CollectionOfActivities'; +export * from './CollectionOfAppRoleAssignments'; +export * from './CollectionOfApplications'; +export * from './CollectionOfClass'; +export * from './CollectionOfDriveItems'; +export * from './CollectionOfDriveItems1'; +export * from './CollectionOfDrives'; +export * from './CollectionOfDrives1'; +export * from './CollectionOfEducationClass'; +export * from './CollectionOfEducationUser'; +export * from './CollectionOfGroup'; +export * from './CollectionOfPermissions'; +export * from './CollectionOfPermissionsWithAllowedValues'; +export * from './CollectionOfSchools'; +export * from './CollectionOfTags'; +export * from './CollectionOfUser'; +export * from './CollectionOfUsers'; +export * from './Deleted'; +export * from './Drive'; +export * from './DriveItem'; +export * from './DriveItemCreateLink'; +export * from './DriveItemInvite'; +export * from './DriveRecipient'; +export * from './DriveUpdate'; +export * from './EducationClass'; +export * from './EducationSchool'; +export * from './EducationUser'; +export * from './EducationUserReference'; +export * from './ExportPersonalDataRequest'; +export * from './FileSystemInfo'; +export * from './Folder'; +export * from './FolderView'; +export * from './GeoCoordinates'; +export * from './Group'; +export * from './Hashes'; +export * from './Identity'; +export * from './IdentitySet'; +export * from './Image'; +export * from './Instance'; +export * from './ItemReference'; +export * from './MemberReference'; +export * from './ObjectIdentity'; +export * from './OdataError'; +export * from './OdataErrorDetail'; +export * from './OdataErrorMain'; +export * from './OpenGraphFile'; +export * from './PasswordChange'; +export * from './PasswordProfile'; +export * from './Permission'; +export * from './Photo'; +export * from './Quota'; +export * from './RemoteItem'; +export * from './SharePointIdentitySet'; +export * from './SharingInvitation'; +export * from './SharingLink'; +export * from './SharingLinkPassword'; +export * from './SharingLinkType'; +export * from './SignInActivity'; +export * from './SpecialFolder'; +export * from './TagAssignment'; +export * from './TagUnassignment'; +export * from './Thumbnail'; +export * from './ThumbnailSet'; +export * from './Trash'; +export * from './UnifiedRoleDefinition'; +export * from './UnifiedRolePermission'; +export * from './User'; +export * from './UserUpdate'; +export * from './Video'; diff --git a/web/packages/web-client/src/graph/generated/runtime.ts b/web/packages/web-client/src/graph/generated/runtime.ts new file mode 100644 index 00000000000..386b09a8ea4 --- /dev/null +++ b/web/packages/web-client/src/graph/generated/runtime.ts @@ -0,0 +1,505 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Libre Graph API + * Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export const BASE_PATH = "https://ocis.ocis.rolling.owncloud.works/graph".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + + // restore prototype chain + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + + // restore prototype chain + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + + // restore prototype chain + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(serializeDateTime(value))}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +/** + * Every generated date call site routes through these. + * + * `format: date` is a calendar date, with no time and no offset, so it is converted + * against the local calendar on both ends: they have to agree or the date shifts by + * a day. `format: date-time` is an instant and uses UTC. + */ +export function serializeDateTime(value: Date): string { + return value.toISOString(); +} + +export function serializeDate(value: Date): string { + if (isNaN(value.getTime())) { + throw new RangeError('Invalid time value'); + } + const year = ('000' + value.getFullYear()).slice(-4); + const month = ('0' + (value.getMonth() + 1)).slice(-2); + const day = ('0' + value.getDate()).slice(-2); + return `${year}-${month}-${day}`; +} + + +export function parseDate(value: Date | string): Date { + if (value instanceof Date) { + return value; + } + // `new Date("2026-08-05")` would parse as UTC midnight: a different day west of UTC. + // Local midnight is the stated day everywhere. setFullYear avoids the 1900 offset the + // multi-argument constructor applies to years 0-99. + const fullDate = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(value)); + if (fullDate) { + const year = Number(fullDate[1]); + const month = Number(fullDate[2]) - 1; + const day = Number(fullDate[3]); + const date = new Date(0); + date.setFullYear(year, month, day); + date.setHours(0, 0, 0, 0); + // Out-of-range components (or a day the local zone skipped) silently roll over, + // which would hand back a date the server never sent. + if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) { + return new Date(NaN); + } + return date; + } + return new Date(value); +} + +export function parseDateTime(value: any): Date { + return new Date(value); +} + +export function mapValues(data: any, fn: (item: any) => any) { + const result: { [key: string]: any } = {}; + for (const key of Object.keys(data)) { + result[key] = fn(data[key]); + } + return result; +} + +// Pass-through serializer for `any`-typed properties in form data. See #1877. +export function anyToJSON(value: any): any { + return value; +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if (consume.contentType?.startsWith('multipart/form-data') == true) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} From 6bb4a63f52b6cb26bf6d93cce3d4f4be45d4d942 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 10:33:45 +0200 Subject: [PATCH 10/19] refactor(web-client): adapt graph wrappers to the fetch-based generated client Regenerate the libre-graph client with the typescript-fetch template and rewrite the eight facade factories against it: - the generated APIs are classes (`new XxxApi(config)`), take a single request-parameters object and resolve to the payload rather than an envelope, so the wrappers no longer destructure `{ data }` - every generated request is routed through `FetchClient` via `Configuration.fetchApi`, keeping header injection, maintenance detection and `HttpError`-on-non-2xx intact. Callers keep seeing `HttpError` with `statusCode` and `data`, never `ResponseError` - `toInitOverrides` merges our per-request headers into the generated `RequestInit` instead of replacing them, which a plain object would do because the runtime spreads `initOverrides` shallowly - undeclared query parameters travel on a symbol-keyed channel, since the runtime assembles the URL before it applies `initOverrides` `--type-mappings=DateTime=string` keeps date-times as strings, matching what the previous template emitted and what the app expects. --- web/packages/web-client/package.json | 2 +- .../src/graph/activities/activities.ts | 18 +- .../src/graph/applications/applications.ts | 21 +-- .../src/graph/driveItems/driveItems.ts | 44 +++-- .../web-client/src/graph/drives/drives.ts | 54 +++--- .../src/graph/generated/docs/ActivityTimes.md | 2 +- .../graph/generated/docs/AppRoleAssignment.md | 4 +- .../src/graph/generated/docs/Drive.md | 4 +- .../src/graph/generated/docs/DriveItem.md | 4 +- .../generated/docs/DriveItemCreateLink.md | 2 +- .../graph/generated/docs/DriveItemInvite.md | 2 +- .../src/graph/generated/docs/DriveUpdate.md | 4 +- .../graph/generated/docs/EducationSchool.md | 2 +- .../graph/generated/docs/FileSystemInfo.md | 6 +- .../src/graph/generated/docs/Permission.md | 4 +- .../src/graph/generated/docs/Photo.md | 2 +- .../src/graph/generated/docs/RemoteItem.md | 4 +- .../graph/generated/docs/SignInActivity.md | 2 +- .../src/graph/generated/docs/Trash.md | 2 +- .../graph/generated/models/ActivityTimes.ts | 8 +- .../generated/models/AppRoleAssignment.ts | 14 +- .../src/graph/generated/models/Drive.ts | 10 +- .../src/graph/generated/models/DriveItem.ts | 10 +- .../generated/models/DriveItemCreateLink.ts | 8 +- .../graph/generated/models/DriveItemInvite.ts | 8 +- .../src/graph/generated/models/DriveUpdate.ts | 10 +- .../graph/generated/models/EducationSchool.ts | 8 +- .../graph/generated/models/FileSystemInfo.ts | 20 +-- .../src/graph/generated/models/Permission.ts | 14 +- .../src/graph/generated/models/Photo.ts | 8 +- .../src/graph/generated/models/RemoteItem.ts | 14 +- .../graph/generated/models/SignInActivity.ts | 8 +- .../src/graph/generated/models/Trash.ts | 8 +- .../web-client/src/graph/groups/groups.ts | 62 +++---- web/packages/web-client/src/graph/index.ts | 37 +++-- .../src/graph/permissions/permissions.ts | 155 ++++++++---------- .../web-client/src/graph/tags/tags.ts | 16 +- web/packages/web-client/src/graph/types.ts | 34 +++- .../web-client/src/graph/users/users.ts | 106 ++++++------ 39 files changed, 375 insertions(+), 366 deletions(-) diff --git a/web/packages/web-client/package.json b/web/packages/web-client/package.json index aaf5c6ea804..7036c5d9a45 100644 --- a/web/packages/web-client/package.json +++ b/web/packages/web-client/package.json @@ -75,7 +75,7 @@ } }, "scripts": { - "generate-openapi": "rm -rf src/graph/generated && docker run --rm -v \"${PWD}/src/graph:/local\" openapitools/openapi-generator-cli generate -i https://raw.githubusercontent.com/owncloud/libre-graph-api/main/api/openapi-spec/v1.0.yaml -g typescript-fetch -o /local/generated", + "generate-openapi": "rm -rf src/graph/generated && docker run --rm -v \"${PWD}/src/graph:/local\" openapitools/openapi-generator-cli generate -i https://raw.githubusercontent.com/owncloud/libre-graph-api/main/api/openapi-spec/v1.0.yaml -g typescript-fetch --type-mappings=DateTime=string -o /local/generated", "vite": "vite", "prepublishOnly": "rm -rf ./package && clean-publish && rm -rf package/dist/tests && find package && cat package/package.json", "postpublish": "rm -rf ./package", diff --git a/web/packages/web-client/src/graph/activities/activities.ts b/web/packages/web-client/src/graph/activities/activities.ts index 14b1b391677..aa33f1976b5 100644 --- a/web/packages/web-client/src/graph/activities/activities.ts +++ b/web/packages/web-client/src/graph/activities/activities.ts @@ -1,18 +1,16 @@ -import { ActivitiesApiFactory } from './../generated' -import type { GraphFactoryOptions } from './../types' +import { ActivitiesApi } from './../generated' +import { toInitOverrides, type GraphFactoryOptions } from './../types' import type { GraphActivities } from './types' -export const ActivitiesFactory = ({ - axiosClient, - config -}: GraphFactoryOptions): GraphActivities => { - const activitiesApiFactory = ActivitiesApiFactory(config, config.basePath, axiosClient) +export const ActivitiesFactory = ({ config }: GraphFactoryOptions): GraphActivities => { + const activitiesApi = new ActivitiesApi(config) return { async listActivities(kqlTerm, requestOptions) { - const { - data: { value } - } = await activitiesApiFactory.getActivities(kqlTerm, requestOptions) + const { value } = await activitiesApi.getActivities( + { kql: kqlTerm }, + toInitOverrides(requestOptions) + ) return value || [] } } diff --git a/web/packages/web-client/src/graph/applications/applications.ts b/web/packages/web-client/src/graph/applications/applications.ts index 8040d954767..2b5b330e955 100644 --- a/web/packages/web-client/src/graph/applications/applications.ts +++ b/web/packages/web-client/src/graph/applications/applications.ts @@ -1,23 +1,20 @@ -import { ApplicationsApiFactory } from './../generated' -import type { GraphFactoryOptions } from './../types' +import { ApplicationsApi } from './../generated' +import { toInitOverrides, type GraphFactoryOptions } from './../types' import type { GraphApplications } from './types' -export const ApplicationsFactory = ({ - axiosClient, - config -}: GraphFactoryOptions): GraphApplications => { - const applicationsApiFactory = ApplicationsApiFactory(config, config.basePath, axiosClient) +export const ApplicationsFactory = ({ config }: GraphFactoryOptions): GraphApplications => { + const applicationsApi = new ApplicationsApi(config) return { async getApplication(id, requestOptions) { - const { data } = await applicationsApiFactory.getApplication(id, requestOptions) - return data + return await applicationsApi.getApplication( + { applicationId: id }, + toInitOverrides(requestOptions) + ) }, async listApplications(requestOptions) { - const { - data: { value } - } = await applicationsApiFactory.listApplications(requestOptions) + const { value } = await applicationsApi.listApplications(toInitOverrides(requestOptions)) return value || [] } } diff --git a/web/packages/web-client/src/graph/driveItems/driveItems.ts b/web/packages/web-client/src/graph/driveItems/driveItems.ts index b24df26adbc..67c99801add 100644 --- a/web/packages/web-client/src/graph/driveItems/driveItems.ts +++ b/web/packages/web-client/src/graph/driveItems/driveItems.ts @@ -1,51 +1,45 @@ -import { DriveItemApiFactory, DrivesRootApiFactory, MeDriveApiFactory } from './../generated' -import type { GraphFactoryOptions } from './../types' +import { DriveItemApi, DrivesRootApi, MeDriveApi } from './../generated' +import { toInitOverrides, type GraphFactoryOptions } from './../types' import type { GraphDriveItems } from './types' -export const DriveItemsFactory = ({ - axiosClient, - config -}: GraphFactoryOptions): GraphDriveItems => { - const driveItemApiFactory = DriveItemApiFactory(config, config.basePath, axiosClient) - const drivesRootApiFactory = DrivesRootApiFactory(config, config.basePath, axiosClient) - const meDriveApiFactory = MeDriveApiFactory(config, config.basePath, axiosClient) +export const DriveItemsFactory = ({ config }: GraphFactoryOptions): GraphDriveItems => { + const driveItemApi = new DriveItemApi(config) + const drivesRootApi = new DrivesRootApi(config) + const meDriveApi = new MeDriveApi(config) return { async getDriveItem(driveId, itemId, requestOptions) { - const { data } = await driveItemApiFactory.getDriveItem(driveId, itemId, requestOptions) - return data + return await driveItemApi.getDriveItem( + { driveId, itemId }, + toInitOverrides(requestOptions) + ) }, async createDriveItem(driveId, data, requestOptions) { - const { data: driveItem } = await drivesRootApiFactory.createDriveItem( - driveId, - data, - requestOptions + return await drivesRootApi.createDriveItem( + { driveId, driveItem: data }, + toInitOverrides(requestOptions) ) - return driveItem }, async updateDriveItem(driveId, itemId, data, requestOptions) { - const { data: driveItem } = await driveItemApiFactory.updateDriveItem( - driveId, - itemId, - data, - requestOptions + return await driveItemApi.updateDriveItem( + { driveId, itemId, driveItem: data }, + toInitOverrides(requestOptions) ) - return driveItem }, async deleteDriveItem(driveId, itemId, requestOptions) { - await driveItemApiFactory.deleteDriveItem(driveId, itemId, requestOptions) + await driveItemApi.deleteDriveItem({ driveId, itemId }, toInitOverrides(requestOptions)) }, async listSharedByMe(requestOptions) { - const { data } = await meDriveApiFactory.listSharedByMe(requestOptions) + const data = await meDriveApi.listSharedByMe(toInitOverrides(requestOptions)) return data?.value || [] }, async listSharedWithMe(requestOptions) { - const { data } = await meDriveApiFactory.listSharedWithMe(requestOptions) + const data = await meDriveApi.listSharedWithMe(toInitOverrides(requestOptions)) return data?.value || [] } } diff --git a/web/packages/web-client/src/graph/drives/drives.ts b/web/packages/web-client/src/graph/drives/drives.ts index f43cdf089b8..8b1afa1167c 100644 --- a/web/packages/web-client/src/graph/drives/drives.ts +++ b/web/packages/web-client/src/graph/drives/drives.ts @@ -1,56 +1,64 @@ import { buildSpace } from '../../helpers' -import { Drive, DrivesApiFactory, DrivesGetDrivesApi, MeDrivesApi } from './../generated' -import type { GraphFactoryOptions } from './../types' +import { Drive, DrivesApi, DrivesGetDrivesApi, MeDrivesApi } from './../generated' +import { toInitOverrides, type GraphFactoryOptions } from './../types' import type { GraphDrives } from './types' const getServerUrlFromDrive = (drive: Drive) => new URL(drive.webUrl).origin -export const DrivesFactory = ({ axiosClient, config }: GraphFactoryOptions): GraphDrives => { - const drivesApiFactory = DrivesApiFactory(config, config.basePath, axiosClient) - const meDrivesApi = new MeDrivesApi(config, config.basePath, axiosClient) - const allDrivesApi = new DrivesGetDrivesApi(config, config.basePath, axiosClient) +export const DrivesFactory = ({ config }: GraphFactoryOptions): GraphDrives => { + const drivesApi = new DrivesApi(config) + const meDrivesApi = new MeDrivesApi(config) + const allDrivesApi = new DrivesGetDrivesApi(config) return { async getDrive(id, graphRoles, requestOptions) { - const { data: drive } = await drivesApiFactory.getDriveBeta(id, requestOptions) + const drive = await drivesApi.getDriveBeta({ driveId: id }, toInitOverrides(requestOptions)) return buildSpace({ ...drive, serverUrl: getServerUrlFromDrive(drive) }, graphRoles) }, async createDrive(data, graphRoles, requestOptions) { - const { data: drive } = await drivesApiFactory.createDriveBeta(data, requestOptions) + const drive = await drivesApi.createDriveBeta( + { drive: data }, + toInitOverrides(requestOptions) + ) return buildSpace({ ...drive, serverUrl: getServerUrlFromDrive(drive) }, graphRoles) }, async updateDrive(id, data, graphRoles, requestOptions) { - const { data: drive } = await drivesApiFactory.updateDriveBeta(id, data, requestOptions) + const drive = await drivesApi.updateDriveBeta( + { driveId: id, driveUpdate: data }, + toInitOverrides(requestOptions) + ) return buildSpace({ ...drive, serverUrl: getServerUrlFromDrive(drive) }, graphRoles) }, async disableDrive(id, ifMatch, requestOptions) { - await drivesApiFactory.deleteDriveBeta(id, ifMatch, requestOptions) + await drivesApi.deleteDriveBeta({ driveId: id, ifMatch }, toInitOverrides(requestOptions)) }, async deleteDrive(id, ifMatch, requestOptions) { - await drivesApiFactory.deleteDriveBeta(id, ifMatch, { - headers: { - ...((requestOptions?.headers && requestOptions.headers) || {}), - Purge: 'T' - }, - ...((requestOptions && { requestOptions }) || {}) - }) + await drivesApi.deleteDriveBeta( + { driveId: id, ifMatch }, + toInitOverrides({ + ...requestOptions, + headers: { ...(requestOptions?.headers || {}), Purge: 'T' } + }) + ) }, async listMyDrives(graphRoles, options, requestOptions) { - const { - data: { value } - } = await meDrivesApi.listMyDrivesBeta(options?.orderBy, options?.filter, requestOptions) + const { value } = await meDrivesApi.listMyDrivesBeta( + { $orderby: options?.orderBy, $filter: options?.filter }, + toInitOverrides(requestOptions) + ) return value.map((d) => buildSpace({ ...d, serverUrl: getServerUrlFromDrive(d) }, graphRoles)) }, async listAllDrives(graphRoles, options, requestOptions) { - const { - data: { value } - } = await allDrivesApi.listAllDrivesBeta(options?.orderBy, options?.filter, requestOptions) + const { value } = await allDrivesApi.listAllDrivesBeta( + { $orderby: options?.orderBy, $filter: options?.filter }, + toInitOverrides(requestOptions) + ) return value.map((d) => buildSpace({ ...d, serverUrl: getServerUrlFromDrive(d) }, graphRoles)) } } diff --git a/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md b/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md index beca76ff325..d81a6dfcb04 100644 --- a/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md +++ b/web/packages/web-client/src/graph/generated/docs/ActivityTimes.md @@ -6,7 +6,7 @@ Name | Type ------------ | ------------- -`recordedTime` | Date +`recordedTime` | string ## Example diff --git a/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md b/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md index 45e0b2f0732..fc463eba213 100644 --- a/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md +++ b/web/packages/web-client/src/graph/generated/docs/AppRoleAssignment.md @@ -7,9 +7,9 @@ Name | Type ------------ | ------------- `id` | string -`deletedDateTime` | Date +`deletedDateTime` | string `appRoleId` | string -`createdDateTime` | Date +`createdDateTime` | string `principalDisplayName` | string `principalId` | string `principalType` | string diff --git a/web/packages/web-client/src/graph/generated/docs/Drive.md b/web/packages/web-client/src/graph/generated/docs/Drive.md index 0a28dfaf355..02fbc75c69e 100644 --- a/web/packages/web-client/src/graph/generated/docs/Drive.md +++ b/web/packages/web-client/src/graph/generated/docs/Drive.md @@ -9,11 +9,11 @@ Name | Type ------------ | ------------- `id` | string `createdBy` | [IdentitySet](IdentitySet.md) -`createdDateTime` | Date +`createdDateTime` | string `description` | string `eTag` | string `lastModifiedBy` | [IdentitySet](IdentitySet.md) -`lastModifiedDateTime` | Date +`lastModifiedDateTime` | string `name` | string `parentReference` | [ItemReference](ItemReference.md) `webUrl` | string diff --git a/web/packages/web-client/src/graph/generated/docs/DriveItem.md b/web/packages/web-client/src/graph/generated/docs/DriveItem.md index 4b318e3259b..6dcc77b4925 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveItem.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveItem.md @@ -9,11 +9,11 @@ Name | Type ------------ | ------------- `id` | string `createdBy` | [IdentitySet](IdentitySet.md) -`createdDateTime` | Date +`createdDateTime` | string `description` | string `eTag` | string `lastModifiedBy` | [IdentitySet](IdentitySet.md) -`lastModifiedDateTime` | Date +`lastModifiedDateTime` | string `name` | string `parentReference` | [ItemReference](ItemReference.md) `webUrl` | string diff --git a/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md b/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md index afbe0593d8f..3bab5b3c016 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveItemCreateLink.md @@ -7,7 +7,7 @@ Name | Type ------------ | ------------- `type` | [SharingLinkType](SharingLinkType.md) -`expirationDateTime` | Date +`expirationDateTime` | string `password` | string `displayName` | string `atLibreGraphQuickLink` | boolean diff --git a/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md b/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md index 4d22e06ca31..ffe46713d14 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveItemInvite.md @@ -9,7 +9,7 @@ Name | Type `recipients` | [Array<DriveRecipient>](DriveRecipient.md) `roles` | Array<string> `atLibreGraphPermissionsActions` | Array<string> -`expirationDateTime` | Date +`expirationDateTime` | string ## Example diff --git a/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md b/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md index 682b1cb447b..8dd5792d36c 100644 --- a/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md +++ b/web/packages/web-client/src/graph/generated/docs/DriveUpdate.md @@ -9,11 +9,11 @@ Name | Type ------------ | ------------- `id` | string `createdBy` | [IdentitySet](IdentitySet.md) -`createdDateTime` | Date +`createdDateTime` | string `description` | string `eTag` | string `lastModifiedBy` | [IdentitySet](IdentitySet.md) -`lastModifiedDateTime` | Date +`lastModifiedDateTime` | string `name` | string `parentReference` | [ItemReference](ItemReference.md) `webUrl` | string diff --git a/web/packages/web-client/src/graph/generated/docs/EducationSchool.md b/web/packages/web-client/src/graph/generated/docs/EducationSchool.md index a0f7f28b5ea..a2619bf6983 100644 --- a/web/packages/web-client/src/graph/generated/docs/EducationSchool.md +++ b/web/packages/web-client/src/graph/generated/docs/EducationSchool.md @@ -10,7 +10,7 @@ Name | Type `id` | string `displayName` | string `schoolNumber` | string -`terminationDate` | Date +`terminationDate` | string ## Example diff --git a/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md b/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md index 071098e16b3..00ac58ba21f 100644 --- a/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md +++ b/web/packages/web-client/src/graph/generated/docs/FileSystemInfo.md @@ -7,9 +7,9 @@ File system information on client. Read-write. Name | Type ------------ | ------------- -`createdDateTime` | Date -`lastAccessedDateTime` | Date -`lastModifiedDateTime` | Date +`createdDateTime` | string +`lastAccessedDateTime` | string +`lastModifiedDateTime` | string ## Example diff --git a/web/packages/web-client/src/graph/generated/docs/Permission.md b/web/packages/web-client/src/graph/generated/docs/Permission.md index f1a043b0072..8ff4b2883ab 100644 --- a/web/packages/web-client/src/graph/generated/docs/Permission.md +++ b/web/packages/web-client/src/graph/generated/docs/Permission.md @@ -9,8 +9,8 @@ Name | Type ------------ | ------------- `id` | string `hasPassword` | boolean -`expirationDateTime` | Date -`createdDateTime` | Date +`expirationDateTime` | string +`createdDateTime` | string `grantedToV2` | [SharePointIdentitySet](SharePointIdentitySet.md) `link` | [SharingLink](SharingLink.md) `roles` | Array<string> diff --git a/web/packages/web-client/src/graph/generated/docs/Photo.md b/web/packages/web-client/src/graph/generated/docs/Photo.md index 9c015e8a189..614b4bfd2fd 100644 --- a/web/packages/web-client/src/graph/generated/docs/Photo.md +++ b/web/packages/web-client/src/graph/generated/docs/Photo.md @@ -15,7 +15,7 @@ Name | Type `focalLength` | number `iso` | number `orientation` | number -`takenDateTime` | Date +`takenDateTime` | string ## Example diff --git a/web/packages/web-client/src/graph/generated/docs/RemoteItem.md b/web/packages/web-client/src/graph/generated/docs/RemoteItem.md index 76b466e7287..4772b5d93ee 100644 --- a/web/packages/web-client/src/graph/generated/docs/RemoteItem.md +++ b/web/packages/web-client/src/graph/generated/docs/RemoteItem.md @@ -8,7 +8,7 @@ Remote item data, if the item is shared from a drive other than the one being ac Name | Type ------------ | ------------- `createdBy` | [IdentitySet](IdentitySet.md) -`createdDateTime` | Date +`createdDateTime` | string `file` | [OpenGraphFile](OpenGraphFile.md) `fileSystemInfo` | [FileSystemInfo](FileSystemInfo.md) `folder` | [Folder](Folder.md) @@ -18,7 +18,7 @@ Name | Type `id` | string `image` | [Image](Image.md) `lastModifiedBy` | [IdentitySet](IdentitySet.md) -`lastModifiedDateTime` | Date +`lastModifiedDateTime` | string `name` | string `eTag` | string `cTag` | string diff --git a/web/packages/web-client/src/graph/generated/docs/SignInActivity.md b/web/packages/web-client/src/graph/generated/docs/SignInActivity.md index f55385a4922..2b1e816f52d 100644 --- a/web/packages/web-client/src/graph/generated/docs/SignInActivity.md +++ b/web/packages/web-client/src/graph/generated/docs/SignInActivity.md @@ -7,7 +7,7 @@ Provides the last successful sign-in attempt for a user Name | Type ------------ | ------------- -`lastSuccessfulSignInDateTime` | Date +`lastSuccessfulSignInDateTime` | string ## Example diff --git a/web/packages/web-client/src/graph/generated/docs/Trash.md b/web/packages/web-client/src/graph/generated/docs/Trash.md index 7466da10925..b9d561bf72b 100644 --- a/web/packages/web-client/src/graph/generated/docs/Trash.md +++ b/web/packages/web-client/src/graph/generated/docs/Trash.md @@ -8,7 +8,7 @@ Metadata for trashed drive Items Name | Type ------------ | ------------- `trashedBy` | [IdentitySet](IdentitySet.md) -`trashedDateTime` | Date +`trashedDateTime` | string ## Example diff --git a/web/packages/web-client/src/graph/generated/models/ActivityTimes.ts b/web/packages/web-client/src/graph/generated/models/ActivityTimes.ts index 72487095af2..31877900dc8 100644 --- a/web/packages/web-client/src/graph/generated/models/ActivityTimes.ts +++ b/web/packages/web-client/src/graph/generated/models/ActivityTimes.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -22,7 +22,7 @@ export interface ActivityTimes { /** * Timestamp of the activity. */ - recordedTime: Date; + recordedTime: string; } /** @@ -43,7 +43,7 @@ export function ActivityTimesFromJSONTyped(json: any, ignoreDiscriminator: boole } return { - 'recordedTime': (json['recordedTime'] == null ? json['recordedTime'] : parseDateTime(json['recordedTime'])), + 'recordedTime': json['recordedTime'], }; } @@ -58,7 +58,7 @@ export function ActivityTimesToJSONTyped(value?: ActivityTimes | null, ignoreDis return { - 'recordedTime': value['recordedTime'] == null ? value['recordedTime'] : serializeDateTime(value['recordedTime']), + 'recordedTime': value['recordedTime'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts b/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts index a4cc6e17b6e..467591fc59d 100644 --- a/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts +++ b/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -26,7 +26,7 @@ export interface AppRoleAssignment { /** * */ - deletedDateTime?: Date; + deletedDateTime?: string; /** * The identifier (id) for the app role which is assigned to the user. Required on create. */ @@ -34,7 +34,7 @@ export interface AppRoleAssignment { /** * The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. */ - createdDateTime?: Date | null; + createdDateTime?: string | null; /** * The display name of the user, group, or service principal that was granted the app role assignment. Read-only. */ @@ -78,9 +78,9 @@ export function AppRoleAssignmentFromJSONTyped(json: any, ignoreDiscriminator: b return { 'id': json['id'] == null ? undefined : json['id'], - 'deletedDateTime': json['deletedDateTime'] == null ? undefined : (parseDateTime(json['deletedDateTime'])), + 'deletedDateTime': json['deletedDateTime'] == null ? undefined : json['deletedDateTime'], 'appRoleId': json['appRoleId'], - 'createdDateTime': json['createdDateTime'] === undefined ? undefined : json['createdDateTime'] === null ? null : (parseDateTime(json['createdDateTime'])), + 'createdDateTime': json['createdDateTime'] === undefined ? undefined : json['createdDateTime'] === null ? null : json['createdDateTime'], 'principalDisplayName': json['principalDisplayName'] === undefined ? undefined : json['principalDisplayName'] === null ? null : json['principalDisplayName'], 'principalId': json['principalId'], 'principalType': json['principalType'] === undefined ? undefined : json['principalType'] === null ? null : json['principalType'], @@ -100,9 +100,9 @@ export function AppRoleAssignmentToJSONTyped(value?: Omit).map(DriveRecipientFromJSON)), 'roles': json['roles'] == null ? undefined : json['roles'], 'atLibreGraphPermissionsActions': json['@libre.graph.permissions.actions'] == null ? undefined : json['@libre.graph.permissions.actions'], - 'expirationDateTime': json['expirationDateTime'] == null ? undefined : (parseDateTime(json['expirationDateTime'])), + 'expirationDateTime': json['expirationDateTime'] == null ? undefined : json['expirationDateTime'], }; } @@ -83,7 +83,7 @@ export function DriveItemInviteToJSONTyped(value?: DriveItemInvite | null, ignor 'recipients': value['recipients'] == null ? undefined : ((value['recipients'] as Array).map(DriveRecipientToJSON)), 'roles': value['roles'], '@libre.graph.permissions.actions': value['atLibreGraphPermissionsActions'], - 'expirationDateTime': value['expirationDateTime'] == null ? value['expirationDateTime'] : serializeDateTime(value['expirationDateTime']), + 'expirationDateTime': value['expirationDateTime'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts b/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts index 7f6b6251465..d037d689c8b 100644 --- a/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts +++ b/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import { mapValues } from '../runtime'; import type { ItemReference } from './ItemReference'; import { ItemReferenceFromJSON, @@ -59,7 +59,7 @@ export interface DriveUpdate { /** * Date and time of item creation. Read-only. */ - readonly createdDateTime?: Date; + readonly createdDateTime?: string; /** * Provides a user-visible description of the item. Optional. */ @@ -75,7 +75,7 @@ export interface DriveUpdate { /** * Date and time the item was last modified. Read-only. */ - readonly lastModifiedDateTime?: Date; + readonly lastModifiedDateTime?: string; /** * The name of the item. Read-write. */ @@ -137,11 +137,11 @@ export function DriveUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean 'id': json['id'] == null ? undefined : json['id'], 'createdBy': json['createdBy'] == null ? undefined : IdentitySetFromJSON(json['createdBy']), - 'createdDateTime': json['createdDateTime'] == null ? undefined : (parseDateTime(json['createdDateTime'])), + 'createdDateTime': json['createdDateTime'] == null ? undefined : json['createdDateTime'], 'description': json['description'] == null ? undefined : json['description'], 'eTag': json['eTag'] == null ? undefined : json['eTag'], 'lastModifiedBy': json['lastModifiedBy'] == null ? undefined : IdentitySetFromJSON(json['lastModifiedBy']), - 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : (parseDateTime(json['lastModifiedDateTime'])), + 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : json['lastModifiedDateTime'], 'name': json['name'] == null ? undefined : json['name'], 'parentReference': json['parentReference'] == null ? undefined : ItemReferenceFromJSON(json['parentReference']), 'webUrl': json['webUrl'] == null ? undefined : json['webUrl'], diff --git a/web/packages/web-client/src/graph/generated/models/EducationSchool.ts b/web/packages/web-client/src/graph/generated/models/EducationSchool.ts index 293678c9ae2..799850471e0 100644 --- a/web/packages/web-client/src/graph/generated/models/EducationSchool.ts +++ b/web/packages/web-client/src/graph/generated/models/EducationSchool.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import { mapValues } from '../runtime'; /** * Represents a school * @export @@ -34,7 +34,7 @@ export interface EducationSchool { /** * Date and time at which the service for this organization is scheduled to be terminated */ - terminationDate?: Date | null; + terminationDate?: string | null; } /** @@ -57,7 +57,7 @@ export function EducationSchoolFromJSONTyped(json: any, ignoreDiscriminator: boo 'id': json['id'] == null ? undefined : json['id'], 'displayName': json['displayName'] == null ? undefined : json['displayName'], 'schoolNumber': json['schoolNumber'] == null ? undefined : json['schoolNumber'], - 'terminationDate': json['terminationDate'] === undefined ? undefined : json['terminationDate'] === null ? null : (parseDateTime(json['terminationDate'])), + 'terminationDate': json['terminationDate'] === undefined ? undefined : json['terminationDate'] === null ? null : json['terminationDate'], }; } @@ -74,7 +74,7 @@ export function EducationSchoolToJSONTyped(value?: Omit | 'displayName': value['displayName'], 'schoolNumber': value['schoolNumber'], - 'terminationDate': value['terminationDate'] == null ? value['terminationDate'] : serializeDateTime(value['terminationDate']), + 'terminationDate': value['terminationDate'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts b/web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts index c912e1be55e..d54c182a63d 100644 --- a/web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts +++ b/web/packages/web-client/src/graph/generated/models/FileSystemInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import { mapValues } from '../runtime'; /** * File system information on client. Read-write. * @export @@ -22,15 +22,15 @@ export interface FileSystemInfo { /** * The UTC date and time the file was created on a client. */ - createdDateTime?: Date; + createdDateTime?: string; /** * The UTC date and time the file was last accessed. Available for the recent file list only. */ - lastAccessedDateTime?: Date; + lastAccessedDateTime?: string; /** * The UTC date and time the file was last modified on a client. */ - lastModifiedDateTime?: Date; + lastModifiedDateTime?: string; } /** @@ -50,9 +50,9 @@ export function FileSystemInfoFromJSONTyped(json: any, ignoreDiscriminator: bool } return { - 'createdDateTime': json['createdDateTime'] == null ? undefined : (parseDateTime(json['createdDateTime'])), - 'lastAccessedDateTime': json['lastAccessedDateTime'] == null ? undefined : (parseDateTime(json['lastAccessedDateTime'])), - 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : (parseDateTime(json['lastModifiedDateTime'])), + 'createdDateTime': json['createdDateTime'] == null ? undefined : json['createdDateTime'], + 'lastAccessedDateTime': json['lastAccessedDateTime'] == null ? undefined : json['lastAccessedDateTime'], + 'lastModifiedDateTime': json['lastModifiedDateTime'] == null ? undefined : json['lastModifiedDateTime'], }; } @@ -67,9 +67,9 @@ export function FileSystemInfoToJSONTyped(value?: FileSystemInfo | null, ignoreD return { - 'createdDateTime': value['createdDateTime'] == null ? value['createdDateTime'] : serializeDateTime(value['createdDateTime']), - 'lastAccessedDateTime': value['lastAccessedDateTime'] == null ? value['lastAccessedDateTime'] : serializeDateTime(value['lastAccessedDateTime']), - 'lastModifiedDateTime': value['lastModifiedDateTime'] == null ? value['lastModifiedDateTime'] : serializeDateTime(value['lastModifiedDateTime']), + 'createdDateTime': value['createdDateTime'], + 'lastAccessedDateTime': value['lastAccessedDateTime'], + 'lastModifiedDateTime': value['lastModifiedDateTime'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/Permission.ts b/web/packages/web-client/src/graph/generated/models/Permission.ts index 1e99aea747b..2c95779b76e 100644 --- a/web/packages/web-client/src/graph/generated/models/Permission.ts +++ b/web/packages/web-client/src/graph/generated/models/Permission.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { mapValues, parseDate, parseDateTime, serializeDate, serializeDateTime } from '../runtime'; +import { mapValues } from '../runtime'; import type { SharingInvitation } from './SharingInvitation'; import { SharingInvitationFromJSON, @@ -70,11 +70,11 @@ export interface Permission { /** * An optional expiration date which limits the permission in time. */ - expirationDateTime?: Date | null; + expirationDateTime?: string | null; /** * An optional creation date. Libregraph only. */ - createdDateTime?: Date | null; + createdDateTime?: string | null; /** * */ @@ -121,8 +121,8 @@ export function PermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean) 'id': json['id'] == null ? undefined : json['id'], 'hasPassword': json['hasPassword'] == null ? undefined : json['hasPassword'], - 'expirationDateTime': json['expirationDateTime'] === undefined ? undefined : json['expirationDateTime'] === null ? null : (parseDateTime(json['expirationDateTime'])), - 'createdDateTime': json['createdDateTime'] === undefined ? undefined : json['createdDateTime'] === null ? null : (parseDateTime(json['createdDateTime'])), + 'expirationDateTime': json['expirationDateTime'] === undefined ? undefined : json['expirationDateTime'] === null ? null : json['expirationDateTime'], + 'createdDateTime': json['createdDateTime'] === undefined ? undefined : json['createdDateTime'] === null ? null : json['createdDateTime'], 'grantedToV2': json['grantedToV2'] == null ? undefined : SharePointIdentitySetFromJSON(json['grantedToV2']), 'link': json['link'] == null ? undefined : SharingLinkFromJSON(json['link']), 'roles': json['roles'] == null ? undefined : json['roles'], @@ -143,8 +143,8 @@ export function PermissionToJSONTyped(value?: Omit { - const groupApiFactory = GroupApiFactory(config, config.basePath, axiosClient) - const groupsApiFactory = GroupsApiFactory(config, config.basePath, axiosClient) +export const GroupsFactory = ({ config }: GraphFactoryOptions): GraphGroups => { + const groupApi = new GroupApi(config) + const groupsApi = new GroupsApi(config) return { async getGroup(id, options, requestOptions) { - const { data } = await groupApiFactory.getGroup( - id, - options?.select ? new Set([...options.select]) : null, - options?.expand ? new Set([...options.expand]) : new Set(['members']), - requestOptions + return await groupApi.getGroup( + { + groupId: id, + $select: options?.select ? new Set([...options.select]) : null, + $expand: options?.expand ? new Set([...options.expand]) : new Set(['members']) + }, + toInitOverrides(requestOptions) ) - return data }, async createGroup(data, requestOptions) { - const { data: group } = await groupsApiFactory.createGroup(data, requestOptions) - return group + return await groupsApi.createGroup({ group: data }, toInitOverrides(requestOptions)) }, async editGroup(id, data, requestOptions) { - const { data: group } = await groupApiFactory.updateGroup(id, data, requestOptions) - return group + await groupApi.updateGroup({ groupId: id, group: data }, toInitOverrides(requestOptions)) }, async deleteGroup(id, ifMatch, requestOptions) { - await groupApiFactory.deleteGroup(id, ifMatch, requestOptions) + await groupApi.deleteGroup({ groupId: id, ifMatch }, toInitOverrides(requestOptions)) }, async listGroups(options, requestOptions) { - const { - data: { value } - } = await groupsApiFactory.listGroups( - options?.search, - options?.orderBy ? new Set([...options.orderBy]) : null, - options?.select ? new Set([...options.select]) : null, - options?.expand ? new Set([...options.expand]) : null, - requestOptions + const { value } = await groupsApi.listGroups( + { + $search: options?.search, + $orderby: options?.orderBy ? new Set([...options.orderBy]) : null, + $select: options?.select ? new Set([...options.select]) : null, + $expand: options?.expand ? new Set([...options.expand]) : null + }, + toInitOverrides(requestOptions) ) return value }, async addMember(groupId, userId, requestOptions) { - await groupApiFactory.addMember( - groupId, - { '@odata.id': urlJoin(config.basePath, 'v1.0', 'users', userId) }, - requestOptions + await groupApi.addMember( + { + groupId, + memberReference: { atOdataId: urlJoin(config.basePath, 'v1.0', 'users', userId) } + }, + toInitOverrides(requestOptions) ) }, async deleteMember(groupId, userId, ifMatch, requestOptions) { - await groupApiFactory.deleteMember(groupId, userId, ifMatch, requestOptions) + await groupApi.deleteMember( + { groupId, directoryObjectId: userId, ifMatch }, + toInitOverrides(requestOptions) + ) } } } diff --git a/web/packages/web-client/src/graph/index.ts b/web/packages/web-client/src/graph/index.ts index 390d42b6e4b..25ae63ae3b8 100644 --- a/web/packages/web-client/src/graph/index.ts +++ b/web/packages/web-client/src/graph/index.ts @@ -1,5 +1,6 @@ -import { AxiosInstance } from 'axios' import { Configuration } from './generated' +import { FetchClient } from '../http' +import { undeclaredParams } from './types' import { type GraphUsers, UsersFactory } from './users' import { type GraphGroups, GroupsFactory } from './groups' import { ApplicationsFactory, GraphApplications } from './applications' @@ -20,21 +21,35 @@ export interface Graph { permissions: GraphPermissions } -export const graph = (baseURI: string, axiosClient: AxiosInstance): Graph => { +export const graph = (baseURI: string, httpClient: FetchClient): Graph => { const url = new URL(baseURI) url.pathname = [...url.pathname.split('/'), 'graph'].filter(Boolean).join('/') const config = new Configuration({ - basePath: url.href + basePath: url.href, + // Route every generated request through the core so header injection, maintenance + // detection and HttpError-on-non-2xx all apply. Because the core throws on non-2xx, + // callers keep seeing HttpError (with `statusCode` and `data`) rather than the + // generated ResponseError. + fetchApi: (input: RequestInfo | URL, init?: RequestInit) => { + const params = (init as Record>)?.[undeclaredParams] + return httpClient.fetch(String(input), { + method: init?.method, + headers: Object.fromEntries(new Headers(init?.headers).entries()), + body: init?.body, + signal: init?.signal ?? undefined, + ...(params && { params }) + }) + } }) return { - activities: ActivitiesFactory({ axiosClient, config }), - applications: ApplicationsFactory({ axiosClient, config }), - tags: TagsFactory({ axiosClient, config }), - drives: DrivesFactory({ axiosClient, config }), - driveItems: DriveItemsFactory({ axiosClient, config }), - users: UsersFactory({ axiosClient, config }), - groups: GroupsFactory({ axiosClient, config }), - permissions: PermissionsFactory({ axiosClient, config }) + activities: ActivitiesFactory({ httpClient, config }), + applications: ApplicationsFactory({ httpClient, config }), + tags: TagsFactory({ httpClient, config }), + drives: DrivesFactory({ httpClient, config }), + driveItems: DriveItemsFactory({ httpClient, config }), + users: UsersFactory({ httpClient, config }), + groups: GroupsFactory({ httpClient, config }), + permissions: PermissionsFactory({ httpClient, config }) } } diff --git a/web/packages/web-client/src/graph/permissions/permissions.ts b/web/packages/web-client/src/graph/permissions/permissions.ts index e8f7307629d..60ab8000cdf 100644 --- a/web/packages/web-client/src/graph/permissions/permissions.ts +++ b/web/packages/web-client/src/graph/permissions/permissions.ts @@ -7,26 +7,19 @@ import { } from '../../helpers' import { CollectionOfPermissionsWithAllowedValues, - DrivesPermissionsApiFactory, - DrivesRootApiFactory, + DrivesPermissionsApi, + DrivesRootApi, Permission, - RoleManagementApiFactory, + RoleManagementApi, UnifiedRoleDefinition } from './../generated' -import type { GraphFactoryOptions, GraphRequestOptions } from './../types' +import { toInitOverrides, type GraphFactoryOptions, type GraphRequestOptions } from './../types' import type { GraphPermissions } from './types' -export const PermissionsFactory = ({ - axiosClient, - config -}: GraphFactoryOptions): GraphPermissions => { - const drivesRootApiFactory = DrivesRootApiFactory(config, config.basePath, axiosClient) - const roleManagementApiFactory = RoleManagementApiFactory(config, config.basePath, axiosClient) - const drivesPermissionsApiFactory = DrivesPermissionsApiFactory( - config, - config.basePath, - axiosClient - ) +export const PermissionsFactory = ({ config }: GraphFactoryOptions): GraphPermissions => { + const drivesRootApi = new DrivesRootApi(config) + const roleManagementApi = new RoleManagementApi(config) + const drivesPermissionsApi = new DrivesPermissionsApi(config) return { async getPermission( @@ -36,11 +29,9 @@ export const PermissionsFactory = ({ graphRoles: Record, requestOptions: GraphRequestOptions ): Promise { - const { data: permission } = await drivesPermissionsApiFactory.getPermission( - driveId, - itemId, - permId, - requestOptions + const permission = await drivesPermissionsApi.getPermission( + { driveId, itemId, permId }, + toInitOverrides(requestOptions) ) if (permission.link) { @@ -58,27 +49,29 @@ export const PermissionsFactory = ({ let responseData: CollectionOfPermissionsWithAllowedValues if (driveId === itemId) { - const { data } = await drivesRootApiFactory.listPermissionsSpaceRoot( - driveId, - options?.filter, - options?.select ? new Set([...options.select]) : null, - requestOptions + responseData = await drivesRootApi.listPermissionsSpaceRoot( + { + driveId, + $filter: options?.filter, + $select: options?.select ? new Set([...options.select]) : null + }, + toInitOverrides(requestOptions) ) - responseData = data } else { - const { data } = await drivesPermissionsApiFactory.listPermissions( - driveId, - itemId, - options?.filter, - options?.select ? new Set([...options.select]) : null, - requestOptions + responseData = await drivesPermissionsApi.listPermissions( + { + driveId, + itemId, + $filter: options?.filter, + $select: options?.select ? new Set([...options.select]) : null + }, + toInitOverrides(requestOptions) ) - responseData = data } const permissions = responseData.value || [] - const allowedActions = responseData['@libre.graph.permissions.actions.allowedValues'] - const allowedRoles = responseData['@libre.graph.permissions.roles.allowedValues'] + const allowedActions = responseData.atLibreGraphPermissionsActionsAllowedValues + const allowedRoles = responseData.atLibreGraphPermissionsRolesAllowedValues const shares = permissions.map((permission) => { if (permission.link) { @@ -106,24 +99,15 @@ export const PermissionsFactory = ({ let permission: Permission if (driveId === itemId) { - const { data: perm } = await drivesRootApiFactory.updatePermissionSpaceRoot( - driveId, - permId, - data, - requestOptions + permission = await drivesRootApi.updatePermissionSpaceRoot( + { driveId, permId, permission: data }, + toInitOverrides(requestOptions) ) - - permission = perm } else { - const { data: perm } = await drivesPermissionsApiFactory.updatePermission( - driveId, - itemId, - permId, - data, - requestOptions + permission = await drivesPermissionsApi.updatePermission( + { driveId, itemId, permId, permission: data }, + toInitOverrides(requestOptions) ) - - permission = perm } if (permission.link) { @@ -139,30 +123,33 @@ export const PermissionsFactory = ({ async deletePermission(driveId, itemId, permId, requestOptions) { if (driveId === itemId) { - await drivesRootApiFactory.deletePermissionSpaceRoot(driveId, permId, requestOptions) + await drivesRootApi.deletePermissionSpaceRoot( + { driveId, permId }, + toInitOverrides(requestOptions) + ) return } - await drivesPermissionsApiFactory.deletePermission(driveId, itemId, permId, requestOptions) + await drivesPermissionsApi.deletePermission( + { driveId, itemId, permId }, + toInitOverrides(requestOptions) + ) }, async createInvite(driveId, itemId, data, graphRoles, requestOptions) { let permission: Permission | undefined if (driveId === itemId) { - const { data: perm } = await drivesRootApiFactory.inviteSpaceRoot( - driveId, - data, - requestOptions + const perm = await drivesRootApi.inviteSpaceRoot( + { driveId, driveItemInvite: data }, + toInitOverrides(requestOptions) ) permission = perm.value?.[0] } else { - const { data: perm } = await drivesPermissionsApiFactory.invite( - driveId, - itemId, - data, - requestOptions + const perm = await drivesPermissionsApi.invite( + { driveId, itemId, driveItemInvite: data }, + toInitOverrides(requestOptions) ) permission = perm.value?.[0] @@ -183,22 +170,15 @@ export const PermissionsFactory = ({ let permission: Permission if (driveId === itemId) { - const { data: perm } = await drivesRootApiFactory.createLinkSpaceRoot( - driveId, - data, - requestOptions + permission = await drivesRootApi.createLinkSpaceRoot( + { driveId, driveItemCreateLink: data }, + toInitOverrides(requestOptions) ) - - permission = perm } else { - const { data: perm } = await drivesPermissionsApiFactory.createLink( - driveId, - itemId, - data, - requestOptions + permission = await drivesPermissionsApi.createLink( + { driveId, itemId, driveItemCreateLink: data }, + toInitOverrides(requestOptions) ) - - permission = perm } return buildLinkShare({ graphPermission: permission, resourceId: itemId }) @@ -208,34 +188,27 @@ export const PermissionsFactory = ({ let permission: Permission if (driveId === itemId) { - const { data: perm } = await drivesRootApiFactory.setPermissionPasswordSpaceRoot( - driveId, - permId, - data, - requestOptions + permission = await drivesRootApi.setPermissionPasswordSpaceRoot( + { driveId, permId, sharingLinkPassword: data }, + toInitOverrides(requestOptions) ) - - permission = perm } else { - const { data: perm } = await drivesPermissionsApiFactory.setPermissionPassword( - driveId, - itemId, - permId, - data, - requestOptions + permission = await drivesPermissionsApi.setPermissionPassword( + { driveId, itemId, permId, sharingLinkPassword: data }, + toInitOverrides(requestOptions) ) - - permission = perm } return buildLinkShare({ graphPermission: permission, resourceId: itemId }) }, async listRoleDefinitions(requestOptions) { - const { data } = await roleManagementApiFactory.listPermissionRoleDefinitions(requestOptions) + const data = await roleManagementApi.listPermissionRoleDefinitions( + toInitOverrides(requestOptions) + ) // FIXME: graph type is wrong - return data as Promise + return data as UnifiedRoleDefinition[] } } } diff --git a/web/packages/web-client/src/graph/tags/tags.ts b/web/packages/web-client/src/graph/tags/tags.ts index 79586b5a153..26d3a895981 100644 --- a/web/packages/web-client/src/graph/tags/tags.ts +++ b/web/packages/web-client/src/graph/tags/tags.ts @@ -1,24 +1,22 @@ -import { TagsApiFactory } from './../generated' -import type { GraphFactoryOptions } from './../types' +import { TagsApi } from './../generated' +import { toInitOverrides, type GraphFactoryOptions } from './../types' import type { GraphTags } from './types' -export const TagsFactory = ({ axiosClient, config }: GraphFactoryOptions): GraphTags => { - const tagsApiFactory = TagsApiFactory(config, config.basePath, axiosClient) +export const TagsFactory = ({ config }: GraphFactoryOptions): GraphTags => { + const tagsApi = new TagsApi(config) return { async listTags(requestOptions) { - const { - data: { value } - } = await tagsApiFactory.getTags(requestOptions) + const { value } = await tagsApi.getTags(toInitOverrides(requestOptions)) return value || [] }, async assignTags(data, requestOptions) { - await tagsApiFactory.assignTags(data, requestOptions) + await tagsApi.assignTags({ tagAssignment: data }, toInitOverrides(requestOptions)) }, async unassignTags(data, requestOptions) { - await tagsApiFactory.unassignTags(data, requestOptions) + await tagsApi.unassignTags({ tagUnassignment: data }, toInitOverrides(requestOptions)) } } } diff --git a/web/packages/web-client/src/graph/types.ts b/web/packages/web-client/src/graph/types.ts index a98a3e2ad44..8d2466f38c8 100644 --- a/web/packages/web-client/src/graph/types.ts +++ b/web/packages/web-client/src/graph/types.ts @@ -1,13 +1,39 @@ -import type { AxiosInstance } from 'axios' -import type { Configuration } from './generated' +import type { Configuration, InitOverrideFunction } from './generated' +import type { FetchClient } from '../http' export interface GraphFactoryOptions { - axiosClient: AxiosInstance + httpClient: FetchClient config: Configuration } export interface GraphRequestOptions { headers?: Record - params?: Record signal?: AbortSignal + /** + * Query parameters the libre-graph spec does not declare, such as the `template` of a + * newly created drive. Declared parameters belong in the generated request object. + */ + params?: Record } + +/** + * Channel for {@link GraphRequestOptions.params}. The generated client assembles the URL + * before it applies `initOverrides`, so undeclared query parameters cannot reach it there. + * They ride along on the `RequestInit` instead and are unpacked by our `fetchApi` bridge. + */ +export const undeclaredParams = Symbol('graph.undeclaredParams') + +/** + * Adapts our request options to the generated client's `initOverrides`. + * + * A plain object would be spread shallowly over the generated `RequestInit`, replacing + * its headers wholesale and dropping `Content-Type`. A function receives the built init + * and can merge instead. + */ +export const toInitOverrides = + (options?: GraphRequestOptions): InitOverrideFunction => + async ({ init }) => ({ + ...(options?.signal && { signal: options.signal }), + ...(options?.params && { [undeclaredParams]: options.params }), + headers: { ...(init.headers as Record), ...(options?.headers ?? {}) } + }) diff --git a/web/packages/web-client/src/graph/users/users.ts b/web/packages/web-client/src/graph/users/users.ts index d48b42558aa..364713d32a3 100644 --- a/web/packages/web-client/src/graph/users/users.ts +++ b/web/packages/web-client/src/graph/users/users.ts @@ -1,97 +1,93 @@ import { - MeChangepasswordApiFactory, - MeUserApiFactory, - UserApiFactory, - UserAppRoleAssignmentApiFactory, - UsersApiFactory + MeChangepasswordApi, + MeUserApi, + UserApi, + UserAppRoleAssignmentApi, + UsersApi } from './../generated' -import type { GraphFactoryOptions } from './../types' +import { toInitOverrides, type GraphFactoryOptions } from './../types' import type { GraphUsers } from './types' -export const UsersFactory = ({ axiosClient, config }: GraphFactoryOptions): GraphUsers => { - const userApiFactory = UserApiFactory(config, config.basePath, axiosClient) - const usersApiFactory = UsersApiFactory(config, config.basePath, axiosClient) - const meUserApiFactory = MeUserApiFactory(config, config.basePath, axiosClient) - const meChangepasswordApiFactory = MeChangepasswordApiFactory( - config, - config.basePath, - axiosClient - ) - const userAppRoleAssignmentApiFactory = UserAppRoleAssignmentApiFactory( - config, - config.basePath, - axiosClient - ) +export const UsersFactory = ({ config }: GraphFactoryOptions): GraphUsers => { + const userApi = new UserApi(config) + const usersApi = new UsersApi(config) + const meUserApi = new MeUserApi(config) + const meChangepasswordApi = new MeChangepasswordApi(config) + const userAppRoleAssignmentApi = new UserAppRoleAssignmentApi(config) return { async getUser(id, options, requestOptions) { - const { data } = await userApiFactory.getUser( - id, - options?.select ? new Set([...options.select]) : null, - options?.expand - ? new Set([...options.expand]) - : new Set(['drive', 'memberOf', 'appRoleAssignments']), - requestOptions + return await userApi.getUser( + { + userId: id, + $select: options?.select ? new Set([...options.select]) : null, + $expand: options?.expand + ? new Set([...options.expand]) + : new Set(['drive', 'memberOf', 'appRoleAssignments']) + }, + toInitOverrides(requestOptions) ) - return data }, async createUser(data, requestOptions) { - const { data: user } = await usersApiFactory.createUser(data, requestOptions) - return user + return await usersApi.createUser({ user: data }, toInitOverrides(requestOptions)) }, async editUser(id, data, requestOptions) { - const { data: user } = await userApiFactory.updateUser(id, data, requestOptions) - return user + return await userApi.updateUser( + { userId: id, userUpdate: data }, + toInitOverrides(requestOptions) + ) }, async deleteUser(id, ifMatch, requestOptions) { - await userApiFactory.deleteUser(id, ifMatch, requestOptions) + await userApi.deleteUser({ userId: id, ifMatch }, toInitOverrides(requestOptions)) }, async listUsers(options, requestOptions) { - const { - data: { value } - } = await usersApiFactory.listUsers( - options?.search, - options?.filter, - options?.orderBy ? new Set([...options.orderBy]) : null, - options?.select ? new Set([...options.select]) : null, - options?.expand ? new Set([...options.expand]) : null, - requestOptions + const { value } = await usersApi.listUsers( + { + $search: options?.search, + $filter: options?.filter, + $orderby: options?.orderBy ? new Set([...options.orderBy]) : null, + $select: options?.select ? new Set([...options.select]) : null, + $expand: options?.expand ? new Set([...options.expand]) : null + }, + toInitOverrides(requestOptions) ) return value }, async getMe(options, requestOptions) { - const { data } = await meUserApiFactory.getOwnUser( - options?.expand ? new Set([...options.expand]) : new Set(['memberOf']), - requestOptions + return await meUserApi.getOwnUser( + { $expand: options?.expand ? new Set([...options.expand]) : new Set(['memberOf']) }, + toInitOverrides(requestOptions) ) - return data }, async editMe(user, requestOptions) { - const { data } = await meUserApiFactory.updateOwnUser(user, requestOptions) - return data + return await meUserApi.updateOwnUser({ userUpdate: user }, toInitOverrides(requestOptions)) }, async changeOwnPassword(change, requestOptions) { - await meChangepasswordApiFactory.changeOwnPassword(change, requestOptions) + await meChangepasswordApi.changeOwnPassword( + { passwordChange: change }, + toInitOverrides(requestOptions) + ) }, async exportPersonalData(id, destination, requestOptions) { - await userApiFactory.exportPersonalData(id, destination, requestOptions) + await userApi.exportPersonalData( + { userId: id, exportPersonalDataRequest: destination }, + toInitOverrides(requestOptions) + ) }, async createUserAppRoleAssignment(id, roleAssignment, requestOptions) { - const { data } = await userAppRoleAssignmentApiFactory.userCreateAppRoleAssignments( - id, - roleAssignment, - requestOptions + return await userAppRoleAssignmentApi.userCreateAppRoleAssignments( + { userId: id, appRoleAssignment: roleAssignment }, + toInitOverrides(requestOptions) ) - return data } } } From 58b989029a94f6a0ceb6b844986e0c1c096dadc1 Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 10:34:03 +0200 Subject: [PATCH 11/19] refactor: use the generated property names for OData-annotated graph fields The typescript-fetch template emits real JSON serializers, so annotated fields like `@libre.graph.permissions.actions`, `@odata.id`, `@UI.Hidden` and `@client.synchronize` are mapped to camelCase properties on the way in and back to their wire names on the way out. The wire format is unchanged; only the TypeScript-side names are. Reads left on the old names would have silently resolved to `undefined`, and writes would have been dropped. The OData `$filter` expression in FileSideBar keeps its annotated spelling, being a query value rather than a property. Response-only fields are now `readonly`, which the editable copies and test fixtures built from them need to opt out of, hence `writeable()`. --- .../components/Users/SideBar/EditPanel.vue | 5 +-- .../InviteCollaboratorForm.vue | 2 +- .../Spaces/SpaceContextActions.spec.ts | 2 +- web/packages/web-client/src/helpers/index.ts | 1 + .../web-client/src/helpers/share/functions.ts | 22 ++++++------ .../web-client/src/helpers/space/functions.ts | 9 ++--- .../web-client/src/helpers/writeable.ts | 20 +++++++++++ .../unit/helpers/share/functions.spec.ts | 34 +++++++++---------- .../unit/helpers/space/functions.spec.ts | 2 +- .../src/components/CreateLinkModal.vue | 2 +- .../actions/files/useFileActionsCreateLink.ts | 2 +- .../files/useFileActionsToggleHideShare.ts | 2 +- .../composables/piniaStores/shares/shares.ts | 2 +- .../composables/piniaStores/shares/types.ts | 2 +- .../services/folder/loaders/loaderSpace.ts | 4 +-- .../src/pages/resolvePrivateLink.vue | 2 +- .../unit/pages/resolvePrivateLink.spec.ts | 2 +- 17 files changed, 69 insertions(+), 46 deletions(-) create mode 100644 web/packages/web-client/src/helpers/writeable.ts diff --git a/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue b/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue index 77d16ea9913..d0c5a41ab32 100644 --- a/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue +++ b/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue @@ -125,6 +125,7 @@ import { import GroupSelect from '../GroupSelect.vue' import { cloneDeep, isEmpty, isEqual, omit } from 'lodash-es' import { AppRole, AppRoleAssignment, Group, User } from '@ownclouders/web-client/graph/generated' +import { writeable } from '@ownclouders/web-client' import { MaybeRef, useClientService } from '@ownclouders/web-pkg' import { storeToRefs } from 'pinia' import { diff } from 'deep-object-diff' @@ -166,10 +167,10 @@ const formData = ref({ } }) function changeSelectedQuotaOption(option: { value: number; displayValue: string }) { - unref(editUser).drive.quota.total = option.value + writeable(unref(editUser).drive.quota).total = option.value } function changeSelectedGroupOption(option: Group[]) { - unref(editUser).memberOf = option + writeable(unref(editUser)).memberOf = option } async function validateUserName() { unref(formData).userName.valid = false diff --git a/web/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/InviteCollaboratorForm.vue b/web/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/InviteCollaboratorForm.vue index 37678cfdc7f..df91034d372 100644 --- a/web/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/InviteCollaboratorForm.vue +++ b/web/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/InviteCollaboratorForm.vue @@ -373,7 +373,7 @@ const share = async () => { recipients: [ { objectId: id, - '@libre.graph.recipient.type': type + atLibreGraphRecipientType: type } ] } diff --git a/web/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts b/web/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts index 26493f387cf..82a2b58fd3e 100644 --- a/web/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts +++ b/web/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts @@ -12,7 +12,7 @@ import { Drive } from '@ownclouders/web-client/graph/generated' const spaceMock = mock({ id: '1', root: { - permissions: [{ '@libre.graph.permissions.actions': [], grantedToV2: { user: { id: '1' } } }] + permissions: [{ atLibreGraphPermissionsActions: [], grantedToV2: { user: { id: '1' } } }] }, driveType: 'project', special: null diff --git a/web/packages/web-client/src/helpers/index.ts b/web/packages/web-client/src/helpers/index.ts index 6f63f917cf6..6c46e119470 100644 --- a/web/packages/web-client/src/helpers/index.ts +++ b/web/packages/web-client/src/helpers/index.ts @@ -6,3 +6,4 @@ export * from './resource' export * from './share' export * from './space' export * from './maintenance' +export * from './writeable' diff --git a/web/packages/web-client/src/helpers/share/functions.ts b/web/packages/web-client/src/helpers/share/functions.ts index e5fa6877b88..62df10b9170 100644 --- a/web/packages/web-client/src/helpers/share/functions.ts +++ b/web/packages/web-client/src/helpers/share/functions.ts @@ -67,7 +67,7 @@ export const getShareResourcePermissions = ({ // the server lists plain permissions if it doesn't find a corresponding role const permissions = driveItem.remoteItem?.permissions.reduce( (acc, permission) => { - const permissions = permission['@libre.graph.permissions.actions'] as GraphSharePermission[] + const permissions = permission.atLibreGraphPermissionsActions as GraphSharePermission[] if (permissions) { acc.push(...permissions) } @@ -119,7 +119,7 @@ export function buildIncomingShareResource({ }, []) let shareTypes = uniq(driveItem.remoteItem.permissions.map(getShareTypeFromPermission)) - const isExternal = sharedBy.some((s) => s['@libre.graph.userType'] === 'Federated') + const isExternal = sharedBy.some((s) => s.atLibreGraphUserType === 'Federated') if (isExternal) { shareTypes = [ShareTypes.remote.value] } @@ -150,14 +150,14 @@ export function buildIncomingShareResource({ mdate: driveItem.lastModifiedDateTime ? new Date(driveItem.lastModifiedDateTime).toUTCString() : undefined, - syncEnabled: driveItem['@client.synchronize'], - hidden: driveItem['@UI.Hidden'], + syncEnabled: driveItem.atClientSynchronize, + hidden: driveItem.atUIHidden, shareRoles, sharePermissions, outgoing: false, privateLink: urlJoin(serverUrl, 'f', driveItem.remoteItem.id), spaceId: driveItem.remoteItem.spaceId, - canRename: () => driveItem['@client.synchronize'], + canRename: () => driveItem.atClientSynchronize, canDownload: () => sharePermissions.includes(GraphSharePermission.readContent), canUpload: () => sharePermissions.includes(GraphSharePermission.createUpload), canCreate: () => sharePermissions.includes(GraphSharePermission.createChildren), @@ -209,7 +209,7 @@ export function buildOutgoingShareResource({ if (p.link) { return { id: p.id, - displayName: p.link['@libre.graph.displayName'], + displayName: p.link.atLibreGraphDisplayName, shareType: ShareTypes.link.value } } @@ -266,8 +266,8 @@ export function buildCollaboratorShare({ role, sharedBy: { id: invitedBy?.id, displayName: invitedBy?.displayName }, sharedWith: graphPermission.grantedToV2.user || graphPermission.grantedToV2.group, - permissions: (graphPermission['@libre.graph.permissions.actions'] - ? graphPermission['@libre.graph.permissions.actions'] + permissions: (graphPermission.atLibreGraphPermissionsActions + ? graphPermission.atLibreGraphPermissionsActions : role.rolePermissions.flatMap((p) => p.allowedResourceActions)) as GraphSharePermission[], createdDateTime: graphPermission.createdDateTime, expirationDateTime: graphPermission.expirationDateTime @@ -294,8 +294,8 @@ export function buildLinkShare({ hasPassword: graphPermission.hasPassword, createdDateTime: graphPermission.createdDateTime, expirationDateTime: graphPermission.expirationDateTime, - displayName: graphPermission.link['@libre.graph.displayName'], - isQuickLink: graphPermission.link['@libre.graph.quickLink'], + displayName: graphPermission.link.atLibreGraphDisplayName, + isQuickLink: graphPermission.link.atLibreGraphQuickLink, type: graphPermission.link.type, webUrl: graphPermission.link.webUrl, preventsDownload: graphPermission.link.preventsDownload @@ -309,7 +309,7 @@ function getShareTypeFromPermission({ link, grantedToV2 }: Permission) { if (grantedToV2?.group) { return ShareTypes.group.value } - if (grantedToV2?.user?.['@libre.graph.userType'] === 'Federated') { + if (grantedToV2?.user?.atLibreGraphUserType === 'Federated') { return ShareTypes.remote.value } return ShareTypes.user.value diff --git a/web/packages/web-client/src/helpers/space/functions.ts b/web/packages/web-client/src/helpers/space/functions.ts index c16825424f3..6beb9ef3e6a 100644 --- a/web/packages/web-client/src/helpers/space/functions.ts +++ b/web/packages/web-client/src/helpers/space/functions.ts @@ -20,6 +20,7 @@ import { buildWebDavPublicPath, buildWebDavOcmPath } from '../publicLink' import { urlJoin } from '../../utils' import { Drive, DriveItem } from '@ownclouders/web-client/graph/generated' import { GraphSharePermission, ShareRole } from '../share' +import { Writeable } from '../writeable' export function buildWebDavSpacesPath(storageId: string, path?: string) { return urlJoin('spaces', storageId, path, { @@ -139,7 +140,7 @@ export function buildSpace( }, graphRoles: Record ): SpaceResource { - let spaceImageData: DriveItem, spaceReadmeData: DriveItem + let spaceImageData: Writeable, spaceReadmeData: Writeable if (data.special) { spaceImageData = data.special.find((el) => el.specialFolder.name === 'image') spaceReadmeData = data.special.find((el) => el.specialFolder.name === 'readme') @@ -394,15 +395,15 @@ export function getPermissionsForSpaceMember(space: SpaceResource, user: User) { } /** - * Get array of permissions from a given graph permission object. If it has '@libre.graph.permissions.actions', + * Get array of permissions from a given graph permission object. If it has atLibreGraphPermissionsActions, * then no role exists for this set of permissions. Otherwise, the role is found in the graphRoles array. */ function getPermissionsFromGraphPermission( permission: Permission, graphRoles: Record ): string[] { - if (permission['@libre.graph.permissions.actions']) { - return permission['@libre.graph.permissions.actions'] + if (permission.atLibreGraphPermissionsActions) { + return permission.atLibreGraphPermissionsActions } const role = graphRoles[permission.roles?.[0]] if (role) { diff --git a/web/packages/web-client/src/helpers/writeable.ts b/web/packages/web-client/src/helpers/writeable.ts new file mode 100644 index 00000000000..b3dc14e29e3 --- /dev/null +++ b/web/packages/web-client/src/helpers/writeable.ts @@ -0,0 +1,20 @@ +/** + * Strips `readonly` from an object's own properties. + * + * The generated graph models mark response-only fields `readonly`, which is right for a + * server response but gets in the way of the editable copies and test fixtures we build + * from them. + */ +export type Writeable = { -readonly [K in keyof T]: T[K] } + +/** + * Views a value as {@link Writeable} so a single field can be assigned. + * + * Use it on the object that owns the field, not on the whole tree — `readonly` is stripped + * one level deep only, which keeps the escape hatch visible at each assignment: + * + * ```ts + * writeable(user.drive.quota).total = 42 + * ``` + */ +export const writeable = (value: T): Writeable => value diff --git a/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts b/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts index 822711c47d4..84984a08d0c 100644 --- a/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts +++ b/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts @@ -25,7 +25,7 @@ import { UnifiedRoleDefinition, User } from '../../../../src/graph/generated' -import { urlJoin } from '../../../../src' +import { urlJoin, writeable } from '../../../../src' describe('share helper functions', () => { describe('isShareResource', () => { @@ -76,7 +76,7 @@ describe('share helper functions', () => { describe('getShareResourceRoles', () => { it("returns all roles from a drive item's permissions that are also included in the graphRoles", () => { const driveItem = mockDeep() - driveItem.remoteItem.permissions = [{ roles: ['1', '2'] }, { roles: ['1', '3'] }] + writeable(driveItem.remoteItem).permissions = [{ roles: ['1', '2'] }, { roles: ['1', '3'] }] const graphRoles = { '1': mock({ id: '1' }), '4': mock({ id: '4' }) } const result = getShareResourceRoles({ driveItem, graphRoles }) @@ -101,9 +101,9 @@ describe('share helper functions', () => { it('returns permissions based on a drive item if no graph share roles given', () => { const permissions = ['view', 'edit'] const driveItem = mockDeep() - driveItem.remoteItem.permissions = [ - { '@libre.graph.permissions.actions': [permissions[0]] }, - { '@libre.graph.permissions.actions': [permissions[1]] } + writeable(driveItem.remoteItem).permissions = [ + { atLibreGraphPermissionsActions: [permissions[0]] }, + { atLibreGraphPermissionsActions: [permissions[1]] } ] const result = getShareResourcePermissions({ driveItem, shareRoles: [] }) @@ -116,7 +116,7 @@ describe('share helper functions', () => { const driveItem = mockDeep({ id: 'driveItemId', name: 'driveItemName' }) const sharedBy = { id: '1', displayName: 'user1' } as Identity const sharedWith = { id: '2', displayName: 'user2' } as Identity - driveItem.remoteItem.permissions = [ + writeable(driveItem.remoteItem).permissions = [ { roles: ['1', '2'], invitation: { invitedBy: { user: sharedBy } }, @@ -167,10 +167,10 @@ describe('share helper functions', () => { describe('buildOutgoingShareResource', () => { const driveItem = mockDeep({ id: 'driveItemId', name: 'driveItemName' }) - driveItem.parentReference.path = '' + writeable(driveItem.parentReference).path = '' const sharedBy = { id: '1', displayName: 'user1' } as Identity const sharedWith = { id: '2', displayName: 'user2' } as Identity - driveItem.permissions = [ + writeable(driveItem).permissions = [ { roles: ['1', '2'], invitation: { invitedBy: { user: sharedBy } }, @@ -219,7 +219,7 @@ describe('share helper functions', () => { const resourceId = '1' it('sets ids based on the permission and the given resource id', () => { - const graphPermission = mock({ '@libre.graph.permissions.actions': [] }) + const graphPermission = mock({ atLibreGraphPermissionsActions: [] }) const result = buildCollaboratorShare({ graphPermission, @@ -233,7 +233,7 @@ describe('share helper functions', () => { describe('share type', () => { it('is user type if grantedToV2 includes a user', () => { const graphPermission = mock({ - '@libre.graph.permissions.actions': [], + atLibreGraphPermissionsActions: [], grantedToV2: { user: {}, group: undefined }, link: undefined }) @@ -248,7 +248,7 @@ describe('share helper functions', () => { }) it('is group type if grantedToV2 includes a group', () => { const graphPermission = mock({ - '@libre.graph.permissions.actions': [], + atLibreGraphPermissionsActions: [], grantedToV2: { user: undefined, group: {} }, link: undefined }) @@ -263,8 +263,8 @@ describe('share helper functions', () => { }) it('is external type if grantedToV2 includes a user that is external', () => { const graphPermission = mock({ - '@libre.graph.permissions.actions': [], - grantedToV2: { user: { '@libre.graph.userType': 'Federated' }, group: undefined }, + atLibreGraphPermissionsActions: [], + grantedToV2: { user: { atLibreGraphUserType: 'Federated' }, group: undefined }, link: undefined }) @@ -281,7 +281,7 @@ describe('share helper functions', () => { it('sets permissions if given directly via property', () => { const permissions = ['view', 'edit'] const graphPermission = mock({ - '@libre.graph.permissions.actions': permissions + atLibreGraphPermissionsActions: permissions }) const result = buildCollaboratorShare({ @@ -294,7 +294,7 @@ describe('share helper functions', () => { }) it('sets permissions from the graph roles as fallback', () => { const graphPermission = mock({ - '@libre.graph.permissions.actions': undefined, + atLibreGraphPermissionsActions: undefined, roles: [graphRoles['1'].id] }) @@ -317,14 +317,14 @@ describe('share helper functions', () => { const resourceId = '1' it('sets ids based on the permission and the given resource id', () => { - const graphPermission = mock({ '@libre.graph.permissions.actions': [] }) + const graphPermission = mock({ atLibreGraphPermissionsActions: [] }) const result = buildLinkShare({ graphPermission, resourceId }) expect(result.id).toEqual(graphPermission.id) expect(result.resourceId).toEqual(resourceId) }) it('sets the sharing link type', () => { - const graphPermission = mock({ '@libre.graph.permissions.actions': [] }) + const graphPermission = mock({ atLibreGraphPermissionsActions: [] }) const result = buildLinkShare({ graphPermission, resourceId }) expect(result.shareType).toEqual(ShareTypes.link.value) diff --git a/web/packages/web-client/tests/unit/helpers/space/functions.spec.ts b/web/packages/web-client/tests/unit/helpers/space/functions.spec.ts index 0a2853a7b70..c7d4b7245c0 100644 --- a/web/packages/web-client/tests/unit/helpers/space/functions.spec.ts +++ b/web/packages/web-client/tests/unit/helpers/space/functions.spec.ts @@ -51,7 +51,7 @@ describe('buildSpace', () => { { roles: role ? [role.id] : [], grantedToV2: { user: { id } }, - ...(permissions.length && { '@libre.graph.permissions.actions': permissions }) + ...(permissions.length && { atLibreGraphPermissionsActions: permissions }) } ] } diff --git a/web/packages/web-pkg/src/components/CreateLinkModal.vue b/web/packages/web-pkg/src/components/CreateLinkModal.vue index ee86ea7ed30..66aa2858e36 100644 --- a/web/packages/web-pkg/src/components/CreateLinkModal.vue +++ b/web/packages/web-pkg/src/components/CreateLinkModal.vue @@ -190,7 +190,7 @@ const createLinks = () => { resource, options: { type: unref(selectedType), - '@libre.graph.quickLink': false, + atLibreGraphQuickLink: false, password: unref(password).value, expirationDateTime: unref(selectedExpiry)?.toISO(), displayName: $gettext('Unnamed link') diff --git a/web/packages/web-pkg/src/composables/actions/files/useFileActionsCreateLink.ts b/web/packages/web-pkg/src/composables/actions/files/useFileActionsCreateLink.ts index cb7c015acf0..a224eed9dbb 100644 --- a/web/packages/web-pkg/src/composables/actions/files/useFileActionsCreateLink.ts +++ b/web/packages/web-pkg/src/composables/actions/files/useFileActionsCreateLink.ts @@ -107,7 +107,7 @@ export const useFileActionsCreateLink = ({ space, resource, options: { - '@libre.graph.quickLink': false, + atLibreGraphQuickLink: false, displayName: $gettext('Unnamed link'), type: unref(defaultLinkType) } diff --git a/web/packages/web-pkg/src/composables/actions/files/useFileActionsToggleHideShare.ts b/web/packages/web-pkg/src/composables/actions/files/useFileActionsToggleHideShare.ts index 84f45a74d53..53d6a3c3048 100644 --- a/web/packages/web-pkg/src/composables/actions/files/useFileActionsToggleHideShare.ts +++ b/web/packages/web-pkg/src/composables/actions/files/useFileActionsToggleHideShare.ts @@ -34,7 +34,7 @@ export const useFileActionsToggleHideShare = () => { await clientService.graphAuthenticated.driveItems.updateDriveItem( resource.driveId, resource.id, - { '@UI.Hidden': hidden } + { atUIHidden: hidden } ) updateResourceField({ diff --git a/web/packages/web-pkg/src/composables/piniaStores/shares/shares.ts b/web/packages/web-pkg/src/composables/piniaStores/shares/shares.ts index 6a261038bbd..cdb8731dac4 100644 --- a/web/packages/web-pkg/src/composables/piniaStores/shares/shares.ts +++ b/web/packages/web-pkg/src/composables/piniaStores/shares/shares.ts @@ -247,7 +247,7 @@ export const useSharesStore = defineStore('shares', () => { link: { ...(options.type && { type: options.type }), ...(options.displayName && { - '@libre.graph.displayName': options.displayName + atLibreGraphDisplayName: options.displayName }) }, ...(Object.hasOwn(options, 'expirationDateTime') && { diff --git a/web/packages/web-pkg/src/composables/piniaStores/shares/types.ts b/web/packages/web-pkg/src/composables/piniaStores/shares/types.ts index d2cd923febf..f806e23291f 100644 --- a/web/packages/web-pkg/src/composables/piniaStores/shares/types.ts +++ b/web/packages/web-pkg/src/composables/piniaStores/shares/types.ts @@ -37,7 +37,7 @@ export interface UpdateLinkOptions { space: SpaceResource resource: Resource linkShare: LinkShare - options: Omit + options: Omit } export interface DeleteLinkOptions { diff --git a/web/packages/web-pkg/src/services/folder/loaders/loaderSpace.ts b/web/packages/web-pkg/src/services/folder/loaders/loaderSpace.ts index f555b0f7956..7de45d8ee1d 100644 --- a/web/packages/web-pkg/src/services/folder/loaders/loaderSpace.ts +++ b/web/packages/web-pkg/src/services/folder/loaders/loaderSpace.ts @@ -154,8 +154,8 @@ export class FolderLoaderSpace implements FolderLoader { const allPermissions: string[] = [] permissions.forEach((permission) => { - if (permission['@libre.graph.permissions.actions']) { - allPermissions.push(...permission['@libre.graph.permissions.actions']) + if (permission.atLibreGraphPermissionsActions) { + allPermissions.push(...permission.atLibreGraphPermissionsActions) return } const role = sharesStore.graphRoles[permission.roles[0]] diff --git a/web/packages/web-runtime/src/pages/resolvePrivateLink.vue b/web/packages/web-runtime/src/pages/resolvePrivateLink.vue index 6983187ad31..9d9bc718b96 100644 --- a/web/packages/web-runtime/src/pages/resolvePrivateLink.vue +++ b/web/packages/web-runtime/src/pages/resolvePrivateLink.vue @@ -143,7 +143,7 @@ export default defineComponent({ const driveItems = yield clientService.graphAuthenticated.driveItems.listSharedWithMe() const share = driveItems.find(({ remoteItem }) => remoteItem.id === resource.id) - isHiddenShare = share?.['@UI.Hidden'] + isHiddenShare = share?.atUIHidden } } diff --git a/web/packages/web-runtime/tests/unit/pages/resolvePrivateLink.spec.ts b/web/packages/web-runtime/tests/unit/pages/resolvePrivateLink.spec.ts index 81aec4b536b..705a9d50688 100644 --- a/web/packages/web-runtime/tests/unit/pages/resolvePrivateLink.spec.ts +++ b/web/packages/web-runtime/tests/unit/pages/resolvePrivateLink.spec.ts @@ -252,7 +252,7 @@ function getWrapper({ const mocks = { ...defaultComponentMocks() } mocks.$clientService.graphAuthenticated.driveItems.listSharedWithMe.mockResolvedValue([ - { remoteItem: { id: '1' }, '@UI.Hidden': hiddenShare } + { remoteItem: { id: '1' }, atUIHidden: hiddenShare } ]) return { From 1ba9398e7e7e64b463e8ead020148a3f634e416f Mon Sep 17 00:00:00 2001 From: Matteo Date: Fri, 28 Aug 2026 10:43:25 +0200 Subject: [PATCH 12/19] chore: drop the axios dependency Nothing imports axios any more, so remove it from the eight manifests that declared it and update the web-client README, whose usage examples still instantiated an axios client. Also applies prettier to the files touched over the course of the migration. --- .../change-replace-axios-with-fetch.md | 14 +++ .../web-app-admin-settings/package.json | 1 - web/packages/web-app-app-store/package.json | 1 - web/packages/web-app-files/package.json | 1 - .../tests/unit/helpers/user/avatarUrl.spec.ts | 12 +- web/packages/web-app-ocm/package.json | 1 - web/packages/web-client/README.md | 22 ++-- web/packages/web-client/package.json | 1 - web/packages/web-client/src/errors.ts | 7 +- .../src/graph/driveItems/driveItems.ts | 5 +- .../web-client/src/http/fetchClient.ts | 7 +- .../tests/unit/http/fetchClient.spec.ts | 22 ++-- web/packages/web-pkg/package.json | 1 - web/packages/web-pkg/src/http/client.ts | 5 +- .../web-pkg/src/services/client/client.ts | 5 +- .../tests/unit/services/archiver.spec.ts | 8 +- web/packages/web-runtime/package.json | 1 - .../web-runtime/tests/unit/App.spec.ts | 2 +- .../tests/unit/pages/account.spec.ts | 12 +- web/packages/web-test-helpers/package.json | 1 - .../src/mocks/httpResponse.ts | 6 +- web/pnpm-lock.yaml | 119 ------------------ 22 files changed, 64 insertions(+), 190 deletions(-) create mode 100644 changelog/unreleased/change-replace-axios-with-fetch.md diff --git a/changelog/unreleased/change-replace-axios-with-fetch.md b/changelog/unreleased/change-replace-axios-with-fetch.md new file mode 100644 index 00000000000..1e55df13ab9 --- /dev/null +++ b/changelog/unreleased/change-replace-axios-with-fetch.md @@ -0,0 +1,14 @@ +Change: Replace axios with the native fetch API in Web + +The Web frontend no longer depends on axios. All HTTP traffic now goes through a +single fetch-based client, and the libre-graph client is generated from the +`typescript-fetch` template instead of `typescript-axios`. + +Two changes are visible to consumers of the `@ownclouders/web-client` package. +The `graph` and `ocs` factories take a `FetchClient` where they previously took +an axios instance, and graph fields carrying an OData annotation are now exposed +under their generated camelCase names — `atLibreGraphPermissionsActions` for +`@libre.graph.permissions.actions`, and likewise for the other annotated fields. +The names sent over the wire are unchanged. + +https://github.com/owncloud/ocis/pull/TBD diff --git a/web/packages/web-app-admin-settings/package.json b/web/packages/web-app-admin-settings/package.json index 100e55f1e11..052bf664891 100644 --- a/web/packages/web-app-admin-settings/package.json +++ b/web/packages/web-app-admin-settings/package.json @@ -17,7 +17,6 @@ "@ownclouders/design-system": "workspace:^", "@ownclouders/web-client": "workspace:^", "@ownclouders/web-pkg": "workspace:^", - "axios": "^1.18.1", "email-validator": "^2.0.4", "fuse.js": "7.3.0", "lodash-es": "4.18.1", diff --git a/web/packages/web-app-app-store/package.json b/web/packages/web-app-app-store/package.json index 28fae750809..e73531791f0 100644 --- a/web/packages/web-app-app-store/package.json +++ b/web/packages/web-app-app-store/package.json @@ -14,7 +14,6 @@ "@ownclouders/design-system": "workspace:^", "@ownclouders/web-client": "workspace:*", "@ownclouders/web-pkg": "workspace:*", - "axios": "^1.18.1", "fuse.js": "7.3.0", "lodash-es": "4.18.1", "mark.js": "^8.11.1", diff --git a/web/packages/web-app-files/package.json b/web/packages/web-app-files/package.json index 1a9d10f5ffd..6dafe72c3d7 100644 --- a/web/packages/web-app-files/package.json +++ b/web/packages/web-app-files/package.json @@ -16,7 +16,6 @@ "@ownclouders/web-pkg": "workspace:*", "@uppy/core": "5.2.0", "@vueuse/core": "^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0", - "axios": "^1.18.1", "dompurify": "^3.4.2", "email-validator": "^2.0.4", "fuse.js": "7.3.0", diff --git a/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts b/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts index 9f37529e5f9..a95e7e3a527 100644 --- a/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts +++ b/web/packages/web-app-files/tests/unit/helpers/user/avatarUrl.spec.ts @@ -14,7 +14,9 @@ const getDefaultOptions = () => ({ describe('avatarUrl', () => { it('throws an error', async () => { const defaultOptions = getDefaultOptions() - defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue(mockHttpResponse({}, { status: 200 })) + defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue( + mockHttpResponse({}, { status: 200 }) + ) defaultOptions.clientService.ocs.signUrl.mockRejectedValue(new Error('error')) const avatarUrlPromise = avatarUrl(defaultOptions) await expect(avatarUrlPromise).rejects.toThrow(new Error('error')) @@ -24,7 +26,9 @@ describe('avatarUrl', () => { }) it('returns a signed url', async () => { const defaultOptions = getDefaultOptions() - defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue(mockHttpResponse({}, { status: 200 })) + defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue( + mockHttpResponse({}, { status: 200 }) + ) defaultOptions.clientService.ocs.signUrl.mockImplementation((payload) => { return Promise.resolve(`${payload.url}?signed=true`) }) @@ -33,7 +37,9 @@ describe('avatarUrl', () => { }) it('handles caching', async () => { const defaultOptions = getDefaultOptions() - defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue(mockHttpResponse({}, { status: 200 })) + defaultOptions.clientService.httpAuthenticated.head.mockResolvedValue( + mockHttpResponse({}, { status: 200 }) + ) defaultOptions.clientService.ocs.signUrl.mockImplementation((payload) => Promise.resolve(payload.url) ) diff --git a/web/packages/web-app-ocm/package.json b/web/packages/web-app-ocm/package.json index 2fbbcf6c98b..bdaa44ef4ab 100644 --- a/web/packages/web-app-ocm/package.json +++ b/web/packages/web-app-ocm/package.json @@ -7,7 +7,6 @@ "@ownclouders/design-system": "workspace:*", "@ownclouders/web-client": "workspace:*", "@ownclouders/web-pkg": "workspace:*", - "axios": "^1.18.1", "email-validator": "^2.0.4", "fuse.js": "7.3.0", "lodash-es": "4.18.1", diff --git a/web/packages/web-client/README.md b/web/packages/web-client/README.md index 46ec4c4c8af..1b773fe695c 100644 --- a/web/packages/web-client/README.md +++ b/web/packages/web-client/README.md @@ -24,20 +24,19 @@ $ yarn add @ownclouders/web-client ### Graph -The graph client needs to be instantiated with a base URI corresponding to your oCIS deployment and an axios instance. The axios instance is being used for all requests, which means it needs to include all relevant headers either statically or via interceptor. +The graph client needs to be instantiated with a base URI corresponding to your oCIS deployment and a `FetchClient`. The `FetchClient` is being used for all requests, which means it needs to include all relevant headers, either statically or via the `headers` callback for values that change over time. ``` -import axios from axios -import { graph } from '@ownclouders/web-client' +import { FetchClient, graph } from '@ownclouders/web-client' const accessToken = 'some_access_token' const baseURI = 'some_base_uri' -const axiosClient = axios.create({ - headers: { Authorization: accessToken } +const httpClient = new FetchClient({ + staticHeaders: { Authorization: accessToken } }) -const graphClient = graph(baseURI, axiosClient) +const graphClient = graph(baseURI, httpClient) ``` The following example demonstrates how to retrieve all spaces accessible to the user. A `SpaceResource` can then be used to e.g. fetch files and folders (see webdav example down below). @@ -48,20 +47,19 @@ const mySpaces = await graphClient.drives.listMyDrives() ### OCS -The ocs client needs to be instantiated with a base URI corresponding to your oCIS deployment and an axios instance. The axios instance is being used for all requests, which means it needs to include all relevant headers either statically or via interceptor. +The ocs client needs to be instantiated with a base URI corresponding to your oCIS deployment and a `FetchClient`. The `FetchClient` is being used for all requests, which means it needs to include all relevant headers, either statically or via the `headers` callback for values that change over time. ``` -import axios from axios -import { ocs } from '@ownclouders/web-client' +import { FetchClient, ocs } from '@ownclouders/web-client' const accessToken = 'some_access_token' const baseURI = 'some_base_uri' -const axiosClient = axios.create({ - headers: { Authorization: accessToken } +const httpClient = new FetchClient({ + staticHeaders: { Authorization: accessToken } }) -const ocsClient = ocs(baseURI, axiosClient) +const ocsClient = ocs(baseURI, httpClient) ``` The following examples demonstrate how to fetch capabilities and sign URLs. diff --git a/web/packages/web-client/package.json b/web/packages/web-client/package.json index 7036c5d9a45..d847de20950 100644 --- a/web/packages/web-client/package.json +++ b/web/packages/web-client/package.json @@ -84,7 +84,6 @@ "dependencies": { "@casl/ability": "^6.8.1", "@microsoft/fetch-event-source": "^2.0.1", - "axios": "^1.18.1", "fast-xml-parser": "^5.8.0", "lodash-es": "^4.18.1", "luxon": "^3.7.2", diff --git a/web/packages/web-client/src/errors.ts b/web/packages/web-client/src/errors.ts index 2bb1084c68a..096f92715ab 100644 --- a/web/packages/web-client/src/errors.ts +++ b/web/packages/web-client/src/errors.ts @@ -6,12 +6,7 @@ export class HttpError extends Error { /** parsed response body, read once before the error is thrown */ public data?: unknown - constructor( - message: string, - response: Response, - statusCode: number = null, - data?: unknown - ) { + constructor(message: string, response: Response, statusCode: number = null, data?: unknown) { super(message) this.response = response this.statusCode = statusCode diff --git a/web/packages/web-client/src/graph/driveItems/driveItems.ts b/web/packages/web-client/src/graph/driveItems/driveItems.ts index 67c99801add..98096cacc23 100644 --- a/web/packages/web-client/src/graph/driveItems/driveItems.ts +++ b/web/packages/web-client/src/graph/driveItems/driveItems.ts @@ -9,10 +9,7 @@ export const DriveItemsFactory = ({ config }: GraphFactoryOptions): GraphDriveIt return { async getDriveItem(driveId, itemId, requestOptions) { - return await driveItemApi.getDriveItem( - { driveId, itemId }, - toInitOverrides(requestOptions) - ) + return await driveItemApi.getDriveItem({ driveId, itemId }, toInitOverrides(requestOptions)) }, async createDriveItem(driveId, data, requestOptions) { diff --git a/web/packages/web-client/src/http/fetchClient.ts b/web/packages/web-client/src/http/fetchClient.ts index e1bfb8ae8af..b4253babc62 100644 --- a/web/packages/web-client/src/http/fetchClient.ts +++ b/web/packages/web-client/src/http/fetchClient.ts @@ -1,10 +1,5 @@ import { HttpError } from '../errors' -import type { - FetchClientOptions, - FetchRequestOptions, - HttpResponse, - ResponseType -} from './types' +import type { FetchClientOptions, FetchRequestOptions, HttpResponse, ResponseType } from './types' const isBodyInit = (value: unknown): value is BodyInit => typeof value === 'string' || diff --git a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts index 00b95ec23d8..c5a526511a8 100644 --- a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts +++ b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts @@ -42,9 +42,7 @@ describe('FetchClient', () => { it('sets statusCode, not status', async () => { fetchMock.mockResolvedValue(new Response('{}', { status: 423 })) - const error: HttpError = await new FetchClient() - .request('https://host/foo') - .catch((e) => e) + const error: HttpError = await new FetchClient().request('https://host/foo').catch((e) => e) expect(error.statusCode).toBe(423) }) @@ -54,9 +52,7 @@ describe('FetchClient', () => { new Response(JSON.stringify({ error: { message: 'nope' } }), { status: 400 }) ) - const error: HttpError = await new FetchClient() - .request('https://host/foo') - .catch((e) => e) + const error: HttpError = await new FetchClient().request('https://host/foo').catch((e) => e) expect(error.data).toEqual({ error: { message: 'nope' } }) }) @@ -64,9 +60,7 @@ describe('FetchClient', () => { it('does not fail the throw path on a non-JSON error body', async () => { fetchMock.mockResolvedValue(new Response('gateway', { status: 502 })) - const error: HttpError = await new FetchClient() - .request('https://host/foo') - .catch((e) => e) + const error: HttpError = await new FetchClient().request('https://host/foo').catch((e) => e) expect(error.statusCode).toBe(502) expect(error.data).toBe('gateway') @@ -113,9 +107,7 @@ describe('FetchClient', () => { .request(relative) .catch(() => undefined) - expect(onResponse).toHaveBeenCalledWith( - expect.objectContaining({ requestUrl: relative }) - ) + expect(onResponse).toHaveBeenCalledWith(expect.objectContaining({ requestUrl: relative })) }) it('trap 5: reports a transport failure as status 500 with a null response, then throws', async () => { @@ -140,9 +132,9 @@ describe('FetchClient', () => { fetchMock.mockRejectedValue(abortError) const onResponse = vi.fn() - await expect( - new FetchClient({ onResponse }).request('https://host/foo') - ).rejects.toBe(abortError) + await expect(new FetchClient({ onResponse }).request('https://host/foo')).rejects.toBe( + abortError + ) expect(onResponse).not.toHaveBeenCalled() }) }) diff --git a/web/packages/web-pkg/package.json b/web/packages/web-pkg/package.json index f87e7494298..fc6ea776b8c 100644 --- a/web/packages/web-pkg/package.json +++ b/web/packages/web-pkg/package.json @@ -51,7 +51,6 @@ "@vavt/cm-extension": "^1.11.2", "@vue/shared": "^3.5.29", "@vueuse/core": "^14.3.0", - "axios": "^1.18.1", "deepmerge": "^4.3.1", "dompurify": "^3.4.13", "emoji-regex": "^10.6.0", diff --git a/web/packages/web-pkg/src/http/client.ts b/web/packages/web-pkg/src/http/client.ts index 2b1aed38bc7..a9eeceedf48 100644 --- a/web/packages/web-pkg/src/http/client.ts +++ b/web/packages/web-pkg/src/http/client.ts @@ -79,10 +79,7 @@ export class HttpClient { return this.send(url, rest) } - private async send( - url: string, - config: RequestConfig - ): Promise> { + private async send(url: string, config: RequestConfig): Promise> { const response = await this.client.request(url, config) if (config?.schema) { diff --git a/web/packages/web-pkg/src/services/client/client.ts b/web/packages/web-pkg/src/services/client/client.ts index 31ca1ca3567..1cfa56c3f00 100644 --- a/web/packages/web-pkg/src/services/client/client.ts +++ b/web/packages/web-pkg/src/services/client/client.ts @@ -179,9 +179,8 @@ export class ClientService { } /** - * Replaces the former pair of axios response interceptors. The asymmetry is deliberate - * and matches the previous behaviour: only a successful response clears maintenance - * mode, and a non-2xx response never clears it. + * Called for every response the client receives. The asymmetry is deliberate: only a + * successful response clears maintenance mode, and a non-2xx response never clears it. * * `args.requestUrl` is the caller's URL, not `response.url` — the maintenance * allow-list is matched against relative paths. `args.status` is 500 when the transport diff --git a/web/packages/web-pkg/tests/unit/services/archiver.spec.ts b/web/packages/web-pkg/tests/unit/services/archiver.spec.ts index 6c086db10ca..d29cd9a52c3 100644 --- a/web/packages/web-pkg/tests/unit/services/archiver.spec.ts +++ b/web/packages/web-pkg/tests/unit/services/archiver.spec.ts @@ -14,9 +14,11 @@ const getArchiverServiceInstance = (capabilities: Ref) => const userStore = useUserStore() const clientServiceMock = mockDeep() - clientServiceMock.httpUnAuthenticated.get.mockResolvedValue(mockHttpResponse(new ArrayBuffer(8), { - headers: { 'content-disposition': 'filename="download.tar"' } - })) + clientServiceMock.httpUnAuthenticated.get.mockResolvedValue( + mockHttpResponse(new ArrayBuffer(8), { + headers: { 'content-disposition': 'filename="download.tar"' } + }) + ) clientServiceMock.ocs.signUrl.mockImplementation((payload) => Promise.resolve(payload.url)) Object.defineProperty(window, 'open', { diff --git a/web/packages/web-runtime/package.json b/web/packages/web-runtime/package.json index dbe0f480632..93256348727 100644 --- a/web/packages/web-runtime/package.json +++ b/web/packages/web-runtime/package.json @@ -22,7 +22,6 @@ "@uppy/xhr-upload": "5.2.0", "@vueuse/core": "14.3.0", "@vueuse/head": "2.0.0", - "axios": "^1.18.1", "deepmerge": "4.3.1", "email-validator": "2.0.4", "dompurify": "^3.4.13", diff --git a/web/packages/web-runtime/tests/unit/App.spec.ts b/web/packages/web-runtime/tests/unit/App.spec.ts index 63a2e1a7f39..89321b920ce 100644 --- a/web/packages/web-runtime/tests/unit/App.spec.ts +++ b/web/packages/web-runtime/tests/unit/App.spec.ts @@ -6,7 +6,7 @@ import { mockHttpResponse, shallowMount } from '@ownclouders/web-test-helpers' -import { mock, mockDeep } from 'vitest-mock-extended' +import { mockDeep } from 'vitest-mock-extended' import { CapabilityStore, ClientService } from '@ownclouders/web-pkg' import * as LanguageHelpderModule from '../../src/helpers/language' diff --git a/web/packages/web-runtime/tests/unit/pages/account.spec.ts b/web/packages/web-runtime/tests/unit/pages/account.spec.ts index c785a7541fb..2b2f27220b1 100644 --- a/web/packages/web-runtime/tests/unit/pages/account.spec.ts +++ b/web/packages/web-runtime/tests/unit/pages/account.spec.ts @@ -266,7 +266,9 @@ describe('account page', () => { const { wrapper, mocks } = getWrapper() await blockLoadingState(wrapper) - mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockHttpError(500, undefined, 'err')) + mocks.$clientService.httpAuthenticated.post.mockImplementation(() => + mockHttpError(500, undefined, 'err') + ) await wrapper.vm.updateDisableEmailNotifications(true) const { showErrorMessage } = useMessages() expect(showErrorMessage).toHaveBeenCalled() @@ -412,7 +414,9 @@ describe('account page', () => { const { wrapper, mocks } = getWrapper({}) await blockLoadingState(wrapper) - mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockHttpError(500, undefined, 'err')) + mocks.$clientService.httpAuthenticated.post.mockImplementation(() => + mockHttpError(500, undefined, 'err') + ) await wrapper.vm.updateMultiChoiceSettingsValue('setting-id', 'setting-key', true) const { showErrorMessage } = useMessages() expect(showErrorMessage).toHaveBeenCalled() @@ -443,7 +447,9 @@ describe('account page', () => { const { wrapper, mocks } = getWrapper({}) await blockLoadingState(wrapper) - mocks.$clientService.httpAuthenticated.post.mockImplementation(() => mockHttpError(500, undefined, 'err')) + mocks.$clientService.httpAuthenticated.post.mockImplementation(() => + mockHttpError(500, undefined, 'err') + ) await wrapper.vm.updateSingleChoiceValue('setting-id', { displayValue: 'Daily', value: { stringValue: 'daily' } diff --git a/web/packages/web-test-helpers/package.json b/web/packages/web-test-helpers/package.json index 345732696df..07c7e0eef26 100644 --- a/web/packages/web-test-helpers/package.json +++ b/web/packages/web-test-helpers/package.json @@ -49,7 +49,6 @@ "@ownclouders/design-system": "workspace:^", "@ownclouders/web-client": "workspace:^", "@pinia/testing": "^1.0.3", - "axios": "^1.18.1", "vitest-mock-extended": "3.1.1", "vue-router": "5.0.6", "vue3-gettext": "^4.0.1" diff --git a/web/packages/web-test-helpers/src/mocks/httpResponse.ts b/web/packages/web-test-helpers/src/mocks/httpResponse.ts index e9ea07140dd..9df52c0ffe6 100644 --- a/web/packages/web-test-helpers/src/mocks/httpResponse.ts +++ b/web/packages/web-test-helpers/src/mocks/httpResponse.ts @@ -1,7 +1,7 @@ import { HttpError, type HttpResponse } from '@ownclouders/web-client' /** - * Builds the envelope HttpClient resolves with. Replaces mockAxiosResolve. + * Builds the envelope HttpClient resolves with. */ export const mockHttpResponse = ( data: T = {} as T, @@ -22,8 +22,8 @@ export const mockHttpResponse = ( }) /** - * Builds a rejected promise carrying the HttpError the fetch core throws. - * Replaces mockAxiosReject. Note callers branch on `statusCode`, never `status`. + * Builds a rejected promise carrying the HttpError the fetch core throws. Note that + * callers branch on `statusCode`, never `status`. */ export const mockHttpError = ( status = 500, diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 449610335f4..b8f919e9ac5 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -494,9 +494,6 @@ importers: '@ownclouders/web-pkg': specifier: workspace:^ version: link:../web-pkg - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) deep-object-diff: specifier: ^1.1.9 version: 1.1.9 @@ -540,9 +537,6 @@ importers: '@ownclouders/web-pkg': specifier: workspace:* version: link:../web-pkg - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) fuse.js: specifier: 7.3.0 version: 7.3.0 @@ -651,9 +645,6 @@ importers: '@vueuse/core': specifier: ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 version: 14.3.0(vue@3.5.29(typescript@5.9.3)) - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) dompurify: specifier: ^3.4.2 version: 3.4.12 @@ -743,9 +734,6 @@ importers: '@ownclouders/web-pkg': specifier: workspace:* version: link:../web-pkg - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) email-validator: specifier: ^2.0.4 version: 2.0.4 @@ -910,9 +898,6 @@ importers: '@microsoft/fetch-event-source': specifier: ^2.0.1 version: 2.0.1 - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) fast-xml-parser: specifier: ^5.8.0 version: 5.10.1 @@ -1005,9 +990,6 @@ importers: '@vueuse/core': specifier: ^14.3.0 version: 14.3.0(vue@3.5.29(typescript@5.9.3)) - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) deepmerge: specifier: ^4.3.1 version: 4.3.1 @@ -1163,9 +1145,6 @@ importers: '@vueuse/head': specifier: 2.0.0 version: 2.0.0(vue@3.5.29(typescript@5.9.3)) - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) deepmerge: specifier: 4.3.1 version: 4.3.1 @@ -1269,9 +1248,6 @@ importers: '@vue/test-utils': specifier: ^2.4.6 version: 2.4.6 - axios: - specifier: ^1.18.1 - version: 1.18.1(debug@4.4.3) vitest-mock-extended: specifier: 3.1.1 version: 3.1.1(typescript@5.9.3)(vitest@4.1.6(@types/node@24.13.2)(@vitest/coverage-v8@4.1.5(vitest@4.1.6))(happy-dom@20.8.9)(jsdom@27.4.0(@noble/hashes@2.0.1))(vite@7.3.5(@types/node@24.13.2)(sass@1.94.1)(terser@5.49.0)(yaml@2.9.0))) @@ -3637,10 +3613,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - agent-base@7.1.4: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} @@ -3779,9 +3751,6 @@ packages: async@3.2.6: resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - atomic-sleep@1.0.0: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} @@ -3805,9 +3774,6 @@ packages: resolution: {integrity: sha512-s7iGf5GaVMxEG0ENN9x+xTr7GFZCb1ZP/1uATUpCEK2X78nDB3RwbtFCo9pGAf9ru+VwoQ464DkaLEeRM08wJA==} engines: {node: '>=4'} - axios@1.18.1: - resolution: {integrity: sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==} - babel-core@7.0.0-bridge.0: resolution: {integrity: sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==} peerDependencies: @@ -4068,10 +4034,6 @@ packages: combine-errors@3.0.3: resolution: {integrity: sha512-C8ikRNRMygCwaTx+Ek3Yr+OuZzgZjduCOfSQBjbM8V3MfgcjSTeto/GXP6PAwKvJz/v15b7GHZvx5rOlczFw/Q==} - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - command-line-args@6.0.2: resolution: {integrity: sha512-AIjYVxrV9X752LmPDLbVYv8aMCuHPSLZJXEo2qo/xJfv+NYhaZ4sMSF01rM+gHPaMgvPM0l5D/F+Qx+i2WfSmQ==} engines: {node: '>=12.20'} @@ -4435,10 +4397,6 @@ packages: delaunator@5.1.0: resolution: {integrity: sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==} - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - des.js@1.1.0: resolution: {integrity: sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==} @@ -4561,10 +4519,6 @@ packages: resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} engines: {node: '>= 0.4'} - es-set-tostringtag@2.1.0: - resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} - engines: {node: '>= 0.4'} - es-toolkit@1.49.0: resolution: {integrity: sha512-G5iZ6Pc/FNRY/soKZHC+TxGDD83rHUDXxzaWhGCX44vAv/tMs56WMusnm/KMNK+luUPsgA9U28cGr4RDlSzL2g==} @@ -4882,15 +4836,6 @@ packages: focus-trap@8.2.0: resolution: {integrity: sha512-CaBdQ9P4fa/yCA6pDf/3aJd8bf9IOG5QGK21/E+86o2V4V8kzXaR4A9E6tNR7KkkS1+T5ZIU1tJDBDLwsucz9g==} - follow-redirects@1.16.0: - resolution: {integrity: sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - for-each@0.3.5: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} engines: {node: '>= 0.4'} @@ -4899,10 +4844,6 @@ packages: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - form-data@4.0.6: - resolution: {integrity: sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==} - engines: {node: '>= 6'} - formdata-polyfill@4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -5132,10 +5073,6 @@ packages: https-browserify@1.0.0: resolution: {integrity: sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==} - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - https-proxy-agent@7.0.6: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} @@ -6262,10 +6199,6 @@ packages: proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} - proxy-from-env@2.1.0: - resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==} - engines: {node: '>=10'} - public-encrypt@4.0.3: resolution: {integrity: sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==} @@ -10396,12 +10329,6 @@ snapshots: acorn@8.17.0: {} - agent-base@6.0.2: - dependencies: - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - agent-base@7.1.4: {} ajv-draft-04@1.0.0(ajv@8.20.0): @@ -10525,8 +10452,6 @@ snapshots: async@3.2.6: {} - asynckit@0.4.0: {} - atomic-sleep@1.0.0: {} autoprefixer@10.4.22(postcss@8.5.21): @@ -10547,16 +10472,6 @@ snapshots: axe-core@4.12.1: {} - axios@1.18.1(debug@4.4.3): - dependencies: - follow-redirects: 1.16.0(debug@4.4.3) - form-data: 4.0.6 - https-proxy-agent: 5.0.1 - proxy-from-env: 2.1.0 - transitivePeerDependencies: - - debug - - supports-color - babel-core@7.0.0-bridge.0(@babel/core@7.29.6): dependencies: '@babel/core': 7.29.6 @@ -10845,10 +10760,6 @@ snapshots: custom-error-instance: 2.1.1 lodash.uniqby: 4.5.0 - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - command-line-args@6.0.2: dependencies: array-back: 6.2.3 @@ -11236,8 +11147,6 @@ snapshots: dependencies: robust-predicates: 3.0.3 - delayed-stream@1.0.0: {} - des.js@1.1.0: dependencies: inherits: 2.0.4 @@ -11360,13 +11269,6 @@ snapshots: dependencies: es-errors: 1.3.0 - es-set-tostringtag@2.1.0: - dependencies: - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - has-tostringtag: 1.0.2 - hasown: 2.0.4 - es-toolkit@1.49.0: {} es5-ext@0.10.64: @@ -11779,10 +11681,6 @@ snapshots: dependencies: tabbable: 6.5.0 - follow-redirects@1.16.0(debug@4.4.3): - optionalDependencies: - debug: 4.4.3 - for-each@0.3.5: dependencies: is-callable: 1.2.7 @@ -11792,14 +11690,6 @@ snapshots: cross-spawn: 7.0.6 signal-exit: 4.1.0 - form-data@4.0.6: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - es-set-tostringtag: 2.1.0 - hasown: 2.0.4 - mime-types: 2.1.35 - formdata-polyfill@4.0.10: dependencies: fetch-blob: 3.2.0 @@ -12026,13 +11916,6 @@ snapshots: https-browserify@1.0.0: {} - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.4.3 - transitivePeerDependencies: - - supports-color - https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.4 @@ -13162,8 +13045,6 @@ snapshots: proto-list@1.2.4: {} - proxy-from-env@2.1.0: {} - public-encrypt@4.0.3: dependencies: bn.js: 4.12.5 From 02ae9ed54761ed1d31625b5ca48f08ca4eb94718 Mon Sep 17 00:00:00 2001 From: Matteo Date: Sun, 6 Sep 2026 10:40:00 +0200 Subject: [PATCH 13/19] fix(web-pkg): keep the axios-era surface on HttpClient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dropping axios changed more than the transport. Four spellings that consumers outside this repo were written against disappeared with it, and none of them had to. Response headers were a plain lowercased object under axios, so `headers['etag']` was the only way to read one; a fetch `Response` exposes a `Headers`, where `get('etag')` is. `httpHeaders` wraps the native object in a proxy that answers both, case-insensitively, and enumerates the lowercased names — it stays a real `Headers`, so neither spelling is a migration. A rejected request carried its body on `error.response.data` and its status on `error.response.status`. `HttpError` names them `data` and `statusCode`, which this repo unifies on, but the response those shadow is reachable from outside it, so `buildError` defines both on the response as well and keeps axios's `Request failed with status code ` message. The body is read from a clone, so callers still get an unread one. The config `HttpClient` takes has always named the request body `data`, and web extensions pass `data` when they issue raw WebDAV requests through `httpAuthenticated`. Carrying the core's `body` up would have dropped those bodies silently, so `RequestConfig` keeps `data` and `send` translates it. For the same reason a default-responseType body that is not JSON falls back to the raw text instead of throwing: a WebDAV multistatus answered without an explicit `responseType: 'text'` used to arrive as a string, and a `SyntaxError` there would turn a working request into a failing one. `cancel()` is back, on an `AbortController` instead of a `CancelToken`. Combining the client-wide signal with a per-request one needs a listener per request, so `send` disposes of them once the request has settled rather than letting them accumulate on a long-lived client. `mockAxiosResolve` and `mockAxiosReject` stay exported from web-test-helpers as deprecated aliases, so suites written against the axios era keep compiling. --- .../change-replace-axios-with-fetch.md | 34 +++++-- .../web-client/src/http/fetchClient.ts | 36 +++++--- web/packages/web-client/src/http/headers.ts | 46 ++++++++++ web/packages/web-client/src/http/index.ts | 1 + web/packages/web-client/src/http/types.ts | 4 +- .../web-client/src/webdav/getFileContents.ts | 7 +- .../tests/unit/http/fetchClient.spec.ts | 52 ++++++++++- .../tests/unit/http/headers.spec.ts | 52 +++++++++++ web/packages/web-pkg/src/http/client.ts | 71 ++++++++++++--- .../web-pkg/tests/unit/http/client.spec.ts | 90 +++++++++++++++++++ .../src/mocks/httpResponse.ts | 17 +++- 11 files changed, 373 insertions(+), 37 deletions(-) create mode 100644 web/packages/web-client/src/http/headers.ts create mode 100644 web/packages/web-client/tests/unit/http/headers.spec.ts diff --git a/changelog/unreleased/change-replace-axios-with-fetch.md b/changelog/unreleased/change-replace-axios-with-fetch.md index 1e55df13ab9..43a7be6a14e 100644 --- a/changelog/unreleased/change-replace-axios-with-fetch.md +++ b/changelog/unreleased/change-replace-axios-with-fetch.md @@ -1,14 +1,32 @@ Change: Replace axios with the native fetch API in Web -The Web frontend no longer depends on axios. All HTTP traffic now goes through a +The Web frontend no longer depends on axios. All HTTP traffic goes through a single fetch-based client, and the libre-graph client is generated from the `typescript-fetch` template instead of `typescript-axios`. -Two changes are visible to consumers of the `@ownclouders/web-client` package. -The `graph` and `ocs` factories take a `FetchClient` where they previously took -an axios instance, and graph fields carrying an OData annotation are now exposed -under their generated camelCase names — `atLibreGraphPermissionsActions` for -`@libre.graph.permissions.actions`, and likewise for the other annotated fields. -The names sent over the wire are unchanged. +Sending requests is a drop-in change. `HttpClient` keeps its per-request config +including `data`, keeps `cancel()`, still resolves a non-JSON body as text, and +still exposes response headers as `headers['etag']` as well as +`headers.get('etag')`. Errors still carry the body and status as `error.data` / +`error.statusCode` and as `error.response.data` / `error.response.status`. +`mockAxiosResolve` and `mockAxiosReject` still work, deprecated in favour of +`mockHttpResponse` and `mockHttpError`. -https://github.com/owncloud/ocis/pull/TBD +Code that touches axios directly has to be adapted: + +- `new HttpClient()` takes `{ baseUrl, staticHeaders, headers, onResponse }` + instead of `{ config, requestInterceptor, responseInterceptor }`. Clients from + `ClientService` are unaffected. +- The per-request config drops `timeout`, `withCredentials`, `onUploadProgress`, + `cancelToken`, `paramsSerializer`, `transformRequest` / `transformResponse`, + `validateStatus` and `baseURL`; `responseType` drops `document` and `stream`. +- `graph()`, `ocs()`, `UrlSign` and `WebDavOptions` take a `FetchClient`, and + the latter two rename `axiosClient` to `httpClient`. `webdav()` is unchanged. +- Graph fields with an OData annotation use their generated camelCase names, + e.g. `atLibreGraphPermissionsActions`. The wire format is unchanged. +- The generated client loses its `*ApiFactory`, `*ApiFp` and + `*AxiosParamCreator` exports. The `*Api` classes now take one options object + per operation and resolve with the payload. +- `@ownclouders/web-test-helpers` no longer has a `mocks/axios` module path. + +https://github.com/owncloud/ocis/pull/12910 diff --git a/web/packages/web-client/src/http/fetchClient.ts b/web/packages/web-client/src/http/fetchClient.ts index b4253babc62..2cb5091391a 100644 --- a/web/packages/web-client/src/http/fetchClient.ts +++ b/web/packages/web-client/src/http/fetchClient.ts @@ -1,4 +1,5 @@ import { HttpError } from '../errors' +import { httpHeaders } from './headers' import type { FetchClientOptions, FetchRequestOptions, HttpResponse, ResponseType } from './types' const isBodyInit = (value: unknown): value is BodyInit => @@ -61,7 +62,7 @@ export class FetchClient { data: (await this.readBody(response, options.responseType)) as T, status: response.status, statusText: response.statusText, - headers: response.headers + headers: httpHeaders(response.headers) } } @@ -89,8 +90,16 @@ export class FetchClient { private async buildError(response: Response): Promise { // Clone so that HttpError.response still exposes an unread body to callers. const data = await this.readBodySafely(response.clone()) + + // `error.data` and `error.statusCode` are this repo's convention, but `error.response` + // is reachable from outside it, where `.response.data` and `.response.headers['x']` + // were the only spellings. Keep those working too; the `headers` override shadows the + // prototype accessor with a superset of it. + Object.defineProperty(response, 'data', { value: data }) + Object.defineProperty(response, 'headers', { value: httpHeaders(response.headers) }) + return new HttpError( - response.statusText || `Request failed with status ${response.status}`, + `Request failed with status code ${response.status}`, response, response.status, data @@ -99,16 +108,9 @@ export class FetchClient { private async readBodySafely(response: Response): Promise { try { - const text = await response.text() - if (!text) { - return undefined - } - try { - return JSON.parse(text) - } catch { - return text - } + return await this.readBody(response) } catch { + // an unreadable body must not replace the HTTP error with a read error return undefined } } @@ -127,7 +129,17 @@ export class FetchClient { return await response.arrayBuffer() default: { const text = await response.text() - return text ? JSON.parse(text) : undefined + if (!text) { + return undefined + } + try { + return JSON.parse(text) + } catch { + // A caller that does not set a responseType still expects the raw body for a + // non-JSON response — a WebDAV multistatus, say. Axios did the same, and + // throwing here would turn a working request into a SyntaxError. + return text + } } } } diff --git a/web/packages/web-client/src/http/headers.ts b/web/packages/web-client/src/http/headers.ts new file mode 100644 index 00000000000..a1bd245ffef --- /dev/null +++ b/web/packages/web-client/src/http/headers.ts @@ -0,0 +1,46 @@ +/** + * A native `Headers` that also answers to bracket access. + * + * `.get('etag')` is the shape a fetch `Response` produces; `['etag']` is the shape axios + * produced and what consumers outside this repo were written against. Supporting both + * keeps the axios removal invisible to them. + */ +export interface HttpHeaders extends Headers { + [key: string]: any +} + +/** + * Views a native `Headers` as {@link HttpHeaders}. + * + * Enumeration (`Object.keys`, spread, `JSON.stringify`) yields the lowercase header names, + * matching what axios put on its response headers object. Bracket access is + * case-insensitive, which axios's was not, and resolves to `undefined` rather than `null` + * for an absent header — again what a plain object did. + */ +export const httpHeaders = (headers: Headers): HttpHeaders => + new Proxy(headers, { + get(target, property) { + const value = Reflect.get(target, property, target) + if (typeof value === 'function') { + // methods need the real Headers as their receiver, not the proxy + return value.bind(target) + } + if (value !== undefined || typeof property !== 'string') { + return value + } + return target.get(property) ?? undefined + }, + has(target, property) { + return Reflect.has(target, property) || (typeof property === 'string' && target.has(property)) + }, + ownKeys(target) { + // lowercased explicitly: browsers do it in the iterator, jsdom does not + return [...target.keys()].map((name) => name.toLowerCase()) + }, + getOwnPropertyDescriptor(target, property) { + if (typeof property === 'string' && target.has(property)) { + return { value: target.get(property), enumerable: true, configurable: true } + } + return Reflect.getOwnPropertyDescriptor(target, property) + } + }) as HttpHeaders diff --git a/web/packages/web-client/src/http/index.ts b/web/packages/web-client/src/http/index.ts index 305a5ab3f6f..ace7f82382d 100644 --- a/web/packages/web-client/src/http/index.ts +++ b/web/packages/web-client/src/http/index.ts @@ -1,2 +1,3 @@ export * from './fetchClient' +export * from './headers' export * from './types' diff --git a/web/packages/web-client/src/http/types.ts b/web/packages/web-client/src/http/types.ts index 6eca887c144..6cbfc95dfd8 100644 --- a/web/packages/web-client/src/http/types.ts +++ b/web/packages/web-client/src/http/types.ts @@ -1,3 +1,5 @@ +import type { HttpHeaders } from './headers' + export type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'none' export interface OnResponseArgs { @@ -35,5 +37,5 @@ export interface HttpResponse { data: T status: number statusText: string - headers: Headers + headers: HttpHeaders } diff --git a/web/packages/web-client/src/webdav/getFileContents.ts b/web/packages/web-client/src/webdav/getFileContents.ts index 26b160fa15b..be6b39cd12d 100644 --- a/web/packages/web-client/src/webdav/getFileContents.ts +++ b/web/packages/web-client/src/webdav/getFileContents.ts @@ -39,9 +39,10 @@ export const GetFileContentsFactory = (dav: DAV, { httpClient }: WebDavOptions) response, body: response.data, headers: { - ETag: response.headers.get('etag'), - 'OC-ETag': response.headers.get('oc-etag'), - 'OC-FileId': response.headers.get('oc-fileid') + // bracket access, not get(): an absent header stays undefined here rather than null + ETag: response.headers['etag'], + 'OC-ETag': response.headers['oc-etag'], + 'OC-FileId': response.headers['oc-fileid'] } } } catch (error) { diff --git a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts index c5a526511a8..04e46562cec 100644 --- a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts +++ b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts @@ -19,7 +19,7 @@ describe('FetchClient', () => { const lastCall = () => fetchMock.mock.calls[0] describe('request envelope', () => { - it('returns data, status, statusText and native Headers', async () => { + it('returns data, status, statusText and headers', async () => { fetchMock.mockResolvedValue(jsonResponse({ some: 'value' }, { statusText: 'OK' })) const result = await new FetchClient().request<{ some: string }>('https://host/foo') @@ -29,6 +29,15 @@ describe('FetchClient', () => { expect(result.statusText).toBe('OK') expect(result.headers.get('Content-Type')).toBe('application/json') }) + + it('trap 2: headers also answer to bracket access, as axios headers did', async () => { + fetchMock.mockResolvedValue(jsonResponse({}, { headers: { 'Lock-Token': '' } })) + + const result = await new FetchClient().request('https://host/foo') + + expect(result.headers['lock-token']).toBe('') + expect(result.headers['Lock-Token']).toBe('') + }) }) describe('trap 1: throws on non-2xx', () => { @@ -66,6 +75,38 @@ describe('FetchClient', () => { expect(error.data).toBe('gateway') }) + it('keeps the axios error message, which callers may match on', async () => { + fetchMock.mockResolvedValue(new Response('{}', { status: 404, statusText: 'Not Found' })) + + const error: HttpError = await new FetchClient().request('https://host/foo').catch((e) => e) + + expect(error.message).toBe('Request failed with status code 404') + }) + + it('also exposes the body and headers under their axios names on response', async () => { + fetchMock.mockResolvedValue( + new Response(JSON.stringify({ error: 'nope' }), { + status: 429, + headers: { 'Retry-After': '30' } + }) + ) + + const error: HttpError = await new FetchClient().request('https://host/foo').catch((e) => e) + + expect((error.response as Response & { data: unknown }).data).toEqual({ error: 'nope' }) + expect(error.response.headers['retry-after']).toBe('30') + expect(error.response.headers.get('retry-after')).toBe('30') + }) + + it('leaves the error response body unread', async () => { + fetchMock.mockResolvedValue(new Response('{"error":"nope"}', { status: 400 })) + + const error: HttpError = await new FetchClient().request('https://host/foo').catch((e) => e) + + expect(error.response.bodyUsed).toBe(false) + await expect(error.response.json()).resolves.toEqual({ error: 'nope' }) + }) + it('returns the envelope instead of throwing when throwOnError is false', async () => { fetchMock.mockResolvedValue(new Response('{}', { status: 404 })) @@ -262,6 +303,15 @@ describe('FetchClient', () => { expect(result.data).toBeUndefined() }) + + it('falls back to the raw body when a default-responseType body is not json', async () => { + const multistatus = '' + fetchMock.mockResolvedValue(new Response(multistatus, { status: 207 })) + + const result = await new FetchClient().request('https://host/foo', { method: 'REPORT' }) + + expect(result.data).toBe(multistatus) + }) }) describe('headers', () => { diff --git a/web/packages/web-client/tests/unit/http/headers.spec.ts b/web/packages/web-client/tests/unit/http/headers.spec.ts new file mode 100644 index 00000000000..06d272be1ed --- /dev/null +++ b/web/packages/web-client/tests/unit/http/headers.spec.ts @@ -0,0 +1,52 @@ +import { httpHeaders } from '../../../src/http' + +describe('httpHeaders', () => { + const headers = () => + httpHeaders(new Headers({ ETag: '"abc"', 'Retry-After': '30', 'Lock-Token': '' })) + + it('reads a header through get, as a native Headers does', () => { + expect(headers().get('etag')).toBe('"abc"') + expect(headers().get('nope')).toBeNull() + }) + + it('reads a header through bracket access, as axios allowed', () => { + expect(headers()['etag']).toBe('"abc"') + expect(headers()['retry-after']).toBe('30') + }) + + it('ignores case in bracket access', () => { + expect(headers()['Lock-Token']).toBe('') + expect(headers()['LOCK-TOKEN']).toBe('') + }) + + it('resolves an absent header to undefined rather than null', () => { + expect(headers()['nope']).toBeUndefined() + }) + + it('enumerates the lowercased header names', () => { + expect(Object.keys(headers()).sort()).toEqual(['etag', 'lock-token', 'retry-after']) + expect({ ...headers() }).toEqual({ + etag: '"abc"', + 'lock-token': '', + 'retry-after': '30' + }) + }) + + it('answers the in operator for a header and for a Headers method', () => { + expect('etag' in headers()).toBe(true) + expect('nope' in headers()).toBe(false) + expect('get' in headers()).toBe(true) + }) + + it('stays a Headers', () => { + const wrapped = headers() + + expect(wrapped).toBeInstanceOf(Headers) + expect(wrapped.has('etag')).toBe(true) + expect([...wrapped]).toHaveLength(3) + }) + + it('is not mistaken for a thenable', async () => { + await expect(Promise.resolve(headers())).resolves.toBeInstanceOf(Headers) + }) +}) diff --git a/web/packages/web-pkg/src/http/client.ts b/web/packages/web-pkg/src/http/client.ts index a9eeceedf48..c6dfe860454 100644 --- a/web/packages/web-pkg/src/http/client.ts +++ b/web/packages/web-pkg/src/http/client.ts @@ -6,25 +6,65 @@ import { } from '@ownclouders/web-client' import { z } from 'zod' -export type RequestConfig = FetchRequestOptions & { +export type RequestConfig = Omit & { + /** + * The request body. Named `data` rather than the core's `body` so that the + * config this client has always taken keeps working unchanged. + */ + data?: D schema?: S extends z.Schema ? S : never } type Resolved = HttpResponse : T> +/** + * Ties a per-request signal to the client-wide one without leaking a listener per request: + * the caller disposes once the request has settled. + */ +const combineSignals = (clientSignal: AbortSignal, requestSignal?: AbortSignal) => { + if (!requestSignal) { + return { signal: clientSignal, dispose: () => undefined } + } + + const controller = new AbortController() + const signals = [clientSignal, requestSignal] + const abort = (source: AbortSignal) => controller.abort(source.reason) + const listeners = signals.map((source) => { + const listener = () => abort(source) + source.addEventListener('abort', listener) + return () => source.removeEventListener('abort', listener) + }) + + const aborted = signals.find((source) => source.aborted) + if (aborted) { + abort(aborted) + } + + return { signal: controller.signal, dispose: () => listeners.forEach((remove) => remove()) } +} + export class HttpClient { private readonly client: FetchClient + private readonly controller = new AbortController() constructor(options: FetchClientOptions = {}) { this.client = new FetchClient(options) } + /** + * Aborts every request this client has in flight. As with the `CancelToken` this + * replaces, the client is spent afterwards and rejects immediately. + */ + public cancel(msg?: string): void { + this.controller.abort(msg ? new DOMException(msg, 'AbortError') : undefined) + } + public delete( url: string, data?: D, config?: RequestConfig ) { - return this.send(url, { ...config, method: 'DELETE', body: data }) + return this.send(url, { ...config, method: 'DELETE', data }) } public get( @@ -53,7 +93,7 @@ export class HttpClient { data?: D, config?: RequestConfig ) { - return this.send(url, { ...config, method: 'PATCH', body: data }) + return this.send(url, { ...config, method: 'PATCH', data }) } public post( @@ -61,7 +101,7 @@ export class HttpClient { data?: D, config?: RequestConfig ) { - return this.send(url, { ...config, method: 'POST', body: data }) + return this.send(url, { ...config, method: 'POST', data }) } public put( @@ -69,7 +109,7 @@ export class HttpClient { data?: D, config?: RequestConfig ) { - return this.send(url, { ...config, method: 'PUT', body: data }) + return this.send(url, { ...config, method: 'PUT', data }) } public request( @@ -80,12 +120,23 @@ export class HttpClient { } private async send(url: string, config: RequestConfig): Promise> { - const response = await this.client.request(url, config) + const { data, schema, signal, ...rest } = config + const { signal: combined, dispose } = combineSignals(this.controller.signal, signal) - if (config?.schema) { - return { ...response, data: config.schema.parse(response.data) } as Resolved - } + try { + const response = await this.client.request(url, { + ...rest, + body: data, + signal: combined + }) + + if (schema) { + return { ...response, data: schema.parse(response.data) } as Resolved + } - return response as Resolved + return response as Resolved + } finally { + dispose() + } } } diff --git a/web/packages/web-pkg/tests/unit/http/client.spec.ts b/web/packages/web-pkg/tests/unit/http/client.spec.ts index c1ae6cd0a2b..e08b1452175 100644 --- a/web/packages/web-pkg/tests/unit/http/client.spec.ts +++ b/web/packages/web-pkg/tests/unit/http/client.spec.ts @@ -158,6 +158,25 @@ describe('HttpClient', () => { expect(fetchMock.mock.calls[0][1].method).toBe('GET') }) + test('request sends the config data as the request body', async () => { + await new HttpClient().request({ + url: 'https://host/url', + method: 'REPORT', + data: '' + }) + + expect(fetchMock.mock.calls[0][1].body).toBe('') + }) + + test.each(['patch', 'post', 'put'] as const)( + '%s sends its positional data as the request body', + async (method) => { + await new HttpClient()[method]('https://host/url', 'payload') + + expect(fetchMock.mock.calls[0][1].body).toBe('payload') + } + ) + test('applies a zod schema to the response data', async () => { fetchMock.mockImplementation(() => Promise.resolve(new Response(JSON.stringify({ someProperty: 'value' }), { status: 200 })) @@ -168,9 +187,80 @@ describe('HttpClient', () => { expect(data.someProperty).toBe('value') }) + test('resolves a non-json body as text, the way a WebDAV REPORT answers', async () => { + const multistatus = '' + fetchMock.mockImplementation(() => Promise.resolve(new Response(multistatus, { status: 207 }))) + + const { data } = await new HttpClient().request({ url: 'https://host/dav', method: 'REPORT' }) + + expect(data).toBe(multistatus) + }) + + test('exposes response headers both by bracket access and through get', async () => { + fetchMock.mockImplementation(() => + Promise.resolve(new Response('{}', { status: 200, headers: { 'Lock-Token': '' } })) + ) + + const { headers } = await new HttpClient().request({ url: 'https://host/dav', method: 'LOCK' }) + + expect(headers['lock-token']).toBe('') + expect(headers.get('lock-token')).toBe('') + }) + test('baseUrl is applied to relative urls', async () => { await new HttpClient({ baseUrl: 'https://host/' }).get('some/path') expect(fetchMock.mock.calls[0][0]).toBe('https://host/some/path') }) + + describe('cancel', () => { + /** leaves the request pending until its signal aborts, as a real fetch would */ + const neverResolvingFetch = () => + fetchMock.mockImplementation( + (_url: string, init: RequestInit) => + new Promise((_resolve, reject) => { + init.signal.addEventListener('abort', () => reject(init.signal.reason)) + }) + ) + + test('aborts a request that is in flight', async () => { + neverResolvingFetch() + const client = new HttpClient() + + const request = client.get('https://host/url') + client.cancel('gone') + + await expect(request).rejects.toMatchObject({ name: 'AbortError', message: 'gone' }) + }) + + test('leaves a per-request signal able to abort on its own', async () => { + neverResolvingFetch() + const controller = new AbortController() + + const request = new HttpClient().get('https://host/url', { signal: controller.signal }) + controller.abort(new DOMException('mine', 'AbortError')) + + await expect(request).rejects.toMatchObject({ name: 'AbortError', message: 'mine' }) + }) + + test('passes the aborted signal on to requests issued after the cancel', async () => { + const client = new HttpClient() + client.cancel() + + await client.get('https://host/url').catch(() => undefined) + + expect(fetchMock.mock.calls[0][1].signal.aborted).toBe(true) + }) + + test('removes its abort listeners once a request has settled', async () => { + const client = new HttpClient() + const controller = new AbortController() + const removeEventListener = vi.spyOn(controller.signal, 'removeEventListener') + + await client.get('https://host/a', { signal: controller.signal }) + await client.get('https://host/b', { signal: controller.signal }) + + expect(removeEventListener).toHaveBeenCalledTimes(2) + }) + }) }) diff --git a/web/packages/web-test-helpers/src/mocks/httpResponse.ts b/web/packages/web-test-helpers/src/mocks/httpResponse.ts index 9df52c0ffe6..75c425a260e 100644 --- a/web/packages/web-test-helpers/src/mocks/httpResponse.ts +++ b/web/packages/web-test-helpers/src/mocks/httpResponse.ts @@ -1,4 +1,4 @@ -import { HttpError, type HttpResponse } from '@ownclouders/web-client' +import { HttpError, httpHeaders, type HttpResponse } from '@ownclouders/web-client' /** * Builds the envelope HttpClient resolves with. @@ -18,7 +18,7 @@ export const mockHttpResponse = ( data, status, statusText, - headers: new Headers(headers) + headers: httpHeaders(new Headers(headers)) }) /** @@ -31,3 +31,16 @@ export const mockHttpError = ( message = '' ): Promise => Promise.reject(new HttpError(message, new Response(null, { status }), status, data)) + +/** + * @deprecated use {@link mockHttpResponse}. Kept so that suites written against the axios + * era keep compiling; the envelope it returns is the same one. + */ +export const mockAxiosResolve = (data: T = {} as T): HttpResponse => mockHttpResponse(data) + +/** + * @deprecated use {@link mockHttpError}, which carries a status and a body. This rejects + * with a bare `Error`, exactly as it did before. + */ +export const mockAxiosReject = (message = ''): Promise => + Promise.reject(new Error(message)) From 7570fc5544d28b772afbc4c010baf8350c51d232 Mon Sep 17 00:00:00 2001 From: Matteo Date: Wed, 9 Sep 2026 09:45:47 +0200 Subject: [PATCH 14/19] fix(web-client): keep read-only graph fields in request bodies The typescript-fetch templates omit fields the spec marks `readOnly: true` from the generated `*ToJSON` serializers. Every field of `Quota` is annotated that way, so `updateDrive(id, { quota: { total: 500 } })` went out as `{ quota: {} }` and quotas could no longer be changed. Seventeen other models were affected the same way, among them `UserUpdate` and `ItemReference`. The annotation is now stripped from the spec before generating, which is what the axios-generated client effectively did. That also drops the `readonly` modifiers, so the `writeable` escape hatch is no longer needed. --- .../components/Users/SideBar/EditPanel.vue | 5 +- web/packages/web-client/package.json | 2 +- .../web-client/scripts/generate-openapi.sh | 29 +++++++++++ .../src/graph/generated/apis/DriveItemApi.ts | 2 +- .../src/graph/generated/apis/DrivesApi.ts | 4 +- .../generated/apis/DrivesPermissionsApi.ts | 2 +- .../src/graph/generated/apis/DrivesRootApi.ts | 4 +- .../graph/generated/apis/EducationClassApi.ts | 4 +- .../generated/apis/EducationSchoolApi.ts | 4 +- .../graph/generated/apis/EducationUserApi.ts | 4 +- .../src/graph/generated/apis/GroupApi.ts | 2 +- .../src/graph/generated/apis/GroupsApi.ts | 2 +- .../src/graph/generated/apis/MeUserApi.ts | 2 +- .../src/graph/generated/apis/UserApi.ts | 2 +- .../apis/UserAppRoleAssignmentApi.ts | 2 +- .../generated/models/AppRoleAssignment.ts | 5 +- .../src/graph/generated/models/Application.ts | 5 +- .../src/graph/generated/models/Drive.ts | 23 ++++++--- .../src/graph/generated/models/DriveItem.ts | 32 ++++++++---- .../src/graph/generated/models/DriveUpdate.ts | 23 ++++++--- .../graph/generated/models/EducationClass.ts | 5 +- .../graph/generated/models/EducationSchool.ts | 5 +- .../graph/generated/models/EducationUser.ts | 8 +-- .../src/graph/generated/models/Group.ts | 5 +- .../src/graph/generated/models/Image.ts | 8 +-- .../graph/generated/models/ItemReference.ts | 17 ++++--- .../graph/generated/models/OpenGraphFile.ts | 5 +- .../src/graph/generated/models/Permission.ts | 8 +-- .../src/graph/generated/models/Quota.ts | 17 ++++--- .../src/graph/generated/models/RemoteItem.ts | 11 ++-- .../src/graph/generated/models/SharingLink.ts | 8 +-- .../src/graph/generated/models/User.ts | 17 ++++--- .../src/graph/generated/models/UserUpdate.ts | 17 ++++--- web/packages/web-client/src/helpers/index.ts | 1 - .../web-client/src/helpers/space/functions.ts | 3 +- .../web-client/src/helpers/writeable.ts | 20 -------- .../tests/unit/graph/drives.spec.ts | 51 +++++++++++++++++++ .../unit/helpers/share/functions.spec.ts | 12 ++--- 38 files changed, 247 insertions(+), 129 deletions(-) create mode 100755 web/packages/web-client/scripts/generate-openapi.sh delete mode 100644 web/packages/web-client/src/helpers/writeable.ts create mode 100644 web/packages/web-client/tests/unit/graph/drives.spec.ts diff --git a/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue b/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue index d0c5a41ab32..77d16ea9913 100644 --- a/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue +++ b/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue @@ -125,7 +125,6 @@ import { import GroupSelect from '../GroupSelect.vue' import { cloneDeep, isEmpty, isEqual, omit } from 'lodash-es' import { AppRole, AppRoleAssignment, Group, User } from '@ownclouders/web-client/graph/generated' -import { writeable } from '@ownclouders/web-client' import { MaybeRef, useClientService } from '@ownclouders/web-pkg' import { storeToRefs } from 'pinia' import { diff } from 'deep-object-diff' @@ -167,10 +166,10 @@ const formData = ref({ } }) function changeSelectedQuotaOption(option: { value: number; displayValue: string }) { - writeable(unref(editUser).drive.quota).total = option.value + unref(editUser).drive.quota.total = option.value } function changeSelectedGroupOption(option: Group[]) { - writeable(unref(editUser)).memberOf = option + unref(editUser).memberOf = option } async function validateUserName() { unref(formData).userName.valid = false diff --git a/web/packages/web-client/package.json b/web/packages/web-client/package.json index d847de20950..3e637528e6c 100644 --- a/web/packages/web-client/package.json +++ b/web/packages/web-client/package.json @@ -75,7 +75,7 @@ } }, "scripts": { - "generate-openapi": "rm -rf src/graph/generated && docker run --rm -v \"${PWD}/src/graph:/local\" openapitools/openapi-generator-cli generate -i https://raw.githubusercontent.com/owncloud/libre-graph-api/main/api/openapi-spec/v1.0.yaml -g typescript-fetch --type-mappings=DateTime=string -o /local/generated", + "generate-openapi": "sh ./scripts/generate-openapi.sh", "vite": "vite", "prepublishOnly": "rm -rf ./package && clean-publish && rm -rf package/dist/tests && find package && cat package/package.json", "postpublish": "rm -rf ./package", diff --git a/web/packages/web-client/scripts/generate-openapi.sh b/web/packages/web-client/scripts/generate-openapi.sh new file mode 100755 index 00000000000..9803754aaf4 --- /dev/null +++ b/web/packages/web-client/scripts/generate-openapi.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh +set -eu + +# Regenerates the libre-graph client under src/graph/generated. +# +# The spec marks many fields `readOnly: true`, including every field of `Quota` and the +# `parentReference` identifiers. The typescript-fetch templates take that literally: they +# emit `readonly` modifiers and, more importantly, omit those fields from the generated +# `*ToJSON` serializers, so a PATCH body such as `{ quota: { total: 500 } }` would go out +# as `{ quota: {} }`. oCIS does accept these fields on write, so the annotation is stripped +# from the spec before generating. + +SPEC_URL="https://raw.githubusercontent.com/owncloud/libre-graph-api/main/api/openapi-spec/v1.0.yaml" +GRAPH_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")/../src/graph" && pwd)" +SPEC_FILE="$GRAPH_DIR/openapi-spec.yaml" + +cleanup() { + rm -f "$SPEC_FILE" +} +trap cleanup EXIT + +rm -rf "$GRAPH_DIR/generated" +curl -sSfL "$SPEC_URL" | sed '/^ *readOnly: true$/d' >"$SPEC_FILE" + +docker run --rm -v "$GRAPH_DIR:/local" openapitools/openapi-generator-cli generate \ + -i /local/openapi-spec.yaml \ + -g typescript-fetch \ + --type-mappings=DateTime=string \ + -o /local/generated diff --git a/web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts b/web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts index 276c81745de..34388d1da2e 100644 --- a/web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/DriveItemApi.ts @@ -58,7 +58,7 @@ export interface UpdateDriveItemRequest { /** * */ - driveItem: Omit; + driveItem: DriveItem; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/DrivesApi.ts b/web/packages/web-client/src/graph/generated/apis/DrivesApi.ts index 6d8e2376cb9..c1b56975a2b 100644 --- a/web/packages/web-client/src/graph/generated/apis/DrivesApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/DrivesApi.ts @@ -87,7 +87,7 @@ export interface UpdateDriveRequest { /** * */ - driveUpdate: Omit; + driveUpdate: DriveUpdate; } export interface UpdateDriveBetaRequest { @@ -98,7 +98,7 @@ export interface UpdateDriveBetaRequest { /** * */ - driveUpdate: Omit; + driveUpdate: DriveUpdate; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts b/web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts index 4e923203c56..9b67670a2e2 100644 --- a/web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/DrivesPermissionsApi.ts @@ -163,7 +163,7 @@ export interface UpdatePermissionRequest { /** * */ - permission: Omit; + permission: Permission; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts b/web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts index 569c5855925..b8c8ae1dd73 100644 --- a/web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/DrivesRootApi.ts @@ -62,7 +62,7 @@ export interface CreateDriveItemRequest { /** * */ - driveItem?: Omit; + driveItem?: DriveItem; } export interface CreateLinkSpaceRootRequest { @@ -158,7 +158,7 @@ export interface UpdatePermissionSpaceRootRequest { /** * */ - permission: Omit; + permission: Permission; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts b/web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts index 79bfb1a2d55..8e8b4566116 100644 --- a/web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/EducationClassApi.ts @@ -54,7 +54,7 @@ export interface CreateClassRequest { /** * */ - educationClass: Omit; + educationClass: EducationClass; } export interface DeleteClassRequest { @@ -97,7 +97,7 @@ export interface UpdateClassRequest { /** * */ - educationClass: Omit; + educationClass: EducationClass; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts b/web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts index 54952b5088b..46e561e84e6 100644 --- a/web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/EducationSchoolApi.ts @@ -75,7 +75,7 @@ export interface CreateSchoolRequest { /** * */ - educationSchool: Omit; + educationSchool: EducationSchool; } export interface DeleteClassFromSchoolRequest { @@ -136,7 +136,7 @@ export interface UpdateSchoolRequest { /** * */ - educationSchool: Omit; + educationSchool: EducationSchool; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts b/web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts index f8411bce336..95c2506a4b6 100644 --- a/web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/EducationUserApi.ts @@ -33,7 +33,7 @@ export interface CreateEducationUserRequest { /** * */ - educationUser: Omit; + educationUser: EducationUser; } export interface DeleteEducationUserRequest { @@ -73,7 +73,7 @@ export interface UpdateEducationUserRequest { /** * */ - educationUser: Omit; + educationUser: EducationUser; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/GroupApi.ts b/web/packages/web-client/src/graph/generated/apis/GroupApi.ts index 5cc1fcd7e81..cbe03152bcf 100644 --- a/web/packages/web-client/src/graph/generated/apis/GroupApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/GroupApi.ts @@ -101,7 +101,7 @@ export interface UpdateGroupRequest { /** * */ - group: Omit; + group: Group; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/GroupsApi.ts b/web/packages/web-client/src/graph/generated/apis/GroupsApi.ts index 584bd108e4e..a24f6b44a2c 100644 --- a/web/packages/web-client/src/graph/generated/apis/GroupsApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/GroupsApi.ts @@ -33,7 +33,7 @@ export interface CreateGroupRequest { /** * */ - group: Omit; + group: Group; } export interface ListGroupsRequest { diff --git a/web/packages/web-client/src/graph/generated/apis/MeUserApi.ts b/web/packages/web-client/src/graph/generated/apis/MeUserApi.ts index 4c4b664368d..7eaa7a43766 100644 --- a/web/packages/web-client/src/graph/generated/apis/MeUserApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/MeUserApi.ts @@ -40,7 +40,7 @@ export interface UpdateOwnUserRequest { /** * */ - userUpdate?: Omit; + userUpdate?: UserUpdate; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/UserApi.ts b/web/packages/web-client/src/graph/generated/apis/UserApi.ts index ab29095b17f..5635940e53b 100644 --- a/web/packages/web-client/src/graph/generated/apis/UserApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/UserApi.ts @@ -79,7 +79,7 @@ export interface UpdateUserRequest { /** * */ - userUpdate: Omit; + userUpdate: UserUpdate; } /** diff --git a/web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts b/web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts index 69df6ec295b..b54ec01c482 100644 --- a/web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts +++ b/web/packages/web-client/src/graph/generated/apis/UserAppRoleAssignmentApi.ts @@ -37,7 +37,7 @@ export interface UserCreateAppRoleAssignmentsRequest { /** * */ - appRoleAssignment: Omit; + appRoleAssignment: AppRoleAssignment; } export interface UserDeleteAppRoleAssignmentsRequest { diff --git a/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts b/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts index 467591fc59d..793dd5e92f7 100644 --- a/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts +++ b/web/packages/web-client/src/graph/generated/models/AppRoleAssignment.ts @@ -22,7 +22,7 @@ export interface AppRoleAssignment { /** * The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. */ - readonly id?: string; + id?: string; /** * */ @@ -93,13 +93,14 @@ export function AppRoleAssignmentToJSON(json: any): AppRoleAssignment { return AppRoleAssignmentToJSONTyped(json, false); } -export function AppRoleAssignmentToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function AppRoleAssignmentToJSONTyped(value?: AppRoleAssignment | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'deletedDateTime': value['deletedDateTime'], 'appRoleId': value['appRoleId'], 'createdDateTime': value['createdDateTime'], diff --git a/web/packages/web-client/src/graph/generated/models/Application.ts b/web/packages/web-client/src/graph/generated/models/Application.ts index 2e16c780d39..ab0f21ba7e9 100644 --- a/web/packages/web-client/src/graph/generated/models/Application.ts +++ b/web/packages/web-client/src/graph/generated/models/Application.ts @@ -30,7 +30,7 @@ export interface Application { /** * The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only. */ - readonly id: string; + id: string; /** * The collection of roles defined for the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. */ @@ -69,13 +69,14 @@ export function ApplicationToJSON(json: any): Application { return ApplicationToJSONTyped(json, false); } -export function ApplicationToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function ApplicationToJSONTyped(value?: Application | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'appRoles': value['appRoles'] == null ? undefined : ((value['appRoles'] as Array).map(AppRoleToJSON)), 'displayName': value['displayName'], }; diff --git a/web/packages/web-client/src/graph/generated/models/Drive.ts b/web/packages/web-client/src/graph/generated/models/Drive.ts index bbf36810157..891cba927d3 100644 --- a/web/packages/web-client/src/graph/generated/models/Drive.ts +++ b/web/packages/web-client/src/graph/generated/models/Drive.ts @@ -51,7 +51,7 @@ export interface Drive { /** * The unique identifier for this drive. */ - readonly id?: string; + id?: string; /** * */ @@ -59,7 +59,7 @@ export interface Drive { /** * Date and time of item creation. Read-only. */ - readonly createdDateTime?: string; + createdDateTime?: string; /** * Provides a user-visible description of the item. Optional. */ @@ -67,7 +67,7 @@ export interface Drive { /** * ETag for the item. Read-only. */ - readonly eTag?: string; + eTag?: string; /** * */ @@ -75,7 +75,7 @@ export interface Drive { /** * Date and time the item was last modified. Read-only. */ - readonly lastModifiedDateTime?: string; + lastModifiedDateTime?: string; /** * The name of the item. Read-write. */ @@ -87,11 +87,11 @@ export interface Drive { /** * URL that displays the resource in the browser. Read-only. */ - readonly webUrl?: string; + webUrl?: string; /** * Describes the type of drive represented by this resource. Values are "personal" for users home spaces, "project", "virtual" or "share". Read-only. */ - readonly driveType?: string; + driveType?: string; /** * The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID. */ @@ -107,7 +107,7 @@ export interface Drive { /** * All items contained in the drive. Read-only. Nullable. */ - readonly items?: Array; + items?: Array; /** * */ @@ -160,21 +160,28 @@ export function DriveToJSON(json: any): Drive { return DriveToJSONTyped(json, false); } -export function DriveToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function DriveToJSONTyped(value?: Drive | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'createdBy': IdentitySetToJSON(value['createdBy']), + 'createdDateTime': value['createdDateTime'], 'description': value['description'], + 'eTag': value['eTag'], 'lastModifiedBy': IdentitySetToJSON(value['lastModifiedBy']), + 'lastModifiedDateTime': value['lastModifiedDateTime'], 'name': value['name'], 'parentReference': ItemReferenceToJSON(value['parentReference']), + 'webUrl': value['webUrl'], + 'driveType': value['driveType'], 'driveAlias': value['driveAlias'], 'owner': IdentitySetToJSON(value['owner']), 'quota': QuotaToJSON(value['quota']), + 'items': value['items'] == null ? undefined : ((value['items'] as Array).map(DriveItemToJSON)), 'root': DriveItemToJSON(value['root']), 'special': value['special'] == null ? undefined : ((value['special'] as Array).map(DriveItemToJSON)), }; diff --git a/web/packages/web-client/src/graph/generated/models/DriveItem.ts b/web/packages/web-client/src/graph/generated/models/DriveItem.ts index 432d2fd1e48..c3275da21cd 100644 --- a/web/packages/web-client/src/graph/generated/models/DriveItem.ts +++ b/web/packages/web-client/src/graph/generated/models/DriveItem.ts @@ -135,7 +135,7 @@ export interface DriveItem { /** * Read-only. */ - readonly id?: string; + id?: string; /** * */ @@ -143,7 +143,7 @@ export interface DriveItem { /** * Date and time of item creation. Read-only. */ - readonly createdDateTime?: string; + createdDateTime?: string; /** * Provides a user-visible description of the item. Optional. */ @@ -151,7 +151,7 @@ export interface DriveItem { /** * ETag for the item. Read-only. */ - readonly eTag?: string; + eTag?: string; /** * */ @@ -159,7 +159,7 @@ export interface DriveItem { /** * Date and time the item was last modified. Read-only. */ - readonly lastModifiedDateTime?: string; + lastModifiedDateTime?: string; /** * The name of the item. Read-write. */ @@ -171,7 +171,7 @@ export interface DriveItem { /** * URL that displays the resource in the browser. Read-only. */ - readonly webUrl?: string; + webUrl?: string; /** * The content stream, if the item represents a file. */ @@ -179,7 +179,7 @@ export interface DriveItem { /** * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. */ - readonly cTag?: string; + cTag?: string; /** * */ @@ -231,19 +231,19 @@ export interface DriveItem { /** * Size of the item in bytes. Read-only. */ - readonly size?: number; + size?: number; /** * WebDAV compatible URL for the item. Read-only. */ - readonly webDavUrl?: string; + webDavUrl?: string; /** * Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. */ - readonly children?: Array; + children?: Array; /** * The set of permissions for the item. Read-only. Nullable. */ - readonly permissions?: Array; + permissions?: Array; /** * */ @@ -318,19 +318,25 @@ export function DriveItemToJSON(json: any): DriveItem { return DriveItemToJSONTyped(json, false); } -export function DriveItemToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function DriveItemToJSONTyped(value?: DriveItem | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'createdBy': IdentitySetToJSON(value['createdBy']), + 'createdDateTime': value['createdDateTime'], 'description': value['description'], + 'eTag': value['eTag'], 'lastModifiedBy': IdentitySetToJSON(value['lastModifiedBy']), + 'lastModifiedDateTime': value['lastModifiedDateTime'], 'name': value['name'], 'parentReference': ItemReferenceToJSON(value['parentReference']), + 'webUrl': value['webUrl'], 'content': value['content'], + 'cTag': value['cTag'], 'deleted': DeletedToJSON(value['deleted']), 'file': OpenGraphFileToJSON(value['file']), 'fileSystemInfo': FileSystemInfoToJSON(value['fileSystemInfo']), @@ -343,6 +349,10 @@ export function DriveItemToJSONTyped(value?: Omit).map(DriveItemToJSON)), + 'permissions': value['permissions'] == null ? undefined : ((value['permissions'] as Array).map(PermissionToJSON)), 'audio': AudioToJSON(value['audio']), 'video': VideoToJSON(value['video']), '@client.synchronize': value['atClientSynchronize'], diff --git a/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts b/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts index d037d689c8b..39a0417030d 100644 --- a/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts +++ b/web/packages/web-client/src/graph/generated/models/DriveUpdate.ts @@ -51,7 +51,7 @@ export interface DriveUpdate { /** * The unique identifier for this drive. */ - readonly id?: string; + id?: string; /** * */ @@ -59,7 +59,7 @@ export interface DriveUpdate { /** * Date and time of item creation. Read-only. */ - readonly createdDateTime?: string; + createdDateTime?: string; /** * Provides a user-visible description of the item. Optional. */ @@ -67,7 +67,7 @@ export interface DriveUpdate { /** * ETag for the item. Read-only. */ - readonly eTag?: string; + eTag?: string; /** * */ @@ -75,7 +75,7 @@ export interface DriveUpdate { /** * Date and time the item was last modified. Read-only. */ - readonly lastModifiedDateTime?: string; + lastModifiedDateTime?: string; /** * The name of the item. Read-write. */ @@ -87,11 +87,11 @@ export interface DriveUpdate { /** * URL that displays the resource in the browser. Read-only. */ - readonly webUrl?: string; + webUrl?: string; /** * Describes the type of drive represented by this resource. Values are "personal" for users home spaces, "project", "virtual" or "share". Read-only. */ - readonly driveType?: string; + driveType?: string; /** * The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID. */ @@ -107,7 +107,7 @@ export interface DriveUpdate { /** * All items contained in the drive. Read-only. Nullable. */ - readonly items?: Array; + items?: Array; /** * */ @@ -159,21 +159,28 @@ export function DriveUpdateToJSON(json: any): DriveUpdate { return DriveUpdateToJSONTyped(json, false); } -export function DriveUpdateToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function DriveUpdateToJSONTyped(value?: DriveUpdate | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'createdBy': IdentitySetToJSON(value['createdBy']), + 'createdDateTime': value['createdDateTime'], 'description': value['description'], + 'eTag': value['eTag'], 'lastModifiedBy': IdentitySetToJSON(value['lastModifiedBy']), + 'lastModifiedDateTime': value['lastModifiedDateTime'], 'name': value['name'], 'parentReference': ItemReferenceToJSON(value['parentReference']), + 'webUrl': value['webUrl'], + 'driveType': value['driveType'], 'driveAlias': value['driveAlias'], 'owner': IdentitySetToJSON(value['owner']), 'quota': QuotaToJSON(value['quota']), + 'items': value['items'] == null ? undefined : ((value['items'] as Array).map(DriveItemToJSON)), 'root': DriveItemToJSON(value['root']), 'special': value['special'] == null ? undefined : ((value['special'] as Array).map(DriveItemToJSON)), }; diff --git a/web/packages/web-client/src/graph/generated/models/EducationClass.ts b/web/packages/web-client/src/graph/generated/models/EducationClass.ts index 9b39dfbd637..3245915d691 100644 --- a/web/packages/web-client/src/graph/generated/models/EducationClass.ts +++ b/web/packages/web-client/src/graph/generated/models/EducationClass.ts @@ -30,7 +30,7 @@ export interface EducationClass { /** * Read-only. */ - readonly id?: string; + id?: string; /** * An optional description for the group. Returned by default. */ @@ -99,13 +99,14 @@ export function EducationClassToJSON(json: any): EducationClass { return EducationClassToJSONTyped(json, false); } -export function EducationClassToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function EducationClassToJSONTyped(value?: EducationClass | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'description': value['description'], 'displayName': value['displayName'], 'members': value['members'] == null ? undefined : ((value['members'] as Array).map(UserToJSON)), diff --git a/web/packages/web-client/src/graph/generated/models/EducationSchool.ts b/web/packages/web-client/src/graph/generated/models/EducationSchool.ts index 799850471e0..65ea8f4fc42 100644 --- a/web/packages/web-client/src/graph/generated/models/EducationSchool.ts +++ b/web/packages/web-client/src/graph/generated/models/EducationSchool.ts @@ -22,7 +22,7 @@ export interface EducationSchool { /** * The unique identifier for an entity. Read-only. */ - readonly id?: string; + id?: string; /** * The organization name */ @@ -65,13 +65,14 @@ export function EducationSchoolToJSON(json: any): EducationSchool { return EducationSchoolToJSONTyped(json, false); } -export function EducationSchoolToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function EducationSchoolToJSONTyped(value?: EducationSchool | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'displayName': value['displayName'], 'schoolNumber': value['schoolNumber'], 'terminationDate': value['terminationDate'], diff --git a/web/packages/web-client/src/graph/generated/models/EducationUser.ts b/web/packages/web-client/src/graph/generated/models/EducationUser.ts index ed044d44430..a0fdacce0da 100644 --- a/web/packages/web-client/src/graph/generated/models/EducationUser.ts +++ b/web/packages/web-client/src/graph/generated/models/EducationUser.ts @@ -51,7 +51,7 @@ export interface EducationUser { /** * Read-only. */ - readonly id?: string; + id?: string; /** * Set to "true" when the account is enabled. */ @@ -63,7 +63,7 @@ export interface EducationUser { /** * A collection of drives available for this user. Read-only. */ - readonly drives?: Array; + drives?: Array; /** * */ @@ -149,15 +149,17 @@ export function EducationUserToJSON(json: any): EducationUser { return EducationUserToJSONTyped(json, false); } -export function EducationUserToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function EducationUserToJSONTyped(value?: EducationUser | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'accountEnabled': value['accountEnabled'], 'displayName': value['displayName'], + 'drives': value['drives'] == null ? undefined : ((value['drives'] as Array).map(DriveToJSON)), 'drive': DriveToJSON(value['drive']), 'identities': value['identities'] == null ? undefined : ((value['identities'] as Array).map(ObjectIdentityToJSON)), 'mail': value['mail'], diff --git a/web/packages/web-client/src/graph/generated/models/Group.ts b/web/packages/web-client/src/graph/generated/models/Group.ts index eb593839b7c..5d6901f02ad 100644 --- a/web/packages/web-client/src/graph/generated/models/Group.ts +++ b/web/packages/web-client/src/graph/generated/models/Group.ts @@ -30,7 +30,7 @@ export interface Group { /** * Read-only. */ - readonly id?: string; + id?: string; /** * An optional description for the group. Returned by default. */ @@ -83,13 +83,14 @@ export function GroupToJSON(json: any): Group { return GroupToJSONTyped(json, false); } -export function GroupToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function GroupToJSONTyped(value?: Group | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'description': value['description'], 'displayName': value['displayName'], 'groupTypes': value['groupTypes'], diff --git a/web/packages/web-client/src/graph/generated/models/Image.ts b/web/packages/web-client/src/graph/generated/models/Image.ts index 827c62c30bb..17a63a321f7 100644 --- a/web/packages/web-client/src/graph/generated/models/Image.ts +++ b/web/packages/web-client/src/graph/generated/models/Image.ts @@ -22,11 +22,11 @@ export interface Image { /** * Optional. Height of the image, in pixels. Read-only. */ - readonly height?: number; + height?: number; /** * Optional. Width of the image, in pixels. Read-only. */ - readonly width?: number; + width?: number; } /** @@ -55,13 +55,15 @@ export function ImageToJSON(json: any): Image { return ImageToJSONTyped(json, false); } -export function ImageToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function ImageToJSONTyped(value?: Image | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'height': value['height'], + 'width': value['width'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/ItemReference.ts b/web/packages/web-client/src/graph/generated/models/ItemReference.ts index 26d6c178f6d..81a00469da5 100644 --- a/web/packages/web-client/src/graph/generated/models/ItemReference.ts +++ b/web/packages/web-client/src/graph/generated/models/ItemReference.ts @@ -22,23 +22,23 @@ export interface ItemReference { /** * Unique identifier of the drive instance that contains the item. Read-only. */ - readonly driveId?: string; + driveId?: string; /** * Identifies the type of drive. See [drive][] resource for values. Read-only. */ - readonly driveType?: string; + driveType?: string; /** * Unique identifier of the item in the drive. Read-only. */ - readonly id?: string; + id?: string; /** * The name of the item being referenced. Read-only. */ - readonly name?: string; + name?: string; /** * Path that can be used to navigate to the item. Read-only. */ - readonly path?: string; + path?: string; } /** @@ -70,13 +70,18 @@ export function ItemReferenceToJSON(json: any): ItemReference { return ItemReferenceToJSONTyped(json, false); } -export function ItemReferenceToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function ItemReferenceToJSONTyped(value?: ItemReference | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'driveId': value['driveId'], + 'driveType': value['driveType'], + 'id': value['id'], + 'name': value['name'], + 'path': value['path'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts b/web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts index 75b39b9cb6b..154b12db5e5 100644 --- a/web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts +++ b/web/packages/web-client/src/graph/generated/models/OpenGraphFile.ts @@ -34,7 +34,7 @@ export interface OpenGraphFile { /** * The MIME type for the file. This is determined by logic on the server and might not be the value provided when the file was uploaded. Read-only. */ - readonly mimeType?: string; + mimeType?: string; /** * */ @@ -68,7 +68,7 @@ export function OpenGraphFileToJSON(json: any): OpenGraphFile { return OpenGraphFileToJSONTyped(json, false); } -export function OpenGraphFileToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function OpenGraphFileToJSONTyped(value?: OpenGraphFile | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } @@ -76,6 +76,7 @@ export function OpenGraphFileToJSONTyped(value?: Omit return { 'hashes': HashesToJSON(value['hashes']), + 'mimeType': value['mimeType'], 'processingMetadata': value['processingMetadata'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/Permission.ts b/web/packages/web-client/src/graph/generated/models/Permission.ts index 2c95779b76e..e792bd96378 100644 --- a/web/packages/web-client/src/graph/generated/models/Permission.ts +++ b/web/packages/web-client/src/graph/generated/models/Permission.ts @@ -60,13 +60,13 @@ export interface Permission { /** * The unique identifier of the permission among all permissions on the item. Read-only. */ - readonly id?: string; + id?: string; /** * Indicates whether the password is set for this permission. This property only * appears in the response. Optional. Read-only. * */ - readonly hasPassword?: boolean; + hasPassword?: boolean; /** * An optional expiration date which limits the permission in time. */ @@ -136,13 +136,15 @@ export function PermissionToJSON(json: any): Permission { return PermissionToJSONTyped(json, false); } -export function PermissionToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function PermissionToJSONTyped(value?: Permission | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], + 'hasPassword': value['hasPassword'], 'expirationDateTime': value['expirationDateTime'], 'createdDateTime': value['createdDateTime'], 'grantedToV2': SharePointIdentitySetToJSON(value['grantedToV2']), diff --git a/web/packages/web-client/src/graph/generated/models/Quota.ts b/web/packages/web-client/src/graph/generated/models/Quota.ts index c63586c9860..92f7da7c79d 100644 --- a/web/packages/web-client/src/graph/generated/models/Quota.ts +++ b/web/packages/web-client/src/graph/generated/models/Quota.ts @@ -22,23 +22,23 @@ export interface Quota { /** * Total space consumed by files in the recycle bin, in bytes. Read-only. */ - readonly deleted?: number; + deleted?: number; /** * Total space remaining before reaching the quota limit, in bytes. Read-only. */ - readonly remaining?: number; + remaining?: number; /** * Enumeration value that indicates the state of the storage space. Either "normal", "nearing", "critical" or "exceeded". Read-only. */ - readonly state?: string; + state?: string; /** * Total allowed storage space, in bytes. Read-only. */ - readonly total?: number; + total?: number; /** * Total space used, in bytes. Read-only. */ - readonly used?: number; + used?: number; } /** @@ -70,13 +70,18 @@ export function QuotaToJSON(json: any): Quota { return QuotaToJSONTyped(json, false); } -export function QuotaToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function QuotaToJSONTyped(value?: Quota | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'deleted': value['deleted'], + 'remaining': value['remaining'], + 'state': value['state'], + 'total': value['total'], + 'used': value['used'], }; } diff --git a/web/packages/web-client/src/graph/generated/models/RemoteItem.ts b/web/packages/web-client/src/graph/generated/models/RemoteItem.ts index 68f0393d269..59815702b86 100644 --- a/web/packages/web-client/src/graph/generated/models/RemoteItem.ts +++ b/web/packages/web-client/src/graph/generated/models/RemoteItem.ts @@ -131,11 +131,11 @@ export interface RemoteItem { /** * ETag for the item. Read-only. */ - readonly eTag?: string; + eTag?: string; /** * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only. */ - readonly cTag?: string; + cTag?: string; /** * */ @@ -143,7 +143,7 @@ export interface RemoteItem { /** * The set of permissions for the item. Read-only. Nullable. */ - readonly permissions?: Array; + permissions?: Array; /** * Size of the remote item. Read-only. */ @@ -212,7 +212,7 @@ export function RemoteItemToJSON(json: any): RemoteItem { return RemoteItemToJSONTyped(json, false); } -export function RemoteItemToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function RemoteItemToJSONTyped(value?: RemoteItem | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } @@ -232,7 +232,10 @@ export function RemoteItemToJSONTyped(value?: Omit).map(PermissionToJSON)), 'size': value['size'], 'specialFolder': SpecialFolderToJSON(value['specialFolder']), 'webDavUrl': value['webDavUrl'], diff --git a/web/packages/web-client/src/graph/generated/models/SharingLink.ts b/web/packages/web-client/src/graph/generated/models/SharingLink.ts index 8fa133431bc..0cb41d64dc4 100644 --- a/web/packages/web-client/src/graph/generated/models/SharingLink.ts +++ b/web/packages/web-client/src/graph/generated/models/SharingLink.ts @@ -37,11 +37,11 @@ export interface SharingLink { /** * If `true` then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item. */ - readonly preventsDownload?: boolean; + preventsDownload?: boolean; /** * A URL that opens the item in the browser on the website. */ - readonly webUrl?: string; + webUrl?: string; /** * Provides a user-visible display name of the link. Optional. Libregraph only. */ @@ -83,7 +83,7 @@ export function SharingLinkToJSON(json: any): SharingLink { return SharingLinkToJSONTyped(json, false); } -export function SharingLinkToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function SharingLinkToJSONTyped(value?: SharingLink | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } @@ -91,6 +91,8 @@ export function SharingLinkToJSONTyped(value?: Omit; + appRoleAssignments?: Array; /** * The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. */ @@ -88,7 +88,7 @@ export interface User { /** * A collection of drives available for this user. Read-only. */ - readonly drives?: Array; + drives?: Array; /** * */ @@ -104,7 +104,7 @@ export interface User { /** * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. */ - readonly memberOf?: Array; + memberOf?: Array; /** * Contains the on-premises SAM account name synchronized from the on-premises directory. */ @@ -124,7 +124,7 @@ export interface User { /** * The user`s type. This can be either "Member" for regular user, "Guest" for guest users or "Federated" for users imported from a federated instance. */ - readonly userType?: string; + userType?: string; /** * Represents the users language setting, ISO-639-1 Code */ @@ -192,22 +192,27 @@ export function UserToJSON(json: any): User { return UserToJSONTyped(json, false); } -export function UserToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function UserToJSONTyped(value?: User | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'accountEnabled': value['accountEnabled'], + 'appRoleAssignments': value['appRoleAssignments'] == null ? undefined : ((value['appRoleAssignments'] as Array).map(AppRoleAssignmentToJSON)), 'displayName': value['displayName'], + 'drives': value['drives'] == null ? undefined : ((value['drives'] as Array).map(DriveToJSON)), 'drive': DriveToJSON(value['drive']), 'identities': value['identities'] == null ? undefined : ((value['identities'] as Array).map(ObjectIdentityToJSON)), 'mail': value['mail'], + 'memberOf': value['memberOf'] == null ? undefined : ((value['memberOf'] as Array).map(GroupToJSON)), 'onPremisesSamAccountName': value['onPremisesSamAccountName'], 'passwordProfile': PasswordProfileToJSON(value['passwordProfile']), 'surname': value['surname'], 'givenName': value['givenName'], + 'userType': value['userType'], 'preferredLanguage': value['preferredLanguage'], 'signInActivity': SignInActivityToJSON(value['signInActivity']), 'externalID': value['externalID'], diff --git a/web/packages/web-client/src/graph/generated/models/UserUpdate.ts b/web/packages/web-client/src/graph/generated/models/UserUpdate.ts index 7da85958b9e..ef117ddc409 100644 --- a/web/packages/web-client/src/graph/generated/models/UserUpdate.ts +++ b/web/packages/web-client/src/graph/generated/models/UserUpdate.ts @@ -72,7 +72,7 @@ export interface UserUpdate { /** * Read-only. */ - readonly id?: string; + id?: string; /** * Set to "true" when the account is enabled. */ @@ -80,7 +80,7 @@ export interface UserUpdate { /** * The apps and app roles which this user has been assigned. */ - readonly appRoleAssignments?: Array; + appRoleAssignments?: Array; /** * The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby. */ @@ -88,7 +88,7 @@ export interface UserUpdate { /** * A collection of drives available for this user. Read-only. */ - readonly drives?: Array; + drives?: Array; /** * */ @@ -104,7 +104,7 @@ export interface UserUpdate { /** * Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand. */ - readonly memberOf?: Array; + memberOf?: Array; /** * Contains the on-premises SAM account name synchronized from the on-premises directory. */ @@ -124,7 +124,7 @@ export interface UserUpdate { /** * The user`s type. This can be either "Member" for regular user, "Guest" for guest users or "Federated" for users imported from a federated instance. */ - readonly userType?: string; + userType?: string; /** * Represents the users language setting, ISO-639-1 Code */ @@ -190,22 +190,27 @@ export function UserUpdateToJSON(json: any): UserUpdate { return UserUpdateToJSONTyped(json, false); } -export function UserUpdateToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function UserUpdateToJSONTyped(value?: UserUpdate | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { + 'id': value['id'], 'accountEnabled': value['accountEnabled'], + 'appRoleAssignments': value['appRoleAssignments'] == null ? undefined : ((value['appRoleAssignments'] as Array).map(AppRoleAssignmentToJSON)), 'displayName': value['displayName'], + 'drives': value['drives'] == null ? undefined : ((value['drives'] as Array).map(DriveToJSON)), 'drive': DriveToJSON(value['drive']), 'identities': value['identities'] == null ? undefined : ((value['identities'] as Array).map(ObjectIdentityToJSON)), 'mail': value['mail'], + 'memberOf': value['memberOf'] == null ? undefined : ((value['memberOf'] as Array).map(GroupToJSON)), 'onPremisesSamAccountName': value['onPremisesSamAccountName'], 'passwordProfile': PasswordProfileToJSON(value['passwordProfile']), 'surname': value['surname'], 'givenName': value['givenName'], + 'userType': value['userType'], 'preferredLanguage': value['preferredLanguage'], 'signInActivity': SignInActivityToJSON(value['signInActivity']), 'externalID': value['externalID'], diff --git a/web/packages/web-client/src/helpers/index.ts b/web/packages/web-client/src/helpers/index.ts index 6c46e119470..6f63f917cf6 100644 --- a/web/packages/web-client/src/helpers/index.ts +++ b/web/packages/web-client/src/helpers/index.ts @@ -6,4 +6,3 @@ export * from './resource' export * from './share' export * from './space' export * from './maintenance' -export * from './writeable' diff --git a/web/packages/web-client/src/helpers/space/functions.ts b/web/packages/web-client/src/helpers/space/functions.ts index 6beb9ef3e6a..324435a4af5 100644 --- a/web/packages/web-client/src/helpers/space/functions.ts +++ b/web/packages/web-client/src/helpers/space/functions.ts @@ -20,7 +20,6 @@ import { buildWebDavPublicPath, buildWebDavOcmPath } from '../publicLink' import { urlJoin } from '../../utils' import { Drive, DriveItem } from '@ownclouders/web-client/graph/generated' import { GraphSharePermission, ShareRole } from '../share' -import { Writeable } from '../writeable' export function buildWebDavSpacesPath(storageId: string, path?: string) { return urlJoin('spaces', storageId, path, { @@ -140,7 +139,7 @@ export function buildSpace( }, graphRoles: Record ): SpaceResource { - let spaceImageData: Writeable, spaceReadmeData: Writeable + let spaceImageData: DriveItem, spaceReadmeData: DriveItem if (data.special) { spaceImageData = data.special.find((el) => el.specialFolder.name === 'image') spaceReadmeData = data.special.find((el) => el.specialFolder.name === 'readme') diff --git a/web/packages/web-client/src/helpers/writeable.ts b/web/packages/web-client/src/helpers/writeable.ts deleted file mode 100644 index b3dc14e29e3..00000000000 --- a/web/packages/web-client/src/helpers/writeable.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Strips `readonly` from an object's own properties. - * - * The generated graph models mark response-only fields `readonly`, which is right for a - * server response but gets in the way of the editable copies and test fixtures we build - * from them. - */ -export type Writeable = { -readonly [K in keyof T]: T[K] } - -/** - * Views a value as {@link Writeable} so a single field can be assigned. - * - * Use it on the object that owns the field, not on the whole tree — `readonly` is stripped - * one level deep only, which keeps the escape hatch visible at each assignment: - * - * ```ts - * writeable(user.drive.quota).total = 42 - * ``` - */ -export const writeable = (value: T): Writeable => value diff --git a/web/packages/web-client/tests/unit/graph/drives.spec.ts b/web/packages/web-client/tests/unit/graph/drives.spec.ts new file mode 100644 index 00000000000..4c92ebbce44 --- /dev/null +++ b/web/packages/web-client/tests/unit/graph/drives.spec.ts @@ -0,0 +1,51 @@ +import { graph } from '../../../src/graph' +import { FetchClient } from '../../../src/http' + +const drive = { + id: 'storage-id', + name: 'Alice', + webUrl: 'https://host/f/storage-id', + quota: { total: 500, used: 0 } +} + +describe('graph drives', () => { + let fetchMock: ReturnType + + beforeEach(() => { + fetchMock = vi.fn().mockResolvedValue( + new Response(JSON.stringify(drive), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) + ) + vi.stubGlobal('fetch', fetchMock) + }) + + describe('updateDrive', () => { + /** + * The spec marks every `Quota` field read-only, which the generator honours by omitting + * them from its serializers. Without stripping the annotation before generating, the + * quota would silently leave as `{}` and the drive would keep its old limit. + */ + it('sends the quota in the request body', async () => { + await graph('https://host', new FetchClient()).drives.updateDrive( + drive.id, + { name: drive.name, quota: { total: 500 } }, + {} + ) + + const body = JSON.parse(fetchMock.mock.calls[0][1].body) + expect(body.quota).toEqual({ total: 500 }) + }) + + it('returns the updated quota on the space', async () => { + const space = await graph('https://host', new FetchClient()).drives.updateDrive( + drive.id, + { name: drive.name, quota: { total: 500 } }, + {} + ) + + expect(space.spaceQuota).toEqual({ total: 500, used: 0 }) + }) + }) +}) diff --git a/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts b/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts index 84984a08d0c..def1b00a4df 100644 --- a/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts +++ b/web/packages/web-client/tests/unit/helpers/share/functions.spec.ts @@ -25,7 +25,7 @@ import { UnifiedRoleDefinition, User } from '../../../../src/graph/generated' -import { urlJoin, writeable } from '../../../../src' +import { urlJoin } from '../../../../src' describe('share helper functions', () => { describe('isShareResource', () => { @@ -76,7 +76,7 @@ describe('share helper functions', () => { describe('getShareResourceRoles', () => { it("returns all roles from a drive item's permissions that are also included in the graphRoles", () => { const driveItem = mockDeep() - writeable(driveItem.remoteItem).permissions = [{ roles: ['1', '2'] }, { roles: ['1', '3'] }] + driveItem.remoteItem.permissions = [{ roles: ['1', '2'] }, { roles: ['1', '3'] }] const graphRoles = { '1': mock({ id: '1' }), '4': mock({ id: '4' }) } const result = getShareResourceRoles({ driveItem, graphRoles }) @@ -101,7 +101,7 @@ describe('share helper functions', () => { it('returns permissions based on a drive item if no graph share roles given', () => { const permissions = ['view', 'edit'] const driveItem = mockDeep() - writeable(driveItem.remoteItem).permissions = [ + driveItem.remoteItem.permissions = [ { atLibreGraphPermissionsActions: [permissions[0]] }, { atLibreGraphPermissionsActions: [permissions[1]] } ] @@ -116,7 +116,7 @@ describe('share helper functions', () => { const driveItem = mockDeep({ id: 'driveItemId', name: 'driveItemName' }) const sharedBy = { id: '1', displayName: 'user1' } as Identity const sharedWith = { id: '2', displayName: 'user2' } as Identity - writeable(driveItem.remoteItem).permissions = [ + driveItem.remoteItem.permissions = [ { roles: ['1', '2'], invitation: { invitedBy: { user: sharedBy } }, @@ -167,10 +167,10 @@ describe('share helper functions', () => { describe('buildOutgoingShareResource', () => { const driveItem = mockDeep({ id: 'driveItemId', name: 'driveItemName' }) - writeable(driveItem.parentReference).path = '' + driveItem.parentReference.path = '' const sharedBy = { id: '1', displayName: 'user1' } as Identity const sharedWith = { id: '2', displayName: 'user2' } as Identity - writeable(driveItem).permissions = [ + driveItem.permissions = [ { roles: ['1', '2'], invitation: { invitedBy: { user: sharedBy } }, From c193bdb3b1bd7832830d236dbd6a05d110bfe3eb Mon Sep 17 00:00:00 2001 From: Matteo Date: Wed, 9 Sep 2026 10:49:32 +0200 Subject: [PATCH 15/19] fix(web-client): let graph errors keep their status and body The generated runtime wraps whatever its `fetchApi` throws in a `FetchError`, which buried the `HttpError` the core raises for a non-2xx response. Callers that branch on the status saw neither `statusCode` nor `data`, so the banned password hint on a public link never appeared and an aborted graph request stopped looking like an abort. Rethrowing from an `onError` middleware escapes the wrap for every graph operation at once. --- web/packages/web-client/src/graph/index.ts | 12 +++- .../tests/unit/graph/errors.spec.ts | 59 +++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 web/packages/web-client/tests/unit/graph/errors.spec.ts diff --git a/web/packages/web-client/src/graph/index.ts b/web/packages/web-client/src/graph/index.ts index 25ae63ae3b8..f9825395d9f 100644 --- a/web/packages/web-client/src/graph/index.ts +++ b/web/packages/web-client/src/graph/index.ts @@ -39,7 +39,17 @@ export const graph = (baseURI: string, httpClient: FetchClient): Graph => { signal: init?.signal ?? undefined, ...(params && { params }) }) - } + }, + // The runtime wraps everything `fetchApi` throws in a `FetchError`, which would bury the + // `HttpError` raised above and leave callers without `statusCode` or `data`. Rethrowing + // from `onError` escapes that wrap, and an abort stays an `AbortError`. + middleware: [ + { + onError: ({ error }) => { + throw error + } + } + ] }) return { diff --git a/web/packages/web-client/tests/unit/graph/errors.spec.ts b/web/packages/web-client/tests/unit/graph/errors.spec.ts new file mode 100644 index 00000000000..7bf39b24c34 --- /dev/null +++ b/web/packages/web-client/tests/unit/graph/errors.spec.ts @@ -0,0 +1,59 @@ +import { graph } from '../../../src/graph' +import { FetchClient } from '../../../src/http' +import { HttpError } from '../../../src/errors' + +describe('graph error propagation', () => { + let fetchMock: ReturnType + + beforeEach(() => { + fetchMock = vi.fn() + vi.stubGlobal('fetch', fetchMock) + }) + + /** + * The generated runtime wraps anything its `fetchApi` throws in a `FetchError`. Callers + * such as the "banned password" hint read `statusCode` and `data` off the rejection, so + * the `HttpError` from the core has to survive the round trip. + */ + it('rejects with the HttpError raised for a non-2xx response', async () => { + const body = { error: { message: 'password is commonly used' } } + fetchMock.mockResolvedValue( + new Response(JSON.stringify(body), { + status: 400, + headers: { 'Content-Type': 'application/json' } + }) + ) + + const permissions = graph('https://host', new FetchClient()).permissions + const request = permissions.setPermissionPassword('space-id', 'item-id', 'link-id', { + password: 'ownCloud-1' + }) + + await expect(request).rejects.toBeInstanceOf(HttpError) + await expect(request).rejects.toMatchObject({ statusCode: 400, data: body }) + }) + + it('keeps an abort an AbortError', async () => { + const controller = new AbortController() + fetchMock.mockImplementation( + (_url: string, init: RequestInit) => + new Promise((_resolve, reject) => { + // the generated client awaits before it calls fetch, so the abort may already be in + if (init.signal.aborted) { + reject(init.signal.reason) + return + } + init.signal.addEventListener('abort', () => reject(init.signal.reason)) + }) + ) + + const request = graph('https://host', new FetchClient()).drives.listMyDrives( + {}, + {}, + { signal: controller.signal } + ) + controller.abort(new DOMException('gone', 'AbortError')) + + await expect(request).rejects.toMatchObject({ name: 'AbortError' }) + }) +}) From 67d79be8249b92ec4dcd82890b11e558e2359398 Mon Sep 17 00:00:00 2001 From: Matteo Date: Wed, 9 Sep 2026 11:38:10 +0200 Subject: [PATCH 16/19] fix(web-client): let fetch set the multipart boundary for FormData bodies A caller-supplied `Content-Type: multipart/form-data` carries no boundary. Axios replaced the header before sending, fetch passes it through, so the server could not parse the body and the admin settings logo upload silently did nothing. --- .../web-client/src/http/fetchClient.ts | 9 ++++++ .../tests/unit/http/fetchClient.spec.ts | 30 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/web/packages/web-client/src/http/fetchClient.ts b/web/packages/web-client/src/http/fetchClient.ts index 2cb5091391a..9b7dd9b06c2 100644 --- a/web/packages/web-client/src/http/fetchClient.ts +++ b/web/packages/web-client/src/http/fetchClient.ts @@ -78,6 +78,15 @@ export class FetchClient { if (body === undefined || body === null) { return undefined } + if (body instanceof FormData) { + // Only fetch knows the multipart boundary it is about to generate, so a caller-supplied + // `multipart/form-data` header would reach the server without one and make the body + // unparseable. Dropping it lets fetch fill in the complete header, as axios did. + if (!headers.get('Content-Type')?.includes('boundary=')) { + headers.delete('Content-Type') + } + return body + } if (isBodyInit(body)) { return body } diff --git a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts index 04e46562cec..707a92b481c 100644 --- a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts +++ b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts @@ -251,6 +251,36 @@ describe('FetchClient', () => { expect(init.body).toBe(form) expect((init.headers as Headers).get('Content-Type')).toBeNull() }) + + /** + * A `multipart/form-data` header written by hand has no boundary, and fetch would send it + * verbatim, leaving the server unable to parse the body. Callers such as the logo upload + * relied on axios replacing the header, so it has to be dropped here. + */ + it('drops a boundary-less multipart Content-Type for FormData', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient().request('https://host/foo', { + method: 'POST', + body: new FormData(), + headers: { 'Content-Type': 'multipart/form-data' } + }) + + expect((lastCall()[1].headers as Headers).get('Content-Type')).toBeNull() + }) + + it('keeps a multipart Content-Type that already carries a boundary', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + const contentType = 'multipart/form-data; boundary=--abc' + + await new FetchClient().request('https://host/foo', { + method: 'POST', + body: new FormData(), + headers: { 'Content-Type': contentType } + }) + + expect((lastCall()[1].headers as Headers).get('Content-Type')).toBe(contentType) + }) }) describe('responseType', () => { From cd9f4937a7de3c4d347b1e09549f9682432f3aaa Mon Sep 17 00:00:00 2001 From: Matteo Date: Thu, 10 Sep 2026 09:48:35 +0200 Subject: [PATCH 17/19] fix(web): merge request headers case-insensitively, plus PR review fixes Header names are case-insensitive, but the header layers were merged with an object spread, where object keys are not. `Authorization` and `authorization` both survived it, and a spec-compliant `Headers` applies a record init with `append`, so the two were joined into `Bearer stale, Bearer fresh` instead of the override replacing the token. The graph bridge lowercased every per-request header name while the client-wide ones are canonically cased, which made the collision the normal case rather than an edge one. Merge each layer with `Headers.set()` instead, in the fetch client and in the graph `initOverrides` bridge, which had its own copy of the same spread. The new specs run under `@vitest-environment node`: happy-dom's `Headers` applies a record init with `set` semantics and would hide the bug. Also from the PR review: - read an error body with the caller's `responseType` rather than cloning the response, so a `blob` caller keeps getting a Blob on `error.data` - treat any rejection on an aborted signal as an abort, since `abort(reason)` rejects with the reason verbatim and only defaults to an `AbortError` - share the maintenance-mode `onResponse` handler between the webdav client and `ClientService`, with their pre-existing disagreement about clearing on an unrelated error made explicit instead of silently unified - pass the graph headers straight through as a `HeadersInit` and drop the unused `httpClient` from the graph factory options - collapse `combineSignals` onto `AbortSignal.any` - let an abort through `getFileContents` unwrapped - assert maintenance detection against the real `shouldResponseTriggerMaintenance` instead of a mock, which had been hiding that a 500 is not a maintenance signal --- .../change-replace-axios-with-fetch.md | 10 +++ web/packages/web-client/src/graph/index.ts | 18 ++-- web/packages/web-client/src/graph/types.ts | 22 +++-- .../web-client/src/helpers/maintenance.ts | 40 +++++++++ .../web-client/src/http/fetchClient.ts | 50 +++++++---- web/packages/web-client/src/http/types.ts | 3 +- .../web-client/src/webdav/getFileContents.ts | 7 +- web/packages/web-client/src/webdav/index.ts | 10 +-- .../tests/unit/graph/headers.spec.ts | 83 ++++++++++++++++++ .../tests/unit/http/fetchClient.spec.ts | 84 ++++++++++++++++++- .../src/composables/authContext/useRequest.ts | 14 ++-- web/packages/web-pkg/src/http/client.ts | 54 ++++-------- .../web-pkg/src/services/client/client.ts | 23 +++-- .../web-pkg/tests/unit/http/client.spec.ts | 26 ++++-- .../services/client-maintenance-mode.spec.ts | 48 ++++++----- web/tests/unit/config/vitest.init.ts | 11 ++- 16 files changed, 369 insertions(+), 134 deletions(-) create mode 100644 web/packages/web-client/tests/unit/graph/headers.spec.ts diff --git a/changelog/unreleased/change-replace-axios-with-fetch.md b/changelog/unreleased/change-replace-axios-with-fetch.md index 43a7be6a14e..85e22c080db 100644 --- a/changelog/unreleased/change-replace-axios-with-fetch.md +++ b/changelog/unreleased/change-replace-axios-with-fetch.md @@ -12,6 +12,9 @@ still exposes response headers as `headers['etag']` as well as `mockAxiosResolve` and `mockAxiosReject` still work, deprecated in favour of `mockHttpResponse` and `mockHttpError`. +Per-request `headers` are merged over the client-wide ones case-insensitively, so +an override replaces the header it names whatever case either side used. + Code that touches axios directly has to be adapted: - `new HttpClient()` takes `{ baseUrl, staticHeaders, headers, onResponse }` @@ -20,6 +23,13 @@ Code that touches axios directly has to be adapted: - The per-request config drops `timeout`, `withCredentials`, `onUploadProgress`, `cancelToken`, `paramsSerializer`, `transformRequest` / `transformResponse`, `validateStatus` and `baseURL`; `responseType` drops `document` and `stream`. +- The per-request `headers` are typed as `HeadersInit`, so a `Headers` is accepted + as well as a plain object. Assigning into them after the fact + (`config.headers.Authorization = …`) no longer type-checks; build the object + first, or use `new Headers()` and `set()`. +- `error.response` carries the body on `error.response.data`, as it did with + axios. Its underlying stream is consumed, so `error.response.json()` is not + available. - `graph()`, `ocs()`, `UrlSign` and `WebDavOptions` take a `FetchClient`, and the latter two rename `axiosClient` to `httpClient`. `webdav()` is unchanged. - Graph fields with an OData annotation use their generated camelCase names, diff --git a/web/packages/web-client/src/graph/index.ts b/web/packages/web-client/src/graph/index.ts index f9825395d9f..412afa4aa54 100644 --- a/web/packages/web-client/src/graph/index.ts +++ b/web/packages/web-client/src/graph/index.ts @@ -34,7 +34,7 @@ export const graph = (baseURI: string, httpClient: FetchClient): Graph => { const params = (init as Record>)?.[undeclaredParams] return httpClient.fetch(String(input), { method: init?.method, - headers: Object.fromEntries(new Headers(init?.headers).entries()), + headers: init?.headers, body: init?.body, signal: init?.signal ?? undefined, ...(params && { params }) @@ -53,13 +53,13 @@ export const graph = (baseURI: string, httpClient: FetchClient): Graph => { }) return { - activities: ActivitiesFactory({ httpClient, config }), - applications: ApplicationsFactory({ httpClient, config }), - tags: TagsFactory({ httpClient, config }), - drives: DrivesFactory({ httpClient, config }), - driveItems: DriveItemsFactory({ httpClient, config }), - users: UsersFactory({ httpClient, config }), - groups: GroupsFactory({ httpClient, config }), - permissions: PermissionsFactory({ httpClient, config }) + activities: ActivitiesFactory({ config }), + applications: ApplicationsFactory({ config }), + tags: TagsFactory({ config }), + drives: DrivesFactory({ config }), + driveItems: DriveItemsFactory({ config }), + users: UsersFactory({ config }), + groups: GroupsFactory({ config }), + permissions: PermissionsFactory({ config }) } } diff --git a/web/packages/web-client/src/graph/types.ts b/web/packages/web-client/src/graph/types.ts index 8d2466f38c8..463f76d48b5 100644 --- a/web/packages/web-client/src/graph/types.ts +++ b/web/packages/web-client/src/graph/types.ts @@ -1,8 +1,6 @@ import type { Configuration, InitOverrideFunction } from './generated' -import type { FetchClient } from '../http' export interface GraphFactoryOptions { - httpClient: FetchClient config: Configuration } @@ -29,11 +27,21 @@ export const undeclaredParams = Symbol('graph.undeclaredParams') * A plain object would be spread shallowly over the generated `RequestInit`, replacing * its headers wholesale and dropping `Content-Type`. A function receives the built init * and can merge instead. + * + * The merge goes through `Headers.set()` rather than an object spread so that an override + * replaces a generated header whatever case either of them used. An object spread would + * keep both spellings, and the duplicate would later be joined into a single + * comma-separated value. */ export const toInitOverrides = (options?: GraphRequestOptions): InitOverrideFunction => - async ({ init }) => ({ - ...(options?.signal && { signal: options.signal }), - ...(options?.params && { [undeclaredParams]: options.params }), - headers: { ...(init.headers as Record), ...(options?.headers ?? {}) } - }) + async ({ init }) => { + const headers = new Headers(init.headers) + Object.entries(options?.headers ?? {}).forEach(([name, value]) => headers.set(name, value)) + + return { + ...(options?.signal && { signal: options.signal }), + ...(options?.params && { [undeclaredParams]: options.params }), + headers + } + } diff --git a/web/packages/web-client/src/helpers/maintenance.ts b/web/packages/web-client/src/helpers/maintenance.ts index d2d94517a84..d7b971de24e 100644 --- a/web/packages/web-client/src/helpers/maintenance.ts +++ b/web/packages/web-client/src/helpers/maintenance.ts @@ -1,3 +1,5 @@ +import type { OnResponseArgs } from '../http' + /** * List of all API endpoints that should not trigger a maintenance mode warning even when they return 503 status code. */ @@ -10,3 +12,41 @@ export function shouldResponseTriggerMaintenance(responseStatus: number, request return false } + +export interface MaintenanceHandlerOptions { + /** + * Whether a non-2xx response that is *not* a maintenance signal clears maintenance mode. + * + * The two clients have always disagreed here, and both behaviours are kept as they were. + * The webdav client clears (its axios error interceptor called + * `onSetMaintenance(shouldResponseTriggerMaintenance(...))` unconditionally, so any non-503 + * error reset the flag); `ClientService` does not (its `#handleAxiosError` only ever set the + * flag to `true`). The inconsistency predates the fetch migration — unifying it would change + * when the maintenance banner disappears, which is a product decision, not a refactor. + */ + clearOnUnrelatedError?: boolean + /** extra bookkeeping on success, such as recording the last successful request time */ + onSuccess?: () => void +} + +/** + * Builds the `onResponse` handler that keeps maintenance mode in sync with what the server + * answers. Only a successful response clears maintenance mode unconditionally. + */ +export function maintenanceResponseHandler( + onSetMaintenance: (value: boolean) => void, + { clearOnUnrelatedError = false, onSuccess }: MaintenanceHandlerOptions = {} +) { + return ({ response, status, requestUrl }: OnResponseArgs): void => { + if (response?.ok) { + onSetMaintenance(false) + onSuccess?.() + return + } + + const isMaintenance = shouldResponseTriggerMaintenance(status, requestUrl) + if (isMaintenance || clearOnUnrelatedError) { + onSetMaintenance(isMaintenance) + } + } +} diff --git a/web/packages/web-client/src/http/fetchClient.ts b/web/packages/web-client/src/http/fetchClient.ts index 9b7dd9b06c2..aa4ffbf158d 100644 --- a/web/packages/web-client/src/http/fetchClient.ts +++ b/web/packages/web-client/src/http/fetchClient.ts @@ -35,7 +35,11 @@ export class FetchClient { }) } catch (error) { // An abort is a caller decision, not a transport failure: propagate it verbatim. - if (error?.name === 'AbortError') { + // `signal.aborted` and not just the error name, because `AbortController.abort(reason)` + // rejects with that reason as-is — it is only a DOMException named `AbortError` when no + // reason was given. A caller-supplied reason must not be mistaken for a network failure + // and reported as a 500, which would also trip maintenance detection. + if (error?.name === 'AbortError' || signal?.aborted) { throw error } // Degrade a transport failure to 500 so maintenance detection still runs. @@ -46,7 +50,7 @@ export class FetchClient { this.options.onResponse?.({ response, status: response.status, requestUrl }) if (!response.ok && throwOnError) { - throw await this.buildError(response) + throw await this.buildError(response, options.responseType) } return response @@ -66,12 +70,28 @@ export class FetchClient { } } - private buildHeaders(perRequest?: Record): Headers { - return new Headers({ - ...(this.options.staticHeaders || {}), - ...(this.options.headers?.() || {}), - ...(perRequest || {}) - }) + /** + * Merges the three header layers, later ones replacing earlier ones. + * + * Deliberately not an object spread into `new Headers()`: header names are + * case-insensitive, but object keys are not, so `Authorization` and `authorization` would + * both survive the spread — and a record init is applied with `append`, which joins the + * two into `Bearer stale, Bearer fresh` instead of overriding. `set()` per entry is + * case-insensitive and replaces, which is what a layered merge means. + */ + private buildHeaders(perRequest?: HeadersInit): Headers { + const headers = new Headers() + const apply = (layer?: HeadersInit) => { + if (layer) { + new Headers(layer).forEach((value, name) => headers.set(name, value)) + } + } + + apply(this.options.staticHeaders) + apply(this.options.headers?.()) + apply(perRequest) + + return headers } private buildBody(body: unknown, headers: Headers): BodyInit | undefined { @@ -96,14 +116,16 @@ export class FetchClient { return JSON.stringify(body) } - private async buildError(response: Response): Promise { - // Clone so that HttpError.response still exposes an unread body to callers. - const data = await this.readBodySafely(response.clone()) + private async buildError(response: Response, responseType?: ResponseType): Promise { + // Read as the caller asked for the success body: axios applied `responseType` to error + // bodies too, so a `blob` caller keeps getting a Blob on `error.data`. + const data = await this.readBodySafely(response, responseType) // `error.data` and `error.statusCode` are this repo's convention, but `error.response` // is reachable from outside it, where `.response.data` and `.response.headers['x']` // were the only spellings. Keep those working too; the `headers` override shadows the - // prototype accessor with a superset of it. + // prototype accessor with a superset of it. The body itself is already consumed — + // `error.response.data` is the way to it, not `error.response.json()`. Object.defineProperty(response, 'data', { value: data }) Object.defineProperty(response, 'headers', { value: httpHeaders(response.headers) }) @@ -115,9 +137,9 @@ export class FetchClient { ) } - private async readBodySafely(response: Response): Promise { + private async readBodySafely(response: Response, responseType?: ResponseType): Promise { try { - return await this.readBody(response) + return await this.readBody(response, responseType) } catch { // an unreadable body must not replace the HTTP error with a read error return undefined diff --git a/web/packages/web-client/src/http/types.ts b/web/packages/web-client/src/http/types.ts index 6cbfc95dfd8..f61cebe8412 100644 --- a/web/packages/web-client/src/http/types.ts +++ b/web/packages/web-client/src/http/types.ts @@ -23,7 +23,8 @@ export interface FetchClientOptions { export interface FetchRequestOptions { method?: string - headers?: Record + /** merged over the client-wide headers, case-insensitively */ + headers?: HeadersInit params?: Record /** JSON-encoded unless it is already a BodyInit */ body?: unknown diff --git a/web/packages/web-client/src/webdav/getFileContents.ts b/web/packages/web-client/src/webdav/getFileContents.ts index be6b39cd12d..4cffd76ddad 100644 --- a/web/packages/web-client/src/webdav/getFileContents.ts +++ b/web/packages/web-client/src/webdav/getFileContents.ts @@ -46,8 +46,11 @@ export const GetFileContentsFactory = (dav: DAV, { httpClient }: WebDavOptions) } } } catch (error) { - // the core already throws an HttpError carrying the response and status - if (error instanceof HttpError) { + // The core already throws an HttpError carrying the response and status, and lets an + // abort through verbatim. Both have to reach the caller unchanged — wrapping an abort + // would hide the `AbortError` name that callers distinguish a cancelled load by, and + // turn a restarted load into a visible error. + if (error instanceof HttpError || error?.name === 'AbortError' || opts.signal?.aborted) { throw error } throw new HttpError(error?.message, error?.response, error?.statusCode) diff --git a/web/packages/web-client/src/webdav/index.ts b/web/packages/web-client/src/webdav/index.ts index 7c6df7a0714..6a75e5a3db0 100644 --- a/web/packages/web-client/src/webdav/index.ts +++ b/web/packages/web-client/src/webdav/index.ts @@ -20,7 +20,7 @@ import { DAV } from './client/dav' import { ListFileVersionsFactory } from './listFileVersions' import { SetFavoriteFactory } from './setFavorite' import { ListFavoriteFilesFactory } from './listFavoriteFiles' -import { shouldResponseTriggerMaintenance } from '../helpers/maintenance' +import { maintenanceResponseHandler } from '../helpers/maintenance' export * from './constants' export * from './types' @@ -35,13 +35,7 @@ export const webdav = ( ): WebDAV => { const httpClient = new FetchClient({ ...(headers && { headers }), - onResponse: ({ response, status, requestUrl }) => { - if (response?.ok) { - onSetMaintenance(false) - return - } - onSetMaintenance(shouldResponseTriggerMaintenance(status, requestUrl)) - } + onResponse: maintenanceResponseHandler(onSetMaintenance, { clearOnUnrelatedError: true }) }) const options = { httpClient, baseUrl: baseURI, headers } diff --git a/web/packages/web-client/tests/unit/graph/headers.spec.ts b/web/packages/web-client/tests/unit/graph/headers.spec.ts new file mode 100644 index 00000000000..1d7613cb557 --- /dev/null +++ b/web/packages/web-client/tests/unit/graph/headers.spec.ts @@ -0,0 +1,83 @@ +/** + * @vitest-environment node + * + * Deliberately not happy-dom, whose `Headers` constructor applies a record init with `set` + * semantics where the spec — and therefore browsers and undici — applies it with `append`. + * These assertions are about a header merge, so a forgiving implementation would hide a + * duplicate-header bug rather than fail on it. + */ +import { graph } from '../../../src/graph' +import { FetchClient } from '../../../src/http' + +describe('graph request headers', () => { + let fetchMock: ReturnType + + beforeEach(() => { + fetchMock = vi.fn().mockResolvedValue( + new Response(JSON.stringify({ value: [] }), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) + ) + vi.stubGlobal('fetch', fetchMock) + }) + + const sentHeaders = () => new Headers(fetchMock.mock.calls[0][1].headers) + + it('sends the client-wide headers', async () => { + const client = new FetchClient({ + staticHeaders: { 'X-Requested-With': 'XMLHttpRequest' }, + headers: () => ({ Authorization: 'Bearer token' }) + }) + + await graph('https://host', client).tags.listTags() + + expect(sentHeaders().get('authorization')).toBe('Bearer token') + expect(sentHeaders().get('x-requested-with')).toBe('XMLHttpRequest') + }) + + /** + * A per-request override has to replace the client-wide header it names, not be appended + * next to it. Both spellings surviving would put `Bearer stale, Bearer fresh` on the wire, + * which no server accepts as a token. + */ + it('lets a per-request header override a differently-cased client-wide one', async () => { + const client = new FetchClient({ headers: () => ({ Authorization: 'Bearer stale' }) }) + + await graph('https://host', client).tags.listTags({ + headers: { authorization: 'Bearer fresh' } + }) + + expect(sentHeaders().get('authorization')).toBe('Bearer fresh') + }) + + /** + * The generated client writes `Content-Type` itself for a request with a body. An override + * has to replace that entry rather than land beside it as a second, lowercase one. + */ + it('lets a per-request header override a differently-cased generated one', async () => { + await graph('https://host', new FetchClient()).tags.assignTags( + { resourceId: 'storage$space!node', tags: ['a'] }, + { headers: { 'content-type': 'application/json; charset=utf-8' } } + ) + + expect(sentHeaders().get('content-type')).toBe('application/json; charset=utf-8') + // the body still goes out as JSON: the generated runtime decides that before the override + expect(fetchMock.mock.calls[0][1].body).toBe('{"resourceId":"storage$space!node","tags":["a"]}') + }) + + it('keeps a client-wide header a request does not name', async () => { + const client = new FetchClient({ headers: () => ({ Authorization: 'Bearer token' }) }) + + await graph('https://host', client).tags.assignTags( + { resourceId: 'storage$space!node', tags: ['a'] }, + { headers: { Purge: 'T' } } + ) + + const headers = sentHeaders() + expect(headers.get('purge')).toBe('T') + expect(headers.get('authorization')).toBe('Bearer token') + // set by the generated client for the request body, untouched by the override + expect(headers.get('content-type')).toBe('application/json') + }) +}) diff --git a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts index 707a92b481c..cb7bc0c84f0 100644 --- a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts +++ b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts @@ -1,3 +1,11 @@ +/** + * @vitest-environment node + * + * Deliberately not happy-dom. Its `Headers` constructor applies a record init with `set` + * semantics, whereas the spec — and therefore both browsers and undici — applies it with + * `append`. Every header assertion below is about that merge, so running them against a + * forgiving implementation would let a real duplicate-header bug pass. + */ import { FetchClient } from '../../../src/http' import { HttpError } from '../../../src/errors' @@ -98,13 +106,14 @@ describe('FetchClient', () => { expect(error.response.headers.get('retry-after')).toBe('30') }) - it('leaves the error response body unread', async () => { + it('reads the error body with the responseType the caller asked for', async () => { fetchMock.mockResolvedValue(new Response('{"error":"nope"}', { status: 400 })) - const error: HttpError = await new FetchClient().request('https://host/foo').catch((e) => e) + const error: HttpError = await new FetchClient() + .request('https://host/foo', { responseType: 'blob' }) + .catch((e) => e) - expect(error.response.bodyUsed).toBe(false) - await expect(error.response.json()).resolves.toEqual({ error: 'nope' }) + expect(error.data).toBeInstanceOf(Blob) }) it('returns the envelope instead of throwing when throwOnError is false', async () => { @@ -178,6 +187,26 @@ describe('FetchClient', () => { ) expect(onResponse).not.toHaveBeenCalled() }) + + /** + * `AbortController.abort(reason)` rejects the fetch with that reason verbatim, so an + * aborted request is not always identifiable by the error name. Treating one as a + * transport failure would report a 500 and could trip maintenance detection. + */ + it('propagates an abort whose reason is not named AbortError', async () => { + const controller = new AbortController() + const reason = new Error('superseded by a newer request') + fetchMock.mockImplementation(() => { + controller.abort(reason) + return Promise.reject(reason) + }) + const onResponse = vi.fn() + + await expect( + new FetchClient({ onResponse }).request('https://host/foo', { signal: controller.signal }) + ).rejects.toBe(reason) + expect(onResponse).not.toHaveBeenCalled() + }) }) describe('url and params', () => { @@ -359,6 +388,53 @@ describe('FetchClient', () => { expect(headers.get('X-Shared')).toBe('request') }) + /** + * Header names are case-insensitive, so a later layer has to replace an earlier one no + * matter how either spelled it. The graph bridge lowercases every per-request name, which + * makes the mismatch against the canonically-cased client headers the normal case rather + * than an edge one — and a spec-compliant `Headers` would join the two values with a comma, + * sending `Bearer stale, Bearer fresh` instead of overriding the token. + */ + it.each([ + ['authorization', 'Authorization'], + ['Authorization', 'authorization'], + ['X-REQUEST-ID', 'x-request-id'] + ])('overrides a %s client header with a per-request %s', async (clientName, requestName) => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient({ headers: () => ({ [clientName]: 'stale' }) }).request( + 'https://host/foo', + { headers: { [requestName]: 'fresh' } } + ) + + const headers = lastCall()[1].headers as Headers + expect(headers.get(clientName)).toBe('fresh') + expect([...headers]).toHaveLength(1) + }) + + it('overrides a staticHeader whose casing differs from the per-request one', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient({ staticHeaders: { 'X-Requested-With': 'XMLHttpRequest' } }).request( + 'https://host/foo', + { headers: { 'x-requested-with': 'fetch' } } + ) + + const headers = lastCall()[1].headers as Headers + expect(headers.get('x-requested-with')).toBe('fetch') + }) + + it('accepts a Headers instance as per-request headers', async () => { + fetchMock.mockResolvedValue(jsonResponse({})) + + await new FetchClient({ headers: () => ({ Authorization: 'stale' }) }).request( + 'https://host/foo', + { headers: new Headers({ authorization: 'fresh' }) } + ) + + expect((lastCall()[1].headers as Headers).get('authorization')).toBe('fresh') + }) + it('evaluates headers() on every request', async () => { // a fresh Response per call: a body is single-use fetchMock.mockImplementation(() => Promise.resolve(jsonResponse({}))) diff --git a/web/packages/web-pkg/src/composables/authContext/useRequest.ts b/web/packages/web-pkg/src/composables/authContext/useRequest.ts index 39dc6faffa3..6bdaee9f313 100644 --- a/web/packages/web-pkg/src/composables/authContext/useRequest.ts +++ b/web/packages/web-pkg/src/composables/authContext/useRequest.ts @@ -29,20 +29,24 @@ export function useRequest(options: RequestOptions = {}): RequestResult { ? clientService.httpAuthenticated : clientService.httpUnAuthenticated - config.headers = config.headers || {} + // A Headers rather than a plain object so that these entries replace a caller's own + // spelling of the same name instead of being appended alongside it. + const headers = new Headers(config.headers) if (authStore.publicLinkContextReady) { if (authStore.publicLinkPassword) { - config.headers.Authorization = + headers.set( + 'Authorization', 'Basic ' + - Buffer.from(['public', authStore.publicLinkPassword].join(':')).toString('base64') + Buffer.from(['public', authStore.publicLinkPassword].join(':')).toString('base64') + ) } if (authStore.publicLinkToken) { - config.headers['public-token'] = authStore.publicLinkToken + headers.set('public-token', authStore.publicLinkToken) } } - return httpClient.request({ ...config, method, url }) + return httpClient.request({ ...config, headers, method, url }) } return { diff --git a/web/packages/web-pkg/src/http/client.ts b/web/packages/web-pkg/src/http/client.ts index c6dfe860454..6d34451ce74 100644 --- a/web/packages/web-pkg/src/http/client.ts +++ b/web/packages/web-pkg/src/http/client.ts @@ -18,30 +18,11 @@ export type RequestConfig = Omit = HttpResponse : T> /** - * Ties a per-request signal to the client-wide one without leaking a listener per request: - * the caller disposes once the request has settled. + * Ties a per-request signal to the client-wide one. `AbortSignal.any` forwards the reason of + * whichever fires first and needs no listener bookkeeping of its own. */ -const combineSignals = (clientSignal: AbortSignal, requestSignal?: AbortSignal) => { - if (!requestSignal) { - return { signal: clientSignal, dispose: () => undefined } - } - - const controller = new AbortController() - const signals = [clientSignal, requestSignal] - const abort = (source: AbortSignal) => controller.abort(source.reason) - const listeners = signals.map((source) => { - const listener = () => abort(source) - source.addEventListener('abort', listener) - return () => source.removeEventListener('abort', listener) - }) - - const aborted = signals.find((source) => source.aborted) - if (aborted) { - abort(aborted) - } - - return { signal: controller.signal, dispose: () => listeners.forEach((remove) => remove()) } -} +const combineSignals = (clientSignal: AbortSignal, requestSignal?: AbortSignal) => + requestSignal ? AbortSignal.any([clientSignal, requestSignal]) : clientSignal export class HttpClient { private readonly client: FetchClient @@ -121,22 +102,17 @@ export class HttpClient { private async send(url: string, config: RequestConfig): Promise> { const { data, schema, signal, ...rest } = config - const { signal: combined, dispose } = combineSignals(this.controller.signal, signal) - - try { - const response = await this.client.request(url, { - ...rest, - body: data, - signal: combined - }) - - if (schema) { - return { ...response, data: schema.parse(response.data) } as Resolved - } - - return response as Resolved - } finally { - dispose() + + const response = await this.client.request(url, { + ...rest, + body: data, + signal: combineSignals(this.controller.signal, signal) + }) + + if (schema) { + return { ...response, data: schema.parse(response.data) } as Resolved } + + return response as Resolved } } diff --git a/web/packages/web-pkg/src/services/client/client.ts b/web/packages/web-pkg/src/services/client/client.ts index 1cfa56c3f00..2d837a748e8 100644 --- a/web/packages/web-pkg/src/services/client/client.ts +++ b/web/packages/web-pkg/src/services/client/client.ts @@ -10,7 +10,7 @@ import { Language } from 'vue3-gettext' import { FetchEventSourceInit } from '@microsoft/fetch-event-source' import { sse } from '@ownclouders/web-client/sse' import { AuthStore, ConfigStore } from '../../composables' -import { shouldResponseTriggerMaintenance } from '@ownclouders/web-client' +import { maintenanceResponseHandler } from '@ownclouders/web-client' const createFetchOptions = (authParams: AuthParameters, language: string): FetchEventSourceInit => { return { @@ -50,6 +50,11 @@ export class ClientService { 'X-Requested-With': 'XMLHttpRequest' } + private readonly maintenanceHandler = maintenanceResponseHandler( + (value: boolean) => this.configStore.setMaintenanceMode(value), + { onSuccess: () => (this.lastSuccessfulRequestTime = Math.floor(Date.now() / 1000)) } + ) + constructor(options: ClientServiceOptions) { this.configStore = options.configStore this.language = options.language @@ -179,22 +184,14 @@ export class ClientService { } /** - * Called for every response the client receives. The asymmetry is deliberate: only a - * successful response clears maintenance mode, and a non-2xx response never clears it. + * Called for every response the client receives. Only a successful response clears + * maintenance mode; a non-2xx response can only set it. * * `args.requestUrl` is the caller's URL, not `response.url` — the maintenance * allow-list is matched against relative paths. `args.status` is 500 when the transport * failed and there is no response at all. */ - public handleResponse({ response, status, requestUrl }: OnResponseArgs): void { - if (response?.ok) { - this.configStore.setMaintenanceMode(false) - this.lastSuccessfulRequestTime = Math.floor(Date.now() / 1000) - return - } - - if (shouldResponseTriggerMaintenance(status, requestUrl)) { - this.configStore.setMaintenanceMode(true) - } + public handleResponse(args: OnResponseArgs): void { + this.maintenanceHandler(args) } } diff --git a/web/packages/web-pkg/tests/unit/http/client.spec.ts b/web/packages/web-pkg/tests/unit/http/client.spec.ts index e08b1452175..7b11c27c49e 100644 --- a/web/packages/web-pkg/tests/unit/http/client.spec.ts +++ b/web/packages/web-pkg/tests/unit/http/client.spec.ts @@ -252,15 +252,31 @@ describe('HttpClient', () => { expect(fetchMock.mock.calls[0][1].signal.aborted).toBe(true) }) - test('removes its abort listeners once a request has settled', async () => { + test('cancels a request that carries a per-request signal of its own', async () => { + neverResolvingFetch() const client = new HttpClient() const controller = new AbortController() - const removeEventListener = vi.spyOn(controller.signal, 'removeEventListener') - await client.get('https://host/a', { signal: controller.signal }) - await client.get('https://host/b', { signal: controller.signal }) + const request = client.get('https://host/url', { signal: controller.signal }) + client.cancel('gone') + + await expect(request).rejects.toMatchObject({ name: 'AbortError', message: 'gone' }) + }) + + /** + * `abort(reason)` rejects with that reason verbatim, so a reason that is not a + * DOMException named `AbortError` must still reach the caller unchanged rather than be + * reported as a transport failure. + */ + test('propagates a per-request abort reason that is not an AbortError', async () => { + neverResolvingFetch() + const controller = new AbortController() + const reason = new Error('superseded') + + const request = new HttpClient().get('https://host/url', { signal: controller.signal }) + controller.abort(reason) - expect(removeEventListener).toHaveBeenCalledTimes(2) + await expect(request).rejects.toBe(reason) }) }) }) diff --git a/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts b/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts index 5fa49ea4d53..abdd1bb20ca 100644 --- a/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts +++ b/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts @@ -1,15 +1,18 @@ import { ClientService, useAuthStore, useConfigStore } from '../../../src/' import { Language } from 'vue3-gettext' import { createTestingPinia, writable } from '@ownclouders/web-test-helpers' -import { shouldResponseTriggerMaintenance } from '@ownclouders/web-client' import type { OnResponseArgs } from '@ownclouders/web-client' +/** + * `shouldResponseTriggerMaintenance` is deliberately left unmocked: the decision it encodes + * — which statuses and which endpoints count — is the thing under test here, and stubbing it + * would only assert that one function calls another. + */ vi.mock('@ownclouders/web-client', async (importOriginal) => ({ ...(await importOriginal()), graph: vi.fn(), ocs: vi.fn(), - webdav: vi.fn(), - shouldResponseTriggerMaintenance: vi.fn() + webdav: vi.fn() })) describe('ClientService maintenance mode', () => { @@ -18,11 +21,11 @@ describe('ClientService maintenance mode', () => { let configStore: ReturnType let authStore: ReturnType + let service: ClientService let onResponse: (args: OnResponseArgs) => void beforeEach(() => { createTestingPinia({ initialState: { auth: { accessToken: 'token' } } }) - vi.mocked(shouldResponseTriggerMaintenance).mockReset() vi.stubGlobal('fetch', vi.fn()) authStore = useAuthStore() @@ -30,7 +33,7 @@ describe('ClientService maintenance mode', () => { writable(configStore).serverUrl = serverUrl configStore.setMaintenanceMode = vi.fn() - const service = new ClientService({ + service = new ClientService({ configStore, language: language as Language, authStore @@ -47,53 +50,52 @@ describe('ClientService maintenance mode', () => { }) expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(false) + expect(service.lastSuccessfulRequestTime).not.toBeNull() }) - it('sets maintenance mode when shouldResponseTriggerMaintenance returns true', () => { - vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(true) - + it('sets maintenance mode for a 503', () => { onResponse({ response: new Response('{}', { status: 503 }), status: 503, requestUrl: 'some/url' }) - expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(503, 'some/url') expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(true) }) it('leaves maintenance state untouched for a 404', () => { - vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(false) - onResponse({ response: new Response('{}', { status: 404 }), status: 404, requestUrl: 'some/url' }) - expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(404, 'some/url') expect(configStore.setMaintenanceMode).not.toHaveBeenCalled() }) - it('trap 5: treats a transport failure as 503-eligible via status 500', () => { - vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(true) - + /** + * A transport failure has no response to read a status off, so it is reported as 500. As on + * master — where the axios error interceptor fell back to `error.response?.status || 500` — + * that is not a maintenance signal, so the flag is left alone rather than cleared. + */ + it('trap 5: leaves maintenance state untouched for a transport failure', () => { onResponse({ response: null, status: 500, requestUrl: 'some/url' }) - expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(500, 'some/url') - expect(configStore.setMaintenanceMode).toHaveBeenCalledWith(true) + expect(configStore.setMaintenanceMode).not.toHaveBeenCalled() }) - it('trap 4: forwards the relative request url to the maintenance check', () => { - vi.mocked(shouldResponseTriggerMaintenance).mockReturnValue(false) - const sseUrl = 'ocs/v2.php/apps/notifications/api/v1/notifications/sse' - + /** + * The allow-list is matched against the relative request url, which is why `onResponse` + * reports the caller's url rather than `response.url`. The notifications SSE endpoint + * answers 503 by design and must not raise the banner. + */ + it('trap 4: exempts an allow-listed endpoint from a 503', () => { onResponse({ response: new Response('{}', { status: 503 }), status: 503, - requestUrl: sseUrl + requestUrl: 'ocs/v2.php/apps/notifications/api/v1/notifications/sse' }) - expect(shouldResponseTriggerMaintenance).toHaveBeenCalledWith(503, sseUrl) + expect(configStore.setMaintenanceMode).not.toHaveBeenCalled() }) }) diff --git a/web/tests/unit/config/vitest.init.ts b/web/tests/unit/config/vitest.init.ts index 2a114008833..fbf7e4bf769 100644 --- a/web/tests/unit/config/vitest.init.ts +++ b/web/tests/unit/config/vitest.init.ts @@ -35,10 +35,13 @@ if (typeof window !== 'undefined' && !window.matchMedia) { vi.stubGlobal('define', vi.fn()) -// This is needed for KaTeX to work in the tests -Object.defineProperty(document, 'compatMode', { - value: 'CSS1Compat' -}) +// This is needed for KaTeX to work in the tests. Guarded because specs that assert against +// platform-native behaviour opt out of the DOM with `@vitest-environment node`. +if (typeof document !== 'undefined') { + Object.defineProperty(document, 'compatMode', { + value: 'CSS1Compat' + }) +} // Mock Math.random to return predictable values for tests let mathRandomCounter = 0 From 0ca256b0e681f532ace4e340d6f4ee62b97e3148 Mon Sep 17 00:00:00 2001 From: Matteo Date: Thu, 10 Sep 2026 11:13:47 +0200 Subject: [PATCH 18/19] chore(web): drop leaked test title prefixes, document the maintenance-mode widening --- changelog/unreleased/change-replace-axios-with-fetch.md | 6 ++++++ .../web-client/tests/unit/http/fetchClient.spec.ts | 8 ++++---- .../tests/unit/services/client-maintenance-mode.spec.ts | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/changelog/unreleased/change-replace-axios-with-fetch.md b/changelog/unreleased/change-replace-axios-with-fetch.md index 85e22c080db..e2798f2b4a7 100644 --- a/changelog/unreleased/change-replace-axios-with-fetch.md +++ b/changelog/unreleased/change-replace-axios-with-fetch.md @@ -15,6 +15,12 @@ still exposes response headers as `headers['etag']` as well as Per-request `headers` are merged over the client-wide ones case-insensitively, so an override replaces the header it names whatever case either side used. +Maintenance mode is now also detected on `clientService.httpAuthenticated`. Before, +only the unauthenticated, graph and ocs clients watched responses for it, as the +authenticated client had no response interceptor. Requests through it now raise and +clear the maintenance flag like any other, and they update +`lastSuccessfulRequestTime`, which seeds the MFA expiry timer. + Code that touches axios directly has to be adapted: - `new HttpClient()` takes `{ baseUrl, staticHeaders, headers, onResponse }` diff --git a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts index cb7bc0c84f0..26a8d6745a5 100644 --- a/web/packages/web-client/tests/unit/http/fetchClient.spec.ts +++ b/web/packages/web-client/tests/unit/http/fetchClient.spec.ts @@ -38,7 +38,7 @@ describe('FetchClient', () => { expect(result.headers.get('Content-Type')).toBe('application/json') }) - it('trap 2: headers also answer to bracket access, as axios headers did', async () => { + it('headers also answer to bracket access, as axios headers did', async () => { fetchMock.mockResolvedValue(jsonResponse({}, { headers: { 'Lock-Token': '' } })) const result = await new FetchClient().request('https://host/foo') @@ -48,7 +48,7 @@ describe('FetchClient', () => { }) }) - describe('trap 1: throws on non-2xx', () => { + describe('throws on non-2xx', () => { it.each([400, 404, 500, 503])('throws HttpError for %i', async (status) => { fetchMock.mockResolvedValue(new Response('{}', { status })) @@ -148,7 +148,7 @@ describe('FetchClient', () => { expect(onResponse).toHaveBeenCalledWith(expect.objectContaining({ status: 503 })) }) - it('trap 4: reports the caller URL, not the resolved response.url', async () => { + it('reports the caller URL, not the resolved response.url', async () => { const relative = 'ocs/v2.php/apps/notifications/api/v1/notifications/sse' fetchMock.mockResolvedValue(new Response('{}', { status: 503 })) const onResponse = vi.fn() @@ -160,7 +160,7 @@ describe('FetchClient', () => { expect(onResponse).toHaveBeenCalledWith(expect.objectContaining({ requestUrl: relative })) }) - it('trap 5: reports a transport failure as status 500 with a null response, then throws', async () => { + it('reports a transport failure as status 500 with a null response, then throws', async () => { fetchMock.mockRejectedValue(new TypeError('Failed to fetch')) const onResponse = vi.fn() diff --git a/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts b/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts index abdd1bb20ca..09d7a5b60a5 100644 --- a/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts +++ b/web/packages/web-pkg/tests/unit/services/client-maintenance-mode.spec.ts @@ -78,7 +78,7 @@ describe('ClientService maintenance mode', () => { * master — where the axios error interceptor fell back to `error.response?.status || 500` — * that is not a maintenance signal, so the flag is left alone rather than cleared. */ - it('trap 5: leaves maintenance state untouched for a transport failure', () => { + it('leaves maintenance state untouched for a transport failure', () => { onResponse({ response: null, status: 500, requestUrl: 'some/url' }) expect(configStore.setMaintenanceMode).not.toHaveBeenCalled() @@ -89,7 +89,7 @@ describe('ClientService maintenance mode', () => { * reports the caller's url rather than `response.url`. The notifications SSE endpoint * answers 503 by design and must not raise the banner. */ - it('trap 4: exempts an allow-listed endpoint from a 503', () => { + it('exempts an allow-listed endpoint from a 503', () => { onResponse({ response: new Response('{}', { status: 503 }), status: 503, From ebf22369806d37074c50abdbb434f6e7c11c86cc Mon Sep 17 00:00:00 2001 From: Matteo Date: Thu, 10 Sep 2026 17:49:16 +0200 Subject: [PATCH 19/19] fix(web): keep graph fields the generated decoder used to lose The typescript-fetch templates rebuild every response from the fields the spec declares, which is what lets them rename the OData annotated fields. Two consequences were unhandled. A field the spec does not declare is dropped. oCIS returns `attributes` on users, filled from OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES and displayed by the sharing autocomplete, and the field is not part of the upstream spec. It is now declared before generating, and the generation script fails if the spec stops matching the line it patches, so the field cannot go missing silently. A declared field the server omits is present holding `undefined`, so `'accountEnabled' in user` no longer says whether the server sent it. Three places read it that way: the login select in the user edit panel showed no value at all, its watcher kept reporting unsaved changes, and sorting the user list by login threw on `undefined.toString()`. The same went for `'total' in quota`, which showed a personal quota of `?` for users without one. --- .../change-replace-axios-with-fetch.md | 10 +++ .../components/Users/SideBar/DetailsPanel.vue | 2 +- .../components/Users/SideBar/EditPanel.vue | 16 ++-- .../src/components/Users/UsersList.vue | 4 +- .../Users/SideBar/DetailsPanel.spec.ts | 24 ++++- .../Users/SideBar/EditPanel.spec.ts | 74 +++++++++++++--- .../unit/components/Users/UsersList.spec.ts | 24 ++++- .../web-client/scripts/generate-openapi.sh | 32 ++++++- .../src/graph/generated/docs/User.md | 2 + .../src/graph/generated/models/User.ts | 6 ++ .../web-client/src/helpers/share/types.ts | 2 +- .../web-client/tests/unit/graph/users.spec.ts | 87 +++++++++++++++++++ 12 files changed, 257 insertions(+), 26 deletions(-) create mode 100644 web/packages/web-client/tests/unit/graph/users.spec.ts diff --git a/changelog/unreleased/change-replace-axios-with-fetch.md b/changelog/unreleased/change-replace-axios-with-fetch.md index e2798f2b4a7..fd748c91869 100644 --- a/changelog/unreleased/change-replace-axios-with-fetch.md +++ b/changelog/unreleased/change-replace-axios-with-fetch.md @@ -40,6 +40,16 @@ Code that touches axios directly has to be adapted: the latter two rename `axiosClient` to `httpClient`. `webdav()` is unchanged. - Graph fields with an OData annotation use their generated camelCase names, e.g. `atLibreGraphPermissionsActions`. The wire format is unchanged. +- Graph responses are rebuilt from the fields the spec declares, which is what makes + the renaming above possible. A field the spec does not declare is dropped, so the + oCIS-only `attributes` on users is added to the spec before generating. A declared + field the server omits is present and holds `undefined`, so + `'accountEnabled' in user` no longer tells whether the server sent it. Compare + against `undefined` instead. +- `CollaboratorAutoCompleteItem.attributes` is optional, matching the `attributes` on + the generated `User`. The field is only there when + `OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES` is configured, so read it as + `item.attributes?.join(…)`. - The generated client loses its `*ApiFactory`, `*ApiFp` and `*AxiosParamCreator` exports. The `*Api` classes now take one options object per operation and resolve with the payload. diff --git a/web/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue b/web/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue index e3a068e1b63..f0e9bed0508 100644 --- a/web/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue +++ b/web/packages/web-app-admin-settings/src/components/Users/SideBar/DetailsPanel.vue @@ -126,7 +126,7 @@ const groupsDisplayValue = computed(() => { .join(', ') }) const showUserQuota = computed(() => { - return 'total' in (user.drive?.quota || {}) + return user.drive?.quota?.total !== undefined }) const quotaDisplayValue = computed(() => { return user.drive.quota.total === 0 diff --git a/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue b/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue index 77d16ea9913..671cd155aac 100644 --- a/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue +++ b/web/packages/web-app-admin-settings/src/components/Users/SideBar/EditPanel.vue @@ -393,11 +393,8 @@ const loginOptions = computed(() => { ] }) const selectedLoginValue = computed(() => { - return unref(loginOptions).find((option) => - !('accountEnabled' in unref(editUser)) - ? option.value === true - : unref(editUser).accountEnabled === option.value - ) + const accountEnabled = unref(editUser).accountEnabled ?? true + return unref(loginOptions).find((option) => option.value === accountEnabled) }) const translatedRoleOptions = computed(() => { return roles.map((role) => { @@ -443,11 +440,14 @@ watch( () => { /** * Property accountEnabled won't be always set, but this still means, that login is allowed. - * So we actually don't need to change the property if missing and not set to forbidden in the UI. + * So we actually don't need to change the property if unset and not set to forbidden in the UI. * This also avoids the compare save dialog from displaying that there are unsaved changes. + * The value is reset instead of deleted, so that it keeps matching the unset original: the + * graph client materializes every declared field, and the dialog compares with `isEqual`, + * which tells an absent key apart from one holding `undefined`. */ - if (unref(editUser).accountEnabled === true && !('accountEnabled' in user)) { - delete unref(editUser).accountEnabled + if (unref(editUser).accountEnabled === true && user.accountEnabled === undefined) { + unref(editUser).accountEnabled = undefined } }, { diff --git a/web/packages/web-app-admin-settings/src/components/Users/UsersList.vue b/web/packages/web-app-admin-settings/src/components/Users/UsersList.vue index dd4f7265d0c..10ae60c4459 100644 --- a/web/packages/web-app-admin-settings/src/components/Users/UsersList.vue +++ b/web/packages/web-app-admin-settings/src/components/Users/UsersList.vue @@ -274,8 +274,8 @@ const orderBy = (list: User[], prop: string, desc: boolean) => { b = getRoleDisplayNameByUser(user2) break case 'accountEnabled': - a = ('accountEnabled' in user1 ? user1.accountEnabled : true).toString() - b = ('accountEnabled' in user2 ? user2.accountEnabled : true).toString() + a = (user1.accountEnabled ?? true).toString() + b = (user2.accountEnabled ?? true).toString() break default: a = user1[prop as keyof User].toString() || '' diff --git a/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/DetailsPanel.spec.ts b/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/DetailsPanel.spec.ts index 30f8d96cd87..a790b1d732e 100644 --- a/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/DetailsPanel.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/DetailsPanel.spec.ts @@ -1,4 +1,4 @@ -import { User } from '@ownclouders/web-client/graph/generated' +import { DriveFromJSON, User } from '@ownclouders/web-client/graph/generated' import DetailsPanel from '../../../../../src/components/Users/SideBar/DetailsPanel.vue' import UserInfoBox from '../../../../../src/components/Users/SideBar/UserInfoBox.vue' import { PartialComponentProps, defaultPlugins, shallowMount } from '@ownclouders/web-test-helpers' @@ -58,6 +58,28 @@ describe('DetailsPanel', () => { expect(wrapper.find('[data-testid="no-user-selected"]').exists()).toBeFalsy() }) }) + describe('computed method "showUserQuota"', () => { + /** + * The graph client materializes every declared field, so a drive that comes back without a + * quota limit still has a `quota` object carrying `total: undefined`. Going by the presence + * of the key showed the quota with an unknown size instead of hiding it. + */ + it('should be false if the drive has no quota total', () => { + const drive = DriveFromJSON({ id: 'drive', quota: {} }) + const { wrapper } = getWrapper({ + props: { user: { ...defaultUser, drive } as User, users: [defaultUser] } + }) + expect((wrapper.vm as any).showUserQuota).toBeFalsy() + }) + it('should be true if the drive has a quota total', () => { + const drive = DriveFromJSON({ id: 'drive', quota: { total: 100 } }) + const { wrapper } = getWrapper({ + props: { user: { ...defaultUser, drive } as User, users: [defaultUser] } + }) + expect((wrapper.vm as any).showUserQuota).toBeTruthy() + }) + }) + describe('computed method "multipleUsers"', () => { it('should be false if no users are given', () => { const { wrapper } = getWrapper({ props: { user: null, users: [] } }) diff --git a/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts b/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts index 53a67222b18..9d67cae10c8 100644 --- a/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/components/Users/SideBar/EditPanel.spec.ts @@ -6,7 +6,8 @@ import { shallowMount } from '@ownclouders/web-test-helpers' import { mock } from 'vitest-mock-extended' -import { Drive, Group, User } from '@ownclouders/web-client/graph/generated' +import { isEqual } from 'lodash-es' +import { Drive, Group, User, UserFromJSON } from '@ownclouders/web-client/graph/generated' import { CapabilityStore } from '@ownclouders/web-pkg' import GroupSelect from '../../../../../src/components/Users/GroupSelect.vue' @@ -156,6 +157,49 @@ describe('EditPanel', () => { }) }) + /** + * A user the server sends without an accountEnabled is allowed to log in. The graph client + * materializes every declared field, so such a user still carries the property, holding + * `undefined` - the field being there says nothing about what the server sent. + */ + describe('computed method "selectedLoginValue"', () => { + const decodedUser = (accountEnabled?: boolean) => + UserFromJSON({ + id: '2', + displayName: 'jan', + onPremisesSamAccountName: 'jan', + memberOf: [], + ...(accountEnabled !== undefined && { accountEnabled }) + }) + + it('should select "Allowed" if the user has no accountEnabled', () => { + const { wrapper } = getWrapper({ user: decodedUser() }) + expect((wrapper.vm as any).selectedLoginValue.value).toBe(true) + }) + it.each([true, false])('should select the option matching an accountEnabled of %s', (value) => { + const { wrapper } = getWrapper({ user: decodedUser(value) }) + expect((wrapper.vm as any).selectedLoginValue.value).toBe(value) + }) + + it('should not report unsaved changes when login stays allowed for an unset accountEnabled', async () => { + const user = decodedUser() + const { wrapper } = getWrapper({ user }) + ;(wrapper.vm as any).editUser.accountEnabled = true + await wrapper.vm.$nextTick() + + // the comparison the save dialog makes, which tells an absent key apart from `undefined` + expect(isEqual(user, (wrapper.vm as any).editUser)).toBe(true) + }) + it('should report unsaved changes when login gets forbidden for an unset accountEnabled', async () => { + const user = decodedUser() + const { wrapper } = getWrapper({ user }) + ;(wrapper.vm as any).editUser.accountEnabled = false + await wrapper.vm.$nextTick() + + expect(isEqual(user, (wrapper.vm as any).editUser)).toBe(false) + }) + }) + describe('group select', () => { it('takes all available groups', () => { const { wrapper } = getWrapper() @@ -177,8 +221,14 @@ describe('EditPanel', () => { function getWrapper({ readOnlyUserAttributes = [], selectedGroups = [], - groups = availableGroupOptions -}: { readOnlyUserAttributes?: string[]; selectedGroups?: Group[]; groups?: Group[] } = {}) { + groups = availableGroupOptions, + user +}: { + readOnlyUserAttributes?: string[] + selectedGroups?: Group[] + groups?: Group[] + user?: User +} = {}) { const mocks = defaultComponentMocks() const capabilities = { graph: { users: { read_only_attributes: readOnlyUserAttributes }, tags: { max_tag_length: 30 } } @@ -188,14 +238,16 @@ function getWrapper({ mocks, wrapper: shallowMount(EditPanel, { props: { - user: { - id: '2', - displayName: 'jan', - mail: 'jan@owncloud.com', - passwordProfile: { password: '' }, - drive: { quota: {} } as Drive, - memberOf: selectedGroups - } as User, + user: + user ?? + ({ + id: '2', + displayName: 'jan', + mail: 'jan@owncloud.com', + passwordProfile: { password: '' }, + drive: { quota: {} } as Drive, + memberOf: selectedGroups + } as User), roles: [{ id: '1', displayName: 'admin' }], groups, applicationId: '1' diff --git a/web/packages/web-app-admin-settings/tests/unit/components/Users/UsersList.spec.ts b/web/packages/web-app-admin-settings/tests/unit/components/Users/UsersList.spec.ts index 5addd2b60a7..13b766fc165 100644 --- a/web/packages/web-app-admin-settings/tests/unit/components/Users/UsersList.spec.ts +++ b/web/packages/web-app-admin-settings/tests/unit/components/Users/UsersList.spec.ts @@ -8,7 +8,7 @@ import { import { displayPositionedDropdown, eventBus, queryItemAsString } from '@ownclouders/web-pkg' import { SideBarEventTopics } from '@ownclouders/web-pkg' import { useUserSettingsStore } from '../../../../src/composables/stores/userSettings' -import { User } from '@ownclouders/web-client/graph/generated' +import { User, UserFromJSON } from '@ownclouders/web-client/graph/generated' const getUserMocks = () => [{ id: '1', displayName: 'jan' }] as User[] vi.mock('@ownclouders/web-pkg', async (importOriginal) => ({ @@ -93,6 +93,28 @@ describe('UsersList', () => { { appRoleAssignments: [{ appRoleId: '1' }] } ]) }) + + /** + * A user whose accountEnabled the server does not send still carries the property after + * being decoded by the graph client, holding `undefined`. Treating a present key as a sent + * value made the sort read `undefined` and throw. + */ + it('should sort a user without an accountEnabled as being allowed to log in', () => { + const { wrapper } = getWrapper() + const users = [ + UserFromJSON({ displayName: 'forbidden', accountEnabled: false }), + UserFromJSON({ displayName: 'unset' }) + ] as User[] + + expect((wrapper.vm as any).orderBy(users, 'accountEnabled', false)).toEqual([ + users[0], + users[1] + ]) + expect((wrapper.vm as any).orderBy(users, 'accountEnabled', true)).toEqual([ + users[1], + users[0] + ]) + }) }) it('should show the context menu on right click', async () => { const users = getUserMocks() diff --git a/web/packages/web-client/scripts/generate-openapi.sh b/web/packages/web-client/scripts/generate-openapi.sh index 9803754aaf4..fe2ebcb82e0 100755 --- a/web/packages/web-client/scripts/generate-openapi.sh +++ b/web/packages/web-client/scripts/generate-openapi.sh @@ -9,18 +9,48 @@ set -eu # `*ToJSON` serializers, so a PATCH body such as `{ quota: { total: 500 } }` would go out # as `{ quota: {} }`. oCIS does accept these fields on write, so the annotation is stripped # from the spec before generating. +# +# oCIS also returns a field the spec does not declare: `attributes` on users, added by +# `UserWithAttributes` in services/graph and filled from +# OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES. The typescript-fetch templates rebuild every +# response from the declared fields only, so an undeclared field is dropped during decoding. +# It is declared on the read model below to keep it. SPEC_URL="https://raw.githubusercontent.com/owncloud/libre-graph-api/main/api/openapi-spec/v1.0.yaml" GRAPH_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")/../src/graph" && pwd)" SPEC_FILE="$GRAPH_DIR/openapi-spec.yaml" +# The single line the `user` schema composes `userUpdate` into. The two other references to +# that schema are request bodies and sit at a different indentation. +USER_ALL_OF_LINE=" - \$ref: '#/components/schemas/userUpdate'" + cleanup() { rm -f "$SPEC_FILE" } trap cleanup EXIT rm -rf "$GRAPH_DIR/generated" -curl -sSfL "$SPEC_URL" | sed '/^ *readOnly: true$/d' >"$SPEC_FILE" +curl -sSfL "$SPEC_URL" \ + | sed '/^ *readOnly: true$/d' \ + | awk -v anchor="$USER_ALL_OF_LINE" ' + { print } + $0 == anchor { + print " - type: object" + print " properties:" + print " attributes:" + print " type: array" + print " items:" + print " type: string" + print " description: Attributes of the user as configured via OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES. Not part of the upstream spec, added by oCIS. Read-only." + patched = 1 + } + END { if (!patched) exit 1 } + ' >"$SPEC_FILE" || { + echo "failed to declare the oCIS-only user 'attributes' field: the spec no longer contains" >&2 + echo "the expected line, adapt USER_ALL_OF_LINE to how the 'user' schema now composes" >&2 + echo "'userUpdate'. Regenerating without it silently drops the field from user responses." >&2 + exit 1 +} docker run --rm -v "$GRAPH_DIR:/local" openapitools/openapi-generator-cli generate \ -i /local/openapi-spec.yaml \ diff --git a/web/packages/web-client/src/graph/generated/docs/User.md b/web/packages/web-client/src/graph/generated/docs/User.md index 47429fcda4f..be073b55bf5 100644 --- a/web/packages/web-client/src/graph/generated/docs/User.md +++ b/web/packages/web-client/src/graph/generated/docs/User.md @@ -26,6 +26,7 @@ Name | Type `externalID` | string `crossInstanceReference` | string `instances` | [Array<Instance>](Instance.md) +`attributes` | Array<string> ## Example @@ -53,6 +54,7 @@ const example = { "externalID": null, "crossInstanceReference": null, "instances": null, + "attributes": null, } satisfies User console.log(example) diff --git a/web/packages/web-client/src/graph/generated/models/User.ts b/web/packages/web-client/src/graph/generated/models/User.ts index 154da5ed637..9c562ed041c 100644 --- a/web/packages/web-client/src/graph/generated/models/User.ts +++ b/web/packages/web-client/src/graph/generated/models/User.ts @@ -145,6 +145,10 @@ export interface User { * oCIS instances that the user is either a member or a guest of. */ instances?: Array; + /** + * Attributes of the user as configured via OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES. Not part of the upstream spec, added by oCIS. Read-only. + */ + attributes?: Array; } /** @@ -185,6 +189,7 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User 'externalID': json['externalID'] == null ? undefined : json['externalID'], 'crossInstanceReference': json['crossInstanceReference'] == null ? undefined : json['crossInstanceReference'], 'instances': json['instances'] == null ? undefined : ((json['instances'] as Array).map(InstanceFromJSON)), + 'attributes': json['attributes'] == null ? undefined : json['attributes'], }; } @@ -218,6 +223,7 @@ export function UserToJSONTyped(value?: User | null, ignoreDiscriminator: boolea 'externalID': value['externalID'], 'crossInstanceReference': value['crossInstanceReference'], 'instances': value['instances'] == null ? undefined : ((value['instances'] as Array).map(InstanceToJSON)), + 'attributes': value['attributes'], }; } diff --git a/web/packages/web-client/src/helpers/share/types.ts b/web/packages/web-client/src/helpers/share/types.ts index 490c04ae9c6..beecf0aa16d 100644 --- a/web/packages/web-client/src/helpers/share/types.ts +++ b/web/packages/web-client/src/helpers/share/types.ts @@ -86,5 +86,5 @@ export interface CollaboratorAutoCompleteItem { mail?: string onPremisesSamAccountName?: string identities?: ObjectIdentity[] - attributes: string[] + attributes?: string[] } diff --git a/web/packages/web-client/tests/unit/graph/users.spec.ts b/web/packages/web-client/tests/unit/graph/users.spec.ts new file mode 100644 index 00000000000..047fbedc604 --- /dev/null +++ b/web/packages/web-client/tests/unit/graph/users.spec.ts @@ -0,0 +1,87 @@ +import { graph } from '../../../src/graph' +import { FetchClient } from '../../../src/http' + +const respondWith = (payload: unknown) => { + const fetchMock = vi.fn().mockResolvedValue( + new Response(JSON.stringify(payload), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) + ) + vi.stubGlobal('fetch', fetchMock) + return fetchMock +} + +const client = () => graph('https://host', new FetchClient()) + +describe('graph users', () => { + /** + * oCIS returns `attributes` on users, filled from OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES, and + * the sharing autocomplete displays them. The upstream spec does not declare the field, and + * the generator rebuilds every response from the declared fields only, so it has to be + * declared during generation or it gets dropped on the way out of the client. + */ + it('keeps the oCIS-only attributes when listing users', async () => { + respondWith({ + value: [ + { + id: 'alice', + displayName: 'Alice', + onPremisesSamAccountName: 'alice', + attributes: ['Engineering', 'Vienna'] + } + ] + }) + + const [user] = await client().users.listUsers({}) + + expect(user.attributes).toEqual(['Engineering', 'Vienna']) + }) + + it('keeps the oCIS-only attributes when getting a single user', async () => { + respondWith({ + id: 'alice', + displayName: 'Alice', + onPremisesSamAccountName: 'alice', + attributes: ['Engineering'] + }) + + const user = await client().users.getUser('alice') + + expect(user.attributes).toEqual(['Engineering']) + }) + + it('omits the attributes when the server does not send any', async () => { + respondWith({ id: 'alice', displayName: 'Alice', onPremisesSamAccountName: 'alice' }) + + const user = await client().users.getUser('alice') + + expect(user.attributes).toBeUndefined() + }) + + /** + * The generator materializes every declared field, so a response that omits `accountEnabled` + * still yields an own property holding `undefined`. Consumers therefore cannot tell an unset + * field apart with `'accountEnabled' in user` and have to compare against `undefined`. + */ + it('reports an unset accountEnabled as undefined', async () => { + respondWith({ id: 'alice', displayName: 'Alice', onPremisesSamAccountName: 'alice' }) + + const user = await client().users.getUser('alice') + + expect(user.accountEnabled).toBeUndefined() + }) + + it.each([true, false])('passes an accountEnabled of %s through', async (accountEnabled) => { + respondWith({ + id: 'alice', + displayName: 'Alice', + onPremisesSamAccountName: 'alice', + accountEnabled + }) + + const user = await client().users.getUser('alice') + + expect(user.accountEnabled).toBe(accountEnabled) + }) +})