Liking cljdoc? Tell your friends :D

lambdaconnect-model.scoping


add-include-in-push-permissionclj/s

(add-include-in-push-permission edn)
source

execute-queryclj/s

(execute-query config tag query)
source

execute-query-genericclj/s

(execute-query-generic config tag query)
source

execute-query-splitclj/s

(execute-query-split config tag query)
source

get-scoping-queriesclj/s

(get-scoping-queries entities-by-name scoping-definition push?)
(get-scoping-queries entities-by-name
                     scoping-definition
                     push?
                     {:keys [tags necessary-tags]})

Takes: entities-by-name, parsed (and validated) EDN of scoping rules, push? config map, with optional keys:

  • tags, a set of tags which queries are requested (if not provided all tags are taken by default)
  • necessary-tags, a set of tags which are required for scoping selected tags, calculated with tree obtained from scope_dependeny/get-minimum-scoping-sets if not provided queries for all tags will be calculated and result will be filtered according to tags param

A typical invocation looks like this: (get-scoping-queries entities-by-name validated-scope push?))) (get-scoping-queries entities-by-name validated-scope push? {:tags #{:RAEmployee.ofOwner} :necessary-tags #{:RAEmployee.ofOwner :RAOwner.me}}}))) Returns a map with tags and queries generated to obtain entities for indicated user: {:RAEmployee.ofOwner [:find ?RAEmployee-ofOwner :in $ [?user ...] :where [?user :app/uuid ?G__33023] [(= ?G__33024 ?G__33023)] [?RAOwner-me :RAOwner/internalUserId ?G__33024] [?RAEmployee-ofOwner :RAEmployee/owner ?RAOwner-me]]} ...

Takes:
 entities-by-name,
 parsed (and validated) EDN of scoping rules,
 push?
 config map, with optional keys:
  - tags, a set of tags which queries are requested (if not provided all tags are taken by default)
  - necessary-tags, a set of tags which are required for scoping selected tags, calculated with tree obtained from scope_dependeny/get-minimum-scoping-sets
    if not provided queries for all tags will be calculated and result will be filtered according to tags param

 A typical invocation looks like this:
 (get-scoping-queries entities-by-name validated-scope push?)))
 (get-scoping-queries entities-by-name validated-scope push? {:tags #{:RAEmployee.ofOwner} :necessary-tags #{:RAEmployee.ofOwner :RAOwner.me}}})))
 Returns a map with tags and queries generated to obtain entities for indicated user:
{:RAEmployee.ofOwner
[:find
?RAEmployee-ofOwner
:in
$
[?user ...]
:where
[?user :app/uuid ?G__33023]
[(= ?G__33024 ?G__33023)]
[?RAOwner-me :RAOwner/internalUserId ?G__33024]
[?RAEmployee-ofOwner :RAEmployee/owner ?RAOwner-me]]}
 ...
sourceraw docstring

inverse-entitiesclj/s

(inverse-entities map-to-inverse)
source

none-rulesclj/s

(none-rules user-symbol entity-symbol)
source

read-pull-scoping-ednclj/s≠

clj
(read-pull-scoping-edn path entities-by-name)
cljs
(read-pull-scoping-edn scope-str entities-by-name)
source (clj)source (cljs)

reduce-entitiesclj/s

(reduce-entities scoped-entities)

Takes what 'scope' produces and aggregates all the entity types (so :NOUser.me and :NOUser.peer become :NOUser with unified ids)

Takes what 'scope' produces and aggregates all the entity types (so :NOUser.me and :NOUser.peer become :NOUser with unified ids)
sourceraw docstring

reorder-rulesclj/s

(reorder-rules remaining-rules final-tags)
(reorder-rules remaining-rules result next-matches final-tags)
source

s-dependenciesclj/s

(s-dependencies rule)
source

s-matches?clj/s

(s-matches? match-tag rule)
source

scopeclj/s

(scope config snapshot user entities-by-name scoping-definition push?)
(scope config snapshot user entities-by-name scoping-definition push? tags)

Takes config map, a snapshot, a user object from DB, entities-by-name and the parsed EDN of rules, push? and optional set of tags to scope. If set of tags to scope is not provided all tags are scoped. A typical invocation looks like this: (scope config (d/db db/conn) user entities-by-name (clojure.edn/read-string (slurp "resources/model/pull-scope.edn")) false) (scope config (d/db db/conn) user entities-by-name (clojure.edn/read-string (slurp "resources/model/pull-scope.edn")) false #{:NOUser.me :NOLanguage.mine})

Returns a map with db ids, something like: {:NOUser.me #{11122, 1222} :user #{2312312}}

Takes config map, a snapshot, a user object from DB, entities-by-name and the parsed EDN of rules, push? and optional set of tags to scope.
 If set of tags to scope is not provided all tags are scoped.
 A typical invocation looks like this:
(scope config (d/db db/conn) user entities-by-name (clojure.edn/read-string (slurp "resources/model/pull-scope.edn")) false)
(scope config (d/db db/conn) user entities-by-name (clojure.edn/read-string (slurp "resources/model/pull-scope.edn")) false #{:NOUser.me :NOLanguage.mine})

Returns a map with db ids, something like:
{:NOUser.me #{11122, 1222} :user #{2312312}}
sourceraw docstring

scope-selected-tags-with-treeclj/s

(scope-selected-tags-with-tree config
                               snapshot
                               user
                               entities-by-name
                               scoping-definition
                               scoping-sets
                               tags)

Takes: a snapshot, a user object from DB, entities-by-name, parsed (and validated) EDN of scoping rules, scoping-sets, a map of sets indiacting which tags must be scoped per tag calculated with scope_dependency/get-minimum-scoping-sets tags, set of desired tags.

It is advised to calculacte scoping sets once and pass the result. A typical invocation looks like this: (scope-selected-tags-with-tree config (d/db db/conn) user entities-by-name validated-scope scoping-sets #{:RARestaurant.ofOwner})))

Returns a map with db ids, something like: {:RAOwner.me #{11122, 1222} :user #{2312312}}

Takes:
a snapshot,
a user object from DB,
entities-by-name,
parsed (and validated) EDN of scoping rules,
scoping-sets, a map of sets indiacting which tags must be scoped per tag calculated with scope_dependency/get-minimum-scoping-sets
tags, set of desired tags.

It is advised to calculacte scoping sets once and pass the result.
A typical invocation looks like this:
(scope-selected-tags-with-tree config (d/db db/conn) user entities-by-name validated-scope scoping-sets #{:RARestaurant.ofOwner})))

Returns a map with db ids, something like:
{:RAOwner.me #{11122, 1222} :user #{2312312}}
sourceraw docstring

validate-pull-scopeclj/s

(validate-pull-scope entities-by-name edn)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close