Liking cljdoc? Tell your friends :D

atomist.api


actionable-messagecljs

(actionable-message o slack & [opts])

attachment style messages with actions - try to switch to block messages params o - incoming command request or event payload slack - slack Message data where all actions may refer to other CommandHandlers

attachment style messages with actions - try to switch to block messages
params
   o       - incoming command request or event payload
   slack   - slack Message data where all actions may refer to
             other CommandHandlers
raw docstring

add-actionscljs

(add-actions o actions)

actions must be an [] of {:keys [id command parameters]} (parameter optional)

  • we are not adding the :automation map to the action (assumes all actions route to this skill)
  • TODO we need to warn if a request does not contain an automation field (which can happen when things come in from events).
  • this adds the special messageId parameter to each action
actions must be an [] of {:keys [id command parameters]} (parameter optional)
- we are not adding the :automation map to the action (assumes all actions route to this skill)
- TODO we need to warn if a request does not contain an automation field (which can
  happen when things come in from events).
- this adds the special messageId parameter to each action
raw docstring

add-destinationcljs

(add-destination o
                 {:keys [id name] :as chat-team}
                 {:keys [id name] :as channel})

add slack team channel to existing desintations

add slack team channel to existing desintations
raw docstring

add-gitub-installation-tokencljs

(add-gitub-installation-token handler k)

add-message-idcljs

(add-message-id ch-request)

ensure message id

  • whether request has an id or a messageId parameter
  • use guid if not
ensure message id
- whether request has an id or a messageId parameter
- use guid if not
raw docstring

add-post-modecljs

(add-post-mode request mode)

add-resource-providerscljs

(add-resource-providers handler)

process any resource providers included in the configuration

  • use typeName to run a graphql query
  • add graphql response to the request at [:atomist/resource-providers (keyword resource-provider-name)] the data added is an array of ResourceProvider maps
process any resource providers included in the configuration
- use typeName to run a graphql query
- add graphql response to the request at [:atomist/resource-providers (keyword resource-provider-name)]
  the data added is an array of ResourceProvider maps
raw docstring

add-skill-configcljs

(add-skill-config handler & ks)

request middleware that looks for configuration added for a skill with dispatchStyle equal to multiple

if the request has a configuration then named configuration values are merged into the request using a keywordized map

request middleware
  that looks for configuration added for a skill with dispatchStyle equal to multiple

if the request has a configuration then named configuration values
  are merged into the request using a keywordized map
raw docstring

add-skill-config-by-configuration-parametercljs

(add-skill-config-by-configuration-parameter handler parameter-name & ks)

request middleware that can be used by command handlers to lookup a particular skill configuration and reflect it into the request.

params parameter-name is keyword for the required configuration name ks the names of config parameters that should be reflected into the skill

request middleware
that can be used by command handlers to lookup a particular skill configuration and reflect it into the request.

params
  parameter-name is keyword for the required configuration name
  ks the names of config parameters that should be reflected into the skill
raw docstring

add-slack-source-to-eventcljs

(add-slack-source-to-event handler & {:keys [channel team-id]})

api middleware team-id is optional - if not provided, we pull it in from the graph channel is mandatory and serves as the default destination

api middleware
team-id is optional - if not provided, we pull it in from the graph
channel is mandatory and serves as the default destination
raw docstring

apply-repo-filtercljs

(apply-repo-filter handler & ks)

check whether request ref is in scope requires that a scope parameter has been added to the request and has includes/excludes

check whether request ref is in scope
requires that a scope parameter has been added to the request and has includes/excludes
raw docstring

block-messagecljs

(block-message o blocks)

params blocks - array of Slack blocks (not a map!) TODO - validate that all blocks with actions have valid action attached

  params
    blocks - array of Slack blocks (not a map!)
TODO - validate that all blocks with actions have valid action attached
raw docstring

by-50cljs

(by-50 coll)

channelcljs

(channel o c)

set first destination channel name params o - command request or incoming event payload c - string name of message channel

set first destination channel name
params
  o      - command request or incoming event payload
  c      - string name of message channel
