From 7f1648802b360e3bd6060f52df646487bbfec699 Mon Sep 17 00:00:00 2001
From: Justin Dalrymple <%= bodyContent %>
+ >18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[i];return n=s%3,n===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):n===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):n===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function Tfe(r){return jl&&jl.isBuffer(r)}IU.exports=new Rfe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ffe,construct:Nfe,predicate:Tfe,represent:Lfe})});var BU=w((kXe,wU)=>{"use strict";var Ofe=si(),Mfe=Object.prototype.hasOwnProperty,Kfe=Object.prototype.toString;function Ufe(r){if(r===null)return!0;var e=[],t,i,n,s,o,a=r;for(t=0,i=a.length;t{"use strict";var Gfe=si(),Yfe=Object.prototype.toString;function jfe(r){if(r===null)return!0;var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e"u"&&(t=e,e=null),e2(r,e,da.extend({schema:qU},t))}function Nhe(r,e){return t2(r,da.extend({schema:qU},e))}Kp.exports.loadAll=e2;Kp.exports.load=t2;Kp.exports.safeLoadAll=Fhe;Kp.exports.safeLoad=Nhe});var b2=w((UXe,OS)=>{"use strict";var Hp=Gl(),Gp=Qg(),Lhe=Mp(),The=Sg(),c2=Object.prototype.toString,u2=Object.prototype.hasOwnProperty,Ohe=9,Up=10,Mhe=13,Khe=32,Uhe=33,Hhe=34,g2=35,Ghe=37,Yhe=38,jhe=39,qhe=42,f2=44,Jhe=45,h2=58,Whe=61,zhe=62,Vhe=63,Xhe=64,p2=91,d2=93,_he=96,C2=123,Zhe=124,m2=125,Fi={};Fi[0]="\\0";Fi[7]="\\a";Fi[8]="\\b";Fi[9]="\\t";Fi[10]="\\n";Fi[11]="\\v";Fi[12]="\\f";Fi[13]="\\r";Fi[27]="\\e";Fi[34]='\\"';Fi[92]="\\\\";Fi[133]="\\N";Fi[160]="\\_";Fi[8232]="\\L";Fi[8233]="\\P";var $he=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function epe(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},i=Object.keys(e),n=0,s=i.length;n0?r.charCodeAt(s-1):null,f=f&&s2(o,a)}else{for(s=0;s{"use strict";var gI=r2(),S2=b2();function fI(r){return function(){throw new Error("Function "+r+" is deprecated and cannot be used.")}}Fr.exports.Type=si();Fr.exports.Schema=Yl();Fr.exports.FAILSAFE_SCHEMA=sI();Fr.exports.JSON_SCHEMA=xS();Fr.exports.CORE_SCHEMA=PS();Fr.exports.DEFAULT_SAFE_SCHEMA=Sg();Fr.exports.DEFAULT_FULL_SCHEMA=Mp();Fr.exports.load=gI.load;Fr.exports.loadAll=gI.loadAll;Fr.exports.safeLoad=gI.safeLoad;Fr.exports.safeLoadAll=gI.safeLoadAll;Fr.exports.dump=S2.dump;Fr.exports.safeDump=S2.safeDump;Fr.exports.YAMLException=Qg();Fr.exports.MINIMAL_SCHEMA=sI();Fr.exports.SAFE_SCHEMA=Sg();Fr.exports.DEFAULT_SCHEMA=Mp();Fr.exports.scan=fI("scan");Fr.exports.parse=fI("parse");Fr.exports.compose=fI("compose");Fr.exports.addConstructor=fI("addConstructor")});var P2=w((GXe,x2)=>{"use strict";var ppe=v2();x2.exports=ppe});var k2=w((YXe,D2)=>{"use strict";function dpe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function zl(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,zl)}dpe(zl,Error);zl.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g
-
+
-
-
-
Justin Dalrymple
💻 👀 🚧 🐛 🤔 📖 ⚠️ 🚇
-
akira345
📖 👀 💻
-
Pavel Birukov
👀 💻
-
Joseph Petersen
👀 🤔 🐛 💻
-
Louis Cherel
👀 💻
-
Adam Dehnel
👀 🚧 🐛 💻
-
Ev Haus
👀 💻
-
-
-
Loïc Mahieu
👀
-
Giuseppe Angri
👀 💻
-
jennparise
👀 🐛 💻
-
Oscar
👀
-
Daniel Ruf
👀 📖 🐛 🚧 💻
-
schindld
👀 💻
-
Alvaro
💻
-
-
-
Daniel Moore
💻
-
Dylan M. Taylor
📖 💻
-
Corentin Mors
💻
-
xatavian
💻
-
Yevgeny Petukhov
💻
-
Mickaël Tricot
📖
-
Andrea
💻
-
-
-
Flavien Bridault
⚠️ 💻
-
s-kazuki
💻
-
Kipras Melnikovas
💻
-
xieyu
💻
-
st1gok
💻
-
Max Wittig
📖 ⚠️ 💻
-
Niklas Lochschmidt
📖 ⚠️ 💻
-
-
-
Ilya Dus
💻
-
Omar Awamry
💻
-
Hennadii Varava
💻
-
xiezht
📖
-
Martin Helmich
💻
-
Sean McGivern
📖
-
Clemens Lieb
💻
-
-
-
Vojtěch Sajdl
⚠️ 💻
-
divido
⚠️ 💻
-
Vincent Boulaye
⚠️ 💻
-
Aliyss Snow
📖 ⚠️ 💻
-
Mahmoud Saada
💻
-
Feng Yu
💻
-
Roy Jacobs
💻
-
-
-
Paul Lemke
💻
-
Ian Jenkins
⚠️ 💻
-
nilennoct
⚠️ 💻
-
Laffargue Michael
💻
-
Martin Howarth
⚠️ 💻
-
pataar
💻
-
Ikko Ashimine
💻 ⚠️
-
-
-
Bilal Aslam
💻
-
youngje
💻
-
Sullivan SENECHAL
💻
-
Felix Herold
💻
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -🤖 [GitLab](https://gitlab.com/gitlab-org/gitlab/) API Browser library with full support of all the [Gitlab API](https://gitlab.com/gitlab-org/gitlab/tree/master/doc/api) services. - -[Read More](https://github.com/jdalrymple/gitbeaker#readme) diff --git a/packages/browser/jest.config.js b/packages/browser/jest.config.js deleted file mode 100644 index c9fcc3a48..000000000 --- a/packages/browser/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -const base = require('../../jest.config.base'); - -module.exports = { - ...base, - preset: 'jest-playwright-preset', - displayName: '-- Gitbeaker Browser', -}; diff --git a/packages/browser/package.json b/packages/browser/package.json deleted file mode 100644 index 0c03442cb..000000000 --- a/packages/browser/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@gitbeaker/browser", - "description": "Full Browser implementation of the GitLab API. Supports Promises, Async/Await.", - "version": "35.8.0", - "author": { - "name": "Justin Dalrymple" - }, - "bugs": { - "url": "https://github.com/jdalrymple/gitbeaker/issues" - }, - "dependencies": { - "@gitbeaker/core": "^35.8.0", - "@gitbeaker/requester-utils": "^35.8.0", - "delay": "^5.0.0", - "ky": "0.28.7" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^21.0.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.0.0", - "@rollup/plugin-replace": "^3.0.0", - "@types/node": "^18.0.3", - "headers-utils": "^3.0.2", - "jest-extended": "^3.0.0", - "jest-playwright-preset": "^1.5.1", - "node-fetch": "^3.0.0", - "playwright": "^1.9.2", - "rollup": "^2.47.0", - "rollup-plugin-node-globals": "^1.4.0", - "rollup-plugin-node-polyfills": "^0.2.1", - "rollup-plugin-terser": "^7.0.2", - "rollup-plugin-typescript2": "^0.31.1", - "tslib": "^2.3.1", - "typescript": "^4.2.4", - "uuid": "^8.3.2" - }, - "engines": { - "node": ">=14.2.0" - }, - "files": [ - "dist" - ], - "homepage": "https://github.com/jdalrymple/gitbeaker#readme", - "keywords": [ - "api", - "es5", - "es6", - "gitlab", - "gitbeaker", - "ky" - ], - "license": "MIT", - "browser": "dist/index.js", - "main": "dist/index.cjs.js", - "types": "dist/types", - "repository": { - "type": "git", - "url": "https://github.com/jdalrymple/gitbeaker" - }, - "scripts": { - "build": "rollup -c", - "test:integration": "TEST_ID=$(uuid) node --expose-gc ../../node_modules/.bin/jest --runInBand --logHeapUsage test/integration", - "test:unit": "node --expose-gc ../../node_modules/.bin/jest --runInBand --logHeapUsage test/unit" - } -} diff --git a/packages/browser/rollup.config.js b/packages/browser/rollup.config.js deleted file mode 100644 index 34c0dc4bb..000000000 --- a/packages/browser/rollup.config.js +++ /dev/null @@ -1,46 +0,0 @@ -import resolve from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; -import builtins from 'rollup-plugin-node-polyfills'; -import globals from 'rollup-plugin-node-globals'; -import ts from 'rollup-plugin-typescript2'; -import json from '@rollup/plugin-json'; -import { terser } from 'rollup-plugin-terser'; -import pkg from './package.json'; - -export default [ - { - input: 'src/index.ts', - external: ['form-data'], - output: [ - { - file: pkg.browser, - name: 'gitbeaker', - format: 'umd', - exports: 'named', - globals: { 'form-data': 'FormData' }, - sourcemap: true, - }, - { - file: pkg.main, // CommonJS (for Node) build. - format: 'cjs', - sourcemap: true, - }, - ], - plugins: [ - globals(), - builtins(), - resolve({ browser: true }), - ts({ - useTsconfigDeclarationDir: true, - tsconfigOverride: { - compilerOptions: { - baseUrl: '.', - }, - }, - }), - json(), - commonjs(), - terser({ mangle: false }), - ], - }, -]; diff --git a/packages/browser/src/KyRequester.ts b/packages/browser/src/KyRequester.ts deleted file mode 100644 index 21d458388..000000000 --- a/packages/browser/src/KyRequester.ts +++ /dev/null @@ -1,75 +0,0 @@ -import ky from 'ky'; -import delay from 'delay'; -import { - DefaultResourceOptions, - DefaultRequestReturn, - DefaultRequestOptions, - createRequesterFn, - defaultOptionsHandler as baseOptionsHandler, -} from '@gitbeaker/requester-utils'; - -export function defaultOptionsHandler( - serviceOptions: DefaultResourceOptions, - options: DefaultRequestOptions = {}, -): DefaultRequestReturn { - const opts: DefaultRequestReturn = baseOptionsHandler(serviceOptions, options); - - return { ...opts, headers: new Headers(opts.headers as Record- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - +
-🤖 [GitLab](https://gitlab.com/gitlab-org/gitlab/) API CLI library with full support of all the [Gitlab API](https://gitlab.com/gitlab-org/gitlab/tree/master/doc/api) services. +> A CLI Wrapper for the [@gitbeaker/rest](https://www.npmjs.com/package/@gitbeaker/rest) SDK. + +## Table of Contents + +- [Usage](#usage) +- [Contributors](#contributors) +- [Changelog](./CHANGELOG.md) + +## Usage + ++Node 18+ + |
+
+Install with npm install -g @gitbeaker/cli , or yarn add -g @gitbeaker/cli
+
+```bash
+gitbeaker [service name] [method name] --config_args pos_arg1 pos_argN --opts_arg1 --opts_argN
+
+# A shorthand can also be used:
+gb [service name] [method name] --config_args pos_arg1 pos_argN --opts_arg1 --opts_argN
+```
+
+Where:
+
+- `service name` is any of the supported API names of the [@gitbeaker/rest](https://github.com/jdalrymple/gitbeaker/blob/main/packages/rest/README.md) sdk
+- `method name` is any of the supported commands on that API service (See source for exceptions, but generally all, show, remove, update)
+- `--config_args` is any of general configuration arguments such as your personal token. These are outlined in this [table](https://github.com/jdalrymple/gitbeaker/blob/main/README.md?#api-client) and can also be found by looking at the cli help menu. These arguments must also include a `gb` or `gl` prefix. ie.
+
+```bash
+# To get all the projects
+gitbeaker projects all --gb-token="personaltoken"
+```
+
+- `pos_arg1 ... pos_argN` are any of the arguments you would normally supply to the function. The names of the args should match the names in the method headers. These positional arguments can also be written as flag arguments: `--pos_arg1 ... --pos_argN`, **BUT** must be written in the correct order.
+- `--opts_arg1 ...--opts_argN` are any of the optional arguments that you would normally supply to the function. Their names should match what the GitLab API docs request.
+
+```bash
+# To get all the projects id=2 and optional parameter "search" = "cool"
+gitbeaker projects all --gb-token="personaltoken" 2 --search="cool"
+```
+
+To reduce the annoyance of having to pass those configuration properties each time, it is also possible to pass the token and host information through environment variables in the form of `GITLAB_[option name]` or `GITBEAKER_[option name]` ie:
+
+```bash
+GITLAB_HOST=http://example.com
+GITLAB_TOKEN=personaltoken
+GITBEAKER_CAMELIZE=true
+```
+
+This could be set globally or using a [.env](https://github.com/motdotla/dotenv#readme) file in the project folder.
+
+ |
---|
+
- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -34,6 +27,162 @@
-🤖 [GitLab](https://gitlab.com/gitlab-org/gitlab/) API NodeJS library with full support of all the [Gitlab API](https://gitlab.com/gitlab-org/gitlab/tree/master/doc/api) services. This library is generally for internal use only. +> Core SDK for the [GitLab](https://gitlab.com/gitlab-org/gitlab/) API. This is not intended for direct use, see [@gitbeaker/rest](https://www.npmjs.com/package/@gitbeaker/rest) or [gitbeaker/cli](https://www.npmjs.com/package/@gitbeaker/cli) instead. + +## Table of Contents + +- [Usage](#usage) +- [Contributors](#contributors) +- [Changelog](./CHANGELOG.md) + +## Usage + ++Browsers + |
+Load @gitbeaker/core directly from cdn.skypack.dev
+
+```html
+
+```
+
+ |
---|---|
+Deno + |
+Load @gitbeaker/core directly from cdn.skypack.dev
+
+```ts
+import { Gitlab } from 'https://cdn.skypack.dev/@gitbeaker/core?dts';
+```
+
+ |
+Node 18+ + |
+
+Install with npm install @gitbeaker/core , or yarn add @gitbeaker/core
+
+```js
+import { Gitlab } from '@gitbeaker/core';
+```
+
+ |
+
=
- BaseRequestOptions & {
- pagination?: P;
- perPage?: number;
- };
+export type PaginationTypes = 'keyset' | 'offset';
+
+export type BaseRequestOptions {
+ pagination?: P;
+ perPage?: number | string;
+}
-export type PaginatedRequestOptions =
- P extends 'keyset'
- ? BasePaginationRequestOptions
- : BasePaginationRequestOptions & OffsetPaginationRequestOptions;
+export type PaginationRequestSubOptions = P extends 'keyset'
+ ? KeysetPaginationRequestOptions
+ : P extends 'offset'
+ ? OffsetPaginationRequestOptions
+ : Record =
+ BasePaginationRequestOptions & PaginationRequestSubOptions ;
// Response Formats
-export interface ExpandedResponse (
- service: BaseResource & ShowExpanded & BaseRequestOptions & BaseRequestOptions & BaseRequestOptions & ShowExpanded & BaseRequestOptions & BaseRequestOptions