APIv2: Release `has_done`/`has_not_done` (#5285)

* APIv2: Release `has_done`/`has_not_done`

* Update tests to mark new features publicly available
This commit is contained in:
Karl-Aksel Puulmann 2025-04-08 10:13:18 +03:00 committed by GitHub
parent 0fcbcc3a8c
commit bf482efe84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 20 deletions

View File

@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file.
- Add support for creating and managing teams owning multiple sites
- Introduce "billing" team role for users
- Introduce "editor" role with permissions greater than "viewer" but lesser than "admin"
- Support behavioral filters `has_done` and `has_not_done` on the Stats API to allow filtering sessions by other events that have been completed.
### Removed

View File

@ -486,10 +486,7 @@
{ "$ref": "#/definitions/filter_entry" },
{ "$ref": "#/definitions/filter_and_or" },
{ "$ref": "#/definitions/filter_not" },
{
"$ref": "#/definitions/filter_has_done",
"$comment": "only :internal"
}
{ "$ref": "#/definitions/filter_has_done" }
]
},
"filter_not": {

View File

@ -593,8 +593,7 @@ defmodule Plausible.Stats.Filters.QueryParserTest do
timezone: site.timezone,
include: @default_include,
pagination: %{limit: 10_000, offset: 0}
},
:internal
}
)
end
@ -609,8 +608,7 @@ defmodule Plausible.Stats.Filters.QueryParserTest do
}
|> check_error(
site,
"Invalid filters. Behavioral filters (has_done, has_not_done) can only be used with event dimension filters.",
:internal
"Invalid filters. Behavioral filters (has_done, has_not_done) can only be used with event dimension filters."
)
end
@ -625,8 +623,7 @@ defmodule Plausible.Stats.Filters.QueryParserTest do
}
|> check_error(
site,
"Invalid filters. Behavioral filters (has_done, has_not_done) cannot be nested.",
:internal
"Invalid filters. Behavioral filters (has_done, has_not_done) cannot be nested."
)
end
@ -1239,8 +1236,7 @@ defmodule Plausible.Stats.Filters.QueryParserTest do
timezone: site.timezone,
include: @default_include,
pagination: %{limit: 10_000, offset: 0}
},
:internal
}
)
|> check_goals(
preloaded_goals: %{all: ["Signup"], matching_toplevel_filters: ["Signup"]},

View File

@ -4662,7 +4662,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
])
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors", "visits", "events", "pageviews"],
"date_range" => "all",
@ -4688,7 +4688,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
])
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors", "events", "pageviews"],
"date_range" => "all",
@ -4729,7 +4729,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
])
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors", "pageviews"],
"date_range" => "all",
@ -4770,7 +4770,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
])
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors", "pageviews"],
"date_range" => "all",
@ -4816,7 +4816,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
])
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors", "pageviews"],
"date_range" => "all",
@ -4861,7 +4861,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
])
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors", "pageviews"],
"date_range" => "all",
@ -4892,7 +4892,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
])
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors", "pageviews"],
"date_range" => "all",
@ -4912,7 +4912,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryTest do
site: site
} do
conn =
post(conn, "/api/v2/query-internal-test", %{
post(conn, "/api/v2/query", %{
"site_id" => site.domain,
"metrics" => ["visitors"],
"date_range" => "all",