raw docstring

check-required-parameterscljs

(check-required-parameters handler & parameters)

request middleware used during command handler processing to check that required parameters are present

  • if the request is a command handler request and has missing parameters then the bot will go back to the user to get more data
  • if the required parameters are all present then the pipeline will continue with the parameter values keywordized and merged into the request
request middleware
  used during command handler processing to check that required parameters are present

- if the request is a command handler request and has missing parameters then the bot will go back to the user
  to get more data
- if the required parameters are all present then the pipeline will continue with the parameter values keywordized
  and merged into the request
raw docstring

check-run-transactioncljs

(check-run-transaction {:keys [sha repo-id]} check-response)

params ref GitHub response after creating CheckRun

params
ref
GitHub response after creating CheckRun
raw docstring

check-txcljs

(check-tx cname title status & [conclusion])

Generate a transaction for a skill configuration check

Generate a transaction for a skill configuration check
raw docstring

checks-action->enumcljs

(checks-action->enum check-type action)

checks-conclusion->enumcljs

(checks-conclusion->enum check-type conclusion)

checks-status->enumcljs

(checks-status->enum check-type status)

clone-refcljs

(clone-ref handler)

clone a ref and augment request with a :atomist/project at key :project

clone a ref and augment request with a :atomist/project at key :project
raw docstring

command-handlerscljs

(command-handlers dispatch-map)

create a top-level handler function for a dispatch map of command names to command handlers Set up the middleware as if request needs a github token

create a top-level handler function for a dispatch map of command names to command handlers
Set up the middleware as if request needs a github token
raw docstring

compose-middlewarecljs

(compose-middleware & args)

config-iteratorcljs

(config-iterator join-handler forked-handler)

continuecljs

(continue o params)

continue this request with some additional parameter specs (all added parameters must be required)

continue this request with some additional parameter specs
(all added parameters must be required)
raw docstring

create-ref-from-eventcljs

(create-ref-from-event handler
                       &
                       {:keys [stop-if-missing] :or {stop-if-missing true}})

create-ref-from-first-linked-repocljs

(create-ref-from-first-linked-repo handler)

request middleware use a requests's :linked-repos to construct a git ref with {:keys [repo owner branch]}

  • the repo name is a parameter expression which can use parameter values
  • currently always using master branch (should this be a middleware parameter?)
request middleware
use a requests's :linked-repos to construct a git ref with {:keys [repo owner branch]}
- the repo name is a parameter expression which can use parameter values
- currently always using master branch (should this be a middleware parameter?)
raw docstring

creds-killcljs

(creds-kill data)

delete-messagecljs

(delete-message o)

dispatchcljs

(dispatch dispatch-map)

create a request handler using a map where the keys are command names or event subscription operations and the values are request handlers

create a request handler using a map where the keys are command names or event subscription operations
and the values are request handlers
raw docstring

edit-inside-PRcljs

(edit-inside-PR handler configuration)

mostly run editor inside a PR but also allow for running with a commit on master params configuration - :editor/configuration

mostly run editor inside a PR but also allow for running with a commit on master
params
  configuration - :editor/configuration
raw docstring

event->requestcljs

(event->request request)

adds :operation :data :api_version :team :correlation_id to the non-command requests

adds
:operation
:data
:api_version
:team
:correlation_id
to the non-command requests
raw docstring

extract-cli-parameterscljs

(extract-cli-parameters handler options)

request middleware used during command handler processing to parse the raw bot message into cli parameters. The parameters are merged into the request keywordized.

middleware-params options - must contain a clojure.tools.cli option parser definition

request middleware
used during command handler processing to parse the raw bot message into cli parameters.  The parameters
are merged into the request keywordized.

middleware-params
options - must contain a clojure.tools.cli option parser definition
raw docstring

extract-github-tokencljs

(extract-github-token handler)

request middleware will extract a github token by trying a few strategies

  • first check whether any request middleware has already found a github provider with a credential secret This is used when we have a shared authorization for the ResourceProvider

  • second, check whether any request middleware has stored a ref with an owner org. If so, check whether this org has a GitHub Installation and then fetch an Installation token for this Org.

