@pipedream/connectwise_psa 0.0.1 → 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 ADDED
@@ -0,0 +1,11 @@
1
+ # Overview
2
+
3
+ ConnectWise PSA (Professional Services Automation) API offers a powerful avenue for managing business processes related to technology services. By integrating with ConnectWise PSA via Pipedream, developers can automate complex workflows, synchronize data across various platforms, and enhance operational efficiencies. This API allows for control over modules like service tickets, project management, and account management, essentially streamlining operations and making data management more effective.
4
+
5
+ # Example Use Cases
6
+
7
+ - **Ticket Management Automation**: Automatically create or update tickets in ConnectWise PSA whenever specific triggers occur in other apps, such as receiving a high-priority email in Gmail or a new form entry in Typeform. This workflow can help in ensuring rapid response times and better issue tracking.
8
+
9
+ - **Client Onboarding**: Streamline the onboarding process for new clients by using ConnectWise PSA to manage project setups, configurations, and initial assessments whenever a new client is added in CRM platforms like Salesforce. Automate task creation and assignment to ensure every client setup is thorough and consistent.
10
+
11
+ - **Invoice and Payment Sync**: Sync invoices and payments between ConnectWise PSA and accounting software like QuickBooks. Automate the process of updating financial records whenever a new invoice is created or a payment is received in ConnectWise, ensuring that your financial data remains accurate and up to date.
@@ -0,0 +1,142 @@
1
+ import connectwise from "../../connectwise_psa.app.mjs";
2
+
3
+ export default {
4
+ key: "connectwise_psa-create-company",
5
+ name: "Create Company",
6
+ description: "Creates a new company in Connectwise. [See the documentation](https://developer.connectwise.com/Products/ConnectWise_PSA/REST#/Companies/postCompanyCompanies)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ connectwise,
11
+ name: {
12
+ type: "string",
13
+ label: "Company Name",
14
+ description: "The name of the new company",
15
+ },
16
+ identifier: {
17
+ type: "string",
18
+ label: "Identifier",
19
+ description: "A unique identifier for the company",
20
+ },
21
+ types: {
22
+ propDefinition: [
23
+ connectwise,
24
+ "companyTypes",
25
+ ],
26
+ },
27
+ status: {
28
+ propDefinition: [
29
+ connectwise,
30
+ "status",
31
+ ],
32
+ },
33
+ site: {
34
+ type: "string",
35
+ label: "Site Name",
36
+ description: "The site name for the company",
37
+ },
38
+ address1: {
39
+ type: "string",
40
+ label: "Address Line 1",
41
+ description: "First line of the company's address",
42
+ optional: true,
43
+ },
44
+ address2: {
45
+ type: "string",
46
+ label: "Address Line 2",
47
+ description: "Second line of the company's address",
48
+ optional: true,
49
+ },
50
+ city: {
51
+ type: "string",
52
+ label: "City",
53
+ description: "City of the company",
54
+ optional: true,
55
+ },
56
+ state: {
57
+ type: "string",
58
+ label: "State",
59
+ description: "State of the company",
60
+ optional: true,
61
+ },
62
+ zip: {
63
+ type: "string",
64
+ label: "Zip",
65
+ description: "Zip code of the company",
66
+ optional: true,
67
+ },
68
+ country: {
69
+ propDefinition: [
70
+ connectwise,
71
+ "country",
72
+ ],
73
+ },
74
+ phone: {
75
+ type: "string",
76
+ label: "Phone",
77
+ description: "Phone number of the company",
78
+ optional: true,
79
+ },
80
+ website: {
81
+ type: "string",
82
+ label: "Website",
83
+ description: "Website of the company",
84
+ optional: true,
85
+ },
86
+ market: {
87
+ propDefinition: [
88
+ connectwise,
89
+ "market",
90
+ ],
91
+ },
92
+ territory: {
93
+ propDefinition: [
94
+ connectwise,
95
+ "territory",
96
+ ],
97
+ },
98
+ },
99
+ async run({ $ }) {
100
+ const types = this.types.map((type) => ({
101
+ id: type,
102
+ }));
103
+ const response = await this.connectwise.createCompany({
104
+ $,
105
+ data: {
106
+ name: this.name,
107
+ identifier: this.identifier,
108
+ types,
109
+ status: {
110
+ id: this.status,
111
+ },
112
+ site: {
113
+ name: this.site,
114
+ },
115
+ addressLine1: this.address1,
116
+ addressLine2: this.address2,
117
+ city: this.city,
118
+ state: this.state,
119
+ zip: this.zip,
120
+ country: this.country
121
+ ? {
122
+ id: this.country,
123
+ }
124
+ : undefined,
125
+ phoneNumber: this.phone,
126
+ website: this.website,
127
+ market: this.market
128
+ ? {
129
+ id: this.market,
130
+ }
131
+ : undefined,
132
+ territory: this.territory
133
+ ? {
134
+ id: this.territory,
135
+ }
136
+ : undefined,
137
+ },
138
+ });
139
+ $.export("$summary", `Successfully created company with ID: ${response.id}`);
140
+ return response;
141
+ },
142
+ };
@@ -0,0 +1,153 @@
1
+ import connectwise from "../../connectwise_psa.app.mjs";
2
+
3
+ export default {
4
+ key: "connectwise_psa-create-contact",
5
+ name: "Create Contact",
6
+ description: "Creates a new contact in Connectwise. [See the documentation](https://developer.connectwise.com/Products/ConnectWise_PSA/REST#/Contacts/postCompanyContacts)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ connectwise,
11
+ firstName: {
12
+ type: "string",
13
+ label: "First Name",
14
+ description: "First name of the contact",
15
+ },
16
+ lastName: {
17
+ type: "string",
18
+ label: "Last Name",
19
+ description: "Last name of the contact",
20
+ },
21
+ email: {
22
+ type: "string",
23
+ label: "Email",
24
+ description: "Email address of the contact",
25
+ optional: true,
26
+ },
27
+ types: {
28
+ propDefinition: [
29
+ connectwise,
30
+ "contactTypes",
31
+ ],
32
+ },
33
+ company: {
34
+ propDefinition: [
35
+ connectwise,
36
+ "company",
37
+ ],
38
+ optional: true,
39
+ },
40
+ relationship: {
41
+ propDefinition: [
42
+ connectwise,
43
+ "relationship",
44
+ ],
45
+ },
46
+ department: {
47
+ propDefinition: [
48
+ connectwise,
49
+ "department",
50
+ ],
51
+ },
52
+ phone: {
53
+ type: "string",
54
+ label: "Phone",
55
+ description: "Phone number of the contact",
56
+ optional: true,
57
+ },
58
+ address1: {
59
+ type: "string",
60
+ label: "Address Line 1",
61
+ description: "First line of the contact's address",
62
+ optional: true,
63
+ },
64
+ address2: {
65
+ type: "string",
66
+ label: "Address Line 2",
67
+ description: "Second line of the contact's address",
68
+ optional: true,
69
+ },
70
+ city: {
71
+ type: "string",
72
+ label: "City",
73
+ description: "City of the contact",
74
+ optional: true,
75
+ },
76
+ state: {
77
+ type: "string",
78
+ label: "State",
79
+ description: "State of the contact",
80
+ optional: true,
81
+ },
82
+ zip: {
83
+ type: "string",
84
+ label: "Zip",
85
+ description: "Zip code of the contact",
86
+ optional: true,
87
+ },
88
+ country: {
89
+ propDefinition: [
90
+ connectwise,
91
+ "country",
92
+ ],
93
+ },
94
+ },
95
+ async run({ $ }) {
96
+ const communicationItems = [];
97
+ if (this.email) {
98
+ communicationItems.push({
99
+ value: this.email,
100
+ type: {
101
+ id: 1, // email
102
+ },
103
+ });
104
+ }
105
+ if (this.phone) {
106
+ communicationItems.push({
107
+ value: this.phone,
108
+ type: {
109
+ id: 2, // phone
110
+ },
111
+ });
112
+ }
113
+ const types = this.types.map((type) => ({
114
+ id: type,
115
+ }));
116
+ const response = await this.connectwise.createContact({
117
+ $,
118
+ data: {
119
+ firstName: this.firstName,
120
+ lastName: this.lastName,
121
+ addressLine1: this.address1,
122
+ addressLine2: this.address2,
123
+ city: this.city,
124
+ state: this.state,
125
+ zip: this.zip,
126
+ country: this.country
127
+ ? {
128
+ id: this.country,
129
+ }
130
+ : undefined,
131
+ communicationItems,
132
+ types,
133
+ company: this.company
134
+ ? {
135
+ id: this.company,
136
+ }
137
+ : undefined,
138
+ relationship: this.relationship
139
+ ? {
140
+ id: this.relationship,
141
+ }
142
+ : undefined,
143
+ department: this.department
144
+ ? {
145
+ id: this.department,
146
+ }
147
+ : undefined,
148
+ },
149
+ });
150
+ $.export("$summary", `Successfully created contact with ID: ${response.id}`);
151
+ return response;
152
+ },
153
+ };
@@ -0,0 +1,58 @@
1
+ import connectwise from "../../connectwise_psa.app.mjs";
2
+
3
+ export default {
4
+ key: "connectwise_psa-create-ticket",
5
+ name: "Create Ticket",
6
+ description: "Creates a new ticket in Connectwise. [See the documentation](https://developer.connectwise.com/Products/ConnectWise_PSA/REST#/Tickets/postServiceTickets)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ connectwise,
11
+ summary: {
12
+ type: "string",
13
+ label: "Summary",
14
+ description: "The subject line or description line for the ticket",
15
+ },
16
+ company: {
17
+ propDefinition: [
18
+ connectwise,
19
+ "company",
20
+ ],
21
+ },
22
+ contact: {
23
+ propDefinition: [
24
+ connectwise,
25
+ "contact",
26
+ ],
27
+ },
28
+ priority: {
29
+ propDefinition: [
30
+ connectwise,
31
+ "priority",
32
+ ],
33
+ },
34
+ },
35
+ async run({ $ }) {
36
+ const response = await this.connectwise.createTicket({
37
+ $,
38
+ data: {
39
+ summary: this.summary,
40
+ company: {
41
+ id: this.company,
42
+ },
43
+ contact: this.contact
44
+ ? {
45
+ id: this.contact,
46
+ }
47
+ : undefined,
48
+ priority: this.priority
49
+ ? {
50
+ id: this.priority,
51
+ }
52
+ : undefined,
53
+ },
54
+ });
55
+ $.export("$summary", `Successfully created ticket with ID: ${response.id}`);
56
+ return response;
57
+ },
58
+ };
@@ -1,11 +1,364 @@
1
+ import { axios } from "@pipedream/platform";
2
+
1
3
  export default {
2
4
  type: "app",
3
5
  app: "connectwise_psa",
4
- propDefinitions: {},
6
+ propDefinitions: {
7
+ company: {
8
+ type: "integer",
9
+ label: "Company",
10
+ description: "The identifier of a company",
11
+ async options({ page }) {
12
+ const companies = await this.listCompanies({
13
+ params: {
14
+ page: page + 1,
15
+ },
16
+ });
17
+ return companies?.map(({
18
+ id: value, name: label,
19
+ }) => ({
20
+ value,
21
+ label,
22
+ })) || [];
23
+ },
24
+ },
25
+ contact: {
26
+ type: "integer",
27
+ label: "Contact",
28
+ description: "The identifier of a contact",
29
+ async options({ page }) {
30
+ const contacts = await this.listContacts({
31
+ params: {
32
+ page: page + 1,
33
+ },
34
+ });
35
+ return contacts?.map(({
36
+ id: value, firstName, lastName,
37
+ }) => ({
38
+ value,
39
+ label: `${firstName} ${lastName}`,
40
+ })) || [];
41
+ },
42
+ },
43
+ companyTypes: {
44
+ type: "integer[]",
45
+ label: "Types",
46
+ description: "Select one or more company types",
47
+ async options({ page }) {
48
+ const types = await this.listCompanyTypes({
49
+ params: {
50
+ page: page + 1,
51
+ },
52
+ });
53
+ return types?.map(({
54
+ id: value, name: label,
55
+ }) => ({
56
+ value,
57
+ label,
58
+ })) || [];
59
+ },
60
+ },
61
+ contactTypes: {
62
+ type: "integer[]",
63
+ label: "Types",
64
+ description: "Select one or more contact types",
65
+ async options({ page }) {
66
+ const types = await this.listContactTypes({
67
+ params: {
68
+ page: page + 1,
69
+ },
70
+ });
71
+ return types?.map(({
72
+ id: value, description: label,
73
+ }) => ({
74
+ value,
75
+ label,
76
+ })) || [];
77
+ },
78
+ },
79
+ status: {
80
+ type: "integer",
81
+ label: "Status",
82
+ description: "The status of the company",
83
+ async options({ page }) {
84
+ const statuses = await this.listCompanyStatuses({
85
+ params: {
86
+ page: page + 1,
87
+ },
88
+ });
89
+ return statuses?.map(({
90
+ id: value, name: label,
91
+ }) => ({
92
+ value,
93
+ label,
94
+ })) || [];
95
+ },
96
+ },
97
+ territory: {
98
+ type: "integer",
99
+ label: "Territory",
100
+ description: "The territory location the company",
101
+ optional: true,
102
+ async options({ page }) {
103
+ const territories = await this.listLocations({
104
+ params: {
105
+ page: page + 1,
106
+ },
107
+ });
108
+ return territories?.map(({
109
+ id: value, name: label,
110
+ }) => ({
111
+ value,
112
+ label,
113
+ })) || [];
114
+ },
115
+ },
116
+ market: {
117
+ type: "integer",
118
+ label: "Market",
119
+ description: "The market of the company",
120
+ optional: true,
121
+ async options({ page }) {
122
+ const markets = await this.listMarkets({
123
+ params: {
124
+ page: page + 1,
125
+ },
126
+ });
127
+ return markets?.map(({
128
+ id: value, name: label,
129
+ }) => ({
130
+ value,
131
+ label,
132
+ })) || [];
133
+ },
134
+ },
135
+ relationship: {
136
+ type: "integer",
137
+ label: "Relationship",
138
+ description: "The relationship of the contact",
139
+ optional: true,
140
+ async options({ page }) {
141
+ const relationships = await this.listRelationships({
142
+ params: {
143
+ page: page + 1,
144
+ },
145
+ });
146
+ return relationships?.map(({
147
+ id: value, name: label,
148
+ }) => ({
149
+ value,
150
+ label,
151
+ })) || [];
152
+ },
153
+ },
154
+ department: {
155
+ type: "integer",
156
+ label: "Department",
157
+ description: "The department of the contact",
158
+ optional: true,
159
+ async options({ page }) {
160
+ const departments = await this.listDepartments({
161
+ params: {
162
+ page: page + 1,
163
+ },
164
+ });
165
+ return departments?.map(({
166
+ id: value, name: label,
167
+ }) => ({
168
+ value,
169
+ label,
170
+ })) || [];
171
+ },
172
+ },
173
+ country: {
174
+ type: "integer",
175
+ label: "Country",
176
+ description: "The identifier of a country",
177
+ optional: true,
178
+ async options({ page }) {
179
+ const countries = await this.listCountries({
180
+ params: {
181
+ page: page + 1,
182
+ },
183
+ });
184
+ return countries?.map(({
185
+ id: value, name: label,
186
+ }) => ({
187
+ value,
188
+ label,
189
+ })) || [];
190
+ },
191
+ },
192
+ priority: {
193
+ type: "integer",
194
+ label: "Priority",
195
+ description: "The priority of the ticket",
196
+ optional: true,
197
+ async options({ page }) {
198
+ const priorities = await this.listPriorities({
199
+ params: {
200
+ page: page + 1,
201
+ },
202
+ });
203
+ return priorities?.map(({
204
+ id: value, name: label,
205
+ }) => ({
206
+ value,
207
+ label,
208
+ })) || [];
209
+ },
210
+ },
211
+ },
5
212
  methods: {
6
- // this.$auth contains connected account data
7
- authKeys() {
8
- console.log(Object.keys(this.$auth));
213
+ _baseUrl() {
214
+ return `https://${this.$auth.environment}/v4_6_release/apis/3.0`;
215
+ },
216
+ _headers() {
217
+ return {
218
+ clientId: this.$auth.client_id,
219
+ };
220
+ },
221
+ _auth() {
222
+ return {
223
+ username: `${this.$auth.company_id}+${this.$auth.public_key}`,
224
+ password: `${this.$auth.private_key}`,
225
+ };
226
+ },
227
+ _makeRequest({
228
+ $ = this,
229
+ path,
230
+ ...opts
231
+ }) {
232
+ return axios($, {
233
+ url: `${this._baseUrl()}${path}`,
234
+ headers: this._headers(),
235
+ auth: this._auth(),
236
+ ...opts,
237
+ });
238
+ },
239
+ listCompanies(opts = {}) {
240
+ return this._makeRequest({
241
+ path: "/company/companies",
242
+ ...opts,
243
+ });
244
+ },
245
+ listContacts(opts = {}) {
246
+ return this._makeRequest({
247
+ path: "/company/contacts",
248
+ ...opts,
249
+ });
250
+ },
251
+ listProjects(opts = {}) {
252
+ return this._makeRequest({
253
+ path: "/project/projects",
254
+ ...opts,
255
+ });
256
+ },
257
+ listTickets(opts = {}) {
258
+ return this._makeRequest({
259
+ path: "/service/tickets",
260
+ ...opts,
261
+ });
262
+ },
263
+ listCompanyTypes(opts = {}) {
264
+ return this._makeRequest({
265
+ path: "/company/companies/types",
266
+ ...opts,
267
+ });
268
+ },
269
+ listContactTypes(opts = {}) {
270
+ return this._makeRequest({
271
+ path: "/company/contacts/types",
272
+ ...opts,
273
+ });
274
+ },
275
+ listCompanyStatuses(opts = {}) {
276
+ return this._makeRequest({
277
+ path: "/company/companies/statuses",
278
+ ...opts,
279
+ });
280
+ },
281
+ listLocations(opts = {}) {
282
+ return this._makeRequest({
283
+ path: "/system/locations",
284
+ ...opts,
285
+ });
286
+ },
287
+ listMarkets(opts = {}) {
288
+ return this._makeRequest({
289
+ path: "/company/marketDescriptions",
290
+ ...opts,
291
+ });
292
+ },
293
+ listRelationships(opts = {}) {
294
+ return this._makeRequest({
295
+ path: "/company/contacts/relationships",
296
+ ...opts,
297
+ });
298
+ },
299
+ listDepartments(opts = {}) {
300
+ return this._makeRequest({
301
+ path: "/company/contacts/departments",
302
+ ...opts,
303
+ });
304
+ },
305
+ listPriorities(opts = {}) {
306
+ return this._makeRequest({
307
+ path: "/service/priorities",
308
+ ...opts,
309
+ });
310
+ },
311
+ listCountries(opts = {}) {
312
+ return this._makeRequest({
313
+ path: "/company/countries",
314
+ ...opts,
315
+ });
316
+ },
317
+ createContact(opts = {}) {
318
+ return this._makeRequest({
319
+ method: "POST",
320
+ path: "/company/contacts",
321
+ ...opts,
322
+ });
323
+ },
324
+ createCompany(opts = {}) {
325
+ return this._makeRequest({
326
+ method: "POST",
327
+ path: "/company/companies",
328
+ ...opts,
329
+ });
330
+ },
331
+ createTicket(opts = {}) {
332
+ return this._makeRequest({
333
+ method: "POST",
334
+ path: "/service/tickets",
335
+ ...opts,
336
+ });
337
+ },
338
+ async *paginate({
339
+ resourceFn,
340
+ params,
341
+ max,
342
+ }) {
343
+ params = {
344
+ ...params,
345
+ page: 1,
346
+ };
347
+ let hasMore, count = 0;
348
+ do {
349
+ const items = await resourceFn({
350
+ params,
351
+ });
352
+ for (const item of items) {
353
+ yield item;
354
+ count++;
355
+ if (max && count >= max) {
356
+ return;
357
+ }
358
+ }
359
+ hasMore = items.length;
360
+ params.page++;
361
+ } while (hasMore);
9
362
  },
10
363
  },
11
- };
364
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/connectwise_psa",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "Pipedream Connectwise PSA Components",
5
5
  "main": "connectwise_psa.app.mjs",
6
6
  "keywords": [
@@ -11,5 +11,8 @@
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@pipedream/platform": "^2.0.0"
14
17
  }
15
18
  }
