From 5544d42bc166e50ab49d41ccc84cd7cef59bde67 Mon Sep 17 00:00:00 2001 From: Elie Rotenberg Date: Tue, 21 May 2024 18:46:32 +0200 Subject: [PATCH] fix: webhook match go struct instead of syncer * Previous version was copied as-in from the Syncer interface, instead of the Webhook go struct (see https://github.com/casdoor/casdoor/blob/master/object/webhook.go#L24). --- src/webhook.ts | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/webhook.ts b/src/webhook.ts index f2d5c39..4c59b42 100644 --- a/src/webhook.ts +++ b/src/webhook.ts @@ -12,33 +12,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TableColumn } from './syncer' import { AxiosResponse } from 'axios' import { Config } from './config' import Request from './request' +// Webhook has same definition as https://github.com/casdoor/casdoor/blob/master/object/webhook.go#L29 export interface Webhook { owner: string name: string - createdTime: string - - organization: string - type?: string - - host?: string - port?: number - user?: string - password?: string - databaseType?: string - database?: string - table?: string - tablePrimaryKey?: string - tableColumns?: TableColumn[] - affiliationTable?: string - avatarBaseUrl?: string - errorText?: string - syncInterval?: number - isReadOnly?: boolean + createdTime?: string + + organization?: string + + url?: string + method?: string + contentType?: string + headers?: { name?: string; value?: string }[] + events?: string[] + isUserExtended?: boolean + singleOrgOnly?: boolean isEnabled?: boolean // Ormer *Ormer `xorm:"-" json:"-"`