Skip to content

Commit

Permalink
feat: #1630 Pagination access control privilege endpoint (#1649)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianliuwk1019 authored Nov 14, 2024
1 parent da64cff commit 90f63e5
Show file tree
Hide file tree
Showing 29 changed files with 1,928 additions and 137 deletions.
1,190 changes: 1,189 additions & 1 deletion client-code-gen/admin-management-openapi.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ index.ts
model/admin-role-auth-group.ts
model/admin-user-access-response.ts
model/app-env.ts
model/delegated-admin-sort-by-enum.ts
model/email-sending-status.ts
model/fam-access-control-privilege-create-request.ts
model/fam-access-control-privilege-create-response.ts
Expand All @@ -34,7 +35,10 @@ model/fam-user-type-dto.ts
model/httpvalidation-error.ts
model/index.ts
model/location-inner.ts
model/page-result-meta-schema.ts
model/paged-results-schema-fam-access-control-privilege-get-response.ts
model/role-type.ts
model/sort-order-enum.ts
model/user-type.ts
model/validation-error.ts
package.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { FamAccessControlPrivilegeCreateRequest } from '../model';
import { DelegatedAdminSortByEnum } from '../model';
// @ts-ignore
import { FamAccessControlPrivilegeGetResponse } from '../model';
import { FamAccessControlPrivilegeCreateRequest } from '../model';
// @ts-ignore
import { FamAccessControlPrivilegeResponse } from '../model';
// @ts-ignore
import { HTTPValidationError } from '../model';
// @ts-ignore
import { PagedResultsSchemaFamAccessControlPrivilegeGetResponse } from '../model';
// @ts-ignore
import { SortOrderEnum } from '../model';
/**
* FAMAccessControlPrivilegesApi - axios parameter creator
* @export
Expand All @@ -45,7 +49,7 @@ export const FAMAccessControlPrivilegesApiAxiosParamCreator = function (configur
createAccessControlPrivilegeMany: async (famAccessControlPrivilegeCreateRequest: FamAccessControlPrivilegeCreateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'famAccessControlPrivilegeCreateRequest' is not null or undefined
assertParamExists('createAccessControlPrivilegeMany', 'famAccessControlPrivilegeCreateRequest', famAccessControlPrivilegeCreateRequest)
const localVarPath = `/access_control_privileges`;
const localVarPath = `/access-control-privileges`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
Expand Down Expand Up @@ -85,7 +89,7 @@ export const FAMAccessControlPrivilegesApiAxiosParamCreator = function (configur
deleteAccessControlPrivilege: async (accessControlPrivilegeId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'accessControlPrivilegeId' is not null or undefined
assertParamExists('deleteAccessControlPrivilege', 'accessControlPrivilegeId', accessControlPrivilegeId)
const localVarPath = `/access_control_privileges/{access_control_privilege_id}`
const localVarPath = `/access-control-privileges/{access_control_privilege_id}`
.replace(`{${"access_control_privilege_id"}}`, encodeURIComponent(String(accessControlPrivilegeId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
Expand Down Expand Up @@ -114,16 +118,21 @@ export const FAMAccessControlPrivilegesApiAxiosParamCreator = function (configur
};
},
/**
* Get Delegated Admin Privileges For an Application
* Get \'Delegated Admin Privileges\' for an application with pagination.
* @summary Get Access Control Privileges By Application Id
* @param {number} applicationId
* @param {number | null} [pageNumber] Page number
* @param {number | null} [pageSize] Number of records per page
* @param {string | null} [search] Search by keyword
* @param {SortOrderEnum | null} [sortOrder] Column sorting order by &lt;br&gt;Possible values: [asc, desc]
* @param {DelegatedAdminSortByEnum | null} [sortBy] Column to be sorted by &lt;br&gt;Possible values: [create_date, user_name, user_type_code, email, full_name, role_display_name, forest_client_number]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccessControlPrivilegesByApplicationId: async (applicationId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
getAccessControlPrivilegesByApplicationId: async (applicationId: number, pageNumber?: number | null, pageSize?: number | null, search?: string | null, sortOrder?: SortOrderEnum | null, sortBy?: DelegatedAdminSortByEnum | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'applicationId' is not null or undefined
assertParamExists('getAccessControlPrivilegesByApplicationId', 'applicationId', applicationId)
const localVarPath = `/access_control_privileges`;
const localVarPath = `/access-control-privileges`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
Expand All @@ -143,6 +152,26 @@ export const FAMAccessControlPrivilegesApiAxiosParamCreator = function (configur
localVarQueryParameter['application_id'] = applicationId;
}

if (pageNumber !== undefined) {
localVarQueryParameter['pageNumber'] = pageNumber;
}

if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}

if (search !== undefined) {
localVarQueryParameter['search'] = search;
}

if (sortOrder !== undefined) {
localVarQueryParameter['sortOrder'] = sortOrder;
}

if (sortBy !== undefined) {
localVarQueryParameter['sortBy'] = sortBy;
}



setSearchParams(localVarUrlObj, localVarQueryParameter);
Expand Down Expand Up @@ -191,14 +220,19 @@ export const FAMAccessControlPrivilegesApiFp = function(configuration?: Configur
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Get Delegated Admin Privileges For an Application
* Get \'Delegated Admin Privileges\' for an application with pagination.
* @summary Get Access Control Privileges By Application Id
* @param {number} applicationId
* @param {number | null} [pageNumber] Page number
* @param {number | null} [pageSize] Number of records per page
* @param {string | null} [search] Search by keyword
* @param {SortOrderEnum | null} [sortOrder] Column sorting order by &lt;br&gt;Possible values: [asc, desc]
* @param {DelegatedAdminSortByEnum | null} [sortBy] Column to be sorted by &lt;br&gt;Possible values: [create_date, user_name, user_type_code, email, full_name, role_display_name, forest_client_number]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAccessControlPrivilegesByApplicationId(applicationId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FamAccessControlPrivilegeGetResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccessControlPrivilegesByApplicationId(applicationId, options);
async getAccessControlPrivilegesByApplicationId(applicationId: number, pageNumber?: number | null, pageSize?: number | null, search?: string | null, sortOrder?: SortOrderEnum | null, sortBy?: DelegatedAdminSortByEnum | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedResultsSchemaFamAccessControlPrivilegeGetResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccessControlPrivilegesByApplicationId(applicationId, pageNumber, pageSize, search, sortOrder, sortBy, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FAMAccessControlPrivilegesApi.getAccessControlPrivilegesByApplicationId']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
Expand Down Expand Up @@ -234,14 +268,19 @@ export const FAMAccessControlPrivilegesApiFactory = function (configuration?: Co
return localVarFp.deleteAccessControlPrivilege(accessControlPrivilegeId, options).then((request) => request(axios, basePath));
},
/**
* Get Delegated Admin Privileges For an Application
* Get \'Delegated Admin Privileges\' for an application with pagination.
* @summary Get Access Control Privileges By Application Id
* @param {number} applicationId
* @param {number | null} [pageNumber] Page number
* @param {number | null} [pageSize] Number of records per page
* @param {string | null} [search] Search by keyword
* @param {SortOrderEnum | null} [sortOrder] Column sorting order by &lt;br&gt;Possible values: [asc, desc]
* @param {DelegatedAdminSortByEnum | null} [sortBy] Column to be sorted by &lt;br&gt;Possible values: [create_date, user_name, user_type_code, email, full_name, role_display_name, forest_client_number]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccessControlPrivilegesByApplicationId(applicationId: number, options?: any): AxiosPromise<Array<FamAccessControlPrivilegeGetResponse>> {
return localVarFp.getAccessControlPrivilegesByApplicationId(applicationId, options).then((request) => request(axios, basePath));
getAccessControlPrivilegesByApplicationId(applicationId: number, pageNumber?: number | null, pageSize?: number | null, search?: string | null, sortOrder?: SortOrderEnum | null, sortBy?: DelegatedAdminSortByEnum | null, options?: any): AxiosPromise<PagedResultsSchemaFamAccessControlPrivilegeGetResponse> {
return localVarFp.getAccessControlPrivilegesByApplicationId(applicationId, pageNumber, pageSize, search, sortOrder, sortBy, options).then((request) => request(axios, basePath));
},
};
};
Expand Down Expand Up @@ -273,14 +312,19 @@ export interface FAMAccessControlPrivilegesApiInterface {
deleteAccessControlPrivilege(accessControlPrivilegeId: number, options?: RawAxiosRequestConfig): AxiosPromise<void>;

/**
* Get Delegated Admin Privileges For an Application
* Get \'Delegated Admin Privileges\' for an application with pagination.
* @summary Get Access Control Privileges By Application Id
* @param {number} applicationId
* @param {number | null} [pageNumber] Page number
* @param {number | null} [pageSize] Number of records per page
* @param {string | null} [search] Search by keyword
* @param {SortOrderEnum | null} [sortOrder] Column sorting order by &lt;br&gt;Possible values: [asc, desc]
* @param {DelegatedAdminSortByEnum | null} [sortBy] Column to be sorted by &lt;br&gt;Possible values: [create_date, user_name, user_type_code, email, full_name, role_display_name, forest_client_number]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FAMAccessControlPrivilegesApiInterface
*/
getAccessControlPrivilegesByApplicationId(applicationId: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<FamAccessControlPrivilegeGetResponse>>;
getAccessControlPrivilegesByApplicationId(applicationId: number, pageNumber?: number | null, pageSize?: number | null, search?: string | null, sortOrder?: SortOrderEnum | null, sortBy?: DelegatedAdminSortByEnum | null, options?: RawAxiosRequestConfig): AxiosPromise<PagedResultsSchemaFamAccessControlPrivilegeGetResponse>;

}

