From ea05849ceab4d88ea79a3fed1c8e0d2441901aeb Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 24 Dec 2025 15:15:25 +0100 Subject: [PATCH] add glab --- elpa/glab-20250620.1333/glab-autoloads.el | 23 +++ elpa/glab-20250620.1333/glab-pkg.el | 10 ++ elpa/glab-20250620.1333/glab.el | 172 ++++++++++++++++++++++ 3 files changed, 205 insertions(+) create mode 100644 elpa/glab-20250620.1333/glab-autoloads.el create mode 100644 elpa/glab-20250620.1333/glab-pkg.el create mode 100644 elpa/glab-20250620.1333/glab.el diff --git a/elpa/glab-20250620.1333/glab-autoloads.el b/elpa/glab-20250620.1333/glab-autoloads.el new file mode 100644 index 00000000..5cecb83d --- /dev/null +++ b/elpa/glab-20250620.1333/glab-autoloads.el @@ -0,0 +1,23 @@ +;;; glab-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + +;;; Code: + +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + + +;;; End of scraped data + +(provide 'glab-autoloads) + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; coding: utf-8-emacs-unix +;; End: + +;;; glab-autoloads.el ends here diff --git a/elpa/glab-20250620.1333/glab-pkg.el b/elpa/glab-20250620.1333/glab-pkg.el new file mode 100644 index 00000000..a1fd75f6 --- /dev/null +++ b/elpa/glab-20250620.1333/glab-pkg.el @@ -0,0 +1,10 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "glab" "20250620.1333" + "Client library for the Gitlab API." + '((ghub "4")) + :url "https://github.com/emacsattic/glab" + :commit "655c0cd042b8e4abe6d314846f4c55b146f9fdee" + :revdesc "655c0cd042b8" + :keywords '("tools") + :authors '(("Jonas Bernoulli" . "emacs.ghub@jonas.bernoulli.dev")) + :maintainers '(("Jonas Bernoulli" . "emacs.ghub@jonas.bernoulli.dev"))) diff --git a/elpa/glab-20250620.1333/glab.el b/elpa/glab-20250620.1333/glab.el new file mode 100644 index 00000000..5d114cde --- /dev/null +++ b/elpa/glab-20250620.1333/glab.el @@ -0,0 +1,172 @@ +;;; glab.el --- Client library for the Gitlab API -*- lexical-binding:t -*- + +;; Copyright (C) 2016-2025 Jonas Bernoulli + +;; Author: Jonas Bernoulli +;; Homepage: https://github.com/emacsattic/glab +;; Keywords: tools + +;; Package-Version: 20250620.1333 +;; Package-Revision: 655c0cd042b8 +;; Package-Requires: ((ghub "4")) + +;; SPDX-License-Identifier: GPL-3.0-or-later + +;; This file is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published +;; by the Free Software Foundation, either version 3 of the License, +;; or (at your option) any later version. +;; +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this file. If not, see . + +;;; Commentary: + +;; This package provides convenience wrappers, specialized for Gitlab, +;; around functions provided by the `ghub' package (which, unless told +;; otherwise, assumes it is talking to a Github host). + +;; Instead of (ghub-get ... :forge 'gitlab) +;; you can use (glab-get ...) + +;; This package is semi-deprecated. You might learn that in your own +;; package you have to further wrap `glab-VERB' functions, and if you +;; do that, you might as well wrap `ghub-VERB' or even `ghub-request' +;; directly. + +;;; Code: + +(require 'ghub) + +(cl-defun glab-head (resource &optional params + &key query payload headers + silent unpaginate noerror reader + username auth host + callback errorback extra) + "Make a `HEAD' request for RESOURCE, with optional query PARAMS. +Like calling `ghub-request' (which see) with \"HEAD\" as METHOD +and `gitlab' as FORGE." + (ghub-request "HEAD" resource params :forge 'gitlab + :query query :payload payload :headers headers + :silent silent :unpaginate unpaginate + :noerror noerror :reader reader + :username username :auth auth :host host + :callback callback :errorback errorback :extra extra)) + +(cl-defun glab-get (resource &optional params + &key query payload headers + silent unpaginate noerror reader + username auth host + callback errorback extra) + "Make a `GET' request for RESOURCE, with optional query PARAMS. +Like calling `ghub-request' (which see) with \"GET\" as METHOD +and `gitlab' as FORGE." + (ghub-request "GET" resource params :forge 'gitlab + :query query :payload payload :headers headers + :silent silent :unpaginate unpaginate + :noerror noerror :reader reader + :username username :auth auth :host host + :callback callback :errorback errorback :extra extra)) + +(cl-defun glab-put (resource &optional params + &key query payload headers + silent unpaginate noerror reader + username auth host + callback errorback extra) + "Make a `PUT' request for RESOURCE, with optional payload PARAMS. +Like calling `ghub-request' (which see) with \"PUT\" as METHOD +and `gitlab' as FORGE." + (ghub-request "PUT" resource params :forge 'gitlab + :query query :payload payload :headers headers + :silent silent :unpaginate unpaginate + :noerror noerror :reader reader + :username username :auth auth :host host + :callback callback :errorback errorback :extra extra)) + +(cl-defun glab-post (resource &optional params + &key query payload headers + silent unpaginate noerror reader + username auth host + callback errorback extra) + "Make a `POST' request for RESOURCE, with optional payload PARAMS. +Like calling `ghub-request' (which see) with \"POST\" as METHOD +and `gitlab' as FORGE." + (ghub-request "POST" resource params :forge 'gitlab + :query query :payload payload :headers headers + :silent silent :unpaginate unpaginate + :noerror noerror :reader reader + :username username :auth auth :host host + :callback callback :errorback errorback :extra extra)) + +(cl-defun glab-patch (resource &optional params + &key query payload headers + silent unpaginate noerror reader + username auth host + callback errorback extra) + "Make a `PATCH' request for RESOURCE, with optional payload PARAMS. +Like calling `ghub-request' (which see) with \"PATCH\" as METHOD +and `gitlab' as FORGE." + (ghub-request "PATCH" resource params :forge 'gitlab + :query query :payload payload :headers headers + :silent silent :unpaginate unpaginate + :noerror noerror :reader reader + :username username :auth auth :host host + :callback callback :errorback errorback :extra extra)) + +(cl-defun glab-delete (resource &optional params + &key query payload headers + silent unpaginate noerror reader + username auth host + callback errorback extra) + "Make a `DELETE' request for RESOURCE, with optional payload PARAMS. +Like calling `ghub-request' (which see) with \"DELETE\" as METHOD +and `gitlab' as FORGE." + (ghub-request "DELETE" resource params :forge 'gitlab + :query query :payload payload :headers headers + :silent silent :unpaginate unpaginate + :noerror noerror :reader reader + :username username :auth auth :host host + :callback callback :errorback errorback :extra extra)) + +(cl-defun glab-request (method resource &optional params + &key query payload headers + silent unpaginate noerror reader + username auth host + callback errorback extra) + "Make a request for RESOURCE and return the response body. +Like calling `ghub-request' (which see) with `gitlab' as FORGE." + (ghub-request method resource params :forge 'gitlab + :query query :payload payload :headers headers + :silent silent :unpaginate unpaginate + :noerror noerror :reader reader + :username username :auth auth :host host + :callback callback :errorback errorback :extra extra)) + +(cl-defun glab-graphql (graphql &optional variables + &key username auth host + headers silent + callback errorback value extra) + "Make a GraphQL request using GRAPHQL and VARIABLES. +Like calling `ghub-graphql' (which see) with `gitlab' as FORGE." + (ghub-graphql graphql variables :forge 'gitlab + :username username :auth auth :host host + :headers headers :silent silent + :callback callback :errorback errorback + :value value :extra extra)) + +(cl-defun glab-repository-id (owner name &key username auth host) + "Return the id of the repository specified by OWNER, NAME and HOST." + (number-to-string + (cdr (assq 'id (glab-get (format "/projects/%s%%2F%s" + (string-replace "/" "%2F" owner) + name) + nil :username username :auth auth :host host))))) + +;;; _ +(provide 'glab) +;;; glab.el ends here -- 2.47.3