new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _validate = _interopRequireDefault(require("./validate.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function version(uuid) {
|
||||
if (!(0, _validate.default)(uuid)) {
|
||||
throw TypeError('Invalid UUID');
|
||||
}
|
||||
|
||||
return parseInt(uuid.substr(14, 1), 16);
|
||||
}
|
||||
|
||||
var _default = version;
|
||||
exports.default = _default;
|
||||
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isLocale;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var localeReg = /^[A-z]{2,4}([_-]([A-z]{4}|[\d]{3}))?([_-]([A-z]{2}|[\d]{3}))?$/;
|
||||
|
||||
function isLocale(str) {
|
||||
(0, _assertString.default)(str);
|
||||
|
||||
if (str === 'en_US_POSIX' || str === 'ca_ES_VALENCIA') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return localeReg.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sampleTime.js","sources":["../src/operators/sampleTime.ts"],"names":[],"mappings":";;;;;AAAA,sDAAiD"}
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var observable_1 = require("../symbol/observable");
|
||||
function isInteropObservable(input) {
|
||||
return input && typeof input[observable_1.observable] === 'function';
|
||||
}
|
||||
exports.isInteropObservable = isInteropObservable;
|
||||
//# sourceMappingURL=isInteropObservable.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"switchMap.js","sources":["../../src/add/operator/switchMap.ts"],"names":[],"mappings":";;AAAA,8CAA4C"}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { OperatorFunction, MonoTypeOperatorFunction } from '../types';
|
||||
export declare function takeWhile<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;
|
||||
export declare function takeWhile<T, S extends T>(predicate: (value: T, index: number) => value is S, inclusive: false): OperatorFunction<T, S>;
|
||||
export declare function takeWhile<T>(predicate: (value: T, index: number) => boolean, inclusive?: boolean): MonoTypeOperatorFunction<T>;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("rxjs-compat/add/operator/audit");
|
||||
//# sourceMappingURL=audit.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"merge.js","sources":["../../../src/internal/operators/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAsC3D,MAAM,UAAU,KAAK,CAAO,GAAG,WAAiE;IAC9F,OAAO,CAAC,MAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;AAC1F,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mergeAll.js","sources":["../../../src/internal/operators/mergeAll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA6D5C,MAAM,UAAU,QAAQ,CAAI,aAAqB,MAAM,CAAC,iBAAiB;IACvE,OAAO,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACxC,CAAC"}
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operators/map"));
|
||||
//# sourceMappingURL=map.js.map
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/bufferToggle';
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E BC","132":"F","260":"G A B"},B:{"1":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","260":"C K H M N O","772":"L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"1":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB"},G:{"1":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"1":"nC"},I:{"1":"tB I D oC pC qC rC AC sC tC"},J:{"1":"E A"},K:{"1":"A B C e qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"260":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:6,C:"Data URIs"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"never.js","sources":["../../../src/internal/observable/never.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAgCpC,MAAM,CAAC,IAAM,KAAK,GAAG,IAAI,UAAU,CAAQ,IAAI,CAAC,CAAC;AAKjD,MAAM,UAAU,KAAK;IACnB,OAAO,KAAK,CAAC;AACf,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC tB I u J E F G A B C K L DC EC"},D:{"1":"NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB","194":"KB LB MB"},E:{"1":"A B C K L H 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u J E F G GC zB HC IC JC KC"},F:{"1":"AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"0 1 2 3 4 5 6 G B C H M N O v w x y z OC PC QC RC qB 9B SC rB","194":"7 8 9"},G:{"1":"aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"F zB TC AC UC VC WC XC YC ZC"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:6,C:"Rest parameters"};
|
||||
@@ -0,0 +1,40 @@
|
||||
declare const macosRelease: {
|
||||
/**
|
||||
Get the name and version of a macOS release from the Darwin version.
|
||||
|
||||
@param release - By default, the current operating system is used, but you can supply a custom [Darwin kernel version](https://en.wikipedia.org/wiki/Darwin_%28operating_system%29#Release_history), which is the output of [`os.release()`](https://nodejs.org/api/os.html#os_os_release).
|
||||
|
||||
@example
|
||||
```
|
||||
import * as os from 'os';
|
||||
import macosRelease = require('macos-release');
|
||||
|
||||
// On a macOS Sierra system
|
||||
|
||||
macosRelease();
|
||||
//=> {name: 'Sierra', version: '10.12'}
|
||||
|
||||
os.release();
|
||||
//=> 13.2.0
|
||||
// This is the Darwin kernel version
|
||||
|
||||
macosRelease(os.release());
|
||||
//=> {name: 'Sierra', version: '10.12'}
|
||||
|
||||
macosRelease('14.0.0');
|
||||
//=> {name: 'Yosemite', version: '10.10'}
|
||||
|
||||
macosRelease('20.0.0');
|
||||
//=> {name: 'Big Sur', version: '11'}
|
||||
```
|
||||
*/
|
||||
(): {name: string, version: string}
|
||||
(release: string): {name: string, version: string} | undefined;
|
||||
|
||||
// TODO: remove this in the next major version, refactor the whole definition to:
|
||||
// declare function macosRelease(release?: string): {name: string, version: string};
|
||||
// export = macosRelease;
|
||||
default: typeof macosRelease;
|
||||
};
|
||||
|
||||
export = macosRelease;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"@octokit/plugin-rest-endpoint-methods","version":"5.0.0","files":{"LICENSE":{"checkedAt":1678887829383,"integrity":"sha512-bTGv3z196MOWM1pED3fS4NgeOXALRa13dBpWpUu3VkXl8hiIyX8JPYv9CzfWlJeNCJ2lyKm/h5vBQN1NEaBcSQ==","mode":420,"size":1107},"dist-src/endpoints-to-methods.js":{"checkedAt":1678887830236,"integrity":"sha512-StFa8xBAjB2tOg3el36+UmMPQxdZJChSKlcH7vAvLQ9vB7DZP3Do3HeoeFbHhuba/a8Xc065UVwcar8AOgpjdg==","mode":420,"size":2816},"dist-src/generated/endpoints.js":{"checkedAt":1678887830254,"integrity":"sha512-GV9Ga1uhBkHn5pok3S90uP7Np9hW32KS8e4d10NOevQ73fOMcnyifEMcCmpKH/OqrcrIhLJf0ba9HlSsAX5OXg==","mode":420,"size":65624},"dist-node/index.js":{"checkedAt":1678887830279,"integrity":"sha512-WWaxqU4oN+axNDx9xsSiUVRIUC/BuwXYjk7H5REJ5KTVC+uiCPDM1F2nnAO3LHIt395YtwUx68q497QFxBnZ2w==","mode":420,"size":61348},"dist-src/index.js":{"checkedAt":1678887830282,"integrity":"sha512-iqYbtR+3T9ugBMvNfuj11PeSpqCD2j3EKtjITmLlN1vaqVPP/yXvsKe9J+ZErhSmM3gF04RYUnNL6Z9Oj1dS7w==","mode":420,"size":539},"dist-web/index.js":{"checkedAt":1678887830300,"integrity":"sha512-2IbvNWAjF/0ArJ9eBQ7kcMJcqmDSttu+K6htj/T/Iz1CNVfZAWDMmk518QqWrdFWSjRHCMbUghLBrdgVPJt/CQ==","mode":420,"size":68909},"dist-src/generated/method-types.js":{"checkedAt":1678887829276,"integrity":"sha512-TuHIj4w/TkzTTLbAAzm/nW0Db/St469J6HHMiWa4THKdi3VJKsxkE8mmZKwApXlYIjrBPEIp2oxi6+alPk94Pw==","mode":420,"size":11},"dist-src/generated/parameters-and-response-types.js":{"checkedAt":1678887829276,"integrity":"sha512-TuHIj4w/TkzTTLbAAzm/nW0Db/St469J6HHMiWa4THKdi3VJKsxkE8mmZKwApXlYIjrBPEIp2oxi6+alPk94Pw==","mode":420,"size":11},"dist-src/types.js":{"checkedAt":1678887829276,"integrity":"sha512-TuHIj4w/TkzTTLbAAzm/nW0Db/St469J6HHMiWa4THKdi3VJKsxkE8mmZKwApXlYIjrBPEIp2oxi6+alPk94Pw==","mode":420,"size":11},"dist-src/version.js":{"checkedAt":1678887830300,"integrity":"sha512-V4qqIrzA0EbJDGcIsm2IPMopyRldgGVfbY8tPOaVRP7DGWuSDWaM7ligTbFyO4zJ2LaIy523jD3Q3m5oR4RnzQ==","mode":420,"size":32},"package.json":{"checkedAt":1678887830300,"integrity":"sha512-1ZiMkMbq2MYC74x93BW6InZQXqBSIrvqzKauoXwl0lNp63CEIp2XbkHWKWF2qRtYEvjioHN4ZnX365T3CFX5ig==","mode":420,"size":1598},"dist-node/index.js.map":{"checkedAt":1678887830336,"integrity":"sha512-bfZp2b5O2rbF6xvIGOUR0ChM28nkj3lgXWSZA4cRs2cSqyJc9AtuNEtRP1m4nQb4UPteVRXwKuOXtBuCyZaqrQ==","mode":420,"size":125112},"dist-web/index.js.map":{"checkedAt":1678887830376,"integrity":"sha512-UPAYrqYFImTO05UUmJJzSl0YGsv7sJXKGorXiKBXjWiLqvFeBNK2+Dpm0fc8WWkCx2wJJ6Y9RG3hqPD0M49aKw==","mode":420,"size":111396},"README.md":{"checkedAt":1678887830376,"integrity":"sha512-LaSUpd9tQQ2k55qElhoWe+qvxwKPeY3eR/tDSfx7ePUmARU5s+jVX73zI6qZL1wAZmgUyNyoXgj2tWn9dX+prg==","mode":420,"size":2499},"dist-types/endpoints-to-methods.d.ts":{"checkedAt":1678887830380,"integrity":"sha512-BA5bF4gGDX6YmfMYVUi3ThVDWtNyHQSBnod2348hUGBGICMom+lPKVzjaJAY3InwfsOaKWzuQK+HALf2r/i5SA==","mode":420,"size":294},"dist-types/generated/endpoints.d.ts":{"checkedAt":1678887830380,"integrity":"sha512-2xMOttFoSEj8/60LWsIjRAa7IWCdp3PVWnvwP9GPXMS2GvVvWpYycu2Qyti/6M3hMbpnVR/7YXmUrbLPKAqkJw==","mode":420,"size":144},"dist-types/index.d.ts":{"checkedAt":1678887830380,"integrity":"sha512-nXAc+ouOIH5Uxr1xkxjVPeXiaktyH42Dek8kYaYj1o99PO5BWTKKF+oGFLkOSAdGIuxboFFTVOH7NUuW3nBuGw==","mode":420,"size":467},"dist-types/generated/method-types.d.ts":{"checkedAt":1678887830554,"integrity":"sha512-7YPYXTTbmUlr0ZUHQF009s6Tv2mOkukurn8180E6vun1vf+auVGbaeNe7VIXFgsfBnh3ua0wBPwF+WiFOICTmw==","mode":420,"size":504086},"dist-types/types.d.ts":{"checkedAt":1678887830615,"integrity":"sha512-Y+6okaPI13RmnqQVhoLP2l2f3ZU4BZ/TiboBJGmfE6eaapEHeSFbJsBgONJpV0eXwUdUl4CtlkBKhbI9cZ7jZw==","mode":420,"size":548},"dist-types/version.d.ts":{"checkedAt":1678887830615,"integrity":"sha512-fmQXc8DhpHffjazfzTDpjlGkp2MgGRNpDYog104QkCcP/1B5cuxzHsJcLyr6cl5wLpGehzPI4XzbdndP6tUI6A==","mode":420,"size":40},"dist-types/generated/parameters-and-response-types.d.ts":{"checkedAt":1678887830616,"integrity":"sha512-Si3d0knIqyYqOiH9CTI5CKz3K9uespZsqC3vjZxEGiDxd+5iGDQEUdwE2ywh1Xphx0Xp00TqlmRShQ3lm2B8/A==","mode":420,"size":192354}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"windowWhen.js","sources":["../../../src/internal/operators/window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rB,OAAO;SACR;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;IAChF,CAAC;IACH,uBAAC;AAAD,CAAC,AAvED,CAAkC,eAAe,GAuEhD"}
|
||||
@@ -0,0 +1,421 @@
|
||||
# endpoint.js
|
||||
|
||||
> Turns GitHub REST API endpoints into generic request options
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/endpoint)
|
||||

|
||||
|
||||
`@octokit/endpoint` combines [GitHub REST API routes](https://developer.github.com/v3/) with your parameters and turns them into generic request options that can be used in any request library.
|
||||
|
||||
<!-- update table of contents by running `npx markdown-toc README.md -i` -->
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [API](#api)
|
||||
- [`endpoint(route, options)` or `endpoint(options)`](#endpointroute-options-or-endpointoptions)
|
||||
- [`endpoint.defaults()`](#endpointdefaults)
|
||||
- [`endpoint.DEFAULTS`](#endpointdefaults)
|
||||
- [`endpoint.merge(route, options)` or `endpoint.merge(options)`](#endpointmergeroute-options-or-endpointmergeoptions)
|
||||
- [`endpoint.parse()`](#endpointparse)
|
||||
- [Special cases](#special-cases)
|
||||
- [The `data` parameter – set request body directly](#the-data-parameter-%E2%80%93-set-request-body-directly)
|
||||
- [Set parameters for both the URL/query and the request body](#set-parameters-for-both-the-urlquery-and-the-request-body)
|
||||
- [LICENSE](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/endpoint</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { endpoint } from "https://cdn.skypack.dev/@octokit/endpoint";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/endpoint</code>
|
||||
|
||||
```js
|
||||
const { endpoint } = require("@octokit/endpoint");
|
||||
// or: import { endpoint } from "@octokit/endpoint";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Example for [List organization repositories](https://developer.github.com/v3/repos/#list-organization-repositories)
|
||||
|
||||
```js
|
||||
const requestOptions = endpoint("GET /orgs/{org}/repos", {
|
||||
headers: {
|
||||
authorization: "token 0000000000000000000000000000000000000001",
|
||||
},
|
||||
org: "octokit",
|
||||
type: "private",
|
||||
});
|
||||
```
|
||||
|
||||
The resulting `requestOptions` looks as follows
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "GET",
|
||||
"url": "https://api.github.com/orgs/octokit/repos?type=private",
|
||||
"headers": {
|
||||
"accept": "application/vnd.github.v3+json",
|
||||
"authorization": "token 0000000000000000000000000000000000000001",
|
||||
"user-agent": "octokit/endpoint.js v1.2.3"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can pass `requestOptions` to common request libraries
|
||||
|
||||
```js
|
||||
const { url, ...options } = requestOptions;
|
||||
// using with fetch (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
|
||||
fetch(url, options);
|
||||
// using with request (https://github.com/request/request)
|
||||
request(requestOptions);
|
||||
// using with got (https://github.com/sindresorhus/got)
|
||||
got[options.method](url, options);
|
||||
// using with axios
|
||||
axios(requestOptions);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `endpoint(route, options)` or `endpoint(options)`
|
||||
|
||||
<table>
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th>
|
||||
name
|
||||
</th>
|
||||
<th>
|
||||
type
|
||||
</th>
|
||||
<th width=100%>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th>
|
||||
<code>route</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
If set, it has to be a string consisting of URL and the request method, e.g., <code>GET /orgs/{org}</code>. If it’s set to a URL, only the method defaults to <code>GET</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.method</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<strong>Required unless <code>route</code> is set.</strong> Any supported <a href="https://developer.github.com/v3/#http-verbs">http verb</a>. <em>Defaults to <code>GET</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.url</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<strong>Required unless <code>route</code> is set.</strong> A path or full URL which may contain <code>:variable</code> or <code>{variable}</code> placeholders,
|
||||
e.g., <code>/orgs/{org}/repos</code>. The <code>url</code> is parsed using <a href="https://github.com/bramstein/url-template">url-template</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.baseUrl</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<em>Defaults to <code>https://api.github.com</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.headers</code>
|
||||
</th>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
<td>
|
||||
Custom headers. Passed headers are merged with defaults:<br>
|
||||
<em><code>headers['user-agent']</code> defaults to <code>octokit-endpoint.js/1.2.3</code> (where <code>1.2.3</code> is the released version)</em>.<br>
|
||||
<em><code>headers['accept']</code> defaults to <code>application/vnd.github.v3+json</code></em>.<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.mediaType.format</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
Media type param, such as <code>raw</code>, <code>diff</code>, or <code>text+json</code>. See <a href="https://developer.github.com/v3/media/">Media Types</a>. Setting <code>options.mediaType.format</code> will amend the <code>headers.accept</code> value.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.mediaType.previews</code>
|
||||
</th>
|
||||
<td>
|
||||
Array of Strings
|
||||
</td>
|
||||
<td>
|
||||
Name of previews, such as <code>mercy</code>, <code>symmetra</code>, or <code>scarlet-witch</code>. See <a href="https://developer.github.com/v3/previews/">API Previews</a>. If <code>options.mediaType.previews</code> was set as default, the new previews will be merged into the default ones. Setting <code>options.mediaType.previews</code> will amend the <code>headers.accept</code> value. <code>options.mediaType.previews</code> will be merged with an existing array set using <code>.defaults()</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.data</code>
|
||||
</th>
|
||||
<td>
|
||||
Any
|
||||
</td>
|
||||
<td>
|
||||
Set request body directly instead of setting it to JSON based on additional parameters. See <a href="#data-parameter">"The <code>data</code> parameter"</a> below.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.request</code>
|
||||
</th>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
<td>
|
||||
Pass custom meta information for the request. The <code>request</code> object will be returned as is.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
All other options will be passed depending on the `method` and `url` options.
|
||||
|
||||
1. If the option key has a placeholder in the `url`, it will be used as the replacement. For example, if the passed options are `{url: '/orgs/{org}/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos`.
|
||||
2. If the `method` is `GET` or `HEAD`, the option is passed as a query parameter.
|
||||
3. Otherwise, the parameter is passed in the request body as a JSON key.
|
||||
|
||||
**Result**
|
||||
|
||||
`endpoint()` is a synchronous method and returns an object with the following keys:
|
||||
|
||||
<table>
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th>
|
||||
key
|
||||
</th>
|
||||
<th>
|
||||
type
|
||||
</th>
|
||||
<th width=100%>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th><code>method</code></th>
|
||||
<td>String</td>
|
||||
<td>The http method. Always lowercase.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>url</code></th>
|
||||
<td>String</td>
|
||||
<td>The url with placeholders replaced with passed parameters.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>headers</code></th>
|
||||
<td>Object</td>
|
||||
<td>All header names are lowercased.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>body</code></th>
|
||||
<td>Any</td>
|
||||
<td>The request body if one is present. Only for <code>PATCH</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code> requests.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>request</code></th>
|
||||
<td>Object</td>
|
||||
<td>Request meta option, it will be returned as it was passed into <code>endpoint()</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### `endpoint.defaults()`
|
||||
|
||||
Override or set default options. Example:
|
||||
|
||||
```js
|
||||
const request = require("request");
|
||||
const myEndpoint = require("@octokit/endpoint").defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
org: "my-project",
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
request(myEndpoint(`GET /orgs/{org}/repos`));
|
||||
```
|
||||
|
||||
You can call `.defaults()` again on the returned method, the defaults will cascade.
|
||||
|
||||
```js
|
||||
const myProjectEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
},
|
||||
org: "my-project",
|
||||
});
|
||||
const myProjectEndpointWithAuth = myProjectEndpoint.defaults({
|
||||
headers: {
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
`myProjectEndpointWithAuth` now defaults the `baseUrl`, `headers['user-agent']`,
|
||||
`org` and `headers['authorization']` on top of `headers['accept']` that is set
|
||||
by the global default.
|
||||
|
||||
### `endpoint.DEFAULTS`
|
||||
|
||||
The current default options.
|
||||
|
||||
```js
|
||||
endpoint.DEFAULTS.baseUrl; // https://api.github.com
|
||||
const myEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
});
|
||||
myEndpoint.DEFAULTS.baseUrl; // https://github-enterprise.acme-inc.com/api/v3
|
||||
```
|
||||
|
||||
### `endpoint.merge(route, options)` or `endpoint.merge(options)`
|
||||
|
||||
Get the defaulted endpoint options, but without parsing them into request options:
|
||||
|
||||
```js
|
||||
const myProjectEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
},
|
||||
org: "my-project",
|
||||
});
|
||||
myProjectEndpoint.merge("GET /orgs/{org}/repos", {
|
||||
headers: {
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
org: "my-secret-project",
|
||||
type: "private",
|
||||
});
|
||||
|
||||
// {
|
||||
// baseUrl: 'https://github-enterprise.acme-inc.com/api/v3',
|
||||
// method: 'GET',
|
||||
// url: '/orgs/{org}/repos',
|
||||
// headers: {
|
||||
// accept: 'application/vnd.github.v3+json',
|
||||
// authorization: `token 0000000000000000000000000000000000000001`,
|
||||
// 'user-agent': 'myApp/1.2.3'
|
||||
// },
|
||||
// org: 'my-secret-project',
|
||||
// type: 'private'
|
||||
// }
|
||||
```
|
||||
|
||||
### `endpoint.parse()`
|
||||
|
||||
Stateless method to turn endpoint options into request options. Calling
|
||||
`endpoint(options)` is the same as calling `endpoint.parse(endpoint.merge(options))`.
|
||||
|
||||
## Special cases
|
||||
|
||||
<a name="data-parameter"></a>
|
||||
|
||||
### The `data` parameter – set request body directly
|
||||
|
||||
Some endpoints such as [Render a Markdown document in raw mode](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode) don’t have parameters that are sent as request body keys, instead, the request body needs to be set directly. In these cases, set the `data` parameter.
|
||||
|
||||
```js
|
||||
const options = endpoint("POST /markdown/raw", {
|
||||
data: "Hello world github/linguist#1 **cool**, and #1!",
|
||||
headers: {
|
||||
accept: "text/html;charset=utf-8",
|
||||
"content-type": "text/plain",
|
||||
},
|
||||
});
|
||||
|
||||
// options is
|
||||
// {
|
||||
// method: 'post',
|
||||
// url: 'https://api.github.com/markdown/raw',
|
||||
// headers: {
|
||||
// accept: 'text/html;charset=utf-8',
|
||||
// 'content-type': 'text/plain',
|
||||
// 'user-agent': userAgent
|
||||
// },
|
||||
// body: 'Hello world github/linguist#1 **cool**, and #1!'
|
||||
// }
|
||||
```
|
||||
|
||||
### Set parameters for both the URL/query and the request body
|
||||
|
||||
There are API endpoints that accept both query parameters as well as a body. In that case, you need to add the query parameters as templates to `options.url`, as defined in the [RFC 6570 URI Template specification](https://tools.ietf.org/html/rfc6570).
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
endpoint(
|
||||
"POST https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
|
||||
{
|
||||
name: "example.zip",
|
||||
label: "short description",
|
||||
headers: {
|
||||
"content-type": "text/plain",
|
||||
"content-length": 14,
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
data: "Hello, world!",
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/concat';
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/observable/IntervalObservable';
|
||||
@@ -0,0 +1,123 @@
|
||||
const { cosmiconfigSync } = require('cosmiconfig');
|
||||
const parseJson = require('parse-json');
|
||||
const parseToml = require('@iarna/toml/parse-string');
|
||||
const yaml = require('yaml');
|
||||
const _ = require('lodash');
|
||||
const isCI = require('is-ci');
|
||||
const debug = require('debug')('release-it:config');
|
||||
const defaultConfig = require('../config/release-it.json');
|
||||
const { getSystemInfo } = require('./util');
|
||||
|
||||
const searchPlaces = [
|
||||
'package.json',
|
||||
'.release-it.json',
|
||||
'.release-it.js',
|
||||
'.release-it.cjs',
|
||||
'.release-it.yaml',
|
||||
'.release-it.yml',
|
||||
'.release-it.toml'
|
||||
];
|
||||
|
||||
const loaders = {
|
||||
'.json': (_, content) => parseJson(content),
|
||||
'.toml': (_, content) => parseToml(content),
|
||||
'.yaml': (_, content) => yaml.parse(content)
|
||||
};
|
||||
|
||||
const getLocalConfig = localConfigFile => {
|
||||
let localConfig = {};
|
||||
if (localConfigFile === false) return localConfig;
|
||||
const explorer = cosmiconfigSync('release-it', {
|
||||
searchPlaces,
|
||||
loaders
|
||||
});
|
||||
const result = localConfigFile ? explorer.load(localConfigFile) : explorer.search();
|
||||
if (result && typeof result.config === 'string') {
|
||||
throw new Error(`Invalid configuration file at ${result.filepath}`);
|
||||
}
|
||||
debug({ cosmiconfig: result });
|
||||
return result && _.isPlainObject(result.config) ? result.config : localConfig;
|
||||
};
|
||||
|
||||
class Config {
|
||||
constructor(config = {}) {
|
||||
this.constructorConfig = config;
|
||||
this.localConfig = getLocalConfig(config.config);
|
||||
this.options = this.mergeOptions();
|
||||
this.options = this.expandPreReleaseShorthand(this.options);
|
||||
this.contextOptions = {};
|
||||
debug({ system: getSystemInfo() });
|
||||
debug(this.options);
|
||||
}
|
||||
|
||||
expandPreReleaseShorthand(options) {
|
||||
const { increment, preRelease, preReleaseId } = options;
|
||||
options.isUpdate = increment === false;
|
||||
options.version = {
|
||||
increment,
|
||||
isPreRelease: Boolean(preRelease),
|
||||
preReleaseId: typeof preRelease === 'string' ? preRelease : preReleaseId
|
||||
};
|
||||
return options;
|
||||
}
|
||||
|
||||
mergeOptions() {
|
||||
return _.defaultsDeep(
|
||||
{},
|
||||
this.constructorConfig,
|
||||
{
|
||||
ci: isCI
|
||||
},
|
||||
this.localConfig,
|
||||
this.defaultConfig
|
||||
);
|
||||
}
|
||||
|
||||
getContext(path) {
|
||||
const context = _.merge({}, this.options, this.contextOptions);
|
||||
return path ? _.get(context, path) : context;
|
||||
}
|
||||
|
||||
setContext(options) {
|
||||
debug(options);
|
||||
_.merge(this.contextOptions, options);
|
||||
}
|
||||
|
||||
setCI(value = true) {
|
||||
this.options.ci = value;
|
||||
}
|
||||
|
||||
get defaultConfig() {
|
||||
return defaultConfig;
|
||||
}
|
||||
|
||||
get isDryRun() {
|
||||
return Boolean(this.options['dry-run']);
|
||||
}
|
||||
|
||||
get isVerbose() {
|
||||
return Boolean(this.options.verbose);
|
||||
}
|
||||
|
||||
get verbosityLevel() {
|
||||
return this.options.verbose;
|
||||
}
|
||||
|
||||
get isDebug() {
|
||||
return debug.enabled;
|
||||
}
|
||||
|
||||
get isCI() {
|
||||
return Boolean(this.options.ci);
|
||||
}
|
||||
|
||||
get isPromptOnlyVersion() {
|
||||
return this.options['only-version'];
|
||||
}
|
||||
|
||||
get isCollectMetrics() {
|
||||
return !this.options['disable-metrics'];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Config;
|
||||
@@ -0,0 +1,29 @@
|
||||
export interface UnsubscriptionError extends Error {
|
||||
readonly errors: any[];
|
||||
}
|
||||
|
||||
export interface UnsubscriptionErrorCtor {
|
||||
new(errors: any[]): UnsubscriptionError;
|
||||
}
|
||||
|
||||
const UnsubscriptionErrorImpl = (() => {
|
||||
function UnsubscriptionErrorImpl(this: any, errors: any[]) {
|
||||
Error.call(this);
|
||||
this.message = errors ?
|
||||
`${errors.length} errors occurred during unsubscription:
|
||||
${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
|
||||
this.name = 'UnsubscriptionError';
|
||||
this.errors = errors;
|
||||
return this;
|
||||
}
|
||||
|
||||
UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
|
||||
|
||||
return UnsubscriptionErrorImpl;
|
||||
})();
|
||||
|
||||
/**
|
||||
* An error thrown when one or more errors have occurred during the
|
||||
* `unsubscribe` of a {@link Subscription}.
|
||||
*/
|
||||
export const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"skipLast.js","sources":["../src/operators/skipLast.ts"],"names":[],"mappings":";;;;;AAAA,oDAA+C"}
|
||||
Reference in New Issue
Block a user