@pipedream/prodpad 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +41 -0
- package/README.md +33 -0
- package/actions/create-company/create-company.mjs +81 -0
- package/actions/create-contact/create-contact.mjs +115 -0
- package/actions/create-feedback/create-feedback.mjs +85 -0
- package/actions/create-idea/create-idea.mjs +151 -0
- package/actions/find-company/find-company.mjs +85 -0
- package/actions/find-contact/find-contact.mjs +90 -0
- package/actions/find-feedback/find-feedback.mjs +123 -0
- package/actions/find-idea/find-idea.mjs +66 -0
- package/actions/find-or-create-company/find-or-create-company.mjs +105 -0
- package/actions/find-or-create-contact/find-or-create-contact.mjs +114 -0
- package/actions/find-or-create-feedback/find-or-create-feedback.mjs +149 -0
- package/actions/update-company/update-company.mjs +101 -0
- package/actions/update-contact/update-contact.mjs +134 -0
- package/actions/update-feedback/update-feedback.mjs +87 -0
- package/actions/update-idea-stage/update-idea-stage.mjs +52 -0
- package/common/constants.mjs +11 -0
- package/common/utils.mjs +42 -0
- package/package.json +19 -0
- package/prodpad.app.mjs +427 -0
- package/sources/common/polling.mjs +65 -0
- package/sources/new-company-created/new-company-created.mjs +27 -0
- package/sources/new-contact-created/new-contact-created.mjs +27 -0
- package/sources/new-feedback-created/new-feedback-created.mjs +27 -0
- package/sources/new-idea-created/new-idea-created.mjs +27 -0
- package/sources/new-idea-feedback-created/new-idea-feedback-created.mjs +38 -0
- package/sources/new-persona-created/new-persona-created.mjs +24 -0
- package/sources/new-product-created/new-product-created.mjs +24 -0
- package/sources/new-tag-created/new-tag-created.mjs +24 -0
- package/sources/new-user-story-created/new-user-story-created.mjs +24 -0
- package/sources/pushed-idea/pushed-idea.mjs +24 -0
- package/sources/pushed-user-story/pushed-user-story.mjs +24 -0
package/prodpad.app.mjs
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
import constants from "./common/constants.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
type: "app",
|
|
6
|
+
app: "prodpad",
|
|
7
|
+
propDefinitions: {
|
|
8
|
+
name: {
|
|
9
|
+
type: "string",
|
|
10
|
+
label: "Name",
|
|
11
|
+
description: "The name of the company",
|
|
12
|
+
},
|
|
13
|
+
email: {
|
|
14
|
+
type: "string",
|
|
15
|
+
label: "Email",
|
|
16
|
+
description: "Email address",
|
|
17
|
+
},
|
|
18
|
+
city: {
|
|
19
|
+
type: "string",
|
|
20
|
+
label: "City",
|
|
21
|
+
description: "The city of the company",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
country: {
|
|
25
|
+
type: "string",
|
|
26
|
+
label: "Country",
|
|
27
|
+
description: "The country of the company. This should be a two letter country code. [See the ISO 3166 1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Decoding_table).",
|
|
28
|
+
optional: true,
|
|
29
|
+
},
|
|
30
|
+
externalId: {
|
|
31
|
+
type: "string",
|
|
32
|
+
label: "External ID",
|
|
33
|
+
description: "The external id",
|
|
34
|
+
optional: true,
|
|
35
|
+
},
|
|
36
|
+
externalUrl: {
|
|
37
|
+
type: "string",
|
|
38
|
+
label: "External URL",
|
|
39
|
+
description: "The external url",
|
|
40
|
+
optional: true,
|
|
41
|
+
},
|
|
42
|
+
companySize: {
|
|
43
|
+
type: "string",
|
|
44
|
+
label: "Size",
|
|
45
|
+
description: "The size of the company.",
|
|
46
|
+
optional: true,
|
|
47
|
+
options: [
|
|
48
|
+
{
|
|
49
|
+
label: "1-10",
|
|
50
|
+
value: "1_10",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "11-50",
|
|
54
|
+
value: "11_50",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "50-250",
|
|
58
|
+
value: "50_250",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: "250-500",
|
|
62
|
+
value: "250_500",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "500-1000",
|
|
66
|
+
value: "500_1000",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "1000-5000",
|
|
70
|
+
value: "1000_5000",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: "5000-10000",
|
|
74
|
+
value: "5000_10000",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "10000+",
|
|
78
|
+
value: "10000",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
companyValue: {
|
|
83
|
+
type: "string",
|
|
84
|
+
label: "Value",
|
|
85
|
+
description: "The value of the company to your organization.",
|
|
86
|
+
optional: true,
|
|
87
|
+
options: [
|
|
88
|
+
{
|
|
89
|
+
label: "High",
|
|
90
|
+
value: "high",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: "Medium",
|
|
94
|
+
value: "medium",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: "Low",
|
|
98
|
+
value: "low",
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
feedback: {
|
|
103
|
+
type: "string",
|
|
104
|
+
label: "Feedback",
|
|
105
|
+
description: "The feedback text. This field accepts HTML and is stored as UTF-8.",
|
|
106
|
+
},
|
|
107
|
+
tagId: {
|
|
108
|
+
type: "string",
|
|
109
|
+
label: "Tag ID",
|
|
110
|
+
description: "The tag id",
|
|
111
|
+
async options() {
|
|
112
|
+
const tags = await this.listTags();
|
|
113
|
+
return tags.map(({
|
|
114
|
+
id: value, tag: label,
|
|
115
|
+
}) => ({
|
|
116
|
+
label,
|
|
117
|
+
value,
|
|
118
|
+
}));
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
personaId: {
|
|
122
|
+
type: "string",
|
|
123
|
+
label: "Persona ID",
|
|
124
|
+
description: "The persona id",
|
|
125
|
+
async options() {
|
|
126
|
+
const personas = await this.listPersonas();
|
|
127
|
+
return personas.map(({
|
|
128
|
+
id: value, name: label,
|
|
129
|
+
}) => ({
|
|
130
|
+
label,
|
|
131
|
+
value,
|
|
132
|
+
}));
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
companyId: {
|
|
136
|
+
type: "string",
|
|
137
|
+
label: "Company ID",
|
|
138
|
+
description: "The company id",
|
|
139
|
+
async options({ page }) {
|
|
140
|
+
const { companies } = await this.listCompanies({
|
|
141
|
+
params: {
|
|
142
|
+
page: page + 1,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
return companies.map(({
|
|
146
|
+
id: value, name: label,
|
|
147
|
+
}) => ({
|
|
148
|
+
label,
|
|
149
|
+
value,
|
|
150
|
+
}));
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
jobroleId: {
|
|
154
|
+
type: "string",
|
|
155
|
+
label: "Job Role ID",
|
|
156
|
+
description: "The job role id",
|
|
157
|
+
async options() {
|
|
158
|
+
const jobroles = await this.listJobroles();
|
|
159
|
+
return jobroles.map(({
|
|
160
|
+
id: value, name: label,
|
|
161
|
+
}) => ({
|
|
162
|
+
label,
|
|
163
|
+
value,
|
|
164
|
+
}));
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
productId: {
|
|
168
|
+
type: "string",
|
|
169
|
+
label: "Product ID",
|
|
170
|
+
description: "The product id",
|
|
171
|
+
async options() {
|
|
172
|
+
const products = await this.listProducts();
|
|
173
|
+
return products.map(({
|
|
174
|
+
id: value, name: label,
|
|
175
|
+
}) => ({
|
|
176
|
+
label,
|
|
177
|
+
value,
|
|
178
|
+
}));
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
statusId: {
|
|
182
|
+
type: "string",
|
|
183
|
+
label: "Status ID",
|
|
184
|
+
description: "The workflow status id",
|
|
185
|
+
async options() {
|
|
186
|
+
const statuses = await this.listStatuses();
|
|
187
|
+
return statuses.map(({
|
|
188
|
+
id: value, status: label,
|
|
189
|
+
}) => ({
|
|
190
|
+
label,
|
|
191
|
+
value,
|
|
192
|
+
}));
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
contactId: {
|
|
196
|
+
type: "string",
|
|
197
|
+
label: "Contact ID",
|
|
198
|
+
description: "The contact id",
|
|
199
|
+
async options({ page }) {
|
|
200
|
+
const { contacts } = await this.listContacts({
|
|
201
|
+
params: {
|
|
202
|
+
page: page + 1,
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
return contacts.map(({
|
|
206
|
+
id: value, name: label,
|
|
207
|
+
}) => ({
|
|
208
|
+
label,
|
|
209
|
+
value,
|
|
210
|
+
}));
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
feedbackId: {
|
|
214
|
+
type: "string",
|
|
215
|
+
label: "Feedback ID",
|
|
216
|
+
description: "The feedback id",
|
|
217
|
+
async options({ page }) {
|
|
218
|
+
const feedbacks = await this.listFeedbacks({
|
|
219
|
+
params: {
|
|
220
|
+
page: page + 1,
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
return feedbacks.map(({
|
|
224
|
+
id: value, feedback: label,
|
|
225
|
+
}) => ({
|
|
226
|
+
label,
|
|
227
|
+
value,
|
|
228
|
+
}));
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
ideaId: {
|
|
232
|
+
type: "string",
|
|
233
|
+
label: "Idea ID",
|
|
234
|
+
description: "The idea id",
|
|
235
|
+
async options({ page }) {
|
|
236
|
+
const { ideas } = await this.listIdeas({
|
|
237
|
+
params: {
|
|
238
|
+
page: page + 1,
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
return ideas.map(({
|
|
242
|
+
id: value, title: label,
|
|
243
|
+
}) => ({
|
|
244
|
+
label,
|
|
245
|
+
value,
|
|
246
|
+
}));
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
methods: {
|
|
251
|
+
getBaseUrl() {
|
|
252
|
+
return `${constants.BASE_URL}${constants.VERSION_PATH}`;
|
|
253
|
+
},
|
|
254
|
+
getUrl(path, url) {
|
|
255
|
+
return url || `${this.getBaseUrl()}${path}`;
|
|
256
|
+
},
|
|
257
|
+
getHeaders(headers) {
|
|
258
|
+
return {
|
|
259
|
+
"Content-Type": "application/json",
|
|
260
|
+
"Authorization": `Bearer ${this.$auth.api_key}`,
|
|
261
|
+
...headers,
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
async makeRequest({
|
|
265
|
+
step = this, path, headers, url, ...args
|
|
266
|
+
} = {}) {
|
|
267
|
+
|
|
268
|
+
const config = {
|
|
269
|
+
headers: this.getHeaders(headers),
|
|
270
|
+
url: this.getUrl(path, url),
|
|
271
|
+
...args,
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
return axios(step, config);
|
|
275
|
+
},
|
|
276
|
+
create(args = {}) {
|
|
277
|
+
return this.makeRequest({
|
|
278
|
+
method: "post",
|
|
279
|
+
...args,
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
update(args = {}) {
|
|
283
|
+
return this.makeRequest({
|
|
284
|
+
method: "put",
|
|
285
|
+
...args,
|
|
286
|
+
});
|
|
287
|
+
},
|
|
288
|
+
createCompany(args = {}) {
|
|
289
|
+
return this.create({
|
|
290
|
+
path: "/companies",
|
|
291
|
+
...args,
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
createFeedback(args = {}) {
|
|
295
|
+
return this.create({
|
|
296
|
+
path: "/feedbacks",
|
|
297
|
+
...args,
|
|
298
|
+
});
|
|
299
|
+
},
|
|
300
|
+
createContact(args = {}) {
|
|
301
|
+
return this.create({
|
|
302
|
+
path: "/contacts",
|
|
303
|
+
...args,
|
|
304
|
+
});
|
|
305
|
+
},
|
|
306
|
+
listTags(args = {}) {
|
|
307
|
+
return this.makeRequest({
|
|
308
|
+
path: "/tags",
|
|
309
|
+
...args,
|
|
310
|
+
});
|
|
311
|
+
},
|
|
312
|
+
listPersonas(args = {}) {
|
|
313
|
+
return this.makeRequest({
|
|
314
|
+
path: "/personas",
|
|
315
|
+
...args,
|
|
316
|
+
});
|
|
317
|
+
},
|
|
318
|
+
listCompanies(args = {}) {
|
|
319
|
+
return this.makeRequest({
|
|
320
|
+
path: "/companies",
|
|
321
|
+
...args,
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
listJobroles(args = {}) {
|
|
325
|
+
return this.makeRequest({
|
|
326
|
+
path: "/jobroles",
|
|
327
|
+
...args,
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
listProducts(args = {}) {
|
|
331
|
+
return this.makeRequest({
|
|
332
|
+
path: "/products",
|
|
333
|
+
...args,
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
listStatuses(args = {}) {
|
|
337
|
+
return this.makeRequest({
|
|
338
|
+
path: "/statuses",
|
|
339
|
+
...args,
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
listContacts(args = {}) {
|
|
343
|
+
return this.makeRequest({
|
|
344
|
+
path: "/contacts",
|
|
345
|
+
...args,
|
|
346
|
+
});
|
|
347
|
+
},
|
|
348
|
+
listFeedbacks(args = {}) {
|
|
349
|
+
return this.makeRequest({
|
|
350
|
+
path: "/feedbacks",
|
|
351
|
+
...args,
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
listIdeas(args = {}) {
|
|
355
|
+
return this.makeRequest({
|
|
356
|
+
path: "/ideas",
|
|
357
|
+
...args,
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
listFeedbackIdeas({
|
|
361
|
+
feedbackId, ...args
|
|
362
|
+
} = {}) {
|
|
363
|
+
return this.makeRequest({
|
|
364
|
+
path: `/feedbacks/${feedbackId}/ideas`,
|
|
365
|
+
...args,
|
|
366
|
+
});
|
|
367
|
+
},
|
|
368
|
+
listUserstories(args = {}) {
|
|
369
|
+
return this.makeRequest({
|
|
370
|
+
path: "/userstories",
|
|
371
|
+
...args,
|
|
372
|
+
});
|
|
373
|
+
},
|
|
374
|
+
async *getResourcesStream({
|
|
375
|
+
requestResourcesFn,
|
|
376
|
+
requestResourcesArgs,
|
|
377
|
+
resourceName,
|
|
378
|
+
lastCreatedAt,
|
|
379
|
+
max = constants.DEFAULT_MAX,
|
|
380
|
+
}) {
|
|
381
|
+
let page = 1;
|
|
382
|
+
let resourcesCount = 0;
|
|
383
|
+
|
|
384
|
+
while (true) {
|
|
385
|
+
const response =
|
|
386
|
+
await requestResourcesFn({
|
|
387
|
+
...requestResourcesArgs,
|
|
388
|
+
params: {
|
|
389
|
+
page,
|
|
390
|
+
},
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
const nextResources =
|
|
394
|
+
Array.isArray(response)
|
|
395
|
+
? response
|
|
396
|
+
: response[resourceName];
|
|
397
|
+
|
|
398
|
+
if (!nextResources?.length) {
|
|
399
|
+
console.log("No more resources found");
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
for (const resource of nextResources) {
|
|
404
|
+
const dateFilter =
|
|
405
|
+
lastCreatedAt
|
|
406
|
+
&& Date.parse(resource.created_at) > Date.parse(lastCreatedAt);
|
|
407
|
+
|
|
408
|
+
if (!lastCreatedAt || dateFilter) {
|
|
409
|
+
yield resource;
|
|
410
|
+
resourcesCount += 1;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
if (resourcesCount >= max) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// It doesn't support pagination
|
|
419
|
+
if (Array.isArray(response)) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
page += 1;
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import app from "../../prodpad.app.mjs";
|
|
2
|
+
import constants from "../../common/constants.mjs";
|
|
3
|
+
import utils from "../../common/utils.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ConfigurationError,
|
|
6
|
+
DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
|
|
7
|
+
} from "@pipedream/platform";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
props: {
|
|
11
|
+
app,
|
|
12
|
+
db: "$.service.db",
|
|
13
|
+
timer: {
|
|
14
|
+
type: "$.interface.timer",
|
|
15
|
+
label: "Polling schedule",
|
|
16
|
+
description: "How often to poll the API",
|
|
17
|
+
default: {
|
|
18
|
+
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
methods: {
|
|
23
|
+
setLastCreatedAt(value) {
|
|
24
|
+
this.db.set(constants.LAST_CREATED_AT, value);
|
|
25
|
+
},
|
|
26
|
+
getLastCreatedAt() {
|
|
27
|
+
return this.db.get(constants.LAST_CREATED_AT);
|
|
28
|
+
},
|
|
29
|
+
getRequestResourcesFn() {
|
|
30
|
+
throw new ConfigurationError("getRequestResourcesFn is not implemented");
|
|
31
|
+
},
|
|
32
|
+
getRequestResourcesArgs() {
|
|
33
|
+
return {};
|
|
34
|
+
},
|
|
35
|
+
getResourceName() {},
|
|
36
|
+
generateMeta() {
|
|
37
|
+
throw new ConfigurationError("generateMeta is not implemented");
|
|
38
|
+
},
|
|
39
|
+
processEvent(resource) {
|
|
40
|
+
const meta = this.generateMeta(resource);
|
|
41
|
+
this.$emit(resource, meta);
|
|
42
|
+
},
|
|
43
|
+
async processEvents(resources) {
|
|
44
|
+
const [
|
|
45
|
+
lastResource,
|
|
46
|
+
] = resources;
|
|
47
|
+
|
|
48
|
+
if (lastResource?.created_at) {
|
|
49
|
+
this.setLastCreatedAt(lastResource.created_at);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
resources.reverse().forEach(this.processEvent);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
async run() {
|
|
56
|
+
const stream = this.app.getResourcesStream({
|
|
57
|
+
requestResourcesFn: this.getRequestResourcesFn(),
|
|
58
|
+
requestResourcesArgs: this.getRequestResourcesArgs(),
|
|
59
|
+
resourceName: this.getResourceName(),
|
|
60
|
+
lastCreatedAt: this.getLastCreatedAt(),
|
|
61
|
+
});
|
|
62
|
+
const resources = await utils.streamIterator(stream);
|
|
63
|
+
await this.processEvents(resources);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import common from "../common/polling.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "prodpad-new-company-created",
|
|
6
|
+
name: "New Company Created",
|
|
7
|
+
description: "Emit new event when a new company is created. [See the docs](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Feedback/GetCompanies).",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
methods: {
|
|
12
|
+
...common.methods,
|
|
13
|
+
getRequestResourcesFn() {
|
|
14
|
+
return this.app.listCompanies;
|
|
15
|
+
},
|
|
16
|
+
getResourceName() {
|
|
17
|
+
return "companies";
|
|
18
|
+
},
|
|
19
|
+
generateMeta(resource) {
|
|
20
|
+
return {
|
|
21
|
+
id: resource.id,
|
|
22
|
+
ts: Date.parse(resource.created_at),
|
|
23
|
+
summary: `New Company ${resource.id}`,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import common from "../common/polling.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "prodpad-new-contact-created",
|
|
6
|
+
name: "New Contact Created",
|
|
7
|
+
description: "Emit new event when a new contact is created. [See the docs](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Feedback/GetContacts).",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
methods: {
|
|
12
|
+
...common.methods,
|
|
13
|
+
getRequestResourcesFn() {
|
|
14
|
+
return this.app.listContacts;
|
|
15
|
+
},
|
|
16
|
+
getResourceName() {
|
|
17
|
+
return "contacts";
|
|
18
|
+
},
|
|
19
|
+
generateMeta(resource) {
|
|
20
|
+
return {
|
|
21
|
+
id: resource.id,
|
|
22
|
+
ts: Date.parse(resource.created_at),
|
|
23
|
+
summary: `New Contact ${resource.id}`,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import common from "../common/polling.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "prodpad-new-feedback-created",
|
|
6
|
+
name: "New Feedback Created",
|
|
7
|
+
description: "Emit new event when a new feedback is created. [See the docs](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Feedback/GetFeedbacks).",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
methods: {
|
|
12
|
+
...common.methods,
|
|
13
|
+
getRequestResourcesFn() {
|
|
14
|
+
return this.app.listFeedbacks;
|
|
15
|
+
},
|
|
16
|
+
getResourceName() {
|
|
17
|
+
return "feedbacks";
|
|
18
|
+
},
|
|
19
|
+
generateMeta(resource) {
|
|
20
|
+
return {
|
|
21
|
+
id: resource.id,
|
|
22
|
+
ts: Date.parse(resource.created_at),
|
|
23
|
+
summary: `New Feedback ${resource.id}`,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import common from "../common/polling.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "prodpad-new-idea-created",
|
|
6
|
+
name: "New Idea Created",
|
|
7
|
+
description: "Emit new event when a new idea is created. [See the docs](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Ideas/GetIdeas).",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
methods: {
|
|
12
|
+
...common.methods,
|
|
13
|
+
getRequestResourcesFn() {
|
|
14
|
+
return this.app.listIdeas;
|
|
15
|
+
},
|
|
16
|
+
getResourceName() {
|
|
17
|
+
return "ideas";
|
|
18
|
+
},
|
|
19
|
+
generateMeta(resource) {
|
|
20
|
+
return {
|
|
21
|
+
id: resource.id,
|
|
22
|
+
ts: Date.parse(resource.created_at),
|
|
23
|
+
summary: `New Idea ${resource.id}`,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import common from "../common/polling.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "prodpad-new-idea-feedback-created",
|
|
6
|
+
name: "New Idea Feedback Created",
|
|
7
|
+
description: "Emit new event when a new feedback is created for an idea. [See the docs]https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Ideas/GetIdeaFeedback).",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
feedbackId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
common.props.app,
|
|
16
|
+
"feedbackId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
...common.methods,
|
|
22
|
+
getRequestResourcesFn() {
|
|
23
|
+
return this.app.listFeedbackIdeas;
|
|
24
|
+
},
|
|
25
|
+
getRequestResourcesArgs() {
|
|
26
|
+
return {
|
|
27
|
+
feedbackId: this.feedbackId,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
generateMeta(resource) {
|
|
31
|
+
return {
|
|
32
|
+
id: resource.id,
|
|
33
|
+
ts: Date.parse(resource.created_at),
|
|
34
|
+
summary: `New Feedback Idea ${resource.id}`,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import common from "../common/polling.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "prodpad-new-persona-created",
|
|
6
|
+
name: "New Persona Created",
|
|
7
|
+
description: "Emit new event when a new persona is created. [See the docs](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Personas/GetPersonas).",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
methods: {
|
|
12
|
+
...common.methods,
|
|
13
|
+
getRequestResourcesFn() {
|
|
14
|
+
return this.app.listPersonas;
|
|
15
|
+
},
|
|
16
|
+
generateMeta(resource) {
|
|
17
|
+
return {
|
|
18
|
+
id: resource.id,
|
|
19
|
+
ts: Date.parse(resource.created_at),
|
|
20
|
+
summary: `New Persona ${resource.id}`,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import common from "../common/polling.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "prodpad-new-product-created",
|
|
6
|
+
name: "New Product Created",
|
|
7
|
+
description: "Emit new event when a new product is created. [See the docs](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Products/GetProducts).",
|
|
8
|
+
type: "source",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
dedupe: "unique",
|
|
11
|
+
methods: {
|
|
12
|
+
...common.methods,
|
|
13
|
+
getRequestResourcesFn() {
|
|
14
|
+
return this.app.listProducts;
|
|
15
|
+
},
|
|
16
|
+
generateMeta(resource) {
|
|
17
|
+
return {
|
|
18
|
+
id: resource.id,
|
|
19
|
+
ts: Date.parse(resource.created_at),
|
|
20
|
+
summary: `New Product ${resource.id}`,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|