Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ jobs:
strategy:
matrix:
include:
- typesense: '0.25.2'
- typesense: '26.0'
otp: '25'
elixir: '1.14'
lint: false
- typesense: '26.0'
- typesense: '27.0'
otp: '25'
elixir: '1.14'
lint: false
- typesense: '27.1'
otp: '25'
elixir: '1.14'
lint: false
- typesense: '0.25.2'
- typesense: '26.0'
otp: '27'
elixir: '1.17'
elixir: '1.18'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Specified Elixir version 1.18 is not yet released

Elixir 1.18 hasn't been released yet. The latest stable version is 1.16. This will cause CI failures. Please update to use an existing Elixir version.

lint: false
- typesense: '26.0'
- typesense: '27.0'
otp: '27'
elixir: '1.17'
elixir: '1.18'
lint: false
- typesense: '27.1'
otp: '27'
elixir: '1.17'
elixir: '1.18'
lint: true

services:
Expand All @@ -73,8 +73,8 @@ jobs:
-v /tmp/typesense-data:/data \
-v /tmp/typesense-analytics-data:/analytics-data \
typesense/typesense:${{ matrix.typesense}} \
--api-key=xyz \
--data-dir=/data \
--api-key xyz \
--data-dir /data \
--enable-search-analytics=true \
--analytics-dir=/analytics-data \
--analytics-flush-interval=60 \
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## major.minor.patch (yyyy.mm.dd)

## 0.6.0 (2025.01.19)

### Changed

* CI to support Typesense versions v26.0, v27.0, v27.1

### Removed

* Support for Typesense version v0.25.2

## 0.5.2 (2025.01.16)

### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Restful client for Typesense with adherence to Open API spec 3 (formerly Swagger
[![Hex.pm](https://img.shields.io/hexpm/v/open_api_typesense)](https://hex.pm/packages/open_api_typesense)
[![Hexdocs.pm](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/open_api_typesense)
[![Hex.pm](https://img.shields.io/hexpm/l/open_api_typesense)](https://hexdocs.pm/open_api_typesense/license.html)
[![Typesense badge](https://img.shields.io/badge/Typesense-v27.1-darkblue)](https://typesense.org/docs/27.1/api)
[![Typesense badge](https://img.shields.io/badge/Typesense-v26.0_%7C_v27.0_%7C_v27.1-darkblue)](https://typesense.org/docs/27.1/api)
[![Coverage Status](https://coveralls.io/repos/github/jaeyson/open_api_typesense/badge.svg?branch=main)](https://coveralls.io/github/jaeyson/open_api_typesense?branch=main)
[![CI Status](https://github.com/jaeyson/open_api_typesense/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jaeyson/open_api_typesense/actions/workflows/ci.yml)

Expand All @@ -18,7 +18,7 @@ by adding `open_api_typesense` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:open_api_typesense, "~> 0.5"}
{:open_api_typesense, "~> 0.6"}

# Or from GitHub repository, if you want the latest greatest from main branch
{:open_api_typesense, git: "https://github.com/jaeyson/open_api_typesense.git"}
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule OpenApiTypesense.MixProject do

@source_url "https://github.com/jaeyson/open_api_typesense"
@hex_url "https://hexdocs.pm/open_api_typesense"
@version "0.5.2"
@version "0.6.0"

def project do
[
Expand Down
6 changes: 3 additions & 3 deletions test/client_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ defmodule ClientTest do
end)
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "returns the configured options" do
Application.put_env(:open_api_typesense, :options,
finch: MyApp.CustomFinch,
Expand All @@ -86,7 +86,7 @@ defmodule ClientTest do
assert options === [finch: MyApp.CustomFinch, receive_timeout: 5_000]
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "returns an empty map if options is not configured" do
Application.delete_env(:open_api_typesense, :options)

Expand All @@ -95,7 +95,7 @@ defmodule ClientTest do
assert options === nil
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "use another HTTP client" do
map_conn = %{
api_key: "xyz",
Expand Down
10 changes: 5 additions & 5 deletions test/connection_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule ConnectionTest do

alias OpenApiTypesense.Connection

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "new/0 using the default config to creates a connection struct" do
assert Connection.new() === %Connection{
api_key: "xyz",
Expand All @@ -14,7 +14,7 @@ defmodule ConnectionTest do
}
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "new/1 with custom fields creates a connection struct" do
conn =
Connection.new(%{
Expand All @@ -32,20 +32,20 @@ defmodule ConnectionTest do
}
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "new/1 with Connection struct" do
conn = Connection.new()
assert %Connection{} = Connection.new(conn)
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "new/1 with empty map raises ArgumentError" do
error = assert_raise ArgumentError, fn -> Connection.new(%{}) end

assert error.message === "Missing required fields: [:api_key, :host, :port, :scheme]"
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "new/1 with invalid data type raises ArgumentError" do
invalid_inputs = [
nil,
Expand Down
10 changes: 5 additions & 5 deletions test/operations/analytics_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ defmodule AnalyticsTest do
%{conn: conn, map_conn: map_conn}
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "error: create analytics rule with non-existent collection", %{
conn: conn,
map_conn: map_conn
Expand Down Expand Up @@ -114,7 +114,7 @@ defmodule AnalyticsTest do
Analytics.create_analytics_rule(map_conn, body, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": false]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: upsert analytics rule", %{conn: conn, map_conn: map_conn} do
name = "product_no_hits"

Expand Down Expand Up @@ -151,7 +151,7 @@ defmodule AnalyticsTest do
Analytics.upsert_analytics_rule(map_conn, name, body, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "error: create analytics rule with wrong field" do
name = "products_test_query"
field_name = "wrong_field"
Expand All @@ -177,7 +177,7 @@ defmodule AnalyticsTest do
assert {:error, %ApiResponse{message: _}} = Analytics.create_analytics_rule(body)
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: list analytics rules", %{conn: conn, map_conn: map_conn} do
assert {:ok, %AnalyticsRulesRetrieveSchema{rules: rules}} =
Analytics.retrieve_analytics_rules()
Expand All @@ -200,7 +200,7 @@ defmodule AnalyticsTest do
Analytics.retrieve_analytics_rules(map_conn, [])
end

@tag ["27.1": true, "26.0": false, "0.25.2": false]
@tag ["27.1": true, "27.0": true, "26.0": false]
test "success (v27.1): create analytics rule and event", %{conn: conn, map_conn: map_conn} do
name = "product_popularity"

Expand Down
18 changes: 9 additions & 9 deletions test/operations/collections_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule CollectionsTest do
%{schema: schema, alias_name: "foo_bar", conn: conn, map_conn: map_conn}
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: clone a collection schema" do
schema = %{
"name" => "vehicles",
Expand All @@ -58,7 +58,7 @@ defmodule CollectionsTest do
Collections.create_collection(payload, src_name: schema["name"])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: create a collection", %{schema: schema, conn: conn, map_conn: map_conn} do
name = schema["name"]

Expand All @@ -72,7 +72,7 @@ defmodule CollectionsTest do
Collections.create_collection(map_conn, schema, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: list collections", %{conn: conn, map_conn: map_conn} do
assert {:ok, collections} = Collections.get_collections()
assert length(collections) >= 0
Expand All @@ -85,7 +85,7 @@ defmodule CollectionsTest do
assert {:ok, _} = Collections.get_collections(map_conn, limit: 1)
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: update an existing collection", %{conn: conn, map_conn: map_conn} do
name = "burgers"

Expand Down Expand Up @@ -122,7 +122,7 @@ defmodule CollectionsTest do
Collections.delete_collection(name)
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: list empty aliases", %{conn: conn, map_conn: map_conn} do
assert {:ok, %CollectionAliasesResponse{aliases: aliases}} = Collections.get_aliases()
assert length(aliases) >= 0
Expand All @@ -133,7 +133,7 @@ defmodule CollectionsTest do
assert {:ok, _} = Collections.get_aliases(map_conn, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: delete a missing collection", %{conn: conn, map_conn: map_conn} do
assert Collections.delete_collection("non-existing-collection") ==
{:error,
Expand All @@ -148,7 +148,7 @@ defmodule CollectionsTest do
assert {:error, %ApiResponse{message: _}} = Collections.delete_collection(map_conn, "xyz", [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: upsert an alias", %{
schema: schema,
alias_name: alias_name,
Expand Down Expand Up @@ -176,7 +176,7 @@ defmodule CollectionsTest do
assert {:error, %ApiResponse{message: _}} = Collections.delete_alias(map_conn, alias_name, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "error: get a non-existing alias", %{conn: conn, map_conn: map_conn} do
assert Collections.get_alias("non-existing-alias") ==
{:error, %ApiResponse{message: "Not Found"}}
Expand All @@ -188,7 +188,7 @@ defmodule CollectionsTest do
assert {:error, %ApiResponse{message: _}} = Collections.get_alias(map_conn, "xyz", [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "error: get a non-existing collection", %{conn: conn, map_conn: map_conn} do
assert Collections.get_collection("non-existing-collection") ==
{:error, %ApiResponse{message: "Not Found"}}
Expand Down
10 changes: 5 additions & 5 deletions test/operations/conversations_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule ConversationsTest do
%{conn: conn, map_conn: map_conn}
end

@tag ["27.1": true, "26.0": true, "0.25.2": false]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: list conversation models", %{conn: conn, map_conn: map_conn} do
assert {:ok, models} = Conversations.retrieve_all_conversation_models()
assert length(models) >= 0
Expand All @@ -45,7 +45,7 @@ defmodule ConversationsTest do
assert {:ok, _} = Conversations.retrieve_all_conversation_models(map_conn, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": false]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "error: get a non-existent conversation model", %{conn: conn, map_conn: map_conn} do
assert {:error, %ApiResponse{message: "Model not found"}} =
Conversations.retrieve_conversation_model("non-existent")
Expand All @@ -57,7 +57,7 @@ defmodule ConversationsTest do
assert {:error, _} = Conversations.retrieve_conversation_model(map_conn, "xyz", [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": false]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: delete a conversation model", %{conn: conn, map_conn: map_conn} do
assert {:error, %ApiResponse{message: "Model not found"}} =
Conversations.delete_conversation_model("non-existent")
Expand All @@ -69,7 +69,7 @@ defmodule ConversationsTest do
assert {:error, _} = Conversations.delete_conversation_model(map_conn, "xyz", [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": false]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "error: create a conversation model with incorrect API key", %{
conn: conn,
map_conn: map_conn
Expand Down Expand Up @@ -102,7 +102,7 @@ defmodule ConversationsTest do
assert {:error, _} = Conversations.create_conversation_model(map_conn, body, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": false]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "error: update a conversation model with incorrect API key", %{
conn: conn,
map_conn: map_conn
Expand Down
6 changes: 3 additions & 3 deletions test/operations/curation_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule CurationTest do
%{schema_name: name, conn: conn, map_conn: map_conn}
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: upsert search override", %{
schema_name: schema_name,
conn: conn,
Expand Down Expand Up @@ -69,7 +69,7 @@ defmodule CurationTest do
Curation.upsert_search_override(map_conn, schema_name, override_id, body, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: delete search override", %{
schema_name: schema_name,
conn: conn,
Expand All @@ -87,7 +87,7 @@ defmodule CurationTest do
assert {:error, _} = Curation.delete_search_override(map_conn, schema_name, "test", [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: list collection overrides", %{
schema_name: schema_name,
conn: conn,
Expand Down
4 changes: 2 additions & 2 deletions test/operations/debug_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule DebugTest do
%{conn: conn, map_conn: map_conn}
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "success: list stopwords sets", %{conn: conn, map_conn: map_conn} do
assert {:ok, %Debug{version: _}} = Debug.debug()
assert {:ok, _} = Debug.debug([])
Expand All @@ -22,7 +22,7 @@ defmodule DebugTest do
assert {:ok, _} = Debug.debug(map_conn, [])
end

@tag ["27.1": true, "26.0": true, "0.25.2": true]
@tag ["27.1": true, "27.0": true, "26.0": true]
test "field" do
assert [version: {:string, :generic}] = Debug.__fields__(:debug_200_json_resp)
end
Expand Down
Loading
Loading