diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 726f33c8c2..2cae11fb92 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -14,17 +14,20 @@ export interface UserType { id: string; firstname: string; lastname: string; + /** @format email */ email: string; - /** @format email */ roles?: string; + /** * @format date * @example 1997-10-31 */ date_of_birth?: string; + /** Set to true if the user's email has been verified. */ email_verified: boolean; + /** * The date that the user was created. * @format date @@ -39,10 +42,7 @@ export interface PageReqQueryParamsType { } export interface UserListType { - users: { - list: UserType; - pageInfo: PaginatedType; - }; + users: { list: UserType; pageInfo: PaginatedType }; } export interface ProjectReqType { @@ -99,10 +99,7 @@ export interface BaseReqType { } export interface BaseListType { - bases: { - list: BaseType[]; - pageInfo: PaginatedType; - }; + bases: { list: BaseType[]; pageInfo: PaginatedType }; } export interface TableType { @@ -188,7 +185,7 @@ export interface FilterType { fk_column_id?: string; logical_op?: string; comparison_op?: string; - value?: string | number | boolean | null; + value?: string | number | number | boolean | null; is_group?: boolean; children?: FilterType[]; project_id?: string; @@ -199,9 +196,7 @@ export interface FilterType { } export interface FilterListType { - filters: { - list: FilterType[]; - }; + filters: { list: FilterType[] }; } export interface SortType { @@ -215,9 +210,7 @@ export interface SortType { } export interface SortListType { - sorts: { - list: SharedViewType[]; - }; + sorts: { list: SharedViewType[] }; } export interface ColumnType { @@ -261,9 +254,7 @@ export interface ColumnType { } export interface ColumnListType { - columns: { - list: ColumnType[]; - }; + columns: { list: ColumnType[] }; } export interface LinkToAnotherRecordType { @@ -545,6 +536,9 @@ export interface ApiTokenType { id?: string; token?: string; description?: string; + fk_user_id?: string; + created_at?: any; + updated_at?: any; } export interface HookLogType { @@ -648,12 +642,7 @@ export type ColumnReqType = fk_relation_column_id?: string; fk_lookup_column_id?: string; } - | { - uidt?: string; - formula_raw?: string; - formula?: string; - title?: string; - }; + | { uidt?: string; formula_raw?: string; formula?: string; title?: string }; export interface UserInfoType { id?: string; @@ -832,38 +821,22 @@ export class Api< > extends HttpClient { auth = { /** - * @description Create a new user with provided email and password and first user is marked as super admin. - * - * @tags Auth - * @name Signup - * @summary Signup - * @request POST:/api/v1/auth/user/signup - * @response `200` `{ - token?: string, - -}` OK - * @response `400` `{ - msg?: string, - -}` Bad Request - * @response `401` `void` Unauthorized - * @response `403` `void` Forbidden - */ + * @description Create a new user with provided email and password and first user is marked as super admin. + * + * @tags Auth + * @name Signup + * @summary Signup + * @request POST:/api/v1/auth/user/signup + * @response `200` `{ token?: string }` OK + * @response `400` `{ msg?: string }` Bad Request + * @response `401` `void` Unauthorized + * @response `403` `void` Forbidden + */ signup: ( - data: { - email?: string; - password?: string; - }, + data: { email?: string; password?: string }, params: RequestParams = {} ) => - this.request< - { - token?: string; - }, - { - msg?: string; - } | void - >({ + this.request<{ token?: string }, { msg?: string } | void>({ path: `/api/v1/auth/user/signup`, method: 'POST', body: data, @@ -872,36 +845,20 @@ export class Api< }), /** - * @description Authenticate existing user with their email and password. Successful login will return a JWT access-token. - * - * @tags Auth - * @name Signin - * @summary Signin - * @request POST:/api/v1/auth/user/signin - * @response `200` `{ - token?: string, - -}` OK - * @response `400` `{ - msg?: string, - -}` Bad Request - */ + * @description Authenticate existing user with their email and password. Successful login will return a JWT access-token. + * + * @tags Auth + * @name Signin + * @summary Signin + * @request POST:/api/v1/auth/user/signin + * @response `200` `{ token?: string }` OK + * @response `400` `{ msg?: string }` Bad Request + */ signin: ( - data: { - email: string; - password: string; - }, + data: { email: string; password: string }, params: RequestParams = {} ) => - this.request< - { - token?: string; - }, - { - msg?: string; - } - >({ + this.request<{ token?: string }, { msg?: string }>({ path: `/api/v1/auth/user/signin`, method: 'POST', body: data, @@ -919,13 +876,7 @@ export class Api< * @request GET:/api/v1/auth/user/me * @response `200` `UserInfoType` OK */ - me: ( - query?: { - /** Pass project id to get project specific roles along with user info */ - project_id?: string; - }, - params: RequestParams = {} - ) => + me: (query?: { project_id?: string }, params: RequestParams = {}) => this.request({ path: `/api/v1/auth/user/me`, method: 'GET', @@ -944,12 +895,7 @@ export class Api< * @response `200` `void` OK * @response `401` `void` Unauthorized */ - passwordForgot: ( - data: { - email?: string; - }, - params: RequestParams = {} - ) => + passwordForgot: (data: { email?: string }, params: RequestParams = {}) => this.request({ path: `/api/v1/auth/password/forgot`, method: 'POST', @@ -959,36 +905,20 @@ export class Api< }), /** - * @description Change password of authenticated user with a new one. - * - * @tags Auth - * @name PasswordChange - * @summary Password change - * @request POST:/api/v1/auth/password/change - * @response `200` `{ - msg?: string, - -}` OK - * @response `400` `{ - msg?: string, - -}` Bad request - */ + * @description Change password of authenticated user with a new one. + * + * @tags Auth + * @name PasswordChange + * @summary Password change + * @request POST:/api/v1/auth/password/change + * @response `200` `{ msg?: string }` OK + * @response `400` `{ msg?: string }` Bad request + */ passwordChange: ( - data: { - currentPassword?: string; - newPassword?: string; - }, + data: { currentPassword?: string; newPassword?: string }, params: RequestParams = {} ) => - this.request< - { - msg?: string; - }, - { - msg?: string; - } - >({ + this.request<{ msg?: string }, { msg?: string }>({ path: `/api/v1/auth/password/change`, method: 'POST', body: data, @@ -1040,9 +970,7 @@ export class Api< */ passwordReset: ( token: string, - data: { - new_password?: string; - }, + data: { new_password?: string }, params: RequestParams = {} ) => this.request({ @@ -1070,29 +998,17 @@ export class Api< }), /** - * No description - * - * @tags Auth - * @name ProjectUserList - * @summary Project users - * @request GET:/api/v1/db/meta/projects/{projectId}/users - * @response `200` `{ - users?: { - list: (UserType)[], - pageInfo: PaginatedType, - -}, - -}` OK - */ + * No description + * + * @tags Auth + * @name ProjectUserList + * @summary Project users + * @request GET:/api/v1/db/meta/projects/{projectId}/users + * @response `200` `{ users?: { list: (UserType)[], pageInfo: PaginatedType } }` OK + */ projectUserList: (projectId: string, params: RequestParams = {}) => this.request< - { - users?: { - list: UserType[]; - pageInfo: PaginatedType; - }; - }, + { users?: { list: UserType[]; pageInfo: PaginatedType } }, any >({ path: `/api/v1/db/meta/projects/${projectId}/users`, @@ -1189,26 +1105,256 @@ export class Api< ...params, }), }; + orgTokens = { + /** + * No description + * + * @tags Org tokens + * @name List + * @summary Organisation API Tokens List + * @request GET:/api/v1/tokens + * @response `200` `{ users?: { list: ((ApiTokenType & { created_by?: string }))[], pageInfo: PaginatedType } }` OK + */ + list: (params: RequestParams = {}) => + this.request< + { + users?: { + list: (ApiTokenType & { created_by?: string })[]; + pageInfo: PaginatedType; + }; + }, + any + >({ + path: `/api/v1/tokens`, + method: 'GET', + format: 'json', + ...params, + }), + + /** + * No description + * + * @tags Org tokens + * @name Create + * @request POST:/api/v1/tokens + * @response `200` `void` OK + */ + create: (data: ApiTokenType, params: RequestParams = {}) => + this.request({ + path: `/api/v1/tokens`, + method: 'POST', + body: data, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags Org tokens + * @name Delete + * @request DELETE:/api/v1/tokens/{token} + * @response `200` `void` OK + */ + delete: (token: string, params: RequestParams = {}) => + this.request({ + path: `/api/v1/tokens/${token}`, + method: 'DELETE', + ...params, + }), + }; + orgLicense = { + /** + * No description + * + * @tags Org license + * @name Get + * @summary App license get + * @request GET:/api/v1/license + * @response `200` `{ key?: string }` OK + */ + get: (params: RequestParams = {}) => + this.request<{ key?: string }, any>({ + path: `/api/v1/license`, + method: 'GET', + format: 'json', + ...params, + }), + + /** + * No description + * + * @tags Org license + * @name Set + * @summary App license get + * @request POST:/api/v1/license + * @response `200` `void` OK + */ + set: (data: { key?: string }, params: RequestParams = {}) => + this.request({ + path: `/api/v1/license`, + method: 'POST', + body: data, + type: ContentType.Json, + ...params, + }), + }; + orgAppSettings = { + /** + * No description + * + * @tags Org app settings + * @name Get + * @summary App settings get + * @request GET:/api/v1/app-settings + * @response `200` `{ enable_user_signup?: boolean }` OK + */ + get: (params: RequestParams = {}) => + this.request<{ enable_user_signup?: boolean }, any>({ + path: `/api/v1/app-settings`, + method: 'GET', + format: 'json', + ...params, + }), + + /** + * No description + * + * @tags Org app settings + * @name Set + * @summary App app settings get + * @request POST:/api/v1/app-settings + * @response `200` `void` OK + */ + set: (data: { enable_user_signup?: boolean }, params: RequestParams = {}) => + this.request({ + path: `/api/v1/app-settings`, + method: 'POST', + body: data, + type: ContentType.Json, + ...params, + }), + }; + orgUsers = { + /** + * No description + * + * @tags Org users + * @name List + * @summary Organisation Users + * @request GET:/api/v1/users + * @response `200` `{ users?: { list: (UserType)[], pageInfo: PaginatedType } }` OK + */ + list: (params: RequestParams = {}) => + this.request< + { users?: { list: UserType[]; pageInfo: PaginatedType } }, + any + >({ + path: `/api/v1/users`, + method: 'GET', + format: 'json', + ...params, + }), + + /** + * No description + * + * @tags Org users + * @name Add + * @summary Organisation User Add + * @request POST:/api/v1/users + * @response `200` `any` OK + */ + add: (data: UserType, params: RequestParams = {}) => + this.request({ + path: `/api/v1/users`, + method: 'POST', + body: data, + type: ContentType.Json, + format: 'json', + ...params, + }), + + /** + * No description + * + * @tags Org users + * @name Update + * @summary Organisation User Update + * @request PATCH:/api/v1/users/{userId} + * @response `200` `void` OK + */ + update: (userId: string, data: UserType, params: RequestParams = {}) => + this.request({ + path: `/api/v1/users/${userId}`, + method: 'PATCH', + body: data, + type: ContentType.Json, + ...params, + }), + + /** + * No description + * + * @tags Org users + * @name Delete + * @summary Organisation User Delete + * @request DELETE:/api/v1/users/{userId} + * @response `200` `void` OK + */ + delete: (userId: string, params: RequestParams = {}) => + this.request({ + path: `/api/v1/users/${userId}`, + method: 'DELETE', + ...params, + }), + + /** + * No description + * + * @tags Org users + * @name ResendInvite + * @summary Organisation User Invite + * @request POST:/api/v1/users/{userId}/resend-invite + * @response `200` `void` OK + */ + resendInvite: (userId: string, params: RequestParams = {}) => + this.request({ + path: `/api/v1/users/${userId}/resend-invite`, + method: 'POST', + ...params, + }), + + /** + * No description + * + * @tags Org users + * @name GeneratePasswordResetToken + * @summary Organisation User Generate Password Reset Token + * @request POST:/api/v1/users/{userId}/generate-reset-url + * @response `200` `{ reset_password_token?: string, reset_password_url?: string }` OK + */ + generatePasswordResetToken: (userId: string, params: RequestParams = {}) => + this.request< + { reset_password_token?: string; reset_password_url?: string }, + any + >({ + path: `/api/v1/users/${userId}/generate-reset-url`, + method: 'POST', + format: 'json', + ...params, + }), + }; project = { /** - * No description - * - * @tags Project - * @name MetaGet - * @summary Project info - * @request GET:/api/v1/db/meta/projects/{projectId}/info - * @response `200` `{ - Node?: string, - Arch?: string, - Platform?: string, - Docker?: boolean, - Database?: string, - ProjectOnRootDB?: string, - RootDB?: string, - PackageVersion?: string, - -}` OK - */ + * No description + * + * @tags Project + * @name MetaGet + * @summary Project info + * @request GET:/api/v1/db/meta/projects/{projectId}/info + * @response `200` `{ Node?: string, Arch?: string, Platform?: string, Docker?: boolean, Database?: string, ProjectOnRootDB?: string, RootDB?: string, PackageVersion?: string }` OK + */ metaGet: (projectId: string, params: RequestParams = {}, query: object) => this.request< { @@ -1241,9 +1387,7 @@ export class Api< */ modelVisibilityList: ( projectId: string, - query?: { - includeM2M?: boolean; - }, + query?: { includeM2M?: boolean }, params: RequestParams = {} ) => this.request({ @@ -1286,11 +1430,7 @@ export class Api< * @response `201` `ProjectListType` */ list: ( - query?: { - page?: number; - pageSize?: number; - sort?: string; - }, + query?: { page?: number; pageSize?: number; sort?: string }, params: RequestParams = {} ) => this.request({ @@ -1310,9 +1450,7 @@ export class Api< * @response `200` `ProjectType` OK */ create: ( - data: ProjectType & { - external?: boolean; - }, + data: ProjectType & { external?: boolean }, params: RequestParams = {} ) => this.request({ @@ -1376,27 +1514,15 @@ export class Api< }), /** - * @description Read project details - * - * @tags Project - * @name SharedBaseGet - * @request GET:/api/v1/db/meta/projects/{projectId}/shared - * @response `200` `{ - uuid?: string, - url?: string, - roles?: string, - -}` OK - */ + * @description Read project details + * + * @tags Project + * @name SharedBaseGet + * @request GET:/api/v1/db/meta/projects/{projectId}/shared + * @response `200` `{ uuid?: string, url?: string, roles?: string }` OK + */ sharedBaseGet: (projectId: string, params: RequestParams = {}) => - this.request< - { - uuid?: string; - url?: string; - roles?: string; - }, - any - >({ + this.request<{ uuid?: string; url?: string; roles?: string }, any>({ path: `/api/v1/db/meta/projects/${projectId}/shared`, method: 'GET', format: 'json', @@ -1419,34 +1545,19 @@ export class Api< }), /** - * No description - * - * @tags Project - * @name SharedBaseCreate - * @request POST:/api/v1/db/meta/projects/{projectId}/shared - * @response `200` `{ - uuid?: string, - url?: string, - roles?: string, - -}` OK - */ + * No description + * + * @tags Project + * @name SharedBaseCreate + * @request POST:/api/v1/db/meta/projects/{projectId}/shared + * @response `200` `{ uuid?: string, url?: string, roles?: string }` OK + */ sharedBaseCreate: ( projectId: string, - data: { - roles?: string; - password?: string; - }, + data: { roles?: string; password?: string }, params: RequestParams = {} ) => - this.request< - { - uuid?: string; - url?: string; - roles?: string; - }, - any - >({ + this.request<{ uuid?: string; url?: string; roles?: string }, any>({ path: `/api/v1/db/meta/projects/${projectId}/shared`, method: 'POST', body: data, @@ -1456,34 +1567,19 @@ export class Api< }), /** - * No description - * - * @tags Project - * @name SharedBaseUpdate - * @request PATCH:/api/v1/db/meta/projects/{projectId}/shared - * @response `200` `{ - uuid?: string, - url?: string, - roles?: string, - -}` OK - */ + * No description + * + * @tags Project + * @name SharedBaseUpdate + * @request PATCH:/api/v1/db/meta/projects/{projectId}/shared + * @response `200` `{ uuid?: string, url?: string, roles?: string }` OK + */ sharedBaseUpdate: ( projectId: string, - data: { - roles?: string; - password?: string; - }, + data: { roles?: string; password?: string }, params: RequestParams = {} ) => - this.request< - { - uuid?: string; - url?: string; - roles?: string; - }, - any - >({ + this.request<{ uuid?: string; url?: string; roles?: string }, any>({ path: `/api/v1/db/meta/projects/${projectId}/shared`, method: 'PATCH', body: data, @@ -1542,32 +1638,19 @@ export class Api< }), /** - * No description - * - * @tags Project - * @name AuditList - * @request GET:/api/v1/db/meta/projects/{projectId}/audits - * @response `200` `{ - list: (AuditType)[], - pageInfo: PaginatedType, - -}` OK - */ + * No description + * + * @tags Project + * @name AuditList + * @request GET:/api/v1/db/meta/projects/{projectId}/audits + * @response `200` `{ list: (AuditType)[], pageInfo: PaginatedType }` OK + */ auditList: ( projectId: string, - query?: { - offset?: string; - limit?: string; - }, + query?: { offset?: string; limit?: string }, params: RequestParams = {} ) => - this.request< - { - list: AuditType[]; - pageInfo: PaginatedType; - }, - any - >({ + this.request<{ list: AuditType[]; pageInfo: PaginatedType }, any>({ path: `/api/v1/db/meta/projects/${projectId}/audits`, method: 'GET', query: query, @@ -1649,10 +1732,7 @@ export class Api< */ update: ( tableId: string, - data: { - table_name?: string; - project_id?: string; - }, + data: { table_name?: string; project_id?: string }, params: RequestParams = {} ) => this.request({ @@ -1689,9 +1769,7 @@ export class Api< */ reorder: ( tableId: string, - data: { - order?: number; - }, + data: { order?: number }, params: RequestParams = {} ) => this.request({ @@ -1845,9 +1923,7 @@ export class Api< */ showAllColumn: ( viewId: string, - query?: { - ignoreIds?: any[]; - }, + query?: { ignoreIds?: any[] }, params: RequestParams = {} ) => this.request({ @@ -1867,9 +1943,7 @@ export class Api< */ hideAllColumn: ( viewId: string, - query?: { - ignoreIds?: any[]; - }, + query?: { ignoreIds?: any[] }, params: RequestParams = {} ) => this.request({ @@ -2145,23 +2219,15 @@ export class Api< }), /** - * No description - * - * @tags DB view share - * @name Create - * @request POST:/api/v1/db/meta/views/{viewId}/share - * @response `200` `{ - uuid?: string, - -}` OK - */ + * No description + * + * @tags DB view share + * @name Create + * @request POST:/api/v1/db/meta/views/{viewId}/share + * @response `200` `{ uuid?: string }` OK + */ create: (viewId: string, params: RequestParams = {}) => - this.request< - { - uuid?: string; - }, - any - >({ + this.request<{ uuid?: string }, any>({ path: `/api/v1/db/meta/views/${viewId}/share`, method: 'POST', format: 'json', @@ -2178,10 +2244,7 @@ export class Api< */ update: ( viewId: string, - data: { - password?: string; - meta?: any; - }, + data: { password?: string; meta?: any }, params: RequestParams = {} ) => this.request({ @@ -2264,28 +2327,15 @@ export class Api< }; dbTableSort = { /** - * No description - * - * @tags DB table sort - * @name List - * @request GET:/api/v1/db/meta/views/{viewId}/sorts - * @response `200` `{ - sorts?: { - list?: (SortType)[], - -}, - -}` OK - */ + * No description + * + * @tags DB table sort + * @name List + * @request GET:/api/v1/db/meta/views/{viewId}/sorts + * @response `200` `{ sorts?: { list?: (SortType)[] } }` OK + */ list: (viewId: string, params: RequestParams = {}) => - this.request< - { - sorts?: { - list?: SortType[]; - }; - }, - any - >({ + this.request<{ sorts?: { list?: SortType[] } }, any>({ path: `/api/v1/db/meta/views/${viewId}/sorts`, method: 'GET', format: 'json', @@ -2558,11 +2608,7 @@ export class Api< orgs: string, projectName: string, tableName: string, - query?: { - fields?: any[]; - sort?: any[]; - where?: string; - }, + query?: { fields?: any[]; sort?: any[]; where?: string }, params: RequestParams = {} ) => this.request({ @@ -2587,7 +2633,6 @@ export class Api< projectName: string, tableName: string, query?: { - /** Column name of the column you want to group by, eg. `column_name=column1` */ column_name?: string; sort?: any[]; where?: string; @@ -2618,13 +2663,7 @@ export class Api< projectName: string, tableName: string, columnId: string, - query?: { - fields?: any[]; - sort?: any[]; - where?: string; - /** Query params for nested data */ - nested?: any; - }, + query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, params: RequestParams = {} ) => this.request({ @@ -2819,9 +2858,7 @@ export class Api< projectName: string, tableName: string, data: any, - query?: { - where?: string; - }, + query?: { where?: string }, params: RequestParams = {} ) => this.request({ @@ -2848,9 +2885,7 @@ export class Api< projectName: string, tableName: string, data: any, - query?: { - where?: string; - }, + query?: { where?: string }, params: RequestParams = {} ) => this.request({ @@ -2934,10 +2969,7 @@ export class Api< relationType: 'mm' | 'hm' | 'bt', columnName: string, refRowId: string, - query?: { - limit?: string; - offset?: string; - }, + query?: { limit?: string; offset?: string }, params: RequestParams = {} ) => this.request({ @@ -3021,13 +3053,7 @@ export class Api< tableName: string, viewName: string, columnId: string, - query?: { - fields?: any[]; - sort?: any[]; - where?: string; - /** Query params for nested data */ - nested?: any; - }, + query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, params: RequestParams = {} ) => this.request({ @@ -3052,13 +3078,7 @@ export class Api< projectName: string, tableName: string, viewName: string, - query?: { - fields?: any[]; - sort?: any[]; - where?: string; - /** Query params for nested data */ - nested?: any; - }, + query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, params: RequestParams = {} ) => this.request({ @@ -3109,13 +3129,7 @@ export class Api< projectName: string, tableName: string, viewName: string, - query?: { - fields?: any[]; - sort?: any[]; - where?: string; - /** Query params for nested data */ - nested?: any; - }, + query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, params: RequestParams = {} ) => this.request({ @@ -3141,7 +3155,6 @@ export class Api< tableName: string, viewName: string, query?: { - /** Column name of the column you want to group by, eg. `column_name=column1` */ column_name?: string; sort?: any[]; where?: string; @@ -3172,11 +3185,7 @@ export class Api< projectName: string, tableName: string, viewName: string, - query?: { - where?: string; - /** Query params for nested data */ - nested?: any; - }, + query?: { where?: string; nested?: any }, params: RequestParams = {} ) => this.request({ @@ -3321,10 +3330,7 @@ export class Api< groupedDataList: ( sharedViewUuid: string, columnId: string, - query?: { - limit?: string; - offset?: string; - }, + query?: { limit?: string; offset?: string }, params: RequestParams = {} ) => this.request({ @@ -3345,10 +3351,7 @@ export class Api< */ dataList: ( sharedViewUuid: string, - query?: { - limit?: string; - offset?: string; - }, + query?: { limit?: string; offset?: string }, params: RequestParams = {} ) => this.request({ @@ -3394,10 +3397,7 @@ export class Api< rowId: string, relationType: 'mm' | 'hm' | 'bt', columnName: string, - query?: { - limit?: string; - offset?: string; - }, + query?: { limit?: string; offset?: string }, params: RequestParams = {} ) => this.request({ @@ -3439,10 +3439,7 @@ export class Api< dataRelationList: ( sharedViewUuid: string, columnName: string, - query?: { - limit?: string; - offset?: string; - }, + query?: { limit?: string; offset?: string }, params: RequestParams = {} ) => this.request({ @@ -3454,23 +3451,15 @@ export class Api< }), /** - * @description Read project details - * - * @tags Public - * @name SharedBaseGet - * @request GET:/api/v1/db/public/shared-base/{sharedBaseUuid}/meta - * @response `200` `{ - project_id?: string, - -}` OK - */ + * @description Read project details + * + * @tags Public + * @name SharedBaseGet + * @request GET:/api/v1/db/public/shared-base/{sharedBaseUuid}/meta + * @response `200` `{ project_id?: string }` OK + */ sharedBaseGet: (sharedBaseUuid: string, params: RequestParams = {}) => - this.request< - { - project_id?: string; - }, - any - >({ + this.request<{ project_id?: string }, any>({ path: `/api/v1/db/public/shared-base/${sharedBaseUuid}/meta`, method: 'GET', format: 'json', @@ -3478,22 +3467,13 @@ export class Api< }), /** - * No description - * - * @tags Public - * @name SharedViewMetaGet - * @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/meta - * @response `200` `(ViewType & { - relatedMetas?: any, - client?: string, - columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType), - model?: TableType, - -} & { - view?: (FormType | GridType | GalleryType), - -})` OK - */ + * No description + * + * @tags Public + * @name SharedViewMetaGet + * @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/meta + * @response `200` `(ViewType & { relatedMetas?: any, client?: string, columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType), model?: TableType } & { view?: (FormType | GridType | GalleryType) })` OK + */ sharedViewMetaGet: (sharedViewUuid: string, params: RequestParams = {}) => this.request< ViewType & { @@ -3502,9 +3482,7 @@ export class Api< columns?: (GridColumnType | FormColumnType | GalleryColumnType) & ColumnType; model?: TableType; - } & { - view?: FormType | GridType | GalleryType; - }, + } & { view?: FormType | GridType | GalleryType }, any >({ path: `/api/v1/db/public/shared-view/${sharedViewUuid}/meta`, @@ -3523,11 +3501,7 @@ export class Api< * @response `201` `any` Created */ commentList: ( - query: { - row_id: string; - fk_model_id: string; - comments_only?: boolean; - }, + query: { row_id: string; fk_model_id: string; comments_only?: boolean }, params: RequestParams = {} ) => this.request({ @@ -3547,11 +3521,7 @@ export class Api< * @response `200` `void` OK */ commentRow: ( - data: { - row_id: string; - fk_model_id: string; - description?: string; - }, + data: { row_id: string; fk_model_id: string; description?: string }, params: RequestParams = {} ) => this.request({ @@ -3571,10 +3541,7 @@ export class Api< * @response `201` `any` Created */ commentCount: ( - query: { - ids: any[]; - fk_model_id: string; - }, + query: { ids: any; fk_model_id: string }, params: RequestParams = {} ) => this.request({ @@ -3613,25 +3580,15 @@ export class Api< }), /** - * No description - * - * @tags Utils - * @name TestConnection - * @request POST:/api/v1/db/meta/connection/test - * @response `200` `{ - code?: number, - message?: string, - -}` OK - */ + * No description + * + * @tags Utils + * @name TestConnection + * @request POST:/api/v1/db/meta/connection/test + * @response `200` `{ code?: number, message?: string }` OK + */ testConnection: (data: any, params: RequestParams = {}) => - this.request< - { - code?: number; - message?: string; - }, - any - >({ + this.request<{ code?: number; message?: string }, any>({ path: `/api/v1/db/meta/connection/test`, method: 'POST', body: data, @@ -3723,58 +3680,19 @@ export class Api< }), /** - * No description - * - * @tags Utils - * @name AggregatedMetaInfo - * @request GET:/api/v1/aggregated-meta-info - * @response `200` `{ - projectCount?: number, - projects?: ({ - tableCount?: { - table?: number, - view?: number, - -}, - external?: boolean, - viewCount?: { - formCount?: number, - gridCount?: number, - galleryCount?: number, - kanbanCount?: number, - total?: number, - sharedFormCount?: number, - sharedGridCount?: number, - sharedGalleryCount?: number, - sharedKanbanCount?: number, - sharedTotal?: number, - sharedLockedCount?: number, - -}, - webhookCount?: number, - filterCount?: number, - sortCount?: number, - rowCount?: ({ - TotalRecords?: string, - -})[], - userCount?: number, - -})[], - userCount?: number, - sharedBaseCount?: number, - -}` OK - */ + * No description + * + * @tags Utils + * @name AggregatedMetaInfo + * @request GET:/api/v1/aggregated-meta-info + * @response `200` `{ projectCount?: number, projects?: ({ tableCount?: { table?: number, view?: number }, external?: boolean, viewCount?: { formCount?: number, gridCount?: number, galleryCount?: number, kanbanCount?: number, total?: number, sharedFormCount?: number, sharedGridCount?: number, sharedGalleryCount?: number, sharedKanbanCount?: number, sharedTotal?: number, sharedLockedCount?: number }, webhookCount?: number, filterCount?: number, sortCount?: number, rowCount?: ({ TotalRecords?: string })[], userCount?: number })[], userCount?: number, sharedBaseCount?: number }` OK + */ aggregatedMetaInfo: (params: RequestParams = {}) => this.request< { projectCount?: number; projects?: { - tableCount?: { - table?: number; - view?: number; - }; + tableCount?: { table?: number; view?: number }; external?: boolean; viewCount?: { formCount?: number; @@ -3792,9 +3710,7 @@ export class Api< webhookCount?: number; filterCount?: number; sortCount?: number; - rowCount?: { - TotalRecords?: string; - }[]; + rowCount?: { TotalRecords?: string }[]; userCount?: number; }[]; userCount?: number; @@ -3840,25 +3756,15 @@ export class Api< }; dbTableWebhook = { /** - * No description - * - * @tags DB table webhook - * @name List - * @request GET:/api/v1/db/meta/tables/{tableId}/hooks - * @response `200` `{ - list: (HookType)[], - pageInfo: PaginatedType, - -}` OK - */ + * No description + * + * @tags DB table webhook + * @name List + * @request GET:/api/v1/db/meta/tables/{tableId}/hooks + * @response `200` `{ list: (HookType)[], pageInfo: PaginatedType }` OK + */ list: (tableId: string, params: RequestParams = {}) => - this.request< - { - list: HookType[]; - pageInfo: PaginatedType; - }, - any - >({ + this.request<{ list: HookType[]; pageInfo: PaginatedType }, any>({ path: `/api/v1/db/meta/tables/${tableId}/hooks`, method: 'GET', format: 'json', @@ -3893,13 +3799,7 @@ export class Api< */ test: ( tableId: string, - data: { - payload?: { - data?: any; - user?: any; - }; - hook?: HookType; - }, + data: { payload?: { data?: any; user?: any }; hook?: HookType }, params: RequestParams = {} ) => this.request({ @@ -3912,32 +3812,20 @@ export class Api< }), /** - * No description - * - * @tags DB table webhook - * @name SamplePayloadGet - * @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation} - * @response `200` `{ - plugins?: { - list: (PluginType)[], - pageInfo: PaginatedType, - -}, - -}` OK - */ + * No description + * + * @tags DB table webhook + * @name SamplePayloadGet + * @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation} + * @response `200` `{ plugins?: { list: (PluginType)[], pageInfo: PaginatedType } }` OK + */ samplePayloadGet: ( tableId: string, operation: 'update' | 'delete' | 'insert', params: RequestParams = {} ) => this.request< - { - plugins?: { - list: PluginType[]; - pageInfo: PaginatedType; - }; - }, + { plugins?: { list: PluginType[]; pageInfo: PaginatedType } }, any >({ path: `/api/v1/db/meta/tables/${tableId}/hooks/samplePayload/${operation}`, @@ -3981,25 +3869,15 @@ export class Api< }; plugin = { /** - * No description - * - * @tags Plugin - * @name List - * @request GET:/api/v1/db/meta/plugins - * @response `200` `{ - list?: (PluginType)[], - pageInfo?: PaginatedType, - -}` OK - */ + * No description + * + * @tags Plugin + * @name List + * @request GET:/api/v1/db/meta/plugins + * @response `200` `{ list?: (PluginType)[], pageInfo?: PaginatedType }` OK + */ list: (params: RequestParams = {}) => - this.request< - { - list?: PluginType[]; - pageInfo?: PaginatedType; - }, - any - >({ + this.request<{ list?: PluginType[]; pageInfo?: PaginatedType }, any>({ path: `/api/v1/db/meta/plugins`, method: 'GET', format: 'json', @@ -4033,12 +3911,7 @@ export class Api< * @response `401` `void` Unauthorized */ test: ( - data: { - id?: string; - title?: string; - input?: any; - category?: string; - }, + data: { id?: string; title?: string; input?: any; category?: string }, params: RequestParams = {} ) => this.request({ @@ -4113,9 +3986,7 @@ export class Api< */ create: ( projectId: string, - data: { - description?: string; - }, + data: { description?: string }, params: RequestParams = {} ) => this.request({ @@ -4151,13 +4022,8 @@ export class Api< * @request POST:/api/v1/db/storage/upload */ upload: ( - query: { - path: string; - }, - data: { - files?: any; - json?: string; - }, + query: { path: string }, + data: { files?: any; json?: string }, params: RequestParams = {} ) => this.request({ @@ -4178,9 +4044,7 @@ export class Api< * @request POST:/api/v1/db/storage/upload-by-url */ uploadByUrl: ( - query: { - path: string; - }, + query: { path: string }, data: { url?: string; fileName?: string;