@activepieces/piece-azure-devops 0.0.3 → 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 -59
- 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 -74
- 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 -43
- 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 -62
- 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 -109
- 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 -170
- 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 -117
- package/src/lib/triggers/new-updated-work-item.js.map +0 -1
|
@@ -1,74 +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
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: { description: 'Creates a new work item of the chosen type (Bug, Task, User Story, etc.) in an Azure DevOps project, optionally setting description, assignee, and priority. Use to file a new tracked item. Requires a project and work item type; not idempotent, as each call creates a separate item with a new ID.', idempotent: false },
|
|
16
|
-
props: {
|
|
17
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
18
|
-
work_item_type: common_2.azureDevOpsCommon.workItemTypeDropdown,
|
|
19
|
-
title: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'Title',
|
|
21
|
-
description: 'The title of the work item',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
description: pieces_framework_1.Property.LongText({
|
|
25
|
-
displayName: 'Description',
|
|
26
|
-
description: 'Detailed description of the work item (supports HTML)',
|
|
27
|
-
required: false,
|
|
28
|
-
}),
|
|
29
|
-
assigned_to: common_2.azureDevOpsCommon.assignedToDropdown,
|
|
30
|
-
priority: common_2.azureDevOpsCommon.priorityDropdown,
|
|
31
|
-
},
|
|
32
|
-
run(context) {
|
|
33
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const { project, work_item_type, title, description, assigned_to, priority } = context.propsValue;
|
|
35
|
-
const auth = context.auth;
|
|
36
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
37
|
-
const operations = [
|
|
38
|
-
{ op: 'add', path: '/fields/System.Title', value: title },
|
|
39
|
-
];
|
|
40
|
-
if (description) {
|
|
41
|
-
operations.push({
|
|
42
|
-
op: 'add',
|
|
43
|
-
path: '/fields/System.Description',
|
|
44
|
-
value: description,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
if (assigned_to) {
|
|
48
|
-
operations.push({
|
|
49
|
-
op: 'add',
|
|
50
|
-
path: '/fields/System.AssignedTo',
|
|
51
|
-
value: assigned_to,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (priority) {
|
|
55
|
-
operations.push({
|
|
56
|
-
op: 'add',
|
|
57
|
-
path: '/fields/Microsoft.VSTS.Common.Priority',
|
|
58
|
-
value: Number(priority),
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
const response = yield common_2.azureDevOpsCommon.apiCall({
|
|
62
|
-
organizationUrl: orgUrl,
|
|
63
|
-
pat: auth.props.pat,
|
|
64
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
65
|
-
endpoint: `/${encodeURIComponent(project)}/_apis/wit/workitems/$${encodeURIComponent(common_2.azureDevOpsCommon.narrowString(work_item_type, 'work_item_type'))}`,
|
|
66
|
-
queryParams: { 'api-version': '7.1' },
|
|
67
|
-
body: operations,
|
|
68
|
-
isJsonPatch: true,
|
|
69
|
-
});
|
|
70
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(response);
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
//# 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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C;oBACd,EAAE,EAAE,KAAK;oBACT,IAAI,EAAE,4BAA4B;oBAClC,KAAK,EAAE,WAAW;iBACnB,CAAC,CAAC;YACL,CAAC;YAED,IAAI,WAAW,EAAE,CAAC;gBAChB,UAAU,CAAC,IAAI,CAAC;oBACd,EAAE,EAAE,KAAK;oBACT,IAAI,EAAE,2BAA2B;oBACjC,KAAK,EAAE,WAAW;iBACnB,CAAC,CAAC;YACL,CAAC;YAED,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;;;;;;;;;EAkC5B,CAAC"}
|
|
@@ -1,43 +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
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: { description: 'Fetches a single Azure DevOps work item by its numeric ID, returning its fields (title, state, assignee, etc.). Use to look up details of a known work item; requires the project and the numeric work item ID, not a title. Read-only and idempotent.', idempotent: true },
|
|
16
|
-
props: {
|
|
17
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
18
|
-
work_item_id: pieces_framework_1.Property.Number({
|
|
19
|
-
displayName: 'Work Item ID',
|
|
20
|
-
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.',
|
|
21
|
-
required: true,
|
|
22
|
-
}),
|
|
23
|
-
},
|
|
24
|
-
run(context) {
|
|
25
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const { project, work_item_id } = context.propsValue;
|
|
27
|
-
const auth = context.auth;
|
|
28
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
29
|
-
const response = yield common_2.azureDevOpsCommon.apiCall({
|
|
30
|
-
organizationUrl: orgUrl,
|
|
31
|
-
pat: auth.props.pat,
|
|
32
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
33
|
-
endpoint: `/${encodeURIComponent(project)}/_apis/wit/workitems/${work_item_id}`,
|
|
34
|
-
queryParams: {
|
|
35
|
-
'$expand': 'all',
|
|
36
|
-
'api-version': '7.1',
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(response);
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
//# 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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,wPAAwP,EAAE,UAAU,EAAE,IAAI,EAAE;IACvS,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;;;;;;;;;;EAuD9B,CAAC"}
|
|
@@ -1,62 +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
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: { description: 'Queries work items in an Azure DevOps project and returns their fields. Leave the WIQL query empty to list all work items ordered by most recently changed, or supply a custom WIQL query to filter (by type, state, assignee, etc.). Use to search or enumerate work items; requires a project, and results are capped by the limit (default 50, max 200). Read-only and idempotent.', idempotent: true },
|
|
17
|
-
props: {
|
|
18
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
19
|
-
wiql_query: pieces_framework_1.Property.LongText({
|
|
20
|
-
displayName: 'WIQL Query',
|
|
21
|
-
description: `The WIQL query to execute. Default: SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.ChangedDate] DESC`,
|
|
22
|
-
required: false,
|
|
23
|
-
}),
|
|
24
|
-
limit: pieces_framework_1.Property.Number({
|
|
25
|
-
displayName: 'Limit',
|
|
26
|
-
description: 'Maximum number of work items to return (default: 50, max: 200)',
|
|
27
|
-
required: false,
|
|
28
|
-
defaultValue: 50,
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
run(context) {
|
|
32
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const { project, wiql_query, limit } = context.propsValue;
|
|
34
|
-
const auth = context.auth;
|
|
35
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
36
|
-
const query = wiql_query || DEFAULT_WIQL;
|
|
37
|
-
const maxItems = Math.max(1, Math.min(limit !== null && limit !== void 0 ? limit : 50, 200));
|
|
38
|
-
const wiqlResponse = yield common_2.azureDevOpsCommon.apiCall({
|
|
39
|
-
organizationUrl: orgUrl,
|
|
40
|
-
pat: auth.props.pat,
|
|
41
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
42
|
-
endpoint: `/${encodeURIComponent(project)}/_apis/wit/wiql`,
|
|
43
|
-
queryParams: {
|
|
44
|
-
'$top': `${maxItems}`,
|
|
45
|
-
'api-version': '7.1',
|
|
46
|
-
},
|
|
47
|
-
body: { query },
|
|
48
|
-
});
|
|
49
|
-
if (!wiqlResponse.workItems || wiqlResponse.workItems.length === 0) {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
const ids = wiqlResponse.workItems.map((wi) => wi.id);
|
|
53
|
-
const workItems = yield common_2.azureDevOpsCommon.fetchWorkItemsByIds({
|
|
54
|
-
organizationUrl: orgUrl,
|
|
55
|
-
pat: auth.props.pat,
|
|
56
|
-
ids,
|
|
57
|
-
});
|
|
58
|
-
return workItems;
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
//# 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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uXAAuX,EAAE,UAAU,EAAE,IAAI,EAAE;IACta,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;YAC7E,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,MAAM,GAAG,0BAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAE5E,MAAM,KAAK,GAAG,UAAU,IAAI,YAAY,CAAC;YACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YAEzD,MAAM,YAAY,GAAG,MAAM,0BAAiB,CAAC,OAAO,CAAe;gBACjE,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,iBAAiB;gBAC1D,WAAW,EAAE;oBACX,MAAM,EAAE,GAAG,QAAQ,EAAE;oBACrB,aAAa,EAAE,KAAK;iBACrB;gBACD,IAAI,EAAE,EAAE,KAAK,EAAE;aAChB,CAAC,CAAC;YAEH,IAAI,CAAC,YAAY,CAAC,SAAS,IAAI,YAAY,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnE,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAEtD,MAAM,SAAS,GAAG,MAAM,0BAAiB,CAAC,mBAAmB,CAAC;gBAC5D,eAAe,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6G/B,CAAC"}
|
|
@@ -1,109 +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
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: { description: 'Updates fields (title, description, state, assignee, priority) on an existing Azure DevOps work item identified by its numeric ID; only the fields you provide are changed. Use to modify a known work item rather than to look it up or create one. Requires the project and numeric work item ID; the work item type prop only loads the matching state list and does not change the item type. Idempotent, since it replaces fields to a fixed target value keyed on a stable ID.', idempotent: true },
|
|
16
|
-
props: {
|
|
17
|
-
project: common_2.azureDevOpsCommon.projectDropdown,
|
|
18
|
-
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.' }),
|
|
19
|
-
work_item_id: pieces_framework_1.Property.Number({
|
|
20
|
-
displayName: 'Work Item ID',
|
|
21
|
-
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.',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
title: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Title',
|
|
26
|
-
description: 'New title for the work item',
|
|
27
|
-
required: false,
|
|
28
|
-
}),
|
|
29
|
-
description: pieces_framework_1.Property.LongText({
|
|
30
|
-
displayName: 'Description',
|
|
31
|
-
description: 'New description for the work item (supports HTML)',
|
|
32
|
-
required: false,
|
|
33
|
-
}),
|
|
34
|
-
state: common_2.azureDevOpsCommon.stateDropdown,
|
|
35
|
-
assigned_to: common_2.azureDevOpsCommon.assignedToDropdown,
|
|
36
|
-
priority: common_2.azureDevOpsCommon.priorityDropdown,
|
|
37
|
-
},
|
|
38
|
-
run(context) {
|
|
39
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const { project, work_item_id, title, description, state, assigned_to, priority } = context.propsValue;
|
|
41
|
-
const auth = context.auth;
|
|
42
|
-
const orgUrl = common_2.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
|
|
43
|
-
const encodedProject = encodeURIComponent(project);
|
|
44
|
-
const operations = [];
|
|
45
|
-
if (isNonEmptyString(title)) {
|
|
46
|
-
operations.push({
|
|
47
|
-
op: 'replace',
|
|
48
|
-
path: '/fields/System.Title',
|
|
49
|
-
value: title,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
if (isNonEmptyString(description)) {
|
|
53
|
-
operations.push({
|
|
54
|
-
op: 'replace',
|
|
55
|
-
path: '/fields/System.Description',
|
|
56
|
-
value: description,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
if (isNonEmptyString(state)) {
|
|
60
|
-
operations.push({
|
|
61
|
-
op: 'replace',
|
|
62
|
-
path: '/fields/System.State',
|
|
63
|
-
value: state,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
if (isNonEmptyString(assigned_to)) {
|
|
67
|
-
operations.push({
|
|
68
|
-
op: 'replace',
|
|
69
|
-
path: '/fields/System.AssignedTo',
|
|
70
|
-
value: assigned_to,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (priority !== undefined && priority !== null) {
|
|
74
|
-
operations.push({
|
|
75
|
-
op: 'replace',
|
|
76
|
-
path: '/fields/Microsoft.VSTS.Common.Priority',
|
|
77
|
-
value: Number(priority),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
if (operations.length === 0) {
|
|
81
|
-
const getResponse = yield common_2.azureDevOpsCommon.apiCall({
|
|
82
|
-
organizationUrl: orgUrl,
|
|
83
|
-
pat: auth.props.pat,
|
|
84
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
85
|
-
endpoint: `/${encodedProject}/_apis/wit/workitems/${work_item_id}`,
|
|
86
|
-
queryParams: {
|
|
87
|
-
'$expand': 'all',
|
|
88
|
-
'api-version': '7.1',
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(getResponse);
|
|
92
|
-
}
|
|
93
|
-
const response = yield common_2.azureDevOpsCommon.apiCall({
|
|
94
|
-
organizationUrl: orgUrl,
|
|
95
|
-
pat: auth.props.pat,
|
|
96
|
-
method: pieces_common_1.HttpMethod.PATCH,
|
|
97
|
-
endpoint: `/${encodedProject}/_apis/wit/workitems/${work_item_id}`,
|
|
98
|
-
queryParams: { 'api-version': '7.1' },
|
|
99
|
-
body: operations,
|
|
100
|
-
isJsonPatch: true,
|
|
101
|
-
});
|
|
102
|
-
return common_2.azureDevOpsCommon.flattenWorkItem(response);
|
|
103
|
-
});
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
function isNonEmptyString(value) {
|
|
107
|
-
return typeof value === 'string' && value.length > 0;
|
|
108
|
-
}
|
|
109
|
-
//# 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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sdAAsd,EAAE,UAAU,EAAE,IAAI,EAAE;IACrgB,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,0BAAiB,CAAC,kBAAkB;QACjD,QAAQ,EAAE,0BAAiB,CAAC,gBAAgB;KAC7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-
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
|