If we find a token store it in the request under the :token key. If we don't find a token, continue anyway. It's possible a good idea to supply an option to stop processing if no token is found.

request middleware
will extract a github token by trying a few strategies

- first check whether any request middleware has already found a github provider with a credential secret
  This is used when we have a shared authorization for the ResourceProvider

- second, check whether any request middleware has stored a ref with an owner org.  If so, check whether this
  org has a GitHub Installation and then fetch an Installation token for this Org.

If we find a token store it in the request under the :token key.  If we don't find a token, continue anyway.
It's possible a good idea to supply an option to stop processing if no token is found.
raw docstring

extract-github-user-tokencljs

(extract-github-user-token handler)

request middleware used during command handler processing to extract a github user token from a request

  • if this middleware finds that the chat user is linked to an authorized ScmProvider then the token will be added to the request
  • if the current user is not authorized then the bot will ask the user authorize and then stop the pipeline with status success.
request middleware
used during command handler processing to extract a github user token from a request

- if this middleware finds that the chat user is linked to an authorized ScmProvider then the token will be added
    to the request
- if the current user is not authorized then the bot will ask the user authorize and then stop the pipeline with status success.
raw docstring

extract-github-user-token-by-github-logincljs

(extract-github-user-token-by-github-login handler)

request middleware used during command handler processing to extract a github user token from a request

  • if this middleware finds that the chat user is linked to an authorized ScmProvider then the token will be added to the request
  • if the current user is not authorized then the bot will ask the user authorize and then stop the pipeline with status success.
request middleware
used during command handler processing to extract a github user token from a request

- if this middleware finds that the chat user is linked to an authorized ScmProvider then the token will be added
    to the request
- if the current user is not authorized then the bot will ask the user authorize and then stop the pipeline with status success.
raw docstring

extract-linked-reposcljs

(extract-linked-repos handler)

request middleware used during command handler processing to extract the set of linked repos for this channel

  • processor will stop if there are no linked channels so this should be inserted in the pipeline only when >0 linked channels should be found. It will output a message if there are zero linked channels
request middleware
used during command handler processing to extract the set of linked repos for this channel

- processor will stop if there are no linked channels so this should be inserted in the pipeline only when >0
  linked channels should be found.  It will output a message if there are zero linked channels
raw docstring

extract-parameterscljs

(extract-parameters handler)

merge all command handler parameters so they can be looked up associatively

merge all command handler parameters so they can be looked up associatively
raw docstring

finishedcljs

(finished & {:keys [message success]})

convenient function to generate a request handler to put at the end of a chain of middleware

options :message - log a finished message into the User log :success - set the reason string in a success status message

convenient function to generate a request handler to put at the end of a chain of middleware

options
  :message - log a finished message into the User log
  :success - set the `reason` string in a success status message
raw docstring

fromcljs

(from handler f & {:keys [key]})

from-channelcljs

(from-channel handler ->channel & {:keys [key] :or {key :results}})

request middleware that pauses to run an async function ->channel and then continues with the functions result merged into request

middleware params ->channel function (request) => channel where the channel result is needed by downstream processors key - the key to use when merging the async result into the request map

request middleware
  that pauses to run an async function ->channel and then continues with the functions result merged into request

middleware params
  ->channel function (request) => channel where the channel result is needed by downstream processors
  key - the key to use when merging the async result into the request map
raw docstring

get-parameter-valuecljs

(get-parameter-value o parameter-name)

search command request for parameter params o - command request parameter-name - string name returns nil if there's no parameter

search command request for parameter
params
  o              - command request
  parameter-name - string name
returns nil if there's no parameter
raw docstring

get-secret-valuecljs

(get-secret-value o secret-uri)

@deprecated

@deprecated
raw docstring

graphql-resource-providerscljs


ingestcljs

(ingest o x channel)

@deprecated ingest a new custom event params o - incoming event or command request x - custom event channel - name of custom event channel

