Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/accounts/deploy/resources/realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
},
"fullScopeAllowed": true,
"defaultClientScopes": [
"web-origins", "profile", "roles", "email"
"web-origins", "profile", "roles", "email", "basic"
],
"optionalClientScopes": [
"offline_access", "{{ .Values.apps.accounts.admin.role }}-scope"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apis/DandiApi.ts
apis/K8sApi.ts
apis/RestApi.ts
apis/index.ts
Expand Down Expand Up @@ -30,6 +31,12 @@ models/ResourceOrigin.ts
models/ResourceStatus.ts
models/ResourceType.ts
models/Tag.ts
models/UploadFinalizeRequest.ts
models/UploadFinalizeResponse.ts
models/UploadInitRequest.ts
models/UploadInitResponse.ts
models/UploadPart.ts
models/UploadedPart.ts
models/User.ts
models/Valid.ts
models/VolumeStorage.ts
Expand Down
127 changes: 127 additions & 0 deletions applications/osb-portal/src/apiclient/workspaces/apis/DandiApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/* tslint:disable */
/* eslint-disable */
/**
* OSB Workspaces manager API
* Opensource Brain Platform - Reference Workspaces manager API
*
* The version of the OpenAPI document: 0.2.0
*
*
* 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 {
UploadFinalizeRequest,
UploadFinalizeRequestFromJSON,
UploadFinalizeRequestToJSON,
UploadFinalizeResponse,
UploadFinalizeResponseFromJSON,
UploadFinalizeResponseToJSON,
UploadInitRequest,
UploadInitRequestFromJSON,
UploadInitRequestToJSON,
UploadInitResponse,
UploadInitResponseFromJSON,
UploadInitResponseToJSON,
} from '../models';

export interface WorkspacesControllersDandiUploadControllerDandiUploadFinalizeRequest {
uploadFinalizeRequest: UploadFinalizeRequest;
}

export interface WorkspacesControllersDandiUploadControllerDandiUploadInitRequest {
uploadInitRequest: UploadInitRequest;
}

/**
*
*/
export class DandiApi extends runtime.BaseAPI {

/**
* Complete the DANDI upload, create/attach the workspace, and run the protocol script in it. Synchronous — does not return until the script finishes, which can take minutes.
*/
async workspacesControllersDandiUploadControllerDandiUploadFinalizeRaw(requestParameters: WorkspacesControllersDandiUploadControllerDandiUploadFinalizeRequest): Promise<runtime.ApiResponse<UploadFinalizeResponse>> {
if (requestParameters.uploadFinalizeRequest === null || requestParameters.uploadFinalizeRequest === undefined) {
throw new runtime.RequiredError('uploadFinalizeRequest','Required parameter requestParameters.uploadFinalizeRequest was null or undefined when calling workspacesControllersDandiUploadControllerDandiUploadFinalize.');
}

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 = typeof token === 'function' ? token("bearerAuth", []) : token;

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/dandi/upload/finalize`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: UploadFinalizeRequestToJSON(requestParameters.uploadFinalizeRequest),
});

return new runtime.JSONApiResponse(response, (jsonValue) => UploadFinalizeResponseFromJSON(jsonValue));
}

/**
* Complete the DANDI upload, create/attach the workspace, and run the protocol script in it. Synchronous — does not return until the script finishes, which can take minutes.
*/
async workspacesControllersDandiUploadControllerDandiUploadFinalize(requestParameters: WorkspacesControllersDandiUploadControllerDandiUploadFinalizeRequest): Promise<UploadFinalizeResponse> {
const response = await this.workspacesControllersDandiUploadControllerDandiUploadFinalizeRaw(requestParameters);
return await response.value();
}

/**
* Reserve a DANDI upload. The asset path is derived server-side from the caller\'s identity and is never taken from the request body.
*/
async workspacesControllersDandiUploadControllerDandiUploadInitRaw(requestParameters: WorkspacesControllersDandiUploadControllerDandiUploadInitRequest): Promise<runtime.ApiResponse<UploadInitResponse>> {
if (requestParameters.uploadInitRequest === null || requestParameters.uploadInitRequest === undefined) {
throw new runtime.RequiredError('uploadInitRequest','Required parameter requestParameters.uploadInitRequest was null or undefined when calling workspacesControllersDandiUploadControllerDandiUploadInit.');
}

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 = typeof token === 'function' ? token("bearerAuth", []) : token;

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/dandi/upload/init`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: UploadInitRequestToJSON(requestParameters.uploadInitRequest),
});

return new runtime.JSONApiResponse(response, (jsonValue) => UploadInitResponseFromJSON(jsonValue));
}

