Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into connect/workflow-sd…
Browse files Browse the repository at this point in the history
…k-docs
  • Loading branch information
dylburger committed Nov 1, 2024
2 parents 0a5c3b6 + 02197b3 commit 7cb7338
Show file tree
Hide file tree
Showing 221 changed files with 5,574 additions and 391 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import app from "../../aitable_ai.app.mjs";

export default {
key: "aitable_ai-create-datasheet",
name: "Create Datasheet",
description: "Create a datasheet in the specified space. [See the documentation](https://developers.aitable.ai/api/reference#tag/Datasheet/operation/create-datasheets)",
version: "0.0.1",
type: "action",
props: {
app,
spaceId: {
propDefinition: [
app,
"spaceId",
],
},
name: {
propDefinition: [
app,
"name",
],
},
description: {
propDefinition: [
app,
"description",
],
},
folderId: {
propDefinition: [
app,
"folderId",
],
},
},

async run({ $ }) {
const response = await this.app.createDatasheet({
$,
spaceId: this.spaceId,
data: {
name: this.name,
description: this.description,
folderId: this.folderId,
},
});
$.export("$summary", `Successfully created Datasheet with ID '${response.data.id}'`);
return response;
},
};
44 changes: 44 additions & 0 deletions components/aitable_ai/actions/create-field/create-field.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import app from "../../aitable_ai.app.mjs";

export default {
key: "aitable_ai-create-field",
name: "Create Field",
description: "Create a new field in the specified datasheet. [See the documentation](https://developers.aitable.ai/api/reference#tag/Field/operation/create-fields)",
version: "0.0.1",
type: "action",
props: {
app,
spaceId: {
propDefinition: [
app,
"spaceId",
],
},
type: {
propDefinition: [
app,
"type",
],
},
name: {
propDefinition: [
app,
"name",
],
description: "Name of the Field",
},
},

async run({ $ }) {
const response = await this.app.createField({
$,
spaceId: this.spaceId,
data: {
type: this.type,
name: this.name,
},
});
$.export("$summary", `Successfully sent request to create field. Result: '${response.message}'`);
return response;
},
};
34 changes: 34 additions & 0 deletions components/aitable_ai/actions/delete-field/delete-field.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import app from "../../aitable_ai.app.mjs";

export default {
key: "aitable_ai-delete-field",
name: "Delete Field",
description: "Delete a field in the specified datasheet. [See the documentation](https://developers.aitable.ai/api/reference/#tag/Field/operation/delete-fields)",
version: "0.0.1",
type: "action",
props: {
app,
spaceId: {
propDefinition: [
app,
"spaceId",
],
},
fieldId: {
propDefinition: [
app,
"fieldId",
],
},
},

async run({ $ }) {
const response = await this.app.deleteField({
$,
spaceId: this.spaceId,
fieldId: this.fieldId,
});
$.export("$summary", `Successfully deleted the field with ID '${this.fieldId}'`);
return response;
},
};
120 changes: 115 additions & 5 deletions components/aitable_ai/aitable_ai.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,121 @@
import { axios } from "@pipedream/platform";
import constants from "./common/constants.mjs";

export default {
type: "app",
app: "aitable_ai",
propDefinitions: {},
propDefinitions: {
spaceId: {
type: "string",
label: "Space ID",
description: "ID of the Space",
async options() {
const response = await this.getSpaces({});
const spaceIds = response.data.spaces;
return spaceIds.map(({
id, name,
}) => ({
value: id,
label: name,
}));
},
},
fieldId: {
type: "string",
label: "Field ID",
description: "ID of the Field",
async options() {
const response = await this.getFields({});
const fieldIds = response.data.fields;
return fieldIds.map(({
id, name,
}) => ({
value: id,
label: name,
}));
},
},
name: {
type: "string",
label: "Name",
description: "Name of the Datasheet",
},
description: {
type: "string",
label: "Description",
description: "Description of the Datasheet",
},
folderId: {
type: "string",
label: "Folder ID",
description: "The Folder ID is located in the `URL` when the folder is selected on the `Workbench page`, i.e.: if the URL is `https://aitable.ai/workbench/123456`, the `Folder ID` is 123456",
optional: true,
},
type: {
type: "string",
label: "Type",
description: "Type of the Field",
options: constants.FIELD_TYPES,
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://aitable.ai/fusion/v1";
},
async _makeRequest(opts = {}) {
const {
$ = this,
path,
headers,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
...headers,
Authorization: `Bearer ${this.$auth.api_token}`,
},
});
},
async createDatasheet({
spaceId, ...args
}) {
return this._makeRequest({
path: `/spaces/${spaceId}/datasheets`,
method: "post",
...args,
});
},
async createField({
spaceId, ...args
}) {
return this._makeRequest({
path: `/spaces/${spaceId}/datasheets/${this.$auth.datasheet_id}/fields`,
method: "post",
...args,
});
},
async deleteField({
spaceId, fieldId, ...args
}) {
return this._makeRequest({
path: `/spaces/${spaceId}/datasheets/${this.$auth.datasheet_id}/fields/${fieldId}`,
method: "delete",
...args,
});
},
async getSpaces(args = {}) {
return this._makeRequest({
path: "/spaces",
...args,
});
},
async getFields(args = {}) {
return this._makeRequest({
path: `/datasheets/${this.$auth.datasheet_id}/fields`,
...args,
});
},
},
};
};
11 changes: 11 additions & 0 deletions components/aitable_ai/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
FIELD_TYPES: [
"Text",
"URL",
"Phone",
"Email",
"WorkDoc",
"AutoNumber",
"CreatedBy",
],
};
7 changes: 5 additions & 2 deletions components/aitable_ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/aitable_ai",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream AITable.ai Components",
"main": "aitable_ai.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
}
2 changes: 1 addition & 1 deletion components/anthropic/actions/chat/chat.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import constants from "../common/constants.mjs";

export default {
name: "Chat",
version: "0.0.8",
version: "0.0.9",
key: "anthropic-chat",
description: "The Chat API. [See the documentation](https://docs.anthropic.com/claude/reference/messages_post)",
type: "action",
Expand Down
1 change: 1 addition & 0 deletions components/anthropic/actions/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
MESSAGE_MODELS: [
"claude-3-5-sonnet-20241022",
"claude-3-5-sonnet-20240620",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
Expand Down
2 changes: 1 addition & 1 deletion components/anthropic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/anthropic",
"version": "0.0.10",
"version": "0.0.11",
"description": "Pipedream Anthropic (Claude) Components",
"main": "anthropic.app.mjs",
"keywords": [
Expand Down
39 changes: 39 additions & 0 deletions components/bippybox/actions/activate-box/activate-box.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import app from "../../bippybox.app.mjs";

export default {
key: "bippybox-activate-box",
name: "Activate Box",
description: "Triggers the BippyBox to play an audio file. [See the documentation](https://bippybox.io/docs/).",
version: "0.0.1",
type: "action",
props: {
app,
device: {
type: "string",
label: "Device",
description: "The device identifier. Eg. `DEVICE123`.",
},
url: {
type: "string",
label: "URL",
description: "The URL of the audio file to play. Eg. `https://storage.example.com/users/exampleUserUID67890/audio/SampleAudioFile.wav?alt=media&token=exampleToken123456`.",
},
},
async run({ $ }) {
const {
app,
device,
url,
} = this;

const response = await app.activateBox({
$,
data: {
device,
URL: url,
},
});
$.export("$summary", "Successfully activated BippyBox.");
return response;
},
};
Loading

0 comments on commit 7cb7338

Please sign in to comment.