From 1d6f762f9cb0aa1cf3b4e60d7f075bf1c3e0af65 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 10 Mar 2023 13:04:13 +0800 Subject: [PATCH] refactor(sdk): regenerate Api.ts --- packages/nocodb-sdk/src/lib/Api.ts | 83 ++++++++++++------------------ 1 file changed, 34 insertions(+), 49 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index ace1636823..a0cdbc011a 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -40,6 +40,16 @@ export interface ApiTokenReqType { description?: string; } +/** + * Model for API Token List + */ +export interface ApiTokenListType { + /** @example [{"list":[{"id":"1","fk_user_id":"us_b3xo2i44nx5y9l","description":"This API Token is for ABC application","token":"DYh540o8hbWpUGdarekECKLdN5OhlgCUWutVJYX2"}],"pageInfo":{"isFirstPage":true,"isLastPage":true,"page":1,"pageSize":10,"totalRows":1}}] */ + list?: ApiTokenType[]; + /** Model for Paginated */ + pageInfo?: PaginatedType; +} + /** * Model for Attachment */ @@ -2291,6 +2301,12 @@ export type VisibilityRuleReqType = { }; }[]; +export interface ApiTokenReqCopyType { + list?: ApiTokenType[]; + /** Model for Paginated */ + pageInfo?: PaginatedType; +} + import axios, { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios'; export type QueryParamsType = Record; @@ -3026,33 +3042,16 @@ export class Api< }; orgUsers = { /** - * @description List all organisation users. Exclusive for Super Admin. Access with API Tokens will be blocked. - * - * @tags Org Users - * @name List - * @summary List Organisation Users - * @request GET:/api/v1/users - * @response `200` `{ - users?: { - list: (UserType)[], - \** Model for Paginated *\ - pageInfo: PaginatedType, - -}, - -}` OK - */ + * @description List all organisation users. Exclusive for Super Admin. Access with API Tokens will be blocked. + * + * @tags Org Users + * @name List + * @summary List Organisation Users + * @request GET:/api/v1/users + * @response `200` `UserListType` OK + */ list: (params: RequestParams = {}) => - this.request< - { - users?: { - list: UserType[]; - /** Model for Paginated */ - pageInfo: PaginatedType; - }; - }, - any - >({ + this.request({ path: `/api/v1/users`, method: 'GET', format: 'json', @@ -6703,30 +6702,16 @@ export class Api< }; apiToken = { /** - * @description List API Tokens in the given project - * - * @tags API Token - * @name List - * @summary List API Tokens in Project - * @request GET:/api/v1/db/meta/projects/{projectId}/api-tokens - * @response `200` `{ - \** List of API Token Models *\ - list: (ApiTokenType)[], - \** Pagination Info *\ - pageInfo: PaginatedType, - -}` OK - */ + * @description List API Tokens in the given project + * + * @tags API Token + * @name List + * @summary List API Tokens in Project + * @request GET:/api/v1/db/meta/projects/{projectId}/api-tokens + * @response `200` `ApiTokenListType` OK + */ list: (projectId: IdType, params: RequestParams = {}) => - this.request< - { - /** List of API Token Models */ - list: ApiTokenType[]; - /** Pagination Info */ - pageInfo: PaginatedType; - }, - any - >({ + this.request({ path: `/api/v1/db/meta/projects/${projectId}/api-tokens`, method: 'GET', format: 'json',