@deprecated
ingest a new custom event
  params
    o         - incoming event or command request
    x         - custom event
    channel   - name of custom event channel
raw docstring

log-eventcljs

(log-event handler)

make-requestcljs

(make-request data sendreponse handler)

This is probably the only function that should be called in a cljs skill handler. It kicks off the request handler.

  • start with the incoming PubSubMessage.data, keywordize it, and use it as the request map
  • wrap the whole request processor in a Promise to satisfy the gcf Node.js runtime
  • create a done channel in the request so that request processing pipeline can finish early
  • wrap the whole pipeline in a try catch block
  • add a callback sendreponse function to the request map to handle writing events to the response topic
  • success/fail status are normally handled in the pipeline, but exception cases handled here will result in fail status
This is probably the only function that should be called in a cljs skill handler.  It kicks off the request handler.

- start with the incoming PubSubMessage.data, keywordize it, and use it as the request map
- wrap the whole request processor in a Promise to satisfy the gcf Node.js runtime
- create a done channel in the request so that request processing pipeline can finish early
- wrap the whole pipeline in a try catch block
- add a callback sendreponse function to the request map to handle writing events to the response topic
- success/fail status are normally handled in the pipeline, but exception cases handled here will result in fail status
raw docstring

mapped-parameter-valuecljs

(mapped-parameter-value o parameter-name)

@deprecated search command request for mapped parameter params o - command request parameter-name - string name returns nil if there's no parameter

@deprecated
search command request for mapped parameter
 params
   o              - command request
   parameter-name - string name
 returns nil if there's no parameter
raw docstring

merge-into-requestcljs

(merge-into-request handler m)

mw-dispatchcljs

(mw-dispatch handler dispatch-map)

normalize-namecljs

(normalize-name s)

parameter-expressioncljs

(parameter-expression ch-request expression)

post-modecljs

(post-mode handler mode)

repo->slugcljs

(repo->slug {repo-name :name {org :owner} :org})

repo-iteratorcljs

(repo-iterator join-handler forked-handler)
(repo-iterator join-handler ref-filter forked-handler)

run a handler (forked-handler) over all of our current repos

forked-handler should return a channel that will emit one value when the forked handler is finished

  • start with a channel that emits all the visible repo-refs in this team
  • map the forked-handler over these refs which means we will end up with a coll of channels
  • merge these channels and then reduce them into an array - this array will contain the results of all of the forked handlers

when the final channel for the reduced results closes, we can run the join handler to continue the outer pipeline

run a handler (forked-handler) over all of our current repos

 forked-handler should return a channel that will emit one value when the forked handler is finished

  - start with a channel that emits all the visible repo-refs in this team
  - map the forked-handler over these refs which means we will end up with a coll of channels
  - merge these channels and then reduce them into an array - this array
    will contain the results of all of the forked handlers

when the final channel for the reduced results closes, we can run the join handler to continue
   the outer pipeline
raw docstring

run-commandcljs

(run-command handler & {:keys [cmd ->args on-success on-failure]})

seekcljs

(seek f coll)

Find first item in coll for which f returns logical true (short cuts early)

Find first item in coll for which f returns logical true (short cuts early)
raw docstring

send-fingerprintscljs

(send-fingerprints handler)

request middleware that will look for fingerprints in the request and send them to Atomist

request middleware
that will look for fingerprints in the request and send them to Atomist
raw docstring

set-message-idcljs

(set-message-id handler)

request middleware used during command handler processing to extract messageIds or create new random ones

This is useful to insert into a pipeline that will keep updating a message over a set of events.

request middleware
used during command handler processing to extract messageIds or create new random ones

This is useful to insert into a pipeline that will keep updating a message over a set of events.
raw docstring

show-results-in-slackcljs

(show-results-in-slack handler
                       &
                       {:keys [result-type] :or {result-type "results"}})

request middleware will send a slack snippet containing the results in the current request. Mostly for debugging This request must already have been configured to send to a particular Slack channel or be a command handler request.

