import {
getState,
setState,
} from "windmill-client@1";
import StripeClient from "[email protected]";
type Stripe = {
token: string;
};
export async function main(auth: Stripe) {
const stripe = new StripeClient(auth.token, {
httpClient: StripeClient.createFetchHttpClient(),
});
const lastCheck = (await getState()) || 0;
await setState(Date.now());
const customers = await stripe.customers.list({
created: { gt: lastCheck },
});
return customers.data;
}
Submitted by hugo989 14 days ago