@scopieflows/app-copper 0.1.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.
- package/README.md +7 -0
- package/package.json +28 -0
- package/src/i18n/de.json +285 -0
- package/src/i18n/es.json +285 -0
- package/src/i18n/fr.json +285 -0
- package/src/i18n/ja.json +285 -0
- package/src/i18n/nl.json +285 -0
- package/src/i18n/pt.json +285 -0
- package/src/i18n/translation.json +285 -0
- package/src/i18n/zh.json +285 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +94 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/convert-lead.d.ts +23 -0
- package/src/lib/actions/convert-lead.js +52 -0
- package/src/lib/actions/convert-lead.js.map +1 -0
- package/src/lib/actions/create-activity.d.ts +15 -0
- package/src/lib/actions/create-activity.js +108 -0
- package/src/lib/actions/create-activity.js.map +1 -0
- package/src/lib/actions/create-company.d.ts +21 -0
- package/src/lib/actions/create-company.js +103 -0
- package/src/lib/actions/create-company.js.map +1 -0
- package/src/lib/actions/create-lead.d.ts +14 -0
- package/src/lib/actions/create-lead.js +101 -0
- package/src/lib/actions/create-lead.js.map +1 -0
- package/src/lib/actions/create-opportunity.d.ts +24 -0
- package/src/lib/actions/create-opportunity.js +69 -0
- package/src/lib/actions/create-opportunity.js.map +1 -0
- package/src/lib/actions/create-person.d.ts +13 -0
- package/src/lib/actions/create-person.js +122 -0
- package/src/lib/actions/create-person.js.map +1 -0
- package/src/lib/actions/create-project.d.ts +7 -0
- package/src/lib/actions/create-project.js +35 -0
- package/src/lib/actions/create-project.js.map +1 -0
- package/src/lib/actions/create-task.d.ts +27 -0
- package/src/lib/actions/create-task.js +142 -0
- package/src/lib/actions/create-task.js.map +1 -0
- package/src/lib/actions/search-for-a-company.d.ts +40 -0
- package/src/lib/actions/search-for-a-company.js +258 -0
- package/src/lib/actions/search-for-a-company.js.map +1 -0
- package/src/lib/actions/search-for-a-lead.d.ts +52 -0
- package/src/lib/actions/search-for-a-lead.js +274 -0
- package/src/lib/actions/search-for-a-lead.js.map +1 -0
- package/src/lib/actions/search-for-a-person.d.ts +54 -0
- package/src/lib/actions/search-for-a-person.js +235 -0
- package/src/lib/actions/search-for-a-person.js.map +1 -0
- package/src/lib/actions/search-for-a-project.d.ts +24 -0
- package/src/lib/actions/search-for-a-project.js +165 -0
- package/src/lib/actions/search-for-a-project.js.map +1 -0
- package/src/lib/actions/search-for-an-activity.d.ts +22 -0
- package/src/lib/actions/search-for-an-activity.js +130 -0
- package/src/lib/actions/search-for-an-activity.js.map +1 -0
- package/src/lib/actions/search-for-an-opportunity.d.ts +74 -0
- package/src/lib/actions/search-for-an-opportunity.js +334 -0
- package/src/lib/actions/search-for-an-opportunity.js.map +1 -0
- package/src/lib/actions/update-company.d.ts +23 -0
- package/src/lib/actions/update-company.js +135 -0
- package/src/lib/actions/update-company.js.map +1 -0
- package/src/lib/actions/update-lead.d.ts +13 -0
- package/src/lib/actions/update-lead.js +136 -0
- package/src/lib/actions/update-lead.js.map +1 -0
- package/src/lib/actions/update-opportunity.d.ts +34 -0
- package/src/lib/actions/update-opportunity.js +89 -0
- package/src/lib/actions/update-opportunity.js.map +1 -0
- package/src/lib/actions/update-person.d.ts +13 -0
- package/src/lib/actions/update-person.js +155 -0
- package/src/lib/actions/update-person.js.map +1 -0
- package/src/lib/actions/update-project.d.ts +16 -0
- package/src/lib/actions/update-project.js +56 -0
- package/src/lib/actions/update-project.js.map +1 -0
- package/src/lib/common/constants.d.ts +35 -0
- package/src/lib/common/constants.js +54 -0
- package/src/lib/common/constants.js.map +1 -0
- package/src/lib/common/props.d.ts +168 -0
- package/src/lib/common/props.js +679 -0
- package/src/lib/common/props.js.map +1 -0
- package/src/lib/common/requests.d.ts +33 -0
- package/src/lib/common/requests.js +320 -0
- package/src/lib/common/requests.js.map +1 -0
- package/src/lib/triggers/new-activity.d.ts +14 -0
- package/src/lib/triggers/new-activity.js +74 -0
- package/src/lib/triggers/new-activity.js.map +1 -0
- package/src/lib/triggers/new-lead.d.ts +14 -0
- package/src/lib/triggers/new-lead.js +45 -0
- package/src/lib/triggers/new-lead.js.map +1 -0
- package/src/lib/triggers/new-person.d.ts +14 -0
- package/src/lib/triggers/new-person.js +45 -0
- package/src/lib/triggers/new-person.js.map +1 -0
- package/src/lib/triggers/new-task.d.ts +14 -0
- package/src/lib/triggers/new-task.js +45 -0
- package/src/lib/triggers/new-task.js.map +1 -0
- package/src/lib/triggers/updated-lead-status.d.ts +14 -0
- package/src/lib/triggers/updated-lead-status.js +66 -0
- package/src/lib/triggers/updated-lead-status.js.map +1 -0
- package/src/lib/triggers/updated-lead.d.ts +14 -0
- package/src/lib/triggers/updated-lead.js +45 -0
- package/src/lib/triggers/updated-lead.js.map +1 -0
- package/src/lib/triggers/updated-opportunity-stage.d.ts +14 -0
- package/src/lib/triggers/updated-opportunity-stage.js +73 -0
- package/src/lib/triggers/updated-opportunity-stage.js.map +1 -0
- package/src/lib/triggers/updated-opportunity-status.d.ts +14 -0
- package/src/lib/triggers/updated-opportunity-status.js +66 -0
- package/src/lib/triggers/updated-opportunity-status.js.map +1 -0
- package/src/lib/triggers/updated-opportunity.d.ts +14 -0
- package/src/lib/triggers/updated-opportunity.js +45 -0
- package/src/lib/triggers/updated-opportunity.js.map +1 -0
- package/src/lib/triggers/updated-project.d.ts +14 -0
- package/src/lib/triggers/updated-project.js +45 -0
- package/src/lib/triggers/updated-project.js.map +1 -0
- package/src/lib/triggers/updated-task.d.ts +14 -0
- package/src/lib/triggers/updated-task.js +45 -0
- package/src/lib/triggers/updated-task.js.map +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const searchForAPerson: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
name: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
phone_number: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
emails: import("@scopieflows/pieces-framework").ArrayProperty<false>;
|
|
8
|
+
contact_type_ids: import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
}>> | import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
12
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
14
|
+
}>>;
|
|
15
|
+
assignee_ids: import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
16
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
17
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
18
|
+
}>> | import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
19
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
20
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
21
|
+
}>>;
|
|
22
|
+
company_ids: import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
23
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
24
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
25
|
+
}>> | import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
26
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
27
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
28
|
+
}>>;
|
|
29
|
+
opportunity_ids: import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
30
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
31
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
32
|
+
}>> | import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
33
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
34
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
35
|
+
}>>;
|
|
36
|
+
city: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
37
|
+
state: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
38
|
+
postal_code: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
39
|
+
country: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
40
|
+
tags: import("@scopieflows/pieces-framework").ArrayProperty<false>;
|
|
41
|
+
socials: import("@scopieflows/pieces-framework").ArrayProperty<false>;
|
|
42
|
+
followed: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, false>;
|
|
43
|
+
age: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
44
|
+
page_size: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
45
|
+
page_number: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
46
|
+
sort_by: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, false>;
|
|
47
|
+
sort_direction: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, false>;
|
|
48
|
+
minimum_interaction_count: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
49
|
+
maximum_interaction_count: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
50
|
+
minimum_interaction_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
51
|
+
maximum_interaction_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
52
|
+
minimum_created_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
53
|
+
maximum_created_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchForAPerson = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
6
|
+
const constants_1 = require("../common/constants");
|
|
7
|
+
const props_1 = require("../common/props");
|
|
8
|
+
const requests_1 = require("../common/requests");
|
|
9
|
+
exports.searchForAPerson = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: constants_1.CopperAuth,
|
|
11
|
+
name: 'searchForAPerson',
|
|
12
|
+
displayName: 'Search for a Person',
|
|
13
|
+
description: 'Lookup a person using match criteria.',
|
|
14
|
+
props: {
|
|
15
|
+
name: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Name',
|
|
17
|
+
description: 'Full name of the People to search for.',
|
|
18
|
+
required: false,
|
|
19
|
+
}),
|
|
20
|
+
phone_number: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'Phone Number',
|
|
22
|
+
description: 'Phone Number of the People to search for.',
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
emails: pieces_framework_1.Property.Array({
|
|
26
|
+
displayName: 'Emails',
|
|
27
|
+
required: false,
|
|
28
|
+
description: 'Emails of the People to search for.',
|
|
29
|
+
defaultValue: [],
|
|
30
|
+
}),
|
|
31
|
+
contact_type_ids: (0, props_1.MultiContactTypesDropdown)({}),
|
|
32
|
+
assignee_ids: (0, props_1.multiUsersDropdown)({ refreshers: ['auth'] }),
|
|
33
|
+
company_ids: (0, props_1.multiCompanyDropdown)({ refreshers: ['auth'] }),
|
|
34
|
+
opportunity_ids: (0, props_1.multiOpportunityDropdown)({ refreshers: ['auth'] }),
|
|
35
|
+
city: pieces_framework_1.Property.ShortText({
|
|
36
|
+
displayName: 'City',
|
|
37
|
+
description: 'The city in which People must be located.',
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
state: pieces_framework_1.Property.ShortText({
|
|
41
|
+
displayName: 'State',
|
|
42
|
+
description: 'The state or province in which People must be located.',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
postal_code: pieces_framework_1.Property.ShortText({
|
|
46
|
+
displayName: 'Postal Code',
|
|
47
|
+
description: 'The postal code in which People must be located.',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
country: pieces_framework_1.Property.ShortText({
|
|
51
|
+
displayName: 'Country',
|
|
52
|
+
description: 'The two character country code where People must be located.',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
tags: pieces_framework_1.Property.Array({
|
|
56
|
+
displayName: 'Tags',
|
|
57
|
+
description: 'Filter People to those that match at least one of the tags specified.',
|
|
58
|
+
required: false,
|
|
59
|
+
defaultValue: [],
|
|
60
|
+
}),
|
|
61
|
+
socials: pieces_framework_1.Property.Array({
|
|
62
|
+
displayName: 'Socials',
|
|
63
|
+
description: 'Filter People to those that match at least one of the social accounts specified.',
|
|
64
|
+
required: false,
|
|
65
|
+
defaultValue: [],
|
|
66
|
+
}),
|
|
67
|
+
followed: pieces_framework_1.Property.StaticDropdown({
|
|
68
|
+
displayName: 'Followed',
|
|
69
|
+
description: 'Filter by followed state',
|
|
70
|
+
required: false,
|
|
71
|
+
options: {
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
label: 'followed',
|
|
75
|
+
value: '1',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: 'not followed',
|
|
79
|
+
value: '2',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
age: pieces_framework_1.Property.Number({
|
|
85
|
+
displayName: 'Age',
|
|
86
|
+
description: 'The maximum age in seconds that People must be.',
|
|
87
|
+
required: false,
|
|
88
|
+
}),
|
|
89
|
+
page_size: pieces_framework_1.Property.Number({
|
|
90
|
+
displayName: 'Page Size',
|
|
91
|
+
description: 'Default 50. Max 200.',
|
|
92
|
+
required: false,
|
|
93
|
+
defaultValue: 50,
|
|
94
|
+
}),
|
|
95
|
+
page_number: pieces_framework_1.Property.Number({
|
|
96
|
+
displayName: 'Page Number',
|
|
97
|
+
required: false,
|
|
98
|
+
defaultValue: 1,
|
|
99
|
+
}),
|
|
100
|
+
sort_by: pieces_framework_1.Property.StaticDropdown({
|
|
101
|
+
displayName: 'Sort By',
|
|
102
|
+
description: 'The field on which to sort the results',
|
|
103
|
+
required: false,
|
|
104
|
+
options: {
|
|
105
|
+
options: [
|
|
106
|
+
{
|
|
107
|
+
label: 'Name',
|
|
108
|
+
value: 'name',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: 'Title',
|
|
112
|
+
value: 'title',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: 'Email',
|
|
116
|
+
value: 'email',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: 'Phone',
|
|
120
|
+
value: 'phone',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: 'Date Modified',
|
|
124
|
+
value: 'date_modified',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: 'Date Created',
|
|
128
|
+
value: 'date_created',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: 'City',
|
|
132
|
+
value: 'city',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: 'State',
|
|
136
|
+
value: 'state',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: 'Country',
|
|
140
|
+
value: 'country',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: 'Zip',
|
|
144
|
+
value: 'zip',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: 'Socials',
|
|
148
|
+
value: 'socials',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
sort_direction: pieces_framework_1.Property.StaticDropdown({
|
|
154
|
+
displayName: 'Sort Direction',
|
|
155
|
+
description: 'The direction in which to sort the result',
|
|
156
|
+
required: false,
|
|
157
|
+
options: {
|
|
158
|
+
options: [
|
|
159
|
+
{
|
|
160
|
+
label: 'Ascending',
|
|
161
|
+
value: 'asc',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: 'Descending',
|
|
165
|
+
value: 'desc',
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
minimum_interaction_count: pieces_framework_1.Property.Number({
|
|
171
|
+
displayName: 'Minimum Interaction Count',
|
|
172
|
+
required: false,
|
|
173
|
+
description: 'The minimum number of interactions People must have had.',
|
|
174
|
+
}),
|
|
175
|
+
maximum_interaction_count: pieces_framework_1.Property.Number({
|
|
176
|
+
displayName: 'Maximum Interaction Count',
|
|
177
|
+
required: false,
|
|
178
|
+
description: 'The maximum number of interactions People must have had.',
|
|
179
|
+
}),
|
|
180
|
+
minimum_interaction_date: pieces_framework_1.Property.DateTime({
|
|
181
|
+
displayName: 'Minimum Interaction Date',
|
|
182
|
+
required: false,
|
|
183
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the earliest date of the last interaction.',
|
|
184
|
+
}),
|
|
185
|
+
maximum_interaction_date: pieces_framework_1.Property.DateTime({
|
|
186
|
+
displayName: 'Maximum Interaction Date',
|
|
187
|
+
required: false,
|
|
188
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the latest date of the last interaction.',
|
|
189
|
+
}),
|
|
190
|
+
minimum_created_date: pieces_framework_1.Property.DateTime({
|
|
191
|
+
displayName: 'Minimum Created Date',
|
|
192
|
+
required: false,
|
|
193
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the earliest date People are created.',
|
|
194
|
+
}),
|
|
195
|
+
maximum_created_date: pieces_framework_1.Property.DateTime({
|
|
196
|
+
displayName: 'Maximum Created Date',
|
|
197
|
+
required: false,
|
|
198
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the latest date People are Created.',
|
|
199
|
+
}),
|
|
200
|
+
},
|
|
201
|
+
run(context) {
|
|
202
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
const { name, phone_number, emails, contact_type_ids, assignee_ids, company_ids, opportunity_ids, city, state, postal_code, country, tags, socials, followed, age, page_size, page_number, sort_by, sort_direction, minimum_interaction_count, maximum_interaction_count, minimum_interaction_date, maximum_interaction_date, minimum_created_date, maximum_created_date, } = context.propsValue;
|
|
204
|
+
const payload = {
|
|
205
|
+
name,
|
|
206
|
+
phone_number,
|
|
207
|
+
emails,
|
|
208
|
+
contact_type_ids,
|
|
209
|
+
assignee_ids,
|
|
210
|
+
company_ids,
|
|
211
|
+
opportunity_ids,
|
|
212
|
+
city,
|
|
213
|
+
state,
|
|
214
|
+
postal_code,
|
|
215
|
+
country,
|
|
216
|
+
tags,
|
|
217
|
+
socials,
|
|
218
|
+
followed,
|
|
219
|
+
age,
|
|
220
|
+
page_size,
|
|
221
|
+
page_number,
|
|
222
|
+
sort_by,
|
|
223
|
+
sort_direction,
|
|
224
|
+
minimum_interaction_count,
|
|
225
|
+
maximum_interaction_count,
|
|
226
|
+
minimum_interaction_date: (0, constants_1.toUnix)(minimum_interaction_date),
|
|
227
|
+
maximum_interaction_date: (0, constants_1.toUnix)(maximum_interaction_date),
|
|
228
|
+
minimum_created_date: (0, constants_1.toUnix)(minimum_created_date),
|
|
229
|
+
maximum_created_date: (0, constants_1.toUnix)(maximum_created_date),
|
|
230
|
+
};
|
|
231
|
+
return yield requests_1.CopperApiService.fetchPeople(context.auth, payload);
|
|
232
|
+
});
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
//# sourceMappingURL=search-for-a-person.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-for-a-person.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/copper/src/lib/actions/search-for-a-person.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,mDAAyD;AACzD,2CAKyB;AACzB,iDAAsD;AAEzC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,sBAAU;IAChB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,uCAAuC;IACpD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACrB,WAAW,EAAE,QAAQ;YACrB,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,qCAAqC;YAClD,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,gBAAgB,EAAE,IAAA,iCAAyB,EAAC,EAAE,CAAC;QAC/C,YAAY,EAAE,IAAA,0BAAkB,EAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,WAAW,EAAE,IAAA,4BAAoB,EAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3D,eAAe,EAAE,IAAA,gCAAwB,E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AAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,EACP,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,GAAG,EACH,SAAS,EACT,WAAW,EACX,OAAO,EACP,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,GACrB,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvB,MAAM,OAAO,GAAG;gBACd,IAAI;gBACJ,YAAY;gBACZ,MAAM;gBACN,gBAAgB;gBAChB,YAAY;gBACZ,WAAW;gBACX,eAAe;gBACf,IAAI;gBACJ,KAAK;gBACL,WAAW;gBACX,OAAO;gBACP,IAAI;gBACJ,OAAO;gBACP,QAAQ;gBACR,GAAG;gBACH,SAAS;gBACT,WAAW;gBACX,OAAO;gBACP,cAAc;gBACd,yBAAyB;gBACzB,yBAAyB;gBACzB,wBAAwB,EAAE,IAAA,kBAAM,EAAC,wBAAwB,CAAC;gBAC1D,wBAAwB,EAAE,IAAA,kBAAM,EAAC,wBAAwB,CAAC;gBAC1D,oBAAoB,EAAE,IAAA,kBAAM,EAAC,oBAAoB,CAAC;gBAClD,oBAAoB,EAAE,IAAA,kBAAM,EAAC,oBAAoB,CAAC;aACnD,CAAC;YAEF,OAAO,MAAM,2BAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnE,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const searchForAProject: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
name: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
assignee_ids: import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
}>> | import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
10
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
}>>;
|
|
13
|
+
statuses: import("@scopieflows/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
|
|
14
|
+
tags: import("@scopieflows/pieces-framework").ArrayProperty<false>;
|
|
15
|
+
followed: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, false>;
|
|
16
|
+
page_size: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
17
|
+
page_number: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
18
|
+
sort_by: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, false>;
|
|
19
|
+
sort_direction: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, false>;
|
|
20
|
+
minimum_created_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
21
|
+
maximum_created_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
22
|
+
minimum_modified_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
23
|
+
maximum_modified_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchForAProject = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
6
|
+
const constants_1 = require("../common/constants");
|
|
7
|
+
const requests_1 = require("../common/requests");
|
|
8
|
+
const props_1 = require("../common/props");
|
|
9
|
+
exports.searchForAProject = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: constants_1.CopperAuth,
|
|
11
|
+
name: 'searchForAProject',
|
|
12
|
+
displayName: 'Search for a Project',
|
|
13
|
+
description: 'Lookup a project.',
|
|
14
|
+
props: {
|
|
15
|
+
name: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Name',
|
|
17
|
+
description: 'Full name of the Opportunity to search for.',
|
|
18
|
+
required: false,
|
|
19
|
+
}),
|
|
20
|
+
assignee_ids: (0, props_1.multiUsersDropdown)({ refreshers: ['auth'] }),
|
|
21
|
+
statuses: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
22
|
+
displayName: 'Status',
|
|
23
|
+
description: 'Filter by Opportunity status',
|
|
24
|
+
required: false,
|
|
25
|
+
options: {
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
label: 'Open',
|
|
29
|
+
value: 'Open',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Completed',
|
|
33
|
+
value: 'Completed',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
tags: pieces_framework_1.Property.Array({
|
|
39
|
+
displayName: 'Tags',
|
|
40
|
+
description: 'Filter People to those that match at least one of the tags specified.',
|
|
41
|
+
required: false,
|
|
42
|
+
defaultValue: [],
|
|
43
|
+
}),
|
|
44
|
+
followed: pieces_framework_1.Property.StaticDropdown({
|
|
45
|
+
displayName: 'Followed',
|
|
46
|
+
description: 'Filter by followed state',
|
|
47
|
+
required: false,
|
|
48
|
+
options: {
|
|
49
|
+
options: [
|
|
50
|
+
{
|
|
51
|
+
label: 'followed',
|
|
52
|
+
value: '1',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'not followed',
|
|
56
|
+
value: '2',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
page_size: pieces_framework_1.Property.Number({
|
|
62
|
+
displayName: 'Page Size',
|
|
63
|
+
description: 'Default 50. Max 200.',
|
|
64
|
+
required: false,
|
|
65
|
+
defaultValue: 50,
|
|
66
|
+
}),
|
|
67
|
+
page_number: pieces_framework_1.Property.Number({
|
|
68
|
+
displayName: 'Page Number',
|
|
69
|
+
required: false,
|
|
70
|
+
defaultValue: 1,
|
|
71
|
+
}),
|
|
72
|
+
sort_by: pieces_framework_1.Property.StaticDropdown({
|
|
73
|
+
displayName: 'Sort By',
|
|
74
|
+
description: 'The field on which to sort the results',
|
|
75
|
+
required: false,
|
|
76
|
+
options: {
|
|
77
|
+
options: [
|
|
78
|
+
{
|
|
79
|
+
label: 'Name',
|
|
80
|
+
value: 'name',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'Assigned To',
|
|
84
|
+
value: 'assigned_to',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'Related To',
|
|
88
|
+
value: 'related_to',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'Status',
|
|
92
|
+
value: 'status',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: 'Date Modified',
|
|
96
|
+
value: 'date_modified',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: 'Date Created',
|
|
100
|
+
value: 'date_created',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
sort_direction: pieces_framework_1.Property.StaticDropdown({
|
|
106
|
+
displayName: 'Sort Direction',
|
|
107
|
+
description: 'The direction in which to sort the result',
|
|
108
|
+
required: false,
|
|
109
|
+
options: {
|
|
110
|
+
options: [
|
|
111
|
+
{
|
|
112
|
+
label: 'Ascending',
|
|
113
|
+
value: 'asc',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'Descending',
|
|
117
|
+
value: 'desc',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
minimum_created_date: pieces_framework_1.Property.DateTime({
|
|
123
|
+
displayName: 'Minimum Created Date',
|
|
124
|
+
required: false,
|
|
125
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the earliest date Opportunity are created.',
|
|
126
|
+
}),
|
|
127
|
+
maximum_created_date: pieces_framework_1.Property.DateTime({
|
|
128
|
+
displayName: 'Maximum Created Date',
|
|
129
|
+
required: false,
|
|
130
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the latest date Opportunity are Created.',
|
|
131
|
+
}),
|
|
132
|
+
minimum_modified_date: pieces_framework_1.Property.DateTime({
|
|
133
|
+
displayName: 'Minimum Modified Date',
|
|
134
|
+
required: false,
|
|
135
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the earliest date Opportunity are Modified.',
|
|
136
|
+
}),
|
|
137
|
+
maximum_modified_date: pieces_framework_1.Property.DateTime({
|
|
138
|
+
displayName: 'Maximum Modified Date',
|
|
139
|
+
required: false,
|
|
140
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the latest date Opportunity are Modified.',
|
|
141
|
+
}),
|
|
142
|
+
},
|
|
143
|
+
run(context) {
|
|
144
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const { name, assignee_ids, statuses, tags, followed, page_size, page_number, sort_by, sort_direction, minimum_created_date, maximum_created_date, minimum_modified_date, maximum_modified_date, } = context.propsValue;
|
|
146
|
+
const payload = {
|
|
147
|
+
name,
|
|
148
|
+
assignee_ids: assignee_ids || [],
|
|
149
|
+
statuses,
|
|
150
|
+
followed,
|
|
151
|
+
page_size,
|
|
152
|
+
page_number,
|
|
153
|
+
sort_by,
|
|
154
|
+
tags,
|
|
155
|
+
sort_direction,
|
|
156
|
+
minimum_created_date: (0, constants_1.toUnix)(minimum_created_date),
|
|
157
|
+
maximum_created_date: (0, constants_1.toUnix)(maximum_created_date),
|
|
158
|
+
minimum_modified_date: (0, constants_1.toUnix)(minimum_modified_date),
|
|
159
|
+
maximum_modified_date: (0, constants_1.toUnix)(maximum_modified_date),
|
|
160
|
+
};
|
|
161
|
+
return yield requests_1.CopperApiService.fetchProjects(context.auth, payload);
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=search-for-a-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-for-a-project.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/copper/src/lib/actions/search-for-a-project.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,mDAAyD;AACzD,iDAAsD;AACtD,2CAAqD;AAExC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,sBAAU;IAChB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,IAAA,0BAAkB,EAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,QAAQ,EAAE,2BAAQ,CAAC,yBAAyB,CAAC;YAC3C,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,MAAM;qBACd;oBACD;wBACE,KAAK,EAAE,WAAW;wBAClB,KAAK,EAAE,WAAW;qBACnB;iBACF;aACF;SACF,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACnB,WAAW,EAAE,MAAM;YACn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oBAAoB,EAAE,IAAA,kBAAM,EAAC,oBAAoB,CAAC;gBAClD,oBAAoB,EAAE,IAAA,kBAAM,EAAC,oBAAoB,CAAC;gBAClD,qBAAqB,EAAE,IAAA,kBAAM,EAAC,qBAAqB,CAAC;gBACpD,qBAAqB,EAAE,IAAA,kBAAM,EAAC,qBAAqB,CAAC;aACrD,CAAC;YAEF,OAAO,MAAM,2BAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const searchForAnActivity: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
entity: import("@scopieflows/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
|
+
entityItemId: import("@scopieflows/pieces-framework").DropdownProperty<any, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
}>>;
|
|
10
|
+
activity_types: import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
11
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
}>> | import("@scopieflows/pieces-framework").MultiSelectDropdownProperty<unknown, true, import("@scopieflows/pieces-framework").CustomAuthProperty<{
|
|
14
|
+
email: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
apiKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
16
|
+
}>>;
|
|
17
|
+
page_size: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
18
|
+
page_number: import("@scopieflows/pieces-framework").NumberProperty<false>;
|
|
19
|
+
minimum_activity_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
20
|
+
maximum_activity_date: import("@scopieflows/pieces-framework").DateTimeProperty<false>;
|
|
21
|
+
full_result: import("@scopieflows/pieces-framework").CheckboxProperty<false>;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchForAnActivity = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
6
|
+
const constants_1 = require("../common/constants");
|
|
7
|
+
const props_1 = require("../common/props");
|
|
8
|
+
const requests_1 = require("../common/requests");
|
|
9
|
+
exports.searchForAnActivity = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: constants_1.CopperAuth,
|
|
11
|
+
name: 'searchForAnActivity',
|
|
12
|
+
displayName: 'Search for an Activity',
|
|
13
|
+
description: 'Find an existing activity by type/criteria.',
|
|
14
|
+
props: {
|
|
15
|
+
entity: pieces_framework_1.Property.StaticDropdown({
|
|
16
|
+
displayName: 'Parent Entity',
|
|
17
|
+
description: 'Select parent entity',
|
|
18
|
+
required: false,
|
|
19
|
+
options: {
|
|
20
|
+
options: [
|
|
21
|
+
{ label: 'Person', value: 'person' },
|
|
22
|
+
{ label: 'Company', value: 'company' },
|
|
23
|
+
{ label: 'Lead', value: 'lead' },
|
|
24
|
+
{ label: 'Opportunity', value: 'opportunity' },
|
|
25
|
+
{ label: 'Project', value: 'project' },
|
|
26
|
+
{ label: 'Task', value: 'task' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
entityItemId: pieces_framework_1.Property.Dropdown({
|
|
31
|
+
auth: constants_1.CopperAuth,
|
|
32
|
+
displayName: 'Parent Entity Resource',
|
|
33
|
+
description: 'Select Resource',
|
|
34
|
+
required: false,
|
|
35
|
+
refreshers: ['auth', 'entity'],
|
|
36
|
+
options(propsValue) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const auth = propsValue['auth'];
|
|
39
|
+
const entity = propsValue['entity'];
|
|
40
|
+
if (!auth) {
|
|
41
|
+
return {
|
|
42
|
+
disabled: true,
|
|
43
|
+
placeholder: 'Connect your Copper account first',
|
|
44
|
+
options: [],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (!entity) {
|
|
48
|
+
return {
|
|
49
|
+
disabled: true,
|
|
50
|
+
placeholder: 'Select a Parent Entity first',
|
|
51
|
+
options: [],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const fetchFnMap = {
|
|
55
|
+
person: requests_1.CopperApiService.fetchPeople,
|
|
56
|
+
company: requests_1.CopperApiService.fetchCompanies,
|
|
57
|
+
lead: requests_1.CopperApiService.fetchLeads,
|
|
58
|
+
opportunity: requests_1.CopperApiService.fetchOpportunities,
|
|
59
|
+
task: requests_1.CopperApiService.fetchTasks,
|
|
60
|
+
project: requests_1.CopperApiService.fetchProjects,
|
|
61
|
+
};
|
|
62
|
+
const fetchFn = fetchFnMap[entity];
|
|
63
|
+
try {
|
|
64
|
+
const items = yield fetchFn(auth);
|
|
65
|
+
return {
|
|
66
|
+
options: items.map((item) => ({
|
|
67
|
+
label: item.name,
|
|
68
|
+
value: item.id,
|
|
69
|
+
})),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
console.error('Failed to fetch entity items', e);
|
|
74
|
+
return {
|
|
75
|
+
options: [],
|
|
76
|
+
placeholder: 'Unable to load entity items',
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
activity_types: (0, props_1.MultiActivityTypesDropdown)({}),
|
|
83
|
+
page_size: pieces_framework_1.Property.Number({
|
|
84
|
+
displayName: 'Page Size',
|
|
85
|
+
description: 'Default 50. Max 200.',
|
|
86
|
+
required: false,
|
|
87
|
+
defaultValue: 50,
|
|
88
|
+
}),
|
|
89
|
+
page_number: pieces_framework_1.Property.Number({
|
|
90
|
+
displayName: 'Page Number',
|
|
91
|
+
required: false,
|
|
92
|
+
defaultValue: 1,
|
|
93
|
+
}),
|
|
94
|
+
minimum_activity_date: pieces_framework_1.Property.DateTime({
|
|
95
|
+
displayName: 'Minimum Activity Date',
|
|
96
|
+
required: false,
|
|
97
|
+
description: '24-hour format, e.g. 2025-09-10 11:40. The timestamp of the earliest activity date.',
|
|
98
|
+
}),
|
|
99
|
+
maximum_activity_date: pieces_framework_1.Property.DateTime({
|
|
100
|
+
displayName: 'Maximum Activity Date',
|
|
101
|
+
required: false,
|
|
102
|
+
description: '24-hour format, e.g. 2025-09-10 13:00. The timestamp of the latest activity date.',
|
|
103
|
+
}),
|
|
104
|
+
full_result: pieces_framework_1.Property.Checkbox({
|
|
105
|
+
displayName: 'Full Result',
|
|
106
|
+
description: '(Optional) If set, search performance improves but duplicate activity logs may be returned',
|
|
107
|
+
required: false,
|
|
108
|
+
defaultValue: false,
|
|
109
|
+
}),
|
|
110
|
+
},
|
|
111
|
+
run(ctx) {
|
|
112
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const { page_size, page_number, activity_types, entity, entityItemId, minimum_activity_date, maximum_activity_date, full_result, } = ctx.propsValue;
|
|
114
|
+
const parsed_activity_types = (activity_types || []).map((activity) => {
|
|
115
|
+
const parsed_activity = JSON.parse(activity);
|
|
116
|
+
return {
|
|
117
|
+
id: parsed_activity.id,
|
|
118
|
+
category: parsed_activity.category,
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
const payload = Object.assign(Object.assign({}, (entity &&
|
|
122
|
+
entityItemId && {
|
|
123
|
+
parent: { id: entityItemId, type: entity },
|
|
124
|
+
})), { activity_types: parsed_activity_types, page_number,
|
|
125
|
+
page_size, minimum_activity_date: (0, constants_1.toUnix)(minimum_activity_date), maximum_activity_date: (0, constants_1.toUnix)(maximum_activity_date), full_result });
|
|
126
|
+
return yield requests_1.CopperApiService.fetchActivities(ctx.auth, payload);
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=search-for-an-activity.js.map
|