{"id":23121993,"url":"https://github.com/sdairs/tinybird-trigger","last_synced_at":"2025-04-04T04:14:27.849Z","repository":{"id":266717243,"uuid":"899111446","full_name":"sdairs/tinybird-trigger","owner":"sdairs","description":"Example trigger.dev task implementations for Tinybird APIs","archived":false,"fork":false,"pushed_at":"2025-02-05T14:50:13.000Z","size":357,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T15:39:03.695Z","etag":null,"topics":["tinybird","triggerdev"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdairs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T16:34:32.000Z","updated_at":"2025-02-05T14:45:36.000Z","dependencies_parsed_at":"2024-12-05T18:35:06.395Z","dependency_job_id":"6ceaccad-82c8-495f-bffe-ed2521776331","html_url":"https://github.com/sdairs/tinybird-trigger","commit_stats":null,"previous_names":["sdairs/tinybird-trigger"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdairs%2Ftinybird-trigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdairs%2Ftinybird-trigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdairs%2Ftinybird-trigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdairs%2Ftinybird-trigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdairs","download_url":"https://codeload.github.com/sdairs/tinybird-trigger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247117765,"owners_count":20886439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tinybird","triggerdev"],"created_at":"2024-12-17T07:17:49.553Z","updated_at":"2025-04-04T04:14:27.820Z","avatar_url":"https://github.com/sdairs.png","language":"TypeScript","readme":"# @sdairs/tinybird-trigger-tasks\n\nA collection of [trigger.dev](https://trigger.dev) task implementations for Tinybird APIs.\n\n## Installation\n\n```bash\nnpm install @sdairs/tinybird-trigger-tasks\n# or\nyarn add @sdairs/tinybird-trigger-tasks\n# or\npnpm add @sdairs/tinybird-trigger-tasks\n```\n\n## Tasks\n\n### Query\n\nThe [Query](./src/tasks/query.ts) task [executes a SQL query using the Query API](https://www.tinybird.co/docs/api-reference/query-api#post--v0-sql).\n\n### Copy\n\nThe [Copy](./src/tasks/copy.ts) task [executes an on-demand Copy job using the Copy API](https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api#post--v0-pipes-(.+)-copy).\n\n## Usage\n\nYou can provide your Tinybird API token either through the environment variable `TINYBIRD_TOKEN` or directly in the task payload.\n\n### Copy Task\n\nTo run a Copy with no params:\n\n```typescript\nimport { tinybirdCopyTask } from '@sdairs/tinybird-trigger-tasks';\n\nconst copyResult = await tinybirdCopyTask.triggerAndWait({ \n  pipeId: \"YOUR_COPY_PIPE_ID\",\n  token: \"YOUR_TOKEN\" // Optional if TINYBIRD_TOKEN env var is set\n});\n```\n\nTo run a Copy with params:\n\n```typescript\nconst copyWithParamResult = await tinybirdCopyTask.triggerAndWait({ \n  pipeId: \"YOUR_COPY_WITH_PARAM_ID\", \n  params: { test_int: \"7\" },\n  token: \"YOUR_TOKEN\" // Optional if TINYBIRD_TOKEN env var is set\n});\n```\n\n### Query Task\n\nTo run a Query with no params:\n\n```typescript\nimport { tinybirdQueryTask } from '@sdairs/tinybird-trigger-tasks';\n\nconst queryResult = await tinybirdQueryTask.triggerAndWait({ \n  sql: \"SELECT * FROM table\",\n  token: \"YOUR_TOKEN\" // Optional if TINYBIRD_TOKEN env var is set\n});\n```\n\nTo run a Query with params:\n\n```typescript\nconst paramResult = await tinybirdQueryTask.triggerAndWait({ \n  sql: \"% SELECT * FROM my_ds WHERE number == {{Int8(test_int)}}\", \n  params: { test_int: \"7\" },\n  token: \"YOUR_TOKEN\" // Optional if TINYBIRD_TOKEN env var is set\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdairs%2Ftinybird-trigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdairs%2Ftinybird-trigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdairs%2Ftinybird-trigger/lists"}