Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

server: add ash json api

+169 -4
+5 -1
lib/sower/repo.ex
··· 3 3 4 4 # Installs Postgres extensions that ash commonly uses 5 5 def installed_extensions do 6 - ["uuid-ossp", "citext"] 6 + [ 7 + "ash-functions", 8 + "citext", 9 + "uuid-ossp" 10 + ] 7 11 end 8 12 end
+1
mix.exs
··· 16 16 defp deps do 17 17 [ 18 18 {:ash, "~> 3.0.0-rc.17"}, 19 + {:ash_json_api, "~> 1.0.0-rc.6"}, 19 20 {:ash_phoenix, "~> 2.0.0-rc.4"}, 20 21 {:ash_postgres, "~> 2.0.0-rc.5"}, 21 22 {:bandit, "~> 1.0"},
+4
mix.lock
··· 1 1 %{ 2 2 "ash": {:hex, :ash, "3.0.0-rc.45", "6c71cb4045c84cfec37b5e6964b8c0391b2e78a037492a29f3d2094032253cac", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.7", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.2", [hex: :picosat_elixir, repo: "hexpm", optional: true]}, {:plug, ">= 0.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:reactor, ">= 0.8.1 and < 1.0.0-0", [hex: :reactor, repo: "hexpm", optional: false]}, {:simple_sat, ">= 0.1.1 and < 1.0.0-0", [hex: :simple_sat, repo: "hexpm", optional: true]}, {:spark, ">= 2.1.18 and < 3.0.0-0", [hex: :spark, repo: "hexpm", optional: false]}, {:splode, "~> 0.2", [hex: :splode, repo: "hexpm", optional: false]}, {:stream_data, "~> 0.6", [hex: :stream_data, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1a3261257aee24a59c66db289163b9e16d91cdbc0c6b3ac7eaf64a8a8e45c842"}, 3 + "ash_json_api": {:hex, :ash_json_api, "1.0.0-rc.6", "561ddeda984028a60d7dee866e10666c53ba0eff2db59bf6212d503a4b22a1ea", [:mix], [{:ash, "~> 3.0.0-rc.31", [hex: :ash, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:json_xema, "~> 0.4", [hex: :json_xema, repo: "hexpm", optional: false]}, {:open_api_spex, "~> 3.16", [hex: :open_api_spex, repo: "hexpm", optional: true]}, {:plug, "~> 1.11", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "f2f6acbf0a0e8e90a6168c01cfa746430d92332e008a435ad897aba70c722656"}, 3 4 "ash_phoenix": {:hex, :ash_phoenix, "2.0.0-rc.8", "f151d43566172dfd33e8e8c3841b4463dd655dfc7acc4e462da516323e1e3cbf", [:mix], [{:ash, "~> 3.0.0-rc", [hex: :ash, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.5.6 or ~> 1.6", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.20.3", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "891ac97c7ee1fe96ad6fd0b56f7081930d10bab92cee753d3d2ed026221be372"}, 4 5 "ash_postgres": {:hex, :ash_postgres, "2.0.0-rc.14", "7ec5024bf95b3193f7d766832d3abd812e031e16f1d0d889ff9e9055586b76ba", [:mix], [{:ash, "~> 3.0.0-rc.38", [hex: :ash, repo: "hexpm", optional: false]}, {:ash_sql, "~> 0.1.1-rc.13", [hex: :ash_sql, repo: "hexpm", optional: false]}, {:ecto, "~> 3.9", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.9", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: false]}], "hexpm", "d8f870020bfd4b53ba9f07a019fdaf8086c24c51cfd722fbb576a2b92dc50e88"}, 5 6 "ash_sql": {:hex, :ash_sql, "0.1.1-rc.17", "b55c4a71ba0e4cdfef905bcdfa9ebb74c75e59dd1c1b53fcfa1a8d81e9c58def", [:mix], [{:ash, "~> 3.0.0-rc", [hex: :ash, repo: "hexpm", optional: false]}, {:ecto, "~> 3.9", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.9", [hex: :ecto_sql, repo: "hexpm", optional: false]}], "hexpm", "0eda1e606959d6fb85c665f7465397792f0c128761db8177f1683807020e5f67"}, ··· 7 8 "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, 8 9 "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, 9 10 "comparable": {:hex, :comparable, "1.0.0", "bb669e91cedd14ae9937053e5bcbc3c52bb2f22422611f43b6e38367d94a495f", [:mix], [{:typable, "~> 0.1", [hex: :typable, repo: "hexpm", optional: false]}], "hexpm", "277c11eeb1cd726e7cd41c6c199e7e52fa16ee6830b45ad4cdc62e51f62eb60c"}, 11 + "conv_case": {:hex, :conv_case, "0.2.3", "c1455c27d3c1ffcdd5f17f1e91f40b8a0bc0a337805a6e8302f441af17118ed8", [:mix], [], "hexpm", "88f29a3d97d1742f9865f7e394ed3da011abb7c5e8cc104e676fdef6270d4b4a"}, 10 12 "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, 11 13 "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, 12 14 "ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"}, ··· 23 25 "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, 24 26 "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, 25 27 "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, 28 + "json_xema": {:hex, :json_xema, "0.6.2", "2af74c57f3f8dff8b74502d69d53f1ae7b6b236b477f30871c415ea8377a4c72", [:mix], [{:conv_case, "~> 0.2", [hex: :conv_case, repo: "hexpm", optional: false]}, {:xema, "~> 0.16", [hex: :xema, repo: "hexpm", optional: false]}], "hexpm", "50c84c537c95fcc76677f1f030af4aed188f538820fc488aeaa3f7dfe04d0edf"}, 26 29 "libgraph": {:hex, :libgraph, "0.16.0", "3936f3eca6ef826e08880230f806bfea13193e49bf153f93edcf0239d4fd1d07", [:mix], [], "hexpm", "41ca92240e8a4138c30a7e06466acc709b0cbb795c643e9e17174a178982d6bf"}, 27 30 "makeup": {:hex, :makeup, "1.1.1", "fa0bc768698053b2b3869fa8a62616501ff9d11a562f3ce39580d60860c3a55e", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5dc62fbdd0de44de194898b6710692490be74baa02d9d108bc29f007783b0b48"}, 28 31 "makeup_json": {:hex, :makeup_json, "0.1.1", "44204f3f023ff3daca682cc0b1dc372098514460064599979cb4cde5926cff70", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "3879d78117e37a9b1e567b9cc76c1b5b51b9efc5f4f4301ea5e53fb70c59c718"}, ··· 64 67 "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, 65 68 "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, 66 69 "websock_adapter": {:hex, :websock_adapter, "0.5.6", "0437fe56e093fd4ac422de33bf8fc89f7bc1416a3f2d732d8b2c8fd54792fe60", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "e04378d26b0af627817ae84c92083b7e97aca3121196679b73c73b99d0d133ea"}, 70 + "xema": {:hex, :xema, "0.17.1", "fa83ed90ec7d9a5e38a223ee1f0693cfb8cd3fa0d0c7f7967f828a0643811f10", [:mix], [{:conv_case, "~> 0.2.2", [hex: :conv_case, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "3dd7213309cc8e6d7770ee54de807a0d91cdbdd9dcb78a6f3eee9dbad43889af"}, 67 71 }
+52
nix/mix.nix
··· 21 21 beamDeps = [ comparable decimal ecto ets jason plug reactor spark splode stream_data telemetry ]; 22 22 }; 23 23 24 + ash_json_api = buildMix rec { 25 + name = "ash_json_api"; 26 + version = "1.0.0-rc.6"; 27 + 28 + src = fetchHex { 29 + pkg = "ash_json_api"; 30 + version = "${version}"; 31 + sha256 = "f2f6acbf0a0e8e90a6168c01cfa746430d92332e008a435ad897aba70c722656"; 32 + }; 33 + 34 + beamDeps = [ ash jason json_xema plug ]; 35 + }; 36 + 24 37 ash_phoenix = buildMix rec { 25 38 name = "ash_phoenix"; 26 39 version = "2.0.0-rc.8"; ··· 110 123 }; 111 124 112 125 beamDeps = [ typable ]; 126 + }; 127 + 128 + conv_case = buildMix rec { 129 + name = "conv_case"; 130 + version = "0.2.3"; 131 + 132 + src = fetchHex { 133 + pkg = "conv_case"; 134 + version = "${version}"; 135 + sha256 = "88f29a3d97d1742f9865f7e394ed3da011abb7c5e8cc104e676fdef6270d4b4a"; 136 + }; 137 + 138 + beamDeps = []; 113 139 }; 114 140 115 141 db_connection = buildMix rec { ··· 318 344 }; 319 345 320 346 beamDeps = [ decimal ]; 347 + }; 348 + 349 + json_xema = buildMix rec { 350 + name = "json_xema"; 351 + version = "0.6.2"; 352 + 353 + src = fetchHex { 354 + pkg = "json_xema"; 355 + version = "${version}"; 356 + sha256 = "50c84c537c95fcc76677f1f030af4aed188f538820fc488aeaa3f7dfe04d0edf"; 357 + }; 358 + 359 + beamDeps = [ conv_case xema ]; 321 360 }; 322 361 323 362 libgraph = buildMix rec { ··· 851 890 }; 852 891 853 892 beamDeps = [ bandit plug websock ]; 893 + }; 894 + 895 + xema = buildMix rec { 896 + name = "xema"; 897 + version = "0.17.1"; 898 + 899 + src = fetchHex { 900 + pkg = "xema"; 901 + version = "${version}"; 902 + sha256 = "3dd7213309cc8e6d7770ee54de807a0d91cdbdd9dcb78a6f3eee9dbad43889af"; 903 + }; 904 + 905 + beamDeps = [ conv_case decimal ]; 854 906 }; 855 907 }; 856 908 in self
+102
priv/repo/migrations/20240505035412_install_ash-functions_extension_3.exs
··· 1 + defmodule Sower.Repo.Migrations.InstallAshFunctionsExtension320240505035410 do 2 + @moduledoc """ 3 + Installs any extensions that are mentioned in the repo's `installed_extensions/0` callback 4 + 5 + This file was autogenerated with `mix ash_postgres.generate_migrations` 6 + """ 7 + 8 + use Ecto.Migration 9 + 10 + def up do 11 + execute(""" 12 + CREATE OR REPLACE FUNCTION ash_elixir_or(left BOOLEAN, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE) 13 + AS $$ SELECT COALESCE(NULLIF($1, FALSE), $2) $$ 14 + LANGUAGE SQL 15 + IMMUTABLE; 16 + """) 17 + 18 + execute(""" 19 + CREATE OR REPLACE FUNCTION ash_elixir_or(left ANYCOMPATIBLE, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE) 20 + AS $$ SELECT COALESCE($1, $2) $$ 21 + LANGUAGE SQL 22 + IMMUTABLE; 23 + """) 24 + 25 + execute(""" 26 + CREATE OR REPLACE FUNCTION ash_elixir_and(left BOOLEAN, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE) AS $$ 27 + SELECT CASE 28 + WHEN $1 IS TRUE THEN $2 29 + ELSE $1 30 + END $$ 31 + LANGUAGE SQL 32 + IMMUTABLE; 33 + """) 34 + 35 + execute(""" 36 + CREATE OR REPLACE FUNCTION ash_elixir_and(left ANYCOMPATIBLE, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE) AS $$ 37 + SELECT CASE 38 + WHEN $1 IS NOT NULL THEN $2 39 + ELSE $1 40 + END $$ 41 + LANGUAGE SQL 42 + IMMUTABLE; 43 + """) 44 + 45 + execute(""" 46 + CREATE OR REPLACE FUNCTION ash_trim_whitespace(arr text[]) 47 + RETURNS text[] AS $$ 48 + DECLARE 49 + start_index INT = 1; 50 + end_index INT = array_length(arr, 1); 51 + BEGIN 52 + WHILE start_index <= end_index AND arr[start_index] = '' LOOP 53 + start_index := start_index + 1; 54 + END LOOP; 55 + 56 + WHILE end_index >= start_index AND arr[end_index] = '' LOOP 57 + end_index := end_index - 1; 58 + END LOOP; 59 + 60 + IF start_index > end_index THEN 61 + RETURN ARRAY[]::text[]; 62 + ELSE 63 + RETURN arr[start_index : end_index]; 64 + END IF; 65 + END; $$ 66 + LANGUAGE plpgsql 67 + IMMUTABLE; 68 + """) 69 + 70 + execute(""" 71 + CREATE OR REPLACE FUNCTION ash_raise_error(json_data jsonb) 72 + RETURNS BOOLEAN AS $$ 73 + BEGIN 74 + -- Raise an error with the provided JSON data. 75 + -- The JSON object is converted to text for inclusion in the error message. 76 + RAISE EXCEPTION 'ash_error: %', json_data::text; 77 + RETURN NULL; 78 + END; 79 + $$ LANGUAGE plpgsql; 80 + """) 81 + 82 + execute(""" 83 + CREATE OR REPLACE FUNCTION ash_raise_error(json_data jsonb, type_signal ANYCOMPATIBLE) 84 + RETURNS ANYCOMPATIBLE AS $$ 85 + BEGIN 86 + -- Raise an error with the provided JSON data. 87 + -- The JSON object is converted to text for inclusion in the error message. 88 + RAISE EXCEPTION 'ash_error: %', json_data::text; 89 + RETURN NULL; 90 + END; 91 + $$ LANGUAGE plpgsql; 92 + """) 93 + end 94 + 95 + def down do 96 + # Uncomment this if you actually want to uninstall the extensions 97 + # when this migration is rolled back: 98 + execute( 99 + "DROP FUNCTION IF EXISTS ash_raise_error(jsonb), ash_raise_error(jsonb, ANYCOMPATIBLE), ash_elixir_and(BOOLEAN, ANYCOMPATIBLE), ash_elixir_and(ANYCOMPATIBLE, ANYCOMPATIBLE), ash_elixir_or(ANYCOMPATIBLE, ANYCOMPATIBLE), ash_elixir_or(BOOLEAN, ANYCOMPATIBLE), ash_trim_whitespace(text[])" 100 + ) 101 + end 102 + end
+5 -3
priv/resource_snapshots/repo/extensions.json
··· 1 1 { 2 2 "installed": [ 3 - "uuid-ossp", 4 - "citext" 5 - ] 3 + "ash-functions", 4 + "citext", 5 + "uuid-ossp" 6 + ], 7 + "ash_functions_version": 3 6 8 }