@activepieces/piece-azure-devops 0.0.1

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.
Files changed (37) hide show
  1. package/package.json +16 -0
  2. package/src/index.d.ts +5 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +42 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/add-comment.d.ts +12 -0
  7. package/src/lib/actions/add-comment.d.ts.map +1 -0
  8. package/src/lib/actions/add-comment.js +57 -0
  9. package/src/lib/actions/add-comment.js.map +1 -0
  10. package/src/lib/actions/create-work-item.d.ts +27 -0
  11. package/src/lib/actions/create-work-item.d.ts.map +1 -0
  12. package/src/lib/actions/create-work-item.js +72 -0
  13. package/src/lib/actions/create-work-item.js.map +1 -0
  14. package/src/lib/actions/get-work-item.d.ts +11 -0
  15. package/src/lib/actions/get-work-item.d.ts.map +1 -0
  16. package/src/lib/actions/get-work-item.js +41 -0
  17. package/src/lib/actions/get-work-item.js.map +1 -0
  18. package/src/lib/actions/list-work-items.d.ts +12 -0
  19. package/src/lib/actions/list-work-items.d.ts.map +1 -0
  20. package/src/lib/actions/list-work-items.js +60 -0
  21. package/src/lib/actions/list-work-items.js.map +1 -0
  22. package/src/lib/actions/update-work-item.d.ts +67 -0
  23. package/src/lib/actions/update-work-item.d.ts.map +1 -0
  24. package/src/lib/actions/update-work-item.js +107 -0
  25. package/src/lib/actions/update-work-item.js.map +1 -0
  26. package/src/lib/common/index.d.ts +210 -0
  27. package/src/lib/common/index.d.ts.map +1 -0
  28. package/src/lib/common/index.js +581 -0
  29. package/src/lib/common/index.js.map +1 -0
  30. package/src/lib/triggers/new-updated-work-item-webhook.d.ts +68 -0
  31. package/src/lib/triggers/new-updated-work-item-webhook.d.ts.map +1 -0
  32. package/src/lib/triggers/new-updated-work-item-webhook.js +167 -0
  33. package/src/lib/triggers/new-updated-work-item-webhook.js.map +1 -0
  34. package/src/lib/triggers/new-updated-work-item.d.ts +91 -0
  35. package/src/lib/triggers/new-updated-work-item.d.ts.map +1 -0
  36. package/src/lib/triggers/new-updated-work-item.js +114 -0
  37. package/src/lib/triggers/new-updated-work-item.js.map +1 -0
