Skip to content

Commit

Permalink
downgrade fastapi and generate client
Browse files Browse the repository at this point in the history
  • Loading branch information
beggers committed Jan 3, 2024
1 parent 6aee0be commit a158b02
Show file tree
Hide file tree
Showing 4 changed files with 4,424 additions and 94 deletions.
142 changes: 64 additions & 78 deletions clients/js/src/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,12 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
},
/**
* @summary Create Database
* @param {string} [database]
* @param {string} [tenant]
* @param {Api.CreateDatabase} request
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
createDatabase(tenant: string | undefined, request: Api.CreateDatabase, options: RequestInit = {}): FetchArgs {
// verify required parameter 'request' is not null or undefined
if (request === null || request === undefined) {
throw new RequiredError('request', 'Required parameter request was null or undefined when calling createDatabase.');
}
createDatabase(database: string | undefined, tenant: string | undefined, options: RequestInit = {}): FetchArgs {
let localVarPath = `/api/v1/databases`;
const localVarPathQueryStart = localVarPath.indexOf("?");
const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
Expand All @@ -289,17 +285,15 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
localVarPath = localVarPath.substring(0, localVarPathQueryStart);
}

if (database !== undefined) {
localVarQueryParameter.append('database', String(database));
}

if (tenant !== undefined) {
localVarQueryParameter.append('tenant', String(tenant));
}

localVarHeaderParameter.set('Content-Type', 'application/json');

localVarRequestOptions.headers = localVarHeaderParameter;

if (request !== undefined) {
localVarRequestOptions.body = JSON.stringify(request || {});
}

const localVarQueryParameterString = localVarQueryParameter.toString();
if (localVarQueryParameterString) {
Expand All @@ -312,15 +306,11 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
},
/**
* @summary Create Tenant
* @param {Api.CreateTenant} request
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
createTenant(request: Api.CreateTenant, options: RequestInit = {}): FetchArgs {
// verify required parameter 'request' is not null or undefined
if (request === null || request === undefined) {
throw new RequiredError('request', 'Required parameter request was null or undefined when calling createTenant.');
}
createTenant(tenant: string | undefined, options: RequestInit = {}): FetchArgs {
let localVarPath = `/api/v1/tenants`;
const localVarPathQueryStart = localVarPath.indexOf("?");
const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
Expand All @@ -330,13 +320,11 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
localVarPath = localVarPath.substring(0, localVarPathQueryStart);
}

localVarHeaderParameter.set('Content-Type', 'application/json');
if (tenant !== undefined) {
localVarQueryParameter.append('tenant', String(tenant));
}

localVarRequestOptions.headers = localVarHeaderParameter;

if (request !== undefined) {
localVarRequestOptions.body = JSON.stringify(request || {});
}

const localVarQueryParameterString = localVarQueryParameter.toString();
if (localVarQueryParameterString) {
Expand Down Expand Up @@ -433,18 +421,13 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
},
/**
* @summary Get Database
* @param {string} database
* @param {string} [database]
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
getDatabase(database: string, tenant: string | undefined, options: RequestInit = {}): FetchArgs {
// verify required parameter 'database' is not null or undefined
if (database === null || database === undefined) {
throw new RequiredError('database', 'Required parameter database was null or undefined when calling getDatabase.');
}
let localVarPath = `/api/v1/databases/{database}`
.replace('{database}', encodeURIComponent(String(database)));
getDatabase(database: string | undefined, tenant: string | undefined, options: RequestInit = {}): FetchArgs {
let localVarPath = `/api/v1/databases`;
const localVarPathQueryStart = localVarPath.indexOf("?");
const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
Expand All @@ -453,6 +436,10 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
localVarPath = localVarPath.substring(0, localVarPathQueryStart);
}

if (database !== undefined) {
localVarQueryParameter.append('database', String(database));
}

if (tenant !== undefined) {
localVarQueryParameter.append('tenant', String(tenant));
}
Expand Down Expand Up @@ -513,17 +500,12 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
},
/**
* @summary Get Tenant
* @param {string} tenant
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
getTenant(tenant: string, options: RequestInit = {}): FetchArgs {
// verify required parameter 'tenant' is not null or undefined
if (tenant === null || tenant === undefined) {
throw new RequiredError('tenant', 'Required parameter tenant was null or undefined when calling getTenant.');
}
let localVarPath = `/api/v1/tenants/{tenant}`
.replace('{tenant}', encodeURIComponent(String(tenant)));
getTenant(tenant: string | undefined, options: RequestInit = {}): FetchArgs {
let localVarPath = `/api/v1/tenants`;
const localVarPathQueryStart = localVarPath.indexOf("?");
const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
Expand All @@ -532,6 +514,10 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
localVarPath = localVarPath.substring(0, localVarPathQueryStart);
}

if (tenant !== undefined) {
localVarQueryParameter.append('tenant', String(tenant));
}

localVarRequestOptions.headers = localVarHeaderParameter;

const localVarQueryParameterString = localVarQueryParameter.toString();
Expand Down Expand Up @@ -571,14 +557,14 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
},
/**
* @summary List Collections
* @param {string} [tenant]
* @param {string} [database]
* @param {number} [limit]
* @param {number} [offset]
* @param {string} [tenant]
* @param {string} [database]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
listCollections(tenant: string | undefined, database: string | undefined, limit: number | undefined, offset: number | undefined, options: RequestInit = {}): FetchArgs {
listCollections(limit: number | undefined, offset: number | undefined, tenant: string | undefined, database: string | undefined, options: RequestInit = {}): FetchArgs {
let localVarPath = `/api/v1/collections`;
const localVarPathQueryStart = localVarPath.indexOf("?");
const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
Expand All @@ -588,14 +574,6 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
localVarPath = localVarPath.substring(0, localVarPathQueryStart);
}

if (tenant !== undefined) {
localVarQueryParameter.append('tenant', String(tenant));
}

if (database !== undefined) {
localVarQueryParameter.append('database', String(database));
}

if (limit !== undefined) {
localVarQueryParameter.append('limit', String(limit));
}
Expand All @@ -604,6 +582,14 @@ export const ApiApiFetchParamCreator = function (configuration?: Configuration)
localVarQueryParameter.append('offset', String(offset));
}

if (tenant !== undefined) {
localVarQueryParameter.append('tenant', String(tenant));
}

if (database !== undefined) {
localVarQueryParameter.append('database', String(database));
}

localVarRequestOptions.headers = localVarHeaderParameter;

const localVarQueryParameterString = localVarQueryParameter.toString();
Expand Down Expand Up @@ -1039,13 +1025,13 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
* @summary Create Database
* @param {string} [database]
* @param {string} [tenant]
* @param {Api.CreateDatabase} request
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
createDatabase(tenant: string | undefined, request: Api.CreateDatabase, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.CreateDatabase200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).createDatabase(tenant, request, options);
createDatabase(database: string | undefined, tenant: string | undefined, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.CreateDatabase200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).createDatabase(database, tenant, options);
return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
const contentType = response.headers.get('Content-Type');
Expand All @@ -1069,12 +1055,12 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
* @summary Create Tenant
* @param {Api.CreateTenant} request
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
createTenant(request: Api.CreateTenant, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.CreateTenant200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).createTenant(request, options);
createTenant(tenant: string | undefined, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.CreateTenant200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).createTenant(tenant, options);
return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
const contentType = response.headers.get('Content-Type');
Expand Down Expand Up @@ -1160,12 +1146,12 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
* @summary Get Database
* @param {string} database
* @param {string} [database]
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
getDatabase(database: string, tenant: string | undefined, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.GetDatabase200Response> {
getDatabase(database: string | undefined, tenant: string | undefined, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.GetDatabase200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).getDatabase(database, tenant, options);
return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
Expand Down Expand Up @@ -1220,11 +1206,11 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
* @summary Get Tenant
* @param {string} tenant
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
getTenant(tenant: string, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.GetTenant200Response> {
getTenant(tenant: string | undefined, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.GetTenant200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).getTenant(tenant, options);
return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
Expand Down Expand Up @@ -1271,15 +1257,15 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
* @summary List Collections
* @param {string} [tenant]
* @param {string} [database]
* @param {number} [limit]
* @param {number} [offset]
* @param {string} [tenant]
* @param {string} [database]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
listCollections(tenant: string | undefined, database: string | undefined, limit: number | undefined, offset: number | undefined, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.ListCollections200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).listCollections(tenant, database, limit, offset, options);
listCollections(limit: number | undefined, offset: number | undefined, tenant: string | undefined, database: string | undefined, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.ListCollections200Response> {
const localVarFetchArgs = ApiApiFetchParamCreator(configuration).listCollections(limit, offset, tenant, database, options);
return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
const contentType = response.headers.get('Content-Type');
Expand Down Expand Up @@ -1565,23 +1551,23 @@ export class ApiApi extends BaseAPI {

/**
* @summary Create Database
* @param {string} [database]
* @param {string} [tenant]
* @param {Api.CreateDatabase} request
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
public createDatabase(tenant: string | undefined, request: Api.CreateDatabase, options?: RequestInit) {
return ApiApiFp(this.configuration).createDatabase(tenant, request, options)(this.fetch, this.basePath);
public createDatabase(database: string | undefined, tenant: string | undefined, options?: RequestInit) {
return ApiApiFp(this.configuration).createDatabase(database, tenant, options)(this.fetch, this.basePath);
}

/**
* @summary Create Tenant
* @param {Api.CreateTenant} request
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
public createTenant(request: Api.CreateTenant, options?: RequestInit) {
return ApiApiFp(this.configuration).createTenant(request, options)(this.fetch, this.basePath);
public createTenant(tenant: string | undefined, options?: RequestInit) {
return ApiApiFp(this.configuration).createTenant(tenant, options)(this.fetch, this.basePath);
}

/**
Expand Down Expand Up @@ -1610,12 +1596,12 @@ export class ApiApi extends BaseAPI {

/**
* @summary Get Database
* @param {string} database
* @param {string} [database]
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
public getDatabase(database: string, tenant: string | undefined, options?: RequestInit) {
public getDatabase(database: string | undefined, tenant: string | undefined, options?: RequestInit) {
return ApiApiFp(this.configuration).getDatabase(database, tenant, options)(this.fetch, this.basePath);
}

Expand All @@ -1632,11 +1618,11 @@ export class ApiApi extends BaseAPI {

/**
* @summary Get Tenant
* @param {string} tenant
* @param {string} [tenant]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
public getTenant(tenant: string, options?: RequestInit) {
public getTenant(tenant: string | undefined, options?: RequestInit) {
return ApiApiFp(this.configuration).getTenant(tenant, options)(this.fetch, this.basePath);
}

Expand All @@ -1651,15 +1637,15 @@ export class ApiApi extends BaseAPI {

/**
* @summary List Collections
* @param {string} [tenant]
* @param {string} [database]
* @param {number} [limit]
* @param {number} [offset]
* @param {string} [tenant]
* @param {string} [database]
* @param {RequestInit} [options] Override http request option.
* @throws {RequiredError}
*/
public listCollections(tenant: string | undefined, database: string | undefined, limit: number | undefined, offset: number | undefined, options?: RequestInit) {
return ApiApiFp(this.configuration).listCollections(tenant, database, limit, offset, options)(this.fetch, this.basePath);
public listCollections(limit: number | undefined, offset: number | undefined, tenant: string | undefined, database: string | undefined, options?: RequestInit) {
return ApiApiFp(this.configuration).listCollections(limit, offset, tenant, database, options)(this.fetch, this.basePath);
}

/**
Expand Down
Loading

0 comments on commit a158b02

Please sign in to comment.