Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe), packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier (CLI app), vendor/zapier-platform, and research/zapier vendor corpus. Gate 0 structure checks pass. Product code and research are not yet wired.
This commit is contained in:
commit
b4150c8250
1364 changed files with 6814366 additions and 0 deletions
41
vendor/zapier-platform/example-apps/dynamic-dropdown/triggers/species.js
vendored
Normal file
41
vendor/zapier-platform/example-apps/dynamic-dropdown/triggers/species.js
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
const { extractID } = require('../utils');
|
||||
|
||||
// Fetches a list of records from the endpoint
|
||||
const perform = async (z, bundle) => {
|
||||
const request = {
|
||||
url: 'https://swapi.info/api/species/',
|
||||
params: {},
|
||||
};
|
||||
|
||||
// This API returns things in "pages" of results
|
||||
if (bundle.meta.page) {
|
||||
request.params.page = 1 + bundle.meta.page;
|
||||
}
|
||||
|
||||
const response = await z.request(request);
|
||||
const speciesArray = response.data;
|
||||
return speciesArray.map((species) => {
|
||||
species.id = extractID(species.url);
|
||||
return species;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'species',
|
||||
noun: 'Species',
|
||||
display: {
|
||||
label: 'List of Species',
|
||||
description:
|
||||
'This is a hidden trigger, and is used in a Dynamic Dropdown of another trigger.',
|
||||
hidden: true,
|
||||
},
|
||||
|
||||
operation: {
|
||||
// Since this is a "hidden" trigger, there aren't any inputFields needed
|
||||
perform,
|
||||
// The folowing is a "hint" to the Zap Editor that this trigger returns data
|
||||
// "in pages", and that the UI should display an option to "load more" to
|
||||
// the human.
|
||||
canPaginate: true,
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue