Browse Source

chore: lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/9232/head
Pranav C 4 months ago
parent
commit
c9b776d82c
  1. 2
      packages/nc-gui/components/project/AccessSettings.vue
  2. 128
      packages/nocodb-sdk/src/lib/Api.ts

2
packages/nc-gui/components/project/AccessSettings.vue

@ -373,7 +373,7 @@ const isDeleteOrUpdateAllowed = (user) => {
</div> </div>
</div> </div>
<div v-if="column.key === 'role'"> <div v-if="column.key === 'role'">
<template v-if="isDeleteOrUpdateAllowed(record) && isOwnerOrCreator && accessibleRoles.includes(record.roles)"> <template v-if="isDeleteOrUpdateAllowed(record) && isOwnerOrCreator && accessibleRoles.includes(record.roles)">
<RolesSelector <RolesSelector
:role="record.roles" :role="record.roles"
:roles="accessibleRoles" :roles="accessibleRoles"

128
packages/nocodb-sdk/src/lib/Api.ts

@ -589,12 +589,14 @@ export interface ColumnListType {
* Model for Column Request * Model for Column Request
*/ */
export type ColumnReqType = ( export type ColumnReqType = (
| ButtonColumnReqType
| FormulaColumnReqType | FormulaColumnReqType
| LinkToAnotherColumnReqType | LinkToAnotherColumnReqType
| LookupColumnReqType | LookupColumnReqType
| NormalColumnRequestType | NormalColumnRequestType
| RollupColumnReqType | RollupColumnReqType
| (FormulaColumnReqType & | (ButtonColumnReqType &
FormulaColumnReqType &
LinkToAnotherColumnReqType & LinkToAnotherColumnReqType &
LookupColumnReqType & LookupColumnReqType &
NormalColumnRequestType & NormalColumnRequestType &
@ -1099,6 +1101,88 @@ export interface FormulaType {
id?: IdType; id?: IdType;
} }
/**
* Model for Button
*/
export interface ButtonType {
/** Unique ID */
id?: IdType;
/** Whether button is webhook or url */
type?: 'webhook' | 'url';
/** Label of Button */
label?: string;
/** Button Theme */
theme?: 'solid' | 'text' | 'light';
/** Button color */
color?:
| 'brand'
| 'red'
| 'green'
| 'maroon'
| 'blue'
| 'orange'
| 'pink'
| 'purple'
| 'yellow'
| 'gray';
/** Button Icon */
icon?: string;
/**
* Formula with column ID replaced
* @example CONCAT("FOO", {{cl_c5knoi4xs4sfpt}})
*/
formula?: string;
/**
* Original Formula inputted in UI
* @example CONCAT("FOO", {Title})
*/
formula_raw?: string;
/** Error Message */
error?: string;
/** Parsed Formula Tree */
parsed_tree?: object;
/** Webhook ID */
fk_webhook_id?: IdType;
/** Foreign Key to Column */
fk_column_id?: IdType;
}
/**
* Model for Button Column Request
*/
export interface ButtonColumnReqType {
/** Formula Title */
title?: string;
/** UI Data Type */
uidt?: 'Formula';
/** Whether button is webhook or url */
type?: 'webhook' | 'url';
/** Button Theme */
theme?: 'solid' | 'text' | 'light';
/** Button color */
color?:
| 'brand'
| 'red'
| 'green'
| 'maroon'
| 'blue'
| 'orange'
| 'pink'
| 'purple'
| 'yellow'
| 'gray';
/** Label of Button */
label?: string;
/** Button Icon */
icon?: string;
/** Webhook ID */
fk_webhook_id?: IdType;
/** Formula with column ID replaced */
formula?: string;
/** Original Formula inputted in UI */
formula_raw?: string;
}
/** /**
* Model for Formula Column Request * Model for Formula Column Request
*/ */
@ -1347,7 +1431,7 @@ export interface HookType {
* Event Type for the operation * Event Type for the operation
* @example after * @example after
*/ */
event?: 'after' | 'before'; event?: 'after' | 'before' | 'manual';
/** /**
* Foreign Key to Model * Foreign Key to Model
* @example md_rsu68aqjsbyqtl * @example md_rsu68aqjsbyqtl
@ -1367,7 +1451,8 @@ export interface HookType {
| 'delete' | 'delete'
| 'bulkInsert' | 'bulkInsert'
| 'bulkUpdate' | 'bulkUpdate'
| 'bulkDelete'; | 'bulkDelete'
| 'trigger';
/** /**
* Retry Count * Retry Count
* @example 10 * @example 10
@ -1416,7 +1501,7 @@ export interface HookReqType {
* Event Type for the operation * Event Type for the operation
* @example after * @example after
*/ */
event: 'after' | 'before'; event: 'after' | 'before' | 'manual';
/** /**
* Foreign Key to Model * Foreign Key to Model
* @example md_rsu68aqjsbyqtl * @example md_rsu68aqjsbyqtl
@ -1436,7 +1521,8 @@ export interface HookReqType {
| 'delete' | 'delete'
| 'bulkInsert' | 'bulkInsert'
| 'bulkUpdate' | 'bulkUpdate'
| 'bulkDelete'; | 'bulkDelete'
| 'trigger';
/** /**
* Retry Count * Retry Count
* @example 10 * @example 10
@ -1494,7 +1580,7 @@ export interface HookLogType {
* Hook Event * Hook Event
* @example after * @example after
*/ */
event?: 'after' | 'before'; event?: 'after' | 'before' | 'manual';
/** /**
* Execution Time in milliseconds * Execution Time in milliseconds
* @example 98 * @example 98
@ -1516,7 +1602,8 @@ export interface HookLogType {
| 'delete' | 'delete'
| 'bulkInsert' | 'bulkInsert'
| 'bulkUpdate' | 'bulkUpdate'
| 'bulkDelete'; | 'bulkDelete'
| 'trigger';
/** /**
* Hook Payload * Hook Payload
* @example {"method":"POST","body":"{{ json data }}","headers":[{}],"parameters":[{}],"auth":"","path":"https://webhook.site/6eb45ce5-b611-4be1-8b96-c2965755662b"} * @example {"method":"POST","body":"{{ json data }}","headers":[{}],"parameters":[{}],"auth":"","path":"https://webhook.site/6eb45ce5-b611-4be1-8b96-c2965755662b"}
@ -11192,6 +11279,33 @@ export class Api<
format: 'json', format: 'json',
...params, ...params,
}), }),
/**
* @description Trigger the manual WebHook
*
* @tags DB Table Webhook
* @name Trigger
* @summary Trigger Manual Hook
* @request POST:/api/v2/meta/hooks/{hookId}/trigger/{rowId}
* @response `200` `void` OK
* @response `400` `{
\** @example BadRequest [Error]: <ERROR MESSAGE> *\
msg: string,
}`
*/
trigger: (hookId: IdType, rowId: IdType, params: RequestParams = {}) =>
this.request<
void,
{
/** @example BadRequest [Error]: <ERROR MESSAGE> */
msg: string;
}
>({
path: `/api/v2/meta/hooks/${hookId}/trigger/${rowId}`,
method: 'POST',
...params,
}),
}; };
plugin = { plugin = {
/** /**

Loading…
Cancel
Save