Liking cljdoc? Tell your friends :D

lambdaconnect-model.core


clojure-to-jsonclj

(clojure-to-json obj entity)
(clojure-to-json obj
                 entity
                 inverse-parser-for-attribute
                 inverse-parser-for-relationship)
source

datomic-inverse-nameclj

(datomic-inverse-name rel)
source

datomic-nameclj

(datomic-name o)
source

datomic-schemaclj

(datomic-schema entities-by-name)

Automatically generates schema for the Core Data xml model file the path was provided to.

Automatically generates schema for the Core Data xml model file 
the path was provided to.
sourceraw docstring

datomic-spec-for-nameclj

(datomic-spec-for-name n)
source

entities-by-nameclj

(entities-by-name model-path)

Generates a dictionary keyed with entity names and valued in entity representations for a given core data model file. These include names, attributes and relationships. See core-data-xml module for details on the data model used.

Generates a dictionary keyed with entity names and valued in entity representations for a given core data model file. 
These include names, attributes and relationships. See core-data-xml module for details on the data model used.
sourceraw docstring

get-minimum-scoping-setsclj

(get-minimum-scoping-sets validated-scoping)

Given a validated scoping returns map of sets which has tags as key and each set keeps tags required for scoping that tag

Given a validated scoping
returns map of sets which has tags as key and each set keeps
tags required for scoping that tag
sourceraw docstring

get-scoping-queriesclj

(get-scoping-queries entities-by-name scoping-defintion push?)
(get-scoping-queries entities-by-name scoping-defintion push? 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

json-to-clojureclj

(json-to-clojure json entity)
(json-to-clojure json entity parser-for-attribute parser-for-relationship)

Converts json-based map into the one that conforms to the spec.

Converts json-based map into the one that conforms to the spec. 
sourceraw docstring

read-pull-scoping-ednclj

(read-pull-scoping-edn path entities-by-name)

Read and validate scoping edn.

Read and validate scoping edn.
sourceraw docstring

reduce-entitiesclj

(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

replace-inversesclj

(replace-inverses obj entity)
(replace-inverses obj entity untangle-singles)
source

reverse-scoping-queryclj

(reverse-scoping-query scoping-rule)

Input: Single scoping query (one value of map returned by get-scoping-queries) This query efficiently answers question "As a user, which entities can I access?". Example input: [:find ?RAEmployee-ofOwner :in $ [?user ...] :where [?user :app/uuid ?G__33024] [?RAOwner-me :RAOwner/internalUserId ?G__33024] [?RAEmployee-ofOwner :RAEmployee/owner ?RAOwner-me]] Output: Single scoping query. This query efficiently answers question "Which users can access this entity?". Example output: [:find ?user :in $ [?RAEmployee-ofOwner ...] :where [?RAEmployee-ofOwner :RAEmployee/owner ?RAOwner-me] [?RAOwner-me :RAOwner/internalUserId ?G__33024] [?user :app/uuid ?G__33024]]

Input:
Single scoping query (one value of map returned by get-scoping-queries)
This query efficiently answers question "As a user, which entities can I access?".
Example input:
[:find ?RAEmployee-ofOwner
 :in $ [?user ...]
 :where
 [?user :app/uuid ?G__33024]
 [?RAOwner-me :RAOwner/internalUserId ?G__33024]
 [?RAEmployee-ofOwner :RAEmployee/owner ?RAOwner-me]]
Output:
Single scoping query.
This query efficiently answers question "Which users can access this entity?".
Example output:
[:find ?user
 :in $ [?RAEmployee-ofOwner ...]
 :where
 [?RAEmployee-ofOwner :RAEmployee/owner ?RAOwner-me]
 [?RAOwner-me :RAOwner/internalUserId ?G__33024]
 [?user :app/uuid ?G__33024]]
sourceraw docstring

scopeclj

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

Takes a 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 #{:NOUuser.me :NOLanguage.mine})

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

Takes a 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 #{:NOUuser.me :NOLanguage.mine})

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

scope-selected-tags-with-treeclj

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

Takes: a config map, 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 config map,
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

spec-for-nameclj

(spec-for-name n)
source

special-attribsclj

source

specsclj

(specs entities-by-name)
(specs entities-by-name generators)

Define the specs for all the entities. The specs relate to the entities by their unqualified namespaced names, e.g. ':lambdaconnect-model.spec.json/FIUser' for the user in jsons and ':lambdaconnect-model.spec.datomic/FIUser' for the user saved to database

The generators table lists custom generators and is optional. For example: {:FIUser/gender #(s/gen #{"U", "M", "F"})}

Define the specs for all the entities. The specs relate to the entities by their unqualified namespaced names, e.g. 
':lambdaconnect-model.spec.json/FIUser' for the user in jsons and
':lambdaconnect-model.spec.datomic/FIUser' for the user saved to database

The generators table lists custom generators and is optional. For example:
{:FIUser/gender #(s/gen #{"U", "M", "F"})}
sourceraw docstring

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

× close