Skip to content

Commit a5055d9

Browse files
committed
Added requested changes
1 parent 047f162 commit a5055d9

File tree

5 files changed

+48
-74
lines changed

5 files changed

+48
-74
lines changed

components/klipfolio/actions/create-datasource/create-datasource.mjs

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,51 @@ export default {
1111
name: {
1212
propDefinition: [
1313
app,
14-
"name",
15-
],
14+
"name"
15+
]
1616
},
1717
description: {
1818
propDefinition: [
1919
app,
20-
"description",
21-
],
20+
"description"
21+
]
2222
},
2323
format: {
2424
propDefinition: [
2525
app,
26-
"format",
27-
],
26+
"format"
27+
]
2828
},
2929
connector: {
3030
propDefinition: [
3131
app,
32-
"connector",
33-
],
32+
"connector"
33+
]
3434
},
3535
refreshInterval: {
3636
propDefinition: [
3737
app,
38-
"refreshInterval",
39-
],
38+
"refreshInterval"
39+
]
4040
},
4141
endpointUrl: {
4242
propDefinition: [
4343
app,
44-
"endpointUrl",
45-
],
44+
"endpointUrl"
45+
]
4646
},
4747
method: {
4848
propDefinition: [
4949
app,
50-
"method",
51-
],
50+
"method"
51+
]
5252
},
53+
additionalProperties: {
54+
propDefinition: [
55+
app,
56+
"additionalProperties",
57+
]
58+
}
5359
},
5460

5561
async run({ $ }) {
@@ -64,7 +70,8 @@ export default {
6470
properties: {
6571
endpoint_url: this.endpointUrl,
6672
method: this.method,
67-
},
73+
...this.additionalProperties,
74+
}
6875
},
6976
});
7077
$.export("$summary", `Successfully created Datasource named '${this.name}'`);

components/klipfolio/actions/delete-datasource/delete-datasource.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default {
1111
datasourceId: {
1212
propDefinition: [
1313
app,
14-
"datasourceId",
15-
],
14+
"datasourceId"
15+
]
1616
},
1717
},
1818

components/klipfolio/actions/update-datasource/update-datasource.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ export default {
1111
datasourceId: {
1212
propDefinition: [
1313
app,
14-
"datasourceId",
15-
],
14+
"datasourceId"
15+
]
1616
},
1717
name: {
1818
propDefinition: [
1919
app,
20-
"name",
21-
],
20+
"name"
21+
]
2222
},
2323
description: {
2424
propDefinition: [
2525
app,
26-
"description",
27-
],
26+
"description"
27+
]
2828
},
2929
refreshInterval: {
3030
propDefinition: [
3131
app,
32-
"refreshInterval",
33-
],
32+
"refreshInterval"
33+
]
3434
},
3535
},
3636

@@ -41,7 +41,7 @@ export default {
4141
data: {
4242
name: this.name,
4343
description: this.description,
44-
refreshInterval: parseInt(this.refreshInterval, 10),
44+
refresh_interval: parseInt(this.refreshInterval, 10),
4545
},
4646
});
4747
$.export("$summary", `Successfully updated Datasource named '${this.name}'`);
Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,8 @@
11
export default {
22
DATASOURCE_CONNECTORS: [
3-
"box",
4-
"comscore",
5-
"db",
6-
"dropbox",
7-
"facebook",
8-
"ftp",
9-
"google_adwords",
10-
"google_analytics",
11-
"google_drive",
12-
"google_spreadsheets",
13-
"hubspot",
14-
"iformbuilder",
15-
"marketo",
16-
"omniture",
17-
"radian6",
18-
"salesforce",
19-
"searchMetrics",
20-
"shopify",
21-
"simple_rest",
22-
"survey_monkey",
23-
"versature",
24-
"xero",
25-
"xmla",
3+
'box', 'comscore', 'db', 'dropbox', 'facebook', 'ftp', 'google_adwords', 'google_analytics', 'google_drive', 'google_spreadsheets', 'hubspot', 'iformbuilder', 'marketo', 'omniture', 'radian6', 'salesforce', 'searchMetrics', 'shopify', 'simple_rest', 'survey_monkey', 'versature', 'xero', 'xmla'
264
],
275
REFRESH_INTERVALS: [
28-
"0",
29-
"60",
30-
"300",
31-
"900",
32-
"1800",
33-
"3600",
34-
"7200",
35-
"10800",
36-
"14400",
37-
"43200",
38-
"86400",
39-
],
40-
};
6+
'0', '60', '300', '900', '1800', '3600', '7200', '10800', '14400', '43200', '86400'
7+
]
8+
}

components/klipfolio/klipfolio.app.mjs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,21 @@ export default {
4949
async options() {
5050
const response = await this.getDatasources();
5151
const datasourceIds = response.data.datasources;
52-
return datasourceIds.map(({
53-
id, name,
54-
}) => ({
52+
return datasourceIds.map(({ id, name }) => ({
5553
label: name,
56-
value: id,
54+
value: id
5755
}));
58-
},
56+
}
5957
},
58+
additionalProperties: {
59+
type: "object",
60+
label: "Additional Properties",
61+
description: "Data source additional properties. For example, Google Analytics API has the following properties: `oauth_provider_id`, `oauth_user_header`, `oauth_user_token`, `token_id`, `prop:profile_id`."
62+
}
6063
},
6164
methods: {
6265
_baseUrl() {
63-
return "https://app.klipfolio.com/api/1.0";
66+
return `https://app.klipfolio.com/api/1.0`;
6467
},
6568
async _makeRequest(opts = {}) {
6669
const {
@@ -85,18 +88,14 @@ export default {
8588
...args,
8689
});
8790
},
88-
async updateDatasource({
89-
datasourceId, ...args
90-
}) {
91+
async updateDatasource({ datasourceId, ...args }) {
9192
return this._makeRequest({
9293
path: `/datasources/${datasourceId}`,
9394
method: "put",
9495
...args,
9596
});
9697
},
97-
async deleteDatasource({
98-
datasourceId, ...args
99-
}) {
98+
async deleteDatasource({ datasourceId, ...args }) {
10099
return this._makeRequest({
101100
path: `/datasources/${datasourceId}`,
102101
method: "delete",

0 commit comments

Comments
 (0)