@abyss-project/console 1.0.77 → 1.0.79
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/.eslintrc.js +33 -33
- package/README.md +2 -2
- package/dist/api/internal-ticket.api.d.ts +3 -1
- package/dist/api/internal-ticket.api.js +11 -1
- package/dist/api/workflow.api.d.ts +2 -1
- package/dist/api/workflow.api.js +6 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/types/dto/index.d.ts +1 -0
- package/dist/types/dto/index.js +1 -0
- package/dist/types/dto/internal-ticket-activity.dto.d.ts +99 -0
- package/dist/types/dto/internal-ticket-activity.dto.js +3 -0
- package/dist/types/dto/workflow.dto.d.ts +174 -6
- package/dist/types/dto/workflow.dto.js +1 -0
- package/dist/types/enum/workflow.enum.d.ts +7 -2
- package/dist/types/enum/workflow.enum.js +5 -0
- package/dist/types/interface/api/requests/internal-ticket.request.d.ts +19 -0
- package/dist/types/interface/api/requests/workflow.request.d.ts +8 -1
- package/dist/types/interface/api/responses/internal-ticket.response.d.ts +12 -0
- package/dist/types/interface/api/responses/workflow.response.d.ts +18 -0
- package/dist/types/interface/models/internal-ticket-activity.model.d.ts +4 -3
- package/dist/types/interface/models/internal-ticket-artifact-rule.model.d.ts +2 -0
- package/dist/types/interface/models/internal-ticket-attachment.model.d.ts +3 -2
- package/dist/utils/internal-ticket-status.utils.js +24 -6
- package/dist/workflow-expressions/functions.d.ts +78 -0
- package/dist/workflow-expressions/functions.js +70 -0
- package/dist/workflow-expressions/index.d.ts +1 -0
- package/dist/workflow-expressions/index.js +1 -0
- package/dist/workflow-expressions/types.d.ts +42 -3
- package/dist/workflow-expressions/types.js +2 -0
- package/package.json +1 -1
- package/tsconfig.json +105 -105
|
@@ -33,6 +33,7 @@ var WorkflowTriggerType;
|
|
|
33
33
|
WorkflowTriggerType["INTERNAL_TICKET_ASSIGN"] = "INTERNAL_TICKET_ASSIGN";
|
|
34
34
|
WorkflowTriggerType["INTERNAL_TICKET_UNASSIGN"] = "INTERNAL_TICKET_UNASSIGN";
|
|
35
35
|
WorkflowTriggerType["INTERNAL_TICKET_ACTIVITY"] = "INTERNAL_TICKET_ACTIVITY";
|
|
36
|
+
WorkflowTriggerType["INTERNAL_TICKET_MESSAGE_REPLY"] = "INTERNAL_TICKET_MESSAGE_REPLY";
|
|
36
37
|
})(WorkflowTriggerType || (exports.WorkflowTriggerType = WorkflowTriggerType = {}));
|
|
37
38
|
var WorkflowTemplate;
|
|
38
39
|
(function (WorkflowTemplate) {
|
|
@@ -51,6 +52,10 @@ var WorkflowActionType;
|
|
|
51
52
|
WorkflowActionType["CALL_WEBHOOK"] = "CALL_WEBHOOK";
|
|
52
53
|
WorkflowActionType["INVITE_TO_PROJECT"] = "INVITE_TO_PROJECT";
|
|
53
54
|
WorkflowActionType["TRIGGER_WORKFLOW"] = "TRIGGER_WORKFLOW";
|
|
55
|
+
WorkflowActionType["SEND_SLACK_MESSAGE"] = "SEND_SLACK_MESSAGE";
|
|
56
|
+
WorkflowActionType["SEND_DISCORD_MESSAGE"] = "SEND_DISCORD_MESSAGE";
|
|
57
|
+
WorkflowActionType["SEND_SLACK_WEBHOOK"] = "SEND_SLACK_WEBHOOK";
|
|
58
|
+
WorkflowActionType["SEND_DISCORD_WEBHOOK"] = "SEND_DISCORD_WEBHOOK";
|
|
54
59
|
})(WorkflowActionType || (exports.WorkflowActionType = WorkflowActionType = {}));
|
|
55
60
|
var WorkflowStepStatus;
|
|
56
61
|
(function (WorkflowStepStatus) {
|
|
@@ -10,6 +10,11 @@ export interface ICreateInternalTicketBody {
|
|
|
10
10
|
internalTicketPriorityId: string;
|
|
11
11
|
internalTicketCategoryId?: string;
|
|
12
12
|
priorityReason?: string;
|
|
13
|
+
tagIds?: string[];
|
|
14
|
+
artifacts?: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
13
18
|
}
|
|
14
19
|
export interface IPaginateInternalTicketParams {
|
|
15
20
|
projectId: string;
|
|
@@ -131,6 +136,11 @@ export interface IDeleteInternalTicketAttachmentParams {
|
|
|
131
136
|
internalTicketId: string;
|
|
132
137
|
internalTicketAttachmentId: string;
|
|
133
138
|
}
|
|
139
|
+
export interface IGetInternalTicketAttachmentDownloadUrlParams {
|
|
140
|
+
projectId: string;
|
|
141
|
+
internalTicketId: string;
|
|
142
|
+
internalTicketAttachmentId: string;
|
|
143
|
+
}
|
|
134
144
|
export interface IPaginateInternalTicketActivityParams {
|
|
135
145
|
projectId: string;
|
|
136
146
|
internalTicketId: string;
|
|
@@ -208,6 +218,15 @@ export interface IRemoveInternalTicketArtifactParams {
|
|
|
208
218
|
internalTicketId: string;
|
|
209
219
|
internalTicketArtifactId: string;
|
|
210
220
|
}
|
|
221
|
+
export interface IUpdateInternalTicketArtifactParams {
|
|
222
|
+
projectId: string;
|
|
223
|
+
internalTicketId: string;
|
|
224
|
+
internalTicketArtifactId: string;
|
|
225
|
+
}
|
|
226
|
+
export interface IUpdateInternalTicketArtifactBody {
|
|
227
|
+
label?: string;
|
|
228
|
+
value?: string;
|
|
229
|
+
}
|
|
211
230
|
export interface IListInternalTicketArtifactParams {
|
|
212
231
|
projectId: string;
|
|
213
232
|
internalTicketId: string;
|
|
@@ -15,7 +15,7 @@ export interface IPaginateWorkflowParams {
|
|
|
15
15
|
projectId: string;
|
|
16
16
|
}
|
|
17
17
|
export interface IPaginateWorkflowQuery extends QueryPaginate {
|
|
18
|
-
status?: WorkflowStatus;
|
|
18
|
+
status?: WorkflowStatus | WorkflowStatus[];
|
|
19
19
|
search?: string;
|
|
20
20
|
orderBy?: 'name' | 'createdAt' | 'updatedAt' | 'status';
|
|
21
21
|
orderDirection?: 'ASC' | 'DESC';
|
|
@@ -156,6 +156,13 @@ export interface IGetTimeSeriesWorkflowExecutionQuery {
|
|
|
156
156
|
period: 'minute' | 'hour' | 'day' | 'week' | 'month';
|
|
157
157
|
days: number;
|
|
158
158
|
}
|
|
159
|
+
export interface IGetProjectWorkflowAnalyticsParams {
|
|
160
|
+
projectId: string;
|
|
161
|
+
}
|
|
162
|
+
export interface IGetProjectWorkflowAnalyticsQuery {
|
|
163
|
+
period: 'minute' | 'hour' | 'day' | 'week' | 'month';
|
|
164
|
+
days: number;
|
|
165
|
+
}
|
|
159
166
|
export interface ICreateWorkflowTriggerParams {
|
|
160
167
|
projectId: string;
|
|
161
168
|
workflowId: string;
|
|
@@ -5,6 +5,7 @@ import { IInternalTicketMessageReaction } from '../../models/internal-ticket-mes
|
|
|
5
5
|
import { IInternalTicketActivity } from '../../models/internal-ticket-activity.model';
|
|
6
6
|
import { IInternalTicketFollower } from '../../models/internal-ticket-follower.model';
|
|
7
7
|
import { IInternalTicketTicketTag } from '../../models/internal-ticket-ticket-tag.model';
|
|
8
|
+
import { IInternalTicketAttachment } from '../../models/internal-ticket-attachment.model';
|
|
8
9
|
import { IInternalTicketArtifact } from '../../models/internal-ticket-artifact.model';
|
|
9
10
|
import { IResponse } from '../type-message/response';
|
|
10
11
|
import { BasePaginate } from '../type-message/base-paginate';
|
|
@@ -60,6 +61,11 @@ export type ICreateInternalTicketAttachmentResponse = IResponse<ICreateInternalT
|
|
|
60
61
|
export interface IDeleteInternalTicketAttachmentData {
|
|
61
62
|
}
|
|
62
63
|
export type IDeleteInternalTicketAttachmentResponse = IResponse<IDeleteInternalTicketAttachmentData>;
|
|
64
|
+
export interface IGetInternalTicketAttachmentDownloadUrlData {
|
|
65
|
+
downloadUrl: string;
|
|
66
|
+
expireAt: number;
|
|
67
|
+
}
|
|
68
|
+
export type IGetInternalTicketAttachmentDownloadUrlResponse = IResponse<IGetInternalTicketAttachmentDownloadUrlData>;
|
|
63
69
|
export type IPaginateInternalTicketActivityResponse = IResponse<BasePaginate<IInternalTicketActivity>>;
|
|
64
70
|
export interface IFollowInternalTicketData {
|
|
65
71
|
internalTicketFollower: IInternalTicketFollower;
|
|
@@ -99,8 +105,10 @@ export interface IInternalTicketSSEPayloadInput {
|
|
|
99
105
|
internalTicketFollower?: IInternalTicketFollower;
|
|
100
106
|
internalTicketActivity?: IInternalTicketActivity;
|
|
101
107
|
internalTicketTicketTag?: IInternalTicketTicketTag;
|
|
108
|
+
internalTicketAttachment?: IInternalTicketAttachment;
|
|
102
109
|
internalTicketArtifact?: IInternalTicketArtifact;
|
|
103
110
|
assigneeUserId?: string;
|
|
111
|
+
internalTicketMessageId?: string | null;
|
|
104
112
|
}
|
|
105
113
|
export interface IInternalTicketSSEPayload extends IInternalTicketSSEPayloadInput {
|
|
106
114
|
timestamp: string;
|
|
@@ -138,6 +146,10 @@ export type IAddInternalTicketArtifactResponse = IResponse<IAddInternalTicketArt
|
|
|
138
146
|
export interface IRemoveInternalTicketArtifactData {
|
|
139
147
|
}
|
|
140
148
|
export type IRemoveInternalTicketArtifactResponse = IResponse<IRemoveInternalTicketArtifactData>;
|
|
149
|
+
export interface IUpdateInternalTicketArtifactData {
|
|
150
|
+
internalTicketArtifact: IInternalTicketArtifact;
|
|
151
|
+
}
|
|
152
|
+
export type IUpdateInternalTicketArtifactResponse = IResponse<IUpdateInternalTicketArtifactData>;
|
|
141
153
|
export interface IListInternalTicketArtifactData {
|
|
142
154
|
internalTicketArtifacts: IInternalTicketArtifact[];
|
|
143
155
|
}
|
|
@@ -90,6 +90,24 @@ export interface IGetTimeSeriesWorkflowExecutionData {
|
|
|
90
90
|
timeSeries: IWorkflowExecutionTimeSeriesBucket[];
|
|
91
91
|
}
|
|
92
92
|
export type IGetTimeSeriesWorkflowExecutionResponse = IResponse<IGetTimeSeriesWorkflowExecutionData>;
|
|
93
|
+
export interface IProjectWorkflowAnalyticsPerWorkflow {
|
|
94
|
+
workflowId: string;
|
|
95
|
+
workflowName: string;
|
|
96
|
+
total: number;
|
|
97
|
+
completed: number;
|
|
98
|
+
failed: number;
|
|
99
|
+
cancelled: number;
|
|
100
|
+
avgDurationMs: number | null;
|
|
101
|
+
successRate: number | null;
|
|
102
|
+
}
|
|
103
|
+
export interface IGetProjectWorkflowAnalyticsData {
|
|
104
|
+
stats: IWorkflowExecutionStats;
|
|
105
|
+
timeSeries: IWorkflowExecutionTimeSeriesBucket[];
|
|
106
|
+
perWorkflow: IProjectWorkflowAnalyticsPerWorkflow[];
|
|
107
|
+
totalWorkflows: number;
|
|
108
|
+
activeWorkflows: number;
|
|
109
|
+
}
|
|
110
|
+
export type IGetProjectWorkflowAnalyticsResponse = IResponse<IGetProjectWorkflowAnalyticsData>;
|
|
93
111
|
export interface ICreateWorkflowTriggerData {
|
|
94
112
|
workflowTrigger: IWorkflowTrigger;
|
|
95
113
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { InternalTicketActivityType } from '../../enum';
|
|
2
|
+
import { InternalTicketActivityDataMap } from '../../dto';
|
|
2
3
|
import { IInternalTicket } from './internal-ticket.model';
|
|
3
|
-
export interface IInternalTicketActivity {
|
|
4
|
+
export interface IInternalTicketActivity<T extends InternalTicketActivityType = InternalTicketActivityType> {
|
|
4
5
|
id: string;
|
|
5
6
|
internalTicketId: string;
|
|
6
7
|
userId: string;
|
|
7
|
-
type:
|
|
8
|
-
data: Record<string, any>;
|
|
8
|
+
type: T;
|
|
9
|
+
data: T extends keyof InternalTicketActivityDataMap ? InternalTicketActivityDataMap[T] : Record<string, any>;
|
|
9
10
|
createdAt?: Date;
|
|
10
11
|
updatedAt?: Date;
|
|
11
12
|
internalTicket?: IInternalTicket;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export type ArtifactRuleConditionType = 'ALWAYS' | 'TAG' | 'CATEGORY' | 'PRIORITY';
|
|
2
|
+
export type ArtifactRuleBehaviorType = 'REQUIRED' | 'SUGGESTED';
|
|
2
3
|
export interface IInternalTicketArtifactRule {
|
|
3
4
|
id: string;
|
|
4
5
|
internalTicketArtifactTypeId: string;
|
|
5
6
|
conditionType: ArtifactRuleConditionType;
|
|
6
7
|
conditionId: string | null;
|
|
8
|
+
behaviorType: ArtifactRuleBehaviorType;
|
|
7
9
|
createdAt?: Date;
|
|
8
10
|
updatedAt?: Date;
|
|
9
11
|
}
|
|
@@ -8,8 +8,9 @@ export interface IInternalTicketAttachment {
|
|
|
8
8
|
mimeType: string | null;
|
|
9
9
|
sizeOctet: number;
|
|
10
10
|
storageId: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
thumbnailId: string | null;
|
|
12
|
+
thumbnailPublicAccessId: string | null;
|
|
13
|
+
thumbnailPublicAccessPassword: string | null;
|
|
13
14
|
userId: string;
|
|
14
15
|
createdAt?: Date;
|
|
15
16
|
updatedAt?: Date;
|
|
@@ -5,21 +5,39 @@ const internal_ticket_enum_1 = require("../types/enum/internal-ticket.enum");
|
|
|
5
5
|
function computeInternalTicketStatus(ticket) {
|
|
6
6
|
var _a;
|
|
7
7
|
if (ticket.archivedAt) {
|
|
8
|
-
return {
|
|
8
|
+
return {
|
|
9
|
+
status: internal_ticket_enum_1.InternalTicketStatus.ARCHIVED,
|
|
10
|
+
reason: internal_ticket_enum_1.InternalTicketStatusReason.TICKET_ARCHIVED,
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
13
|
if (ticket.closedAt) {
|
|
11
|
-
return {
|
|
14
|
+
return {
|
|
15
|
+
status: internal_ticket_enum_1.InternalTicketStatus.CLOSED,
|
|
16
|
+
reason: internal_ticket_enum_1.InternalTicketStatusReason.TICKET_CLOSED,
|
|
17
|
+
};
|
|
12
18
|
}
|
|
13
19
|
if (ticket.resolvedAt) {
|
|
14
|
-
return {
|
|
20
|
+
return {
|
|
21
|
+
status: internal_ticket_enum_1.InternalTicketStatus.RESOLVED,
|
|
22
|
+
reason: internal_ticket_enum_1.InternalTicketStatusReason.TICKET_RESOLVED,
|
|
23
|
+
};
|
|
15
24
|
}
|
|
16
25
|
if (!ticket.reviewedAt) {
|
|
17
|
-
return {
|
|
26
|
+
return {
|
|
27
|
+
status: internal_ticket_enum_1.InternalTicketStatus.WAITING_REVIEW,
|
|
28
|
+
reason: internal_ticket_enum_1.InternalTicketStatusReason.NOT_REVIEWED,
|
|
29
|
+
};
|
|
18
30
|
}
|
|
19
31
|
const hasAssignees = !!ticket.assignedToUserId || ((_a = ticket.internalTicketAssignee) !== null && _a !== void 0 ? _a : []).length > 0;
|
|
20
32
|
if (!hasAssignees) {
|
|
21
|
-
return {
|
|
33
|
+
return {
|
|
34
|
+
status: internal_ticket_enum_1.InternalTicketStatus.WAITING_ASSIGNEE,
|
|
35
|
+
reason: internal_ticket_enum_1.InternalTicketStatusReason.NO_ASSIGNEE,
|
|
36
|
+
};
|
|
22
37
|
}
|
|
23
|
-
return {
|
|
38
|
+
return {
|
|
39
|
+
status: internal_ticket_enum_1.InternalTicketStatus.IN_PROGRESS,
|
|
40
|
+
reason: internal_ticket_enum_1.InternalTicketStatusReason.HAS_ASSIGNEE,
|
|
41
|
+
};
|
|
24
42
|
}
|
|
25
43
|
exports.computeInternalTicketStatus = computeInternalTicketStatus;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const WORKFLOW_FN_RATE_LIMIT_MAX_CALLS = 50;
|
|
2
|
+
export declare const WORKFLOW_FN_RATE_LIMIT_WINDOW_MS = 10000;
|
|
3
|
+
export declare const WORKFLOW_FN_CALL_TIMEOUT_MS = 5000;
|
|
4
|
+
export interface IWfnTicket {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string | null;
|
|
8
|
+
status: string;
|
|
9
|
+
sectionId: string;
|
|
10
|
+
sectionName: string;
|
|
11
|
+
priorityId: string | null;
|
|
12
|
+
priorityName: string | null;
|
|
13
|
+
categoryId: string | null;
|
|
14
|
+
categoryName: string | null;
|
|
15
|
+
creatorUserId: string;
|
|
16
|
+
assignedToUserId: string | null;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
resolvedAt: string | null;
|
|
20
|
+
closedAt: string | null;
|
|
21
|
+
archivedAt: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface IWfnTicketTag {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
color: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface IWfnTicketArtifact {
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
value: string;
|
|
32
|
+
typeName: string | null;
|
|
33
|
+
}
|
|
34
|
+
export interface IWfnSection {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string | null;
|
|
38
|
+
color: string | null;
|
|
39
|
+
icon: string | null;
|
|
40
|
+
categories: {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
color: string | null;
|
|
44
|
+
}[];
|
|
45
|
+
priorities: {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
color: string | null;
|
|
49
|
+
}[];
|
|
50
|
+
tags: {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
color: string | null;
|
|
54
|
+
}[];
|
|
55
|
+
}
|
|
56
|
+
export interface IWfnMember {
|
|
57
|
+
userId: string;
|
|
58
|
+
email: string;
|
|
59
|
+
alias: string;
|
|
60
|
+
name: string | null;
|
|
61
|
+
familyName: string | null;
|
|
62
|
+
permissions: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface IWorkflowFunctionParam {
|
|
65
|
+
name: string;
|
|
66
|
+
type: string;
|
|
67
|
+
description: string;
|
|
68
|
+
optional?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface IWorkflowFunctionDef {
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
parameters: IWorkflowFunctionParam[];
|
|
74
|
+
returnType: string;
|
|
75
|
+
}
|
|
76
|
+
export declare const WORKFLOW_FUNCTION_DEFS: IWorkflowFunctionDef[];
|
|
77
|
+
export type WorkflowFn = (...args: any[]) => Promise<unknown>;
|
|
78
|
+
export type WorkflowFnMap = Map<string, WorkflowFn>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WORKFLOW_FUNCTION_DEFS = exports.WORKFLOW_FN_CALL_TIMEOUT_MS = exports.WORKFLOW_FN_RATE_LIMIT_WINDOW_MS = exports.WORKFLOW_FN_RATE_LIMIT_MAX_CALLS = void 0;
|
|
4
|
+
exports.WORKFLOW_FN_RATE_LIMIT_MAX_CALLS = 50;
|
|
5
|
+
exports.WORKFLOW_FN_RATE_LIMIT_WINDOW_MS = 10000;
|
|
6
|
+
exports.WORKFLOW_FN_CALL_TIMEOUT_MS = 5000;
|
|
7
|
+
exports.WORKFLOW_FUNCTION_DEFS = [
|
|
8
|
+
{
|
|
9
|
+
name: 'getTicket',
|
|
10
|
+
description: 'Get internal ticket data by ID (with section, priority, category)',
|
|
11
|
+
parameters: [{ name: 'ticketId', type: 'string', description: 'The ticket ID (UUID)' }],
|
|
12
|
+
returnType: 'IWfnTicket | null',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'getTicketFollowers',
|
|
16
|
+
description: 'Get user IDs of all followers of a ticket',
|
|
17
|
+
parameters: [{ name: 'ticketId', type: 'string', description: 'The ticket ID (UUID)' }],
|
|
18
|
+
returnType: 'string[]',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'getTicketAssignees',
|
|
22
|
+
description: 'Get user IDs of all assignees of a ticket',
|
|
23
|
+
parameters: [{ name: 'ticketId', type: 'string', description: 'The ticket ID (UUID)' }],
|
|
24
|
+
returnType: 'string[]',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'getTicketTags',
|
|
28
|
+
description: 'Get tags attached to a ticket',
|
|
29
|
+
parameters: [{ name: 'ticketId', type: 'string', description: 'The ticket ID (UUID)' }],
|
|
30
|
+
returnType: 'IWfnTicketTag[]',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'getTicketArtifacts',
|
|
34
|
+
description: 'Get artifacts (custom fields) of a ticket',
|
|
35
|
+
parameters: [{ name: 'ticketId', type: 'string', description: 'The ticket ID (UUID)' }],
|
|
36
|
+
returnType: 'IWfnTicketArtifact[]',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'getSection',
|
|
40
|
+
description: 'Get a ticket section with its categories, priorities, and tags',
|
|
41
|
+
parameters: [{ name: 'sectionId', type: 'string', description: 'The section ID (UUID)' }],
|
|
42
|
+
returnType: 'IWfnSection | null',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'getSectionTicketCount',
|
|
46
|
+
description: 'Count tickets in a section, optionally filtered by status',
|
|
47
|
+
parameters: [
|
|
48
|
+
{ name: 'sectionId', type: 'string', description: 'The section ID (UUID)' },
|
|
49
|
+
{
|
|
50
|
+
name: 'status',
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'Optional status filter (e.g. "IN_PROGRESS")',
|
|
53
|
+
optional: true,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
returnType: 'number',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'getProjectAdmins',
|
|
60
|
+
description: 'Get user IDs of all project admins (FULL_ACCESS permission)',
|
|
61
|
+
parameters: [],
|
|
62
|
+
returnType: 'string[]',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'getProjectMembers',
|
|
66
|
+
description: 'Get all project members with their info',
|
|
67
|
+
parameters: [],
|
|
68
|
+
returnType: 'IWfnMember[]',
|
|
69
|
+
},
|
|
70
|
+
];
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./resolver"), exports);
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./functions"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IProject, IWorkflow, IWorkflowTrigger, IWorkflowStep, IWorkflowStepExecution, IWorkflowStepConnection, IWorkflowExecution, IIpAddress, IDomainVerification, ISecret, IVariable,
|
|
1
|
+
import type { IProject, IWorkflow, IWorkflowTrigger, IWorkflowStep, IWorkflowStepExecution, IWorkflowStepConnection, IWorkflowExecution, IIpAddress, IDomainVerification, ISecret, IVariable, WorkflowTriggerDataMap } from '../types';
|
|
2
2
|
export declare enum ExpressionMode {
|
|
3
3
|
EXPRESSION = "EXPRESSION",
|
|
4
4
|
TEMPLATE = "TEMPLATE",
|
|
@@ -13,21 +13,43 @@ export declare enum DataSourceType {
|
|
|
13
13
|
SECRETS = "secrets",
|
|
14
14
|
VARIABLES = "variables",
|
|
15
15
|
PROJECT = "project",
|
|
16
|
+
ORGANIZATION = "organization",
|
|
16
17
|
WORKFLOW = "workflow",
|
|
17
18
|
WORKFLOW_EXECUTION = "workflowExecutions",
|
|
18
19
|
STEP_EXECUTIONS = "stepExecutions",
|
|
19
20
|
STEPS = "steps",
|
|
20
21
|
CONNECTIONS = "connections",
|
|
21
|
-
ABYSS = "abyss"
|
|
22
|
+
ABYSS = "abyss",
|
|
23
|
+
MEMBERS = "members"
|
|
24
|
+
}
|
|
25
|
+
export interface IWorkflowOrganizationIntegration {
|
|
26
|
+
id: string;
|
|
27
|
+
type: string;
|
|
28
|
+
botToken: string;
|
|
29
|
+
teamId: string | null;
|
|
30
|
+
guildId: string | null;
|
|
31
|
+
scope: string[];
|
|
32
|
+
disabledAt: Date | null;
|
|
33
|
+
config: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface IWorkflowOrganization {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
description: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface IWorkflowOrganizationAdmin {
|
|
42
|
+
organizationIntegrations: IWorkflowOrganizationIntegration[];
|
|
22
43
|
}
|
|
23
44
|
export interface WorkflowContext {
|
|
24
45
|
[DataSourceType.PROJECT]: Pick<IProject, 'id'> & {
|
|
25
46
|
name: string;
|
|
26
47
|
};
|
|
48
|
+
[DataSourceType.ORGANIZATION]: IWorkflowOrganization;
|
|
27
49
|
[DataSourceType.WORKFLOW]: Pick<IWorkflow, 'id' | 'name' | 'description' | 'template' | 'status' | 'settings'>;
|
|
28
50
|
[DataSourceType.WORKFLOW_EXECUTION]?: Pick<IWorkflowExecution, 'id' | 'status' | 'startedAt' | 'completedAt' | 'context' | 'metadata'>;
|
|
29
51
|
[DataSourceType.WORKFLOW_TRIGGER]: IWorkflowTrigger & {
|
|
30
|
-
data:
|
|
52
|
+
data: Partial<WorkflowTriggerDataMap>;
|
|
31
53
|
};
|
|
32
54
|
[DataSourceType.WORKFLOW_TRIGGERS]: Record<string, IWorkflowTrigger>;
|
|
33
55
|
[DataSourceType.STEP_EXECUTIONS]: Record<string, IWorkflowStepExecution>;
|
|
@@ -45,4 +67,21 @@ export interface WorkflowContext {
|
|
|
45
67
|
api: string;
|
|
46
68
|
site: string;
|
|
47
69
|
}>;
|
|
70
|
+
[DataSourceType.MEMBERS]: Record<string, IWorkflowMember>;
|
|
71
|
+
}
|
|
72
|
+
export interface WorkflowContextAdmin {
|
|
73
|
+
discordBotToken: string;
|
|
74
|
+
organization: IWorkflowOrganizationAdmin;
|
|
75
|
+
}
|
|
76
|
+
export interface IWorkflowMember {
|
|
77
|
+
userId: string;
|
|
78
|
+
email: string;
|
|
79
|
+
alias: string;
|
|
80
|
+
name: string | null;
|
|
81
|
+
familyName: string | null;
|
|
82
|
+
permissions: string[];
|
|
83
|
+
oauthProviders: {
|
|
84
|
+
type: number;
|
|
85
|
+
accountId: string;
|
|
86
|
+
}[];
|
|
48
87
|
}
|
|
@@ -17,10 +17,12 @@ var DataSourceType;
|
|
|
17
17
|
DataSourceType["SECRETS"] = "secrets";
|
|
18
18
|
DataSourceType["VARIABLES"] = "variables";
|
|
19
19
|
DataSourceType["PROJECT"] = "project";
|
|
20
|
+
DataSourceType["ORGANIZATION"] = "organization";
|
|
20
21
|
DataSourceType["WORKFLOW"] = "workflow";
|
|
21
22
|
DataSourceType["WORKFLOW_EXECUTION"] = "workflowExecutions";
|
|
22
23
|
DataSourceType["STEP_EXECUTIONS"] = "stepExecutions";
|
|
23
24
|
DataSourceType["STEPS"] = "steps";
|
|
24
25
|
DataSourceType["CONNECTIONS"] = "connections";
|
|
25
26
|
DataSourceType["ABYSS"] = "abyss";
|
|
27
|
+
DataSourceType["MEMBERS"] = "members";
|
|
26
28
|
})(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
|