Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 0 additions & 3 deletions components/listen_notes/.gitignore

This file was deleted.

58 changes: 58 additions & 0 deletions components/listen_notes/actions/full-search/full-search.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import app from "../../listen_notes.app.mjs";

export default {
key: "listen_notes-full-search",
name: "Full Search",
description: "Full-text search on episodes, podcasts, or curated lists of podcasts. [See the documentation](https://www.listennotes.com/api/docs/#get-api-v2-search)",
version: "0.0.1",
type: "action",
props: {
app,
q: {
propDefinition: [
app,
"q",
],
},
sortByDate: {
propDefinition: [
app,
"sortByDate",
],
},
type: {
propDefinition: [
app,
"type",
],
},
language: {
propDefinition: [
app,
"language",
],
},
offset: {
propDefinition: [
app,
"offset",
],
},
},

async run({ $ }) {
const response = await this.app.fullSearch({
$,
params: {
q: this.q,
sort_by_date: this.sortByDate,
type: this.type,
language: this.language,
},
});

$.export("$summary", `Successfully retrieved ${response.results.length} results`);

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import app from "../../listen_notes.app.mjs";

export default {
key: "listen_notes-get-episode-details",
name: "Get Episode Details",
description: "Get the details of the selected episode. [See the documentation](https://www.listennotes.com/api/docs/#get-api-v2-episodes-id)",
version: "0.0.1",
type: "action",
props: {
app,
q: {
propDefinition: [
app,
"q",
],
optional: true,
},
language: {
propDefinition: [
app,
"language",
],
},
offset: {
propDefinition: [
app,
"offset",
],
},
id: {
propDefinition: [
app,
"id",
(c) => ({
q: c.q,
language: c.language,
offset: c.offset,
}),
],
},
showTranscript: {
propDefinition: [
app,
"showTranscript",
],
},
},

async run({ $ }) {
const response = await this.app.getEpisodeDetails({
$,
id: this.id,
params: {
show_transcript: this.showTranscript,
},
});

$.export("$summary", `Successfully retrieved details for the episode '${response.title}'`);

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import app from "../../listen_notes.app.mjs";

export default {
key: "listen_notes-get-podcast-details",
name: "Get Podcast Details",
description: "Get the details of the selected podcast. [See the documentation](https://www.listennotes.com/api/docs/#get-api-v2-podcasts-id)",
version: "0.0.1",
type: "action",
props: {
app,
q: {
propDefinition: [
app,
"q",
],
optional: true,
},
language: {
propDefinition: [
app,
"language",
],
},
offset: {
propDefinition: [
app,
"offset",
],
},
id: {
propDefinition: [
app,
"id",
(c) => ({
q: c.q,
type: "podcast",
language: c.language,
offset: c.offset,
}),
],
},
nextEpisodePubDate: {
propDefinition: [
app,
"nextEpisodePubDate",
],
},
sort: {
propDefinition: [
app,
"sort",
],
},
},

async run({ $ }) {
const response = await this.app.getPodcastDetails({
$,
id: this.id,
params: {
next_episode_pub_date: this.nextEpisodePubDate,
sort: this.sort,
},
});

$.export("$summary", `Successfully retrieved details for the podcast '${response.title}'`);

return response;
},
};
13 changes: 0 additions & 13 deletions components/listen_notes/app/listen_notes.app.ts

This file was deleted.

37 changes: 37 additions & 0 deletions components/listen_notes/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
export default {
SEARCH_SORTING_OPTIONS: [
{
value: "0",
label: "Sort by Relevance",
},
{
value: "1",
label: "Sort by Date",
},
],
EPISODES_SORTING_OPTIONS: [
{
value: "recent_first",
label: "Recent First",
},
{
value: "oldest_first",
label: "Oldest First",
},
],
TRANSCRIPT_OPTIONS: [
{
value: "0",
label: "Don't include transcript",
},
{
value: "1",
label: "Include transcript",
},
],
TYPE_OPTIONS: [
"episode",
"podcast",
"curated",
],
};
Loading
Loading