/**
* Reserve a DANDI upload. The asset path is derived server-side from the caller\'s identity and is never taken from the request body.
*/
async workspacesControllersDandiUploadControllerDandiUploadInit(requestParameters: WorkspacesControllersDandiUploadControllerDandiUploadInitRequest): Promise<UploadInitResponse> {
const response = await this.workspacesControllersDandiUploadControllerDandiUploadInitRaw(requestParameters);
return await response.value();
}

}
41 changes: 41 additions & 0 deletions applications/osb-portal/src/apiclient/workspaces/apis/RestApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ export interface WorkspacesControllersWorkspaceControllerImportResourcesRequest
inlineObject?: InlineObject;
}

export interface WorkspacesControllersWorkspaceControllerOpenRequest {
id: number;
}

export interface WorkspacesControllersWorkspaceControllerSetthumbnailRequest {
id: number;
thumbNail?: Blob;
Expand Down Expand Up @@ -1484,6 +1488,43 @@ export class RestApi extends runtime.BaseAPI {
await this.workspacesControllersWorkspaceControllerImportResourcesRaw(requestParameters);
}

/**
* Ensure the workspace volume exists and is ready before opening the workspace.
*/
async workspacesControllersWorkspaceControllerOpenRaw(requestParameters: WorkspacesControllersWorkspaceControllerOpenRequest): Promise<runtime.ApiResponse<void>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling workspacesControllersWorkspaceControllerOpen.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/workspace/{id}/open`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
});

return new runtime.VoidApiResponse(response);
}

/**
* Ensure the workspace volume exists and is ready before opening the workspace.
*/
async workspacesControllersWorkspaceControllerOpen(requestParameters: WorkspacesControllersWorkspaceControllerOpenRequest): Promise<void> {
await this.workspacesControllersWorkspaceControllerOpenRaw(requestParameters);
}

/**
* Sets the thumbnail of the workspace.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './DandiApi';
export * from './K8sApi';
export * from './RestApi';
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/* tslint:disable */
/* eslint-disable */
/**
* OSB Workspaces manager API
* Opensource Brain Platform - Reference Workspaces manager API
*
* The version of the OpenAPI document: 0.2.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { exists, mapValues } from '../runtime';
import {
UploadedPart,
UploadedPartFromJSON,
UploadedPartFromJSONTyped,
UploadedPartToJSON,
} from './';

/**
*
* @export
* @interface UploadFinalizeRequest
*/
export interface UploadFinalizeRequest {
/**
* Omitted on the deduplicated path, where no upload took place.
* @type {string}
* @memberof UploadFinalizeRequest
*/
uploadId?: string;
/**
*
* @type {string}
* @memberof UploadFinalizeRequest
*/
path: string;
/**
* Omitted on the deduplicated path.
* @type {Array<UploadedPart>}
* @memberof UploadFinalizeRequest
*/
parts?: Array<UploadedPart>;
/**
* Echoed back from init's deduplicated response; when present, complete/validate are skipped.
* @type {string}
* @memberof UploadFinalizeRequest
*/
blobId?: string;
/**
* Existing workspace to attach to. Omit to create a new one.
* @type {number}
* @memberof UploadFinalizeRequest
*/
workspaceId?: number;
/**
* Name for a new workspace, used only when workspace_id is omitted.
* @type {string}
* @memberof UploadFinalizeRequest
*/
workspaceName?: string;
/**
* Publicly-reachable URL of the protocol's analysis script. Fetched and run server-side inside the workspace; omit to skip running anything.
* @type {string}
* @memberof UploadFinalizeRequest
*/
scriptUrl?: string;
/**
* Filename the script lands under in the workspace.
* @type {string}
* @memberof UploadFinalizeRequest
*/
scriptName?: string;
}

export function UploadFinalizeRequestFromJSON(json: any): UploadFinalizeRequest {
return UploadFinalizeRequestFromJSONTyped(json, false);
}

export function UploadFinalizeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadFinalizeRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'uploadId': !exists(json, 'upload_id') ? undefined : json['upload_id'],
'path': json['path'],
'parts': !exists(json, 'parts') ? undefined : ((json['parts'] as Array<any>).map(UploadedPartFromJSON)),
'blobId': !exists(json, 'blob_id') ? undefined : json['blob_id'],
'workspaceId': !exists(json, 'workspace_id') ? undefined : json['workspace_id'],
'workspaceName': !exists(json, 'workspace_name') ? undefined : json['workspace_name'],
'scriptUrl': !exists(json, 'script_url') ? undefined : json['script_url'],
'scriptName': !exists(json, 'script_name') ? undefined : json['script_name'],
};
}

export function UploadFinalizeRequestToJSON(value?: UploadFinalizeRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'upload_id': value.uploadId,
'path': value.path,
'parts': value.parts === undefined ? undefined : ((value.parts as Array<any>).map(UploadedPartToJSON)),
'blob_id': value.blobId,
'workspace_id': value.workspaceId,
'workspace_name': value.workspaceName,
'script_url': value.scriptUrl,
'script_name': value.scriptName,
};
}


Loading
Loading