@sentry/junior-scheduler 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts ADDED
@@ -0,0 +1,110 @@
1
+ export type ScheduledTaskStatus = "active" | "paused" | "blocked" | "deleted";
2
+
3
+ export type ScheduledRunStatus =
4
+ | "pending"
5
+ | "running"
6
+ | "completed"
7
+ | "failed"
8
+ | "blocked"
9
+ | "skipped";
10
+
11
+ export interface ScheduledTaskPrincipal {
12
+ slackUserId: string;
13
+ fullName?: string;
14
+ userName?: string;
15
+ }
16
+
17
+ export interface ScheduledTaskExecutionActor {
18
+ type: "system";
19
+ id: string;
20
+ }
21
+
22
+ export const SCHEDULED_TASK_SYSTEM_ACTOR = Object.freeze({
23
+ type: "system",
24
+ id: "scheduled-task",
25
+ } satisfies ScheduledTaskExecutionActor);
26
+
27
+ export interface ScheduledTaskDestination {
28
+ platform: "slack";
29
+ teamId: string;
30
+ channelId: string;
31
+ }
32
+
33
+ export interface ScheduledTaskConversationAccess {
34
+ audience: "direct" | "group" | "channel";
35
+ visibility: "private" | "public" | "unknown";
36
+ }
37
+
38
+ export interface ScheduledTaskCredentialSubject {
39
+ type: "user";
40
+ userId: string;
41
+ allowedWhen: "private-direct-conversation";
42
+ }
43
+
44
+ export type ScheduledCalendarFrequency =
45
+ | "daily"
46
+ | "weekly"
47
+ | "monthly"
48
+ | "yearly";
49
+
50
+ export interface ScheduledLocalTime {
51
+ hour: number;
52
+ minute: number;
53
+ }
54
+
55
+ export interface ScheduledTaskRecurrence {
56
+ dayOfMonth?: number;
57
+ frequency: ScheduledCalendarFrequency;
58
+ interval: number;
59
+ month?: number;
60
+ startDate: string;
61
+ time: ScheduledLocalTime;
62
+ weekdays?: number[];
63
+ }
64
+
65
+ export interface ScheduledTaskSchedule {
66
+ description: string;
67
+ timezone: string;
68
+ kind: "one_off" | "recurring";
69
+ recurrence?: ScheduledTaskRecurrence;
70
+ }
71
+
72
+ export interface ScheduledTaskSpec {
73
+ text: string;
74
+ }
75
+
76
+ export interface ScheduledTask {
77
+ id: string;
78
+ createdAtMs: number;
79
+ createdBy: ScheduledTaskPrincipal;
80
+ conversationAccess?: ScheduledTaskConversationAccess;
81
+ credentialSubject?: ScheduledTaskCredentialSubject;
82
+ destination: ScheduledTaskDestination;
83
+ executionActor?: ScheduledTaskExecutionActor;
84
+ lastRunAtMs?: number;
85
+ nextRunAtMs?: number;
86
+ originalRequest?: string;
87
+ runNowAtMs?: number;
88
+ schedule: ScheduledTaskSchedule;
89
+ status: ScheduledTaskStatus;
90
+ statusReason?: string;
91
+ task: ScheduledTaskSpec;
92
+ updatedAtMs: number;
93
+ version: number;
94
+ }
95
+
96
+ export interface ScheduledRun {
97
+ id: string;
98
+ attempt: number;
99
+ claimedAtMs: number;
100
+ completedAtMs?: number;
101
+ dispatchId?: string;
102
+ errorMessage?: string;
103
+ idempotencyKey: string;
104
+ resultMessageTs?: string;
105
+ scheduledForMs: number;
106
+ startedAtMs?: number;
107
+ status: ScheduledRunStatus;
108
+ taskId: string;
109
+ taskVersion: number;
110
+ }