@@ -0,0 +1,68 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ import { AzureDevOpsHookEvent } from '../common';
3
+ export declare const newUpdatedWorkItemWebhookTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
4
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
+ }>, {
7
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
+ }>>;
11
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
12
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
15
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
16
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
17
+ }>>;
18
+ events: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<AzureDevOpsHookEvent, true>;
19
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
20
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
21
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
22
+ }>, {
23
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
24
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
25
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
26
+ }>>;
27
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
28
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
29
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
30
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
31
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
32
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
33
+ }>>;
34
+ events: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<AzureDevOpsHookEvent, true>;
35
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
36
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
37
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
38
+ }>, {
39
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
40
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
41
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
42
+ }>>;
43
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
44
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
45
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
46
+ }>> | 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
+ events: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<AzureDevOpsHookEvent, true>;
51
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
52
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
53
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
54
+ }>, {
55
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
56
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
57
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
58
+ }>>;
59
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
60
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
61
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
62
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
63
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
64
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
65
+ }>>;
66
+ events: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<AzureDevOpsHookEvent, true>;
67
+ }>;
68
+ //# sourceMappingURL=new-updated-work-item-webhook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-updated-work-item-webhook.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-updated-work-item-webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,oBAAoB,EAKrB,MAAM,WAAW,CAAC;AA2BnB,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoG3C,CAAC"}
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newUpdatedWorkItemWebhookTrigger = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const common_1 = require("../common");
7
+ const TRIGGER_STORE_KEY = 'azure_devops_workitem_subscription_ids';
8
+ const TRIGGER_TOKEN_STORE_KEY = 'azure_devops_workitem_webhook_token';
9
+ const BASIC_AUTH_USERNAME = 'activepieces';
10
+ const sampleWebhookOutput = {
11
+ id: 123,
12
+ rev: 2,
13
+ url: 'https://dev.azure.com/myorg/_apis/wit/workItems/123',
14
+ title: 'Fix login page bug',
15
+ work_item_type: 'Bug',
16
+ state: 'Active',
17
+ reason: 'New',
18
+ assigned_to: 'John Doe',
19
+ assigned_to_email: 'john.doe@example.com',
20
+ created_date: '2024-03-15T10:30:00Z',
21
+ created_by: 'Jane Smith',
22
+ changed_date: '2024-03-15T14:45:00Z',
23
+ changed_by: 'John Doe',
24
+ area_path: 'MyProject\\Backend',
25
+ iteration_path: 'MyProject\\Sprint 5',
26
+ priority: 2,
27
+ description: '<p>Users cannot log in after password reset.</p>',
28
+ project: 'MyProject',
29
+ };
30
+ exports.newUpdatedWorkItemWebhookTrigger = (0, pieces_framework_1.createTrigger)({
31
+ auth: common_1.azureDevOpsAuth,
32
+ name: 'new_updated_work_item_webhook',
33
+ displayName: 'New or Updated Work Item (Instant)',
34
+ description: 'Fires instantly when a work item is created, updated, or commented on in Azure DevOps via a Service Hooks subscription. Requires a public webhook URL reachable from Azure DevOps.',
35
+ props: {
36
+ project: common_1.azureDevOpsCommon.projectDropdown,
37
+ work_item_type: common_1.azureDevOpsCommon.workItemTypeDropdownOptional,
38
+ events: pieces_framework_1.Property.StaticMultiSelectDropdown({
39
+ displayName: 'Events',
40
+ description: 'Which work item lifecycle events should trigger this flow. Select at least one.',
41
+ required: true,
42
+ defaultValue: ['workitem.created', 'workitem.updated'],
43
+ options: {
44
+ options: [...common_1.WEBHOOK_EVENT_OPTIONS],
45
+ },
46
+ }),
47
+ },
48
+ sampleData: sampleWebhookOutput,
49
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
50
+ onEnable(context) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ var _a;
53
+ const projectName = common_1.azureDevOpsCommon.narrowString(context.propsValue.project, 'project');
54
+ const workItemType = typeof context.propsValue.work_item_type === 'string' &&
55
+ context.propsValue.work_item_type.length > 0
56
+ ? context.propsValue.work_item_type
57
+ : undefined;
58
+ const events = filterToHookEvents((_a = context.propsValue.events) !== null && _a !== void 0 ? _a : []);
59
+ const projectId = yield common_1.azureDevOpsCommon.fetchProjectId(context.auth, projectName);
60
+ if (!projectId) {
61
+ throw new Error(`Project "${projectName}" not found in Azure DevOps.`);
62
+ }
63
+ const token = common_1.azureDevOpsCommon.generateWebhookToken();
64
+ yield context.store.put(TRIGGER_TOKEN_STORE_KEY, token);
65
+ const subscriptionIds = [];
66
+ for (const event of events) {
67
+ const subscription = yield common_1.azureDevOpsCommon.createSubscription({
68
+ auth: context.auth,
69
+ projectId,
70
+ eventType: event,
71
+ webhookUrl: context.webhookUrl,
72
+ workItemType,
73
+ basicAuthUsername: BASIC_AUTH_USERNAME,
74
+ basicAuthPassword: token,
75
+ });
76
+ subscriptionIds.push(subscription.id);
77
+ yield context.store.put(TRIGGER_STORE_KEY, subscriptionIds);
78
+ }
79
+ });
80
+ },
81
+ onDisable(context) {
82
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
83
+ var _a;
84
+ const subscriptionIds = (_a = (yield context.store.get(TRIGGER_STORE_KEY))) !== null && _a !== void 0 ? _a : [];
85
+ for (const subscriptionId of subscriptionIds) {
86
+ try {
87
+ yield common_1.azureDevOpsCommon.deleteSubscription({
88
+ auth: context.auth,
89
+ subscriptionId,
90
+ });
91
+ }
92
+ catch (_b) {
93
+ // best-effort cleanup: if the user already deleted the subscription
94
+ // in Azure DevOps, the DELETE will 404 and we intentionally swallow
95
+ }
96
+ }
97
+ yield context.store.delete(TRIGGER_STORE_KEY);
98
+ yield context.store.delete(TRIGGER_TOKEN_STORE_KEY);
99
+ });
100
+ },
101
+ run(context) {
102
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
103
+ const expectedToken = yield context.store.get(TRIGGER_TOKEN_STORE_KEY);
104
+ if (!expectedToken)
105
+ return [];
106
+ const authHeader = extractAuthHeader(context.payload.headers);
107
+ if (!authHeader || !verifyBasicAuth(authHeader, BASIC_AUTH_USERNAME, expectedToken)) {
108
+ return [];
109
+ }
110
+ const payload = common_1.azureDevOpsCommon.parseWebhookPayload(context.payload.body);
111
+ if (!payload)
112
+ return [];
113
+ if (payload.eventType === 'workitem.commented') {
114
+ return [flattenCommentEvent(payload)];
115
+ }
116
+ return [flattenResource(payload.resource)];
117
+ });
118
+ },
119
+ test() {
120
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
121
+ return [sampleWebhookOutput];
122
+ });
123
+ },
124
+ });
125
+ function flattenResource(resource) {
126
+ var _a, _b, _c, _d, _e, _f;
127
+ return common_1.azureDevOpsCommon.flattenWorkItem({
128
+ id: (_b = (_a = resource.id) !== null && _a !== void 0 ? _a : resource.workItemId) !== null && _b !== void 0 ? _b : 0,
129
+ rev: (_c = resource.rev) !== null && _c !== void 0 ? _c : 0,
130
+ url: resource.url,
131
+ fields: (_f = (_e = (_d = resource.revision) === null || _d === void 0 ? void 0 : _d.fields) !== null && _e !== void 0 ? _e : resource.fields) !== null && _f !== void 0 ? _f : {},
132
+ });
133
+ }
134
+ function flattenCommentEvent(payload) {
135
+ var _a, _b, _c;
136
+ const { resource } = payload;
137
+ return Object.assign(Object.assign({}, flattenResource(resource)), { comment: (_c = (_b = (_a = resource.revision) === null || _a === void 0 ? void 0 : _a.comment) === null || _b === void 0 ? void 0 : _b.content) !== null && _c !== void 0 ? _c : null });
138
+ }
139
+ function extractAuthHeader(headers) {
140
+ var _a;
141
+ const raw = (_a = headers['authorization']) !== null && _a !== void 0 ? _a : headers['Authorization'];
142
+ return typeof raw === 'string' ? raw : null;
143
+ }
144
+ function verifyBasicAuth(header, expectedUser, expectedToken) {
145
+ const prefix = 'Basic ';
146
+ if (!header.startsWith(prefix))
147
+ return false;
148
+ let decoded;
149
+ try {
150
+ decoded = Buffer.from(header.slice(prefix.length), 'base64').toString('utf-8');
151
+ }
152
+ catch (_a) {
153
+ return false;
154
+ }
155
+ const sep = decoded.indexOf(':');
156
+ if (sep < 0)
157
+ return false;
158
+ const username = decoded.slice(0, sep);
159
+ const password = decoded.slice(sep + 1);
160
+ return (common_1.azureDevOpsCommon.timingSafeEqual(username, expectedUser) &&
161
+ common_1.azureDevOpsCommon.timingSafeEqual(password, expectedToken));
162
+ }
163
+ function filterToHookEvents(values) {
164
+ const allowed = common_1.WEBHOOK_EVENT_OPTIONS.map((o) => o.value);
165
+ return values.filter((v) => typeof v === 'string' && allowed.includes(v));
166
+ }
167
+ //# sourceMappingURL=new-updated-work-item-webhook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-updated-work-item-webhook.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-updated-work-item-webhook.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,sCAQmB;AAEnB,MAAM,iBAAiB,GAAG,wCAAwC,CAAC;AACnE,MAAM,uBAAuB,GAAG,qCAAqC,CAAC;AACtE,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAE3C,MAAM,mBAAmB,GAAiB;IACxC,EAAE,EAAE,GAAG;IACP,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,qDAAqD;IAC1D,KAAK,EAAE,oBAAoB;IAC3B,cAAc,EAAE,KAAK;IACrB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,UAAU;IACvB,iBAAiB,EAAE,sBAAsB;IACzC,YAAY,EAAE,sBAAsB;IACpC,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,sBAAsB;I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;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACxC,OAAO,CACL,0BAAiB,CAAC,eAAe,CAAC,QAAQ,EAAE,YAAY,CAAC;QACzD,0BAAiB,CAAC,eAAe,CAAC,QAAQ,EAAE,aAAa,CAAC,CAC3D,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,MAA0B;IACpD,MAAM,OAAO,GAAsB,8BAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7E,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,CAAC,EAA6B,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC/E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newUpdatedWorkItemTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {
6
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
9
+ }>>;
10
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
14
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
15
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
16
+ }>>;
17
+ state_filter: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
18
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
19
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
20
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
21
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
22
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
23
+ }>>;
24
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
25
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
26
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
27
+ }>, {
28
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
29
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
30
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
31
+ }>>;
32
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
33
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
34
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
35
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
36
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
37
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
38
+ }>>;
39
+ state_filter: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
40
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
41
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
42
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
43
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
44
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
45
+ }>>;
46
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
47
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
48
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
49
+ }>, {
50
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
51
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
52
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
53
+ }>>;
54
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
55
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
56
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
57
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
58
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
59
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
60
+ }>>;
61
+ state_filter: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
62
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
63
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
64
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
65
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
66
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
67
+ }>>;
68
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
69
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
70
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
71
+ }>, {
72
+ project: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
73
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
74
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
75
+ }>>;
76
+ work_item_type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
77
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
78
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
79
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
80
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
81
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
82
+ }>>;
83
+ state_filter: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
84
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
85
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
86
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
87
+ organizationUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
88
+ pat: import("@activepieces/pieces-framework").SecretTextProperty<true>;
89
+ }>>;
90
+ }>;
91
+ //# sourceMappingURL=new-updated-work-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-updated-work-item.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-updated-work-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AA2GxC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBpC,CAAC"}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newUpdatedWorkItemTrigger = 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 props = {
9
+ project: common_1.azureDevOpsCommon.projectDropdown,
10
+ work_item_type: common_1.azureDevOpsCommon.workItemTypeDropdownOptional,
11
+ state_filter: common_1.azureDevOpsCommon.stateDropdownOptional,
12
+ };
13
+ const POLLING_FIRST_RUN_LOOKBACK_DAYS = 14;
14
+ const polling = {
15
+ strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
16
+ items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
17
+ const orgUrl = common_1.azureDevOpsCommon.sanitizeOrgUrl(auth.props.organizationUrl);
18
+ const { project, work_item_type, state_filter } = propsValue;
19
+ const projectName = common_1.azureDevOpsCommon.narrowString(project, 'project');
20
+ const sinceEpoch = lastFetchEpochMS && lastFetchEpochMS > 0
21
+ ? lastFetchEpochMS + 1
22
+ : Date.now() - POLLING_FIRST_RUN_LOOKBACK_DAYS * 24 * 60 * 60 * 1000;
23
+ const sinceDate = new Date(sinceEpoch).toISOString().slice(0, 10);
24
+ const escapedProject = common_1.azureDevOpsCommon.escapeWiqlString(projectName);
25
+ let wiqlQuery = `SELECT [System.Id], [System.ChangedDate] FROM WorkItems ` +
26
+ `WHERE [System.TeamProject] = '${escapedProject}' ` +
27
+ `AND [System.ChangedDate] >= '${sinceDate}'`;
28
+ if (work_item_type) {
29
+ const escapedType = common_1.azureDevOpsCommon.escapeWiqlString(common_1.azureDevOpsCommon.narrowString(work_item_type, 'work_item_type'));
30
+ wiqlQuery += ` AND [System.WorkItemType] = '${escapedType}'`;
31
+ }
32
+ if (state_filter) {
33
+ const escapedState = common_1.azureDevOpsCommon.escapeWiqlString(common_1.azureDevOpsCommon.narrowString(state_filter, 'state_filter'));
34
+ wiqlQuery += ` AND [System.State] = '${escapedState}'`;
35
+ }
36
+ wiqlQuery += ' ORDER BY [System.ChangedDate] DESC';
37
+ const wiqlResponse = yield common_1.azureDevOpsCommon.apiCall({
38
+ organizationUrl: orgUrl,
39
+ pat: auth.props.pat,
40
+ method: pieces_common_1.HttpMethod.POST,
41
+ endpoint: `/${encodeURIComponent(projectName)}/_apis/wit/wiql`,
42
+ queryParams: {
43
+ '$top': '200',
44
+ 'api-version': '7.1',
45
+ },
46
+ body: { query: wiqlQuery },
47
+ });
48
+ if (!wiqlResponse.workItems || wiqlResponse.workItems.length === 0) {
49
+ return [];
50
+ }
51
+ const ids = wiqlResponse.workItems.map((wi) => wi.id);
52
+ const workItems = yield common_1.azureDevOpsCommon.fetchWorkItemsByIds({
53
+ organizationUrl: orgUrl,
54
+ pat: auth.props.pat,
55
+ ids,
56
+ });
57
+ return workItems.map((item) => ({
58
+ epochMilliSeconds: item.changed_date
59
+ ? new Date(item.changed_date).getTime()
60
+ : Date.now(),
61
+ data: item,
62
+ }));
63
+ }),
64
+ };
65
+ const sampleWorkItem = {
66
+ id: 123,
67
+ rev: 1,
68
+ url: 'https://dev.azure.com/myorg/myproject/_apis/wit/workItems/123',
69
+ title: 'Fix login page bug',
70
+ work_item_type: 'Bug',
71
+ state: 'Active',
72
+ reason: 'New',
73
+ assigned_to: 'John Doe',
74
+ assigned_to_email: 'john.doe@example.com',
75
+ created_date: '2024-03-15T10:30:00Z',
76
+ created_by: 'Jane Smith',
77
+ changed_date: '2024-03-15T14:45:00Z',
78
+ changed_by: 'John Doe',
79
+ area_path: 'MyProject\\Backend',
80
+ iteration_path: 'MyProject\\Sprint 5',
81
+ priority: 2,
82
+ description: '<p>Users cannot log in after password reset.</p>',
83
+ project: 'MyProject',
84
+ };
85
+ exports.newUpdatedWorkItemTrigger = (0, pieces_framework_1.createTrigger)({
86
+ auth: common_1.azureDevOpsAuth,
87
+ name: 'new_updated_work_item',
88
+ displayName: 'New or Updated Work Item (Polling)',
89
+ description: 'Polls Azure DevOps every few minutes and fires when a work item is created or updated. Use this when your Activepieces instance is not reachable from the public internet; otherwise prefer the Instant trigger. Pick a work item type to unlock the state filter.',
90
+ props,
91
+ sampleData: sampleWorkItem,
92
+ type: pieces_framework_1.TriggerStrategy.POLLING,
93
+ test(context) {
94
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
95
+ return yield pieces_common_1.pollingHelper.test(polling, context);
96
+ });
97
+ },
98
+ onEnable(context) {
99
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
100
+ yield pieces_common_1.pollingHelper.onEnable(polling, context);
101
+ });
102
+ },
103
+ onDisable(context) {
104
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
105
+ yield pieces_common_1.pollingHelper.onDisable(polling, context);
106
+ });
107
+ },
108
+ run(context) {
109
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
110
+ return yield pieces_common_1.pollingHelper.poll(polling, context);
111
+ });
112
+ },
113
+ });
114
+ //# sourceMappingURL=new-updated-work-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-updated-work-item.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-updated-work-item.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAAiG;AACjG,sCAMmB;AAEnB,MAAM,KAAK,GAAG;IACZ,OAAO,EAAE,0BAAiB,CAAC,eAAe;IAC1C,cAAc,EAAE,0BAAiB,CAAC,4BAA4B;IAC9D,YAAY,EAAE,0BAAiB,CAAC,qBAAqB;CACtD,CAAC;AAEF,MAAM,+BAA+B,GAAG,EAAE,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