Skip to content

Commit 9dddce1

Browse files
committed
Merge branch 'master' into issue-13198
2 parents c6e3ef9 + 8f91060 commit 9dddce1

File tree

310 files changed

+9826
-9973
lines changed

Some content is hidden

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

310 files changed

+9826
-9973
lines changed

components/adalo/actions/common/base.mjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/adalo/actions/create-record/create-record.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import base from "../common/base.mjs";
1+
import adalo from "../../adalo.app.mjs";
22

33
export default {
4-
...base,
54
key: "adalo-create-record",
65
name: "Create Record",
76
description: "Create a new record. [See docs here](https://help.adalo.com/integrations/the-adalo-api/collections)",
8-
version: "0.0.1",
7+
version: "0.0.2",
98
type: "action",
109
props: {
11-
...base.props,
10+
adalo,
1211
data: {
1312
label: "Data",
1413
description: "The data to create record. E.g. `{ \"Email\": \"string\", \"Username\": \"string\", \"Full Name\": \"string\" }`",
@@ -18,7 +17,6 @@ export default {
1817
async run({ $ }) {
1918
const response = await this.adalo.createRecord({
2019
$,
21-
collectionId: this.collectionId,
2220
data: JSON.parse(this.data),
2321
});
2422

components/adalo/actions/get-records/get-records.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import base from "../common/base.mjs";
1+
import adalo from "../../adalo.app.mjs";
22

33
export default {
4-
...base,
54
key: "adalo-get-records",
65
name: "Get Records",
76
description: "Get all records from a collection. [See docs here](https://help.adalo.com/integrations/the-adalo-api/collections)",
8-
version: "0.0.2",
7+
version: "0.0.4",
98
type: "action",
9+
props: {
10+
adalo,
11+
},
1012
async run({ $ }) {
1113
let resources = [];
1214
let offset = 0;
@@ -18,7 +20,6 @@ export default {
1820
requestFn: this.adalo.getRecords,
1921
requestArgs: {
2022
$,
21-
collectionId: this.collectionId,
2223
params: {
2324
offset,
2425
},

components/adalo/actions/update-record/update-record.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import base from "../common/base.mjs";
1+
import adalo from "../../adalo.app.mjs";
22

33
export default {
4-
...base,
54
key: "adalo-update-record",
65
name: "Update Record",
76
description: "Update a record. [See docs here](https://help.adalo.com/integrations/the-adalo-api/collections)",
8-
version: "0.0.1",
7+
version: "0.0.2",
98
type: "action",
109
props: {
11-
...base.props,
10+
adalo,
1211
recordId: {
1312
label: "Record ID",
1413
description: "The ID of a record",
@@ -23,7 +22,6 @@ export default {
2322
async run({ $ }) {
2423
const response = await this.adalo.updateRecord({
2524
$,
26-
collectionId: this.collectionId,
2725
recordId: this.recordId,
2826
data: JSON.parse(this.data),
2927
});

components/adalo/adalo.app.mjs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { axios } from "@pipedream/platform";
33
export default {
44
type: "app",
55
app: "adalo",
6-
propDefinitions: {},
76
methods: {
7+
_collectionId() {
8+
return this.$auth.collection_id;
9+
},
810
_apiKey() {
911
return this.$auth.api_key;
1012
},
@@ -49,30 +51,24 @@ export default {
4951
},
5052
};
5153
},
52-
async getRecords({
53-
collectionId, ...args
54-
} = {}) {
55-
const response = await this._makeRequest({
56-
path: `/collections/${collectionId}`,
54+
getRecords(args = {}) {
55+
return this._makeRequest({
56+
path: `/collections/${this._collectionId()}`,
5757
...args,
5858
});
59-
60-
return response.records;
6159
},
62-
async createRecord({
63-
collectionId, ...args
64-
} = {}) {
60+
createRecord(args = {}) {
6561
return this._makeRequest({
66-
path: `/collections/${collectionId}`,
62+
path: `/collections/${this._collectionId()}`,
6763
method: "post",
6864
...args,
6965
});
7066
},
71-
async updateRecord({
72-
collectionId, recordId, ...args
67+
updateRecord({
68+
recordId, ...args
7369
} = {}) {
7470
return this._makeRequest({
75-
path: `/collections/${collectionId}/${recordId}`,
71+
path: `/collections/${this._collectionId()}/${recordId}`,
7672
method: "put",
7773
...args,
7874
});

components/adalo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/adalo",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "Pipedream Adalo Components",
55
"main": "adalo.app.mjs",
66
"keywords": [
@@ -14,6 +14,6 @@
1414
"access": "public"
1515
},
1616
"dependencies": {
17-
"@pipedream/platform": "^1.2.0"
17+
"@pipedream/platform": "^3.0.1"
1818
}
1919
}

components/adalo/sources/new-record/new-record.mjs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "adalo-new-record",
66
name: "New Record",
77
description: "Emit new event when is created a record.",
8-
version: "0.0.4",
8+
version: "0.0.5",
99
type: "source",
1010
dedupe: "unique",
1111
props: {
@@ -16,11 +16,6 @@ export default {
1616
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
1717
},
1818
},
19-
collectionId: {
20-
label: "Collection ID",
21-
description: "The ID the collection",
22-
type: "string",
23-
},
2419
},
2520
methods: {
2621
emitEvent(event) {
@@ -33,8 +28,7 @@ export default {
3328
},
3429
hooks: {
3530
async deploy() {
36-
const records = await this.adalo.getRecords({
37-
collectionId: this.collectionId,
31+
const { records } = await this.adalo.getRecords({
3832
params: {
3933
limit: 10,
4034
},
@@ -47,9 +41,8 @@ export default {
4741
let offset = 0;
4842

4943
while (offset >= 0) {
50-
const records = await this.adalo.getRecords({
44+
const { records } = await this.adalo.getRecords({
5145
$,
52-
collectionId: this.collectionId,
5346
params: {
5447
offset,
5548
},

0 commit comments

Comments
 (0)