Expand Down Expand Up @@ -316,15 +360,20 @@ export class FAMAccessControlPrivilegesApi extends BaseAPI implements FAMAccessC
}

/**
* Get Delegated Admin Privileges For an Application
* Get \'Delegated Admin Privileges\' for an application with pagination.
* @summary Get Access Control Privileges By Application Id
* @param {number} applicationId
* @param {number | null} [pageNumber] Page number
* @param {number | null} [pageSize] Number of records per page
* @param {string | null} [search] Search by keyword
* @param {SortOrderEnum | null} [sortOrder] Column sorting order by &lt;br&gt;Possible values: [asc, desc]
* @param {DelegatedAdminSortByEnum | null} [sortBy] Column to be sorted by &lt;br&gt;Possible values: [create_date, user_name, user_type_code, email, full_name, role_display_name, forest_client_number]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FAMAccessControlPrivilegesApi
*/
public getAccessControlPrivilegesByApplicationId(applicationId: number, options?: RawAxiosRequestConfig) {
return FAMAccessControlPrivilegesApiFp(this.configuration).getAccessControlPrivilegesByApplicationId(applicationId, options).then((request) => request(this.axios, this.basePath));
public getAccessControlPrivilegesByApplicationId(applicationId: number, pageNumber?: number | null, pageSize?: number | null, search?: string | null, sortOrder?: SortOrderEnum | null, sortBy?: DelegatedAdminSortByEnum | null, options?: RawAxiosRequestConfig) {
return FAMAccessControlPrivilegesApiFp(this.configuration).getAccessControlPrivilegesByApplicationId(applicationId, pageNumber, pageSize, search, sortOrder, sortBy, options).then((request) => request(this.axios, this.basePath));
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* tslint:disable */
/* eslint-disable */
/**
* Forest Access Management - FAM - Admin Management API
* Forest Access Management Admin Management API used by the Forest Access Management application to define admin access to forest applications.
*
* The version of the OpenAPI document: 0.0.1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/



/**
*
* @export
* @enum {string}
*/

export const DelegatedAdminSortByEnum = {
CreateDate: 'create_date',
UserName: 'user_name',
UserTypeCode: 'user_type_code',
Email: 'email',
FullName: 'full_name',
RoleDisplayName: 'role_display_name',
ForestClientNumber: 'forest_client_number'
} as const;

export type DelegatedAdminSortByEnum = typeof DelegatedAdminSortByEnum[keyof typeof DelegatedAdminSortByEnum];



Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,11 @@ export interface FamAccessControlPrivilegeGetResponse {
* @memberof FamAccessControlPrivilegeGetResponse
*/
'role': FamRoleWithClientDto;
/**
*
* @type {string}
* @memberof FamAccessControlPrivilegeGetResponse
*/
'create_date': string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ import { AppEnv } from './app-env';
* @interface FamApplicationBase
*/
export interface FamApplicationBase {
/**
*
* @type {number}
* @memberof FamApplicationBase
*/
'application_id': number;
/**
*
* @type {string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
* @interface FamForestClientBase
*/
export interface FamForestClientBase {
/**
*
* @type {string}
* @memberof FamForestClientBase
*/
'client_name'?: string | null;
/**
*
* @type {string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ export interface FamRoleDto {
* @type {string}
* @memberof FamRoleDto
*/
'description': string;
'display_name'?: string | null;
/**
*
* @type {string}
* @memberof FamRoleDto
*/
'description': string | null;
/**
*
* @type {RoleType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export interface FamRoleWithClientDto {
* @memberof FamRoleWithClientDto
*/
'role_name': string;
/**
*
* @type {string}
* @memberof FamRoleWithClientDto
*/
'display_name'?: string | null;
/**
*
* @type {string}
* @memberof FamRoleWithClientDto
*/
'description': string | null;
/**
*
* @type {FamForestClientBase}
Expand Down
4 changes: 4 additions & 0 deletions client-code-gen/gen/admin-management-api/model/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './admin-role-auth-group';
export * from './admin-user-access-response';
export * from './app-env';
export * from './delegated-admin-sort-by-enum';
export * from './email-sending-status';
export * from './fam-access-control-privilege-create-request';
export * from './fam-access-control-privilege-create-response';
Expand All @@ -20,6 +21,9 @@ export * from './fam-user-info-dto';
export * from './fam-user-type-dto';
export * from './httpvalidation-error';
export * from './location-inner';
export * from './page-result-meta-schema';
export * from './paged-results-schema-fam-access-control-privilege-get-response';
export * from './role-type';
export * from './sort-order-enum';
export * from './user-type';
export * from './validation-error';
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* tslint:disable */
/* eslint-disable */
/**
* Forest Access Management - FAM - Admin Management API
* Forest Access Management Admin Management API used by the Forest Access Management application to define admin access to forest applications.
*
* The version of the OpenAPI document: 0.0.1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/



/**
*
* @export
* @interface PageResultMetaSchema
*/
export interface PageResultMetaSchema {
/**
* Total records counts for query conditions
* @type {number}
* @memberof PageResultMetaSchema
*/
'total': number;
/**
* Total pages for query records
* @type {number}
* @memberof PageResultMetaSchema
*/
'number_of_pages': number;
/**
* Page number
* @type {number}
* @memberof PageResultMetaSchema
*/
'page_number': number;
/**
* Number of records per page
* @type {number}
* @memberof PageResultMetaSchema
*/
'page_size': number;
}

Loading

0 comments on commit 90f63e5

Please sign in to comment.