Skip to content

Commit 0e97aa2

Browse files
authored
Merge branch 'master' into jay/dj-3523-migrate-sdk
2 parents 0fcde9b + 3eafcf9 commit 0e97aa2

File tree

2,464 files changed

+16935
-3804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,464 files changed

+16935
-3804
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "brandfetch",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/brandfetch/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/brandfetch",
3+
"version": "0.0.1",
4+
"description": "Pipedream Brandfetch Components",
5+
"main": "brandfetch.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"brandfetch"
9+
],
10+
"homepage": "https://pipedream.com/apps/brandfetch",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/codescene/actions/get-project-analysis/get-project-analysis.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "codescene-get-project-analysis",
55
name: "Get Project Analysis",
66
description: "Returns a single project analysis. [See the documentation](https://codescene.io/docs/integrations/public-api.html#single-analysis-details)",
7-
version: "0.0.NaN",
7+
version: "0.1.0",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/connectwise_psa/actions/create-company/create-company.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "connectwise_psa-create-company",
55
name: "Create Company",
66
description: "Creates a new company in Connectwise. [See the documentation](https://developer.connectwise.com/Products/ConnectWise_PSA/REST#/Companies/postCompanyCompanies)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/connectwise_psa/actions/create-contact/create-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "connectwise_psa-create-contact",
66
name: "Create Contact",
77
description: "Creates a new contact in Connectwise. [See the documentation](https://developer.connectwise.com/Products/ConnectWise_PSA/REST#/Contacts/postCompanyContacts)",
8-
version: "0.1.1",
8+
version: "0.1.2",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/connectwise_psa/actions/create-ticket/create-ticket.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "connectwise_psa-create-ticket",
55
name: "Create Ticket",
66
description: "Creates a new ticket in Connectwise. [See the documentation](https://developer.connectwise.com/Products/ConnectWise_PSA/REST#/Tickets/postServiceTickets)",
7-
version: "0.1.1",
7+
version: "0.1.2",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/connectwise_psa/connectwise_psa.app.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ export default {
339339
resourceFn,
340340
params,
341341
max,
342+
lastId,
342343
}) {
343344
params = {
344345
...params,
@@ -350,12 +351,19 @@ export default {
350351
params,
351352
});
352353
for (const item of items) {
353-
yield item;
354-
count++;
355354
if (max && count >= max) {
356355
return;
357356
}
357+
358+
// orderby id desc
359+
if (item.id <= lastId) {
360+
return;
361+
}
362+
363+
yield item;
364+
count++;
358365
}
366+
359367
hasMore = items.length;
360368
params.page++;
361369
} while (hasMore);

components/connectwise_psa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connectwise_psa",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Pipedream Connectwise PSA Components",
55
"main": "connectwise_psa.app.mjs",
66
"keywords": [

components/connectwise_psa/sources/common/base.mjs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ export default {
2525
this.db.set("lastId", lastId);
2626
},
2727
getParams() {
28-
return {};
28+
return {
29+
pageSize: 500,
30+
orderBy: "id desc",
31+
};
2932
},
3033
generateMeta(item) {
3134
return {
@@ -38,25 +41,30 @@ export default {
3841
const lastId = this._getLastId();
3942
const resourceFn = this.getResourceFn();
4043
const params = this.getParams();
41-
const results = this.connectwise.paginate({
44+
const iterator = this.connectwise.paginate({
4245
resourceFn,
4346
params,
4447
max,
48+
lastId,
4549
});
46-
let items = [];
47-
for await (const item of results) {
48-
if (item.id > lastId) {
49-
items.push(item);
50+
51+
const items = [];
52+
let firstNewId;
53+
54+
for await (const item of iterator) {
55+
if (!firstNewId) {
56+
firstNewId = item.id;
5057
}
58+
items.push(item);
5159
}
52-
if (!items.length) {
53-
return;
54-
}
55-
if (max) {
56-
items = items.slice(-1 * max);
60+
61+
if (firstNewId) {
62+
this._setLastId(firstNewId);
5763
}
58-
this._setLastId(items[items.length - 1].id);
59-
items.forEach((item) => this.$emit(item, this.generateMeta(item)));
64+
65+
items
66+
.reverse()
67+
.forEach((item) => this.$emit(item, this.generateMeta(item)));
6068
},
6169
getResourceFn() {
6270
throw new Error("getResourceFn is not implemented");

components/connectwise_psa/sources/new-contact-created/new-contact-created.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "connectwise_psa-new-contact-created",
77
name: "New Contact Created",
88
description: "Emit new event when a new contact is created in Connectwise.",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
type: "source",
1111
dedupe: "unique",
1212
methods: {

0 commit comments

Comments
 (0)