@activepieces/piece-monday 0.3.3 → 0.3.5

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 (59) hide show
  1. package/package.json +7 -25
  2. package/src/index.js +260 -57
  3. package/README.md +0 -7
  4. package/src/index.d.ts +0 -2
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-column.d.ts +0 -6
  7. package/src/lib/actions/create-column.js +0 -42
  8. package/src/lib/actions/create-column.js.map +0 -1
  9. package/src/lib/actions/create-group.d.ts +0 -5
  10. package/src/lib/actions/create-group.js +0 -32
  11. package/src/lib/actions/create-group.js.map +0 -1
  12. package/src/lib/actions/create-item.d.ts +0 -8
  13. package/src/lib/actions/create-item.js +0 -61
  14. package/src/lib/actions/create-item.js.map +0 -1
  15. package/src/lib/actions/create-update.d.ts +0 -4
  16. package/src/lib/actions/create-update.js +0 -34
  17. package/src/lib/actions/create-update.js.map +0 -1
  18. package/src/lib/actions/get-board-values.d.ts +0 -5
  19. package/src/lib/actions/get-board-values.js +0 -43
  20. package/src/lib/actions/get-board-values.js.map +0 -1
  21. package/src/lib/actions/get-column-values.d.ts +0 -6
  22. package/src/lib/actions/get-column-values.js +0 -41
  23. package/src/lib/actions/get-column-values.js.map +0 -1
  24. package/src/lib/actions/update-column-values-of-item.d.ts +0 -6
  25. package/src/lib/actions/update-column-values-of-item.js +0 -47
  26. package/src/lib/actions/update-column-values-of-item.js.map +0 -1
  27. package/src/lib/actions/update-item-name.d.ts +0 -6
  28. package/src/lib/actions/update-item-name.js +0 -34
  29. package/src/lib/actions/update-item-name.js.map +0 -1
  30. package/src/lib/actions/upload-file-to-column.d.ts +0 -8
  31. package/src/lib/actions/upload-file-to-column.js +0 -91
  32. package/src/lib/actions/upload-file-to-column.js.map +0 -1
  33. package/src/lib/common/client.d.ts +0 -99
  34. package/src/lib/common/client.js +0 -101
  35. package/src/lib/common/client.js.map +0 -1
  36. package/src/lib/common/constants.d.ts +0 -73
  37. package/src/lib/common/constants.js +0 -133
  38. package/src/lib/common/constants.js.map +0 -1
  39. package/src/lib/common/helper.d.ts +0 -10
  40. package/src/lib/common/helper.js +0 -359
  41. package/src/lib/common/helper.js.map +0 -1
  42. package/src/lib/common/index.d.ts +0 -12
  43. package/src/lib/common/index.js +0 -213
  44. package/src/lib/common/index.js.map +0 -1
  45. package/src/lib/common/models.d.ts +0 -82
  46. package/src/lib/common/models.js +0 -3
  47. package/src/lib/common/models.js.map +0 -1
  48. package/src/lib/common/mutations.d.ts +0 -9
  49. package/src/lib/common/mutations.js +0 -85
  50. package/src/lib/common/mutations.js.map +0 -1
  51. package/src/lib/common/queries.d.ts +0 -10
  52. package/src/lib/common/queries.js +0 -162
  53. package/src/lib/common/queries.js.map +0 -1
  54. package/src/lib/triggers/new-item-in-board.d.ts +0 -14
  55. package/src/lib/triggers/new-item-in-board.js +0 -97
  56. package/src/lib/triggers/new-item-in-board.js.map +0 -1
  57. package/src/lib/triggers/specific-column-updated.d.ts +0 -18
  58. package/src/lib/triggers/specific-column-updated.js +0 -120
  59. package/src/lib/triggers/specific-column-updated.js.map +0 -1
