@pipedream/habitica
Version:
Pipedream Habitica Components
34 lines (32 loc) • 834 B
JavaScript
import habitica from "../../habitica.app.mjs";
export default {
key: "habitica-list-challenge-id-options",
name: "List Challenge ID Options",
description: "Retrieves available options for the Challenge ID field.",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
habitica,
page: {
type: "integer",
label: "Page",
description: "The page of results to retrieve.",
min: 0,
default: 0,
},
},
async run({ $ }) {
const options = await habitica.propDefinitions.challengeId.options.call(this.habitica, {
page: this.page,
});
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
? ""
: "s"}`);
return options;
},
};