-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] klipfolio #13229 #14693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e4bc63c
Added actions
lcaresia 8792a7a
Update components/klipfolio/package.json
lcaresia 4712421
Update components/klipfolio/package.json
lcaresia ebf8b76
Update components/klipfolio/actions/update-datasource/update-datasour…
lcaresia 4c31ca3
Merge branch 'master' into issue-13229
lcaresia 1d1cc9c
Merge remote-tracking branch 'origin/master' into issue-13229
lcaresia 8ab16ec
Fixed requested changes
lcaresia 53dfeec
Merge branch 'issue-13229' of github.com:PipedreamHQ/pipedream into i…
lcaresia b489f66
Fixed requested changes
lcaresia 047f162
Update components/klipfolio/actions/update-datasource/update-datasour…
lcaresia a5055d9
Added requested changes
lcaresia 0d4fffc
Added requested changes
lcaresia e8ec223
Merge branch 'master' into issue-13229
lcaresia b356a1b
Done requests changes
lcaresia c4c0922
Added actions
lcaresia d3fa274
Merge branch 'master' into issue-13229
lcaresia 9aed661
Make additional properties optional
vunguyenhung 55dbfb3
Merge branch 'master' into issue-13229
lcaresia 1c658fc
Update klipfolio.app.mjs
lcaresia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
components/klipfolio/actions/create-datasource/create-datasource.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import app from "../../klipfolio.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "klipfolio-create-datasource", | ||
| name: "Create Datasource", | ||
| description: "Create a data source. [See the documentation](https://apidocs.klipfolio.com/reference/data-sources#post-datasources)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "name", | ||
| ], | ||
| }, | ||
| description: { | ||
| propDefinition: [ | ||
| app, | ||
| "description", | ||
| ], | ||
| }, | ||
| format: { | ||
| propDefinition: [ | ||
| app, | ||
| "format", | ||
| ], | ||
| }, | ||
| connector: { | ||
| propDefinition: [ | ||
| app, | ||
| "connector", | ||
| ], | ||
| }, | ||
| refreshInterval: { | ||
| propDefinition: [ | ||
| app, | ||
| "refreshInterval", | ||
| ], | ||
| }, | ||
| endpointUrl: { | ||
| propDefinition: [ | ||
| app, | ||
| "endpointUrl", | ||
| ], | ||
| }, | ||
| method: { | ||
| propDefinition: [ | ||
| app, | ||
| "method", | ||
| ], | ||
| }, | ||
| }, | ||
|
|
||
| async run({ $ }) { | ||
| const response = await this.app.createDatasource({ | ||
| $, | ||
| data: { | ||
| name: this.name, | ||
| description: this.description, | ||
| format: this.format, | ||
| connector: this.connector, | ||
| refresh_interval: parseInt(this.refreshInterval, 10), | ||
| properties: { | ||
| endpoint_url: this.endpointUrl, | ||
| method: this.method, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created Datasource named '${this.name}'`); | ||
| return response; | ||
| }, | ||
| }; |
27 changes: 27 additions & 0 deletions
27
components/klipfolio/actions/delete-datasource/delete-datasource.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import app from "../../klipfolio.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "klipfolio-delete-datasource", | ||
| name: "Delete Datasource", | ||
| description: "Delete the data source associated with a specific data source ID. [See the documentation](https://apidocs.klipfolio.com/reference/data-sources#delete-datasourcesid)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| datasourceId: { | ||
| propDefinition: [ | ||
| app, | ||
| "datasourceId", | ||
| ], | ||
| }, | ||
| }, | ||
|
|
||
| async run({ $ }) { | ||
| const response = await this.app.deleteDatasource({ | ||
| $, | ||
| datasourceId: this.datasourceId, | ||
| }); | ||
| $.export("$summary", `Successfully deleted datasource with ID: ${this.datasourceId}`); | ||
| return response; | ||
| }, | ||
| }; |
51 changes: 51 additions & 0 deletions
51
components/klipfolio/actions/update-datasource/update-datasource.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import app from "../../klipfolio.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "klipfolio-update-datasource", | ||
| name: "Update Datasource", | ||
| description: "Update the specified data source. [See the documentation](https://apidocs.klipfolio.com/reference/data-sources#put-datasourcesid)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| datasourceId: { | ||
| propDefinition: [ | ||
| app, | ||
| "datasourceId", | ||
| ], | ||
| }, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "name", | ||
| ], | ||
| }, | ||
| description: { | ||
| propDefinition: [ | ||
| app, | ||
| "description", | ||
| ], | ||
| }, | ||
| refreshInterval: { | ||
| propDefinition: [ | ||
| app, | ||
| "refreshInterval", | ||
| ], | ||
| }, | ||
| }, | ||
|
|
||
| async run({ $ }) { | ||
| const response = await this.app.updateDatasource({ | ||
| $, | ||
| datasourceId: this.datasourceId, | ||
| data: { | ||
| name: this.name, | ||
| description: this.description, | ||
| refreshInterval: parseInt(this.refreshInterval, 10), | ||
|
|
||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully updated Datasource named '${this.name}'`); | ||
| return response; | ||
| }, | ||
| }; | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| export default { | ||
| DATASOURCE_CONNECTORS: [ | ||
| "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", | ||
| ], | ||
| REFRESH_INTERVALS: [ | ||
| "0", | ||
| "60", | ||
| "300", | ||
| "900", | ||
| "1800", | ||
| "3600", | ||
| "7200", | ||
| "10800", | ||
| "14400", | ||
| "43200", | ||
| "86400", | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
| import constants from "./common/constants.mjs"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "klipfolio", | ||
| propDefinitions: { | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "Name of the Datasource", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "Description of the Datasource", | ||
| }, | ||
| format: { | ||
| type: "string", | ||
| label: "Format", | ||
| description: "Format of the Datasource, i.e.: `xml`", | ||
| }, | ||
| connector: { | ||
| type: "string", | ||
| label: "Connector", | ||
| description: "Connector of the Datasource", | ||
| options: constants.DATASOURCE_CONNECTORS, | ||
| }, | ||
| refreshInterval: { | ||
| type: "string", | ||
| label: "Refresh Interval", | ||
| description: "Refresh Interval of the Datasource", | ||
| options: constants.REFRESH_INTERVALS, | ||
| }, | ||
| endpointUrl: { | ||
| type: "string", | ||
| label: "Endpoint URL", | ||
| description: "Endpoint URL of the Datasource, i.e.: `http://test/data/scatter.xml`", | ||
| }, | ||
| method: { | ||
| type: "string", | ||
| label: "Method", | ||
| description: "Method for the endpoint, i.e.: `GET`", | ||
| }, | ||
| datasourceId: { | ||
| type: "string", | ||
| label: "Datasource ID", | ||
| description: "ID of the Datasource", | ||
| async options() { | ||
| const response = await this.getDatasources(); | ||
| const datasourceIds = response.data.datasources; | ||
| return datasourceIds.map(({ | ||
| id, name, | ||
| }) => ({ | ||
| label: name, | ||
| value: id, | ||
| })); | ||
| }, | ||
| }, | ||
| }, | ||
| methods: { | ||
| _baseUrl() { | ||
| return "https://app.klipfolio.com/api/1.0"; | ||
| }, | ||
| async _makeRequest(opts = {}) { | ||
| const { | ||
| $ = this, | ||
| path, | ||
| headers, | ||
| ...otherOpts | ||
| } = opts; | ||
| return axios($, { | ||
| ...otherOpts, | ||
| url: this._baseUrl() + path, | ||
| headers: { | ||
| ...headers, | ||
| "kf-api-key": `${this.$auth.api_key}`, | ||
| }, | ||
| }); | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| async createDatasource(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/datasources", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async updateDatasource({ | ||
| datasourceId, ...args | ||
| }) { | ||
| return this._makeRequest({ | ||
| path: `/datasources/${datasourceId}`, | ||
| method: "put", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async deleteDatasource({ | ||
| datasourceId, ...args | ||
| }) { | ||
| return this._makeRequest({ | ||
| path: `/datasources/${datasourceId}`, | ||
| method: "delete", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async getDatasources(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/datasources", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,18 @@ | ||
| { | ||
| "name": "@pipedream/klipfolio", | ||
| "version": "0.0.2", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream Klipfolio Components", | ||
| "main": "dist/app/klipfolio.app.mjs", | ||
| "main": "klipfolio.app.mjs", | ||
| "keywords": [ | ||
| "pipedream", | ||
| "klipfolio" | ||
| ], | ||
| "files": ["dist"], | ||
| "homepage": "https://pipedream.com/apps/klipfolio", | ||
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.0.3" | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.