@breign/db-schemas 0.1.79 → 0.1.80
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/dist/types/gitlab-integration.d.ts +136 -0
- package/dist/types/gitlab-integration.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/scheduled-task-run.d.ts +10 -0
- package/dist/types/scheduled-task.d.ts +25 -1
- package/package.json +1 -1
- package/src/types/gitlab-integration.ts +157 -0
- package/src/types/index.ts +1 -0
- package/src/types/scheduled-task-run.ts +11 -0
- package/src/types/scheduled-task.ts +24 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Les niveaux d'accès d'un membre de projet GitLab : Guest (10), Reporter (20), Developer (30),
|
|
3
|
+
* Maintainer (40), Owner (50).
|
|
4
|
+
*/
|
|
5
|
+
export type GitlabAccessLevel = 10 | 20 | 30 | 40 | 50;
|
|
6
|
+
export type GitlabIntegrationStatus = 'active' | 'disabled';
|
|
7
|
+
/**
|
|
8
|
+
* Une instance GitLab reliée à une organisation : elle reçoit les webhooks des projets qui la
|
|
9
|
+
* déclarent, à l'adresse `/webhooks/gitlab/:id`.
|
|
10
|
+
*/
|
|
11
|
+
export type GitlabIntegration = {
|
|
12
|
+
id: string;
|
|
13
|
+
organizationId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
/** `https://gitlab.exemple.com`, sans `/` final. */
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
/** Le « Secret token » du webhook, chiffré en base. */
|
|
18
|
+
webhookSecret: string;
|
|
19
|
+
/** Niveau minimal de l'auteur d'une mention sur le projet pour réveiller un agent. */
|
|
20
|
+
minAccessLevel: GitlabAccessLevel;
|
|
21
|
+
status: GitlabIntegrationStatus;
|
|
22
|
+
lastEventAt: string | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
};
|
|
26
|
+
/** `token_invalid` : GitLab a refusé le token (401/403), le compte ne répond plus. */
|
|
27
|
+
export type GitlabBotAccountStatus = 'active' | 'token_invalid' | 'disabled';
|
|
28
|
+
/**
|
|
29
|
+
* Un compte GitLab que l'on mentionne pour réveiller un agent. `@bot Agent …` réveille l'agent
|
|
30
|
+
* nommé s'il est appelable, sinon tout le texte part à l'agent par défaut.
|
|
31
|
+
*/
|
|
32
|
+
export type GitlabBotAccount = {
|
|
33
|
+
id: string;
|
|
34
|
+
integrationId: string;
|
|
35
|
+
organizationId: string;
|
|
36
|
+
gitlabUserId: number | null;
|
|
37
|
+
/** Sans `@`. */
|
|
38
|
+
username: string;
|
|
39
|
+
/** Token d'accès personnel du compte, chiffré en base. */
|
|
40
|
+
token: string;
|
|
41
|
+
tokenExpiresAt: string | null;
|
|
42
|
+
defaultAgentId: string | null;
|
|
43
|
+
/** `null` : tous les agents de l'organisation sont appelables par leur nom. */
|
|
44
|
+
callableAgentIds: string[] | null;
|
|
45
|
+
/**
|
|
46
|
+
* Le membre de l'organisation au nom duquel tournent les conversations : outils MCP de portée
|
|
47
|
+
* utilisateur, quotas, et qui retrouve la conversation dans son historique.
|
|
48
|
+
*/
|
|
49
|
+
runAsUserId: string;
|
|
50
|
+
status: GitlabBotAccountStatus;
|
|
51
|
+
lastError: string | null;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
};
|
|
55
|
+
/** Le type d'objet GitLab sur lequel porte une mention. */
|
|
56
|
+
export type ExternalEventTargetType = 'merge_request' | 'issue' | 'work_item' | 'commit';
|
|
57
|
+
/** Le `object_kind` du webhook GitLab. */
|
|
58
|
+
export type ExternalEventKind = 'note' | 'issue' | 'merge_request' | 'work_item';
|
|
59
|
+
/** Ce qu'on garde d'un webhook GitLab : jamais le JSON complet. */
|
|
60
|
+
export type ExternalEventPayload = {
|
|
61
|
+
instanceUrl: string;
|
|
62
|
+
projectId: number;
|
|
63
|
+
/** `groupe/projet`. */
|
|
64
|
+
projectPath: string;
|
|
65
|
+
targetType: ExternalEventTargetType;
|
|
66
|
+
/** `!142`, `#88` : l'iid ; absent pour un commit. */
|
|
67
|
+
targetIid: number | null;
|
|
68
|
+
/** Identifiant global de l'objet (work item : sert à l'API GraphQL). */
|
|
69
|
+
targetId: number | null;
|
|
70
|
+
targetTitle: string | null;
|
|
71
|
+
targetUrl: string | null;
|
|
72
|
+
commitSha: string | null;
|
|
73
|
+
/** Absent quand la mention vient de la description d'une MR ou d'une issue. */
|
|
74
|
+
noteId: number | null;
|
|
75
|
+
discussionId: string | null;
|
|
76
|
+
noteUrl: string | null;
|
|
77
|
+
authorId: number;
|
|
78
|
+
authorUsername: string;
|
|
79
|
+
authorName: string | null;
|
|
80
|
+
/** Le texte, tronqué à 20 ko. */
|
|
81
|
+
body: string;
|
|
82
|
+
bodyTruncated: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* `received` → (routage) → `ignored` | `no_automation` | `queued` → `running` → `replying` →
|
|
86
|
+
* `done`. Un échec transitoire repasse `queued` (plus tard) ; au-delà des essais, `dead`.
|
|
87
|
+
* `expired` : resté trop longtemps en file. `dropped_overload` : écarté par le garde-fou de débit.
|
|
88
|
+
*/
|
|
89
|
+
export type ExternalEventStatus = 'received' | 'queued' | 'running' | 'replying' | 'done' | 'ignored' | 'no_automation' | 'expired' | 'dead' | 'dropped_overload';
|
|
90
|
+
/** `named` : premier mot = agent appelable ; `default` : tout le texte à l'agent par défaut. */
|
|
91
|
+
export type ExternalEventRouting = {
|
|
92
|
+
mode: 'named' | 'default' | 'help';
|
|
93
|
+
/** Le nom tel qu'écrit dans la mention, quand il a désigné l'agent. */
|
|
94
|
+
agentName: string | null;
|
|
95
|
+
instruction: string;
|
|
96
|
+
};
|
|
97
|
+
/** Un événement reçu d'une source externe, et son passage dans la file. */
|
|
98
|
+
export type ExternalEvent = {
|
|
99
|
+
id: string;
|
|
100
|
+
integrationId: string;
|
|
101
|
+
organizationId: string;
|
|
102
|
+
/** `X-Gitlab-Event-UUID` : unique avec l'intégration, un renvoi n'est pas rejoué. */
|
|
103
|
+
eventUuid: string;
|
|
104
|
+
source: 'gitlab';
|
|
105
|
+
kind: ExternalEventKind;
|
|
106
|
+
payload: ExternalEventPayload;
|
|
107
|
+
/** Instance + projet + objet + discussion : deux mentions d'un même fil s'y retrouvent. */
|
|
108
|
+
threadKey: string;
|
|
109
|
+
botAccountId: string | null;
|
|
110
|
+
agentId: string | null;
|
|
111
|
+
taskId: string | null;
|
|
112
|
+
runId: string | null;
|
|
113
|
+
conversationId: string | null;
|
|
114
|
+
routing: ExternalEventRouting | null;
|
|
115
|
+
status: ExternalEventStatus;
|
|
116
|
+
availableAt: string;
|
|
117
|
+
attempts: number;
|
|
118
|
+
claimedBy: string | null;
|
|
119
|
+
leaseUntil: string | null;
|
|
120
|
+
lastError: string | null;
|
|
121
|
+
/** La note de réponse, dès qu'elle existe : un nouvel essai ne la reposte pas. */
|
|
122
|
+
replyNoteId: string | null;
|
|
123
|
+
replyUrl: string | null;
|
|
124
|
+
receivedAt: string;
|
|
125
|
+
finishedAt: string | null;
|
|
126
|
+
updatedAt: string;
|
|
127
|
+
};
|
|
128
|
+
/** La conversation d'un agent dans un fil GitLab : les mentions suivantes la reprennent. */
|
|
129
|
+
export type ExternalThread = {
|
|
130
|
+
threadKey: string;
|
|
131
|
+
agentId: string;
|
|
132
|
+
organizationId: string;
|
|
133
|
+
conversationId: string;
|
|
134
|
+
createdAt: string;
|
|
135
|
+
lastRunAt: string | null;
|
|
136
|
+
};
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./engine"), exports);
|
|
|
24
24
|
__exportStar(require("./file"), exports);
|
|
25
25
|
__exportStar(require("./flow"), exports);
|
|
26
26
|
__exportStar(require("./flow-editor"), exports);
|
|
27
|
+
__exportStar(require("./gitlab-integration"), exports);
|
|
27
28
|
__exportStar(require("./inbox"), exports);
|
|
28
29
|
__exportStar(require("./knowledge"), exports);
|
|
29
30
|
__exportStar(require("./ocr"), exports);
|
|
@@ -8,6 +8,12 @@ export type RunStep = {
|
|
|
8
8
|
tokens?: number;
|
|
9
9
|
error?: string;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Qui exécute le run : `external`, l'exécuteur des tâches programmées (via la file) ;
|
|
13
|
+
* `internal`, brain-api lui-même (runs déclenchés par un événement). L'exécuteur externe et la
|
|
14
|
+
* reprise des runs bloqués ignorent les runs `internal`.
|
|
15
|
+
*/
|
|
16
|
+
export type RunExecutor = 'internal' | 'external';
|
|
11
17
|
export type ScheduledTaskRun = {
|
|
12
18
|
id: string;
|
|
13
19
|
taskId: string;
|
|
@@ -20,5 +26,9 @@ export type ScheduledTaskRun = {
|
|
|
20
26
|
claimedAt?: Date;
|
|
21
27
|
retryCount: number;
|
|
22
28
|
steps: RunStep[];
|
|
29
|
+
/** L'événement externe à l'origine du run (mention GitLab). */
|
|
30
|
+
triggerEventId?: string;
|
|
31
|
+
/** Absent : `external`. */
|
|
32
|
+
executor?: RunExecutor;
|
|
23
33
|
createdAt: Date;
|
|
24
34
|
};
|
|
@@ -28,6 +28,27 @@ export type TaskSchedule = {
|
|
|
28
28
|
start?: string;
|
|
29
29
|
end?: TaskEnd;
|
|
30
30
|
};
|
|
31
|
+
export type TaskTriggerSchedule = {
|
|
32
|
+
type: 'schedule';
|
|
33
|
+
};
|
|
34
|
+
/** Les objets GitLab dans lesquels une mention déclenche l'automatisation. */
|
|
35
|
+
export type TaskEventKind = 'merge_request' | 'issue' | 'work_item' | 'commit';
|
|
36
|
+
/**
|
|
37
|
+
* Déclenchée par une mention d'un compte bot GitLab, au lieu d'un horaire. `projects` vide : tous
|
|
38
|
+
* les projets ; sinon `groupe/projet` ou `groupe/*`.
|
|
39
|
+
*/
|
|
40
|
+
export type TaskTriggerEvent = {
|
|
41
|
+
type: 'event';
|
|
42
|
+
source: 'gitlab_mention';
|
|
43
|
+
botAccountIds: string[];
|
|
44
|
+
kinds: TaskEventKind[];
|
|
45
|
+
projects: string[];
|
|
46
|
+
reply: {
|
|
47
|
+
thread: boolean;
|
|
48
|
+
ack: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export type TaskTrigger = TaskTriggerSchedule | TaskTriggerEvent;
|
|
31
52
|
export type ScheduledTask = {
|
|
32
53
|
id: string;
|
|
33
54
|
agentId: string;
|
|
@@ -36,7 +57,10 @@ export type ScheduledTask = {
|
|
|
36
57
|
message: string;
|
|
37
58
|
mode: TaskMode;
|
|
38
59
|
status: TaskStatus;
|
|
39
|
-
|
|
60
|
+
/** `null` pour une automatisation déclenchée par un événement. */
|
|
61
|
+
schedule: TaskSchedule | null;
|
|
62
|
+
/** Absent : `{ type: 'schedule' }`. */
|
|
63
|
+
trigger?: TaskTrigger;
|
|
40
64
|
cronExpression: string;
|
|
41
65
|
timezone: string;
|
|
42
66
|
lang: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Les niveaux d'accès d'un membre de projet GitLab : Guest (10), Reporter (20), Developer (30),
|
|
3
|
+
* Maintainer (40), Owner (50).
|
|
4
|
+
*/
|
|
5
|
+
export type GitlabAccessLevel = 10 | 20 | 30 | 40 | 50;
|
|
6
|
+
|
|
7
|
+
export type GitlabIntegrationStatus = 'active' | 'disabled';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Une instance GitLab reliée à une organisation : elle reçoit les webhooks des projets qui la
|
|
11
|
+
* déclarent, à l'adresse `/webhooks/gitlab/:id`.
|
|
12
|
+
*/
|
|
13
|
+
export type GitlabIntegration = {
|
|
14
|
+
id: string;
|
|
15
|
+
organizationId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
/** `https://gitlab.exemple.com`, sans `/` final. */
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
/** Le « Secret token » du webhook, chiffré en base. */
|
|
20
|
+
webhookSecret: string;
|
|
21
|
+
/** Niveau minimal de l'auteur d'une mention sur le projet pour réveiller un agent. */
|
|
22
|
+
minAccessLevel: GitlabAccessLevel;
|
|
23
|
+
status: GitlabIntegrationStatus;
|
|
24
|
+
lastEventAt: string | null;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** `token_invalid` : GitLab a refusé le token (401/403), le compte ne répond plus. */
|
|
30
|
+
export type GitlabBotAccountStatus = 'active' | 'token_invalid' | 'disabled';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Un compte GitLab que l'on mentionne pour réveiller un agent. `@bot Agent …` réveille l'agent
|
|
34
|
+
* nommé s'il est appelable, sinon tout le texte part à l'agent par défaut.
|
|
35
|
+
*/
|
|
36
|
+
export type GitlabBotAccount = {
|
|
37
|
+
id: string;
|
|
38
|
+
integrationId: string;
|
|
39
|
+
organizationId: string;
|
|
40
|
+
gitlabUserId: number | null;
|
|
41
|
+
/** Sans `@`. */
|
|
42
|
+
username: string;
|
|
43
|
+
/** Token d'accès personnel du compte, chiffré en base. */
|
|
44
|
+
token: string;
|
|
45
|
+
tokenExpiresAt: string | null;
|
|
46
|
+
defaultAgentId: string | null;
|
|
47
|
+
/** `null` : tous les agents de l'organisation sont appelables par leur nom. */
|
|
48
|
+
callableAgentIds: string[] | null;
|
|
49
|
+
/**
|
|
50
|
+
* Le membre de l'organisation au nom duquel tournent les conversations : outils MCP de portée
|
|
51
|
+
* utilisateur, quotas, et qui retrouve la conversation dans son historique.
|
|
52
|
+
*/
|
|
53
|
+
runAsUserId: string;
|
|
54
|
+
status: GitlabBotAccountStatus;
|
|
55
|
+
lastError: string | null;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
updatedAt: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** Le type d'objet GitLab sur lequel porte une mention. */
|
|
61
|
+
export type ExternalEventTargetType = 'merge_request' | 'issue' | 'work_item' | 'commit';
|
|
62
|
+
|
|
63
|
+
/** Le `object_kind` du webhook GitLab. */
|
|
64
|
+
export type ExternalEventKind = 'note' | 'issue' | 'merge_request' | 'work_item';
|
|
65
|
+
|
|
66
|
+
/** Ce qu'on garde d'un webhook GitLab : jamais le JSON complet. */
|
|
67
|
+
export type ExternalEventPayload = {
|
|
68
|
+
instanceUrl: string;
|
|
69
|
+
projectId: number;
|
|
70
|
+
/** `groupe/projet`. */
|
|
71
|
+
projectPath: string;
|
|
72
|
+
targetType: ExternalEventTargetType;
|
|
73
|
+
/** `!142`, `#88` : l'iid ; absent pour un commit. */
|
|
74
|
+
targetIid: number | null;
|
|
75
|
+
/** Identifiant global de l'objet (work item : sert à l'API GraphQL). */
|
|
76
|
+
targetId: number | null;
|
|
77
|
+
targetTitle: string | null;
|
|
78
|
+
targetUrl: string | null;
|
|
79
|
+
commitSha: string | null;
|
|
80
|
+
/** Absent quand la mention vient de la description d'une MR ou d'une issue. */
|
|
81
|
+
noteId: number | null;
|
|
82
|
+
discussionId: string | null;
|
|
83
|
+
noteUrl: string | null;
|
|
84
|
+
authorId: number;
|
|
85
|
+
authorUsername: string;
|
|
86
|
+
authorName: string | null;
|
|
87
|
+
/** Le texte, tronqué à 20 ko. */
|
|
88
|
+
body: string;
|
|
89
|
+
bodyTruncated: boolean;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* `received` → (routage) → `ignored` | `no_automation` | `queued` → `running` → `replying` →
|
|
94
|
+
* `done`. Un échec transitoire repasse `queued` (plus tard) ; au-delà des essais, `dead`.
|
|
95
|
+
* `expired` : resté trop longtemps en file. `dropped_overload` : écarté par le garde-fou de débit.
|
|
96
|
+
*/
|
|
97
|
+
export type ExternalEventStatus =
|
|
98
|
+
| 'received'
|
|
99
|
+
| 'queued'
|
|
100
|
+
| 'running'
|
|
101
|
+
| 'replying'
|
|
102
|
+
| 'done'
|
|
103
|
+
| 'ignored'
|
|
104
|
+
| 'no_automation'
|
|
105
|
+
| 'expired'
|
|
106
|
+
| 'dead'
|
|
107
|
+
| 'dropped_overload';
|
|
108
|
+
|
|
109
|
+
/** `named` : premier mot = agent appelable ; `default` : tout le texte à l'agent par défaut. */
|
|
110
|
+
export type ExternalEventRouting = {
|
|
111
|
+
mode: 'named' | 'default' | 'help';
|
|
112
|
+
/** Le nom tel qu'écrit dans la mention, quand il a désigné l'agent. */
|
|
113
|
+
agentName: string | null;
|
|
114
|
+
instruction: string;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/** Un événement reçu d'une source externe, et son passage dans la file. */
|
|
118
|
+
export type ExternalEvent = {
|
|
119
|
+
id: string;
|
|
120
|
+
integrationId: string;
|
|
121
|
+
organizationId: string;
|
|
122
|
+
/** `X-Gitlab-Event-UUID` : unique avec l'intégration, un renvoi n'est pas rejoué. */
|
|
123
|
+
eventUuid: string;
|
|
124
|
+
source: 'gitlab';
|
|
125
|
+
kind: ExternalEventKind;
|
|
126
|
+
payload: ExternalEventPayload;
|
|
127
|
+
/** Instance + projet + objet + discussion : deux mentions d'un même fil s'y retrouvent. */
|
|
128
|
+
threadKey: string;
|
|
129
|
+
botAccountId: string | null;
|
|
130
|
+
agentId: string | null;
|
|
131
|
+
taskId: string | null;
|
|
132
|
+
runId: string | null;
|
|
133
|
+
conversationId: string | null;
|
|
134
|
+
routing: ExternalEventRouting | null;
|
|
135
|
+
status: ExternalEventStatus;
|
|
136
|
+
availableAt: string;
|
|
137
|
+
attempts: number;
|
|
138
|
+
claimedBy: string | null;
|
|
139
|
+
leaseUntil: string | null;
|
|
140
|
+
lastError: string | null;
|
|
141
|
+
/** La note de réponse, dès qu'elle existe : un nouvel essai ne la reposte pas. */
|
|
142
|
+
replyNoteId: string | null;
|
|
143
|
+
replyUrl: string | null;
|
|
144
|
+
receivedAt: string;
|
|
145
|
+
finishedAt: string | null;
|
|
146
|
+
updatedAt: string;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/** La conversation d'un agent dans un fil GitLab : les mentions suivantes la reprennent. */
|
|
150
|
+
export type ExternalThread = {
|
|
151
|
+
threadKey: string;
|
|
152
|
+
agentId: string;
|
|
153
|
+
organizationId: string;
|
|
154
|
+
conversationId: string;
|
|
155
|
+
createdAt: string;
|
|
156
|
+
lastRunAt: string | null;
|
|
157
|
+
};
|
package/src/types/index.ts
CHANGED
|
@@ -15,6 +15,13 @@ export type RunStep = {
|
|
|
15
15
|
error?: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Qui exécute le run : `external`, l'exécuteur des tâches programmées (via la file) ;
|
|
20
|
+
* `internal`, brain-api lui-même (runs déclenchés par un événement). L'exécuteur externe et la
|
|
21
|
+
* reprise des runs bloqués ignorent les runs `internal`.
|
|
22
|
+
*/
|
|
23
|
+
export type RunExecutor = 'internal' | 'external';
|
|
24
|
+
|
|
18
25
|
export type ScheduledTaskRun = {
|
|
19
26
|
id: string;
|
|
20
27
|
taskId: string;
|
|
@@ -27,5 +34,9 @@ export type ScheduledTaskRun = {
|
|
|
27
34
|
claimedAt?: Date;
|
|
28
35
|
retryCount: number;
|
|
29
36
|
steps: RunStep[];
|
|
37
|
+
/** L'événement externe à l'origine du run (mention GitLab). */
|
|
38
|
+
triggerEventId?: string;
|
|
39
|
+
/** Absent : `external`. */
|
|
40
|
+
executor?: RunExecutor;
|
|
30
41
|
createdAt: Date;
|
|
31
42
|
};
|
|
@@ -20,6 +20,26 @@ export type TaskSchedule = {
|
|
|
20
20
|
end?: TaskEnd;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
export type TaskTriggerSchedule = { type: 'schedule' };
|
|
24
|
+
|
|
25
|
+
/** Les objets GitLab dans lesquels une mention déclenche l'automatisation. */
|
|
26
|
+
export type TaskEventKind = 'merge_request' | 'issue' | 'work_item' | 'commit';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Déclenchée par une mention d'un compte bot GitLab, au lieu d'un horaire. `projects` vide : tous
|
|
30
|
+
* les projets ; sinon `groupe/projet` ou `groupe/*`.
|
|
31
|
+
*/
|
|
32
|
+
export type TaskTriggerEvent = {
|
|
33
|
+
type: 'event';
|
|
34
|
+
source: 'gitlab_mention';
|
|
35
|
+
botAccountIds: string[];
|
|
36
|
+
kinds: TaskEventKind[];
|
|
37
|
+
projects: string[];
|
|
38
|
+
reply: { thread: boolean; ack: boolean };
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type TaskTrigger = TaskTriggerSchedule | TaskTriggerEvent;
|
|
42
|
+
|
|
23
43
|
export type ScheduledTask = {
|
|
24
44
|
id: string;
|
|
25
45
|
agentId: string;
|
|
@@ -28,7 +48,10 @@ export type ScheduledTask = {
|
|
|
28
48
|
message: string;
|
|
29
49
|
mode: TaskMode;
|
|
30
50
|
status: TaskStatus;
|
|
31
|
-
|
|
51
|
+
/** `null` pour une automatisation déclenchée par un événement. */
|
|
52
|
+
schedule: TaskSchedule | null;
|
|
53
|
+
/** Absent : `{ type: 'schedule' }`. */
|
|
54
|
+
trigger?: TaskTrigger;
|
|
32
55
|
cronExpression: string;
|
|
33
56
|
timezone: string;
|
|
34
57
|
lang: string;
|