@activepieces/piece-azure-devops 0.0.2 → 0.0.4
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/package.json +7 -12
- package/src/index.js +24 -42
- package/src/index.d.ts +0 -5
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-comment.d.ts +0 -12
- package/src/lib/actions/add-comment.d.ts.map +0 -1
- package/src/lib/actions/add-comment.js +0 -57
- package/src/lib/actions/add-comment.js.map +0 -1
- package/src/lib/actions/create-work-item.d.ts +0 -27
- package/src/lib/actions/create-work-item.d.ts.map +0 -1
- package/src/lib/actions/create-work-item.js +0 -72
- package/src/lib/actions/create-work-item.js.map +0 -1
- package/src/lib/actions/get-work-item.d.ts +0 -11
- package/src/lib/actions/get-work-item.d.ts.map +0 -1
- package/src/lib/actions/get-work-item.js +0 -41
- package/src/lib/actions/get-work-item.js.map +0 -1
- package/src/lib/actions/list-work-items.d.ts +0 -12
- package/src/lib/actions/list-work-items.d.ts.map +0 -1
- package/src/lib/actions/list-work-items.js +0 -60
- package/src/lib/actions/list-work-items.js.map +0 -1
- package/src/lib/actions/update-work-item.d.ts +0 -67
- package/src/lib/actions/update-work-item.d.ts.map +0 -1
- package/src/lib/actions/update-work-item.js +0 -107
- package/src/lib/actions/update-work-item.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -210
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -581
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/new-updated-work-item-webhook.d.ts +0 -68
- package/src/lib/triggers/new-updated-work-item-webhook.d.ts.map +0 -1
- package/src/lib/triggers/new-updated-work-item-webhook.js +0 -167
- package/src/lib/triggers/new-updated-work-item-webhook.js.map +0 -1
- package/src/lib/triggers/new-updated-work-item.d.ts +0 -91
- package/src/lib/triggers/new-updated-work-item.d.ts.map +0 -1
- package/src/lib/triggers/new-updated-work-item.js +0 -114
- package/src/lib/triggers/new-updated-work-item.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createWorkItemAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const common_2 = require("../common");
|
|
9
|
-
exports.createWorkItemAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: common_1.azureDevOpsAuth,
|
|
11
|
-
name: 'create_work_item',
|
|
12
|
-
displayName: 'Create Work Item',
|
|
13
|
-
description: 'Creates a new work item (Bug, Task, User Story, etc.) in Azure DevOps',
|
|
14
|
-
props: {
|
|
15
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
16
|
-
work_item_type: common_2.azureDevOpsCommon.workItemTypeDropdown,
|
|
17
|
-
title: pieces_framework_1.Property.ShortText({
|
|
18
|
-
displayName: 'Title',
|
|
19
|
-
description: 'The title of the work item',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
description: pieces_framework_1.Property.LongText({
|
|
23
|
-
displayName: 'Description',
|
|
24
|
-
description: 'Detailed description of the work item (supports HTML)',
|
|
25
|
-
required: false,
|
|
26
|
-
}),
|
|
27
|
-
assigned_to: common_2.azureDevOpsCommon.assignedToDropdown,
|
|
28
|
-
priority: common_2.azureDevOpsCommon.priorityDropdown,
|
|
29
|
-
},
|
|
30
|
-
run(context) {
|
|
31
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const { project, work_item_type, title, description, assigned_to, priority } = context.propsValue;
|
|
33
|
-
const auth = context.auth;
|
|
34
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
35
|
-
const operations = [
|
|
36
|
-
{ op: 'add', path: '/fields/System.Title', value: title },
|
|
37
|
-
];
|
|
38
|
-
if (description) {
|
|
39
|
-
operations.push({
|
|
40
|
-
op: 'add',
|
|
41
|
-
path: '/fields/System.Description',
|
|
42
|
-
value: description,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
if (assigned_to) {
|
|
46
|
-
operations.push({
|
|
47
|
-
op: 'add',
|
|
48
|
-
path: '/fields/System.AssignedTo',
|
|
49
|
-
value: assigned_to,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
if (priority) {
|
|
53
|
-
operations.push({
|
|
54
|
-
op: 'add',
|
|
55
|
-
path: '/fields/Microsoft.VSTS.Common.Priority',
|
|
56
|
-
value: Number(priority),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
const response = yield common_2.azureDevOpsCommon.apiCall({
|
|
60
|
-
organizationUrl: orgUrl,
|
|
61
|
-
pat: auth.props.pat,
|
|
62
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
63
|
-
endpoint: `/${encodeURIComponent(project)}/_apis/wit/workitems/$${encodeURIComponent(common_2.azureDevOpsCommon.narrowString(work_item_type, 'work_item_type'))}`,
|
|
64
|
-
queryParams: { 'api-version': '7.1' },
|
|
65
|
-
body: operations,
|
|
66
|
-
isJsonPatch: true,
|
|
67
|
-
});
|
|
68
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(response);
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
//# sourceMappingURL=create-work-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-work-item.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-work-item.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA4C;AAC5C,sCAImB;AAEN,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,wBAAe;IACrB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAk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AED,IAAI,QAAQ,EAAE,CAAC;gBACb,UAAU,CAAC,IAAI,CAAC;oBACd,EAAE,EAAE,KAAK;oBACT,IAAI,EAAE,wCAAwC;oBAC9C,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC;iBACxB,CAAC,CAAC;YACL,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAiB,CAAC,OAAO,CAAsB;gBACpE,eAAe,EAAE,MAAM;gBACvB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;gBACnB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,QAAQ,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,yBAAyB,kBAAkB,CAAC,0BAAiB,CAAC,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,EAAE;gBACxJ,WAAW,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;gBACrC,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,IAAI;aAClB,CAAC,CAAC;YAEH,OAAO,0BAAiB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACrD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const getWorkItemAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>>;
|
|
9
|
-
work_item_id: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=get-work-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-work-item.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-work-item.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;;;;;;;;EAgC5B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWorkItemAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const common_2 = require("../common");
|
|
9
|
-
exports.getWorkItemAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: common_1.azureDevOpsAuth,
|
|
11
|
-
name: 'get_work_item',
|
|
12
|
-
displayName: 'Get Work Item',
|
|
13
|
-
description: 'Retrieves a work item by ID from Azure DevOps',
|
|
14
|
-
props: {
|
|
15
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
16
|
-
work_item_id: pieces_framework_1.Property.Number({
|
|
17
|
-
displayName: 'Work Item ID',
|
|
18
|
-
description: 'Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.',
|
|
19
|
-
required: true,
|
|
20
|
-
}),
|
|
21
|
-
},
|
|
22
|
-
run(context) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const { project, work_item_id } = context.propsValue;
|
|
25
|
-
const auth = context.auth;
|
|
26
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
27
|
-
const response = yield common_2.azureDevOpsCommon.apiCall({
|
|
28
|
-
organizationUrl: orgUrl,
|
|
29
|
-
pat: auth.props.pat,
|
|
30
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
31
|
-
endpoint: `/${encodeURIComponent(project)}/_apis/wit/workitems/${work_item_id}`,
|
|
32
|
-
queryParams: {
|
|
33
|
-
'$expand': 'all',
|
|
34
|
-
'api-version': '7.1',
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(response);
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=get-work-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-work-item.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-work-item.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA4C;AAC5C,sCAGmB;AAEN,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,wBAAe;IACrB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,+CAA+C;IAC5D,KAAK,EAAE;QACL,OAAO,EAAE,0BAAiB,CAAC,eAAe;QAC1C,YAAY,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,+IAA+I;YACjJ,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACrD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,MAAM,GAAG,0BAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAE5E,MAAM,QAAQ,GAAG,MAAM,0BAAiB,CAAC,OAAO,CAAsB;gBACpE,eAAe,EAAE,MAAM;gBACvB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;gBACnB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,QAAQ,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,wBAAwB,YAAY,EAAE;gBAC/E,WAAW,EAAE;oBACX,SAAS,EAAE,KAAK;oBAChB,aAAa,EAAE,KAAK;iBACrB;aACF,CAAC,CAAC;YAEH,OAAO,0BAAiB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACrD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const listWorkItemsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>>;
|
|
9
|
-
wiql_query: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
10
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=list-work-items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-work-items.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-work-items.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB;;;;;;;;;;EAqD9B,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listWorkItemsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const common_2 = require("../common");
|
|
9
|
-
const DEFAULT_WIQL = `SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] <> '' ORDER BY [System.ChangedDate] DESC`;
|
|
10
|
-
exports.listWorkItemsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: common_1.azureDevOpsAuth,
|
|
12
|
-
name: 'list_work_items',
|
|
13
|
-
displayName: 'List Work Items',
|
|
14
|
-
description: 'Lists work items from Azure DevOps using a WIQL query',
|
|
15
|
-
props: {
|
|
16
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
17
|
-
wiql_query: pieces_framework_1.Property.LongText({
|
|
18
|
-
displayName: 'WIQL Query',
|
|
19
|
-
description: `The WIQL query to execute. Default: SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.ChangedDate] DESC`,
|
|
20
|
-
required: false,
|
|
21
|
-
}),
|
|
22
|
-
limit: pieces_framework_1.Property.Number({
|
|
23
|
-
displayName: 'Limit',
|
|
24
|
-
description: 'Maximum number of work items to return (default: 50, max: 200)',
|
|
25
|
-
required: false,
|
|
26
|
-
defaultValue: 50,
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
run(context) {
|
|
30
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const { project, wiql_query, limit } = context.propsValue;
|
|
32
|
-
const auth = context.auth;
|
|
33
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
34
|
-
const query = wiql_query || DEFAULT_WIQL;
|
|
35
|
-
const maxItems = Math.max(1, Math.min(limit !== null && limit !== void 0 ? limit : 50, 200));
|
|
36
|
-
const wiqlResponse = yield common_2.azureDevOpsCommon.apiCall({
|
|
37
|
-
organizationUrl: orgUrl,
|
|
38
|
-
pat: auth.props.pat,
|
|
39
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
40
|
-
endpoint: `/${encodeURIComponent(project)}/_apis/wit/wiql`,
|
|
41
|
-
queryParams: {
|
|
42
|
-
'$top': `${maxItems}`,
|
|
43
|
-
'api-version': '7.1',
|
|
44
|
-
},
|
|
45
|
-
body: { query },
|
|
46
|
-
});
|
|
47
|
-
if (!wiqlResponse.workItems || wiqlResponse.workItems.length === 0) {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
const ids = wiqlResponse.workItems.map((wi) => wi.id);
|
|
51
|
-
const workItems = yield common_2.azureDevOpsCommon.fetchWorkItemsByIds({
|
|
52
|
-
organizationUrl: orgUrl,
|
|
53
|
-
pat: auth.props.pat,
|
|
54
|
-
ids,
|
|
55
|
-
});
|
|
56
|
-
return workItems;
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=list-work-items.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-work-items.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-work-items.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA4C;AAC5C,sCAGmB;AAEnB,MAAM,YAAY,GAAG,4IAA4I,CAAC;AAErJ,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,wBAAe;IACrB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,uDAAuD;IACpE,KAAK,EAAE;QACL,OAAO,EAAE,0BAAiB,CAAC,eAAe;QAC1C,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,gJAAgJ;YAC7J,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,gEAAgE;Y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MAAM;gBACvB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;gBACnB,GAAG;aACJ,CAAC,CAAC;YAEH,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare const updateWorkItemAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>>;
|
|
9
|
-
work_item_type: {
|
|
10
|
-
description: string;
|
|
11
|
-
displayName: string;
|
|
12
|
-
auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
13
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
14
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
15
|
-
}>;
|
|
16
|
-
refreshers: string[];
|
|
17
|
-
refreshOnSearch?: boolean;
|
|
18
|
-
options: (propsValue: Record<string, unknown> & {
|
|
19
|
-
auth?: import("@activepieces/shared").CustomAuthConnectionValue<import("@activepieces/pieces-framework").StaticPropsValue<{
|
|
20
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
21
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
22
|
-
}>> | undefined;
|
|
23
|
-
}, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").DropdownState<string>>;
|
|
24
|
-
valueSchema: string;
|
|
25
|
-
type: import("@activepieces/pieces-framework").PropertyType.DROPDOWN;
|
|
26
|
-
required: false;
|
|
27
|
-
defaultValue?: unknown;
|
|
28
|
-
} | {
|
|
29
|
-
description: string;
|
|
30
|
-
displayName: string;
|
|
31
|
-
auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
32
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
33
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
34
|
-
}>;
|
|
35
|
-
refreshers: string[];
|
|
36
|
-
refreshOnSearch?: boolean;
|
|
37
|
-
options: (propsValue: Record<string, unknown> & {
|
|
38
|
-
auth?: import("@activepieces/shared").CustomAuthConnectionValue<import("@activepieces/pieces-framework").StaticPropsValue<{
|
|
39
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
40
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
41
|
-
}>> | undefined;
|
|
42
|
-
}, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").DropdownState<string>>;
|
|
43
|
-
valueSchema: string;
|
|
44
|
-
type: import("@activepieces/pieces-framework").PropertyType.DROPDOWN;
|
|
45
|
-
required: true;
|
|
46
|
-
defaultValue?: unknown;
|
|
47
|
-
};
|
|
48
|
-
work_item_id: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
49
|
-
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
50
|
-
description: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
51
|
-
state: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
52
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
53
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
54
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
55
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
56
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
57
|
-
}>>;
|
|
58
|
-
assigned_to: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
59
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
60
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
61
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
62
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
63
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
64
|
-
}>>;
|
|
65
|
-
priority: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
66
|
-
}>;
|
|
67
|
-
//# sourceMappingURL=update-work-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-work-item.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-work-item.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2G/B,CAAC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateWorkItemAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const common_2 = require("../common");
|
|
9
|
-
exports.updateWorkItemAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: common_1.azureDevOpsAuth,
|
|
11
|
-
name: 'update_work_item',
|
|
12
|
-
displayName: 'Update Work Item',
|
|
13
|
-
description: 'Updates an existing work item in Azure DevOps',
|
|
14
|
-
props: {
|
|
15
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
16
|
-
work_item_type: Object.assign(Object.assign({}, common_2.azureDevOpsCommon.workItemTypeDropdown), { description: 'Type of the work item. Used only to load the matching list of states below — it does not change the work item\'s type. Changing type requires a separate Azure DevOps operation not supported here.' }),
|
|
17
|
-
work_item_id: pieces_framework_1.Property.Number({
|
|
18
|
-
displayName: 'Work Item ID',
|
|
19
|
-
description: 'Numeric ID of the work item (e.g. 123). To pass it dynamically from a previous step, use a reference like `{{trigger.id}}` or the output of a Get/List step — not the title.',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
title: pieces_framework_1.Property.ShortText({
|
|
23
|
-
displayName: 'Title',
|
|
24
|
-
description: 'New title for the work item',
|
|
25
|
-
required: false,
|
|
26
|
-
}),
|
|
27
|
-
description: pieces_framework_1.Property.LongText({
|
|
28
|
-
displayName: 'Description',
|
|
29
|
-
description: 'New description for the work item (supports HTML)',
|
|
30
|
-
required: false,
|
|
31
|
-
}),
|
|
32
|
-
state: common_2.azureDevOpsCommon.stateDropdown,
|
|
33
|
-
assigned_to: common_2.azureDevOpsCommon.assignedToDropdown,
|
|
34
|
-
priority: common_2.azureDevOpsCommon.priorityDropdown,
|
|
35
|
-
},
|
|
36
|
-
run(context) {
|
|
37
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
const { project, work_item_id, title, description, state, assigned_to, priority } = context.propsValue;
|
|
39
|
-
const auth = context.auth;
|
|
40
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
41
|
-
const encodedProject = encodeURIComponent(project);
|
|
42
|
-
const operations = [];
|
|
43
|
-
if (isNonEmptyString(title)) {
|
|
44
|
-
operations.push({
|
|
45
|
-
op: 'replace',
|
|
46
|
-
path: '/fields/System.Title',
|
|
47
|
-
value: title,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (isNonEmptyString(description)) {
|
|
51
|
-
operations.push({
|
|
52
|
-
op: 'replace',
|
|
53
|
-
path: '/fields/System.Description',
|
|
54
|
-
value: description,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
if (isNonEmptyString(state)) {
|
|
58
|
-
operations.push({
|
|
59
|
-
op: 'replace',
|
|
60
|
-
path: '/fields/System.State',
|
|
61
|
-
value: state,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (isNonEmptyString(assigned_to)) {
|
|
65
|
-
operations.push({
|
|
66
|
-
op: 'replace',
|
|
67
|
-
path: '/fields/System.AssignedTo',
|
|
68
|
-
value: assigned_to,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
if (priority !== undefined && priority !== null) {
|
|
72
|
-
operations.push({
|
|
73
|
-
op: 'replace',
|
|
74
|
-
path: '/fields/Microsoft.VSTS.Common.Priority',
|
|
75
|
-
value: Number(priority),
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
if (operations.length === 0) {
|
|
79
|
-
const getResponse = yield common_2.azureDevOpsCommon.apiCall({
|
|
80
|
-
organizationUrl: orgUrl,
|
|
81
|
-
pat: auth.props.pat,
|
|
82
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
83
|
-
endpoint: `/${encodedProject}/_apis/wit/workitems/${work_item_id}`,
|
|
84
|
-
queryParams: {
|
|
85
|
-
'$expand': 'all',
|
|
86
|
-
'api-version': '7.1',
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(getResponse);
|
|
90
|
-
}
|
|
91
|
-
const response = yield common_2.azureDevOpsCommon.apiCall({
|
|
92
|
-
organizationUrl: orgUrl,
|
|
93
|
-
pat: auth.props.pat,
|
|
94
|
-
method: pieces_common_1.HttpMethod.PATCH,
|
|
95
|
-
endpoint: `/${encodedProject}/_apis/wit/workitems/${work_item_id}`,
|
|
96
|
-
queryParams: { 'api-version': '7.1' },
|
|
97
|
-
body: operations,
|
|
98
|
-
isJsonPatch: true,
|
|
99
|
-
});
|
|
100
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(response);
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
function isNonEmptyString(value) {
|
|
105
|
-
return typeof value === 'string' && value.length > 0;
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=update-work-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-work-item.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-work-item.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA4C;AAC5C,sCAImB;AAEN,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,wBAAe;IACrB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,+CAA+C;IAC5D,KAAK,EAAE;QACL,OAAO,EAAE,0BAAiB,CAAC,eAAe;QAC1C,cAAc,kCACT,0BAAiB,CAAC,oBAAoB,KACzC,WAAW,EACT,qMAAqM,GACxM;QACD,YAAY,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,8KAA8K;YAChL,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,0BAAiB,CAAC,aAAa;QACtC,WAAW,EAAE,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0 @@
|
|
|
1
|
-
import { HttpMethod, HttpMessageBody } from '@activepieces/pieces-common';
|
|
2
|
-
import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
|
|
3
|
-
declare function asAzureAuth(auth: unknown): AzureDevOpsAuth;
|
|
4
|
-
declare function narrowString(value: unknown, fieldName: string): string;
|
|
5
|
-
declare function generateWebhookToken(): string;
|
|
6
|
-
declare function timingSafeEqual(a: string, b: string): boolean;
|
|
7
|
-
declare function extractHttpStatus(error: unknown): string;
|
|
8
|
-
declare function parseWebhookPayload(body: unknown): WebhookPayload | null;
|
|
9
|
-
export declare const azureDevOpsAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
10
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
-
}>;
|
|
13
|
-
export type AzureDevOpsAuth = AppConnectionValueForAuthProperty<typeof azureDevOpsAuth>;
|
|
14
|
-
declare function azureDevOpsApiCall<T extends HttpMessageBody>({ organizationUrl, pat, method, endpoint, body, queryParams, isJsonPatch, }: {
|
|
15
|
-
organizationUrl: string;
|
|
16
|
-
pat: string;
|
|
17
|
-
method: HttpMethod;
|
|
18
|
-
endpoint: string;
|
|
19
|
-
body?: unknown;
|
|
20
|
-
queryParams?: Record<string, string>;
|
|
21
|
-
isJsonPatch?: boolean;
|
|
22
|
-
}): Promise<T>;
|
|
23
|
-
declare function flattenWorkItem(workItem: AzureDevOpsWorkItem): FlatWorkItem;
|
|
24
|
-
declare function fetchWorkItemsByIds({ organizationUrl, pat, ids, }: {
|
|
25
|
-
organizationUrl: string;
|
|
26
|
-
pat: string;
|
|
27
|
-
ids: number[];
|
|
28
|
-
}): Promise<FlatWorkItem[]>;
|
|
29
|
-
declare function createSubscription({ auth, projectId, eventType, webhookUrl, workItemType, basicAuthUsername, basicAuthPassword, }: {
|
|
30
|
-
auth: AzureDevOpsAuth;
|
|
31
|
-
projectId: string;
|
|
32
|
-
eventType: AzureDevOpsHookEvent;
|
|
33
|
-
webhookUrl: string;
|
|
34
|
-
workItemType?: string;
|
|
35
|
-
basicAuthUsername?: string;
|
|
36
|
-
basicAuthPassword?: string;
|
|
37
|
-
}): Promise<SubscriptionResponse>;
|
|
38
|
-
declare function deleteSubscription({ auth, subscriptionId, }: {
|
|
39
|
-
auth: AzureDevOpsAuth;
|
|
40
|
-
subscriptionId: string;
|
|
41
|
-
}): Promise<void>;
|
|
42
|
-
declare function fetchProjectId(auth: AzureDevOpsAuth, projectName: string): Promise<string | null>;
|
|
43
|
-
declare function fetchTeamMembers(auth: AzureDevOpsAuth, projectName: string): Promise<IdentityRef[]>;
|
|
44
|
-
declare function fetchWorkItemTypeStates(auth: AzureDevOpsAuth, projectName: string, workItemType: string): Promise<WorkItemStateColor[]>;
|
|
45
|
-
export declare const azureDevOpsCommon: {
|
|
46
|
-
projectDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
47
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
48
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
49
|
-
}>>;
|
|
50
|
-
workItemTypeDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
51
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
52
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
53
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
54
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
55
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
56
|
-
}>>;
|
|
57
|
-
workItemTypeDropdownOptional: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
58
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
59
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
60
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
61
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
62
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
63
|
-
}>>;
|
|
64
|
-
assignedToDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
65
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
66
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
67
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
68
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
69
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
70
|
-
}>>;
|
|
71
|
-
stateDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
72
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
73
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
74
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
75
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
76
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
77
|
-
}>>;
|
|
78
|
-
stateDropdownOptional: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
79
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
80
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
81
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
82
|
-
organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
83
|
-
pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
84
|
-
}>>;
|
|
85
|
-
priorityDropdown: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
86
|
-
escapeWiqlString: typeof escapeWiqlString;
|
|
87
|
-
sanitizeOrgUrl: typeof sanitizeOrgUrl;
|
|
88
|
-
isValidUrl: typeof isValidUrl;
|
|
89
|
-
asAuth: typeof asAzureAuth;
|
|
90
|
-
narrowString: typeof narrowString;
|
|
91
|
-
parseWebhookPayload: typeof parseWebhookPayload;
|
|
92
|
-
generateWebhookToken: typeof generateWebhookToken;
|
|
93
|
-
timingSafeEqual: typeof timingSafeEqual;
|
|
94
|
-
extractHttpStatus: typeof extractHttpStatus;
|
|
95
|
-
apiCall: typeof azureDevOpsApiCall;
|
|
96
|
-
fetchWorkItemsByIds: typeof fetchWorkItemsByIds;
|
|
97
|
-
flattenWorkItem: typeof flattenWorkItem;
|
|
98
|
-
fetchProjectId: typeof fetchProjectId;
|
|
99
|
-
fetchTeamMembers: typeof fetchTeamMembers;
|
|
100
|
-
fetchWorkItemTypeStates: typeof fetchWorkItemTypeStates;
|
|
101
|
-
createSubscription: typeof createSubscription;
|
|
102
|
-
deleteSubscription: typeof deleteSubscription;
|
|
103
|
-
};
|
|
104
|
-
declare function sanitizeOrgUrl(url: string): string;
|
|
105
|
-
declare function escapeWiqlString(value: string): string;
|
|
106
|
-
declare function isValidUrl(url: string): boolean;
|
|
107
|
-
export interface JsonPatchOperation {
|
|
108
|
-
op: 'add' | 'replace' | 'remove' | 'test';
|
|
109
|
-
path: string;
|
|
110
|
-
value?: unknown;
|
|
111
|
-
}
|
|
112
|
-
export interface IdentityRef {
|
|
113
|
-
displayName: string;
|
|
114
|
-
uniqueName: string;
|
|
115
|
-
id: string;
|
|
116
|
-
}
|
|
117
|
-
export interface AzureDevOpsWorkItem {
|
|
118
|
-
id: number;
|
|
119
|
-
rev: number;
|
|
120
|
-
url?: string;
|
|
121
|
-
fields: Record<string, unknown> & {
|
|
122
|
-
'System.Title'?: string;
|
|
123
|
-
'System.WorkItemType'?: string;
|
|
124
|
-
'System.State'?: string;
|
|
125
|
-
'System.Reason'?: string;
|
|
126
|
-
'System.AssignedTo'?: IdentityRef;
|
|
127
|
-
'System.CreatedDate'?: string;
|
|
128
|
-
'System.CreatedBy'?: IdentityRef;
|
|
129
|
-
'System.ChangedDate'?: string;
|
|
130
|
-
'System.ChangedBy'?: IdentityRef;
|
|
131
|
-
'System.AreaPath'?: string;
|
|
132
|
-
'System.IterationPath'?: string;
|
|
133
|
-
'System.TeamProject'?: string;
|
|
134
|
-
'System.Description'?: string;
|
|
135
|
-
'Microsoft.VSTS.Common.Priority'?: number;
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
export interface FlatWorkItem {
|
|
139
|
-
id: number;
|
|
140
|
-
rev: number;
|
|
141
|
-
url: string | null;
|
|
142
|
-
title: string | null;
|
|
143
|
-
work_item_type: string | null;
|
|
144
|
-
state: string | null;
|
|
145
|
-
reason: string | null;
|
|
146
|
-
assigned_to: string | null;
|
|
147
|
-
assigned_to_email: string | null;
|
|
148
|
-
created_date: string | null;
|
|
149
|
-
created_by: string | null;
|
|
150
|
-
changed_date: string | null;
|
|
151
|
-
changed_by: string | null;
|
|
152
|
-
area_path: string | null;
|
|
153
|
-
iteration_path: string | null;
|
|
154
|
-
priority: number | null;
|
|
155
|
-
description: string | null;
|
|
156
|
-
project: string | null;
|
|
157
|
-
}
|
|
158
|
-
export interface WiqlResponse {
|
|
159
|
-
queryType: string;
|
|
160
|
-
queryResultType: string;
|
|
161
|
-
asOf: string;
|
|
162
|
-
workItems: Array<{
|
|
163
|
-
id: number;
|
|
164
|
-
url: string;
|
|
165
|
-
}>;
|
|
166
|
-
}
|
|
167
|
-
export interface ProjectListResponse {
|
|
168
|
-
count: number;
|
|
169
|
-
value: Array<{
|
|
170
|
-
id: string;
|
|
171
|
-
name: string;
|
|
172
|
-
state: string;
|
|
173
|
-
}>;
|
|
174
|
-
}
|
|
175
|
-
export interface WorkItemStateColor {
|
|
176
|
-
name: string;
|
|
177
|
-
color?: string;
|
|
178
|
-
category?: string;
|
|
179
|
-
}
|
|
180
|
-
export type AzureDevOpsHookEvent = 'workitem.created' | 'workitem.updated' | 'workitem.commented';
|
|
181
|
-
export declare const WEBHOOK_EVENT_OPTIONS: ReadonlyArray<{
|
|
182
|
-
label: string;
|
|
183
|
-
value: AzureDevOpsHookEvent;
|
|
184
|
-
}>;
|
|
185
|
-
export interface SubscriptionResponse {
|
|
186
|
-
id: string;
|
|
187
|
-
publisherId: string;
|
|
188
|
-
eventType: string;
|
|
189
|
-
consumerId: string;
|
|
190
|
-
consumerActionId: string;
|
|
191
|
-
}
|
|
192
|
-
export interface WorkItemResource {
|
|
193
|
-
id?: number;
|
|
194
|
-
rev?: number;
|
|
195
|
-
url?: string;
|
|
196
|
-
workItemId?: number;
|
|
197
|
-
fields?: AzureDevOpsWorkItem['fields'];
|
|
198
|
-
revision?: {
|
|
199
|
-
comment?: {
|
|
200
|
-
content?: string;
|
|
201
|
-
};
|
|
202
|
-
fields?: AzureDevOpsWorkItem['fields'];
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
export interface WebhookPayload {
|
|
206
|
-
eventType: AzureDevOpsHookEvent;
|
|
207
|
-
resource: WorkItemResource;
|
|
208
|
-
}
|
|
209
|
-
export {};
|
|
210
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL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