diff --git a/.github/workflows/ci-tinybird.yaml b/.github/workflows/ci-tinybird.yaml new file mode 100644 index 0000000000..3678c0ea7f --- /dev/null +++ b/.github/workflows/ci-tinybird.yaml @@ -0,0 +1,22 @@ +name: CI Tinybird +on: + # Temporarily disabled + # push: + # branches: + # - main + + # pull_request: + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ci: + uses: tinybirdco/ci/.github/workflows/ci.yml@main + with: + data_project_dir: packages/twenty-tinybird + secrets: + tb_admin_token: ${{ secrets.TINYBIRD_ADMIN_TOKEN }} + tb_host: https://api.eu-central-1.aws.tinybird.co \ No newline at end of file diff --git a/.gitignore b/.gitignore index c5bb33e003..20f9749222 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ storybook-static .nyc_output test-results/ dump.rdb +.tinyb diff --git a/packages/twenty-tinybird/.gitignore b/packages/twenty-tinybird/.gitignore new file mode 100644 index 0000000000..77f27a5932 --- /dev/null +++ b/packages/twenty-tinybird/.gitignore @@ -0,0 +1,2 @@ +.tinyb +.venv \ No newline at end of file diff --git a/packages/twenty-tinybird/.tinyenv b/packages/twenty-tinybird/.tinyenv new file mode 100644 index 0000000000..2c802ef9e4 --- /dev/null +++ b/packages/twenty-tinybird/.tinyenv @@ -0,0 +1,18 @@ + +VERSION=0.0.0 + + + +########## +# OPTIONAL env vars + +# Don't print CLI version warning message if there's a new available version +# TB_VERSION_WARNING=0 + +# Skip regression tests +# TB_SKIP_REGRESSION=0 + +# Use `OBFUSCATE_REGEX_PATTERN` and `OBFUSCATE_PATTERN_SEPARATOR` environment variables to define a regex pattern and a separator (in case of a single string with multiple regex) to obfuscate secrets in the CLI output. +# OBFUSCATE_REGEX_PATTERN="https://(www\.)?[^/]+||^Follow these instructions =>" +# OBFUSCATE_PATTERN_SEPARATOR=|| +########## diff --git a/packages/twenty-tinybird/README.md b/packages/twenty-tinybird/README.md new file mode 100644 index 0000000000..aa0d74023d --- /dev/null +++ b/packages/twenty-tinybird/README.md @@ -0,0 +1,42 @@ + +## How to use +Create a virtual enviroment and install tinybird +```sh +python3 -m venv .venv +source .venv/bin/activate +pip install tinybird-cli +``` +Authenticate using your admin token from your workspace (twenty_analytics_cli_playground) +```sh +tb auth -i + +** List of available regions: +[1] us-east4 (gcp) (https://app.us-east.tinybird.co) +[2] europe-west3 (gcp) (https://app.tinybird.co/gcp/europe-west3) +[3] us-east-1 (aws) (https://app.tinybird.co/aws/us-east-1) +[4] us-west-2 (aws) (https://app.tinybird.co/aws/us-west-2) +[5] eu-central-1 (aws) (https://app.tinybird.co/aws/eu-central-1) <- this +[0] Cancel + +Use region [5]: +Copy the "admin your@email" token from from https://app.tinybird.co/tokens and paste it here: +** Auth successful! +** Configuration written to .tinyb file, consider adding it to .gitignore +``` +To sync your changes to Tinybird use: +```sh +tb push --force --push-deps +``` +To pull data from Tinybird use: +```sh +tb pull +``` +Things I learned: + +* When creating Materialied Views think about populating it first using the files from the fixtures +* When pushing your pipes prefer to push one by one so you can have more coherent error messages +* The Include files will be nodes that will be added at the start of your node in Tinybird UI +* It's best to stick only with only the CLI or the UI when developping in Tinybird +* If you want to format the data us the tb fmt command, perhaps we can add it to the linter in a next pull request. + + diff --git a/packages/twenty-tinybird/datasources/event.datasource b/packages/twenty-tinybird/datasources/event.datasource new file mode 100644 index 0000000000..c0629d75c7 --- /dev/null +++ b/packages/twenty-tinybird/datasources/event.datasource @@ -0,0 +1,11 @@ +SCHEMA > + `action` String `json:$.action`, + `timestamp` DateTime64(3) `json:$.timestamp`, + `version` String `json:$.version`, + `userId` String `json:$.userId` DEFAULT '', + `workspaceId` String `json:$.workspaceId` DEFAULT '', + `payload` String `json:$.payload` + +ENGINE MergeTree +ENGINE_PARTITION_KEY toYear(timestamp) +ENGINE_SORTING_KEY action, timestamp diff --git a/packages/twenty-tinybird/datasources/fixtures/event.csv b/packages/twenty-tinybird/datasources/fixtures/event.csv new file mode 100644 index 0000000000..bb326307e2 --- /dev/null +++ b/packages/twenty-tinybird/datasources/fixtures/event.csv @@ -0,0 +1,283 @@ +"action","timestamp","version","userId","workspaceId","payload" +"apiKey.created","2024-10-24 15:55:35.177","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 15:55:35.178","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 15:55:35.212","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 15:57:42.810","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 15:57:42.812","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 15:57:42.989","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 16:03:18.134","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 16:03:18.135","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"apiKey.created","2024-10-24 16:03:18.205","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 15:55:31.949","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 15:55:31.950","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 15:55:32.027","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 15:57:31.970","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 15:57:31.979","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 15:57:34.033","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 16:03:17.602","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 16:03:17.602","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"attachment.created","2024-10-24 16:03:17.755","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 15:55:33.498","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 15:55:33.499","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 15:55:33.602","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 15:57:42.984","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 15:57:42.986","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 15:57:43.219","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 16:03:19.139","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 16:03:19.141","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"auditLog.created","2024-10-24 16:03:19.289","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 15:55:33.732","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 15:55:33.733","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 15:55:33.836","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 15:57:43.255","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 15:57:43.257","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 15:57:43.454","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 16:03:18.813","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 16:03:18.814","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"blocklist.created","2024-10-24 16:03:19.148","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:55:31.547","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:55:32.156","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:55:32.158","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:55:32.279","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:57:26.908","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:57:26.914","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:57:26.914","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 15:57:27.059","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 16:03:16.523","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 16:03:16.524","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 16:03:16.525","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannel.created","2024-10-24 16:03:16.686","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 15:55:32.230","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 15:55:32.231","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 15:55:32.334","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 15:57:27.238","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 15:57:27.238","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 15:57:27.611","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 16:03:16.756","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 16:03:16.757","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarChannelEventAssociation.created","2024-10-24 16:03:16.861","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEvent.created","2024-10-24 15:55:31.420","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEvent.created","2024-10-24 15:55:32.015","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEvent.created","2024-10-24 15:57:26.778","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEvent.created","2024-10-24 15:57:27.090","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEvent.created","2024-10-24 16:03:16.377","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEvent.created","2024-10-24 16:03:16.692","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 15:55:31.728","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 15:55:31.730","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 15:55:32.060","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 15:57:26.901","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 15:57:26.902","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 15:57:27.045","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 16:03:16.517","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 16:03:16.517","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"calendarEventParticipant.created","2024-10-24 16:03:16.682","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-22 09:31:13.563","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-22 10:17:00.671","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-22 13:16:50.935","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 15:55:36.922","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 15:55:36.927","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 15:55:38.123","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 15:57:34.430","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 15:57:34.443","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 15:57:37.343","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 16:03:17.741","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 16:03:17.742","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"company.created","2024-10-24 16:03:17.854","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:55:31.333","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:55:33.225","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:55:33.226","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:55:33.271","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:57:26.651","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:57:44.533","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:57:44.534","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 15:57:44.621","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 16:03:16.374","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 16:03:18.781","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 16:03:18.782","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"connectedAccount.created","2024-10-24 16:03:18.922","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 15:55:34.589","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 15:55:34.590","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 15:55:34.651","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 15:57:44.022","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 15:57:44.023","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 15:57:44.183","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 16:03:20.770","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 16:03:20.772","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"favorite.created","2024-10-24 16:03:20.964","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"function.execute","2024-10-22 14:51:25.149","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":37,""status"":""SUCCESS"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""testingMiVida""}" +"function.execute","2024-10-22 14:54:59.296","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":38,""status"":""ERROR"",""errorType"":""ReferenceError"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""testingMiVida""}" +"function.execute","2024-10-22 14:55:00.677","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":32,""status"":""ERROR"",""errorType"":""ReferenceError"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""testingMiVida""}" +"function.execute","2024-10-22 14:55:03.512","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":34,""status"":""ERROR"",""errorType"":""ReferenceError"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""testingMiVida""}" +"message.created","2024-10-24 15:55:32.004","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"message.created","2024-10-24 15:57:26.780","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"message.created","2024-10-24 16:03:16.384","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 15:55:32.169","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 15:55:32.170","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 15:55:32.281","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 15:57:26.872","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 15:57:26.872","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 15:57:27.035","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 16:03:16.506","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 16:03:16.507","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannel.created","2024-10-24 16:03:16.661","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 15:55:32.184","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 15:55:32.185","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 15:55:32.303","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 15:57:26.714","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 15:57:26.717","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 15:57:26.869","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 16:03:16.385","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 16:03:16.386","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageChannelMessageAssociation.created","2024-10-24 16:03:16.553","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 15:55:32.236","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 15:55:32.237","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 15:55:32.310","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 15:57:26.944","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 15:57:26.945","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 15:57:27.114","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 16:03:16.499","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 16:03:16.499","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageParticipant.created","2024-10-24 16:03:16.684","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 15:55:34.758","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 15:55:34.759","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 15:55:34.877","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 15:57:35.725","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 15:57:35.803","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 15:57:37.351","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 16:03:17.807","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 16:03:17.808","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"messageThread.created","2024-10-24 16:03:17.879","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 15:55:35.486","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 15:55:35.486","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 15:55:35.671","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 15:57:36.207","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 15:57:36.209","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 15:57:37.487","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 16:03:17.594","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 16:03:17.594","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"note.created","2024-10-24 16:03:17.762","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 15:55:33.621","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 15:55:33.622","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 15:55:33.734","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 15:57:42.859","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 15:57:42.859","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 15:57:43.174","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 16:03:18.800","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 16:03:18.802","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"noteTarget.created","2024-10-24 16:03:19.118","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 15:55:33.606","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 15:55:33.607","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 15:55:33.736","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 15:57:42.937","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 15:57:42.938","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 15:57:43.166","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 16:03:19.409","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 16:03:19.410","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"opportunity.created","2024-10-24 16:03:21.884","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:55:33.525","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:55:33.526","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:55:35.037","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:55:35.038","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:55:35.228","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:57:34.269","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:57:34.273","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:57:37.353","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:57:41.933","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 15:57:41.935","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 16:03:17.781","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 16:03:17.782","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 16:03:17.871","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 16:03:18.137","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"person.created","2024-10-24 16:03:18.137","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"serverlessFunction.executed","2024-10-22 16:08:22.853","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":49,""status"":""SUCCESS"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""""}" +"serverlessFunction.executed","2024-10-22 16:08:25.262","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":33,""status"":""SUCCESS"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""""}" +"serverlessFunction.executed","2024-10-22 16:08:38.831","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":1008,""status"":""SUCCESS"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""""}" +"serverlessFunction.executed","2024-10-22 16:08:40.553","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":35,""status"":""ERROR"",""errorType"":""ReferenceError"",""functionId"":""a9fd87c0-af86-4e17-be3a-a6d3d961678a"",""functionName"":""""}" +"serverlessFunction.executed","2024-10-22 16:17:42.534","1","serverless-function","20202020-1c25-4d02-bf25-6aeccf7ea419","{""duration"":42,""status"":""SUCCESS"",""functionId"":""01963805-b9e9-47c5-8bf0-b815c6ba5e1c"",""functionName"":""jjjj""}" +"task.created","2024-10-24 15:55:35.469","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 15:55:35.469","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 15:55:35.672","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 15:57:32.646","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 15:57:32.649","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 15:57:33.949","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 16:03:17.587","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 16:03:17.589","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"task.created","2024-10-24 16:03:17.738","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 15:55:33.705","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 15:55:33.706","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 15:55:33.781","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 15:57:42.390","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 15:57:42.392","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 15:57:42.749","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 16:03:18.274","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 16:03:18.275","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"taskTarget.created","2024-10-24 16:03:18.362","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 15:55:32.239","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 15:55:32.239","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 15:55:32.319","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 15:57:26.541","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 15:57:26.581","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 15:57:26.836","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 16:03:16.284","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 16:03:16.310","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"timelineActivity.created","2024-10-24 16:03:16.469","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 15:55:33.555","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 15:55:33.557","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 15:55:33.665","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 15:57:42.752","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 15:57:42.753","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 15:57:42.864","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 16:03:18.825","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 16:03:18.826","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"view.created","2024-10-24 16:03:18.968","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 15:55:33.519","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 15:55:33.520","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 15:55:33.604","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 15:57:44.535","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 15:57:44.535","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 15:57:44.649","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 16:03:19.752","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 16:03:19.754","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewField.created","2024-10-24 16:03:19.872","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 15:55:33.521","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 15:55:33.522","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 15:55:33.652","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 15:57:43.289","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 15:57:43.290","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 15:57:43.419","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 16:03:21.314","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 16:03:21.315","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewFilter.created","2024-10-24 16:03:23.508","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 15:55:35.156","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 15:55:35.158","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 15:55:35.205","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 15:57:40.833","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 15:57:40.840","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 15:57:41.421","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 16:03:17.860","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 16:03:17.860","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"viewSort.created","2024-10-24 16:03:17.966","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"webhook.created","2024-10-24 15:57:26.784","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"webhook.created","2024-10-24 15:57:26.787","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"webhook.created","2024-10-24 15:57:26.947","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"webhook.created","2024-10-24 16:03:16.340","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"webhook.created","2024-10-24 16:03:16.341","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"webhook.created","2024-10-24 16:03:16.555","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"webhook.response","2024-10-22 09:31:14.307","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""status"":200,""success"":true,""url"":""https://enfcx639bne28.x.pipedream.net"",""webhookId"":""90f12aed-0276-4bea-bcaa-c21ea2763d7d"",""eventName"":""company.create""}" +"webhook.response","2024-10-22 09:31:14.447","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""status"":405,""success"":false,""url"":""https://google.com"",""webhookId"":""57995a1c-7429-4846-ab9a-3073ddec7865"",""eventName"":""company.create""}" +"webhook.response","2024-10-22 09:31:14.453","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""success"":false,""url"":""a.com"",""webhookId"":""c19ea782-417e-4d44-a486-fd794fc44a27"",""eventName"":""company.create""}" +"webhook.response","2024-10-22 10:17:01.108","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""status"":200,""success"":true,""url"":""https://enfcx639bne28.x.pipedream.net"",""webhookId"":""90f12aed-0276-4bea-bcaa-c21ea2763d7d"",""eventName"":""company.create""}" +"webhook.response","2024-10-22 10:17:01.271","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""status"":405,""success"":false,""url"":""https://google.com"",""webhookId"":""57995a1c-7429-4846-ab9a-3073ddec7865"",""eventName"":""company.create""}" +"webhook.response","2024-10-22 10:17:01.277","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""success"":false,""url"":""a.com"",""webhookId"":""c19ea782-417e-4d44-a486-fd794fc44a27"",""eventName"":""company.create""}" +"webhook.response","2024-10-22 13:16:51.473","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""status"":200,""success"":true,""url"":""https://enfcx639bne28.x.pipedream.net"",""webhookId"":""90f12aed-0276-4bea-bcaa-c21ea2763d7d"",""eventName"":""company.create""}" +"webhook.response","2024-10-22 13:16:51.617","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""success"":false,""url"":""https://google.com"",""webhookId"":""57995a1c-7429-4846-ab9a-3073ddec7865"",""eventName"":""company.create"",""status"":405}" +"webhook.response","2024-10-22 13:16:51.621","1","webhook","20202020-1c25-4d02-bf25-6aeccf7ea419","{""success"":false,""url"":""a.com"",""webhookId"":""c19ea782-417e-4d44-a486-fd794fc44a27"",""eventName"":""company.create""}" +"workspaceMember.created","2024-10-24 15:55:32.038","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 15:55:32.039","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 15:55:32.223","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 15:57:26.646","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 15:57:26.647","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 15:57:26.854","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 16:03:16.337","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 16:03:16.337","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" +"workspaceMember.created","2024-10-24 16:03:16.490","1","20202020-9e3b-46d4-a556-88b9ddc2b034","20202020-1c25-4d02-bf25-6aeccf7ea419","{}" diff --git a/packages/twenty-tinybird/datasources/fixtures/pageview.csv b/packages/twenty-tinybird/datasources/fixtures/pageview.csv new file mode 100644 index 0000000000..4cab99aeb0 --- /dev/null +++ b/packages/twenty-tinybird/datasources/fixtures/pageview.csv @@ -0,0 +1,11 @@ +"href","locale","pathname","referrer","sessionId","timeZone","timestamp","userAgent","userId","version","workspaceId" +"http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","en-US","/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","ebb6279c-c9a6-44c7-b751-6ee615e6a5fe","Europe/Paris","2024-10-17 12:30:33.604","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/objects/companies","en-US","/welcome","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:37:53.093","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/objects/companies","en-US","/objects/companies","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:37:53.184","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/settings/profile","en-US","/settings/profile","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:37:54.802","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/settings/integrations","en-US","/settings/integrations","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:37:56.686","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/settings/developers","en-US","/settings/developers","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:38:01.364","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","en-US","/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:38:02.518","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","en-US","/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:41:11.844","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/settings/profile","en-US","/settings/profile","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:41:23.864","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" +"http://localhost:3001/settings/appearance","en-US","/settings/appearance","http://localhost:3001/settings/developers/webhooks/41a8ad80-265a-425a-93da-35452d0ac83d","8fc30143-b648-4fc0-afe7-e55e1c452003","Europe/Paris","2024-10-17 12:41:25.972","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","20202020-9e3b-46d4-a556-88b9ddc2b034","1","20202020-1c25-4d02-bf25-6aeccf7ea419" diff --git a/packages/twenty-tinybird/datasources/pageview.datasource b/packages/twenty-tinybird/datasources/pageview.datasource new file mode 100644 index 0000000000..d1be6b7e32 --- /dev/null +++ b/packages/twenty-tinybird/datasources/pageview.datasource @@ -0,0 +1,16 @@ +SCHEMA > + `href` String `json:$.href`, + `locale` String `json:$.locale`, + `pathname` String `json:$.pathname`, + `referrer` String `json:$.referrer`, + `sessionId` String `json:$.sessionId`, + `timeZone` String `json:$.timeZone`, + `timestamp` DateTime64(3) `json:$.timestamp`, + `userAgent` String `json:$.userAgent`, + `userId` String `json:$.userId` DEFAULT '', + `version` String `json:$.version`, + `workspaceId` String `json:$.workspaceId` + +ENGINE MergeTree +ENGINE_PARTITION_KEY toYear(timestamp) +ENGINE_SORTING_KEY timestamp, userId, version, workspaceId diff --git a/packages/twenty-tinybird/datasources/serverlessFunctionEventMV.datasource b/packages/twenty-tinybird/datasources/serverlessFunctionEventMV.datasource new file mode 100644 index 0000000000..fb9eb8f0b7 --- /dev/null +++ b/packages/twenty-tinybird/datasources/serverlessFunctionEventMV.datasource @@ -0,0 +1,11 @@ +SCHEMA > + `timestamp` DateTime64(3), + `workspaceId` String, + `functionId` String, + `durationInMs` Int64, + `success` Bool, + `errorType` String + +ENGINE MergeTree +ENGINE_PARTITION_KEY toYYYYMM(timestamp) +ENGINE_SORTING_KEY timestamp, functionId, success diff --git a/packages/twenty-tinybird/datasources/webhookEventMV.datasource b/packages/twenty-tinybird/datasources/webhookEventMV.datasource new file mode 100644 index 0000000000..6ec1601a63 --- /dev/null +++ b/packages/twenty-tinybird/datasources/webhookEventMV.datasource @@ -0,0 +1,13 @@ +SCHEMA > + `timestamp` DateTime64(3), + `workspaceId` String, + `webhookId` String, + `url` String, + `success` UInt8, + `status` Int64, + `eventName` String, + `version` String + +ENGINE MergeTree +ENGINE_PARTITION_KEY toYYYYMM(timestamp) +ENGINE_SORTING_KEY timestamp, workspaceId diff --git a/packages/twenty-tinybird/includes/timeSeries.incl b/packages/twenty-tinybird/includes/timeSeries.incl new file mode 100644 index 0000000000..b00dcd0df8 --- /dev/null +++ b/packages/twenty-tinybird/includes/timeSeries.incl @@ -0,0 +1,87 @@ +DESCRIPTION > + Inspired by DUB implementation + +NODE dayIntervals +SQL > + % + WITH + toStartOfDay( + toDateTime64({{ DateTime64(start, '2024-10-16 00:00:00.000') }}, 3), + {{ String(timezone, 'UTC') }} + ) AS start, + toStartOfDay( + toDateTime64({{ DateTime64(end, '2024-10-23 00:00:00.000') }}, 3), + {{ String(timezone, 'UTC') }} + ) AS + end + SELECT + arrayJoin( + arrayMap( + x -> toDateTime64(toStartOfDay(toDateTime64(x, 3), {{ String(timezone, 'UTC') }}), 3), + range(toUInt32(start + 86400), toUInt32(end + 86400), + 86400 + ) + ) + ) as interval + +NODE hourIntervals +SQL > + % + WITH + toStartOfHour( + toDateTime64({{ DateTime64(start, '2024-10-22 00:00:00.000') }}, 3), + {{ String(timezone, 'UTC') }} + ) AS start, + toStartOfHour( + toDateTime64({{ DateTime64(end, '2024-10-23 00:00:00.000') }}, 3), + {{ String(timezone, 'UTC') }} + ) AS + end + SELECT + arrayJoin( + arrayMap(x -> toDateTime64(x, 3), range(toUInt32(start + 3600), toUInt32(end + 3600), 3600) + ) + ) as interval + +NODE customIntervals +SQL > + % + WITH + time_series AS ( + SELECT + toDateTime64( + toDateTime( + toStartOfInterval( + toDateTime64({{ DateTime64(start, '2024-10-22 00:00:00.000') }}, 3), + INTERVAL {{ Int32(tickIntervalInMinutes, 420) }} MINUTE + ) + ) + + INTERVAL number * {{ Int32(tickIntervalInMinutes, 420) }} MINUTE, + 3 + ) AS interval + FROM + numbers( + 0, + 1 + intDiv( + dateDiff( + 'minute', + toDateTime64({{ DateTime64(start, '2024-10-22 00:00:00.000') }}, 3), + toDateTime64({{ DateTime64(end, '2024-10-23 00:00:00.000') }}, 3) + ), + {{ Int32(tickIntervalInMinutes, 420) }} + ) + ) + WHERE interval <= toDateTime64({{ DateTime64(end, '2024-10-23 00:00:00.000') }}, 3) + ) + SELECT interval + FROM time_series + +NODE selectIntervalByGranularity +SQL > + % + SELECT * + FROM + {% if granularity == "custom" %} customIntervals + {% elif granularity == "hour" %} hourIntervals + {% else %} dayIntervals + {% end %} diff --git a/packages/twenty-tinybird/pipes/getServerlessFunctionDuration.pipe b/packages/twenty-tinybird/pipes/getServerlessFunctionDuration.pipe new file mode 100644 index 0000000000..c0d1bf068f --- /dev/null +++ b/packages/twenty-tinybird/pipes/getServerlessFunctionDuration.pipe @@ -0,0 +1,35 @@ +INCLUDE "../includes/timeSeries.incl" + +NODE timeSeriesServerlessFunctionDurationData +SQL > + % + SELECT + {% if granularity == "hour" %} toStartOfHour(timestamp, {{ String(timezone, 'UTC') }}) + {% elif granularity == "custom" %} + toDateTime64( + toStartOfMinute(timestamp, {{ String(timezone, 'UTC') }}), + 3, + {{ String(timezone, 'UTC') }} + ) + {% else %} toDateTime64(toStartOfDay(timestamp, {{ String(timezone, 'UTC') }}), 3) + {% end %} AS interval, + avg(CAST(durationInMs AS Float64)) as average, + min(durationInMs) as minimum, + max(durationInMs) as maximum + FROM serverlessFunctionEventMV + WHERE + true + AND functionId = {{ String(functionId, 'a9fd87c0-af86-4e17-be3a-a6d3d961678a', required=True) }} + AND workspaceId + ={{ String(workspaceId, '20202020-1c25-4d02-bf25-6aeccf7ea419', required=True) }} + AND timestamp >= {{ DateTime(start, '2024-10-22 00:00:00') }} + AND timestamp < {{ DateTime(end, '2024-10-23 00:00:00') }} + GROUP BY interval + ORDER BY interval + +NODE endpoint +SQL > + % + SELECT formatDateTime(interval, '%FT%T.000%z') as start, minimum, maximum, average + FROM selectIntervalByGranularity + LEFT JOIN timeSeriesServerlessFunctionDurationData USING interval diff --git a/packages/twenty-tinybird/pipes/getServerlessFunctionErrors.pipe b/packages/twenty-tinybird/pipes/getServerlessFunctionErrors.pipe new file mode 100644 index 0000000000..04ece887b0 --- /dev/null +++ b/packages/twenty-tinybird/pipes/getServerlessFunctionErrors.pipe @@ -0,0 +1,41 @@ +INCLUDE "../includes/timeSeries.incl" + +NODE timeSeriesServerlessFunctionErrorsData +SQL > + % + SELECT + {% if granularity == "hour" %} toStartOfHour(timestamp, {{ String(timezone, 'UTC') }}) + {% elif granularity == "custom" %} + toDateTime64( + toStartOfMinute(timestamp, {{ String(timezone, 'UTC') }}), + 3, + {{ String(timezone, 'UTC') }} + ) + {% else %} toDateTime64(toStartOfDay(timestamp, {{ String(timezone, 'UTC') }}), 3) + {% end %} AS interval, + uniqIf(*, success = false) as error_count, + round( + if( + uniqIf(*, success = true) = 0, + 0, + (uniqIf(*, success = true) - uniqIf(*, success = false)) / uniqIf(*, success = true) + ), + 2 + ) as success_rate + FROM serverlessFunctionEventMV + WHERE + true + AND functionId = {{ String(functionId, 'a9fd87c0-af86-4e17-be3a-a6d3d961678a', required=True) }} + AND workspaceId + ={{ String(workspaceId, '20202020-1c25-4d02-bf25-6aeccf7ea419', required=True) }} + AND timestamp >= {{ DateTime(start, '2024-10-22 00:00:00') }} + AND timestamp < {{ DateTime(end, '2024-10-23 00:00:00') }} + GROUP BY interval + ORDER BY interval + +NODE endpoint +SQL > + % + SELECT formatDateTime(interval, '%FT%T.000%z') as start, error_count, success_rate + FROM selectIntervalByGranularity + LEFT JOIN timeSeriesServerlessFunctionErrorsData USING interval diff --git a/packages/twenty-tinybird/pipes/getWebhookAnalytics.pipe b/packages/twenty-tinybird/pipes/getWebhookAnalytics.pipe new file mode 100644 index 0000000000..7fbfe67aae --- /dev/null +++ b/packages/twenty-tinybird/pipes/getWebhookAnalytics.pipe @@ -0,0 +1,34 @@ +INCLUDE "../includes/timeSeries.incl" + +NODE timeSeriesWebhookData +SQL > + % + SELECT + {% if granularity == "hour" %} toStartOfHour(timestamp, {{ String(timezone, 'UTC') }}) + {% elif granularity == "custom" %} + toDateTime64( + toStartOfMinute(timestamp, {{ String(timezone, 'UTC') }}), + 3, + {{ String(timezone, 'UTC') }} + ) + {% else %} toDateTime64(toStartOfDay(timestamp, {{ String(timezone, 'UTC') }}), 3) + {% end %} AS interval, + uniqIf(*, success = true) as success_count, + uniqIf(*, success = false) as failure_count + FROM webhookEventMV + WHERE + true + AND webhookId = {{ String(webhookId, '90f12aed-0276-4bea-bcaa-c21ea2763d7d', required=True) }} + AND workspaceId + ={{ String(workspaceId, '20202020-1c25-4d02-bf25-6aeccf7ea419', required=True) }} + AND timestamp >= {{ DateTime(start, '2024-10-22 00:00:00') }} + AND timestamp < {{ DateTime(end, '2024-10-23 00:00:00') }} + GROUP BY interval + ORDER BY interval + +NODE endpoint +SQL > + % + SELECT formatDateTime(interval, '%FT%T.000%z') as start, success_count, failure_count + FROM selectIntervalByGranularity + LEFT JOIN timeSeriesWebhookData USING interval diff --git a/packages/twenty-tinybird/pipes/materializeServerlessFunctionEvent.pipe b/packages/twenty-tinybird/pipes/materializeServerlessFunctionEvent.pipe new file mode 100644 index 0000000000..8b234b4bcd --- /dev/null +++ b/packages/twenty-tinybird/pipes/materializeServerlessFunctionEvent.pipe @@ -0,0 +1,14 @@ +NODE mv +SQL > + SELECT + timestamp, + workspaceId, + JSONExtractString(payload, 'functionId') as functionId, + JSONExtractInt(payload, 'duration') as durationInMs, + if(JSONExtractString(payload, 'status') = 'SUCCESS', TRUE, FALSE) as success, + JSONExtractString(payload, 'errorType') as errorType + FROM event + WHERE action = 'serverlessFunction.executed' + +TYPE MATERIALIZED +DATASOURCE serverlessFunctionEventMV diff --git a/packages/twenty-tinybird/pipes/materializeWebhookEvent.pipe b/packages/twenty-tinybird/pipes/materializeWebhookEvent.pipe new file mode 100644 index 0000000000..98a72f0090 --- /dev/null +++ b/packages/twenty-tinybird/pipes/materializeWebhookEvent.pipe @@ -0,0 +1,16 @@ +NODE mv +SQL > + SELECT + timestamp, + workspaceId, + JSONExtractString(payload, 'webhookId') as webhookId, + JSONExtractString(payload, 'url') as url, + JSONExtractBool(payload, 'success') as success, + JSONExtractInt(payload, 'status') as status, + JSONExtractString(payload, 'eventName') as eventName, + version + FROM event + WHERE action = 'webhook.response' + +TYPE MATERIALIZED +DATASOURCE webhookEventMV diff --git a/packages/twenty-tinybird/requirements.txt b/packages/twenty-tinybird/requirements.txt new file mode 100644 index 0000000000..cea4440b3d --- /dev/null +++ b/packages/twenty-tinybird/requirements.txt @@ -0,0 +1 @@ +tinybird-cli==5.10.1 \ No newline at end of file diff --git a/packages/twenty-tinybird/scripts/append_fixtures.sh b/packages/twenty-tinybird/scripts/append_fixtures.sh new file mode 100755 index 0000000000..e8745565af --- /dev/null +++ b/packages/twenty-tinybird/scripts/append_fixtures.sh @@ -0,0 +1,21 @@ + +#!/usr/bin/env bash +set -euxo pipefail + +directory="datasources/fixtures" +extensions=("csv" "ndjson") + +absolute_directory=$(realpath "$directory") + +for extension in "${extensions[@]}"; do + file_list=$(find "$absolute_directory" -type f -name "*.$extension") + + for file_path in $file_list; do + file_name=$(basename "$file_path") + file_name_without_extension="${file_name%.*}" + + command="tb datasource append $file_name_without_extension datasources/fixtures/$file_name" + echo $command + $command + done +done diff --git a/packages/twenty-tinybird/scripts/exec_test.sh b/packages/twenty-tinybird/scripts/exec_test.sh new file mode 100755 index 0000000000..50571d952d --- /dev/null +++ b/packages/twenty-tinybird/scripts/exec_test.sh @@ -0,0 +1,58 @@ + +#!/usr/bin/env bash +set -euxo pipefail + +export TB_VERSION_WARNING=0 + +run_test() { + t=$1 + echo "** Running $t **" + echo "** $(cat $t)" + tmpfile=$(mktemp) + retries=0 + TOTAL_RETRIES=3 + + # When appending fixtures, we need to retry in case of the data is not replicated in time + while [ $retries -lt $TOTAL_RETRIES ]; do + # Run the test and store the output in a temporary file + bash $t $2 >$tmpfile + exit_code=$? + if [ "$exit_code" -eq 0 ]; then + # If the test passed, break the loop + if diff -B ${t}.result $tmpfile >/dev/null 2>&1; then + break + # If the test failed, increment the retries counter and try again + else + retries=$((retries+1)) + fi + # If the bash command failed, print an error message and break the loop + else + break + fi + done + + if diff -B ${t}.result $tmpfile >/dev/null 2>&1; then + echo "✅ Test $t passed" + rm $tmpfile + return 0 + elif [ $retries -eq $TOTAL_RETRIES ]; then + echo "🚨 ERROR: Test $t failed, diff:"; + diff -B ${t}.result $tmpfile + rm $tmpfile + return 1 + else + echo "🚨 ERROR: Test $t failed with bash command exit code $?" + cat $tmpfile + rm $tmpfile + return 1 + fi + echo "" +} +export -f run_test + +fail=0 +find ./tests -name "*.test" -print0 | xargs -0 -I {} -P 4 bash -c 'run_test "$@"' _ {} || fail=1 + +if [ $fail == 1 ]; then + exit -1; +fi diff --git a/packages/twenty-tinybird/tests/example.yml b/packages/twenty-tinybird/tests/example.yml new file mode 100644 index 0000000000..14b2259a97 --- /dev/null +++ b/packages/twenty-tinybird/tests/example.yml @@ -0,0 +1,29 @@ + +############################################################################################################################## +### Visit https://www.tinybird.co/docs/production/implementing-test-strategies.html#data-quality-tests ### +### for more details on Data Quality tests ### +############################################################################################################################## + +- example_no_negative_numbers: + max_bytes_read: null + max_time: null + sql: | + SELECT + number + FROM numbers(10) + WHERE + number < 0 + +# - example_top_products_params_no_empty_top_10_on_2023: +# max_bytes_read: null +# max_time: null +# sql: | +# SELECT * +# FROM top_products_params +# WHERE empty(top_10) +# pipe: +# name: top_products_params +# params: +# start: '2023-01-01' +# end: '2023-12-31' + diff --git a/packages/twenty-tinybird/tests/regression.yaml b/packages/twenty-tinybird/tests/regression.yaml new file mode 100644 index 0000000000..6d4708a4e3 --- /dev/null +++ b/packages/twenty-tinybird/tests/regression.yaml @@ -0,0 +1,25 @@ + +############################################################################################################################ +### Visit https://www.tinybird.co/docs/production/implementing-test-strategies.html#regression-tests ### +### for more details on Regression tests ### +############################################################################################################################ + +### +### New pipes are covered by this rule, rules below this one supersede this setting +### +- pipe: '.*' + tests: + - coverage: + + + +### +### These are rules to customize regression testing by pipe using regular expressions +### For instance skip regression tests for the pipes matching `endpoint_name.*` +### +- pipe: 'endpoint_name.*' + tests: + - coverage: + config: + skip: True +