Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

remove unused ColumnWebhookManagerBuilder code

Fendy Heryanto5e3c15baa602
diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts
index b7f6526d4a..1a28a5e835 100644
--- a/packages/nocodb-sdk/src/lib/Api.ts
+++ b/packages/nocodb-sdk/src/lib/Api.ts
@@ -1004,6 +1004,8 @@ export interface FieldBaseV3Type {
export type ViewV3Type = {
/** Unique identifier for the view. */
id: string;
+ /** Id of table associated with the view. */
+ table_id?: string;
/** Indicates if this is the default view. Omitted if not the default view. */
is_default?: boolean;
} & ViewBaseV3Type & {
@@ -1365,7 +1367,7 @@ export interface ViewBaseInUpdateV3Type {
*
* Note: Assigning view as personal using API is not supported currently
*/
- lock_type?: 'collaborative' | 'locked';
+ lock_type?: 'collaborative' | 'locked' | 'personal';
/** Description of the view. */
description?: string;
}
@@ -1393,6 +1395,8 @@ export interface ViewListV3Type {
list: {
/** Unique identifier for the view. */
id: string;
+ /** Id of table associated with the view. */
+ table_id?: string;
/** Title of the view. */
title: string;
/** Description of the view. */
@@ -3211,7 +3215,7 @@ export interface HookType {
* Event Type for the operation
* @example after
*/
- event?: 'after' | 'before' | 'manual';
+ event?: 'view' | 'field' | 'after' | 'before' | 'manual';
/**
* Foreign Key to Model
* @example md_rsu68aqjsbyqtl
@@ -3277,7 +3281,7 @@ export interface HookReqType {
* Event Type for the operation
* @example after
*/
- event: 'after' | 'before' | 'manual';
+ event: 'view' | 'field' | 'after' | 'before' | 'manual';
/**
* Foreign Key to Model
* @example md_rsu68aqjsbyqtl
@@ -3352,7 +3356,7 @@ export interface HookLogType {
* Hook Event
* @example after
*/
- event?: 'after' | 'before' | 'manual';
+ event?: 'field' | 'view' | 'after' | 'before' | 'manual';
/**
* Execution Time in milliseconds
* @example 98
@@ -13408,7 +13412,7 @@ export class Api<
* @tags DB Table Webhook
* @name SamplePayloadGet
* @summary Get Sample Hook Payload
- * @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation}/{version}
+ * @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{event}/{operation}/{version}
* @response `200` `{
\** Sample Payload Data *\
data?: object,
@@ -13422,6 +13426,7 @@ export class Api<
*/
samplePayloadGet: (
tableId: IdType,
+ event: 'field' | 'view' | 'after' | 'before' | 'manual',
operation:
| 'insert'
| 'update'
@@ -13442,7 +13447,7 @@ export class Api<
msg: string;
}
>({
- path: `/api/v1/db/meta/tables/${tableId}/hooks/samplePayload/${operation}/${version}`,
+ path: `/api/v1/db/meta/tables/${tableId}/hooks/samplePayload/${event}/${operation}/${version}`,
method: 'GET',
format: 'json',
...params,
diff --git a/packages/nocodb/src/integrations/index.ts b/packages/nocodb/src/integrations/index.ts
index 6d8bf731be..cb2629fde8 100644
--- a/packages/nocodb/src/integrations/index.ts
+++ b/packages/nocodb/src/integrations/index.ts
@@ -3,6 +3,10 @@
!!! Do not edit this file manually !!!
*/
+
+
import type { IntegrationEntry } from '@noco-local-integrations/core';
-export default [] as IntegrationEntry[];
+export default [
+
+] as IntegrationEntry[];
diff --git a/packages/nocodb/src/utils/column-webhook-manager.ts b/packages/nocodb/src/utils/column-webhook-manager.ts
index 3d056c60d7..67f34b5a74 100644
--- a/packages/nocodb/src/utils/column-webhook-manager.ts
+++ b/packages/nocodb/src/utils/column-webhook-manager.ts
@@ -5,7 +5,6 @@ import type { MetaService } from '~/meta/meta.service';
import type { Model } from '~/models';
import type { ModelWebhookManager } from '~/utils/model-webhook-manager';
import Noco from '~/Noco';
-import { NcError } from '~/helpers/ncError';
export class ColumnWebhookManagerBuilder {
constructor(
@@ -58,11 +57,6 @@ export class ColumnWebhookManagerBuilder {
}
forCreate() {
- if (!this.modelId) {
- NcError.get(this.context).internalServerError(
- `Need to call 'withModel' before running 'forCreate'`,
- );
- }
return new ColumnWebhookManager(this.context, {
action: WebhookActions.INSERT,
modelId: this.modelId!,
@@ -72,16 +66,6 @@ export class ColumnWebhookManagerBuilder {
}
forUpdate() {
- if (!this.modelId) {
- NcError.get(this.context).internalServerError(
- `Need to call 'withModel' before running 'forUpdate'`,
- );
- }
- if (!this.oldColumns.length) {
- NcError.get(this.context).internalServerError(
- `Need to call 'withView' before running 'forUpdate'`,
- );
- }
return new ColumnWebhookManager(this.context, {
action: WebhookActions.UPDATE,
modelId: this.modelId!,
@@ -91,16 +75,6 @@ export class ColumnWebhookManagerBuilder {
}
forDelete() {
- if (!this.modelId) {
- NcError.get(this.context).internalServerError(
- `Need to call 'withModel' before running 'forDelete'`,
- );
- }
- if (!this.oldColumns.length) {
- NcError.get(this.context).internalServerError(
- `Need to call 'withView' before running 'forDelete'`,
- );
- }
return new ColumnWebhookManager(
this.context,
{
diff --git a/packages/nocodb/tests/unit/rest/tests/meta-apis/table.test.ts b/packages/nocodb/tests/unit/rest/tests/meta-apis/table.test.ts
index 2f4b4da948..3567fcef9b 100644
--- a/packages/nocodb/tests/unit/rest/tests/meta-apis/table.test.ts
+++ b/packages/nocodb/tests/unit/rest/tests/meta-apis/table.test.ts
@@ -229,7 +229,7 @@ export default function (API_VERSION: 'v1' | 'v2' | 'v3') {
// });
});
- it(`Delete table ${API_VERSION}`, async function () {
+ it.only(`Delete table ${API_VERSION}`, async function () {
let tables = await getAllTables({ base });
const initialLength = tables.length;
await request(context.app)