Liking cljdoc? Tell your friends :D

boundary.tenant.ports


ITenantInviteAcceptanceServicecljprotocol

accept-external-invite!clj

(accept-external-invite! this request)

Atomically accept a pending external invite.

Request shape: {:token raw-token :accepted-by-user-id uuid :tx-context optional-db-tx :hooks {:after-accept-tx (fn [{:keys [invite membership tx-context]}] ...)}}

Returns: {:invite updated-invite :membership created-membership :effects {:after-accept-tx hook-result}}

Atomically accept a pending external invite.

Request shape:
  {:token raw-token
   :accepted-by-user-id uuid
   :tx-context optional-db-tx
   :hooks {:after-accept-tx (fn [{:keys [invite membership tx-context]}] ...)}}

Returns:
  {:invite updated-invite
   :membership created-membership
   :effects {:after-accept-tx hook-result}}

load-external-invite-for-acceptanceclj

(load-external-invite-for-acceptance this request)

Resolve a pending invite for an acceptance flow.

Request shape: {:token raw-token :tx-context optional-db-tx}

Returns: Pending invite entity

Throws:

  • :not-found when no pending invite exists for the token
  • :validation-error when the invite has expired
Resolve a pending invite for an acceptance flow.

Request shape:
  {:token raw-token
   :tx-context optional-db-tx}

Returns:
  Pending invite entity

Throws:
  - :not-found when no pending invite exists for the token
  - :validation-error when the invite has expired
source

ITenantInviteRepositorycljprotocol

create-inviteclj

(create-invite this invite-entity)

find-invite-by-idclj

(find-invite-by-id this invite-id)

find-invites-by-tenantclj

(find-invites-by-tenant this tenant-id options)

find-pending-invite-by-email-and-tenantclj

(find-pending-invite-by-email-and-tenant this tenant-id email)

find-pending-invite-by-token-hashclj

(find-pending-invite-by-token-hash this token-hash)

update-inviteclj

(update-invite this invite-entity)
source

ITenantInviteServicecljprotocol

accept-external-inviteclj

(accept-external-invite this token accepted-by-user-id)

get-external-inviteclj

(get-external-invite this invite-id)

get-external-invite-by-tokenclj

(get-external-invite-by-token this token)

invite-external-memberclj

(invite-external-member this tenant-id email role options)

list-tenant-invitesclj

(list-tenant-invites this tenant-id options)

revoke-external-inviteclj

(revoke-external-invite this invite-id)
source

ITenantMembershipRepositorycljprotocol

create-membershipclj

(create-membership this membership-entity)

find-membership-by-idclj

(find-membership-by-id this membership-id)

find-membership-by-user-and-tenantclj

(find-membership-by-user-and-tenant this user-id tenant-id)

find-memberships-by-tenantclj

(find-memberships-by-tenant this tenant-id options)

find-memberships-by-userclj

(find-memberships-by-user this user-id)

membership-exists?clj

(membership-exists? this user-id tenant-id)

update-membershipclj

(update-membership this membership-entity)
source

ITenantMembershipServicecljprotocol

accept-invitationclj

(accept-invitation this membership-id)

bootstrap-first-memberclj

(bootstrap-first-member this tenant-id user-id role)

update-member-roleclj

(update-member-role this membership-id role)

list-tenant-membersclj

(list-tenant-members this tenant-id options)

bootstrap-open?clj

(bootstrap-open? this tenant-id)

get-membershipclj

(get-membership this membership-id)

invite-userclj

(invite-user this tenant-id user-id role)

get-active-membershipclj

(get-active-membership this user-id tenant-id)

suspend-memberclj

(suspend-member this membership-id)

revoke-memberclj

(revoke-member this membership-id)
source

ITenantRepositorycljprotocol

create-tenant-schemaclj

(create-tenant-schema this schema-name)

find-all-tenantsclj

(find-all-tenants this options)

find-tenant-by-idclj

(find-tenant-by-id this tenant-id)

drop-tenant-schemaclj

(drop-tenant-schema this schema-name)

create-tenantclj

(create-tenant this tenant-entity)

tenant-slug-exists?clj

(tenant-slug-exists? this slug)

update-tenantclj

(update-tenant this tenant-entity)

delete-tenantclj

(delete-tenant this tenant-id)

find-tenant-by-slugclj

(find-tenant-by-slug this slug)
source

ITenantSchemaProvidercljprotocol

Protocol for executing code within a tenant's database schema context.

This protocol abstracts tenant schema switching operations, allowing different implementations for different database types (PostgreSQL vs others).

Protocol for executing code within a tenant's database schema context.

This protocol abstracts tenant schema switching operations, allowing
different implementations for different database types (PostgreSQL vs others).

list-tenant-schemasclj

(list-tenant-schemas this db-ctx)

List all tenant_* schemas in the database. Returns a vector of schema name strings. Returns empty vector for non-PostgreSQL databases.

List all tenant_* schemas in the database.
Returns a vector of schema name strings.
Returns empty vector for non-PostgreSQL databases.

tenant-provisioned?clj

(tenant-provisioned? this db-ctx tenant-entity)

Check if a tenant's database schema has been provisioned. Returns true if the schema exists in PostgreSQL, false otherwise. Returns false for non-PostgreSQL databases.

Check if a tenant's database schema has been provisioned.
Returns true if the schema exists in PostgreSQL, false otherwise.
Returns false for non-PostgreSQL databases.

with-tenant-schemaclj

(with-tenant-schema this db-ctx schema-name f)

Execute function f within the specified tenant schema context.

For PostgreSQL: Sets search_path to tenant schema for the duration of f For other databases: May use row-level filtering or other mechanisms

Args: db-ctx: Database context map with :datasource schema-name: Tenant schema name (e.g., 'tenant_acme_corp') f: Function to execute, receives transaction context as argument

Returns: Result of executing f

Throws: ex-info with :type :unsupported-database if database doesn't support schemas ex-info with :type :schema-not-found if schema doesn't exist

Execute function f within the specified tenant schema context.

For PostgreSQL: Sets search_path to tenant schema for the duration of f
For other databases: May use row-level filtering or other mechanisms

Args:
  db-ctx: Database context map with :datasource
  schema-name: Tenant schema name (e.g., 'tenant_acme_corp')
  f: Function to execute, receives transaction context as argument

Returns:
  Result of executing f

Throws:
  ex-info with :type :unsupported-database if database doesn't support schemas
  ex-info with :type :schema-not-found if schema doesn't exist
sourceraw docstring

ITenantServicecljprotocol

activate-tenantclj

(activate-tenant this tenant-id)

create-new-tenantclj

(create-new-tenant this tenant-input)

delete-existing-tenantclj

(delete-existing-tenant this tenant-id)

get-tenantclj

(get-tenant this tenant-id)

get-tenant-by-slugclj

(get-tenant-by-slug this slug)

list-tenantsclj

(list-tenants this options)

suspend-tenantclj

(suspend-tenant this tenant-id)

update-existing-tenantclj

(update-existing-tenant this tenant-id update-data)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close