Skip to content

Commit

Permalink
fix: Typo of fileOperation -> fileOperations
Browse files Browse the repository at this point in the history
  • Loading branch information
tommoor committed Jul 3, 2022
1 parent c9af7ff commit ee10e14
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions server/models/Event.ts
Expand Up @@ -11,6 +11,7 @@ import {
DataType,
} from "sequelize-typescript";
import { globalEventQueue } from "../queues";
import { Event as TEvent } from "../types";
import Collection from "./Collection";
import Document from "./Document";
import Team from "./Team";
Expand Down Expand Up @@ -106,7 +107,7 @@ class Event extends IdModel {
);
}

static ACTIVITY_EVENTS = [
static ACTIVITY_EVENTS: TEvent["name"][] = [
"collections.create",
"collections.delete",
"collections.move",
Expand All @@ -123,7 +124,7 @@ class Event extends IdModel {
"users.create",
];

static AUDIT_EVENTS = [
static AUDIT_EVENTS: TEvent["name"][] = [
"api_keys.create",
"api_keys.delete",
"authenticationProviders.update",
Expand All @@ -136,7 +137,6 @@ class Event extends IdModel {
"collections.add_group",
"collections.remove_group",
"collections.delete",
"collections.export_all",
"documents.create",
"documents.publish",
"documents.update",
Expand Down
3 changes: 2 additions & 1 deletion server/queues/tasks/DeliverWebhookTask.ts
Expand Up @@ -88,6 +88,7 @@ export default class DeliverWebhookTask extends BaseTask<Props> {
case "api_keys.delete":
case "attachments.create":
case "attachments.delete":
case "authenticationProviders.update":
// Ignored
return;
case "users.create":
Expand Down Expand Up @@ -126,7 +127,7 @@ export default class DeliverWebhookTask extends BaseTask<Props> {
return;
case "fileOperations.create":
case "fileOperations.update":
case "fileOperation.delete":
case "fileOperations.delete":
await this.handleFileOperationEvent(subscription, event);
return;
case "collections.create":
Expand Down
11 changes: 10 additions & 1 deletion server/types.ts
Expand Up @@ -42,6 +42,14 @@ export type AttachmentEvent = BaseEvent &
}
);

export type AuthenticationProviderEvent = BaseEvent & {
name: "authenticationProviders.update";
modelId: string;
data: {
enabled: boolean;
};
};

export type UserEvent = BaseEvent &
(
| {
Expand Down Expand Up @@ -138,7 +146,7 @@ export type FileOperationEvent = BaseEvent & {
name:
| "fileOperations.create"
| "fileOperations.update"
| "fileOperation.delete";
| "fileOperations.delete";
modelId: string;
data: Partial<FileOperation>;
};
Expand Down Expand Up @@ -270,6 +278,7 @@ export type WebhookSubscriptionEvent = BaseEvent & {
export type Event =
| ApiKeyEvent
| AttachmentEvent
| AuthenticationProviderEvent
| DocumentEvent
| PinEvent
| StarEvent
Expand Down

0 comments on commit ee10e14

Please sign in to comment.