]> git.corax.cc Git - toolbox-restapis/log
toolbox-restapis
3 years agoinclude/gitlab: Make _gitlab_get() and _gitlab_post() handle errors
Matthias Kruk [Mon, 6 Jun 2022 00:06:40 +0000 (09:06 +0900)]
include/gitlab: Make _gitlab_get() and _gitlab_post() handle errors

When an API call fails, GitLab usually returns HTTP 200 and a JSON
object with an error message. Because HTTP 200 indicates success,
_gitlab_get() and _gitlab_post() assume that the call succeeded and
do not return an error.

This commit modifies _gitlab_get() and _gitlab_post() to check if
the received JSON object contains an "error" member, which should
not be found in any non-error results. If an "error" member was
found, the API call is assumed to have failed.

3 years agoinclude/gitlab: Make urlencode function more extensible
Matthias Kruk [Sun, 5 Jun 2022 23:57:48 +0000 (08:57 +0900)]
include/gitlab: Make urlencode function more extensible

Because _gitlab_urlencode() is a simple string replacement, it is
not very extensible and does not handle more than one replacement.

This commit rewrites _gitlab_urlencode() to use an associative
array to store replacement patterns, allowing the function to be
easily extended. For testing, this commit also adds a pattern to
escape comma (',') characters in URLs.

3 years agoinclude/slack.sh: Add module for interacting with Slack
Matthias Kruk [Wed, 16 Feb 2022 04:07:07 +0000 (13:07 +0900)]
include/slack.sh: Add module for interacting with Slack

This commit adds the slack module, which implements functions for
posting messages to private conversations and channels, as well as
formatting functions for Slack's markdown flavor.

3 years agodebian: Add files for building debian packages stable
Matthias Kruk [Mon, 24 Jan 2022 02:44:49 +0000 (11:44 +0900)]
debian: Add files for building debian packages

This commit adds all files necessary to build debian packages from
the source tree.

4 years agoinclude/gitlab: Clean up gitlab module API
Matthias Kruk [Wed, 14 Jul 2021 12:36:22 +0000 (21:36 +0900)]
include/gitlab: Clean up gitlab module API

Function names in the gitlab module do not follow a consistent naming
convention, making them rather irritating to use.
This commit makes sure function names in the gitlab module are
consistent in their naming. Further, this commit makes sure the log
module is used for printing error messages, where necessary.

4 years agoinclude/{gitlab,iruca}: Add gitlab and iruca module from toolbox
Matthias Kruk [Wed, 14 Jul 2021 08:27:27 +0000 (17:27 +0900)]
include/{gitlab,iruca}: Add gitlab and iruca module from toolbox

This commit adds the iruca and gitlab modules that have been removed
from the main toolbox source tree.