request middleware
will send a slack snippet containing the results in the current request.  Mostly for debugging
This request must already have been configured to send to a particular Slack channel or be a command handler request.
raw docstring

simple-messagecljs

(simple-message o s)

send simple message as bot params o - command request or event s - string message

send simple message as bot
params
  o - command request or event
  s - string message
raw docstring

skip-if-not-default-branchcljs

(skip-if-not-default-branch handler)

skip-push-if-atomist-editedcljs

(skip-push-if-atomist-edited handler)

request middleware that checks whether a Push event contains a message with [atomist:edited]

handler chain stops if the message contains [atomist:edited] and otherwise continues

request middleware
that checks whether a Push event contains a message with [atomist:edited]

handler chain stops if the message contains [atomist:edited] and otherwise continues
raw docstring

snippet-messagecljs

(snippet-message o content-str filetype title)

send snippet as bot params o - command request or event content-str - content as string filetype - valid slack filetype title - string title

send snippet as bot
params
  o           - command request or event
  content-str - content as string
  filetype    - valid slack filetype
  title       - string title
raw docstring

statuscljs

(status handler)

middleware looks for :atomist/status in request and sends a status message on response topic

  • fail if there is no valid :atomist/status in the response
middleware looks for :atomist/status in request and sends a status message on response topic
- fail if there is no valid :atomist/status in the response
raw docstring

stop-if-no-files-detectedcljs

(stop-if-no-files-detected handler & {:keys [substr]})

this will halt on Repos that don't have any files matching a certain substr

this will halt on Repos that don't have any files matching a certain substr
raw docstring

tracecljs

(trace s)

transactcljs

(transact o coll)

transact the coll of entities using the response pubsub topic requires :sendreponse :correlation_id :team :api_version

transact the coll of entities using the response pubsub topic
requires
  :sendreponse
  :correlation_id
  :team
  :api_version
raw docstring

transact-http-responsecljs

(transact-http-response request response check? ->transaction)

params request response - http response check? - predicate for evaluating response ->transaction - build transaction data

params
request
response - http response
check? - predicate for evaluating response
->transaction - build transaction data
raw docstring

update-if-existscljs

(update-if-exists m k f)

update-in-if-existscljs

(update-in-if-exists m ks f)

usercljs

(user o u)

set first message destination to user DM params o - command request or incoming event payload c - string name of user to DM

set first message destination to user DM
params
  o      - command request or incoming event payload
  c      - string name of user to DM
raw docstring

user-should-choose-one-linked-repocljs

(user-should-choose-one-linked-repo handler)

request middleware when the request :linked-repos has >1 linked repo, force the user to choose if, on the other hand, the request has zero repos, stop and tell the user that this command should be run from a channel with at least one linked repo

request middleware
when the request :linked-repos has >1 linked repo, force the user to choose
if, on the other hand, the request has zero repos, stop and tell the user that this command should be run from a channel
  with at least one linked repo
raw docstring

validate-repo-in-graphcljs

(validate-repo-in-graph handler repo-name-fn)

request middleware ensure Repo referenced in a command is present in graph - if present, add it to the request with key :repo

request middleware
ensure Repo referenced in a command is present in graph - if present, add it to the request with key :repo
raw docstring

with-github-check-runcljs

(with-github-check-run handler
                       &
                       {:keys [name default conclusion]
                        :or {conclusion :checkrun/conclusion}})

request should contain an :atomist/ref-with-sha but :atomist/datomic-refs will also transact the checkrun into our model options :name - checkrun name or keyword to extract name from request :default - default checkrun name if name is nil :conclusion - defaults to :checkrun/conlusion but can be a 1-arg function that will be called on the handler response

request should contain an :atomist/ref-with-sha but :atomist/datomic-refs will also transact the checkrun into our model
options
  :name - checkrun name or keyword to extract name from request
  :default - default checkrun name if name is nil
  :conclusion - defaults to :checkrun/conlusion but can be a 1-arg function that will be called on the handler
                response
raw docstring

wrap-conditional-mwcljs

(wrap-conditional-mw predicate? mw & args)

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

× close