Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add event_timestamp to all trigger event data objects #109

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import all_trigger_data from "./common-objects/all_triggers.ts";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we name this base_trigger_data instead of all_trigger_data 🤔


export const AppMentioned = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelArchived = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelCreated = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelDeleted = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelRenamed = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelShared = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelUnarchived = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ChannelUnshared = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

const DndStatus = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const EmojiChanged = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const MessageMetadataPosted = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const MessagePosted = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const PinAdded = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const PinRemoved = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ReactionAdded = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const ReactionRemoved = {
...all_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 all_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 = {
...all_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 all_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 = {
...all_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 all_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 = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const SharedChannelInviteReceived = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const UserJoinedChannel = {
...all_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 all_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 = {
...all_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 all_trigger_data from "./common-objects/all_triggers.ts";

export const UserLeftChannel = {
...all_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 all_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 = {
...all_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 all_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 = {
...all_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
Loading