@@ -0,0 +1,70 @@
1
+ import connectwise from "../../connectwise_psa.app.mjs";
2
+ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
3
+
4
+ export default {
5
+ props: {
6
+ connectwise,
7
+ db: "$.service.db",
8
+ timer: {
9
+ type: "$.interface.timer",
10
+ default: {
11
+ intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
12
+ },
13
+ },
14
+ },
15
+ hooks: {
16
+ async deploy() {
17
+ await this.processEvent(25);
18
+ },
19
+ },
20
+ methods: {
21
+ _getLastId() {
22
+ return this.db.get("lastId") || 0;
23
+ },
24
+ _setLastId(lastId) {
25
+ this.db.set("lastId", lastId);
26
+ },
27
+ getParams() {
28
+ return {};
29
+ },
30
+ generateMeta(item) {
31
+ return {
32
+ id: item.id,
33
+ summary: this.getSummary(item),
34
+ ts: Date.now(),
35
+ };
36
+ },
37
+ async processEvent(max) {
38
+ const lastId = this._getLastId();
39
+ const resourceFn = this.getResourceFn();
40
+ const params = this.getParams();
41
+ const results = this.connectwise.paginate({
42
+ resourceFn,
43
+ params,
44
+ });
45
+ let items = [];
46
+ for await (const item of results) {
47
+ if (item.id > lastId) {
48
+ items.push(item);
49
+ }
50
+ }
51
+ if (!items.length) {
52
+ return;
53
+ }
54
+ if (max) {
55
+ items = items.slice(-1 * max);
56
+ }
57
+ this._setLastId(items[items.length - 1].id);
58
+ items.forEach((item) => this.$emit(item, this.generateMeta(item)));
59
+ },
60
+ getResourceFn() {
61
+ throw new Error("getResourceFn is not implemented");
62
+ },
63
+ getSummary() {
64
+ throw new Error("getSummary is not implemented");
65
+ },
66
+ },
67
+ async run() {
68
+ await this.processEvent();
69
+ },
70
+ };
@@ -0,0 +1,22 @@
1
+ import common from "../common/base.mjs";
2
+ import sampleEmit from "./test-event.mjs";
3
+
4
+ export default {
5
+ ...common,
6
+ key: "connectwise_psa-new-contact-created",
7
+ name: "New Contact Created",
8
+ description: "Emit new event when a new contact is created in Connectwise.",
9
+ version: "0.0.1",
10
+ type: "source",
11
+ dedupe: "unique",
12
+ methods: {
13
+ ...common.methods,
14
+ getResourceFn() {
15
+ return this.connectwise.listContacts;
16
+ },
17
+ getSummary(item) {
18
+ return `New Contact Created: ${item.firstName} ${item.lastName}`;
19
+ },
20
+ },
21
+ sampleEmit,
22
+ };
@@ -0,0 +1,63 @@
1
+ export default {
2
+ "id": 179,
3
+ "firstName": "Mike",
4
+ "lastName": "Evans",
5
+ "company": {
6
+ "id": 132,
7
+ "identifier": "EarthTrisolarisOrganization",
8
+ "name": "Earth-Trisolaris Organization",
9
+ "_info": {
10
+ "company_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/companies/132",
11
+ "mobileGuid": "74e4f32b-ebda-40d4-b25f-231d97e9dd28"
12
+ }
13
+ },
14
+ "site": {
15
+ "id": 136,
16
+ "name": "Earth",
17
+ "_info": {
18
+ "site_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/companies/132/sites/136",
19
+ "mobileGuid": "77d95c91-bc33-4931-940a-22295abf42e3"
20
+ }
21
+ },
22
+ "inactiveFlag": false,
23
+ "marriedFlag": false,
24
+ "childrenFlag": false,
25
+ "portalSecurityLevel": 1,
26
+ "disablePortalLoginFlag": true,
27
+ "unsubscribeFlag": false,
28
+ "mobileGuid": "8d6a547e-6a2e-43aa-9670-9907376e4f4f",
29
+ "defaultBillingFlag": false,
30
+ "defaultFlag": false,
31
+ "companyLocation": {
32
+ "id": 39,
33
+ "name": "My Accounts",
34
+ "_info": {
35
+ "location_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/locations/39"
36
+ }
37
+ },
38
+ "types": [
39
+ {
40
+ "id": 11,
41
+ "name": "No Longer Employed",
42
+ "_info": {
43
+ "type_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/types/11"
44
+ }
45
+ }
46
+ ],
47
+ "ignoreDuplicates": false,
48
+ "_info": {
49
+ "lastUpdated": "2024-05-31T18:18:16Z",
50
+ "updatedBy": "Admin1",
51
+ "communications_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/179/communications",
52
+ "notes_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/179/notes",
53
+ "tracks_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/179/tracks",
54
+ "portalSecurity_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/179/portalSecurity",
55
+ "activities_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//sales/activities?conditions=contact/id=179",
56
+ "documents_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/documents?recordType=Contact&recordId=179",
57
+ "configurations_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/configurations?conditions=contact/id=179",
58
+ "tickets_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/tickets?conditions=contact/id=179",
59
+ "opportunities_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//sales/opportunities?conditions=contact/id=179",
60
+ "projects_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//project/projects?conditions=contact/id=179",
61
+ "image_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/179/image?lastModified=2024-05-31T18:18:16Z"
62
+ }
63
+ }
@@ -0,0 +1,22 @@
1
+ import common from "../common/base.mjs";
2
+ import sampleEmit from "./test-event.mjs";
3
+
4
+ export default {
5
+ ...common,
6
+ key: "connectwise_psa-new-project-created",
7
+ name: "New Project Created",
8
+ description: "Emit new event when a new project is created in Connectwise.",
9
+ version: "0.0.1",
10
+ type: "source",
11
+ dedupe: "unique",
12
+ methods: {
13
+ ...common.methods,
14
+ getResourceFn() {
15
+ return this.connectwise.listProjects;
16
+ },
17
+ getSummary(item) {
18
+ return `New Project Created: ${item.name}`;
19
+ },
20
+ },
21
+ sampleEmit,
22
+ };
@@ -0,0 +1,122 @@
1
+ export default {
2
+ "id": 11,
3
+ "actualHours": 0,
4
+ "billExpenses": "NoDefault",
5
+ "billingAmount": 0,
6
+ "billingAttention": "",
7
+ "billingMethod": "ActualRates",
8
+ "billingRateType": "WorkRole",
9
+ "billProducts": "Billable",
10
+ "billProjectAfterClosedFlag": true,
11
+ "billTime": "NoDefault",
12
+ "billUnapprovedTimeAndExpense": false,
13
+ "board": {
14
+ "id": 3,
15
+ "name": "Projects-2-10",
16
+ "_info": {
17
+ "board_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/boards/3"
18
+ }
19
+ },
20
+ "budgetAnalysis": "ActualHours",
21
+ "budgetFlag": false,
22
+ "company": {
23
+ "id": 2,
24
+ "identifier": "YourCompany",
25
+ "name": "Your Company",
26
+ "_info": {
27
+ "company_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/companies/2"
28
+ }
29
+ },
30
+ "contact": {
31
+ "id": 77,
32
+ "name": "Arnie Bellini",
33
+ "_info": {
34
+ "contact_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/77"
35
+ }
36
+ },
37
+ "customerPO": "",
38
+ "description": "",
39
+ "currency": {
40
+ "id": 7,
41
+ "symbol": "$",
42
+ "currencyCode": "USD",
43
+ "decimalSeparator": ".",
44
+ "numberOfDecimals": 2,
45
+ "thousandsSeparator": ",",
46
+ "negativeParenthesesFlag": false,
47
+ "displaySymbolFlag": false,
48
+ "currencyIdentifier": "Z-US$",
49
+ "displayIdFlag": false,
50
+ "rightAlign": false,
51
+ "name": "US Dollars",
52
+ "_info": {
53
+ "currency_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//finance/currencies/7"
54
+ }
55
+ },
56
+ "downpayment": 0,
57
+ "estimatedEnd": "2007-07-27T00:00:00Z",
58
+ "estimatedExpenseRevenue": 0,
59
+ "estimatedHours": 0,
60
+ "estimatedProductRevenue": 0,
61
+ "estimatedStart": "2007-07-02T00:00:00Z",
62
+ "estimatedTimeRevenue": 0,
63
+ "includeDependenciesFlag": false,
64
+ "includeEstimatesFlag": false,
65
+ "location": {
66
+ "id": 2,
67
+ "name": "Tampa Office",
68
+ "_info": {
69
+ "location_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/locations/2"
70
+ }
71
+ },
72
+ "department": {
73
+ "id": 10,
74
+ "identifier": "Services",
75
+ "name": "Professional Services",
76
+ "_info": {
77
+ "department_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/departments/10"
78
+ }
79
+ },
80
+ "manager": {
81
+ "id": 150,
82
+ "identifier": "zAdmin",
83
+ "name": "zSys Admin",
84
+ "_info": {
85
+ "member_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/members/150"
86
+ }
87
+ },
88
+ "name": "ConnectWise Implementation",
89
+ "restrictDownPaymentFlag": false,
90
+ "scheduledHours": 0,
91
+ "status": {
92
+ "id": 1,
93
+ "name": "Open",
94
+ "_info": {
95
+ "status_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//project/statuses/1"
96
+ }
97
+ },
98
+ "closedFlag": false,
99
+ "type": {
100
+ "id": 8,
101
+ "name": "Implementations",
102
+ "_info": {
103
+ "projectType_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//project/projectTypes/8"
104
+ }
105
+ },
106
+ "doNotDisplayInPortalFlag": false,
107
+ "poAmount": 0,
108
+ "estimatedTimeCost": 0,
109
+ "estimatedExpenseCost": 0,
110
+ "estimatedProductCost": 0,
111
+ "companyLocation": {
112
+ "id": 38,
113
+ "name": "Corporate",
114
+ "_info": {
115
+ "location_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/locations/38"
116
+ }
117
+ },
118
+ "_info": {
119
+ "lastUpdated": "2007-07-17T17:26:02Z",
120
+ "updatedBy": "zadmin"
121
+ }
122
+ }
@@ -0,0 +1,22 @@
1
+ import common from "../common/base.mjs";
2
+ import sampleEmit from "./test-event.mjs";
3
+
4
+ export default {
5
+ ...common,
6
+ key: "connectwise_psa-new-ticket-created",
7
+ name: "New Ticket Created",
8
+ description: "Emit new event when a new ticket is created in Connectwise.",
9
+ version: "0.0.1",
10
+ type: "source",
11
+ dedupe: "unique",
12
+ methods: {
13
+ ...common.methods,
14
+ getResourceFn() {
15
+ return this.connectwise.listTickets;
16
+ },
17
+ getSummary(item) {
18
+ return `New Ticket Created: ${item.summary}`;
19
+ },
20
+ },
21
+ sampleEmit,
22
+ };
@@ -0,0 +1,183 @@
1
+ export default {
2
+ "id": 493,
3
+ "summary": "Check Remote Backup",
4
+ "recordType": "ServiceTicket",
5
+ "board": {
6
+ "id": 1,
7
+ "name": "Professional Services",
8
+ "_info": {
9
+ "board_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/boards/1"
10
+ }
11
+ },
12
+ "status": {
13
+ "id": 16,
14
+ "name": "New (not responded)",
15
+ "Sort": 0,
16
+ "_info": {
17
+ "status_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/boards/1/statuses/16"
18
+ }
19
+ },
20
+ "company": {
21
+ "id": 16,
22
+ "identifier": "IndigoStrawberryCo",
23
+ "name": "IndigoStrawberry, Co.",
24
+ "_info": {
25
+ "company_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/companies/16",
26
+ "mobileGuid": "102830a1-479e-4a5f-bec1-fbc532e43c30"
27
+ }
28
+ },
29
+ "site": {
30
+ "id": 20,
31
+ "name": "Main",
32
+ "_info": {
33
+ "site_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/companies/16/sites/20",
34
+ "mobileGuid": "caf531b0-1e63-4159-b429-642b6057a242"
35
+ }
36
+ },
37
+ "siteName": "Main",
38
+ "addressLine1": "2106 SHADYHILL TER",
39
+ "city": "Harrells",
40
+ "stateIdentifier": "FL",
41
+ "zip": "34667",
42
+ "contact": {
43
+ "id": 48,
44
+ "name": "Ramon Stawiarz",
45
+ "_info": {
46
+ "mobileGuid": "57a19455-a9d7-4587-ac45-0f80f5387c31",
47
+ "contact_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//company/contacts/48"
48
+ }
49
+ },
50
+ "contactName": "Ramon Stawiarz",
51
+ "contactPhoneNumber": "8133936413",
52
+ "contactEmailAddress": "ramon.stawiarz@indigostrawberry.com",
53
+ "type": {
54
+ "id": 14,
55
+ "name": "Proactive",
56
+ "_info": {
57
+ "type_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/boards/1/types/14"
58
+ }
59
+ },
60
+ "team": {
61
+ "id": 25,
62
+ "name": "Service Team",
63
+ "_info": {
64
+ "team_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/boards/1/teams/25"
65
+ }
66
+ },
67
+ "priority": {
68
+ "id": 4,
69
+ "name": "Priority 3 - Normal Response",
70
+ "sort": 6,
71
+ "_info": {
72
+ "priority_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/priorities/4",
73
+ "image_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/priorities/4/image?lm=2005-05-27T14:58:21Z"
74
+ }
75
+ },
76
+ "serviceLocation": {
77
+ "id": 2,
78
+ "name": "In-house",
79
+ "_info": {
80
+ "location_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/locations/2"
81
+ }
82
+ },
83
+ "source": {
84
+ "id": 2,
85
+ "name": "Phone",
86
+ "_info": {
87
+ "source_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/sources/2"
88
+ }
89
+ },
90
+ "severity": "Medium",
91
+ "impact": "Medium",
92
+ "allowAllClientsPortalView": false,
93
+ "customerUpdatedFlag": false,
94
+ "automaticEmailContactFlag": false,
95
+ "automaticEmailResourceFlag": false,
96
+ "automaticEmailCcFlag": false,
97
+ "automaticEmailCc": "",
98
+ "closedFlag": false,
99
+ "approved": true,
100
+ "estimatedExpenseCost": 0,
101
+ "estimatedExpenseRevenue": 0,
102
+ "estimatedProductCost": 0,
103
+ "estimatedProductRevenue": 0,
104
+ "estimatedTimeCost": 0,
105
+ "estimatedTimeRevenue": 0,
106
+ "billingMethod": "ActualRates",
107
+ "subBillingMethod": "ActualRates",
108
+ "resolveMinutes": 0,
109
+ "resPlanMinutes": 0,
110
+ "respondMinutes": 0,
111
+ "isInSla": false,
112
+ "hasChildTicket": false,
113
+ "hasMergedChildTicketFlag": false,
114
+ "billTime": "NoDefault",
115
+ "billExpenses": "NoDefault",
116
+ "billProducts": "Billable",
117
+ "location": {
118
+ "id": 2,
119
+ "name": "Tampa Office",
120
+ "_info": {
121
+ "location_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/locations/2"
122
+ }
123
+ },
124
+ "department": {
125
+ "id": 10,
126
+ "identifier": "Services",
127
+ "name": "Professional Services",
128
+ "_info": {
129
+ "department_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/departments/10"
130
+ }
131
+ },
132
+ "mobileGuid": "25bdf3ce-b284-470b-a13d-0ffcea6aa922",
133
+ "sla": {
134
+ "id": 1,
135
+ "name": "Standard SLA",
136
+ "_info": {
137
+ "sla_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/SLAs/1"
138
+ }
139
+ },
140
+ "slaStatus": "Respond by Mon 07/04 1:00 PM UTC-04",
141
+ "requestForChangeFlag": false,
142
+ "currency": {
143
+ "id": 7,
144
+ "symbol": "$",
145
+ "currencyCode": "USD",
146
+ "decimalSeparator": ".",
147
+ "numberOfDecimals": 2,
148
+ "thousandsSeparator": ",",
149
+ "negativeParenthesesFlag": false,
150
+ "displaySymbolFlag": false,
151
+ "currencyIdentifier": "Z-US$",
152
+ "displayIdFlag": false,
153
+ "rightAlign": false,
154
+ "name": "US Dollars",
155
+ "_info": {
156
+ "currency_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//finance/currencies/7"
157
+ }
158
+ },
159
+ "_info": {
160
+ "lastUpdated": "2022-07-02T04:20:41Z",
161
+ "updatedBy": "template3",
162
+ "dateEntered": "2022-07-02T04:20:41Z",
163
+ "enteredBy": "template3",
164
+ "activities_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//sales/activities?conditions=ticket/id=493",
165
+ "scheduleentries_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//schedule/entries?conditions=type/id=4 AND objectId=493",
166
+ "documents_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//system/documents?recordType=Ticket&recordId=493",
167
+ "configurations_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/tickets/493/configurations",
168
+ "tasks_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/tickets/493/tasks",
169
+ "notes_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//service/tickets/493/notes",
170
+ "products_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//procurement/products?conditions=chargeToType='Ticket' AND chargeToId=493",
171
+ "timeentries_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//time/entries?conditions=(chargeToType='ServiceTicket' OR chargeToType='ProjectTicket') AND chargeToId=493",
172
+ "expenseEntries_href": "https://api-staging.connectwisedev.com/v4_6_release/apis/3.0//expense/entries?conditions=(chargeToType='ServiceTicket' OR chargeToType='ProjectTicket') AND chargeToId=493"
173
+ },
174
+ "escalationStartDateUTC": "2022-07-04T13:00:00Z",
175
+ "escalationLevel": 0,
176
+ "minutesBeforeWaiting": 0,
177
+ "respondedSkippedMinutes": 0,
178
+ "resplanSkippedMinutes": 0,
179
+ "respondedHours": 4,
180
+ "resplanHours": 24,
181
+ "resolutionHours": 48,
182
+ "minutesWaiting": 0
183
+ }