Skip to content

Commit

Permalink
feat: add event_timestamp to all trigger event data objects (#109)
Browse files Browse the repository at this point in the history
* feat: add `event_timestamp` to all trigger event data objects.

* linting

* all_trigger_data -> base_trigger_data
  • Loading branch information
filmaj authored Aug 1, 2024
1 parent 2362b9c commit 9105487
Show file tree
Hide file tree
Showing 26 changed files with 77 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const AppMentioned = {
...base_trigger_data,
/**
* A unique identifier for the app being mentioned.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelArchived = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was archived.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelCreated = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was created.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelDeleted = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was deleted.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelRenamed = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was renamed.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelShared = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was shared.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelUnarchived = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was unarchived.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelUnshared = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was unshared.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
/**
* A {@link https://api.slack.com/automation/types#timestamp timestamp} when the trigger was invoked.
*/
event_timestamp: "{{event_timestamp}}",
} as const;
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

const DndStatus = {
...base_trigger_data,
/**
* Whether Do Not Disturb is enabled or not.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const EmojiChanged = {
...base_trigger_data,
/**
* The event type being invoked. At runtime will always be "slack#/events/emoji_changed".
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const MessageMetadataPosted = {
...base_trigger_data,
/**
* A unique identifier for the app that posted metadata.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const MessagePosted = {
...base_trigger_data,
/**
* A unique identifier for the app that posted the message. Only available when message is posted by an app.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const PinAdded = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} where the message was pinned.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const PinRemoved = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} where the message was unpinned.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ReactionAdded = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} where the emoji reaction was added to.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const ReactionRemoved = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} where the emoji reaction was removed from.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Invite } from "./common-objects/shared_channel_invite.ts";
import base_trigger_data from "./common-objects/all_triggers.ts";

const AcceptingUser = {
/**
Expand Down Expand Up @@ -37,6 +38,7 @@ Object.defineProperty(AcceptingUser, "toJSON", {
});

export const SharedChannelInviteAccepted = {
...base_trigger_data,
/**
* Object containing details for the invitee.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Invite } from "./common-objects/shared_channel_invite.ts";
import base_trigger_data from "./common-objects/all_triggers.ts";

const ApprovingUser = {
/**
Expand Down Expand Up @@ -37,6 +38,7 @@ Object.defineProperty(ApprovingUser, "toJSON", {
});

export const SharedChannelInviteApproved = {
...base_trigger_data,
/**
* A unique identifier for the team or workspace issuing the approval.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Invite } from "./common-objects/shared_channel_invite.ts";
import base_trigger_data from "./common-objects/all_triggers.ts";

const DecliningUser = {
/**
Expand Down Expand Up @@ -37,6 +38,7 @@ Object.defineProperty(DecliningUser, "toJSON", {
});

export const SharedChannelInviteDeclined = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} being shared.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Invite } from "./common-objects/shared_channel_invite.ts";
import base_trigger_data from "./common-objects/all_triggers.ts";

export const SharedChannelInviteReceived = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} being shared.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const UserJoinedChannel = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was joined.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

const User = {
/**
* The display name of the user who joined, as they chose upon registering to the workspace.
Expand Down Expand Up @@ -33,6 +35,7 @@ const User = {
Object.defineProperty(User, "toJSON", { value: () => "{{data.user}}" });

export const UserJoinedTeam = {
...base_trigger_data,
/**
* The event type being invoked. At runtime will always be "slack#/events/user_joined_channel".
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import base_trigger_data from "./common-objects/all_triggers.ts";

export const UserLeftChannel = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was left.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/typed-method-types/workflows/triggers/scheduled-data.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import base_trigger_data from "./event-data/common-objects/all_triggers.ts";

/**
* Scheduled-trigger-specific input values that contain information about the scheduled trigger.
*/
export const ScheduledTriggerContextData = {
...base_trigger_data,
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#userid Slack user} who created the trigger.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/typed-method-types/workflows/triggers/shortcut-data.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import base_trigger_data from "./event-data/common-objects/all_triggers.ts";

const Interactor = {
/**
* A unique identifier for the {@link https://api.slack.com/automation/types#userid Slack user} who invoked the trigger.
Expand Down Expand Up @@ -32,6 +34,7 @@ Object.defineProperty(Interactivity, "toJSON", {
* Link-trigger-specific input values that contain information about the link trigger.
*/
export const ShortcutTriggerContextData = {
...base_trigger_data,
/**
* A unique identifier for the action that invoked the trigger. Only available when trigger is invoked from a {@link https://api.slack.com/automation/triggers/link#workflow_buttons Workflow button}!
*/
Expand Down

0 comments on commit 9105487

Please sign in to comment.