Skip to content
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

[Components] xata #13198 #13853

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/algodocs/algodocs.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/allocadence/allocadence.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/ical/ical.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/nioleads/nioleads.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/virifi/virifi.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
3 changes: 0 additions & 3 deletions components/xata/.gitignore

This file was deleted.

67 changes: 67 additions & 0 deletions components/xata/actions/create-record/create-record.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import app from "../../xata.app.mjs";

export default {
key: "xata-create-record",
name: "Create Record",
description: "Create a new Record in the specified database. [See the documentation](https://xata.io/docs/api-reference/db/db_branch_name/tables/table_name/data#insert-record)",
version: "0.0.1",
type: "action",
props: {
app,
endpoint: {
propDefinition: [
app,
"endpoint",
],
},
workspace: {
propDefinition: [
app,
"workspace",
],
},
database: {
propDefinition: [
app,
"database",
(c) => ({
workspace: c.workspace,
}),
],
},
branch: {
propDefinition: [
app,
"branch",
(c) => ({
endpoint: c.endpoint,
database: c.database,
}),
],
},
table: {
propDefinition: [
app,
"table",
],
},
recordData: {
propDefinition: [
app,
"recordData",
],
},
},
async run({ $ }) {
const response = await this.app.createRecord({
$,
endpoint: this.endpoint,
database: this.database,
branch: this.branch,
table: this.table,
data: this.recordData,
});
$.export("$summary", `Successfully created Record with ID: '${response.id}'`);
return response;
},
};
42 changes: 42 additions & 0 deletions components/xata/actions/list-branches/list-branches.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import app from "../../xata.app.mjs";

export default {
key: "xata-list-branches",
name: "List Branches",
description: "List branches of the specified database. [See the documentation](https://xata.io/docs/api-reference/dbs/db_name#list-branches)",
version: "0.0.1",
type: "action",
props: {
app,
endpoint: {
propDefinition: [
app,
"endpoint",
],
},
workspace: {
propDefinition: [
app,
"workspace",
],
},
database: {
propDefinition: [
app,
"database",
(c) => ({
workspace: c.workspace,
}),
],
},
},
async run({ $ }) {
const response = await this.app.listBranches({
$,
endpoint: this.endpoint,
database: this.database,
});
$.export("$summary", `Successfully retrieved '${response.branches.length}' branches`);
return response;
},
};
80 changes: 80 additions & 0 deletions components/xata/actions/replace-record/replace-record.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import app from "../../xata.app.mjs";

export default {
key: "xata-replace-record",
name: "Replace Record",
description: "Replace a record with the specified ID. [See the documentation](https://xata.io/docs/api-reference/db/db_branch_name/tables/table_name/data/record_id#insert-record-with-id)",
version: "0.0.1",
type: "action",
props: {
app,
endpoint: {
propDefinition: [
app,
"endpoint",
],
},
workspace: {
propDefinition: [
app,
"workspace",
],
},
database: {
propDefinition: [
app,
"database",
(c) => ({
workspace: c.workspace,
}),
],
},
branch: {
propDefinition: [
app,
"branch",
(c) => ({
endpoint: c.endpoint,
database: c.database,
}),
],
},
table: {
propDefinition: [
app,
"table",
],
},
recordId: {
propDefinition: [
app,
"recordId",
(c) => ({
endpoint: c.endpoint,
database: c.database,
table: c.table,
branch: c.branch,
}),
],
},
recordData: {
propDefinition: [
app,
"recordData",
],
},
},
async run({ $ }) {
const response = await this.app.replaceRecord({
$,
endpoint: this.endpoint,
database: this.database,
branch: this.branch,
table: this.table,
recordId: this.recordId,
data: this.recordData,
});
$.export("$summary", `Successfully replaced Record with ID: '${response.id}'`);
return response;
},
};
80 changes: 80 additions & 0 deletions components/xata/actions/update-record/update-record.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import app from "../../xata.app.mjs";

export default {
key: "xata-update-record",
name: "Update Record",
description: "Update or create a record with the specified ID. [See the documentation](https://xata.io/docs/api-reference/db/db_branch_name/tables/table_name/data/record_id#upsert-record-with-id)",
version: "0.0.1",
type: "action",
props: {
app,
endpoint: {
propDefinition: [
app,
"endpoint",
],
},
workspace: {
propDefinition: [
app,
"workspace",
],
},
database: {
propDefinition: [
app,
"database",
(c) => ({
workspace: c.workspace,
}),
],
},
branch: {
propDefinition: [
app,
"branch",
(c) => ({
endpoint: c.endpoint,
database: c.database,
}),
],
},
table: {
propDefinition: [
app,
"table",
],
},
recordId: {
propDefinition: [
app,
"recordId",
(c) => ({
endpoint: c.endpoint,
database: c.database,
table: c.table,
branch: c.branch,
}),
],
},
recordData: {
propDefinition: [
app,
"recordData",
],
},
},
async run({ $ }) {
const response = await this.app.updateRecord({
$,
endpoint: this.endpoint,
database: this.database,
branch: this.branch,
table: this.table,
recordId: this.recordId,
data: this.recordData,
});
$.export("$summary", `Successfully updated/created Record with ID: '${response.id}'`);
return response;
},
};
13 changes: 0 additions & 13 deletions components/xata/app/xata.app.ts

This file was deleted.

10 changes: 6 additions & 4 deletions components/xata/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "@pipedream/xata",
"version": "0.0.2",
"description": "Pipedream Xata Components",
"main": "dist/app/xata.app.mjs",
"version": "0.1.0",
"description": "Pipedream xata Components",
"main": "xata.app.mjs",
lcaresia marked this conversation as resolved.
Show resolved Hide resolved
Comment on lines +3 to +5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should include the @pipedream/platform dependency in package.json.

  "dependencies": {
    "@pipedream/platform": "^3.0.1",
  }

"keywords": [
"pipedream",
"xata"
],
"files": ["dist"],
"homepage": "https://pipedream.com/apps/xata",
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.2"
}
}
Loading
Loading