Merged PR 123: API実装(I/F実装)
## 概要 [Task1836: API実装(I/F実装)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1836) - タスクのソート条件更新APIのI/Fを実装 - タスク一覧APIのI/Fを修正 - TODO/XXXですぐ対処可能、または単純に消し忘れているものを対処 ## レビューポイント - API I/Fの修正は妥当な内容であるか - 特にfilterはカンマ区切りでいいか、指定したものを除外という形式でいいか等 - TODO/XXXの対処は妥当な対処であるか ## 動作確認状況 - ローカルでswagger表示されることを確認
This commit is contained in:
parent
e4f84f78ba
commit
1ced5ef66d
@ -490,6 +490,25 @@ export interface SignupRequest {
|
|||||||
*/
|
*/
|
||||||
'notification': boolean;
|
'notification': boolean;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface SortCriteriaRequest
|
||||||
|
*/
|
||||||
|
export interface SortCriteriaRequest {
|
||||||
|
/**
|
||||||
|
* ASC/DESC
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SortCriteriaRequest
|
||||||
|
*/
|
||||||
|
'direction': string;
|
||||||
|
/**
|
||||||
|
* JOB_NUMBER/STATUS/ENCRYPTION/AUTHOR_ID/FILE_NAME/FILE_LENGTH/FILE_SIZE/RECORDING_STARTED_DATE/RECORDING_FINISHED_DATE/UPLOAD_DATE/TRANSCRIPTION_STARTED_DATE/TRANSCRIPTION_FINISHED_DATE
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SortCriteriaRequest
|
||||||
|
*/
|
||||||
|
'paramName': string;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
@ -1284,11 +1303,14 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration
|
|||||||
/**
|
/**
|
||||||
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
uploadFinished: async (audioUploadFinishedRequest: AudioUploadFinishedRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
uploadFinished: async (authorization: string, audioUploadFinishedRequest: AudioUploadFinishedRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'authorization' is not null or undefined
|
||||||
|
assertParamExists('uploadFinished', 'authorization', authorization)
|
||||||
// verify required parameter 'audioUploadFinishedRequest' is not null or undefined
|
// verify required parameter 'audioUploadFinishedRequest' is not null or undefined
|
||||||
assertParamExists('uploadFinished', 'audioUploadFinishedRequest', audioUploadFinishedRequest)
|
assertParamExists('uploadFinished', 'audioUploadFinishedRequest', audioUploadFinishedRequest)
|
||||||
const localVarPath = `/files/audio/upload-finished`;
|
const localVarPath = `/files/audio/upload-finished`;
|
||||||
@ -1307,6 +1329,10 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration
|
|||||||
// http bearer authentication required
|
// http bearer authentication required
|
||||||
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
if (authorization != null) {
|
||||||
|
localVarHeaderParameter['authorization'] = String(authorization);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'application/json';
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||||
@ -1324,10 +1350,13 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration
|
|||||||
/**
|
/**
|
||||||
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
uploadLocation: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
uploadLocation: async (authorization: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'authorization' is not null or undefined
|
||||||
|
assertParamExists('uploadLocation', 'authorization', authorization)
|
||||||
const localVarPath = `/files/audio/upload-location`;
|
const localVarPath = `/files/audio/upload-location`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
@ -1344,6 +1373,10 @@ export const FilesApiAxiosParamCreator = function (configuration?: Configuration
|
|||||||
// http bearer authentication required
|
// http bearer authentication required
|
||||||
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
if (authorization != null) {
|
||||||
|
localVarHeaderParameter['authorization'] = String(authorization);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
@ -1390,22 +1423,24 @@ export const FilesApiFp = function(configuration?: Configuration) {
|
|||||||
/**
|
/**
|
||||||
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async uploadFinished(audioUploadFinishedRequest: AudioUploadFinishedRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AudioUploadFinishedResponse>> {
|
async uploadFinished(authorization: string, audioUploadFinishedRequest: AudioUploadFinishedRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AudioUploadFinishedResponse>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFinished(audioUploadFinishedRequest, options);
|
const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFinished(authorization, audioUploadFinishedRequest, options);
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async uploadLocation(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AudioUploadLocationResponse>> {
|
async uploadLocation(authorization: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AudioUploadLocationResponse>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.uploadLocation(options);
|
const localVarAxiosArgs = await localVarAxiosParamCreator.uploadLocation(authorization, options);
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -1441,21 +1476,23 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath
|
|||||||
/**
|
/**
|
||||||
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
uploadFinished(audioUploadFinishedRequest: AudioUploadFinishedRequest, options?: any): AxiosPromise<AudioUploadFinishedResponse> {
|
uploadFinished(authorization: string, audioUploadFinishedRequest: AudioUploadFinishedRequest, options?: any): AxiosPromise<AudioUploadFinishedResponse> {
|
||||||
return localVarFp.uploadFinished(audioUploadFinishedRequest, options).then((request) => request(axios, basePath));
|
return localVarFp.uploadFinished(authorization, audioUploadFinishedRequest, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
uploadLocation(options?: any): AxiosPromise<AudioUploadLocationResponse> {
|
uploadLocation(authorization: string, options?: any): AxiosPromise<AudioUploadLocationResponse> {
|
||||||
return localVarFp.uploadLocation(options).then((request) => request(axios, basePath));
|
return localVarFp.uploadLocation(authorization, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -1494,24 +1531,26 @@ export class FilesApi extends BaseAPI {
|
|||||||
/**
|
/**
|
||||||
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
* アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
* @param {AudioUploadFinishedRequest} audioUploadFinishedRequest
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof FilesApi
|
* @memberof FilesApi
|
||||||
*/
|
*/
|
||||||
public uploadFinished(audioUploadFinishedRequest: AudioUploadFinishedRequest, options?: AxiosRequestConfig) {
|
public uploadFinished(authorization: string, audioUploadFinishedRequest: AudioUploadFinishedRequest, options?: AxiosRequestConfig) {
|
||||||
return FilesApiFp(this.configuration).uploadFinished(audioUploadFinishedRequest, options).then((request) => request(this.axios, this.basePath));
|
return FilesApiFp(this.configuration).uploadFinished(authorization, audioUploadFinishedRequest, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
* ログイン中ユーザー用のBlob Storage上の音声ファイルのアップロード先アクセスURLを取得します
|
||||||
* @summary
|
* @summary
|
||||||
|
* @param {string} authorization
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof FilesApi
|
* @memberof FilesApi
|
||||||
*/
|
*/
|
||||||
public uploadLocation(options?: AxiosRequestConfig) {
|
public uploadLocation(authorization: string, options?: AxiosRequestConfig) {
|
||||||
return FilesApiFp(this.configuration).uploadLocation(options).then((request) => request(this.axios, this.basePath));
|
return FilesApiFp(this.configuration).uploadLocation(authorization, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1942,10 +1981,11 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration
|
|||||||
* @summary
|
* @summary
|
||||||
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
||||||
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
||||||
|
* @param {string} [status] 取得対象とするタスクのステータス。カンマ(,)区切りで複数指定可能。設定されない場合はすべてのステータスを取得対象とする。許容するステータスの値は次の通り: Uploaded / Pending / InProgress / Finished / Backup
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
getTasks: async (limit?: number, offset?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
getTasks: async (limit?: number, offset?: number, status?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/tasks`;
|
const localVarPath = `/tasks`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
@ -1970,6 +2010,10 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration
|
|||||||
localVarQueryParameter['offset'] = offset;
|
localVarQueryParameter['offset'] = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status !== undefined) {
|
||||||
|
localVarQueryParameter['status'] = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
@ -2127,11 +2171,12 @@ export const TasksApiFp = function(configuration?: Configuration) {
|
|||||||
* @summary
|
* @summary
|
||||||
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
||||||
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
||||||
|
* @param {string} [status] 取得対象とするタスクのステータス。カンマ(,)区切りで複数指定可能。設定されない場合はすべてのステータスを取得対象とする。許容するステータスの値は次の通り: Uploaded / Pending / InProgress / Finished / Backup
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async getTasks(limit?: number, offset?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TasksResponse>> {
|
async getTasks(limit?: number, offset?: number, status?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TasksResponse>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.getTasks(limit, offset, options);
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getTasks(limit, offset, status, options);
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -2221,11 +2266,12 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath
|
|||||||
* @summary
|
* @summary
|
||||||
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
||||||
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
||||||
|
* @param {string} [status] 取得対象とするタスクのステータス。カンマ(,)区切りで複数指定可能。設定されない場合はすべてのステータスを取得対象とする。許容するステータスの値は次の通り: Uploaded / Pending / InProgress / Finished / Backup
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
getTasks(limit?: number, offset?: number, options?: any): AxiosPromise<TasksResponse> {
|
getTasks(limit?: number, offset?: number, status?: string, options?: any): AxiosPromise<TasksResponse> {
|
||||||
return localVarFp.getTasks(limit, offset, options).then((request) => request(axios, basePath));
|
return localVarFp.getTasks(limit, offset, status, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 指定した文字起こしタスクを差し戻します(ステータスをPendingにします)
|
* 指定した文字起こしタスクを差し戻します(ステータスをPendingにします)
|
||||||
@ -2322,12 +2368,13 @@ export class TasksApi extends BaseAPI {
|
|||||||
* @summary
|
* @summary
|
||||||
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
* @param {number} [limit] タスクの取得件数(指定しない場合はデフォルト値)
|
||||||
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
* @param {number} [offset] オフセット(何件目から取得するか 設定しない場合はデフォルト値)
|
||||||
|
* @param {string} [status] 取得対象とするタスクのステータス。カンマ(,)区切りで複数指定可能。設定されない場合はすべてのステータスを取得対象とする。許容するステータスの値は次の通り: Uploaded / Pending / InProgress / Finished / Backup
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof TasksApi
|
* @memberof TasksApi
|
||||||
*/
|
*/
|
||||||
public getTasks(limit?: number, offset?: number, options?: AxiosRequestConfig) {
|
public getTasks(limit?: number, offset?: number, status?: string, options?: AxiosRequestConfig) {
|
||||||
return TasksApiFp(this.configuration).getTasks(limit, offset, options).then((request) => request(this.axios, this.basePath));
|
return TasksApiFp(this.configuration).getTasks(limit, offset, status, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2537,6 +2584,46 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration
|
|||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
localVarRequestOptions.data = serializeDataIfNeeded(signupRequest, localVarRequestOptions, configuration)
|
localVarRequestOptions.data = serializeDataIfNeeded(signupRequest, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* ログインしているユーザーのタスクソート条件を更新します
|
||||||
|
* @summary
|
||||||
|
* @param {SortCriteriaRequest} sortCriteriaRequest
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
updateSortCcriteria: async (sortCriteriaRequest: SortCriteriaRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'sortCriteriaRequest' is not null or undefined
|
||||||
|
assertParamExists('updateSortCcriteria', 'sortCriteriaRequest', sortCriteriaRequest)
|
||||||
|
const localVarPath = `/users/sort-criteria`;
|
||||||
|
// 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 bearer required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = serializeDataIfNeeded(sortCriteriaRequest, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: toPathString(localVarUrlObj),
|
url: toPathString(localVarUrlObj),
|
||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
@ -2605,6 +2692,17 @@ export const UsersApiFp = function(configuration?: Configuration) {
|
|||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.signup(signupRequest, options);
|
const localVarAxiosArgs = await localVarAxiosParamCreator.signup(signupRequest, options);
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* ログインしているユーザーのタスクソート条件を更新します
|
||||||
|
* @summary
|
||||||
|
* @param {SortCriteriaRequest} sortCriteriaRequest
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async updateSortCcriteria(sortCriteriaRequest: SortCriteriaRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.updateSortCcriteria(sortCriteriaRequest, options);
|
||||||
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2663,6 +2761,16 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath
|
|||||||
signup(signupRequest: SignupRequest, options?: any): AxiosPromise<object> {
|
signup(signupRequest: SignupRequest, options?: any): AxiosPromise<object> {
|
||||||
return localVarFp.signup(signupRequest, options).then((request) => request(axios, basePath));
|
return localVarFp.signup(signupRequest, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* ログインしているユーザーのタスクソート条件を更新します
|
||||||
|
* @summary
|
||||||
|
* @param {SortCriteriaRequest} sortCriteriaRequest
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
updateSortCcriteria(sortCriteriaRequest: SortCriteriaRequest, options?: any): AxiosPromise<object> {
|
||||||
|
return localVarFp.updateSortCcriteria(sortCriteriaRequest, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2730,6 +2838,18 @@ export class UsersApi extends BaseAPI {
|
|||||||
public signup(signupRequest: SignupRequest, options?: AxiosRequestConfig) {
|
public signup(signupRequest: SignupRequest, options?: AxiosRequestConfig) {
|
||||||
return UsersApiFp(this.configuration).signup(signupRequest, options).then((request) => request(this.axios, this.basePath));
|
return UsersApiFp(this.configuration).signup(signupRequest, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ログインしているユーザーのタスクソート条件を更新します
|
||||||
|
* @summary
|
||||||
|
* @param {SortCriteriaRequest} sortCriteriaRequest
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof UsersApi
|
||||||
|
*/
|
||||||
|
public updateSortCcriteria(sortCriteriaRequest: SortCriteriaRequest, options?: AxiosRequestConfig) {
|
||||||
|
return UsersApiFp(this.configuration).updateSortCcriteria(sortCriteriaRequest, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||||
"test:e2e": "jest --config ./test/jest-e2e.json",
|
"test:e2e": "jest --config ./test/jest-e2e.json",
|
||||||
"og": "openapi-generator-cli",
|
"og": "openapi-generator-cli",
|
||||||
"swgbundle:sentinel": "swagger-cli bundle -o openapi/build/bundle.yml -t yaml openapi/sentinel_ems/sentinel_ems.yml"
|
"openapi-format": "cat \"src/api/odms/openapi.json\" | jq -c . > \"src/api/odms/openapi.json\" && prettier --write \"src/api/odms/*.json\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/identity": "^3.1.3",
|
"@azure/identity": "^3.1.3",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -3,14 +3,9 @@
|
|||||||
* @param {string[]}
|
* @param {string[]}
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
|
// XXX: deprecated 削除予定
|
||||||
export const confirmPermission = (authority: string): boolean => {
|
export const confirmPermission = (authority: string): boolean => {
|
||||||
console.log(authority);
|
console.log(authority);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
// TODO 将来的にscopeの内容に応じた処理を入れることになる
|
|
||||||
// if (authority.startsWith('hogehoge')) {
|
|
||||||
// return true;
|
|
||||||
// } else {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,10 +1,22 @@
|
|||||||
export type RefreshToken = {
|
export type RefreshToken = {
|
||||||
|
/**
|
||||||
|
* 外部認証サービスの識別子
|
||||||
|
*/
|
||||||
userId: string;
|
userId: string;
|
||||||
|
/**
|
||||||
|
* 半角スペース区切りのRoleを表現する文字列(ex. "author admin")
|
||||||
|
*/
|
||||||
role: string;
|
role: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AccessToken = {
|
export type AccessToken = {
|
||||||
|
/**
|
||||||
|
* 外部認証サービスの識別子
|
||||||
|
*/
|
||||||
userId: string;
|
userId: string;
|
||||||
|
/**
|
||||||
|
* 半角スペース区切りのRoleを表現する文字列(ex. "author admin")
|
||||||
|
*/
|
||||||
role: string;
|
role: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -130,3 +130,24 @@ export const TASK_STATUS = {
|
|||||||
FINISHED: 'Finished',
|
FINISHED: 'Finished',
|
||||||
BACKUP: 'Backup',
|
BACKUP: 'Backup',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* タスク一覧でソート可能な属性の一覧
|
||||||
|
*/
|
||||||
|
export const TASK_LIST_SORTABLE_ATTRIBUTES = [
|
||||||
|
'JOB_NUMBER',
|
||||||
|
'STATUS',
|
||||||
|
'ENCRYPTION',
|
||||||
|
'AUTHOR_ID',
|
||||||
|
'FILE_NAME',
|
||||||
|
'FILE_LENGTH',
|
||||||
|
'FILE_SIZE',
|
||||||
|
'RECORDING_STARTED_DATE',
|
||||||
|
'RECORDING_FINISHED_DATE',
|
||||||
|
'UPLOAD_DATE',
|
||||||
|
'TRANSCRIPTION_STARTED_DATE',
|
||||||
|
'TRANSCRIPTION_FINISHED_DATE',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export type TaskListSortableAttribute =
|
||||||
|
(typeof TASK_LIST_SORTABLE_ATTRIBUTES)[number];
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Body, Controller, HttpStatus, Post } from '@nestjs/common';
|
import { Body, Controller, HttpStatus, Post, UseGuards } from '@nestjs/common';
|
||||||
import {
|
import {
|
||||||
ApiResponse,
|
ApiResponse,
|
||||||
ApiOperation,
|
ApiOperation,
|
||||||
@ -8,6 +8,7 @@ import {
|
|||||||
import { ErrorResponse } from '../../common/error/types/types';
|
import { ErrorResponse } from '../../common/error/types/types';
|
||||||
import { RegisterRequest, RegisterResponse } from './types/types';
|
import { RegisterRequest, RegisterResponse } from './types/types';
|
||||||
import { NotificationService } from './notification.service';
|
import { NotificationService } from './notification.service';
|
||||||
|
import { AuthGuard } from 'src/common/guards/auth/authguards';
|
||||||
|
|
||||||
@ApiTags('notification')
|
@ApiTags('notification')
|
||||||
@Controller('notification')
|
@Controller('notification')
|
||||||
@ -36,9 +37,9 @@ export class NotificationController {
|
|||||||
type: ErrorResponse,
|
type: ErrorResponse,
|
||||||
})
|
})
|
||||||
@ApiOperation({ operationId: 'register' })
|
@ApiOperation({ operationId: 'register' })
|
||||||
|
@UseGuards(AuthGuard)
|
||||||
async register(@Body() body: RegisterRequest): Promise<RegisterResponse> {
|
async register(@Body() body: RegisterRequest): Promise<RegisterResponse> {
|
||||||
const { handler, pns } = body;
|
const { handler, pns } = body;
|
||||||
// XXX 登録処理の前にアクセストークンの認証を行う
|
|
||||||
await this.notificationService.register(pns, handler);
|
await this.notificationService.register(pns, handler);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import {
|
|||||||
Param,
|
Param,
|
||||||
Post,
|
Post,
|
||||||
Query,
|
Query,
|
||||||
UseGuards,
|
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import {
|
import {
|
||||||
ApiResponse,
|
ApiResponse,
|
||||||
@ -24,7 +23,6 @@ import {
|
|||||||
TasksRequest,
|
TasksRequest,
|
||||||
TasksResponse,
|
TasksResponse,
|
||||||
} from './types/types';
|
} from './types/types';
|
||||||
import { AuthGuard } from '../../common/guards/auth/authguards';
|
|
||||||
|
|
||||||
@ApiTags('tasks')
|
@ApiTags('tasks')
|
||||||
@Controller('tasks')
|
@Controller('tasks')
|
||||||
@ -317,7 +315,7 @@ export class TasksController {
|
|||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
// TODO 操作としてarchiveの方が適切かもしれない
|
|
||||||
@Post(':audioFileId/backup')
|
@Post(':audioFileId/backup')
|
||||||
@ApiResponse({
|
@ApiResponse({
|
||||||
status: HttpStatus.OK,
|
status: HttpStatus.OK,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { AudioOptionItem } from '../../../features/files/types/types';
|
import { AudioOptionItem } from '../../../features/files/types/types';
|
||||||
|
import { IsInt, IsOptional, Min } from 'class-validator';
|
||||||
|
|
||||||
export class TasksRequest {
|
export class TasksRequest {
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
@ -7,14 +8,31 @@ export class TasksRequest {
|
|||||||
default: 200,
|
default: 200,
|
||||||
description: 'タスクの取得件数(指定しない場合はデフォルト値)',
|
description: 'タスクの取得件数(指定しない場合はデフォルト値)',
|
||||||
})
|
})
|
||||||
|
@IsInt()
|
||||||
|
@Min(0)
|
||||||
|
@IsOptional()
|
||||||
limit: number;
|
limit: number;
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
required: false,
|
required: false,
|
||||||
default: 0,
|
default: 0,
|
||||||
description:
|
description:
|
||||||
'オフセット(何件目から取得するか 設定しない場合はデフォルト値)',
|
'オフセット(何件目から取得するか 設定しない場合はデフォルト値)',
|
||||||
})
|
})
|
||||||
|
@IsInt()
|
||||||
|
@Min(0)
|
||||||
|
@IsOptional()
|
||||||
offset: number;
|
offset: number;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
required: false,
|
||||||
|
description:
|
||||||
|
'取得対象とするタスクのステータス。カンマ(,)区切りで複数指定可能。設定されない場合はすべてのステータスを取得対象とする。許容するステータスの値は次の通り: Uploaded / Pending / InProgress / Finished / Backup',
|
||||||
|
example: 'Uploaded,Pending,InProgress',
|
||||||
|
})
|
||||||
|
@IsOptional()
|
||||||
|
// TODO: 入力チェックを行うデコレータを追加する。@Matches or カスタムデコレータで実装想定。statusの値は先頭大文字であることまで一致しなくていいはず?(実装時レビューにて要確認)
|
||||||
|
status?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Typist {
|
export class Typist {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { IsIn } from 'class-validator';
|
import { IsIn } from 'class-validator';
|
||||||
|
import { TASK_LIST_SORTABLE_ATTRIBUTES } from '../../../constants';
|
||||||
import { USER_ROLES } from '../../../constants';
|
import { USER_ROLES } from '../../../constants';
|
||||||
|
|
||||||
export class ConfirmRequest {
|
export class ConfirmRequest {
|
||||||
@ -132,3 +133,15 @@ export class GetRelationsResponse {
|
|||||||
})
|
})
|
||||||
prompt: boolean;
|
prompt: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SortCriteriaRequest {
|
||||||
|
@ApiProperty({ description: 'ASC/DESC' })
|
||||||
|
@IsIn(['ASC', 'DESC'], { message: 'invalid direction' })
|
||||||
|
direction: string;
|
||||||
|
|
||||||
|
@ApiProperty({ description: `${TASK_LIST_SORTABLE_ATTRIBUTES.join('/')}` })
|
||||||
|
@IsIn(TASK_LIST_SORTABLE_ATTRIBUTES, { message: 'invalid attributes' })
|
||||||
|
paramName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SortCriteriaResponse {}
|
||||||
|
|||||||
@ -29,6 +29,8 @@ import {
|
|||||||
GetUsersResponse,
|
GetUsersResponse,
|
||||||
SignupRequest,
|
SignupRequest,
|
||||||
SignupResponse,
|
SignupResponse,
|
||||||
|
SortCriteriaRequest,
|
||||||
|
SortCriteriaResponse,
|
||||||
} from './types/types';
|
} from './types/types';
|
||||||
import { UsersService } from './users.service';
|
import { UsersService } from './users.service';
|
||||||
import { AuthGuard } from '../../common/guards/auth/authguards';
|
import { AuthGuard } from '../../common/guards/auth/authguards';
|
||||||
@ -271,4 +273,33 @@ export class UsersController {
|
|||||||
prompt: true,
|
prompt: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiResponse({
|
||||||
|
status: HttpStatus.OK,
|
||||||
|
type: SortCriteriaResponse,
|
||||||
|
description: '成功時のレスポンス',
|
||||||
|
})
|
||||||
|
@ApiResponse({
|
||||||
|
status: HttpStatus.UNAUTHORIZED,
|
||||||
|
description: '認証エラー',
|
||||||
|
type: ErrorResponse,
|
||||||
|
})
|
||||||
|
@ApiResponse({
|
||||||
|
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
|
description: '想定外のサーバーエラー',
|
||||||
|
type: ErrorResponse,
|
||||||
|
})
|
||||||
|
@ApiOperation({
|
||||||
|
operationId: 'updateSortCcriteria',
|
||||||
|
description: 'ログインしているユーザーのタスクソート条件を更新します',
|
||||||
|
})
|
||||||
|
@ApiBearerAuth()
|
||||||
|
@UseGuards(AuthGuard)
|
||||||
|
@Post('sort-criteria')
|
||||||
|
async updateSortCriteria(
|
||||||
|
@Body() body: SortCriteriaRequest,
|
||||||
|
): Promise<SortCriteriaResponse> {
|
||||||
|
console.log(body);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,8 +95,6 @@ export class UsersService {
|
|||||||
authorId?: string | undefined,
|
authorId?: string | undefined,
|
||||||
groupID?: number | undefined,
|
groupID?: number | undefined,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
//アクセストークンからユーザーIDを取得する
|
|
||||||
// TODO アクセストークンの中身が具体的に確定したら、型変換を取り払う必要があるかも
|
|
||||||
this.logger.log(`[IN] ${this.createUser.name}`);
|
this.logger.log(`[IN] ${this.createUser.name}`);
|
||||||
|
|
||||||
//DBよりアクセス者の所属するアカウントIDを取得する
|
//DBよりアクセス者の所属するアカウントIDを取得する
|
||||||
|
|||||||
@ -49,8 +49,6 @@ async function bootstrap() {
|
|||||||
SwaggerModule.setup('api', app, document);
|
SwaggerModule.setup('api', app, document);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO:検証のためポートを固定 後で直す
|
|
||||||
// await app.listen(process.env.PORT || 80);
|
|
||||||
await app.listen(process.env.PORT || 80);
|
await app.listen(process.env.PORT || 80);
|
||||||
}
|
}
|
||||||
bootstrap();
|
bootstrap();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user