Skip to content

Commit 9105487

Browse files
author
Fil Maj
authored
feat: add event_timestamp to all trigger event data objects (#109)
* feat: add `event_timestamp` to all trigger event data objects. * linting * all_trigger_data -> base_trigger_data
1 parent 2362b9c commit 9105487

26 files changed

+77
-0
lines changed

src/typed-method-types/workflows/triggers/event-data/app_mentioned.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
export const AppMentioned = {
4+
...base_trigger_data,
25
/**
36
* A unique identifier for the app being mentioned.
47
*/

src/typed-method-types/workflows/triggers/event-data/channel_archived.ts

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

src/typed-method-types/workflows/triggers/event-data/channel_created.ts

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

src/typed-method-types/workflows/triggers/event-data/channel_deleted.ts

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

src/typed-method-types/workflows/triggers/event-data/channel_renamed.ts

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

src/typed-method-types/workflows/triggers/event-data/channel_shared.ts

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

src/typed-method-types/workflows/triggers/event-data/channel_unarchived.ts

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

src/typed-method-types/workflows/triggers/event-data/channel_unshared.ts

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

src/typed-method-types/workflows/triggers/event-data/dnd_updated.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
const DndStatus = {
4+
...base_trigger_data,
25
/**
36
* Whether Do Not Disturb is enabled or not.
47
*/

src/typed-method-types/workflows/triggers/event-data/emoji_changed.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
export const EmojiChanged = {
4+
...base_trigger_data,
25
/**
36
* The event type being invoked. At runtime will always be "slack#/events/emoji_changed".
47
*/

src/typed-method-types/workflows/triggers/event-data/message_metadata_posted.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
export const MessageMetadataPosted = {
4+
...base_trigger_data,
25
/**
36
* A unique identifier for the app that posted metadata.
47
*/

src/typed-method-types/workflows/triggers/event-data/message_posted.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
export const MessagePosted = {
4+
...base_trigger_data,
25
/**
36
* A unique identifier for the app that posted the message. Only available when message is posted by an app.
47
*/

src/typed-method-types/workflows/triggers/event-data/pin_added.ts

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

src/typed-method-types/workflows/triggers/event-data/pin_removed.ts

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

src/typed-method-types/workflows/triggers/event-data/reaction_added.ts

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

src/typed-method-types/workflows/triggers/event-data/reaction_removed.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
export const ReactionRemoved = {
4+
...base_trigger_data,
25
/**
36
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} where the emoji reaction was removed from.
47
*/

src/typed-method-types/workflows/triggers/event-data/shared_channel_invite_accepted.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Invite } from "./common-objects/shared_channel_invite.ts";
2+
import base_trigger_data from "./common-objects/all_triggers.ts";
23

34
const AcceptingUser = {
45
/**
@@ -37,6 +38,7 @@ Object.defineProperty(AcceptingUser, "toJSON", {
3738
});
3839

3940
export const SharedChannelInviteAccepted = {
41+
...base_trigger_data,
4042
/**
4143
* Object containing details for the invitee.
4244
*/

src/typed-method-types/workflows/triggers/event-data/shared_channel_invite_approved.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Invite } from "./common-objects/shared_channel_invite.ts";
2+
import base_trigger_data from "./common-objects/all_triggers.ts";
23

34
const ApprovingUser = {
45
/**
@@ -37,6 +38,7 @@ Object.defineProperty(ApprovingUser, "toJSON", {
3738
});
3839

3940
export const SharedChannelInviteApproved = {
41+
...base_trigger_data,
4042
/**
4143
* A unique identifier for the team or workspace issuing the approval.
4244
*/

src/typed-method-types/workflows/triggers/event-data/shared_channel_invite_declined.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Invite } from "./common-objects/shared_channel_invite.ts";
2+
import base_trigger_data from "./common-objects/all_triggers.ts";
23

34
const DecliningUser = {
45
/**
@@ -37,6 +38,7 @@ Object.defineProperty(DecliningUser, "toJSON", {
3738
});
3839

3940
export const SharedChannelInviteDeclined = {
41+
...base_trigger_data,
4042
/**
4143
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} being shared.
4244
*/

src/typed-method-types/workflows/triggers/event-data/shared_channel_invite_received.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Invite } from "./common-objects/shared_channel_invite.ts";
2+
import base_trigger_data from "./common-objects/all_triggers.ts";
23

34
export const SharedChannelInviteReceived = {
5+
...base_trigger_data,
46
/**
57
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} being shared.
68
*/

src/typed-method-types/workflows/triggers/event-data/user_joined_channel.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
export const UserJoinedChannel = {
4+
...base_trigger_data,
25
/**
36
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was joined.
47
*/

src/typed-method-types/workflows/triggers/event-data/user_joined_team.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
const User = {
24
/**
35
* The display name of the user who joined, as they chose upon registering to the workspace.
@@ -33,6 +35,7 @@ const User = {
3335
Object.defineProperty(User, "toJSON", { value: () => "{{data.user}}" });
3436

3537
export const UserJoinedTeam = {
38+
...base_trigger_data,
3639
/**
3740
* The event type being invoked. At runtime will always be "slack#/events/user_joined_channel".
3841
*/

src/typed-method-types/workflows/triggers/event-data/user_left_channel.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import base_trigger_data from "./common-objects/all_triggers.ts";
2+
13
export const UserLeftChannel = {
4+
...base_trigger_data,
25
/**
36
* A unique identifier for the {@link https://api.slack.com/automation/types#channelid Slack channel} that was left.
47
*/

src/typed-method-types/workflows/triggers/scheduled-data.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import base_trigger_data from "./event-data/common-objects/all_triggers.ts";
2+
13
/**
24
* Scheduled-trigger-specific input values that contain information about the scheduled trigger.
35
*/
46
export const ScheduledTriggerContextData = {
7+
...base_trigger_data,
58
/**
69
* A unique identifier for the {@link https://api.slack.com/automation/types#userid Slack user} who created the trigger.
710
*/

src/typed-method-types/workflows/triggers/shortcut-data.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import base_trigger_data from "./event-data/common-objects/all_triggers.ts";
2+
13
const Interactor = {
24
/**
35
* A unique identifier for the {@link https://api.slack.com/automation/types#userid Slack user} who invoked the trigger.
@@ -32,6 +34,7 @@ Object.defineProperty(Interactivity, "toJSON", {
3234
* Link-trigger-specific input values that contain information about the link trigger.
3335
*/
3436
export const ShortcutTriggerContextData = {
37+
...base_trigger_data,
3538
/**
3639
* 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}!
3740
*/

0 commit comments

Comments
 (0)