Skip to content
Merged
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/vapi/actions/create-call/create-call.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "vapi-create-call",
name: "Create Call",
description: "Starts a new conversation with an assistant. [See the documentation](https://docs.vapi.ai/api-reference/calls/create)",
version: "0.1.0",
version: "0.1.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import vapi from "../../vapi.app.mjs";
export default {
key: "vapi-list-assistant-id-options",
name: "List Assistant ID Options",
description: "Retrieves available options for the Assistant ID field.",
version: "0.0.2",
description: "Retrieves available options for the Assistant ID field. [See the documentation](https://docs.vapi.ai/api-reference/assistants/list)",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand All @@ -13,14 +13,27 @@ export default {
},
props: {
vapi,
createdAtLt: {
type: "string",
label: "Created At (Less Than)",
description: "The timestamp to filter assistants by creation date (less than). Example: `2026-01-01T00:00:00Z`",
optional: true,
},
},
async run({ $ }) {
const options = await vapi.propDefinitions.assistantId.options.call(this.vapi, {});
$.export("$summary", `Successfully retrieved ${options.length} option${
options.length === 1
? ""
: "s"
}`);
return options;
const {
options, context,
} = await vapi.propDefinitions.assistantId.options.call(this.vapi, {
prevContext: {
createdAtLt: this.createdAtLt,
},
});
$.export("$summary", `Successfully retrieved ${options?.length ?? 0} option${options?.length === 1
? ""
: "s"}`);
return {
options,
context,
};
},
Comment thread
michelle0927 marked this conversation as resolved.
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import vapi from "../../vapi.app.mjs";
export default {
key: "vapi-list-phone-number-id-options",
name: "List Phone Number ID Options",
description: "Retrieves available options for the Phone Number ID field.",
version: "0.0.2",
description: "Retrieves available options for the Phone Number ID field. [See the documentation](https://docs.vapi.ai/api-reference/phone-numbers/list)",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand All @@ -13,12 +13,27 @@ export default {
},
props: {
vapi,
createdAtLt: {
type: "string",
label: "Created At (Less Than)",
description: "The timestamp to filter phone numbers by creation date (less than). Example: `2026-01-01T00:00:00Z`",
optional: true,
},
},
async run({ $ }) {
const options = await vapi.propDefinitions.phoneNumberId.options.call(this.vapi);
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
const {
options, context,
} = await vapi.propDefinitions.phoneNumberId.options.call(this.vapi, {
prevContext: {
createdAtLt: this.createdAtLt,
},
});
$.export("$summary", `Successfully retrieved ${options?.length ?? 0} option${options?.length === 1
? ""
: "s"}`);
return options;
return {
options,
context,
};
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import vapi from "../../vapi.app.mjs";
export default {
key: "vapi-list-squad-id-options",
name: "List Squad ID Options",
description: "Retrieves available options for the Squad ID field.",
version: "0.0.2",
description: "Retrieves available options for the Squad ID field. [See the documentation](https://docs.vapi.ai/api-reference/squads/list)",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand All @@ -13,12 +13,27 @@ export default {
},
props: {
vapi,
createdAtLt: {
type: "string",
label: "Created At (Less Than)",
description: "The timestamp to filter squads by creation date (less than). Example: `2026-01-01T00:00:00Z`",
optional: true,
},
},
async run({ $ }) {
const options = await vapi.propDefinitions.squadId.options.call(this.vapi);
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
const {
options, context,
} = await vapi.propDefinitions.squadId.options.call(this.vapi, {
prevContext: {
createdAtLt: this.createdAtLt,
},
});
$.export("$summary", `Successfully retrieved ${options?.length ?? 0} option${options?.length === 1
? ""
: "s"}`);
return options;
return {
options,
context,
};
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
key: "vapi-update-assistant-settings",
name: "Update Assistant Settings",
description: "Updates the configuration settings for a specific assistant. [See the documentation](https://docs.vapi.ai/api-reference/assistants/update)",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/vapi/actions/upload-file/upload-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "vapi-upload-file",
name: "Upload File",
description: "Uploads a new file. [See the documentation](https://docs.vapi.ai/api-reference)",
version: "0.0.6",
version: "0.0.7",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/vapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/vapi",
"version": "0.4.0",
"version": "0.4.1",
"description": "Pipedream Vapi Components",
"main": "vapi.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "vapi-new-conversation",
name: "New Conversation Started",
description: "Emit new event when a voicebot starts a conversation.",
version: "0.0.2",
version: "0.0.3",
type: "source",
dedupe: "unique",
methods: {
Expand Down
87 changes: 52 additions & 35 deletions components/vapi/vapi.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,77 @@ export default {
type: "string",
label: "Assistant ID",
description: "ID of the assistant to start a conversation with or update",
async options() {
const assistants = await this.listAssistants({
params: {
limit: LIMIT,
},
async options({ prevContext }) {
return this._paginatedOptions({
fetchFn: (opts) => this.listAssistants(opts),
prevContext,
mapFn: ({
id: value, name: label,
}) => ({
label,
value,
}),
});
return assistants.map(({
id: value, name: label,
}) => ({
label,
value,
}));
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
},
squadId: {
type: "string",
label: "Squad ID",
description: "ID of the squad to assign to the conversation",
async options() {
const squads = await this.listSquads({
params: {
limit: LIMIT,
},
async options({ prevContext }) {
return this._paginatedOptions({
fetchFn: (opts) => this.listSquads(opts),
prevContext,
mapFn: ({
id: value, name: label,
}) => ({
label,
value,
}),
});
return squads.map(({
id: value, name: label,
}) => ({
label,
value,
}));
},
},
phoneNumberId: {
type: "string",
label: "Phone Number ID",
description: "ID of the phone number to use for the conversation",
async options() {
const phoneNumbers = await this.listPhoneNumbers({
params: {
limit: LIMIT,
},
async options({ prevContext }) {
return this._paginatedOptions({
fetchFn: (opts) => this.listPhoneNumbers(opts),
prevContext,
mapFn: ({
id: value, name, number,
}) => ({
label: (name && number)
? `${name} (${number})`
: (name ?? number ?? value),
value,
}),
});
return phoneNumbers.map(({
id: value, name, number,
}) => ({
label: (name && number)
? `${name} (${number})`
: (name ?? number ?? value),
value,
}));
},
},
},
methods: {
async _paginatedOptions({
fetchFn, prevContext, mapFn,
}) {
const params = {
limit: LIMIT,
createdAtLt: prevContext?.createdAtLt,
};
const items = await fetchFn({
params,
});
const lastItem = items[items.length - 1];
return {
options: items.map(mapFn),
context: {
createdAtLt: items.length === LIMIT
? lastItem?.createdAt
: undefined,
},
};
},
Comment thread
michelle0927 marked this conversation as resolved.
_baseUrl() {
return "https://api.vapi.ai";
},
Expand Down
Loading