-
-
Save chronark/d47c66d02f7c217d0c63888bc0553de9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Tinybird} from "./client"; | |
import {z} from "zod" | |
const tb = new Tinybird("TINYBIRD_TOKEN") | |
const getUsage = tb.buildPipe({ | |
pipe: "get_usage__v1", | |
parameters: z.object({ | |
teamId: z.string(), | |
year: z.number(), | |
month: z.number(), | |
}), | |
data: z.object({ | |
teamId: z.string(), | |
year: z.number(), | |
month: z.number(), | |
day: z.number(), | |
usage: z.number(), | |
}) | |
}) | |
async function main(){ | |
const {data} = await getUsage({ | |
teamId: "team_1", | |
year: 2023, | |
month: 1, | |
}) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment