flavours refactored

This commit is contained in:
Mayel de Borniol 2022-02-12 18:54:56 +13:00
parent c34a6898cc
commit c828892107
61 changed files with 1362 additions and 735 deletions

View file

@ -142,9 +142,11 @@ db.rollback.all: mix~"ecto.rollback --all" ## Rollback ALL DB migrations (cautio
#### UPDATE COMMANDS ####
update: init update.app build update.forks mix~deps.get mix~ecto.migrate js.deps.get ## Update the dev app and all dependencies/extensions/forks, and run migrations
update: init update.repo update.app build update.forks mix~deps.get mix~ecto.migrate js.deps.get ## Update the dev app and all dependencies/extensions/forks, and run migrations
update.app: update.repo ## Update the app and Bonfire extensions in ./deps
update.app: update.repo update.deps ## Update the app and Bonfire extensions in ./deps
update.deps: ## Update Bonfire extensions in ./deps
@make --no-print-directory mix.remote~updates
update.repo:

View file

@ -239,7 +239,7 @@ config :bonfire_data_identity, User,
has_one :self, unquote(Self), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_many :encircles, unquote(Encircle), foreign_key: :subject_id
# has_one :shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id
has_one :shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id
has_many :created, unquote(Created), foreign_key: :creator_id
has_many :creations, through: [:created, :pointer] # todo: stop through
has_many :posts, through: [:created, :post] # todo: stop through

View file

@ -1,31 +1,90 @@
import Config
config :bonfire_boundaries,
enabled: true
disabled: false
verbs = %{
read: %{id: "0EAD1NGSVTTER1YFVNDAMENTA1", verb: "Read"},
see: %{id: "0BSERV1NG11ST1NGSEX1STENCE", verb: "See"},
create: %{id: "4REATE0RP0STBRANDNEW0BJECT", verb: "Create"},
edit: %{id: "4HANG1NGVA1VES0FPR0PERT1ES", verb: "Edit"},
delete: %{id: "4AKESTVFFG0AWAYPERMANENT1Y", verb: "Delete"},
follow: %{id: "20SVBSCR1BET0THE0VTPVT0F1T", verb: "Follow"},
like: %{id: "11KES1ND1CATEAM11DAPPR0VA1", verb: "Like"},
boost: %{id: "300ST0R0RANN0VCEANACT1V1TY", verb: "Boost"},
flag: %{id: "71AGSPAM0RVNACCEPTAB1E1TEM", verb: "Flag"},
mention: %{id: "0EFERENC1NGTH1NGSE1SEWHERE", verb: "Mention"},
tag: %{id: "4ATEG0R1S1NGNGR0VP1NGSTVFF", verb: "Tag"},
reply: %{id: "71TCREAT1NGA11NKEDRESP0NSE", verb: "Reply"},
}
config :bonfire,
verbs: %{
read: "0EAD1NGSVTTER1YFVNDAMENTA1",
see: "0BSERV1NG11ST1NGSEX1STENCE",
create: "4REATE0RP0STBRANDNEW0BJECT",
edit: "4HANG1NGVA1VES0FPR0PERT1ES",
delete: "4AKESTVFFG0AWAYPERMANENT1Y",
follow: "20SVBSCR1BET0THE0VTPVT0F1T",
like: "11KES1ND1CATEAM11DAPPR0VA1",
boost: "300ST0R0RANN0VCEANACT1V1TY",
flag: "71AGSPAM0RVNACCEPTAB1E1TEM",
mention: "0EFERENC1NGTH1NGSE1SEWHERE",
tag: "4ATEG0R1S1NGNGR0VP1NGSTVFF",
verbs: verbs,
circles: %{
guest: %{id: "0AND0MSTRANGERS0FF1NTERNET", name: "Guests"},
local: %{id: "3SERSFR0MY0VR10CA11NSTANCE", name: "Local Users"},
activity_pub: %{id: "7EDERATEDW1THANACT1V1TYPVB", name: "ActivityPub Peers"},
# stereotypes
followers: %{id: "7DAPE0P1E1PERM1TT0F0110WME", name: "My Followers"},
blocked: %{id: "7N010NGERC0NSENTT0Y0VN0WTY"},
},
default_circles: %{
guest: "0AND0MSTRANGERS0FF1NTERNET",
local: "3SERSFR0MY0VR10CA11NSTANCE",
activity_pub: "7EDERATEDW1THANACT1V1TYPVB",
admin: "2DM1NRESP0NS1B1E0F1NSTANCE"
acls: %{
# read_only: %{id: "AC10N1YACCESS1SREADACCESS1", name: "Read Only"},
# local: %{id: "711M1TEDT010CA1VSERSS01E1Y", name: "Locally Public"},
guests_may_see: %{id: "7W1DE1YAVA11AB1ET0SEENREAD", name: "Publicly visible"},
locals_may_interact: %{id: "710CA1SMY1NTERACTN0TREP1YY", name: "Local users may read, interact"},
locals_may_reply: %{id: "710CA1SMY1NTERACTANDREP1YY", name: "Local users may read, interact and reply"},
### stereotypes - access levels
i_may_see: %{id: "71MAYSEEANDREADMY0WNSTVFFS"},
i_may_interact: %{id: "71MAY1NTERACTW1MY0WNSTVFFS"},
i_may_administer: %{id: "71MAYADM1N1STERMY0WNSTVFFS"},
### stereotypes - always mix in
blocked: %{id: "7AC0MPVTERBESAY1NGN0THANKS"},
},
circle_names: %{
guest: "Public",
local: "Local Users",
activity_pub: "Federate for Remote Users",
admin: "Instance Admins"
grants: %{
guests_may_see: %{guest: [:read, :see]},
locals_may_interact: %{local: [:read, :see, :mention, :tag, :boost, :flag, :like, :follow]},
locals_may_reply: %{local: [:read, :see, :mention, :tag, :boost, :flag, :like, :follow, :reply]},
}
# ladder: replyable > interactable > visible
# circles: guests, locals, followers
# common cases:
# * public and replyable by any member or ap user
# * public and interactable, but only replyable by people on my instance
# * public read only, interactions and replies from people on my instance
# * public read only, interactions and replies from people on my instance and my followers
# * friends only:
alias Bonfire.Me.Users
blocked = Enum.reduce(verbs, %{}, &Map.put(&2, elem(&1, 0), false))
config :bonfire_me, Users,
default_boundaries: %{
circles: %{
followers: %{name: "Followers", stereotype: :followers},
blocked: %{name: "Blocked", stereotype: :blocked},
},
acls: %{
i_may_see: %{stereotype: :i_may_see},
i_may_interact: %{stereotype: :i_may_interact},
i_may_administer: %{stereotype: :i_may_administer},
blocked: %{stereotype: :blocked, name: "Blocked"},
},
grants: %{
i_may_see: %{SELF: [:read, :see]},
i_may_interact: %{SELF: [:read, :see, :create, :mention, :tag, :boost, :flag, :like, :follow]},
i_may_administer: %{SELF: [:read, :see, :edit, :delete]},
blocked: %{blocked: blocked},
},
controlleds: %{
# by default, we may administer ourselves. within contexts, we
# may add more depending on whether the user is local or remote.
SELF: [:guests_may_see, :locals_may_interact, :i_may_administer]
},
# these are acls that we should always mix in. which we don't yet.
always: [:blocked],
}

View file

@ -239,7 +239,7 @@ config :bonfire_data_identity, User,
has_one :self, unquote(Self), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_many :encircles, unquote(Encircle), foreign_key: :subject_id
# has_one :shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id
has_one :shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id
has_many :created, unquote(Created), foreign_key: :creator_id
has_many :creations, through: [:created, :pointer] # todo: stop through
has_many :posts, through: [:created, :post] # todo: stop through
@ -488,6 +488,6 @@ config :bonfire_geolocate, Bonfire.Geolocate.Geolocation,
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [tag_id: :id, id: :id],
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
end]

View file

@ -1,12 +1,14 @@
defmodule Bonfire.Repo.Migrations.InitPointers do
use Ecto.Migration
import Pointers.Migration
# import Pointers.ULID.Migration
def up do
init_pointers_ulid_extra()
init_pointers()
end
def down do
init_pointers_ulid_extra()
init_pointers()
end
end

View file

@ -1,11 +0,0 @@
defmodule Bonfire.Repo.Migrations.InitPointersULID do
use Ecto.Migration
# import Pointers.Migration
import Pointers.ULID.Migration
def change do
init_pointers_ulid_extra()
# init_pointers()
end
end

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Repo.Migrations.InitEdges do
use Ecto.Migration
alias Bonfire.Data.Edges.Migration
def up do
Migration.up()
end
def down do
Migration.down()
end
end

View file

@ -1,16 +0,0 @@
defmodule Bonfire.Repo.Migrations.ImportBoost do
use Ecto.Migration
import Bonfire.Data.Social.Boost.Migration
import Bonfire.Data.Social.BoostCount.Migration
def up do
migrate_boost()
migrate_boost_count()
end
def down do
migrate_boost_count()
migrate_boost()
end
end

View file

@ -1,17 +0,0 @@
defmodule Bonfire.Repo.Migrations.ImportFlag do
use Ecto.Migration
import Bonfire.Data.Social.Flag.Migration
import Bonfire.Data.Social.FlagCount.Migration
def up do
migrate_flag()
migrate_flag_count()
end
def down do
migrate_flag_count()
migrate_flag()
end
end

View file

@ -1,22 +0,0 @@
defmodule Bonfire.Social.Repo.Migrations.CountFunctions do
use Ecto.Migration
require Bonfire.Data.Social.Replied.Migration
def up do
Bonfire.Data.Social.FollowCount.Migration.migrate_functions()
Bonfire.Data.Social.BoostCount.Migration.migrate_functions()
Bonfire.Data.Social.LikeCount.Migration.migrate_functions()
Bonfire.Data.Social.Replied.Migration.migrate_functions()
end
def down do
Bonfire.Data.Social.FollowCount.Migration.migrate_functions()
Bonfire.Data.Social.BoostCount.Migration.migrate_functions()
Bonfire.Data.Social.LikeCount.Migration.migrate_functions()
Bonfire.Data.Social.Replied.Migration.migrate_functions()
end
end

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.ImportInviteLink do
use Ecto.Migration
def up do
Bonfire.Invites.Link.Migration.up
end
def down do
Bonfire.Invites.Link.Migration.down
end
end

View file

@ -1,31 +1,90 @@
import Config
config :bonfire_boundaries,
enabled: true
disabled: false
verbs = %{
read: %{id: "0EAD1NGSVTTER1YFVNDAMENTA1", verb: "Read"},
see: %{id: "0BSERV1NG11ST1NGSEX1STENCE", verb: "See"},
create: %{id: "4REATE0RP0STBRANDNEW0BJECT", verb: "Create"},
edit: %{id: "4HANG1NGVA1VES0FPR0PERT1ES", verb: "Edit"},
delete: %{id: "4AKESTVFFG0AWAYPERMANENT1Y", verb: "Delete"},
follow: %{id: "20SVBSCR1BET0THE0VTPVT0F1T", verb: "Follow"},
like: %{id: "11KES1ND1CATEAM11DAPPR0VA1", verb: "Like"},
boost: %{id: "300ST0R0RANN0VCEANACT1V1TY", verb: "Boost"},
flag: %{id: "71AGSPAM0RVNACCEPTAB1E1TEM", verb: "Flag"},
mention: %{id: "0EFERENC1NGTH1NGSE1SEWHERE", verb: "Mention"},
tag: %{id: "4ATEG0R1S1NGNGR0VP1NGSTVFF", verb: "Tag"},
reply: %{id: "71TCREAT1NGA11NKEDRESP0NSE", verb: "Reply"},
}
config :bonfire,
verbs: %{
read: "0EAD1NGSVTTER1YFVNDAMENTA1",
see: "0BSERV1NG11ST1NGSEX1STENCE",
create: "4REATE0RP0STBRANDNEW0BJECT",
edit: "4HANG1NGVA1VES0FPR0PERT1ES",
delete: "4AKESTVFFG0AWAYPERMANENT1Y",
follow: "20SVBSCR1BET0THE0VTPVT0F1T",
like: "11KES1ND1CATEAM11DAPPR0VA1",
boost: "300ST0R0RANN0VCEANACT1V1TY",
flag: "71AGSPAM0RVNACCEPTAB1E1TEM",
mention: "0EFERENC1NGTH1NGSE1SEWHERE",
tag: "4ATEG0R1S1NGNGR0VP1NGSTVFF",
verbs: verbs,
circles: %{
guest: %{id: "0AND0MSTRANGERS0FF1NTERNET", name: "Guests"},
local: %{id: "3SERSFR0MY0VR10CA11NSTANCE", name: "Local Users"},
activity_pub: %{id: "7EDERATEDW1THANACT1V1TYPVB", name: "ActivityPub Peers"},
# stereotypes
followers: %{id: "7DAPE0P1E1PERM1TT0F0110WME", name: "My Followers"},
blocked: %{id: "7N010NGERC0NSENTT0Y0VN0WTY"},
},
default_circles: %{
guest: "0AND0MSTRANGERS0FF1NTERNET",
local: "3SERSFR0MY0VR10CA11NSTANCE",
activity_pub: "7EDERATEDW1THANACT1V1TYPVB",
admin: "2DM1NRESP0NS1B1E0F1NSTANCE"
acls: %{
# read_only: %{id: "AC10N1YACCESS1SREADACCESS1", name: "Read Only"},
# local: %{id: "711M1TEDT010CA1VSERSS01E1Y", name: "Locally Public"},
guests_may_see: %{id: "7W1DE1YAVA11AB1ET0SEENREAD", name: "Publicly visible"},
locals_may_interact: %{id: "710CA1SMY1NTERACTN0TREP1YY", name: "Local users may read, interact"},
locals_may_reply: %{id: "710CA1SMY1NTERACTANDREP1YY", name: "Local users may read, interact and reply"},
### stereotypes - access levels
i_may_see: %{id: "71MAYSEEANDREADMY0WNSTVFFS"},
i_may_interact: %{id: "71MAY1NTERACTW1MY0WNSTVFFS"},
i_may_administer: %{id: "71MAYADM1N1STERMY0WNSTVFFS"},
### stereotypes - always mix in
blocked: %{id: "7AC0MPVTERBESAY1NGN0THANKS"},
},
circle_names: %{
guest: "Public",
local: "Local Users",
activity_pub: "Federate for Remote Users",
admin: "Instance Admins"
grants: %{
guests_may_see: %{guest: [:read, :see]},
locals_may_interact: %{local: [:read, :see, :mention, :tag, :boost, :flag, :like, :follow]},
locals_may_reply: %{local: [:read, :see, :mention, :tag, :boost, :flag, :like, :follow, :reply]},
}
# ladder: replyable > interactable > visible
# circles: guests, locals, followers
# common cases:
# * public and replyable by any member or ap user
# * public and interactable, but only replyable by people on my instance
# * public read only, interactions and replies from people on my instance
# * public read only, interactions and replies from people on my instance and my followers
# * friends only:
alias Bonfire.Me.Users
blocked = Enum.reduce(verbs, %{}, &Map.put(&2, elem(&1, 0), false))
config :bonfire_me, Users,
default_boundaries: %{
circles: %{
followers: %{name: "Followers", stereotype: :followers},
blocked: %{name: "Blocked", stereotype: :blocked},
},
acls: %{
i_may_see: %{stereotype: :i_may_see},
i_may_interact: %{stereotype: :i_may_interact},
i_may_administer: %{stereotype: :i_may_administer},
blocked: %{stereotype: :blocked, name: "Blocked"},
},
grants: %{
i_may_see: %{SELF: [:read, :see]},
i_may_interact: %{SELF: [:read, :see, :create, :mention, :tag, :boost, :flag, :like, :follow]},
i_may_administer: %{SELF: [:read, :see, :edit, :delete]},
blocked: %{blocked: blocked},
},
controlleds: %{
# by default, we may administer ourselves. within contexts, we
# may add more depending on whether the user is local or remote.
SELF: [:guests_may_see, :locals_may_interact, :i_may_administer]
},
# these are acls that we should always mix in. which we don't yet.
always: [:blocked],
}

View file

@ -35,7 +35,7 @@ context_and_queries_extensions = pointable_schema_extensions ++ [
:bonfire_social,
:bonfire_valueflows
]
config :bonfire, :query_modules_search_path, context_and_queries_extensions
config :bonfire, :query_modules_search_path, context_and_queries_extensions
config :bonfire, :context_modules_search_path, context_and_queries_extensions
# Search these apps/extensions for Verbs to index (i.e. they contain modules with a declare_verbs/0 function)
@ -50,15 +50,22 @@ config :bonfire_data_access_control,
#### Alias modules for readability
alias Pointers.{Pointer, Table}
alias Bonfire.Data.AccessControl.{
Access, Acl, Controlled, InstanceAdmin, Grant, Interact, Verb
Acl, Circle, Encircle, Controlled, InstanceAdmin, Grant, Verb,
}
alias Bonfire.Data.ActivityPub.{Actor, Peer, Peered}
alias Bonfire.Boundaries.Stereotype
alias Bonfire.Data.Edges.{Edge,EdgeTotal}
alias Bonfire.Data.Identity.{
Account, Accounted, Caretaker, Character, Credential, Email, Self, User, Named
Account, Accounted, Caretaker, Character, Credential, Email, Named, Self, User,
}
alias Bonfire.Data.Social.{
Activity, Article, Block, Bookmark, Circle, Created, Encircle, Feed, FeedPublish, Inbox, Message, Follow, FollowCount, Boost, BoostCount, Like, LikeCount, Flag, FlagCount, Mention, Post, PostContent, Profile, Replied
Activity, Article, Block, Bookmark, Created, Feed, FeedPublish, Message, Follow,
Boost, Like, Flag, Mention, Post, PostContent, Profile, Replied,
}
alias Bonfire.Classify.Category
alias Bonfire.Geolocate.Geolocation
alias Bonfire.Files.Media
alias Bonfire.{Tag, Tag.Tagged}
#### Flexto Stitching
@ -71,33 +78,62 @@ alias Bonfire.Data.Social.{
## Note: This does not apply to configuration for
## `Pointers.Changesets`, which is read at runtime, not compile time
edge = quote do
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
end
edges = quote do
unquote(edge)
# has_one :edge, unquote(Edge), foreign_key: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id # requires an ON clause
end
# first up, pointers could have all the mixins we're using. TODO
config :pointers, Pointer,
has_one: [controlled: {Controlled, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # needs ON clause
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [character: {Character, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
# add references of tags to any tagged Pointer
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
@follow_ulid "70110WTHE1EADER1EADER1EADE"
# pointables
has_one :circle, unquote(Circle), foreign_key: :id
has_one :user, unquote(User), foreign_key: :id
has_one :post, unquote(Post), foreign_key: :id
has_one :message, unquote(Message), foreign_key: :id
has_one :category, unquote(Category), references: :id, foreign_key: :id
has_one :geolocation, unquote(Geolocation), references: :id, foreign_key: :id
# mixins
has_one :stereotype, unquote(Stereotype), foreign_key: :id
has_one :named, unquote(Named), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :created, unquote(Created), foreign_key: :id
has_one :peered, unquote(Peered), foreign_key: :id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id
has_one :post_content, unquote(PostContent), foreign_key: :id
has_one :replied, unquote(Replied), foreign_key: :id
has_one :profile, unquote(Profile), foreign_key: :id
has_one :character, unquote(Character), foreign_key: :id
has_one :actor, unquote(Actor), foreign_key: :id
has_one :edge, unquote(Edge), foreign_key: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
has_one :follow_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @follow_ulid]
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id
# add references of tags to any tagged Pointer
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [pointer_id: :id, tag_id: :id],
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
}
]
end]
config :pointers, Table, []
@ -105,30 +141,42 @@ config :pointers, Table, []
# bonfire_data_access_control
config :bonfire_data_access_control, Access,
has_one: [named: {Named, foreign_key: :id}],
has_one: [caretaker: {Caretaker, foreign_key: :id}]
config :bonfire_data_access_control, Acl,
has_one: [named: {Named, foreign_key: :id}],
has_one: [caretaker: {Caretaker, foreign_key: :id}]
[code: quote do
# this allows us to identify acls for the user which have special
# meaning to the system, such as "public" or "private"
has_one :stereotype, unquote(Stereotype), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_one :named, unquote(Named), foreign_key: :id
# has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_access_control, Circle,
[code: quote do
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_one :named, unquote(Named), foreign_key: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_access_control, Controlled, []
config :bonfire_data_access_control, Encircle, []
config :bonfire_data_access_control, Grant,
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_circle: {Circle, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_named: {Named, foreign_key: :subject_id, define_field: false}]
[code: quote do
has_one :caretaker, unquote(Caretaker), foreign_key: :id
# has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_access_control, Interact, []
config :bonfire_data_access_control, Verb, []
# bonfire_data_activity_pub
config :bonfire_data_activity_pub, Actor,
belongs_to: [character: {Character, foreign_key: :id, define_field: false}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
[code: quote do
belongs_to :character, unquote(Character), foreign_key: :id, define_field: false
belongs_to :user, unquote(User), foreign_key: :id, define_field: false
has_one :peered, unquote(Peered), foreign_key: :id, references: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_activity_pub, Peer, []
config :bonfire_data_activity_pub, Peered, []
@ -136,243 +184,299 @@ config :bonfire_data_activity_pub, Peered, []
# bonfire_data_identity
config :bonfire_data_identity, Account,
has_one: [credential: {Credential, foreign_key: :id}],
has_one: [email: {Email, foreign_key: :id}],
has_one: [inbox: {Inbox, foreign_key: :id}],
many_to_many: [users: {User, join_through: "bonfire_data_identity_accounted", join_keys: [account_id: :id, id: :id]}],
many_to_many: [shared_users: {User, join_through: "bonfire_data_shared_user_accounts", join_keys: [account_id: :id, shared_user_id: :id]}]
[code: quote do
has_one :credential, unquote(Credential),foreign_key: :id
has_one :email, unquote(Email), foreign_key: :id
many_to_many :users, unquote(User),
join_through: "bonfire_data_identity_accounted",
join_keys: [account_id: :id, id: :id]
many_to_many :shared_users, unquote(User),
join_through: "bonfire_data_shared_user_accounts",
join_keys: [account_id: :id, shared_user_id: :id]
end]
config :bonfire_data_identity, Accounted,
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
[code: quote do
belongs_to :user, unquote(User), foreign_key: :id, define_field: false
end]
config :bonfire_data_identity, Caretaker, []
config :bonfire_data_identity, Character,
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [user: {User, foreign_key: :id}],
has_one: [feed: {Feed, foreign_key: :id}],
has_one: [inbox: {Inbox, foreign_key: :id}],
has_many: [feed_publishes: {FeedPublish, references: :id, foreign_key: :feed_id}],
has_many: [followers: {Follow, foreign_key: :following_id, references: :id}],
has_many: [followed: {Follow, foreign_key: :follower_id, references: :id}],
has_one: [follow_count: {FollowCount, foreign_key: :id}]
[code: quote do
@follow_ulid "70110WTHE1EADER1EADER1EADE"
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_one :actor, unquote(Actor), foreign_key: :id
has_one :profile, unquote(Profile), foreign_key: :id
has_one :user, unquote(User), foreign_key: :id
has_one :feed, unquote(Feed), foreign_key: :id
has_many :followers, unquote(Follow), foreign_key: :following_id, references: :id
has_many :followed, unquote(Follow), foreign_key: :follower_id, references: :id
has_one :follow_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @follow_ulid]
end]
config :bonfire_data_identity, Credential,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
[code: quote do
belongs_to :account, unquote(Account), foreign_key: :id, define_field: false
end]
config :bonfire_data_identity, Email,
must_confirm: true,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
[must_confirm: true,
code: quote do
belongs_to :account, unquote(Account), foreign_key: :id, define_field: false
end]
config :bonfire_data_identity, Self, []
config :bonfire_data_identity, User,
has_one: [accounted: {Accounted, foreign_key: :id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [character: {Character, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
has_one: [instance_admin: {InstanceAdmin, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liker_id, references: :id}],
has_one: [self: {Self, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_many: [encircles: {Encircle, foreign_key: :subject_id}],
has_one: [shared_user: {Bonfire.Data.SharedUser, foreign_key: :id}],
many_to_many: [caretaker_accounts: {Account, join_through: "bonfire_data_shared_user_accounts", join_keys: [shared_user_id: :id, account_id: :id]}]
# has_one: [geolocation: {Bonfire.Geolocate.Geolocation}]
[code: quote do
has_one :accounted, unquote(Accounted), foreign_key: :id
has_one :profile, unquote(Profile), foreign_key: :id
has_one :character, unquote(Character), foreign_key: :id
has_one :actor, unquote(Actor), foreign_key: :id
has_one :instance_admin, unquote(InstanceAdmin), foreign_key: :id, on_replace: :update
has_one :self, unquote(Self), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_many :encircles, unquote(Encircle), foreign_key: :subject_id
has_one :shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id
has_many :created, unquote(Created), foreign_key: :creator_id
has_many :creations, through: [:created, :pointer] # todo: stop through
has_many :posts, through: [:created, :post] # todo: stop through
has_many :user_activities, unquote(Activity), foreign_key: :subject_id, references: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
many_to_many :caretaker_accounts, unquote(Account),
join_through: "bonfire_data_shared_user_accounts",
join_keys: [shared_user_id: :id, account_id: :id]
# has_many :account, through: [:accounted, :account] # this is private info, do not expose
# has_one :geolocation, Bonfire.Geolocate.Geolocation
end]
# bonfire_data_social
### bonfire_data_social
config :bonfire_data_social, Activity,
belongs_to: [subject_user: {User, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [object_peered: {Peered, foreign_key: :object_id, define_field: false}],
belongs_to: [object_post: {Post, foreign_key: :object_id, define_field: false}],
# belongs_to: [object_post_content: {PostContent, foreign_key: :object_id, define_field: false}],
belongs_to: [object_message: {Message, foreign_key: :object_id, define_field: false}],
has_one: [boost_count: {BoostCount, foreign_key: :id, references: :object_id}],
has_one: [like_count: {LikeCount, foreign_key: :id, references: :object_id}],
has_many: [boosts: {Boost, foreign_key: :boosted_id, references: :object_id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_boost: {Boost, foreign_key: :boosted_id, references: :object_id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :object_id}],
has_one: [replied: {Replied, foreign_key: :id, references: :object_id}],
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_one: [object_created: {Created, foreign_key: :id, references: :object_id}],
# has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
# has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
# has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :object_id}],
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
@follow_ulid "70110WTHE1EADER1EADER1EADE"
# has_one :object_created, unquote(Created), foreign_key: :id
# belongs_to :object_peered, unquote(Peered), foreign_key: :id, define_field: false
# belongs_to :object_post, unquote(Post), foreign_key: :id, define_field: false
# belongs_to :object_post_content, unquote(PostContent), foreign_key: :id, define_field: false
# belongs_to :object_message, unquote(Message), foreign_key: :id, define_field: false
has_one :replied, unquote(Replied), foreign_key: :id, references: :object_id
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
# has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
# has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
# has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}],
# ugly workaround needed for querying
has_one :activity, unquote(Activity), foreign_key: :id, references: :id
has_one :like_count, unquote(EdgeTotal), foreign_key: :id, references: :object_id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal), foreign_key: :id, references: :object_id, where: [table_id: @boost_ulid]
has_one :follow_count, unquote(EdgeTotal), foreign_key: :id, references: :object_id, where: [table_id: @follow_ulid]
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :object_id
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :object_id
has_many :feed_publishes, unquote(FeedPublish), references: :id, foreign_key: :activity_id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [pointer_id: :object_id, tag_id: :id],
join_keys: [id: :object_id, tag_id: :id],
on_replace: :delete
}
]
end]
config :bonfire_data_social, Circle,
has_one: [caretaker: {Caretaker, foreign_key: :id}],
has_one: [named: {Named, foreign_key: :id}]
# has_many: [encircles: {Encircle, foreign_key: :circle_id}]
config :bonfire_data_social, Encircle,
belongs_to: [subject_user: {User, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}]
config :bonfire_data_social, Edge,
[code: quote do
unquote(edge)
# TODO: requires composite foreign keys:
# has_one :activity, unquote(Activity),
# foreign_key: [:table_id, :object_id], references: [:table_id, :object_id]
end]
config :bonfire_data_social, Feed,
belongs_to: [character: {Character, foreign_key: :id, define_field: false}],
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
[code: quote do
# belongs_to :character, unquote(Character), foreign_key: :id, define_field: false
# belongs_to :user, unquote(User), foreign_key: :id, define_field: false
end]
config :bonfire_data_social, FeedPublish, []
config :bonfire_data_social, Follow,
belongs_to: [follower_character: {Character, foreign_key: :follower_id, define_field: false}],
belongs_to: [follower_profile: {Profile, foreign_key: :follower_id, define_field: false}],
belongs_to: [followed_character: {Character, foreign_key: :followed_id, define_field: false}],
belongs_to: [followed_profile: {Profile, foreign_key: :followed_id, define_field: false}]
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
# belongs_to: [follower_character: {Character, foreign_key: :follower_id, define_field: false}],
# belongs_to: [follower_profile: {Profile, foreign_key: :follower_id, define_field: false}],
# belongs_to: [followed_character: {Character, foreign_key: :followed_id, define_field: false}],
# belongs_to: [followed_profile: {Profile, foreign_key: :followed_id, define_field: false}]
config :bonfire_data_social, Block,
[code: quote do
unquote(edges)
end]
config :bonfire_data_social, Boost,
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
# has_one: [activity: {Activity, foreign_key: :object_id, references: :boosted_id}] # requires an ON clause
config :bonfire_data_social, FollowCount, []
config :bonfire_data_social, Block, []
config :bonfire_data_social, Like,
has_one: [activity: {Activity, foreign_key: :object_id, references: :liked_id}] # requires an ON clause
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
# has_one: [activity: {Activity, foreign_key: :object_id, references: :liked_id}] # requires an ON clause
config :bonfire_data_social, LikeCount, []
config :bonfire_data_social, Bookmark, []
config :bonfire_data_social, Flag,
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
config :bonfire_data_social, Bookmark,
[code: quote do
unquote(edges)
end]
config :bonfire_data_social, Message,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # requires an ON clause
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
has_one: [controlled: {Controlled, foreign_key: :id}]
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
has_one :post_content, unquote(PostContent), foreign_key: :id
has_one :created, unquote(Created), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id,
references: :id # requires an ON clause
has_one :replied, unquote(Replied), foreign_key: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
end]
config :bonfire_data_social, Mention, []
config :bonfire_data_social, Named, []
config :bonfire_data_social, Post,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
# has_one: [creator_user: {[through: [:created, :creator_user]]}],
# has_one: [creator_character: {[through: [:created, :creator_character]]}],
# has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # requires an ON clause
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_boost: {Boost, foreign_key: :boosted_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_one: [controlled: {Controlled, foreign_key: :id}]
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_one :post_content, unquote(PostContent), foreign_key: :id
has_one :created, unquote(Created), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
# has_one: [creator_user: {[through: [:created, :creator_user]]}],
# has_one: [creator_character: {[through: [:created, :creator_character]]}],
# has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id # requires an ON clause
has_one :replied, unquote(Replied), foreign_key: :id
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
end]
config :bonfire_data_social, PostContent, []
config :bonfire_data_social, PostContent,
[code: quote do
field :hashtags, {:array, :any}, virtual: true # used in changesets
field :mentions, {:array, :any}, virtual: true # used in changesets
end]
config :bonfire_data_social, Replied,
belongs_to: [post: {Post, foreign_key: :id, define_field: false}],
belongs_to: [post_content: {PostContent, foreign_key: :id, define_field: false}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}],
has_one: [reply_to_post: {Post, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_post_content: {PostContent, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_created: {Created, foreign_key: :id, references: :reply_to_id}],
# has_one: [reply_to_creator_user: {[through: [:reply_to_created, :creator_user]]}],
# has_one: [reply_to_creator_character: {[through: [:reply_to_created, :creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:reply_to_created, :creator_profile]]}],
# has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id, references: :id}],
has_many: [thread_replies: {Replied, foreign_key: :thread_id, references: :id}],
has_one: [thread_post: {Post, foreign_key: :id, references: :thread_id}],
has_one: [thread_post_content: {PostContent, foreign_key: :id, references: :thread_id}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :id}]
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
belongs_to :post, unquote(Post), foreign_key: :id, define_field: false
belongs_to :post_content,unquote(PostContent), foreign_key: :id, define_field: false
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id
field :replying_to, :map, virtual: true # used in changesets
has_one :reply_to_post, unquote(Post), foreign_key: :id, references: :reply_to_id
has_one :reply_to_post_content, unquote(PostContent), foreign_key: :id, references: :reply_to_id
has_one :reply_to_created, unquote(Created), foreign_key: :id, references: :reply_to_id
# has_one :reply_to_creator_user, through: [:reply_to_created, :creator_user]
# has_one :reply_to_creator_character, through: [:reply_to_created, :creator_character]
# has_one :reply_to_creator_profile, through: [:reply_to_created, :creator_profile]
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id, references: :id
has_many :thread_replies, unquote(Replied), foreign_key: :thread_id, references: :id
has_one :thread_post, unquote(Post), foreign_key: :id, references: :thread_id
has_one :thread_post_content, unquote(PostContent), foreign_key: :id, references: :thread_id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
end]
config :bonfire_data_social, Created,
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
belongs_to: [creator_user: {User, foreign_key: :creator_id, define_field: false}],
belongs_to: [creator_character: {Character, foreign_key: :creator_id, define_field: false}],
belongs_to: [creator_profile: {Profile, foreign_key: :creator_id, define_field: false}]
[code: quote do
belongs_to :creator_user, unquote(User), foreign_key: :creator_id, define_field: false
belongs_to :creator_character, unquote(Character), foreign_key: :creator_id, define_field: false
belongs_to :creator_profile, unquote(Profile), foreign_key: :creator_id, define_field: false
has_one :peered, unquote(Peered), foreign_key: :id, references: :id
has_one :post, unquote(Post), foreign_key: :id, references: :id
end]
config :bonfire_data_social, Profile,
belongs_to: [user: {User, foreign_key: :id, define_field: false}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :id}]
[code: quote do
belongs_to :user, unquote(User), foreign_key: :id, define_field: false
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
######### other extensions
# optional mixin relations for tags that are characters (eg Category) or any other type of objects
config :bonfire_tag, Bonfire.Tag,
# for objects that are follow-able and can federate activities
has_one: [character: {Bonfire.Data.Identity.Character, references: :id, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
# has_one: [actor: {Bonfire.Data.ActivityPub.Actor, references: :id, foreign_key: :id}],
has_one: [follow_count: {Bonfire.Data.Social.FollowCount, references: :id, foreign_key: :id}],
# for likeable objects
has_one: [like_count: {Bonfire.Data.Social.LikeCount, references: :id, foreign_key: :id}],
# name/description
has_one: [profile: {Bonfire.Data.Social.Profile, references: :id, foreign_key: :id}],
# for taxonomy categories/topics
has_one: [category: {Bonfire.Classify.Category, references: :id, foreign_key: :id}],
# for locations
has_one: [geolocation: {Bonfire.Geolocate.Geolocation, references: :id, foreign_key: :id}]
# add references of tagged objects to any Category
config :bonfire_classify, Bonfire.Classify.Category,
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
config :bonfire_classify, Category,
[code: quote do
# has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [tag_id: :id, pointer_id: :id],
join_keys: [tag_id: :id, id: :id],
on_replace: :delete
}
]
end]
# add references of tagged objects to any Geolocation
config :bonfire_geolocate, Bonfire.Geolocate.Geolocation,
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
unique: true,
join_keys: [tag_id: :id, pointer_id: :id],
on_replace: :delete
}
]
config :bonfire_files, Bonfire.Files.Media,
field: [
url: {:string, virtual: true}
]
config :bonfire_valueflows, ValueFlows.Planning.Intent,
has_one: [like_count: {LikeCount, foreign_key: :id}]
config :bonfire_files, Media,
[code: quote do
field :url, :string, virtual: true
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]

View file

@ -1,12 +1,14 @@
defmodule Bonfire.Repo.Migrations.InitPointers do
use Ecto.Migration
import Pointers.Migration
# import Pointers.ULID.Migration
def up do
init_pointers_ulid_extra()
init_pointers()
end
def down do
init_pointers_ulid_extra()
init_pointers()
end
end

View file

@ -1,11 +0,0 @@
defmodule Bonfire.Repo.Migrations.InitPointersULID do
use Ecto.Migration
# import Pointers.Migration
import Pointers.ULID.Migration
def change do
init_pointers_ulid_extra()
# init_pointers()
end
end

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Repo.Migrations.InitEdges do
use Ecto.Migration
alias Bonfire.Data.Edges.Migration
def up do
Migration.up()
end
def down do
Migration.down()
end
end

View file

@ -3,7 +3,7 @@ defmodule Bonfire.Boundaries.Repo.Migrations.ImportBoundaries do
import Bonfire.Boundaries.Migrations
def up, do: migrate_boundaries
def down, do: migrate_boundaries
def up, do: migrate_boundaries()
def down, do: migrate_boundaries()
end

View file

@ -1,16 +0,0 @@
defmodule Bonfire.Repo.Migrations.ImportBoost do
use Ecto.Migration
import Bonfire.Data.Social.Boost.Migration
import Bonfire.Data.Social.BoostCount.Migration
def up do
migrate_boost()
migrate_boost_count()
end
def down do
migrate_boost_count()
migrate_boost()
end
end

View file

@ -1,17 +0,0 @@
defmodule Bonfire.Repo.Migrations.ImportFlag do
use Ecto.Migration
import Bonfire.Data.Social.Flag.Migration
import Bonfire.Data.Social.FlagCount.Migration
def up do
migrate_flag()
migrate_flag_count()
end
def down do
migrate_flag_count()
migrate_flag()
end
end

View file

@ -1,22 +0,0 @@
defmodule Bonfire.Social.Repo.Migrations.CountFunctions do
use Ecto.Migration
require Bonfire.Data.Social.Replied.Migration
def up do
Bonfire.Data.Social.FollowCount.Migration.migrate_functions()
Bonfire.Data.Social.BoostCount.Migration.migrate_functions()
Bonfire.Data.Social.LikeCount.Migration.migrate_functions()
Bonfire.Data.Social.Replied.Migration.migrate_functions()
end
def down do
Bonfire.Data.Social.FollowCount.Migration.migrate_functions()
Bonfire.Data.Social.BoostCount.Migration.migrate_functions()
Bonfire.Data.Social.LikeCount.Migration.migrate_functions()
Bonfire.Data.Social.Replied.Migration.migrate_functions()
end
end

View file

@ -1,9 +0,0 @@
defmodule Bonfire.Repo.Migrations.Message do
use Ecto.Migration
import Bonfire.Data.Social.Message.Migration
def up, do: migrate_message()
def down, do: migrate_message()
end

View file

@ -1,8 +0,0 @@
defmodule Bonfire.Repo.Migrations.ImportRanked do
use Ecto.Migration
require Bonfire.Data.Assort.Ranked.Migration
def up, do: Bonfire.Data.Assort.Ranked.Migration.migrate_ranked
def down, do: Bonfire.Data.Assort.Ranked.Migration.migrate_ranked
end

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.ImportInviteLink do
use Ecto.Migration
def up do
Bonfire.Invites.Link.Migration.up
end
def down do
Bonfire.Invites.Link.Migration.down
end
end

View file

@ -1,31 +1,90 @@
import Config
config :bonfire_boundaries,
enabled: true
disabled: false
verbs = %{
read: %{id: "0EAD1NGSVTTER1YFVNDAMENTA1", verb: "Read"},
see: %{id: "0BSERV1NG11ST1NGSEX1STENCE", verb: "See"},
create: %{id: "4REATE0RP0STBRANDNEW0BJECT", verb: "Create"},
edit: %{id: "4HANG1NGVA1VES0FPR0PERT1ES", verb: "Edit"},
delete: %{id: "4AKESTVFFG0AWAYPERMANENT1Y", verb: "Delete"},
follow: %{id: "20SVBSCR1BET0THE0VTPVT0F1T", verb: "Follow"},
like: %{id: "11KES1ND1CATEAM11DAPPR0VA1", verb: "Like"},
boost: %{id: "300ST0R0RANN0VCEANACT1V1TY", verb: "Boost"},
flag: %{id: "71AGSPAM0RVNACCEPTAB1E1TEM", verb: "Flag"},
mention: %{id: "0EFERENC1NGTH1NGSE1SEWHERE", verb: "Mention"},
tag: %{id: "4ATEG0R1S1NGNGR0VP1NGSTVFF", verb: "Tag"},
reply: %{id: "71TCREAT1NGA11NKEDRESP0NSE", verb: "Reply"},
}
config :bonfire,
verbs: %{
read: "0EAD1NGSVTTER1YFVNDAMENTA1",
see: "0BSERV1NG11ST1NGSEX1STENCE",
create: "4REATE0RP0STBRANDNEW0BJECT",
edit: "4HANG1NGVA1VES0FPR0PERT1ES",
delete: "4AKESTVFFG0AWAYPERMANENT1Y",
follow: "20SVBSCR1BET0THE0VTPVT0F1T",
like: "11KES1ND1CATEAM11DAPPR0VA1",
boost: "300ST0R0RANN0VCEANACT1V1TY",
flag: "71AGSPAM0RVNACCEPTAB1E1TEM",
mention: "0EFERENC1NGTH1NGSE1SEWHERE",
tag: "4ATEG0R1S1NGNGR0VP1NGSTVFF",
verbs: verbs,
circles: %{
guest: %{id: "0AND0MSTRANGERS0FF1NTERNET", name: "Guests"},
local: %{id: "3SERSFR0MY0VR10CA11NSTANCE", name: "Local Users"},
activity_pub: %{id: "7EDERATEDW1THANACT1V1TYPVB", name: "ActivityPub Peers"},
# stereotypes
followers: %{id: "7DAPE0P1E1PERM1TT0F0110WME", name: "My Followers"},
blocked: %{id: "7N010NGERC0NSENTT0Y0VN0WTY"},
},
default_circles: %{
guest: "0AND0MSTRANGERS0FF1NTERNET",
local: "3SERSFR0MY0VR10CA11NSTANCE",
activity_pub: "7EDERATEDW1THANACT1V1TYPVB",
admin: "2DM1NRESP0NS1B1E0F1NSTANCE"
acls: %{
# read_only: %{id: "AC10N1YACCESS1SREADACCESS1", name: "Read Only"},
# local: %{id: "711M1TEDT010CA1VSERSS01E1Y", name: "Locally Public"},
guests_may_see: %{id: "7W1DE1YAVA11AB1ET0SEENREAD", name: "Publicly visible"},
locals_may_interact: %{id: "710CA1SMY1NTERACTN0TREP1YY", name: "Local users may read, interact"},
locals_may_reply: %{id: "710CA1SMY1NTERACTANDREP1YY", name: "Local users may read, interact and reply"},
### stereotypes - access levels
i_may_see: %{id: "71MAYSEEANDREADMY0WNSTVFFS"},
i_may_interact: %{id: "71MAY1NTERACTW1MY0WNSTVFFS"},
i_may_administer: %{id: "71MAYADM1N1STERMY0WNSTVFFS"},
### stereotypes - always mix in
blocked: %{id: "7AC0MPVTERBESAY1NGN0THANKS"},
},
circle_names: %{
guest: "Public",
local: "Local Users",
activity_pub: "Federate for Remote Users",
admin: "Instance Admins"
grants: %{
guests_may_see: %{guest: [:read, :see]},
locals_may_interact: %{local: [:read, :see, :mention, :tag, :boost, :flag, :like, :follow]},
locals_may_reply: %{local: [:read, :see, :mention, :tag, :boost, :flag, :like, :follow, :reply]},
}
# ladder: replyable > interactable > visible
# circles: guests, locals, followers
# common cases:
# * public and replyable by any member or ap user
# * public and interactable, but only replyable by people on my instance
# * public read only, interactions and replies from people on my instance
# * public read only, interactions and replies from people on my instance and my followers
# * friends only:
alias Bonfire.Me.Users
blocked = Enum.reduce(verbs, %{}, &Map.put(&2, elem(&1, 0), false))
config :bonfire_me, Users,
default_boundaries: %{
circles: %{
followers: %{name: "Followers", stereotype: :followers},
blocked: %{name: "Blocked", stereotype: :blocked},
},
acls: %{
i_may_see: %{stereotype: :i_may_see},
i_may_interact: %{stereotype: :i_may_interact},
i_may_administer: %{stereotype: :i_may_administer},
blocked: %{stereotype: :blocked, name: "Blocked"},
},
grants: %{
i_may_see: %{SELF: [:read, :see]},
i_may_interact: %{SELF: [:read, :see, :create, :mention, :tag, :boost, :flag, :like, :follow]},
i_may_administer: %{SELF: [:read, :see, :edit, :delete]},
blocked: %{blocked: blocked},
},
controlleds: %{
# by default, we may administer ourselves. within contexts, we
# may add more depending on whether the user is local or remote.
SELF: [:guests_may_see, :locals_may_interact, :i_may_administer]
},
# these are acls that we should always mix in. which we don't yet.
always: [:blocked],
}

View file

@ -35,7 +35,7 @@ context_and_queries_extensions = pointable_schema_extensions ++ [
:bonfire_social,
:bonfire_valueflows
]
config :bonfire, :query_modules_search_path, context_and_queries_extensions
config :bonfire, :query_modules_search_path, context_and_queries_extensions
config :bonfire, :context_modules_search_path, context_and_queries_extensions
# Search these apps/extensions for Verbs to index (i.e. they contain modules with a declare_verbs/0 function)
@ -50,15 +50,22 @@ config :bonfire_data_access_control,
#### Alias modules for readability
alias Pointers.{Pointer, Table}
alias Bonfire.Data.AccessControl.{
Access, Acl, Controlled, InstanceAdmin, Grant, Interact, Verb
Acl, Circle, Encircle, Controlled, InstanceAdmin, Grant, Verb,
}
alias Bonfire.Data.ActivityPub.{Actor, Peer, Peered}
alias Bonfire.Boundaries.Stereotype
alias Bonfire.Data.Edges.{Edge,EdgeTotal}
alias Bonfire.Data.Identity.{
Account, Accounted, Caretaker, Character, Credential, Email, Self, User, Named
Account, Accounted, Caretaker, Character, Credential, Email, Named, Self, User,
}
alias Bonfire.Data.Social.{
Activity, Article, Block, Bookmark, Circle, Created, Encircle, Feed, FeedPublish, Inbox, Message, Follow, FollowCount, Boost, BoostCount, Like, LikeCount, Flag, FlagCount, Mention, Post, PostContent, Profile, Replied
Activity, Article, Block, Bookmark, Created, Feed, FeedPublish, Message, Follow,
Boost, Like, Flag, Mention, Post, PostContent, Profile, Replied,
}
alias Bonfire.Classify.Category
alias Bonfire.Geolocate.Geolocation
alias Bonfire.Files.Media
alias Bonfire.{Tag, Tag.Tagged}
#### Flexto Stitching
@ -71,34 +78,62 @@ alias Bonfire.Data.Social.{
## Note: This does not apply to configuration for
## `Pointers.Changesets`, which is read at runtime, not compile time
edge = quote do
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
end
edges = quote do
unquote(edge)
# has_one :edge, unquote(Edge), foreign_key: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id # requires an ON clause
end
# first up, pointers could have all the mixins we're using. TODO
config :pointers, Pointer,
has_one: [controlled: {Controlled, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # needs ON clause
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [character: {Character, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
# add references of tags to any tagged Pointer
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
@follow_ulid "70110WTHE1EADER1EADER1EADE"
# pointables
has_one :circle, unquote(Circle), foreign_key: :id
has_one :user, unquote(User), foreign_key: :id
has_one :post, unquote(Post), foreign_key: :id
has_one :message, unquote(Message), foreign_key: :id
has_one :category, unquote(Category), references: :id, foreign_key: :id
has_one :geolocation, unquote(Geolocation), references: :id, foreign_key: :id
# mixins
has_one :stereotype, unquote(Stereotype), foreign_key: :id
has_one :named, unquote(Named), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :created, unquote(Created), foreign_key: :id
has_one :peered, unquote(Peered), foreign_key: :id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id
has_one :post_content, unquote(PostContent), foreign_key: :id
has_one :replied, unquote(Replied), foreign_key: :id
has_one :profile, unquote(Profile), foreign_key: :id
has_one :character, unquote(Character), foreign_key: :id
has_one :actor, unquote(Actor), foreign_key: :id
has_one :edge, unquote(Edge), foreign_key: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
has_one :follow_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @follow_ulid]
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id
# add references of tags to any tagged Pointer
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [pointer_id: :id, tag_id: :id],
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
}
]
end]
config :pointers, Table, []
@ -106,30 +141,42 @@ config :pointers, Table, []
# bonfire_data_access_control
config :bonfire_data_access_control, Access,
has_one: [named: {Named, foreign_key: :id}],
has_one: [caretaker: {Caretaker, foreign_key: :id}]
config :bonfire_data_access_control, Acl,
has_one: [named: {Named, foreign_key: :id}],
has_one: [caretaker: {Caretaker, foreign_key: :id}]
[code: quote do
# this allows us to identify acls for the user which have special
# meaning to the system, such as "public" or "private"
has_one :stereotype, unquote(Stereotype), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_one :named, unquote(Named), foreign_key: :id
# has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_access_control, Circle,
[code: quote do
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_one :named, unquote(Named), foreign_key: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_access_control, Controlled, []
config :bonfire_data_access_control, Encircle, []
config :bonfire_data_access_control, Grant,
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_circle: {Circle, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_named: {Named, foreign_key: :subject_id, define_field: false}]
[code: quote do
has_one :caretaker, unquote(Caretaker), foreign_key: :id
# has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_access_control, Interact, []
config :bonfire_data_access_control, Verb, []
# bonfire_data_activity_pub
config :bonfire_data_activity_pub, Actor,
belongs_to: [character: {Character, foreign_key: :id, define_field: false}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
[code: quote do
belongs_to :character, unquote(Character), foreign_key: :id, define_field: false
belongs_to :user, unquote(User), foreign_key: :id, define_field: false
has_one :peered, unquote(Peered), foreign_key: :id, references: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
config :bonfire_data_activity_pub, Peer, []
config :bonfire_data_activity_pub, Peered, []
@ -137,262 +184,310 @@ config :bonfire_data_activity_pub, Peered, []
# bonfire_data_identity
config :bonfire_data_identity, Account,
has_one: [credential: {Credential, foreign_key: :id}],
has_one: [email: {Email, foreign_key: :id}],
has_one: [inbox: {Inbox, foreign_key: :id}],
many_to_many: [users: {User, join_through: "bonfire_data_identity_accounted", join_keys: [account_id: :id, id: :id]}],
many_to_many: [shared_users: {User, join_through: "bonfire_data_shared_user_accounts", join_keys: [account_id: :id, shared_user_id: :id]}]
[code: quote do
has_one :credential, unquote(Credential),foreign_key: :id
has_one :email, unquote(Email), foreign_key: :id
many_to_many :users, unquote(User),
join_through: "bonfire_data_identity_accounted",
join_keys: [account_id: :id, id: :id]
many_to_many :shared_users, unquote(User),
join_through: "bonfire_data_shared_user_accounts",
join_keys: [account_id: :id, shared_user_id: :id]
end]
config :bonfire_data_identity, Accounted,
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
[code: quote do
belongs_to :user, unquote(User), foreign_key: :id, define_field: false
end]
config :bonfire_data_identity, Caretaker, []
config :bonfire_data_identity, Character,
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [user: {User, foreign_key: :id}],
has_one: [feed: {Feed, foreign_key: :id}],
has_one: [inbox: {Inbox, foreign_key: :id}],
has_many: [feed_publishes: {FeedPublish, references: :id, foreign_key: :feed_id}],
has_many: [followers: {Follow, foreign_key: :following_id, references: :id}],
has_many: [followed: {Follow, foreign_key: :follower_id, references: :id}],
has_one: [follow_count: {FollowCount, foreign_key: :id}]
[code: quote do
@follow_ulid "70110WTHE1EADER1EADER1EADE"
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_one :actor, unquote(Actor), foreign_key: :id
has_one :profile, unquote(Profile), foreign_key: :id
has_one :user, unquote(User), foreign_key: :id
has_one :feed, unquote(Feed), foreign_key: :id
has_many :followers, unquote(Follow), foreign_key: :following_id, references: :id
has_many :followed, unquote(Follow), foreign_key: :follower_id, references: :id
has_one :follow_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @follow_ulid]
end]
config :bonfire_data_identity, Credential,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
[code: quote do
belongs_to :account, unquote(Account), foreign_key: :id, define_field: false
end]
config :bonfire_data_identity, Email,
must_confirm: true,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
[must_confirm: true,
code: quote do
belongs_to :account, unquote(Account), foreign_key: :id, define_field: false
end]
config :bonfire_data_identity, Self, []
config :bonfire_data_identity, User,
has_one: [accounted: {Accounted, foreign_key: :id}],
# has_many: [account: {[through: [:accounted, :account]]}], # this is private info, do not expose
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [character: {Character, foreign_key: :id}],
has_one: [actor: {Actor, foreign_key: :id}],
has_one: [instance_admin: {InstanceAdmin, foreign_key: :id}],
has_one: [self: {Self, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_many: [encircles: {Encircle, foreign_key: :subject_id}],
has_one: [shared_user: {Bonfire.Data.SharedUser, foreign_key: :id}],
many_to_many: [caretaker_accounts: {Account, join_through: "bonfire_data_shared_user_accounts", join_keys: [shared_user_id: :id, account_id: :id]}],
# has_one: [geolocation: {Bonfire.Geolocate.Geolocation}]
has_many: [created: {Created, foreign_key: :creator_id}],
has_many: [creations: {[through: [:created, :pointer]]}],
has_many: [posts: {[through: [:created, :post]]}],
has_many: [user_activities: {Activity, foreign_key: :subject_id, references: :id}],
has_many: [user_feed: Activity], # requires custom filtering
has_many: [user_notifications: Activity], # requires custom filtering
has_many: [boosted: {Boost, foreign_key: :booster_id, references: :id}],
has_many: [boost_activities: {[through: [:boosted, :activity]]}],
has_many: [liked: {Like, foreign_key: :liker_id, references: :id}],
has_many: [like_activities: {[through: [:liked, :activity]]}],
has_many: [followers: {Follow, foreign_key: :followed_id, references: :id}],
has_many: [followed: {Follow, foreign_key: :follower_id, references: :id}]
[code: quote do
has_one :accounted, unquote(Accounted), foreign_key: :id
has_one :profile, unquote(Profile), foreign_key: :id
has_one :character, unquote(Character), foreign_key: :id
has_one :actor, unquote(Actor), foreign_key: :id
has_one :instance_admin, unquote(InstanceAdmin), foreign_key: :id, on_replace: :update
has_one :self, unquote(Self), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_many :encircles, unquote(Encircle), foreign_key: :subject_id
has_one :shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id
has_many :created, unquote(Created), foreign_key: :creator_id
has_many :creations, through: [:created, :pointer] # todo: stop through
has_many :posts, through: [:created, :post] # todo: stop through
has_many :user_activities, unquote(Activity), foreign_key: :subject_id, references: :id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
many_to_many :caretaker_accounts, unquote(Account),
join_through: "bonfire_data_shared_user_accounts",
join_keys: [shared_user_id: :id, account_id: :id]
# has_many :account, through: [:accounted, :account] # this is private info, do not expose
# has_one :geolocation, Bonfire.Geolocate.Geolocation
end]
# bonfire_data_social
### bonfire_data_social
config :bonfire_data_social, Activity,
belongs_to: [subject_user: {User, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [object_peered: {Peered, foreign_key: :object_id, define_field: false}],
belongs_to: [object_post: {Post, foreign_key: :object_id, define_field: false}],
# belongs_to: [object_post_content: {PostContent, foreign_key: :object_id, define_field: false}],
belongs_to: [object_message: {Message, foreign_key: :object_id, define_field: false}],
has_one: [boost_count: {BoostCount, foreign_key: :id, references: :object_id}],
has_one: [like_count: {LikeCount, foreign_key: :id, references: :object_id}],
has_many: [boosts: {Boost, foreign_key: :boosted_id, references: :object_id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_boost: {Boost, foreign_key: :boosted_id, references: :object_id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :object_id}],
has_one: [replied: {Replied, foreign_key: :id, references: :object_id}],
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id, references: :object_id}],
has_one: [object_created: {Created, foreign_key: :id, references: :object_id}],
# has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
# has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
# has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :object_id}],
has_one: [activity: {Activity, foreign_key: :id, references: :id}], # ugly workaround needed for querying
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
@follow_ulid "70110WTHE1EADER1EADER1EADE"
# has_one :object_created, unquote(Created), foreign_key: :id
# belongs_to :object_peered, unquote(Peered), foreign_key: :id, define_field: false
# belongs_to :object_post, unquote(Post), foreign_key: :id, define_field: false
# belongs_to :object_post_content, unquote(PostContent), foreign_key: :id, define_field: false
# belongs_to :object_message, unquote(Message), foreign_key: :id, define_field: false
has_one :replied, unquote(Replied), foreign_key: :id, references: :object_id
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
# has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
# has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
# has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}],
# ugly workaround needed for querying
has_one :activity, unquote(Activity), foreign_key: :id, references: :id
has_one :like_count, unquote(EdgeTotal), foreign_key: :id, references: :object_id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal), foreign_key: :id, references: :object_id, where: [table_id: @boost_ulid]
has_one :follow_count, unquote(EdgeTotal), foreign_key: :id, references: :object_id, where: [table_id: @follow_ulid]
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :object_id
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :object_id
has_many :feed_publishes, unquote(FeedPublish), references: :id, foreign_key: :activity_id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [pointer_id: :object_id, tag_id: :id],
join_keys: [id: :object_id, tag_id: :id],
on_replace: :delete
}
]
end]
config :bonfire_data_social, Circle,
has_one: [caretaker: {Caretaker, foreign_key: :id}],
has_one: [named: {Named, foreign_key: :id}]
# has_many: [encircles: {Encircle, foreign_key: :circle_id}]
config :bonfire_data_social, Encircle,
belongs_to: [subject_user: {User, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}]
config :bonfire_data_social, Edge,
[code: quote do
unquote(edge)
# TODO: requires composite foreign keys:
# has_one :activity, unquote(Activity),
# foreign_key: [:table_id, :object_id], references: [:table_id, :object_id]
end]
config :bonfire_data_social, Feed,
belongs_to: [character: {Character, foreign_key: :id, define_field: false}],
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
[code: quote do
# belongs_to :character, unquote(Character), foreign_key: :id, define_field: false
# belongs_to :user, unquote(User), foreign_key: :id, define_field: false
end]
config :bonfire_data_social, FeedPublish, []
config :bonfire_data_social, Follow,
belongs_to: [follower_character: {Character, foreign_key: :follower_id, define_field: false}],
belongs_to: [follower_profile: {Profile, foreign_key: :follower_id, define_field: false}],
belongs_to: [followed_character: {Character, foreign_key: :followed_id, define_field: false}],
belongs_to: [followed_profile: {Profile, foreign_key: :followed_id, define_field: false}]
config :bonfire_data_social, FollowCount, []
config :bonfire_data_social, Block, []
config :bonfire_data_social, Follow,
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
# belongs_to: [follower_character: {Character, foreign_key: :follower_id, define_field: false}],
# belongs_to: [follower_profile: {Profile, foreign_key: :follower_id, define_field: false}],
# belongs_to: [followed_character: {Character, foreign_key: :followed_id, define_field: false}],
# belongs_to: [followed_profile: {Profile, foreign_key: :followed_id, define_field: false}]
config :bonfire_data_social, Block,
[code: quote do
unquote(edges)
end]
config :bonfire_data_social, Boost,
has_one: [activity: {Activity, foreign_key: :object_id, references: :boosted_id}] # requires an ON clause
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
# has_one: [activity: {Activity, foreign_key: :object_id, references: :boosted_id}] # requires an ON clause
config :bonfire_data_social, Like,
has_one: [activity: {Activity, foreign_key: :object_id, references: :liked_id}] # requires an ON clause
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
# has_one: [activity: {Activity, foreign_key: :object_id, references: :liked_id}] # requires an ON clause
config :bonfire_data_social, LikeCount, []
config :bonfire_data_social, Bookmark, []
config :bonfire_data_social, Flag,
[code: quote do
has_one :created, unquote(Created), foreign_key: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
unquote(edges)
end]
config :bonfire_data_social, Bookmark,
[code: quote do
unquote(edges)
end]
config :bonfire_data_social, Message,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # requires an ON clause
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
has_one: [controlled: {Controlled, foreign_key: :id}]
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
has_one :post_content, unquote(PostContent), foreign_key: :id
has_one :created, unquote(Created), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id,
references: :id # requires an ON clause
has_one :replied, unquote(Replied), foreign_key: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
end]
config :bonfire_data_social, Mention, []
config :bonfire_data_social, Named, []
config :bonfire_data_social, Post,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
# has_one: [creator_user: {[through: [:created, :creator_user]]}],
# has_one: [creator_character: {[through: [:created, :creator_character]]}],
# has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}], # requires an ON clause
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_boost: {Boost, foreign_key: :boosted_id, references: :id}],
has_one: [my_flag: {Flag, foreign_key: :flagged_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_one: [controlled: {Controlled, foreign_key: :id}]
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
has_one :caretaker, unquote(Caretaker), foreign_key: :id
has_one :post_content, unquote(PostContent), foreign_key: :id
has_one :created, unquote(Created), foreign_key: :id
has_one :peered, unquote(Peered), references: :id, foreign_key: :id
# has_one: [creator_user: {[through: [:created, :creator_user]]}],
# has_one: [creator_character: {[through: [:created, :creator_character]]}],
# has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id # requires an ON clause
has_one :replied, unquote(Replied), foreign_key: :id
# has_one: [reply_to: {[through: [:replied, :reply_to]]}],
# has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
# has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
# has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id
# has_one: [thread_post: {[through: [:replied, :thread_post]]}],
# has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}],
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
has_many :tagged, unquote(Tagged), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
end]
config :bonfire_data_social, PostContent, []
config :bonfire_data_social, PostContent,
[code: quote do
field :hashtags, {:array, :any}, virtual: true # used in changesets
field :mentions, {:array, :any}, virtual: true # used in changesets
end]
config :bonfire_data_social, Replied,
belongs_to: [post: {Post, foreign_key: :id, define_field: false}],
belongs_to: [post_content: {PostContent, foreign_key: :id, define_field: false}],
has_many: [activities: {Activity, foreign_key: :object_id, references: :id}],
has_one: [activity: {Activity, foreign_key: :object_id, references: :id}],
has_one: [reply_to_post: {Post, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_post_content: {PostContent, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_created: {Created, foreign_key: :id, references: :reply_to_id}],
# has_one: [reply_to_creator_user: {[through: [:reply_to_created, :creator_user]]}],
# has_one: [reply_to_creator_character: {[through: [:reply_to_created, :creator_character]]}],
# has_one: [reply_to_creator_profile: {[through: [:reply_to_created, :creator_profile]]}],
# has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id, references: :id}],
has_many: [thread_replies: {Replied, foreign_key: :thread_id, references: :id}],
has_one: [thread_post: {Post, foreign_key: :id, references: :thread_id}],
has_one: [thread_post_content: {PostContent, foreign_key: :id, references: :thread_id}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :id}]
[code: quote do
@like_ulid "11KES11KET0BE11KEDY0VKN0WS"
@boost_ulid "300STANN0VNCERESHARESH0VTS"
belongs_to :post, unquote(Post), foreign_key: :id, define_field: false
belongs_to :post_content,unquote(PostContent), foreign_key: :id, define_field: false
has_many :activities, unquote(Activity), foreign_key: :object_id, references: :id
has_one :activity, unquote(Activity), foreign_key: :object_id, references: :id
field :replying_to, :map, virtual: true # used in changesets
has_one :reply_to_post, unquote(Post), foreign_key: :id, references: :reply_to_id
has_one :reply_to_post_content, unquote(PostContent), foreign_key: :id, references: :reply_to_id
has_one :reply_to_created, unquote(Created), foreign_key: :id, references: :reply_to_id
# has_one :reply_to_creator_user, through: [:reply_to_created, :creator_user]
# has_one :reply_to_creator_character, through: [:reply_to_created, :creator_character]
# has_one :reply_to_creator_profile, through: [:reply_to_created, :creator_profile]
has_many :direct_replies, unquote(Replied), foreign_key: :reply_to_id, references: :id
has_many :thread_replies, unquote(Replied), foreign_key: :thread_id, references: :id
has_one :thread_post, unquote(Post), foreign_key: :id, references: :thread_id
has_one :thread_post_content, unquote(PostContent), foreign_key: :id, references: :thread_id
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
has_one :like_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @like_ulid]
has_one :boost_count, unquote(EdgeTotal),
foreign_key: :id, references: :id, where: [table_id: @boost_ulid]
end]
config :bonfire_data_social, Created,
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
belongs_to: [creator_user: {User, foreign_key: :creator_id, define_field: false}],
belongs_to: [creator_character: {Character, foreign_key: :creator_id, define_field: false}],
belongs_to: [creator_profile: {Profile, foreign_key: :creator_id, define_field: false}],
has_one: [post: {Post, references: :id, foreign_key: :id}]
[code: quote do
belongs_to :creator_user, unquote(User), foreign_key: :creator_id, define_field: false
belongs_to :creator_character, unquote(Character), foreign_key: :creator_id, define_field: false
belongs_to :creator_profile, unquote(Profile), foreign_key: :creator_id, define_field: false
has_one :peered, unquote(Peered), foreign_key: :id, references: :id
has_one :post, unquote(Post), foreign_key: :id, references: :id
end]
config :bonfire_data_social, Profile,
belongs_to: [user: {User, foreign_key: :id, define_field: false}],
has_one: [controlled: {Controlled, foreign_key: :id, references: :id}]
[code: quote do
belongs_to :user, unquote(User), foreign_key: :id, define_field: false
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
######### other extensions
# optional mixin relations for tags that are characters (eg Category) or any other type of objects
config :bonfire_tag, Bonfire.Tag,
# for objects that are follow-able and can federate activities
has_one: [character: {Bonfire.Data.Identity.Character, references: :id, foreign_key: :id}],
has_one: [peered: {Peered, references: :id, foreign_key: :id}],
# has_one: [actor: {Bonfire.Data.ActivityPub.Actor, references: :id, foreign_key: :id}],
has_one: [follow_count: {Bonfire.Data.Social.FollowCount, references: :id, foreign_key: :id}],
# for likeable objects
has_one: [like_count: {Bonfire.Data.Social.LikeCount, references: :id, foreign_key: :id}],
# name/description
has_one: [profile: {Bonfire.Data.Social.Profile, references: :id, foreign_key: :id}],
# for taxonomy categories/topics
has_one: [category: {Bonfire.Classify.Category, references: :id, foreign_key: :id}],
# for locations
has_one: [geolocation: {Bonfire.Geolocate.Geolocation, references: :id, foreign_key: :id}]
# add references of tagged objects to any Category
config :bonfire_classify, Bonfire.Classify.Category,
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
config :bonfire_classify, Category,
[code: quote do
# has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [tag_id: :id, pointer_id: :id],
join_keys: [tag_id: :id, id: :id],
on_replace: :delete
}
]
end]
config :bonfire_files, Media,
[code: quote do
field :url, :string, virtual: true
has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
end]
# add references of tagged objects to any Geolocation
config :bonfire_geolocate, Bonfire.Geolocate.Geolocation,
many_to_many: [
tags: {
Bonfire.Tag,
join_through: "bonfire_tagged",
[code: quote do
# has_many :controlled, unquote(Controlled), foreign_key: :id, references: :id
many_to_many :tags, unquote(Pointer),
join_through: unquote(Tagged),
unique: true,
join_keys: [tag_id: :id, pointer_id: :id],
join_keys: [id: :id, tag_id: :id],
on_replace: :delete
}
]
config :bonfire_files, Bonfire.Files.Media,
field: [
url: {:string, virtual: true}
]
config :bonfire_valueflows, ValueFlows.Planning.Intent,
has_one: [like_count: {LikeCount, foreign_key: :id}]
end]

View file

@ -0,0 +1,12 @@
defmodule Bonfire.Repo.Migrations.HelloWorld do
use Ecto.Migration
def up do
execute "CREATE EXTENSION IF NOT EXISTS \"citext\""
end
def down do
execute "DROP EXTENSION IF EXISTS \"citext\""
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200523081010_hello_world.exs

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200523081012_init_pointers.exs

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Repo.Migrations.InitPointers do
use Ecto.Migration
import Pointers.Migration
def up do
init_pointers_ulid_extra()
init_pointers()
end
def down do
init_pointers_ulid_extra()
init_pointers()
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200523081013_init_pointers_ulid.exs

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Repo.Migrations.InitEdges do
use Ecto.Migration
alias Bonfire.Data.Edges.Migration
def up do
Migration.up()
end
def down do
Migration.down()
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200805090401_create_ap_tables.exs

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.CreateApTables do
use Ecto.Migration
def up do
ActivityPub.Migrations.up()
end
def down do
ActivityPub.Migrations.down()
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200817072952_create_oban_tables.exs

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.CreateObanTables do
use Ecto.Migration
def up do
Oban.Migrations.up()
end
def down do
Oban.Migrations.down(version: 1)
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200818094943_import_ap.exs

View file

@ -0,0 +1,10 @@
defmodule Bonfire.Federate.ActivityPub.Repo.Migrations.ImportMe do
use Ecto.Migration
import Bonfire.Federate.ActivityPub.Migrations
# accounts & users
def up, do: migrate_activity_pub
def down, do: migrate_activity_pub
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200820094941_import_boundaries.exs

View file

@ -0,0 +1,9 @@
defmodule Bonfire.Boundaries.Repo.Migrations.ImportBoundaries do
use Ecto.Migration
import Bonfire.Boundaries.Migrations
def up, do: migrate_boundaries
def down, do: migrate_boundaries
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200828094943_add_files.exs

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Repo.Migrations.AddFiles do
use Ecto.Migration
import Bonfire.Files.Media.Migration
import Pointers.Migration
def up do
Bonfire.Files.Media.Migration.migrate_media()
end
def down do
Bonfire.Files.Media.Migration.migrate_media()
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200828094944_import_me.exs

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Repo.Migrations.ImportMe do
use Ecto.Migration
import Bonfire.Me.Migrations
def up do
# accounts & users
migrate_me()
end
def down, do: migrate_me()
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200828094945_import_social.exs

View file

@ -0,0 +1,14 @@
defmodule Bonfire.Social.Repo.Migrations.ImportSocial do
use Ecto.Migration
import Bonfire.Social.Migrations
import Pointers.Migration
def up do
migrate_social()
end
def down, do: migrate_social()
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20200829004946_boundaries_fixtures.exs

View file

@ -0,0 +1,9 @@
defmodule Bonfire.Boundaries.Repo.Migrations.BoundariesFixtures do
use Ecto.Migration
import Bonfire.Boundaries.Fixtures
def up, do: Bonfire.Boundaries.Fixtures.insert()
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20201205094943_import_quantify.exs

View file

@ -0,0 +1,17 @@
defmodule Bonfire.Repo.Migrations.ImportQuantify do
use Ecto.Migration
def up do
if Code.ensure_loaded?(Bonfire.Quantify.Migrations) do
Bonfire.Quantify.Migrations.change
Bonfire.Quantify.Migrations.change_measure
end
end
def down do
if Code.ensure_loaded?(Bonfire.Quantify.Migrations) do
Bonfire.Quantify.Migrations.change
Bonfire.Quantify.Migrations.change_measure
end
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20201208094940_import_geolocation.exs

View file

@ -0,0 +1,15 @@
defmodule Bonfire.Repo.Migrations.ImportGeolocation do
use Ecto.Migration
def up do
if Code.ensure_loaded?(Bonfire.Geolocate.Migrations) do
Bonfire.Geolocate.Migrations.change
end
end
def down do
if Code.ensure_loaded?(Bonfire.Geolocate.Migrations) do
Bonfire.Geolocate.Migrations.change
end
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20201212094942_import_valueflows.exs

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.ImportValueFlows do
use Ecto.Migration
def up do
if Code.ensure_loaded?(ValueFlows.AllMigrations), do: ValueFlows.AllMigrations.up
end
def down do
if Code.ensure_loaded?(ValueFlows.AllMigrations), do: ValueFlows.AllMigrations.down
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210102094944_import_shared_user.exs

View file

@ -0,0 +1,10 @@
defmodule Bonfire.Repo.Migrations.ImportSharedUser do
use Ecto.Migration
import Bonfire.Data.SharedUser.Migration
# accounts & users
def up, do: migrate_shared_user()
def down, do: migrate_shared_user()
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210113094942_import_valueflows_observe.exs

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Repo.Migrations.ImportValueFlowsObserve do
use Ecto.Migration
alias ValueFlows.Observe.Migrations
def up do
if Code.ensure_loaded?(Migrations), do: Migrations.up
end
def down do
if Code.ensure_loaded?(Migrations), do: Migrations.down
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210302094944_import_boost.exs

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210302094945_import_flag.exs

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210401094942_count_functions.exs

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210402105128_ap_test_table.exs

View file

@ -0,0 +1,15 @@
defmodule ActivityPub.Repo.Migrations.APTestTable do
use Ecto.Migration
def change do
# This table only exists for test purposes
create table("local_actor", primary_key: false) do
add :id, :uuid, primary_key: true
add :username, :citext
add :data, :map
add :local, :boolean
add :keys, :text
add :followers, {:array, :string}
end
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210407094946_message.exs

View file

@ -0,0 +1,9 @@
defmodule Bonfire.Repo.Migrations.Message do
use Ecto.Migration
import Bonfire.Data.Social.Message.Migration
def up, do: migrate_message()
def down, do: migrate_message()
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210410094945_profile_images.exs

View file

@ -0,0 +1,18 @@
defmodule Bonfire.Social.Repo.Migrations.ProfileImages do
use Ecto.Migration
import Pointers.Migration
def up do
drop_if_exists constraint "bonfire_data_social_profile", "bonfire_data_social_profile_icon_id_fkey"
drop_if_exists constraint "bonfire_data_social_profile", "bonfire_data_social_profile_image_id_fkey"
alter table("bonfire_data_social_profile") do
Ecto.Migration.add_if_not_exists :icon_id, strong_pointer(Bonfire.Files.Media)
Ecto.Migration.add_if_not_exists :image_id, strong_pointer(Bonfire.Files.Media)
end
end
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210412094946_fp.exs

View file

@ -0,0 +1,40 @@
defmodule Bonfire.Repo.Migrations.FP do
use Ecto.Migration
def up do
execute("create or replace function
column_exists(ptable text, pcolumn text, pschema text default 'public')
returns boolean
language sql stable strict
as $body$
-- does the requested table.column exist in schema?
select exists
( select null
from information_schema.columns
where table_name=ptable
and column_name=pcolumn
and table_schema=pschema
);
$body$;")
execute("CREATE OR REPLACE FUNCTION rename_column_if_exists(ptable TEXT, pcolumn TEXT, new_name TEXT)
RETURNS VOID AS $BODY$
BEGIN
-- Rename the column if it exists.
IF column_exists(ptable, pcolumn) THEN
EXECUTE FORMAT('ALTER TABLE IF EXISTS %I RENAME COLUMN %I TO %I;',
ptable, pcolumn, new_name);
END IF;
END$BODY$
LANGUAGE plpgsql VOLATILE;")
flush()
execute("SELECT rename_column_if_exists('bonfire_data_social_feed_publish', 'object_id', 'activity_id') ")
end
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210618094945_peered_uri.exs

View file

@ -0,0 +1,13 @@
defmodule Bonfire.Social.Repo.Migrations.PeeredURI do
use Ecto.Migration
import Pointers.Migration
def up do
alter table("bonfire_data_activity_pub_peered") do
Ecto.Migration.add_if_not_exists :canonical_uri, :text, null: true
end
end
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210831134330_update_oban_jobs_table.exs

View file

@ -0,0 +1,7 @@
defmodule Bonfire.Repo.Migrations.UpdateObanJobsTable do
use Ecto.Migration
def up, do: Oban.Migrations.up()
def down, do: nil
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210923093415_import_ap_activity.exs

View file

@ -0,0 +1,7 @@
defmodule Bonfire.Repo.Migrations.ImportApActivity do
use Ecto.Migration
import Bonfire.Data.Social.APActivity.Migration
def up(), do: migrate_apactivity()
def down(), do: migrate_apactivity()
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20210925094942_import_classify.exs

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.ImportClassify do
use Ecto.Migration
def up do
Bonfire.Classify.Migrations.up
end
def down do
Bonfire.Classify.Migrations.down
end
end

View file

@ -1 +0,0 @@
../../../cooperation/repo/migrations/20211001094942_import_assort_ranked.exs

View file

@ -0,0 +1,8 @@
defmodule Bonfire.Repo.Migrations.ImportRanked do
use Ecto.Migration
require Bonfire.Data.Assort.Ranked.Migration
def up, do: Bonfire.Data.Assort.Ranked.Migration.migrate_ranked
def down, do: Bonfire.Data.Assort.Ranked.Migration.migrate_ranked
end

View file

@ -0,0 +1,17 @@
defmodule Bonfire.Repo.Migrations.ImportCommitmentSatisfaction do
use Ecto.Migration
def up do
if Code.ensure_loaded?(ValueFlows.Planning.Commitment.Migrations) do
ValueFlows.Planning.Commitment.Migrations.up()
ValueFlows.Planning.Satisfaction.Migrations.up()
end
end
def down do
if Code.ensure_loaded?(ValueFlows.Planning.Commitment.Migrations) do
ValueFlows.Planning.Satisfaction.Migrations.down()
ValueFlows.Planning.Commitment.Migrations.down()
end
end
end

View file

@ -0,0 +1,11 @@
defmodule Bonfire.Repo.Migrations.ImportInviteLink do
use Ecto.Migration
def up do
Bonfire.Invites.Link.Migration.up
end
def down do
Bonfire.Invites.Link.Migration.down
end
end

View file

@ -201,7 +201,7 @@ defmodule Bonfire.GraphQL.Schema do
%Bonfire.Classify.Category{} -> :category
%Bonfire.Tag{} -> :tag
# %Bonfire.Tag{} -> :tag
%ValueFlows.Planning.Intent{} -> :intent

View file

@ -1,34 +1,46 @@
%{
"absinthe": {:hex, :absinthe, "1.7.0", "36819e7b1fd5046c9c734f27fe7e564aed3bda59f0354c37cd2df88fd32dd014", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0 or ~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "566a5b5519afc9b29c4d367f0c6768162de3ec03e9bf9916f9dc2bcbe7c09643"},
"absinthe_client": {:git, "https://github.com/bonfire-networks/absinthe_client.git", "9a13e690d4512a05b158d6db5553d3bbbd0362f4", []},
"absinthe_error_payload": {:hex, :absinthe_error_payload, "1.1.4", "502ff239148c8deaac028ddb600d6502d5be68d24fece0c93f4c3cf7e74c1a4d", [:make, :mix], [{:absinthe, "~> 1.3", [hex: :absinthe, repo: "hexpm", optional: false]}, {:ecto, "~> 3.1", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "9e262ef2fd4a2c644075e0cdde2573b1f713c0676ab905c8640eaa8a882b2aca"},
"absinthe_phoenix": {:hex, :absinthe_phoenix, "2.0.2", "e607b438db900049b9b3760f8ecd0591017a46122fffed7057bf6989020992b5", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:absinthe_plug, "~> 1.5", [hex: :absinthe_plug, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.5", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}], "hexpm", "d36918925c380dc7d2ed7d039c9a3b4182ec36723f7417a68745ade5aab22f8d"},
"absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"},
"activity_pub": {:git, "https://github.com/bonfire-networks/activity_pub", "135f826c7f121777c3ca507e11bb5f045e2df7d0", [branch: "develop"]},
"activity_pub": {:git, "https://github.com/bonfire-networks/activity_pub", "d256d8521eeaf49feed2365e91900559d4b0b184", [branch: "develop"]},
"argon2_elixir": {:hex, :argon2_elixir, "2.4.1", "edb27bdd326bc738f3e4614eddc2f73507be6fedc9533c6bcc6f15bbac9c85cc", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "0e21f52a373739d00bdfd5fe6da2f04eea623cb4f66899f7526dd9db03903d9f"},
"arrows": {:git, "https://github.com/bonfire-networks/arrows", "b49f7f4b2c175371196a35c70f384b92f8e34b7a", [branch: "main"]},
"bamboo": {:hex, :bamboo, "2.2.0", "f10a406d2b7f5123eb1f02edfa043c259db04b47ab956041f279eaac776ef5ce", [:mix], [{:hackney, ">= 1.15.2", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.4", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "8c3b14ba7d2f40cb4be04128ed1e2aff06d91d9413d38bafb4afccffa3ade4fc"},
"bamboo_smtp": {:hex, :bamboo_smtp, "4.1.0", "ba547be4146ae592f63af05c6c7b7b5195b2b6ca57eeea9d80070b38eacd528b", [:mix], [{:bamboo, "~> 2.2.0", [hex: :bamboo, repo: "hexpm", optional: false]}, {:gen_smtp, "~> 1.1.1", [hex: :gen_smtp, repo: "hexpm", optional: false]}], "hexpm", "cb1a2856ab0507d10df609428314aa5e18231e8b1801a5bc6e42f319eeb50ad9"},
"bonfire_api_graphql": {:git, "https://github.com/bonfire-networks/bonfire_api_graphql", "91242f2ed67a8cf2df882e6f544375f4ff4ef376", [branch: "main"]},
"bonfire_boundaries": {:git, "https://github.com/bonfire-networks/bonfire_boundaries", "2aca1e050d50d3514792ab4bb4ae91c4cf9cec24", [branch: "main"]},
"bonfire_classify": {:git, "https://github.com/bonfire-networks/bonfire_classify", "d3483716a61a1584b9356ba467e4cfeea83c327a", [branch: "main"]},
"bonfire_breadpub": {:git, "https://github.com/bonfire-networks/bonfire_breadpub", "08a9722976143fa67e4bdae28b259a0489517ee9", [branch: "main"]},
"bonfire_classify": {:git, "https://github.com/bonfire-networks/bonfire_classify", "836ca462d51f836e067b317450d3896a717f6735", [branch: "main"]},
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "9fc6a8edc4d3c327c876a6982ad850c899866d1b", [branch: "main"]},
"bonfire_data_access_control": {:git, "https://github.com/bonfire-networks/bonfire_data_access_control", "66909dfb579eaf457204e0b00843800e162449e7", [branch: "main"]},
"bonfire_data_activity_pub": {:git, "https://github.com/bonfire-networks/bonfire_data_activity_pub", "5522116c8e5b1a6264fe87139c0a0345aa715cd9", [branch: "main"]},
"bonfire_data_assort": {:git, "https://github.com/bonfire-networks/bonfire_data_assort", "6557b7edccf93804ce63a0c5b8cc2ca248434a4f", []},
"bonfire_data_edges": {:git, "https://github.com/bonfire-networks/bonfire_data_edges", "48694bb63a609cee2070091b06a743aabd389ece", [branch: "main"]},
"bonfire_data_identity": {:git, "https://github.com/bonfire-networks/bonfire_data_identity", "4e3a4ee20ddcf3f26664436cd682c6779d2a1e63", [branch: "main"]},
"bonfire_data_shared_user": {:git, "https://github.com/bonfire-networks/bonfire_data_shared_user", "507c2e9ce51d0c5fc477df4f80b7eaee7bfff5d4", [branch: "main"]},
"bonfire_data_social": {:git, "https://github.com/bonfire-networks/bonfire_data_social", "8ec926d1fab7c99a2ecd3296e8ccf59759b8ff85", [branch: "main"]},
"bonfire_editor_ck": {:git, "https://github.com/bonfire-networks/bonfire_editor_ck", "b37bf6015024325cf14d777726af6a646d75cc42", []},
"bonfire_epics": {:git, "https://github.com/bonfire-networks/bonfire_epics", "3fe62081b1a96eeaebf47dd30769299e089186f8", [branch: "main"]},
"bonfire_fail": {:git, "https://github.com/bonfire-networks/bonfire_fail", "e6f63f5b825d65d4163ce1186743736d7be96c1f", [branch: "main"]},
"bonfire_federate_activitypub": {:git, "https://github.com/bonfire-networks/bonfire_federate_activitypub", "9e9e04512af7aad31c36893ef7489527e39f1694", [branch: "main"]},
"bonfire_files": {:git, "https://github.com/bonfire-networks/bonfire_files", "53ec5108ab0f3f09c86c300687b928b21a9a34ef", [branch: "main"]},
"bonfire_geolocate": {:git, "https://github.com/bonfire-networks/bonfire_geolocate", "0d6ab21e748b7430338d8655709eb585d7ce5838", [branch: "main"]},
"bonfire_invite_links": {:git, "https://github.com/bonfire-networks/bonfire_invite_links", "2db5f918b9f45c3d85a34ec561d367aee9276022", [branch: "main"]},
"bonfire_mailer": {:git, "https://github.com/bonfire-networks/bonfire_mailer", "837fca091119f6af3e1be1af51064dd5a5c4c114", [branch: "main"]},
"bonfire_me": {:git, "https://github.com/bonfire-networks/bonfire_me", "ac699b114971bc2f693a69f3ca680a85f1c08b3f", [branch: "main"]},
"bonfire_quantify": {:git, "https://github.com/bonfire-networks/bonfire_quantify", "3eb47582f63f40e7a1552b43b991aadfec493848", [branch: "main"]},
"bonfire_search": {:git, "https://github.com/bonfire-networks/bonfire_search", "a7c72596af8ca73b97e7f493d48d8a6f82022c74", [branch: "main"]},
"bonfire_social": {:git, "https://github.com/bonfire-networks/bonfire_social", "34a08ff345bcec5c56c11da00f1c352b70055825", [branch: "main"]},
"bonfire_tag": {:git, "https://github.com/bonfire-networks/bonfire_tag", "fb637df8294654cffbf6e2c60bc8daa06efb51dd", [branch: "main"]},
"bonfire_tag": {:git, "https://github.com/bonfire-networks/bonfire_tag", "ba778062ef050be76344433a77fc51a037ac3a8f", [branch: "main"]},
"bonfire_ui_coordination": {:git, "https://github.com/bonfire-networks/bonfire_ui_coordination", "5115293609aca91844f6d912a9761b5405e50c68", [branch: "main"]},
"bonfire_ui_kanban": {:git, "https://github.com/bonfire-networks/bonfire_ui_kanban", "682c1bc420940a4f10526ee75be22fff9378e15b", [branch: "main"]},
"bonfire_ui_reflow": {:git, "https://github.com/bonfire-networks/bonfire_ui_reflow", "c1b04857478faed5f4ffd5d24dd05e3caf90fd69", [branch: "main"]},
"bonfire_ui_social": {:git, "https://github.com/bonfire-networks/bonfire_ui_social", "87beae5968411728de9b6a471cd942f3945001ba", [branch: "main"]},
"bonfire_ui_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_ui_valueflows", "9121d3af45f0c1bb391621310bc742aa9be696ea", [branch: "main"]},
"bonfire_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_valueflows", "0843fa9aa1ae0bc59f0d39f1e715de92ce257cb4", [branch: "main"]},
"bonfire_valueflows_observe": {:git, "https://github.com/bonfire-networks/bonfire_valueflows_observe", "88f0a9d51f9347047bdee0f5f1dd72ed69ed4c78", []},
"bonfire_website": {:git, "https://github.com/bonfire-networks/bonfire_website", "a3f18ae9e2310b53322263e39482b7a86fd788c7", [branch: "main"]},
"cachex": {:hex, :cachex, "3.4.0", "868b2959ea4aeb328c6b60ff66c8d5123c083466ad3c33d3d8b5f142e13101fb", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "370123b1ab4fba4d2965fb18f87fd758325709787c8c5fce35b3fe80645ccbe5"},
"certifi": {:hex, :certifi, "2.8.0", "d4fb0a6bb20b7c9c3643e22507e42f356ac090a1dcea9ab99e27e0376d695eba", [:rebar3], [], "hexpm", "6ac7efc1c6f8600b08d625292d4bbf584e14847ce1b6b5c44d983d273e1097ea"},
@ -46,6 +58,7 @@
"earmark_parser": {:hex, :earmark_parser, "1.4.18", "e1b2be73eb08a49fb032a0208bf647380682374a725dfb5b9e510def8397f6f2", [:mix], [], "hexpm", "114a0e85ec3cf9e04b811009e73c206394ffecfcc313e0b346de0d557774ee97"},
"ecto": {:hex, :ecto, "3.7.1", "a20598862351b29f80f285b21ec5297da1181c0442687f9b8329f0445d228892", [:mix], [{:decimal, "~> 1.6 or ~> 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", "d36e5b39fc479e654cffd4dbe1865d9716e4a9b6311faff799b6f90ab81b8638"},
"ecto_materialized_path": {:git, "https://github.com/bonfire-networks/ecto_materialized_path", "f9ea55f14296dac75c32976529563e43e3b8e25c", []},
"ecto_ranked": {:hex, :ecto_ranked, "0.5.0", "0e428901fe4586f6561b039b90b44940383e90da534b1842a728b56b076fdd68", [:mix], [{:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}], "hexpm", "7f9e119539aca2cf6d98916409e592c884f89069014b7731db1f42483da7e192"},
"ecto_shorts": {:git, "https://github.com/bonfire-networks/ecto_shorts", "a1c9b817491355a1909df3c60e13308dad9ad320", [branch: "fix/sparkles-namespace"]},
"ecto_sparkles": {:git, "https://github.com/bonfire-networks/ecto_sparkles", "c3357e9831c5a5ee04379811e8c261a09539a881", [branch: "main"]},
"ecto_sql": {:hex, :ecto_sql, "3.7.2", "55c60aa3a06168912abf145c6df38b0295c34118c3624cf7a6977cd6ce043081", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.7.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.4.0 or ~> 0.5.0 or ~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c218ea62f305dcaef0b915fb56583195e7b91c91dcfb006ba1f669bfacbff2a"},
@ -67,6 +80,8 @@
"gen_smtp": {:hex, :gen_smtp, "1.1.1", "bf9303c31735100631b1d708d629e4c65944319d1143b5c9952054f4a1311d85", [:rebar3], [{:hut, "1.3.0", [hex: :hut, repo: "hexpm", optional: false]}, {:ranch, ">= 1.7.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "51bc50cc017efd4a4248cbc39ea30fb60efa7d4a49688986fafad84434ff9ab7"},
"geo": {:hex, :geo, "3.4.3", "0ddf3f681993d32c397e5ef346e7b4b6f36f39ed138502429832fa4000ebb9d5", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "e23f2892e5437ec8b063cee1beccec89c58fd841ae11133304700235feb25552"},
"geo_postgis": {:hex, :geo_postgis, "3.4.1", "bec349f98a54f7ab7e24ca95f04b99aed9f779eb6adf548416ec9aa10277f732", [:mix], [{:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0 or ~> 4.0", [hex: :poison, repo: "hexpm", optional: true]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: false]}], "hexpm", "451a20120cb2294d4bd09fdcaa444b610c22950c55d77891dffe2db268040a73"},
"geocoder": {:hex, :geocoder, "1.1.4", "a550247d4a489019607719b2c25e1b58a9d5cff8279535e65fb12bc86266b12a", [:mix], [{:geohash, "~> 1.2", [hex: :geohash, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.5", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:towel, "~> 0.2", [hex: :towel, repo: "hexpm", optional: false]}], "hexpm", "a7b6036b66a8ba906b3e19dea46ac280f18ef45aede31561fc0ba66917684de8"},
"geohash": {:hex, :geohash, "1.2.2", "4e95a65594afde96ba8c003d43947eb06e97b1a4ad25a21f863922918e3819e8", [:mix], [], "hexpm", "98ed91f7e4682f71a21cb9eeec7ca70e2f578f600c1c9335cc6c55b1b9a30ee2"},
"gettext": {:hex, :gettext, "0.19.0", "6909d61b38bb33339558f128f8af5913d5d5fe304a770217bf352b1620fb7ec4", [:mix], [], "hexpm", "3f7a274f52ebda9bb6655dfeda3d6b0dc4537ae51ce41dcccc7f73ca7379ad5e"},
"git_diff": {:hex, :git_diff, "0.6.3", "26fe7799c923fd4ef082efaa4b6725b47a556aa98fddc7b5017509fb4132f963", [:mix], [], "hexpm", "c5d47a956828a916b140d6d6a7f6e26e49d5f243cb5d942452a6a0e73ce2c5c4"},
"grumble": {:hex, :grumble, "0.1.3", "292603ec5f8ff3f1b364800dd8a060fa30b796bd2cdc9a230ce6a69c00c3226b", [:mix], [{:recase, "~> 0.5", [hex: :recase, repo: "hexpm", optional: false]}], "hexpm", "a7a089e5a145e072d0227012002970e85eeb52031f0d01be14c129f649283d0c"},
@ -106,6 +121,7 @@
"pane": {:hex, :pane, "0.4.1", "ca4275b5799066d52c857e7b0deb2feaba409d607419fe54cde056329d247a89", [:mix], [], "hexpm", "27a292ca86f52d4777422930c17fd4a12eaa930d86a6193665c452f94a04ff8a"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"pbkdf2_elixir": {:hex, :pbkdf2_elixir, "1.4.2", "776bed93d0b459713c287b4a90baa7bd92b2c70ddf50d98ded5c3edd335e9131", [:mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}], "hexpm", "5c8201d8ae29652050119e3f98956dcbfe9ef0084f86985737d0d74d868f17d9"},
"phil_columns": {:hex, :phil_columns, "3.1.0", "6f517729418019d58f57b405906f9afd9d2d790922d74cb990a81eb50d986a07", [:mix], [{:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:inflex, "~> 2.0", [hex: :inflex, repo: "hexpm", optional: false]}], "hexpm", "0aa35fa366c4815474f9dd5d2d8edbf71beef0d19f0392bd40184f9edf040768"},
"phoenix": {:hex, :phoenix, "1.6.6", "281c8ce8dccc9f60607346b72cdfc597c3dde134dd9df28dff08282f0b751754", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "807bd646e64cd9dc83db016199715faba72758e6db1de0707eef0a2da4924364"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
"phoenix_gon": {:git, "https://github.com/bonfire-networks/phoenix_gon", "2b8b3d330ac653751d175286eee6f02cb206f2e4", []},
@ -120,6 +136,7 @@
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
"pointers": {:git, "https://github.com/bonfire-networks/pointers", "e1caf09ac335fd4cc1db463d470b662c5c4f9335", [branch: "main"]},
"pointers_ulid": {:git, "https://github.com/bonfire-networks/pointers_ulid", "531e908711fd8b5e0ab9e2ff61f88710ade998f4", [branch: "main"]},
"poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"},
"postgrex": {:hex, :postgrex, "0.16.1", "f94628a32c571266f53cd1e5fca705e626e2417bf1eee6f868985d14e874160a", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "6b225df32c857b9430619dbe30200a7ae664e23415a771ae9209396ee8eeee64"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"recase": {:hex, :recase, "0.7.0", "3f2f719f0886c7a3b7fe469058ec539cb7bbe0023604ae3bce920e186305e5ae", [:mix], [], "hexpm", "36f5756a9f552f4a94b54a695870e32f4e72d5fad9c25e61bc4a3151c08a4e0c"},
@ -130,6 +147,7 @@
"sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"},
"sourceror": {:hex, :sourceror, "0.9.0", "77e8f883be9455812d15913582d2985048ef65d7d931072c548e025a6ea58d5a", [:mix], [], "hexpm", "f56fb5b935df7784504f7d1ba074e0aa83299e2ebd64f75268ffcae62a28f331"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
"surface": {:hex, :surface, "0.7.0", "49473f108713585a335e1f9fc1eecad240f55fcdda365cc6e9f03f8dc605f803", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.17.4", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.9", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "31b6d74abff6dec748a66708b6579d92c7f051eefdeba2eff0c27937090ce93c"},
"surface_heroicons": {:git, "https://github.com/rocketinsights/surface_heroicons", "4bdbe53e9ec933d257d033c267ae1f625ceacd9d", []},
"telemetry": {:hex, :telemetry, "1.0.0", "0f453a102cdf13d506b7c0ab158324c337c41f1cc7548f0bc0e130bbf0ae9452", [:rebar3], [], "hexpm", "73bc09fa59b4a0284efb4624335583c528e07ec9ae76aca96ea0673850aec57a"},
@ -137,6 +155,7 @@
"telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"},
"tesla": {:hex, :tesla, "1.4.4", "bb89aa0c9745190930366f6a2ac612cdf2d0e4d7fff449861baa7875afd797b2", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:finch, "~> 0.3", [hex: :finch, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "d5503a49f9dec1b287567ea8712d085947e247cb11b06bc54adb05bfde466457"},
"timex": {:hex, :timex, "3.7.6", "502d2347ec550e77fdf419bc12d15bdccd31266bb7d925b30bf478268098282f", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "a296327f79cb1ec795b896698c56e662ed7210cc9eb31f0ab365eb3a62e2c589"},
"towel": {:hex, :towel, "0.2.1", "665485fc8acda2565fd7f79e47008cbc60708bcb573a975575190275fa6db393", [:mix], [], "hexpm", "e7b7c5e7e6d8df9e781e130d1defccc9a27f888f7b95c132d8ccd1d6957d3b7a"},
"twinkle_star": {:git, "https://github.com/bonfire-networks/twinkle_star", "925c0a5a2442c08cf578927a971b53c9f7c46827", []},
"typed_struct": {:hex, :typed_struct, "0.2.1", "e1993414c371f09ff25231393b6430bd89d780e2a499ae3b2d2b00852f593d97", [:mix], [], "hexpm", "8f5218c35ec38262f627b2c522542f1eae41f625f92649c0af701a6fab2e11b3"},
"tzdata": {:hex, :tzdata, "1.1.1", "20c8043476dfda8504952d00adac41c6eda23912278add38edc140ae0c5bcc46", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a69cec8352eafcd2e198dea28a34113b60fdc6cb57eb5ad65c10292a6ba89787"},