@@ -1,82 +0,0 @@
1
- import { BoardType, MondayColumnType } from './constants';
2
- export interface MondayColumn {
3
- id: string;
4
- title: string;
5
- type: MondayColumnType;
6
- description?: string;
7
- settings_str: string;
8
- }
9
- export interface ColumnValue {
10
- id: string;
11
- value: string;
12
- text: string;
13
- type: MondayColumnType;
14
- [key: string]: any;
15
- }
16
- export type WorkspaceResponse = {
17
- data: {
18
- workspaces: Workspace[];
19
- };
20
- account_id: number;
21
- };
22
- export interface Workspace {
23
- id: string;
24
- name: string;
25
- }
26
- export interface Group {
27
- id: string;
28
- title: string;
29
- }
30
- export interface SubItem {
31
- id: string;
32
- board: Board;
33
- group: Group;
34
- subscribers: User[];
35
- name: string;
36
- email: string;
37
- created_at: string;
38
- }
39
- export interface Item {
40
- id: string;
41
- board: Board;
42
- group: Group;
43
- name: string;
44
- email: string;
45
- created_at: string;
46
- column_values: ColumnValue[];
47
- subitems: SubItem[];
48
- }
49
- export interface Board {
50
- id: string;
51
- name: string;
52
- groups: Group[];
53
- type: BoardType;
54
- items_page: {
55
- items: Item[];
56
- };
57
- }
58
- export interface Update {
59
- body: string;
60
- id: string;
61
- created_at: string;
62
- creator: {
63
- name: string;
64
- id: string;
65
- };
66
- }
67
- export interface User {
68
- id: string;
69
- name: string;
70
- email: string;
71
- created_at: string;
72
- }
73
- export type BoardResponse = {
74
- data: {
75
- boards: Board[];
76
- };
77
- account_id: number;
78
- };
79
- export interface WebhookInformation {
80
- id: string;
81
- board_id: string;
82
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/monday/src/lib/common/models.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- export declare const mondayGraphQLMutations: {
2
- createItem: string;
3
- updateItem: string;
4
- createWebhook: string;
5
- deleteWebhook: string;
6
- createColumn: string;
7
- createGroup: string;
8
- createUpdate: string;
9
- };
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mondayGraphQLMutations = void 0;
4
- exports.mondayGraphQLMutations = {
5
- createItem: `
6
- mutation createItem(
7
- $itemName: String!
8
- $boardId: ID!
9
- $groupId: String
10
- $columnValues: JSON
11
- $createLabels: Boolean
12
- ) {
13
- create_item(
14
- item_name: $itemName
15
- board_id: $boardId
16
- group_id: $groupId
17
- column_values: $columnValues
18
- create_labels_if_missing: $createLabels
19
- ) {
20
- id
21
- }
22
- }`,
23
- updateItem: `
24
- mutation updateItem($itemId: ID!, $boardId: ID!, $columnValues: JSON!) {
25
- change_multiple_column_values(
26
- item_id: $itemId
27
- board_id: $boardId
28
- column_values: $columnValues
29
- ) {
30
- id
31
- name
32
- }
33
- }`,
34
- createWebhook: `
35
- mutation createWebhook(
36
- $boardId: ID!
37
- $url: String!
38
- $event: WebhookEventType!
39
- $config: JSON
40
- ) {
41
- create_webhook(
42
- board_id: $boardId
43
- url: $url
44
- event: $event
45
- config: $config
46
- ) {
47
- id
48
- board_id
49
- }
50
- }`,
51
- deleteWebhook: `
52
- mutation deleteWebhook($webhookId: ID!) {
53
- delete_webhook(id: $webhookId) {
54
- id
55
- board_id
56
- }
57
- }`,
58
- createColumn: `
59
- mutation createColumn(
60
- $boardId: ID!
61
- $columnTitle: String!
62
- $columnType: ColumnType!
63
- ) {
64
- create_column(
65
- board_id: $boardId
66
- title: $columnTitle
67
- column_type: $columnType
68
- ) {
69
- id
70
- }
71
- }`,
72
- createGroup: `
73
- mutation createGroup($boardId: ID!, $groupName: String!) {
74
- create_group(board_id: $boardId, group_name: $groupName) {
75
- id
76
- }
77
- }`,
78
- createUpdate: `
79
- mutation createUpdate($itemId: ID!, $body: String!) {
80
- create_update(item_id: $itemId, body: $body) {
81
- id
82
- }
83
- }`,
84
- };
85
- //# sourceMappingURL=mutations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/monday/src/lib/common/mutations.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG;IACpC,UAAU,EAAE;;;;;;;;;;;;;;;;;IAiBV;IACF,UAAU,EAAE;;;;;;;;;;IAUV;IACF,aAAa,EAAE;;;;;;;;;;;;;;;;IAgBb;IACF,aAAa,EAAE;;;;;;IAMb;IACF,YAAY,EAAE;;;;;;;;;;;;;IAaZ;IACF,WAAW,EAAE;;;;;IAKX;IACF,YAAY,EAAE;;;;;IAKZ;CACH,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const mondayGraphQLQueries: {
2
- listWorkspaces: string;
3
- listWorkspaceBoards: string;
4
- listBoardGroups: string;
5
- listBoardColumns: string;
6
- listBoardItems: string;
7
- listUsers: string;
8
- getItemColumnValues: string;
9
- getBoardItemValues: string;
10
- };
@@ -1,162 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mondayGraphQLQueries = void 0;
4
- exports.mondayGraphQLQueries = {
5
- listWorkspaces: `
6
- query listWorkspaces($limit: Int)
7
- {
8
- workspaces(limit: $limit)
9
- {
10
- id
11
- name
12
- }
13
- }`,
14
- listWorkspaceBoards: `
15
- query listWorkspaceBoards($workspaceId: ID)
16
- {
17
- boards(workspace_ids: [$workspaceId], order_by: created_at)
18
- {
19
- id
20
- name
21
- type
22
- }
23
- }`,
24
- listBoardGroups: `
25
- query listGroups($boardId: ID!)
26
- {
27
- boards(ids: [$boardId])
28
- {
29
- groups{
30
- id
31
- title
32
- }
33
- }
34
- }`,
35
- listBoardColumns: `
36
- query listBoardColumns($boardId: ID!)
37
- {
38
- boards(ids: [$boardId])
39
- {
40
- columns{
41
- id
42
- title
43
- type
44
- settings_str
45
- description
46
- }
47
- }
48
- }`,
49
- listBoardItems: `
50
- query listBoardItems($boardId: ID!)
51
- {
52
- boards(ids: [$boardId])
53
- {
54
- items_page
55
- {
56
- items{
57
- id
58
- name
59
- }
60
- }
61
- }
62
- }`,
63
- listUsers: `
64
- query listUsers
65
- {
66
- users(newest_first: true)
67
- {
68
- id
69
- name
70
- email
71
- }
72
- }`,
73
- getItemColumnValues: `
74
- query getItemColumnValues($boardId: ID!,$itemId: ID!,$columnIds: [String!])
75
- {
76
- boards(ids: [$boardId])
77
- {
78
- items_page(query_params: {ids: [$itemId]})
79
- {
80
- items{
81
- id
82
- name
83
- column_values(ids: $columnIds){
84
- id
85
- type
86
- value
87
- text
88
- ... on ButtonValue{
89
- label
90
- }
91
- ... on StatusValue{
92
- label
93
- }
94
- ... on VoteValue{
95
- vote_count
96
- }
97
- ... on TagsValue{
98
- tags{
99
- name
100
- }
101
- }
102
- ... on BoardRelationValue {
103
- linked_item_ids
104
- }
105
- ... on DependencyValue {
106
- linked_item_ids
107
- }
108
- ... on WeekValue {
109
- start_date
110
- end_date
111
- }
112
- }
113
- }
114
- }
115
- }
116
- }`,
117
- getBoardItemValues: `
118
- query getItemColumnValues($boardId: ID!,$columnIds: [String!])
119
- {
120
- boards(ids: [$boardId])
121
- {
122
- items_page(query_params: {order_by: {column_id: "__last_updated__",direction: desc}})
123
- {
124
- items{
125
- id
126
- name
127
- column_values(ids: $columnIds){
128
- id
129
- type
130
- value
131
- text
132
- ... on ButtonValue{
133
- label
134
- }
135
- ... on StatusValue{
136
- label
137
- }
138
- ... on VoteValue{
139
- vote_count
140
- }
141
- ... on TagsValue{
142
- tags{
143
- name
144
- }
145
- }
146
- ... on BoardRelationValue {
147
- linked_item_ids
148
- }
149
- ... on DependencyValue {
150
- linked_item_ids
151
- }
152
- ... on WeekValue {
153
- start_date
154
- end_date
155
- }
156
- }
157
- }
158
- }
159
- }
160
- }`,
161
- };
162
- //# sourceMappingURL=queries.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/monday/src/lib/common/queries.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG;IAClC,cAAc,EAAE;;;;;;;;MAQZ;IACJ,mBAAmB,EAAE;;;;;;;;;MASjB;IACJ,eAAe,EAAE;;;;;;;;;;MAUb;IACJ,gBAAgB,EAAE;;;;;;;;;;;;;MAad;IACJ,cAAc,EAAE;;;;;;;;;;;;;MAaZ;IACJ,SAAS,EAAE;;;;;;;;;MASP;IACJ,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2CnB;IACF,kBAAkB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2ClB;CACH,CAAC"}
@@ -1,14 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newItemInBoardTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
5
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
6
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
7
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
9
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
10
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
11
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
12
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
13
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
14
- }>;
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newItemInBoardTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const common_1 = require("../common");
8
- const helper_1 = require("../common/helper");
9
- const shared_1 = require("@activepieces/shared");
10
- exports.newItemInBoardTrigger = (0, pieces_framework_1.createTrigger)({
11
- auth: __1.mondayAuth,
12
- name: 'monday_new_item_in_board',
13
- displayName: 'New Item in Board',
14
- description: 'Triggers when a new item is created in board.',
15
- props: {
16
- workspace_id: common_1.mondayCommon.workspace_id(true),
17
- board_id: common_1.mondayCommon.board_id(true),
18
- },
19
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
20
- sampleData: {
21
- event: {
22
- userId: 9603417,
23
- originalTriggerUuid: null,
24
- boardId: 1771812698,
25
- pulseId: 1772099344,
26
- pulseName: 'Create_item webhook',
27
- groupId: 'topics',
28
- groupName: 'Group Title',
29
- groupColor: '#579bfc',
30
- isTopGroup: true,
31
- columnValues: {},
32
- app: 'monday',
33
- type: 'create_pulse',
34
- triggerTime: '2021-10-11T09:07:28.210Z',
35
- subscriptionId: 73759690,
36
- triggerUuid: 'b5ed2e17c530f43668de130142445cba',
37
- },
38
- },
39
- onEnable(context) {
40
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
41
- const { board_id } = context.propsValue;
42
- const client = (0, common_1.makeClient)(context.auth);
43
- const res = yield client.createWebhook({
44
- boardId: board_id,
45
- url: context.webhookUrl,
46
- event: "create_item" /* MondayWebhookEventType.CREATE_ITEM */,
47
- });
48
- yield context.store.put('monday_new_item_trigger', res.data);
49
- });
50
- },
51
- onDisable(context) {
52
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
53
- const webhook = yield context.store.get('monday_new_item_trigger');
54
- if (webhook != null) {
55
- const client = (0, common_1.makeClient)(context.auth);
56
- yield client.deleteWebhook({ webhookId: webhook.id });
57
- }
58
- });
59
- },
60
- run(context) {
61
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
- const payload = context.payload.body;
63
- const transformedValues = {};
64
- try {
65
- const client = (0, common_1.makeClient)(context.auth);
66
- const res = yield client.getItemColumnValues({
67
- boardId: payload.event.boardId,
68
- itemId: payload.event.pulseId,
69
- });
70
- const item = res.data.boards[0].items_page.items[0];
71
- for (const column of item.column_values) {
72
- transformedValues[column.id] = (0, helper_1.parseMondayColumnValue)(column);
73
- }
74
- }
75
- catch (e) {
76
- console.error(e);
77
- }
78
- const enriched = [
79
- Object.assign(Object.assign({}, payload), { columnValues: transformedValues }),
80
- ];
81
- return enriched;
82
- });
83
- },
84
- handshakeConfiguration: {
85
- strategy: shared_1.WebhookHandshakeStrategy.BODY_PARAM_PRESENT,
86
- paramName: 'challenge',
87
- },
88
- onHandshake(context) {
89
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
90
- return {
91
- status: 200,
92
- body: { challenge: context.payload.body['challenge'] },
93
- };
94
- });
95
- },
96
- });
97
- //# sourceMappingURL=new-item-in-board.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-item-in-board.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/monday/src/lib/triggers/new-item-in-board.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,6BAAmC;AACnC,sCAAqD;AAErD,6CAA0D;AAE1D,iDAAgE;AACnD,QAAA,qBAAqB,GAAG,IAAA,gCAAa,EAAC;IACjD,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,+CAA+C;IAC5D,KAAK,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IAAY,CAAC,WAAW,CAAC,EAAE;aAChE,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const specificColumnValueUpdatedTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
5
- column_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
6
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
7
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
8
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
9
- column_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
10
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
11
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
12
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
13
- column_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
14
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
15
- workspace_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
16
- board_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
17
- column_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
18
- }>;
@@ -1,120 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.specificColumnValueUpdatedTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const common_1 = require("../common");
8
- const constants_1 = require("../common/constants");
9
- const shared_1 = require("@activepieces/shared");
10
- exports.specificColumnValueUpdatedTrigger = (0, pieces_framework_1.createTrigger)({
11
- auth: __1.mondayAuth,
12
- name: 'monday_specific_column_updated',
13
- displayName: 'Specific Column Value Updated in Board',
14
- description: 'Triggers when a specific column value is updated in board.',
15
- props: {
16
- workspace_id: common_1.mondayCommon.workspace_id(true),
17
- board_id: common_1.mondayCommon.board_id(true),
18
- column_id: pieces_framework_1.Property.Dropdown({
19
- auth: __1.mondayAuth,
20
- displayName: 'Column ID',
21
- required: true,
22
- refreshers: ['board_id'],
23
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, board_id }) {
24
- if (!auth || !board_id) {
25
- return {
26
- disabled: true,
27
- placeholder: 'connect your account first and select workspace board.',
28
- options: [],
29
- };
30
- }
31
- const client = (0, common_1.makeClient)(auth);
32
- const res = yield client.listBoardColumns({
33
- boardId: board_id,
34
- });
35
- return {
36
- disabled: false,
37
- options: res.data.boards[0].columns
38
- .filter((column) => !constants_1.MondayNotWritableColumnType.includes(column.type))
39
- .map((column) => {
40
- return {
41
- label: column.title,
42
- value: column.id,
43
- };
44
- }),
45
- };
46
- }),
47
- }),
48
- },
49
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
50
- sampleData: {
51
- event: {
52
- app: 'monday',
53
- type: 'update_column_value',
54
- triggerTime: '2024-01-08T04:41:55.245Z',
55
- subscriptionId: 3209024,
56
- userId: 53812737,
57
- originalTriggerUuid: null,
58
- boardId: 1835745535,
59
- groupId: 'topics',
60
- pulseId: 1835700420,
61
- pulseName: 'Sample Item',
62
- columnId: 'country',
63
- columnType: 'country',
64
- columnTitle: 'Country',
65
- value: {
66
- countryCode: 'AW',
67
- countryName: 'Aruba',
68
- changed_at: '2024-01-08T04:42:00.109Z',
69
- },
70
- previousValue: {
71
- changed_at: '2024-01-08T04:41:39.461Z',
72
- countryCode: 'IO',
73
- countryName: 'British Indian Ocean Territory',
74
- },
75
- changedAt: 1704688953.239433,
76
- isTopGroup: true,
77
- triggerUuid: '72a1ec82ea678e03b55b050711b71e9d',
78
- },
79
- },
80
- onEnable(context) {
81
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
- const { board_id, column_id } = context.propsValue;
83
- const client = (0, common_1.makeClient)(context.auth);
84
- const res = yield client.createWebhook({
85
- boardId: board_id,
86
- url: context.webhookUrl,
87
- event: "change_specific_column_value" /* MondayWebhookEventType.CHANGE_SPECIFIC_COLUMN_VALUE */,
88
- config: JSON.stringify({ columnId: column_id }),
89
- });
90
- yield context.store.put('monday_specific_column_updated', res.data);
91
- });
92
- },
93
- onDisable(context) {
94
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
95
- const webhook = yield context.store.get('monday_specific_column_updated');
96
- if (webhook != null) {
97
- const client = (0, common_1.makeClient)(context.auth);
98
- yield client.deleteWebhook({ webhookId: webhook.id });
99
- }
100
- });
101
- },
102
- run(context) {
103
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
104
- return [context.payload.body];
105
- });
106
- },
107
- handshakeConfiguration: {
108
- strategy: shared_1.WebhookHandshakeStrategy.BODY_PARAM_PRESENT,
109
- paramName: 'challenge',
110
- },
111
- onHandshake(context) {
112
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
- return {
114
- status: 200,
115
- body: { challenge: context.payload.body['challenge'] },
116
- };
117
- });
118
- },
119
- });
120
- //# sourceMappingURL=specific-column-updated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specific-column-updated.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/monday/src/lib/triggers/specific-column-updated.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,6BAAmC;AACnC,sCAAqD;AACrD,mDAG6B;AAE7B,iDAAgE;AACnD,QAAA,iCAAiC,GAAG,IAAA,gCAAa,EAAC;IAC7D,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,wCAAwC;IACrD,WAAW,EAAE,4DAA4D;IACzE,KAAK,EAAE;QACL,YAAY,EAAE,qBAAY,CAAC,YAAY,CAAC,IAAI,CAAC;QAC7C,QAAQ,EAAE,qBAAY,CAAC,QAAQ,CAAC,IAAI,CAAC;QACrC,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,IAAI,EAAE,cAAU;YAChB,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,CAAC,UAAU,CAAC;YACxB,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