mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-28 14:16:02 +00:00
node_modules
This commit is contained in:
parent
5e3f23f92c
commit
806116bda4
734 changed files with 224451 additions and 0 deletions
1
node_modules/.bin/mime
generated
vendored
Symbolic link
1
node_modules/.bin/mime
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../mime/cli.js
|
1
node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/.bin/semver
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../semver/bin/semver
|
1
node_modules/.bin/which
generated
vendored
Symbolic link
1
node_modules/.bin/which
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../which/bin/which
|
519
node_modules/.package-lock.json
generated
vendored
Normal file
519
node_modules/.package-lock.json
generated
vendored
Normal file
|
@ -0,0 +1,519 @@
|
||||||
|
{
|
||||||
|
"name": "action-gh-release",
|
||||||
|
"version": "0.1.5",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"node_modules/@actions/core": {
|
||||||
|
"version": "1.2.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
|
||||||
|
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
|
||||||
|
},
|
||||||
|
"node_modules/@actions/github": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/github/-/github-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-sNpZ5dJyJyfJIO5lNYx8r/Gha4Tlm8R0MLO2cBkGdOnAAEn3t1M/MHVcoBhY/VPfjGVe5RNAUPz+6INrViiUPA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/graphql": "^4.3.1",
|
||||||
|
"@octokit/rest": "^16.15.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/endpoint": {
|
||||||
|
"version": "5.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.1.tgz",
|
||||||
|
"integrity": "sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": "^2.0.0",
|
||||||
|
"is-plain-object": "^3.0.0",
|
||||||
|
"universal-user-agent": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/endpoint/node_modules/is-plain-object": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==",
|
||||||
|
"dependencies": {
|
||||||
|
"isobject": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/endpoint/node_modules/isobject": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/graphql": {
|
||||||
|
"version": "4.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.3.1.tgz",
|
||||||
|
"integrity": "sha512-hCdTjfvrK+ilU2keAdqNBWOk+gm1kai1ZcdjRfB30oA3/T6n53UVJb7w0L5cR3/rhU91xT3HSqCd+qbvH06yxA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/request": "^5.3.0",
|
||||||
|
"@octokit/types": "^2.0.0",
|
||||||
|
"universal-user-agent": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/plugin-retry": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-k7xl2WLfLP7WirRXRHtCq5xGAIXBZHV9X3HVUJhPwe8/N8vVzxPcnnnBL5NpEep/+GQqFRdYxrkgz68VY3z2wA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": "^4.0.1",
|
||||||
|
"bottleneck": "^2.15.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/plugin-retry/node_modules/@octokit/types": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-Ho6h7w2h9y8RRE8r656hIj1oiSbwbIHJGF5r9G5FOwS2VdDPq8QLGvsG4x6pKHpvyGK7j+43sAc2cJKMiFoIJw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/plugin-throttling": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-3.2.1.tgz",
|
||||||
|
"integrity": "sha512-CGr3IagYZLLV3pFgpTQUthQSS5K3BkHLlG8yXK+Op3UKBkYrTf+Y9pCebrDxt60d+VTQ1oxXCx+LVLYY3IhBZQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": "^4.0.1",
|
||||||
|
"bottleneck": "^2.15.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/plugin-throttling/node_modules/@octokit/types": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-Ho6h7w2h9y8RRE8r656hIj1oiSbwbIHJGF5r9G5FOwS2VdDPq8QLGvsG4x6pKHpvyGK7j+43sAc2cJKMiFoIJw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/request": {
|
||||||
|
"version": "5.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.1.tgz",
|
||||||
|
"integrity": "sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/endpoint": "^5.5.0",
|
||||||
|
"@octokit/request-error": "^1.0.1",
|
||||||
|
"@octokit/types": "^2.0.0",
|
||||||
|
"deprecation": "^2.0.0",
|
||||||
|
"is-plain-object": "^3.0.0",
|
||||||
|
"node-fetch": "^2.3.0",
|
||||||
|
"once": "^1.4.0",
|
||||||
|
"universal-user-agent": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/request-error": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-DNBhROBYjjV/I9n7A8kVkmQNkqFAMem90dSxqvPq57e2hBr7mNTX98y3R2zDpqMQHVRpBDjsvsfIGgBzy+4PAg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": "^2.0.0",
|
||||||
|
"deprecation": "^2.0.0",
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/request/node_modules/is-plain-object": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==",
|
||||||
|
"dependencies": {
|
||||||
|
"isobject": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/request/node_modules/isobject": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/rest": {
|
||||||
|
"version": "16.36.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.36.0.tgz",
|
||||||
|
"integrity": "sha512-zoZj7Ya4vWBK4fjTwK2Cnmu7XBB1p9ygSvTk2TthN6DVJXM4hQZQoAiknWFLJWSTix4dnA3vuHtjPZbExYoCZA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/request": "^5.2.0",
|
||||||
|
"@octokit/request-error": "^1.0.2",
|
||||||
|
"atob-lite": "^2.0.0",
|
||||||
|
"before-after-hook": "^2.0.0",
|
||||||
|
"btoa-lite": "^1.0.0",
|
||||||
|
"deprecation": "^2.0.0",
|
||||||
|
"lodash.get": "^4.4.2",
|
||||||
|
"lodash.set": "^4.3.2",
|
||||||
|
"lodash.uniq": "^4.5.0",
|
||||||
|
"octokit-pagination-methods": "^1.1.0",
|
||||||
|
"once": "^1.4.0",
|
||||||
|
"universal-user-agent": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@octokit/types": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "12.12.24",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.24.tgz",
|
||||||
|
"integrity": "sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug=="
|
||||||
|
},
|
||||||
|
"node_modules/atob-lite": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY="
|
||||||
|
},
|
||||||
|
"node_modules/balanced-match": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
|
},
|
||||||
|
"node_modules/before-after-hook": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A=="
|
||||||
|
},
|
||||||
|
"node_modules/bottleneck": {
|
||||||
|
"version": "2.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
||||||
|
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
|
||||||
|
},
|
||||||
|
"node_modules/brace-expansion": {
|
||||||
|
"version": "1.1.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/btoa-lite": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc="
|
||||||
|
},
|
||||||
|
"node_modules/concat-map": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
|
},
|
||||||
|
"node_modules/cross-spawn": {
|
||||||
|
"version": "6.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||||
|
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"nice-try": "^1.0.4",
|
||||||
|
"path-key": "^2.0.1",
|
||||||
|
"semver": "^5.5.0",
|
||||||
|
"shebang-command": "^1.2.0",
|
||||||
|
"which": "^1.2.9"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/deprecation": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
|
||||||
|
},
|
||||||
|
"node_modules/end-of-stream": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/execa": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
|
||||||
|
"dependencies": {
|
||||||
|
"cross-spawn": "^6.0.0",
|
||||||
|
"get-stream": "^4.0.0",
|
||||||
|
"is-stream": "^1.1.0",
|
||||||
|
"npm-run-path": "^2.0.0",
|
||||||
|
"p-finally": "^1.0.0",
|
||||||
|
"signal-exit": "^3.0.0",
|
||||||
|
"strip-eof": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fs.realpath": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
|
},
|
||||||
|
"node_modules/get-stream": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||||
|
"dependencies": {
|
||||||
|
"pump": "^3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/glob": {
|
||||||
|
"version": "7.1.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||||
|
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
|
||||||
|
"dependencies": {
|
||||||
|
"fs.realpath": "^1.0.0",
|
||||||
|
"inflight": "^1.0.4",
|
||||||
|
"inherits": "2",
|
||||||
|
"minimatch": "^3.0.4",
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"path-is-absolute": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/inflight": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
|
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||||
|
"dependencies": {
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/inherits": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
|
},
|
||||||
|
"node_modules/is-stream": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/isexe": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
|
},
|
||||||
|
"node_modules/lodash.get": {
|
||||||
|
"version": "4.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
|
||||||
|
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
|
||||||
|
},
|
||||||
|
"node_modules/lodash.set": {
|
||||||
|
"version": "4.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz",
|
||||||
|
"integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM="
|
||||||
|
},
|
||||||
|
"node_modules/lodash.uniq": {
|
||||||
|
"version": "4.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
|
||||||
|
"integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M="
|
||||||
|
},
|
||||||
|
"node_modules/macos-release": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime": {
|
||||||
|
"version": "2.4.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz",
|
||||||
|
"integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==",
|
||||||
|
"bin": {
|
||||||
|
"mime": "cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/minimatch": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": "^1.1.7"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/nice-try": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
||||||
|
},
|
||||||
|
"node_modules/node-fetch": {
|
||||||
|
"version": "2.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||||
|
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
||||||
|
"engines": {
|
||||||
|
"node": "4.x || >=6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/npm-run-path": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||||
|
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
|
||||||
|
"dependencies": {
|
||||||
|
"path-key": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/octokit-pagination-methods": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ=="
|
||||||
|
},
|
||||||
|
"node_modules/once": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
|
"dependencies": {
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/os-name": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==",
|
||||||
|
"dependencies": {
|
||||||
|
"macos-release": "^2.2.0",
|
||||||
|
"windows-release": "^3.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-finally": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-is-absolute": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-key": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||||
|
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pump": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||||
|
"dependencies": {
|
||||||
|
"end-of-stream": "^1.1.0",
|
||||||
|
"once": "^1.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/semver": {
|
||||||
|
"version": "5.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||||
|
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||||
|
"bin": {
|
||||||
|
"semver": "bin/semver"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/shebang-command": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||||
|
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||||
|
"dependencies": {
|
||||||
|
"shebang-regex": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/shebang-regex": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/signal-exit": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||||
|
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||||
|
},
|
||||||
|
"node_modules/strip-eof": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/universal-user-agent": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==",
|
||||||
|
"dependencies": {
|
||||||
|
"os-name": "^3.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/which": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"which": "bin/which"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/windows-release": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==",
|
||||||
|
"dependencies": {
|
||||||
|
"execa": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
node_modules/@actions/core/LICENSE.md
generated
vendored
Normal file
9
node_modules/@actions/core/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright 2019 GitHub
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
147
node_modules/@actions/core/README.md
generated
vendored
Normal file
147
node_modules/@actions/core/README.md
generated
vendored
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
# `@actions/core`
|
||||||
|
|
||||||
|
> Core functions for setting results, logging, registering secrets and exporting variables across actions
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Import the package
|
||||||
|
|
||||||
|
```js
|
||||||
|
// javascript
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
// typescript
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Inputs/Outputs
|
||||||
|
|
||||||
|
Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const myInput = core.getInput('inputName', { required: true });
|
||||||
|
|
||||||
|
core.setOutput('outputKey', 'outputVal');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Exporting variables
|
||||||
|
|
||||||
|
Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks.
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.exportVariable('envVar', 'Val');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Setting a secret
|
||||||
|
|
||||||
|
Setting a secret registers the secret with the runner to ensure it is masked in logs.
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.setSecret('myPassword');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PATH Manipulation
|
||||||
|
|
||||||
|
To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH.
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.addPath('/path/to/mytool');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Exit codes
|
||||||
|
|
||||||
|
You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Do stuff
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// setFailed logs the message and sets a failing exit code
|
||||||
|
core.setFailed(`Action failed with error ${err}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Logging
|
||||||
|
|
||||||
|
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
const myInput = core.getInput('input');
|
||||||
|
try {
|
||||||
|
core.debug('Inside try block');
|
||||||
|
|
||||||
|
if (!myInput) {
|
||||||
|
core.warning('myInput was not set');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (core.isDebug()) {
|
||||||
|
// curl -v https://github.com
|
||||||
|
} else {
|
||||||
|
// curl https://github.com
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do stuff
|
||||||
|
core.info('Output to the actions build log')
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
core.error(`Error ${err}, action may still succeed though`);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This library can also wrap chunks of output in foldable groups.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core')
|
||||||
|
|
||||||
|
// Manually wrap output
|
||||||
|
core.startGroup('Do some function')
|
||||||
|
doSomeFunction()
|
||||||
|
core.endGroup()
|
||||||
|
|
||||||
|
// Wrap an asynchronous function call
|
||||||
|
const result = await core.group('Do something async', async () => {
|
||||||
|
const response = await doSomeHTTPRequest()
|
||||||
|
return response
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Action state
|
||||||
|
|
||||||
|
You can use this library to save state and get state for sharing information between a given wrapper action:
|
||||||
|
|
||||||
|
**action.yml**
|
||||||
|
```yaml
|
||||||
|
name: 'Wrapper action sample'
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
default: 'GitHub'
|
||||||
|
runs:
|
||||||
|
using: 'node12'
|
||||||
|
main: 'main.js'
|
||||||
|
post: 'cleanup.js'
|
||||||
|
```
|
||||||
|
|
||||||
|
In action's `main.js`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
core.saveState("pidToKill", 12345);
|
||||||
|
```
|
||||||
|
|
||||||
|
In action's `cleanup.js`:
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
var pid = core.getState("pidToKill");
|
||||||
|
|
||||||
|
process.kill(pid);
|
||||||
|
```
|
16
node_modules/@actions/core/lib/command.d.ts
generated
vendored
Normal file
16
node_modules/@actions/core/lib/command.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
interface CommandProperties {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Commands
|
||||||
|
*
|
||||||
|
* Command Format:
|
||||||
|
* ::name key=value,key=value::message
|
||||||
|
*
|
||||||
|
* Examples:
|
||||||
|
* ::warning::This is the message
|
||||||
|
* ::set-env name=MY_VAR::some value
|
||||||
|
*/
|
||||||
|
export declare function issueCommand(command: string, properties: CommandProperties, message: any): void;
|
||||||
|
export declare function issue(name: string, message?: string): void;
|
||||||
|
export {};
|
79
node_modules/@actions/core/lib/command.js
generated
vendored
Normal file
79
node_modules/@actions/core/lib/command.js
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
"use strict";
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const os = __importStar(require("os"));
|
||||||
|
const utils_1 = require("./utils");
|
||||||
|
/**
|
||||||
|
* Commands
|
||||||
|
*
|
||||||
|
* Command Format:
|
||||||
|
* ::name key=value,key=value::message
|
||||||
|
*
|
||||||
|
* Examples:
|
||||||
|
* ::warning::This is the message
|
||||||
|
* ::set-env name=MY_VAR::some value
|
||||||
|
*/
|
||||||
|
function issueCommand(command, properties, message) {
|
||||||
|
const cmd = new Command(command, properties, message);
|
||||||
|
process.stdout.write(cmd.toString() + os.EOL);
|
||||||
|
}
|
||||||
|
exports.issueCommand = issueCommand;
|
||||||
|
function issue(name, message = '') {
|
||||||
|
issueCommand(name, {}, message);
|
||||||
|
}
|
||||||
|
exports.issue = issue;
|
||||||
|
const CMD_STRING = '::';
|
||||||
|
class Command {
|
||||||
|
constructor(command, properties, message) {
|
||||||
|
if (!command) {
|
||||||
|
command = 'missing.command';
|
||||||
|
}
|
||||||
|
this.command = command;
|
||||||
|
this.properties = properties;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
toString() {
|
||||||
|
let cmdStr = CMD_STRING + this.command;
|
||||||
|
if (this.properties && Object.keys(this.properties).length > 0) {
|
||||||
|
cmdStr += ' ';
|
||||||
|
let first = true;
|
||||||
|
for (const key in this.properties) {
|
||||||
|
if (this.properties.hasOwnProperty(key)) {
|
||||||
|
const val = this.properties[key];
|
||||||
|
if (val) {
|
||||||
|
if (first) {
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cmdStr += ',';
|
||||||
|
}
|
||||||
|
cmdStr += `${key}=${escapeProperty(val)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
|
||||||
|
return cmdStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function escapeData(s) {
|
||||||
|
return utils_1.toCommandValue(s)
|
||||||
|
.replace(/%/g, '%25')
|
||||||
|
.replace(/\r/g, '%0D')
|
||||||
|
.replace(/\n/g, '%0A');
|
||||||
|
}
|
||||||
|
function escapeProperty(s) {
|
||||||
|
return utils_1.toCommandValue(s)
|
||||||
|
.replace(/%/g, '%25')
|
||||||
|
.replace(/\r/g, '%0D')
|
||||||
|
.replace(/\n/g, '%0A')
|
||||||
|
.replace(/:/g, '%3A')
|
||||||
|
.replace(/,/g, '%2C');
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=command.js.map
|
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AACxB,mCAAsC;AAWtC;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
122
node_modules/@actions/core/lib/core.d.ts
generated
vendored
Normal file
122
node_modules/@actions/core/lib/core.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
/**
|
||||||
|
* Interface for getInput options
|
||||||
|
*/
|
||||||
|
export interface InputOptions {
|
||||||
|
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
||||||
|
required?: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The code to exit an action
|
||||||
|
*/
|
||||||
|
export declare enum ExitCode {
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was successful
|
||||||
|
*/
|
||||||
|
Success = 0,
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was a failure
|
||||||
|
*/
|
||||||
|
Failure = 1
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Sets env variable for this action and future actions in the job
|
||||||
|
* @param name the name of the variable to set
|
||||||
|
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
||||||
|
*/
|
||||||
|
export declare function exportVariable(name: string, val: any): void;
|
||||||
|
/**
|
||||||
|
* Registers a secret which will get masked from logs
|
||||||
|
* @param secret value of the secret
|
||||||
|
*/
|
||||||
|
export declare function setSecret(secret: string): void;
|
||||||
|
/**
|
||||||
|
* Prepends inputPath to the PATH (for this action and future actions)
|
||||||
|
* @param inputPath
|
||||||
|
*/
|
||||||
|
export declare function addPath(inputPath: string): void;
|
||||||
|
/**
|
||||||
|
* Gets the value of an input. The value is also trimmed.
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
export declare function getInput(name: string, options?: InputOptions): string;
|
||||||
|
/**
|
||||||
|
* Sets the value of an output.
|
||||||
|
*
|
||||||
|
* @param name name of the output to set
|
||||||
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
|
*/
|
||||||
|
export declare function setOutput(name: string, value: any): void;
|
||||||
|
/**
|
||||||
|
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
||||||
|
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export declare function setCommandEcho(enabled: boolean): void;
|
||||||
|
/**
|
||||||
|
* Sets the action status to failed.
|
||||||
|
* When the action exits it will be with an exit code of 1
|
||||||
|
* @param message add error issue message
|
||||||
|
*/
|
||||||
|
export declare function setFailed(message: string | Error): void;
|
||||||
|
/**
|
||||||
|
* Gets whether Actions Step Debug is on or not
|
||||||
|
*/
|
||||||
|
export declare function isDebug(): boolean;
|
||||||
|
/**
|
||||||
|
* Writes debug message to user log
|
||||||
|
* @param message debug message
|
||||||
|
*/
|
||||||
|
export declare function debug(message: string): void;
|
||||||
|
/**
|
||||||
|
* Adds an error issue
|
||||||
|
* @param message error issue message. Errors will be converted to string via toString()
|
||||||
|
*/
|
||||||
|
export declare function error(message: string | Error): void;
|
||||||
|
/**
|
||||||
|
* Adds an warning issue
|
||||||
|
* @param message warning issue message. Errors will be converted to string via toString()
|
||||||
|
*/
|
||||||
|
export declare function warning(message: string | Error): void;
|
||||||
|
/**
|
||||||
|
* Writes info to log with console.log.
|
||||||
|
* @param message info message
|
||||||
|
*/
|
||||||
|
export declare function info(message: string): void;
|
||||||
|
/**
|
||||||
|
* Begin an output group.
|
||||||
|
*
|
||||||
|
* Output until the next `groupEnd` will be foldable in this group
|
||||||
|
*
|
||||||
|
* @param name The name of the output group
|
||||||
|
*/
|
||||||
|
export declare function startGroup(name: string): void;
|
||||||
|
/**
|
||||||
|
* End an output group.
|
||||||
|
*/
|
||||||
|
export declare function endGroup(): void;
|
||||||
|
/**
|
||||||
|
* Wrap an asynchronous function call in a group.
|
||||||
|
*
|
||||||
|
* Returns the same type as the function itself.
|
||||||
|
*
|
||||||
|
* @param name The name of the group
|
||||||
|
* @param fn The function to wrap in the group
|
||||||
|
*/
|
||||||
|
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
||||||
|
/**
|
||||||
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to store
|
||||||
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
|
*/
|
||||||
|
export declare function saveState(name: string, value: any): void;
|
||||||
|
/**
|
||||||
|
* Gets the value of an state set by this action's main execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to get
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
export declare function getState(name: string): string;
|
238
node_modules/@actions/core/lib/core.js
generated
vendored
Normal file
238
node_modules/@actions/core/lib/core.js
generated
vendored
Normal file
|
@ -0,0 +1,238 @@
|
||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const command_1 = require("./command");
|
||||||
|
const file_command_1 = require("./file-command");
|
||||||
|
const utils_1 = require("./utils");
|
||||||
|
const os = __importStar(require("os"));
|
||||||
|
const path = __importStar(require("path"));
|
||||||
|
/**
|
||||||
|
* The code to exit an action
|
||||||
|
*/
|
||||||
|
var ExitCode;
|
||||||
|
(function (ExitCode) {
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was successful
|
||||||
|
*/
|
||||||
|
ExitCode[ExitCode["Success"] = 0] = "Success";
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was a failure
|
||||||
|
*/
|
||||||
|
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
||||||
|
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Variables
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Sets env variable for this action and future actions in the job
|
||||||
|
* @param name the name of the variable to set
|
||||||
|
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
||||||
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
function exportVariable(name, val) {
|
||||||
|
const convertedVal = utils_1.toCommandValue(val);
|
||||||
|
process.env[name] = convertedVal;
|
||||||
|
const filePath = process.env['GITHUB_ENV'] || '';
|
||||||
|
if (filePath) {
|
||||||
|
const delimiter = '_GitHubActionsFileCommandDelimeter_';
|
||||||
|
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
|
||||||
|
file_command_1.issueCommand('ENV', commandValue);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
command_1.issueCommand('set-env', { name }, convertedVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.exportVariable = exportVariable;
|
||||||
|
/**
|
||||||
|
* Registers a secret which will get masked from logs
|
||||||
|
* @param secret value of the secret
|
||||||
|
*/
|
||||||
|
function setSecret(secret) {
|
||||||
|
command_1.issueCommand('add-mask', {}, secret);
|
||||||
|
}
|
||||||
|
exports.setSecret = setSecret;
|
||||||
|
/**
|
||||||
|
* Prepends inputPath to the PATH (for this action and future actions)
|
||||||
|
* @param inputPath
|
||||||
|
*/
|
||||||
|
function addPath(inputPath) {
|
||||||
|
const filePath = process.env['GITHUB_PATH'] || '';
|
||||||
|
if (filePath) {
|
||||||
|
file_command_1.issueCommand('PATH', inputPath);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
command_1.issueCommand('add-path', {}, inputPath);
|
||||||
|
}
|
||||||
|
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
||||||
|
}
|
||||||
|
exports.addPath = addPath;
|
||||||
|
/**
|
||||||
|
* Gets the value of an input. The value is also trimmed.
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
function getInput(name, options) {
|
||||||
|
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
||||||
|
if (options && options.required && !val) {
|
||||||
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
|
}
|
||||||
|
return val.trim();
|
||||||
|
}
|
||||||
|
exports.getInput = getInput;
|
||||||
|
/**
|
||||||
|
* Sets the value of an output.
|
||||||
|
*
|
||||||
|
* @param name name of the output to set
|
||||||
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
function setOutput(name, value) {
|
||||||
|
command_1.issueCommand('set-output', { name }, value);
|
||||||
|
}
|
||||||
|
exports.setOutput = setOutput;
|
||||||
|
/**
|
||||||
|
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
||||||
|
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function setCommandEcho(enabled) {
|
||||||
|
command_1.issue('echo', enabled ? 'on' : 'off');
|
||||||
|
}
|
||||||
|
exports.setCommandEcho = setCommandEcho;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Results
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Sets the action status to failed.
|
||||||
|
* When the action exits it will be with an exit code of 1
|
||||||
|
* @param message add error issue message
|
||||||
|
*/
|
||||||
|
function setFailed(message) {
|
||||||
|
process.exitCode = ExitCode.Failure;
|
||||||
|
error(message);
|
||||||
|
}
|
||||||
|
exports.setFailed = setFailed;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Logging Commands
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Gets whether Actions Step Debug is on or not
|
||||||
|
*/
|
||||||
|
function isDebug() {
|
||||||
|
return process.env['RUNNER_DEBUG'] === '1';
|
||||||
|
}
|
||||||
|
exports.isDebug = isDebug;
|
||||||
|
/**
|
||||||
|
* Writes debug message to user log
|
||||||
|
* @param message debug message
|
||||||
|
*/
|
||||||
|
function debug(message) {
|
||||||
|
command_1.issueCommand('debug', {}, message);
|
||||||
|
}
|
||||||
|
exports.debug = debug;
|
||||||
|
/**
|
||||||
|
* Adds an error issue
|
||||||
|
* @param message error issue message. Errors will be converted to string via toString()
|
||||||
|
*/
|
||||||
|
function error(message) {
|
||||||
|
command_1.issue('error', message instanceof Error ? message.toString() : message);
|
||||||
|
}
|
||||||
|
exports.error = error;
|
||||||
|
/**
|
||||||
|
* Adds an warning issue
|
||||||
|
* @param message warning issue message. Errors will be converted to string via toString()
|
||||||
|
*/
|
||||||
|
function warning(message) {
|
||||||
|
command_1.issue('warning', message instanceof Error ? message.toString() : message);
|
||||||
|
}
|
||||||
|
exports.warning = warning;
|
||||||
|
/**
|
||||||
|
* Writes info to log with console.log.
|
||||||
|
* @param message info message
|
||||||
|
*/
|
||||||
|
function info(message) {
|
||||||
|
process.stdout.write(message + os.EOL);
|
||||||
|
}
|
||||||
|
exports.info = info;
|
||||||
|
/**
|
||||||
|
* Begin an output group.
|
||||||
|
*
|
||||||
|
* Output until the next `groupEnd` will be foldable in this group
|
||||||
|
*
|
||||||
|
* @param name The name of the output group
|
||||||
|
*/
|
||||||
|
function startGroup(name) {
|
||||||
|
command_1.issue('group', name);
|
||||||
|
}
|
||||||
|
exports.startGroup = startGroup;
|
||||||
|
/**
|
||||||
|
* End an output group.
|
||||||
|
*/
|
||||||
|
function endGroup() {
|
||||||
|
command_1.issue('endgroup');
|
||||||
|
}
|
||||||
|
exports.endGroup = endGroup;
|
||||||
|
/**
|
||||||
|
* Wrap an asynchronous function call in a group.
|
||||||
|
*
|
||||||
|
* Returns the same type as the function itself.
|
||||||
|
*
|
||||||
|
* @param name The name of the group
|
||||||
|
* @param fn The function to wrap in the group
|
||||||
|
*/
|
||||||
|
function group(name, fn) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
startGroup(name);
|
||||||
|
let result;
|
||||||
|
try {
|
||||||
|
result = yield fn();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
endGroup();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.group = group;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Wrapper action state
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to store
|
||||||
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
||||||
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
function saveState(name, value) {
|
||||||
|
command_1.issueCommand('save-state', { name }, value);
|
||||||
|
}
|
||||||
|
exports.saveState = saveState;
|
||||||
|
/**
|
||||||
|
* Gets the value of an state set by this action's main execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to get
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
function getState(name) {
|
||||||
|
return process.env[`STATE_${name}`] || '';
|
||||||
|
}
|
||||||
|
exports.getState = getState;
|
||||||
|
//# sourceMappingURL=core.js.map
|
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAC7C,iDAA+D;AAC/D,mCAAsC;AAEtC,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,8DAA8D;AAC9D,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAQ;IACnD,MAAM,YAAY,GAAG,sBAAc,CAAC,GAAG,CAAC,CAAA;IACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAA;IAEhC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;IAChD,IAAI,QAAQ,EAAE;QACZ,MAAM,SAAS,GAAG,qCAAqC,CAAA;QACvD,MAAM,YAAY,GAAG,GAAG,IAAI,KAAK,SAAS,GAAG,EAAE,CAAC,GAAG,GAAG,YAAY,GAAG,EAAE,CAAC,GAAG,GAAG,SAAS,EAAE,CAAA;QACzF,2BAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;KACtC;SAAM;QACL,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,YAAY,CAAC,CAAA;KAC9C;AACH,CAAC;AAZD,wCAYC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;IACjD,IAAI,QAAQ,EAAE;QACZ,2BAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;KACpC;SAAM;QACL,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;KACxC;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AARD,0BAQC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAgB;IAC7C,eAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AACvC,CAAC;AAFD,wCAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAuB;IAC/C,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IAEnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAJD,8BAIC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAA;AAC5C,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAuB;IAC3C,eAAK,CAAC,OAAO,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AACzE,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAuB;IAC7C,eAAK,CAAC,SAAS,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AAC3E,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}
|
1
node_modules/@actions/core/lib/file-command.d.ts
generated
vendored
Normal file
1
node_modules/@actions/core/lib/file-command.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export declare function issueCommand(command: string, message: any): void;
|
29
node_modules/@actions/core/lib/file-command.js
generated
vendored
Normal file
29
node_modules/@actions/core/lib/file-command.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"use strict";
|
||||||
|
// For internal use, subject to change.
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
// We use any as a valid input type
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
const fs = __importStar(require("fs"));
|
||||||
|
const os = __importStar(require("os"));
|
||||||
|
const utils_1 = require("./utils");
|
||||||
|
function issueCommand(command, message) {
|
||||||
|
const filePath = process.env[`GITHUB_${command}`];
|
||||||
|
if (!filePath) {
|
||||||
|
throw new Error(`Unable to find environment variable for file command ${command}`);
|
||||||
|
}
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
throw new Error(`Missing file at path: ${filePath}`);
|
||||||
|
}
|
||||||
|
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
|
||||||
|
encoding: 'utf8'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.issueCommand = issueCommand;
|
||||||
|
//# sourceMappingURL=file-command.js.map
|
1
node_modules/@actions/core/lib/file-command.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/file-command.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,uCAAwB;AACxB,uCAAwB;AACxB,mCAAsC;AAEtC,SAAgB,YAAY,CAAC,OAAe,EAAE,OAAY;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;KACF;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;KACrD;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,sBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAdD,oCAcC"}
|
5
node_modules/@actions/core/lib/utils.d.ts
generated
vendored
Normal file
5
node_modules/@actions/core/lib/utils.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
/**
|
||||||
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||||
|
* @param input input to sanitize into a string
|
||||||
|
*/
|
||||||
|
export declare function toCommandValue(input: any): string;
|
19
node_modules/@actions/core/lib/utils.js
generated
vendored
Normal file
19
node_modules/@actions/core/lib/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
"use strict";
|
||||||
|
// We use any as a valid input type
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
/**
|
||||||
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||||
|
* @param input input to sanitize into a string
|
||||||
|
*/
|
||||||
|
function toCommandValue(input) {
|
||||||
|
if (input === null || input === undefined) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
else if (typeof input === 'string' || input instanceof String) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
return JSON.stringify(input);
|
||||||
|
}
|
||||||
|
exports.toCommandValue = toCommandValue;
|
||||||
|
//# sourceMappingURL=utils.js.map
|
1
node_modules/@actions/core/lib/utils.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/utils.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;AAEvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC"}
|
41
node_modules/@actions/core/package.json
generated
vendored
Normal file
41
node_modules/@actions/core/package.json
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
"name": "@actions/core",
|
||||||
|
"version": "1.2.6",
|
||||||
|
"description": "Actions core lib",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"core"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/main/packages/core",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/core.js",
|
||||||
|
"types": "lib/core.d.ts",
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"!.DS_Store"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/core"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^12.0.2"
|
||||||
|
}
|
||||||
|
}
|
57
node_modules/@actions/github/README.md
generated
vendored
Normal file
57
node_modules/@actions/github/README.md
generated
vendored
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
# `@actions/github`
|
||||||
|
|
||||||
|
> A hydrated Octokit client.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Returns an Octokit client. See https://octokit.github.io/rest.js for the API.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const github = require('@actions/github');
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
// This should be a token with access to your repository scoped in as a secret.
|
||||||
|
// The YML workflow will need to set myToken with the GitHub Secret Token
|
||||||
|
// myToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
// https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret
|
||||||
|
const myToken = core.getInput('myToken');
|
||||||
|
|
||||||
|
const octokit = new github.GitHub(myToken);
|
||||||
|
|
||||||
|
const { data: pullRequest } = await octokit.pulls.get({
|
||||||
|
owner: 'octokit',
|
||||||
|
repo: 'rest.js',
|
||||||
|
pull_number: 123,
|
||||||
|
mediaType: {
|
||||||
|
format: 'diff'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(pullRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
|
```
|
||||||
|
|
||||||
|
You can pass client options (except `auth`, which is handled by the token argument), as specified by [Octokit](https://octokit.github.io/rest.js/), as a second argument to the `GitHub` constructor.
|
||||||
|
|
||||||
|
You can also make GraphQL requests. See https://github.com/octokit/graphql.js for the API.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const result = await octokit.graphql(query, variables);
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, you can get the context of the current action:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const github = require('@actions/github');
|
||||||
|
|
||||||
|
const context = github.context;
|
||||||
|
|
||||||
|
const newIssue = await octokit.issues.create({
|
||||||
|
...context.repo,
|
||||||
|
title: 'New issue!',
|
||||||
|
body: 'Hello Universe!'
|
||||||
|
});
|
||||||
|
```
|
26
node_modules/@actions/github/lib/context.d.ts
generated
vendored
Normal file
26
node_modules/@actions/github/lib/context.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import { WebhookPayload } from './interfaces';
|
||||||
|
export declare class Context {
|
||||||
|
/**
|
||||||
|
* Webhook payload object that triggered the workflow
|
||||||
|
*/
|
||||||
|
payload: WebhookPayload;
|
||||||
|
eventName: string;
|
||||||
|
sha: string;
|
||||||
|
ref: string;
|
||||||
|
workflow: string;
|
||||||
|
action: string;
|
||||||
|
actor: string;
|
||||||
|
/**
|
||||||
|
* Hydrate the context from the environment
|
||||||
|
*/
|
||||||
|
constructor();
|
||||||
|
readonly issue: {
|
||||||
|
owner: string;
|
||||||
|
repo: string;
|
||||||
|
number: number;
|
||||||
|
};
|
||||||
|
readonly repo: {
|
||||||
|
owner: string;
|
||||||
|
repo: string;
|
||||||
|
};
|
||||||
|
}
|
46
node_modules/@actions/github/lib/context.js
generated
vendored
Normal file
46
node_modules/@actions/github/lib/context.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const fs_1 = require("fs");
|
||||||
|
const os_1 = require("os");
|
||||||
|
class Context {
|
||||||
|
/**
|
||||||
|
* Hydrate the context from the environment
|
||||||
|
*/
|
||||||
|
constructor() {
|
||||||
|
this.payload = {};
|
||||||
|
if (process.env.GITHUB_EVENT_PATH) {
|
||||||
|
if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
|
||||||
|
this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const path = process.env.GITHUB_EVENT_PATH;
|
||||||
|
process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.eventName = process.env.GITHUB_EVENT_NAME;
|
||||||
|
this.sha = process.env.GITHUB_SHA;
|
||||||
|
this.ref = process.env.GITHUB_REF;
|
||||||
|
this.workflow = process.env.GITHUB_WORKFLOW;
|
||||||
|
this.action = process.env.GITHUB_ACTION;
|
||||||
|
this.actor = process.env.GITHUB_ACTOR;
|
||||||
|
}
|
||||||
|
get issue() {
|
||||||
|
const payload = this.payload;
|
||||||
|
return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
|
||||||
|
}
|
||||||
|
get repo() {
|
||||||
|
if (process.env.GITHUB_REPOSITORY) {
|
||||||
|
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
|
||||||
|
return { owner, repo };
|
||||||
|
}
|
||||||
|
if (this.payload.repository) {
|
||||||
|
return {
|
||||||
|
owner: this.payload.repository.owner.login,
|
||||||
|
repo: this.payload.repository.name
|
||||||
|
};
|
||||||
|
}
|
||||||
|
throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.Context = Context;
|
||||||
|
//# sourceMappingURL=context.js.map
|
1
node_modules/@actions/github/lib/context.js.map
generated
vendored
Normal file
1
node_modules/@actions/github/lib/context.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;AAEA,2BAA2C;AAC3C,2BAAsB;AAEtB,MAAa,OAAO;IAalB;;OAEG;IACH;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,IAAI,eAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CACvB,iBAAY,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAChE,CAAA;aACF;iBAAM;gBACL,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;gBAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,IAAI,kBAAkB,QAAG,EAAE,CAAC,CAAA;aACvE;SACF;QACD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAA2B,CAAA;QACxD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAyB,CAAA;QACrD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAuB,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAsB,CAAA;IACjD,CAAC;IAED,IAAI,KAAK;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,uCACK,IAAI,CAAC,IAAI,KACZ,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,CAAC,MAAM,IACjE;IACH,CAAC;IAED,IAAI,IAAI;QACN,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC9D,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,CAAA;SACrB;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK;gBAC1C,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI;aACnC,CAAA;SACF;QAED,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAA;IACH,CAAC;CACF;AA9DD,0BA8DC"}
|
8
node_modules/@actions/github/lib/github.d.ts
generated
vendored
Normal file
8
node_modules/@actions/github/lib/github.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { graphql as GraphQL } from '@octokit/graphql/dist-types/types';
|
||||||
|
import Octokit from '@octokit/rest';
|
||||||
|
import * as Context from './context';
|
||||||
|
export declare const context: Context.Context;
|
||||||
|
export declare class GitHub extends Octokit {
|
||||||
|
graphql: GraphQL;
|
||||||
|
constructor(token: string, opts?: Omit<Octokit.Options, 'auth'>);
|
||||||
|
}
|
29
node_modules/@actions/github/lib/github.js
generated
vendored
Normal file
29
node_modules/@actions/github/lib/github.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
|
||||||
|
const graphql_1 = require("@octokit/graphql");
|
||||||
|
const rest_1 = __importDefault(require("@octokit/rest"));
|
||||||
|
const Context = __importStar(require("./context"));
|
||||||
|
// We need this in order to extend Octokit
|
||||||
|
rest_1.default.prototype = new rest_1.default();
|
||||||
|
exports.context = new Context.Context();
|
||||||
|
class GitHub extends rest_1.default {
|
||||||
|
constructor(token, opts = {}) {
|
||||||
|
super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
|
||||||
|
this.graphql = graphql_1.graphql.defaults({
|
||||||
|
headers: { authorization: `token ${token}` }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.GitHub = GitHub;
|
||||||
|
//# sourceMappingURL=github.js.map
|
1
node_modules/@actions/github/lib/github.js.map
generated
vendored
Normal file
1
node_modules/@actions/github/lib/github.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gGAAgG;AAChG,8CAAwC;AAOxC,yDAAmC;AACnC,mDAAoC;AAEpC,0CAA0C;AAC1C,cAAO,CAAC,SAAS,GAAG,IAAI,cAAO,EAAE,CAAA;AAEpB,QAAA,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;AAE5C,MAAa,MAAO,SAAQ,cAAO;IAGjC,YAAY,KAAa,EAAE,OAAsC,EAAE;QACjE,KAAK,iCAAK,IAAI,KAAE,IAAI,EAAE,SAAS,KAAK,EAAE,IAAE,CAAA;QAExC,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC,QAAQ,CAAC;YAC9B,OAAO,EAAE,EAAC,aAAa,EAAE,SAAS,KAAK,EAAE,EAAC;SAC3C,CAAC,CAAA;IACJ,CAAC;CACF;AAVD,wBAUC"}
|
36
node_modules/@actions/github/lib/interfaces.d.ts
generated
vendored
Normal file
36
node_modules/@actions/github/lib/interfaces.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
export interface PayloadRepository {
|
||||||
|
[key: string]: any;
|
||||||
|
full_name?: string;
|
||||||
|
name: string;
|
||||||
|
owner: {
|
||||||
|
[key: string]: any;
|
||||||
|
login: string;
|
||||||
|
name?: string;
|
||||||
|
};
|
||||||
|
html_url?: string;
|
||||||
|
}
|
||||||
|
export interface WebhookPayload {
|
||||||
|
[key: string]: any;
|
||||||
|
repository?: PayloadRepository;
|
||||||
|
issue?: {
|
||||||
|
[key: string]: any;
|
||||||
|
number: number;
|
||||||
|
html_url?: string;
|
||||||
|
body?: string;
|
||||||
|
};
|
||||||
|
pull_request?: {
|
||||||
|
[key: string]: any;
|
||||||
|
number: number;
|
||||||
|
html_url?: string;
|
||||||
|
body?: string;
|
||||||
|
};
|
||||||
|
sender?: {
|
||||||
|
[key: string]: any;
|
||||||
|
type: string;
|
||||||
|
};
|
||||||
|
action?: string;
|
||||||
|
installation?: {
|
||||||
|
id: number;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
}
|
4
node_modules/@actions/github/lib/interfaces.js
generated
vendored
Normal file
4
node_modules/@actions/github/lib/interfaces.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
"use strict";
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
//# sourceMappingURL=interfaces.js.map
|
1
node_modules/@actions/github/lib/interfaces.js.map
generated
vendored
Normal file
1
node_modules/@actions/github/lib/interfaces.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
44
node_modules/@actions/github/package.json
generated
vendored
Normal file
44
node_modules/@actions/github/package.json
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
"name": "@actions/github",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "Actions github lib",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/github",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/github.js",
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/github"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "jest",
|
||||||
|
"build": "tsc",
|
||||||
|
"format": "prettier --write **/*.ts",
|
||||||
|
"format-check": "prettier --check **/*.ts",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/graphql": "^4.3.1",
|
||||||
|
"@octokit/rest": "^16.15.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"jest": "^24.7.1"
|
||||||
|
}
|
||||||
|
}
|
21
node_modules/@octokit/endpoint/LICENSE
generated
vendored
Normal file
21
node_modules/@octokit/endpoint/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2018 Octokit contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
421
node_modules/@octokit/endpoint/README.md
generated
vendored
Normal file
421
node_modules/@octokit/endpoint/README.md
generated
vendored
Normal file
|
@ -0,0 +1,421 @@
|
||||||
|
# endpoint.js
|
||||||
|
|
||||||
|
> Turns GitHub REST API endpoints into generic request options
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/@octokit/endpoint)
|
||||||
|

|
||||||
|
[](https://greenkeeper.io/)
|
||||||
|
|
||||||
|
`@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()](#endpointroute-options-or-endpointoptions)
|
||||||
|
- [endpoint.defaults()](#endpointdefaults)
|
||||||
|
- [endpoint.DEFAULTS](#endpointdefaults-1)
|
||||||
|
- [endpoint.merge()](#endpointmergeroute-options-or-endpointmergeoptions)
|
||||||
|
- [endpoint.parse()](#endpointparse)
|
||||||
|
- [Special cases](#special-cases)
|
||||||
|
- [The `data` parameter – set request body directly](#the-data-parameter--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.pika.dev">cdn.pika.dev</a>
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="module">
|
||||||
|
import { endpoint } from "https://cdn.pika.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)
|
379
node_modules/@octokit/endpoint/dist-node/index.js
generated
vendored
Normal file
379
node_modules/@octokit/endpoint/dist-node/index.js
generated
vendored
Normal file
|
@ -0,0 +1,379 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||||
|
|
||||||
|
var isPlainObject = _interopDefault(require('is-plain-object'));
|
||||||
|
var universalUserAgent = require('universal-user-agent');
|
||||||
|
|
||||||
|
function lowercaseKeys(object) {
|
||||||
|
if (!object) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return Object.keys(object).reduce((newObj, key) => {
|
||||||
|
newObj[key.toLowerCase()] = object[key];
|
||||||
|
return newObj;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
function mergeDeep(defaults, options) {
|
||||||
|
const result = Object.assign({}, defaults);
|
||||||
|
Object.keys(options).forEach(key => {
|
||||||
|
if (isPlainObject(options[key])) {
|
||||||
|
if (!(key in defaults)) Object.assign(result, {
|
||||||
|
[key]: options[key]
|
||||||
|
});else result[key] = mergeDeep(defaults[key], options[key]);
|
||||||
|
} else {
|
||||||
|
Object.assign(result, {
|
||||||
|
[key]: options[key]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function merge(defaults, route, options) {
|
||||||
|
if (typeof route === "string") {
|
||||||
|
let [method, url] = route.split(" ");
|
||||||
|
options = Object.assign(url ? {
|
||||||
|
method,
|
||||||
|
url
|
||||||
|
} : {
|
||||||
|
url: method
|
||||||
|
}, options);
|
||||||
|
} else {
|
||||||
|
options = Object.assign({}, route);
|
||||||
|
} // lowercase header names before merging with defaults to avoid duplicates
|
||||||
|
|
||||||
|
|
||||||
|
options.headers = lowercaseKeys(options.headers);
|
||||||
|
const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
|
||||||
|
|
||||||
|
if (defaults && defaults.mediaType.previews.length) {
|
||||||
|
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
|
||||||
|
}
|
||||||
|
|
||||||
|
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
|
||||||
|
return mergedOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addQueryParameters(url, parameters) {
|
||||||
|
const separator = /\?/.test(url) ? "&" : "?";
|
||||||
|
const names = Object.keys(parameters);
|
||||||
|
|
||||||
|
if (names.length === 0) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
return url + separator + names.map(name => {
|
||||||
|
if (name === "q") {
|
||||||
|
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${name}=${encodeURIComponent(parameters[name])}`;
|
||||||
|
}).join("&");
|
||||||
|
}
|
||||||
|
|
||||||
|
const urlVariableRegex = /\{[^}]+\}/g;
|
||||||
|
|
||||||
|
function removeNonChars(variableName) {
|
||||||
|
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractUrlVariableNames(url) {
|
||||||
|
const matches = url.match(urlVariableRegex);
|
||||||
|
|
||||||
|
if (!matches) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
||||||
|
}
|
||||||
|
|
||||||
|
function omit(object, keysToOmit) {
|
||||||
|
return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
|
||||||
|
obj[key] = object[key];
|
||||||
|
return obj;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Based on https://github.com/bramstein/url-template, licensed under BSD
|
||||||
|
// TODO: create separate package.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014, Bram Stein
|
||||||
|
// All rights reserved.
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions
|
||||||
|
// are met:
|
||||||
|
// 1. Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer in the
|
||||||
|
// documentation and/or other materials provided with the distribution.
|
||||||
|
// 3. The name of the author may not be used to endorse or promote products
|
||||||
|
// derived from this software without specific prior written permission.
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
|
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
|
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
/* istanbul ignore file */
|
||||||
|
function encodeReserved(str) {
|
||||||
|
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
|
||||||
|
if (!/%[0-9A-Fa-f]/.test(part)) {
|
||||||
|
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
return part;
|
||||||
|
}).join("");
|
||||||
|
}
|
||||||
|
|
||||||
|
function encodeUnreserved(str) {
|
||||||
|
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
||||||
|
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function encodeValue(operator, value, key) {
|
||||||
|
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
|
||||||
|
|
||||||
|
if (key) {
|
||||||
|
return encodeUnreserved(key) + "=" + value;
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isDefined(value) {
|
||||||
|
return value !== undefined && value !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isKeyOperator(operator) {
|
||||||
|
return operator === ";" || operator === "&" || operator === "?";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getValues(context, operator, key, modifier) {
|
||||||
|
var value = context[key],
|
||||||
|
result = [];
|
||||||
|
|
||||||
|
if (isDefined(value) && value !== "") {
|
||||||
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
||||||
|
value = value.toString();
|
||||||
|
|
||||||
|
if (modifier && modifier !== "*") {
|
||||||
|
value = value.substring(0, parseInt(modifier, 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||||
|
} else {
|
||||||
|
if (modifier === "*") {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.filter(isDefined).forEach(function (value) {
|
||||||
|
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Object.keys(value).forEach(function (k) {
|
||||||
|
if (isDefined(value[k])) {
|
||||||
|
result.push(encodeValue(operator, value[k], k));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const tmp = [];
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.filter(isDefined).forEach(function (value) {
|
||||||
|
tmp.push(encodeValue(operator, value));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Object.keys(value).forEach(function (k) {
|
||||||
|
if (isDefined(value[k])) {
|
||||||
|
tmp.push(encodeUnreserved(k));
|
||||||
|
tmp.push(encodeValue(operator, value[k].toString()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isKeyOperator(operator)) {
|
||||||
|
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
||||||
|
} else if (tmp.length !== 0) {
|
||||||
|
result.push(tmp.join(","));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (operator === ";") {
|
||||||
|
if (isDefined(value)) {
|
||||||
|
result.push(encodeUnreserved(key));
|
||||||
|
}
|
||||||
|
} else if (value === "" && (operator === "&" || operator === "?")) {
|
||||||
|
result.push(encodeUnreserved(key) + "=");
|
||||||
|
} else if (value === "") {
|
||||||
|
result.push("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseUrl(template) {
|
||||||
|
return {
|
||||||
|
expand: expand.bind(null, template)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function expand(template, context) {
|
||||||
|
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||||
|
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
||||||
|
if (expression) {
|
||||||
|
let operator = "";
|
||||||
|
const values = [];
|
||||||
|
|
||||||
|
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
||||||
|
operator = expression.charAt(0);
|
||||||
|
expression = expression.substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
expression.split(/,/g).forEach(function (variable) {
|
||||||
|
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
||||||
|
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (operator && operator !== "+") {
|
||||||
|
var separator = ",";
|
||||||
|
|
||||||
|
if (operator === "?") {
|
||||||
|
separator = "&";
|
||||||
|
} else if (operator !== "#") {
|
||||||
|
separator = operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (values.length !== 0 ? operator : "") + values.join(separator);
|
||||||
|
} else {
|
||||||
|
return values.join(",");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return encodeReserved(literal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function parse(options) {
|
||||||
|
// https://fetch.spec.whatwg.org/#methods
|
||||||
|
let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
|
||||||
|
|
||||||
|
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
|
||||||
|
let headers = Object.assign({}, options.headers);
|
||||||
|
let body;
|
||||||
|
let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
|
||||||
|
|
||||||
|
const urlVariableNames = extractUrlVariableNames(url);
|
||||||
|
url = parseUrl(url).expand(parameters);
|
||||||
|
|
||||||
|
if (!/^http/.test(url)) {
|
||||||
|
url = options.baseUrl + url;
|
||||||
|
}
|
||||||
|
|
||||||
|
const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
|
||||||
|
const remainingParameters = omit(parameters, omittedParameters);
|
||||||
|
const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
|
||||||
|
|
||||||
|
if (!isBinaryRequset) {
|
||||||
|
if (options.mediaType.format) {
|
||||||
|
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
|
||||||
|
headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.mediaType.previews.length) {
|
||||||
|
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
||||||
|
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
|
||||||
|
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
|
||||||
|
return `application/vnd.github.${preview}-preview${format}`;
|
||||||
|
}).join(",");
|
||||||
|
}
|
||||||
|
} // for GET/HEAD requests, set URL query parameters from remaining parameters
|
||||||
|
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
|
||||||
|
|
||||||
|
|
||||||
|
if (["GET", "HEAD"].includes(method)) {
|
||||||
|
url = addQueryParameters(url, remainingParameters);
|
||||||
|
} else {
|
||||||
|
if ("data" in remainingParameters) {
|
||||||
|
body = remainingParameters.data;
|
||||||
|
} else {
|
||||||
|
if (Object.keys(remainingParameters).length) {
|
||||||
|
body = remainingParameters;
|
||||||
|
} else {
|
||||||
|
headers["content-length"] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // default content-type for JSON if body is set
|
||||||
|
|
||||||
|
|
||||||
|
if (!headers["content-type"] && typeof body !== "undefined") {
|
||||||
|
headers["content-type"] = "application/json; charset=utf-8";
|
||||||
|
} // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
|
||||||
|
// fetch does not allow to set `content-length` header, but we can set body to an empty string
|
||||||
|
|
||||||
|
|
||||||
|
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
||||||
|
body = "";
|
||||||
|
} // Only return body/request keys if present
|
||||||
|
|
||||||
|
|
||||||
|
return Object.assign({
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
headers
|
||||||
|
}, typeof body !== "undefined" ? {
|
||||||
|
body
|
||||||
|
} : null, options.request ? {
|
||||||
|
request: options.request
|
||||||
|
} : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
function endpointWithDefaults(defaults, route, options) {
|
||||||
|
return parse(merge(defaults, route, options));
|
||||||
|
}
|
||||||
|
|
||||||
|
function withDefaults(oldDefaults, newDefaults) {
|
||||||
|
const DEFAULTS = merge(oldDefaults, newDefaults);
|
||||||
|
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
|
||||||
|
return Object.assign(endpoint, {
|
||||||
|
DEFAULTS,
|
||||||
|
defaults: withDefaults.bind(null, DEFAULTS),
|
||||||
|
merge: merge.bind(null, DEFAULTS),
|
||||||
|
parse
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const VERSION = "5.5.1";
|
||||||
|
|
||||||
|
const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
|
||||||
|
// So we use RequestParameters and add method as additional required property.
|
||||||
|
|
||||||
|
const DEFAULTS = {
|
||||||
|
method: "GET",
|
||||||
|
baseUrl: "https://api.github.com",
|
||||||
|
headers: {
|
||||||
|
accept: "application/vnd.github.v3+json",
|
||||||
|
"user-agent": userAgent
|
||||||
|
},
|
||||||
|
mediaType: {
|
||||||
|
format: "",
|
||||||
|
previews: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const endpoint = withDefaults(null, DEFAULTS);
|
||||||
|
|
||||||
|
exports.endpoint = endpoint;
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/endpoint/dist-node/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/endpoint/dist-node/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17
node_modules/@octokit/endpoint/dist-src/defaults.js
generated
vendored
Normal file
17
node_modules/@octokit/endpoint/dist-src/defaults.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { getUserAgent } from "universal-user-agent";
|
||||||
|
import { VERSION } from "./version";
|
||||||
|
const userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
|
||||||
|
// DEFAULTS has all properties set that EndpointOptions has, except url.
|
||||||
|
// So we use RequestParameters and add method as additional required property.
|
||||||
|
export const DEFAULTS = {
|
||||||
|
method: "GET",
|
||||||
|
baseUrl: "https://api.github.com",
|
||||||
|
headers: {
|
||||||
|
accept: "application/vnd.github.v3+json",
|
||||||
|
"user-agent": userAgent
|
||||||
|
},
|
||||||
|
mediaType: {
|
||||||
|
format: "",
|
||||||
|
previews: []
|
||||||
|
}
|
||||||
|
};
|
5
node_modules/@octokit/endpoint/dist-src/endpoint-with-defaults.js
generated
vendored
Normal file
5
node_modules/@octokit/endpoint/dist-src/endpoint-with-defaults.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import { merge } from "./merge";
|
||||||
|
import { parse } from "./parse";
|
||||||
|
export function endpointWithDefaults(defaults, route, options) {
|
||||||
|
return parse(merge(defaults, route, options));
|
||||||
|
}
|
3
node_modules/@octokit/endpoint/dist-src/index.js
generated
vendored
Normal file
3
node_modules/@octokit/endpoint/dist-src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { withDefaults } from "./with-defaults";
|
||||||
|
import { DEFAULTS } from "./defaults";
|
||||||
|
export const endpoint = withDefaults(null, DEFAULTS);
|
22
node_modules/@octokit/endpoint/dist-src/merge.js
generated
vendored
Normal file
22
node_modules/@octokit/endpoint/dist-src/merge.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import { lowercaseKeys } from "./util/lowercase-keys";
|
||||||
|
import { mergeDeep } from "./util/merge-deep";
|
||||||
|
export function merge(defaults, route, options) {
|
||||||
|
if (typeof route === "string") {
|
||||||
|
let [method, url] = route.split(" ");
|
||||||
|
options = Object.assign(url ? { method, url } : { url: method }, options);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
options = Object.assign({}, route);
|
||||||
|
}
|
||||||
|
// lowercase header names before merging with defaults to avoid duplicates
|
||||||
|
options.headers = lowercaseKeys(options.headers);
|
||||||
|
const mergedOptions = mergeDeep(defaults || {}, options);
|
||||||
|
// mediaType.previews arrays are merged, instead of overwritten
|
||||||
|
if (defaults && defaults.mediaType.previews.length) {
|
||||||
|
mergedOptions.mediaType.previews = defaults.mediaType.previews
|
||||||
|
.filter(preview => !mergedOptions.mediaType.previews.includes(preview))
|
||||||
|
.concat(mergedOptions.mediaType.previews);
|
||||||
|
}
|
||||||
|
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, ""));
|
||||||
|
return mergedOptions;
|
||||||
|
}
|
81
node_modules/@octokit/endpoint/dist-src/parse.js
generated
vendored
Normal file
81
node_modules/@octokit/endpoint/dist-src/parse.js
generated
vendored
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
import { addQueryParameters } from "./util/add-query-parameters";
|
||||||
|
import { extractUrlVariableNames } from "./util/extract-url-variable-names";
|
||||||
|
import { omit } from "./util/omit";
|
||||||
|
import { parseUrl } from "./util/url-template";
|
||||||
|
export function parse(options) {
|
||||||
|
// https://fetch.spec.whatwg.org/#methods
|
||||||
|
let method = options.method.toUpperCase();
|
||||||
|
// replace :varname with {varname} to make it RFC 6570 compatible
|
||||||
|
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
|
||||||
|
let headers = Object.assign({}, options.headers);
|
||||||
|
let body;
|
||||||
|
let parameters = omit(options, [
|
||||||
|
"method",
|
||||||
|
"baseUrl",
|
||||||
|
"url",
|
||||||
|
"headers",
|
||||||
|
"request",
|
||||||
|
"mediaType"
|
||||||
|
]);
|
||||||
|
// extract variable names from URL to calculate remaining variables later
|
||||||
|
const urlVariableNames = extractUrlVariableNames(url);
|
||||||
|
url = parseUrl(url).expand(parameters);
|
||||||
|
if (!/^http/.test(url)) {
|
||||||
|
url = options.baseUrl + url;
|
||||||
|
}
|
||||||
|
const omittedParameters = Object.keys(options)
|
||||||
|
.filter(option => urlVariableNames.includes(option))
|
||||||
|
.concat("baseUrl");
|
||||||
|
const remainingParameters = omit(parameters, omittedParameters);
|
||||||
|
const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
|
||||||
|
if (!isBinaryRequset) {
|
||||||
|
if (options.mediaType.format) {
|
||||||
|
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
|
||||||
|
headers.accept = headers.accept
|
||||||
|
.split(/,/)
|
||||||
|
.map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))
|
||||||
|
.join(",");
|
||||||
|
}
|
||||||
|
if (options.mediaType.previews.length) {
|
||||||
|
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
||||||
|
headers.accept = previewsFromAcceptHeader
|
||||||
|
.concat(options.mediaType.previews)
|
||||||
|
.map(preview => {
|
||||||
|
const format = options.mediaType.format
|
||||||
|
? `.${options.mediaType.format}`
|
||||||
|
: "+json";
|
||||||
|
return `application/vnd.github.${preview}-preview${format}`;
|
||||||
|
})
|
||||||
|
.join(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for GET/HEAD requests, set URL query parameters from remaining parameters
|
||||||
|
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
|
||||||
|
if (["GET", "HEAD"].includes(method)) {
|
||||||
|
url = addQueryParameters(url, remainingParameters);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ("data" in remainingParameters) {
|
||||||
|
body = remainingParameters.data;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (Object.keys(remainingParameters).length) {
|
||||||
|
body = remainingParameters;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
headers["content-length"] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// default content-type for JSON if body is set
|
||||||
|
if (!headers["content-type"] && typeof body !== "undefined") {
|
||||||
|
headers["content-type"] = "application/json; charset=utf-8";
|
||||||
|
}
|
||||||
|
// GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
|
||||||
|
// fetch does not allow to set `content-length` header, but we can set body to an empty string
|
||||||
|
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
||||||
|
body = "";
|
||||||
|
}
|
||||||
|
// Only return body/request keys if present
|
||||||
|
return Object.assign({ method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null);
|
||||||
|
}
|
21
node_modules/@octokit/endpoint/dist-src/util/add-query-parameters.js
generated
vendored
Normal file
21
node_modules/@octokit/endpoint/dist-src/util/add-query-parameters.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
export function addQueryParameters(url, parameters) {
|
||||||
|
const separator = /\?/.test(url) ? "&" : "?";
|
||||||
|
const names = Object.keys(parameters);
|
||||||
|
if (names.length === 0) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
return (url +
|
||||||
|
separator +
|
||||||
|
names
|
||||||
|
.map(name => {
|
||||||
|
if (name === "q") {
|
||||||
|
return ("q=" +
|
||||||
|
parameters
|
||||||
|
.q.split("+")
|
||||||
|
.map(encodeURIComponent)
|
||||||
|
.join("+"));
|
||||||
|
}
|
||||||
|
return `${name}=${encodeURIComponent(parameters[name])}`;
|
||||||
|
})
|
||||||
|
.join("&"));
|
||||||
|
}
|
11
node_modules/@octokit/endpoint/dist-src/util/extract-url-variable-names.js
generated
vendored
Normal file
11
node_modules/@octokit/endpoint/dist-src/util/extract-url-variable-names.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
const urlVariableRegex = /\{[^}]+\}/g;
|
||||||
|
function removeNonChars(variableName) {
|
||||||
|
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
|
||||||
|
}
|
||||||
|
export function extractUrlVariableNames(url) {
|
||||||
|
const matches = url.match(urlVariableRegex);
|
||||||
|
if (!matches) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
||||||
|
}
|
9
node_modules/@octokit/endpoint/dist-src/util/lowercase-keys.js
generated
vendored
Normal file
9
node_modules/@octokit/endpoint/dist-src/util/lowercase-keys.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
export function lowercaseKeys(object) {
|
||||||
|
if (!object) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return Object.keys(object).reduce((newObj, key) => {
|
||||||
|
newObj[key.toLowerCase()] = object[key];
|
||||||
|
return newObj;
|
||||||
|
}, {});
|
||||||
|
}
|
16
node_modules/@octokit/endpoint/dist-src/util/merge-deep.js
generated
vendored
Normal file
16
node_modules/@octokit/endpoint/dist-src/util/merge-deep.js
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import isPlainObject from "is-plain-object";
|
||||||
|
export function mergeDeep(defaults, options) {
|
||||||
|
const result = Object.assign({}, defaults);
|
||||||
|
Object.keys(options).forEach(key => {
|
||||||
|
if (isPlainObject(options[key])) {
|
||||||
|
if (!(key in defaults))
|
||||||
|
Object.assign(result, { [key]: options[key] });
|
||||||
|
else
|
||||||
|
result[key] = mergeDeep(defaults[key], options[key]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object.assign(result, { [key]: options[key] });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
8
node_modules/@octokit/endpoint/dist-src/util/omit.js
generated
vendored
Normal file
8
node_modules/@octokit/endpoint/dist-src/util/omit.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
export function omit(object, keysToOmit) {
|
||||||
|
return Object.keys(object)
|
||||||
|
.filter(option => !keysToOmit.includes(option))
|
||||||
|
.reduce((obj, key) => {
|
||||||
|
obj[key] = object[key];
|
||||||
|
return obj;
|
||||||
|
}, {});
|
||||||
|
}
|
170
node_modules/@octokit/endpoint/dist-src/util/url-template.js
generated
vendored
Normal file
170
node_modules/@octokit/endpoint/dist-src/util/url-template.js
generated
vendored
Normal file
|
@ -0,0 +1,170 @@
|
||||||
|
// Based on https://github.com/bramstein/url-template, licensed under BSD
|
||||||
|
// TODO: create separate package.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014, Bram Stein
|
||||||
|
// All rights reserved.
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions
|
||||||
|
// are met:
|
||||||
|
// 1. Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer in the
|
||||||
|
// documentation and/or other materials provided with the distribution.
|
||||||
|
// 3. The name of the author may not be used to endorse or promote products
|
||||||
|
// derived from this software without specific prior written permission.
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
|
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
|
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
/* istanbul ignore file */
|
||||||
|
function encodeReserved(str) {
|
||||||
|
return str
|
||||||
|
.split(/(%[0-9A-Fa-f]{2})/g)
|
||||||
|
.map(function (part) {
|
||||||
|
if (!/%[0-9A-Fa-f]/.test(part)) {
|
||||||
|
part = encodeURI(part)
|
||||||
|
.replace(/%5B/g, "[")
|
||||||
|
.replace(/%5D/g, "]");
|
||||||
|
}
|
||||||
|
return part;
|
||||||
|
})
|
||||||
|
.join("");
|
||||||
|
}
|
||||||
|
function encodeUnreserved(str) {
|
||||||
|
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
||||||
|
return ("%" +
|
||||||
|
c
|
||||||
|
.charCodeAt(0)
|
||||||
|
.toString(16)
|
||||||
|
.toUpperCase());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function encodeValue(operator, value, key) {
|
||||||
|
value =
|
||||||
|
operator === "+" || operator === "#"
|
||||||
|
? encodeReserved(value)
|
||||||
|
: encodeUnreserved(value);
|
||||||
|
if (key) {
|
||||||
|
return encodeUnreserved(key) + "=" + value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function isDefined(value) {
|
||||||
|
return value !== undefined && value !== null;
|
||||||
|
}
|
||||||
|
function isKeyOperator(operator) {
|
||||||
|
return operator === ";" || operator === "&" || operator === "?";
|
||||||
|
}
|
||||||
|
function getValues(context, operator, key, modifier) {
|
||||||
|
var value = context[key], result = [];
|
||||||
|
if (isDefined(value) && value !== "") {
|
||||||
|
if (typeof value === "string" ||
|
||||||
|
typeof value === "number" ||
|
||||||
|
typeof value === "boolean") {
|
||||||
|
value = value.toString();
|
||||||
|
if (modifier && modifier !== "*") {
|
||||||
|
value = value.substring(0, parseInt(modifier, 10));
|
||||||
|
}
|
||||||
|
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (modifier === "*") {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.filter(isDefined).forEach(function (value) {
|
||||||
|
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object.keys(value).forEach(function (k) {
|
||||||
|
if (isDefined(value[k])) {
|
||||||
|
result.push(encodeValue(operator, value[k], k));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const tmp = [];
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.filter(isDefined).forEach(function (value) {
|
||||||
|
tmp.push(encodeValue(operator, value));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object.keys(value).forEach(function (k) {
|
||||||
|
if (isDefined(value[k])) {
|
||||||
|
tmp.push(encodeUnreserved(k));
|
||||||
|
tmp.push(encodeValue(operator, value[k].toString()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (isKeyOperator(operator)) {
|
||||||
|
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
||||||
|
}
|
||||||
|
else if (tmp.length !== 0) {
|
||||||
|
result.push(tmp.join(","));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (operator === ";") {
|
||||||
|
if (isDefined(value)) {
|
||||||
|
result.push(encodeUnreserved(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (value === "" && (operator === "&" || operator === "?")) {
|
||||||
|
result.push(encodeUnreserved(key) + "=");
|
||||||
|
}
|
||||||
|
else if (value === "") {
|
||||||
|
result.push("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
export function parseUrl(template) {
|
||||||
|
return {
|
||||||
|
expand: expand.bind(null, template)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function expand(template, context) {
|
||||||
|
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||||
|
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
||||||
|
if (expression) {
|
||||||
|
let operator = "";
|
||||||
|
const values = [];
|
||||||
|
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
||||||
|
operator = expression.charAt(0);
|
||||||
|
expression = expression.substr(1);
|
||||||
|
}
|
||||||
|
expression.split(/,/g).forEach(function (variable) {
|
||||||
|
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
||||||
|
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
||||||
|
});
|
||||||
|
if (operator && operator !== "+") {
|
||||||
|
var separator = ",";
|
||||||
|
if (operator === "?") {
|
||||||
|
separator = "&";
|
||||||
|
}
|
||||||
|
else if (operator !== "#") {
|
||||||
|
separator = operator;
|
||||||
|
}
|
||||||
|
return (values.length !== 0 ? operator : "") + values.join(separator);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return values.join(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return encodeReserved(literal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
1
node_modules/@octokit/endpoint/dist-src/version.js
generated
vendored
Normal file
1
node_modules/@octokit/endpoint/dist-src/version.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export const VERSION = "5.5.1";
|
13
node_modules/@octokit/endpoint/dist-src/with-defaults.js
generated
vendored
Normal file
13
node_modules/@octokit/endpoint/dist-src/with-defaults.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import { endpointWithDefaults } from "./endpoint-with-defaults";
|
||||||
|
import { merge } from "./merge";
|
||||||
|
import { parse } from "./parse";
|
||||||
|
export function withDefaults(oldDefaults, newDefaults) {
|
||||||
|
const DEFAULTS = merge(oldDefaults, newDefaults);
|
||||||
|
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
|
||||||
|
return Object.assign(endpoint, {
|
||||||
|
DEFAULTS,
|
||||||
|
defaults: withDefaults.bind(null, DEFAULTS),
|
||||||
|
merge: merge.bind(null, DEFAULTS),
|
||||||
|
parse
|
||||||
|
});
|
||||||
|
}
|
2
node_modules/@octokit/endpoint/dist-types/defaults.d.ts
generated
vendored
Normal file
2
node_modules/@octokit/endpoint/dist-types/defaults.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { EndpointDefaults } from "@octokit/types";
|
||||||
|
export declare const DEFAULTS: EndpointDefaults;
|
3
node_modules/@octokit/endpoint/dist-types/endpoint-with-defaults.d.ts
generated
vendored
Normal file
3
node_modules/@octokit/endpoint/dist-types/endpoint-with-defaults.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { EndpointOptions, RequestParameters, Route } from "@octokit/types";
|
||||||
|
import { DEFAULTS } from "./defaults";
|
||||||
|
export declare function endpointWithDefaults(defaults: typeof DEFAULTS, route: Route | EndpointOptions, options?: RequestParameters): import("@octokit/types").RequestOptions;
|
1
node_modules/@octokit/endpoint/dist-types/index.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/endpoint/dist-types/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export declare const endpoint: import("@octokit/types").EndpointInterface;
|
2
node_modules/@octokit/endpoint/dist-types/merge.d.ts
generated
vendored
Normal file
2
node_modules/@octokit/endpoint/dist-types/merge.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { EndpointDefaults, RequestParameters, Route } from "@octokit/types";
|
||||||
|
export declare function merge(defaults: EndpointDefaults | null, route?: Route | RequestParameters, options?: RequestParameters): EndpointDefaults;
|
2
node_modules/@octokit/endpoint/dist-types/parse.d.ts
generated
vendored
Normal file
2
node_modules/@octokit/endpoint/dist-types/parse.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { EndpointDefaults, RequestOptions } from "@octokit/types";
|
||||||
|
export declare function parse(options: EndpointDefaults): RequestOptions;
|
4
node_modules/@octokit/endpoint/dist-types/util/add-query-parameters.d.ts
generated
vendored
Normal file
4
node_modules/@octokit/endpoint/dist-types/util/add-query-parameters.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export declare function addQueryParameters(url: string, parameters: {
|
||||||
|
[x: string]: string | undefined;
|
||||||
|
q?: string;
|
||||||
|
}): string;
|
1
node_modules/@octokit/endpoint/dist-types/util/extract-url-variable-names.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/endpoint/dist-types/util/extract-url-variable-names.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export declare function extractUrlVariableNames(url: string): string[];
|
5
node_modules/@octokit/endpoint/dist-types/util/lowercase-keys.d.ts
generated
vendored
Normal file
5
node_modules/@octokit/endpoint/dist-types/util/lowercase-keys.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export declare function lowercaseKeys(object?: {
|
||||||
|
[key: string]: any;
|
||||||
|
}): {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
1
node_modules/@octokit/endpoint/dist-types/util/merge-deep.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/endpoint/dist-types/util/merge-deep.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export declare function mergeDeep(defaults: any, options: any): object;
|
5
node_modules/@octokit/endpoint/dist-types/util/omit.d.ts
generated
vendored
Normal file
5
node_modules/@octokit/endpoint/dist-types/util/omit.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export declare function omit(object: {
|
||||||
|
[key: string]: any;
|
||||||
|
}, keysToOmit: string[]): {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
3
node_modules/@octokit/endpoint/dist-types/util/url-template.d.ts
generated
vendored
Normal file
3
node_modules/@octokit/endpoint/dist-types/util/url-template.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export declare function parseUrl(template: string): {
|
||||||
|
expand: (context: object) => string;
|
||||||
|
};
|
1
node_modules/@octokit/endpoint/dist-types/version.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/endpoint/dist-types/version.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export declare const VERSION = "5.5.1";
|
2
node_modules/@octokit/endpoint/dist-types/with-defaults.d.ts
generated
vendored
Normal file
2
node_modules/@octokit/endpoint/dist-types/with-defaults.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { EndpointInterface, RequestParameters, EndpointDefaults } from "@octokit/types";
|
||||||
|
export declare function withDefaults(oldDefaults: EndpointDefaults | null, newDefaults: RequestParameters): EndpointInterface;
|
379
node_modules/@octokit/endpoint/dist-web/index.js
generated
vendored
Normal file
379
node_modules/@octokit/endpoint/dist-web/index.js
generated
vendored
Normal file
|
@ -0,0 +1,379 @@
|
||||||
|
import isPlainObject from 'is-plain-object';
|
||||||
|
import { getUserAgent } from 'universal-user-agent';
|
||||||
|
|
||||||
|
function lowercaseKeys(object) {
|
||||||
|
if (!object) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return Object.keys(object).reduce((newObj, key) => {
|
||||||
|
newObj[key.toLowerCase()] = object[key];
|
||||||
|
return newObj;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
function mergeDeep(defaults, options) {
|
||||||
|
const result = Object.assign({}, defaults);
|
||||||
|
Object.keys(options).forEach(key => {
|
||||||
|
if (isPlainObject(options[key])) {
|
||||||
|
if (!(key in defaults))
|
||||||
|
Object.assign(result, { [key]: options[key] });
|
||||||
|
else
|
||||||
|
result[key] = mergeDeep(defaults[key], options[key]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object.assign(result, { [key]: options[key] });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function merge(defaults, route, options) {
|
||||||
|
if (typeof route === "string") {
|
||||||
|
let [method, url] = route.split(" ");
|
||||||
|
options = Object.assign(url ? { method, url } : { url: method }, options);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
options = Object.assign({}, route);
|
||||||
|
}
|
||||||
|
// lowercase header names before merging with defaults to avoid duplicates
|
||||||
|
options.headers = lowercaseKeys(options.headers);
|
||||||
|
const mergedOptions = mergeDeep(defaults || {}, options);
|
||||||
|
// mediaType.previews arrays are merged, instead of overwritten
|
||||||
|
if (defaults && defaults.mediaType.previews.length) {
|
||||||
|
mergedOptions.mediaType.previews = defaults.mediaType.previews
|
||||||
|
.filter(preview => !mergedOptions.mediaType.previews.includes(preview))
|
||||||
|
.concat(mergedOptions.mediaType.previews);
|
||||||
|
}
|
||||||
|
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, ""));
|
||||||
|
return mergedOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addQueryParameters(url, parameters) {
|
||||||
|
const separator = /\?/.test(url) ? "&" : "?";
|
||||||
|
const names = Object.keys(parameters);
|
||||||
|
if (names.length === 0) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
return (url +
|
||||||
|
separator +
|
||||||
|
names
|
||||||
|
.map(name => {
|
||||||
|
if (name === "q") {
|
||||||
|
return ("q=" +
|
||||||
|
parameters
|
||||||
|
.q.split("+")
|
||||||
|
.map(encodeURIComponent)
|
||||||
|
.join("+"));
|
||||||
|
}
|
||||||
|
return `${name}=${encodeURIComponent(parameters[name])}`;
|
||||||
|
})
|
||||||
|
.join("&"));
|
||||||
|
}
|
||||||
|
|
||||||
|
const urlVariableRegex = /\{[^}]+\}/g;
|
||||||
|
function removeNonChars(variableName) {
|
||||||
|
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
|
||||||
|
}
|
||||||
|
function extractUrlVariableNames(url) {
|
||||||
|
const matches = url.match(urlVariableRegex);
|
||||||
|
if (!matches) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
||||||
|
}
|
||||||
|
|
||||||
|
function omit(object, keysToOmit) {
|
||||||
|
return Object.keys(object)
|
||||||
|
.filter(option => !keysToOmit.includes(option))
|
||||||
|
.reduce((obj, key) => {
|
||||||
|
obj[key] = object[key];
|
||||||
|
return obj;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Based on https://github.com/bramstein/url-template, licensed under BSD
|
||||||
|
// TODO: create separate package.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014, Bram Stein
|
||||||
|
// All rights reserved.
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions
|
||||||
|
// are met:
|
||||||
|
// 1. Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer in the
|
||||||
|
// documentation and/or other materials provided with the distribution.
|
||||||
|
// 3. The name of the author may not be used to endorse or promote products
|
||||||
|
// derived from this software without specific prior written permission.
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
|
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
|
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
/* istanbul ignore file */
|
||||||
|
function encodeReserved(str) {
|
||||||
|
return str
|
||||||
|
.split(/(%[0-9A-Fa-f]{2})/g)
|
||||||
|
.map(function (part) {
|
||||||
|
if (!/%[0-9A-Fa-f]/.test(part)) {
|
||||||
|
part = encodeURI(part)
|
||||||
|
.replace(/%5B/g, "[")
|
||||||
|
.replace(/%5D/g, "]");
|
||||||
|
}
|
||||||
|
return part;
|
||||||
|
})
|
||||||
|
.join("");
|
||||||
|
}
|
||||||
|
function encodeUnreserved(str) {
|
||||||
|
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
||||||
|
return ("%" +
|
||||||
|
c
|
||||||
|
.charCodeAt(0)
|
||||||
|
.toString(16)
|
||||||
|
.toUpperCase());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function encodeValue(operator, value, key) {
|
||||||
|
value =
|
||||||
|
operator === "+" || operator === "#"
|
||||||
|
? encodeReserved(value)
|
||||||
|
: encodeUnreserved(value);
|
||||||
|
if (key) {
|
||||||
|
return encodeUnreserved(key) + "=" + value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function isDefined(value) {
|
||||||
|
return value !== undefined && value !== null;
|
||||||
|
}
|
||||||
|
function isKeyOperator(operator) {
|
||||||
|
return operator === ";" || operator === "&" || operator === "?";
|
||||||
|
}
|
||||||
|
function getValues(context, operator, key, modifier) {
|
||||||
|
var value = context[key], result = [];
|
||||||
|
if (isDefined(value) && value !== "") {
|
||||||
|
if (typeof value === "string" ||
|
||||||
|
typeof value === "number" ||
|
||||||
|
typeof value === "boolean") {
|
||||||
|
value = value.toString();
|
||||||
|
if (modifier && modifier !== "*") {
|
||||||
|
value = value.substring(0, parseInt(modifier, 10));
|
||||||
|
}
|
||||||
|
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (modifier === "*") {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.filter(isDefined).forEach(function (value) {
|
||||||
|
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object.keys(value).forEach(function (k) {
|
||||||
|
if (isDefined(value[k])) {
|
||||||
|
result.push(encodeValue(operator, value[k], k));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const tmp = [];
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.filter(isDefined).forEach(function (value) {
|
||||||
|
tmp.push(encodeValue(operator, value));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object.keys(value).forEach(function (k) {
|
||||||
|
if (isDefined(value[k])) {
|
||||||
|
tmp.push(encodeUnreserved(k));
|
||||||
|
tmp.push(encodeValue(operator, value[k].toString()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (isKeyOperator(operator)) {
|
||||||
|
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
||||||
|
}
|
||||||
|
else if (tmp.length !== 0) {
|
||||||
|
result.push(tmp.join(","));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (operator === ";") {
|
||||||
|
if (isDefined(value)) {
|
||||||
|
result.push(encodeUnreserved(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (value === "" && (operator === "&" || operator === "?")) {
|
||||||
|
result.push(encodeUnreserved(key) + "=");
|
||||||
|
}
|
||||||
|
else if (value === "") {
|
||||||
|
result.push("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function parseUrl(template) {
|
||||||
|
return {
|
||||||
|
expand: expand.bind(null, template)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function expand(template, context) {
|
||||||
|
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||||
|
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
||||||
|
if (expression) {
|
||||||
|
let operator = "";
|
||||||
|
const values = [];
|
||||||
|
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
||||||
|
operator = expression.charAt(0);
|
||||||
|
expression = expression.substr(1);
|
||||||
|
}
|
||||||
|
expression.split(/,/g).forEach(function (variable) {
|
||||||
|
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
||||||
|
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
||||||
|
});
|
||||||
|
if (operator && operator !== "+") {
|
||||||
|
var separator = ",";
|
||||||
|
if (operator === "?") {
|
||||||
|
separator = "&";
|
||||||
|
}
|
||||||
|
else if (operator !== "#") {
|
||||||
|
separator = operator;
|
||||||
|
}
|
||||||
|
return (values.length !== 0 ? operator : "") + values.join(separator);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return values.join(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return encodeReserved(literal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function parse(options) {
|
||||||
|
// https://fetch.spec.whatwg.org/#methods
|
||||||
|
let method = options.method.toUpperCase();
|
||||||
|
// replace :varname with {varname} to make it RFC 6570 compatible
|
||||||
|
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
|
||||||
|
let headers = Object.assign({}, options.headers);
|
||||||
|
let body;
|
||||||
|
let parameters = omit(options, [
|
||||||
|
"method",
|
||||||
|
"baseUrl",
|
||||||
|
"url",
|
||||||
|
"headers",
|
||||||
|
"request",
|
||||||
|
"mediaType"
|
||||||
|
]);
|
||||||
|
// extract variable names from URL to calculate remaining variables later
|
||||||
|
const urlVariableNames = extractUrlVariableNames(url);
|
||||||
|
url = parseUrl(url).expand(parameters);
|
||||||
|
if (!/^http/.test(url)) {
|
||||||
|
url = options.baseUrl + url;
|
||||||
|
}
|
||||||
|
const omittedParameters = Object.keys(options)
|
||||||
|
.filter(option => urlVariableNames.includes(option))
|
||||||
|
.concat("baseUrl");
|
||||||
|
const remainingParameters = omit(parameters, omittedParameters);
|
||||||
|
const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
|
||||||
|
if (!isBinaryRequset) {
|
||||||
|
if (options.mediaType.format) {
|
||||||
|
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
|
||||||
|
headers.accept = headers.accept
|
||||||
|
.split(/,/)
|
||||||
|
.map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))
|
||||||
|
.join(",");
|
||||||
|
}
|
||||||
|
if (options.mediaType.previews.length) {
|
||||||
|
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
||||||
|
headers.accept = previewsFromAcceptHeader
|
||||||
|
.concat(options.mediaType.previews)
|
||||||
|
.map(preview => {
|
||||||
|
const format = options.mediaType.format
|
||||||
|
? `.${options.mediaType.format}`
|
||||||
|
: "+json";
|
||||||
|
return `application/vnd.github.${preview}-preview${format}`;
|
||||||
|
})
|
||||||
|
.join(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for GET/HEAD requests, set URL query parameters from remaining parameters
|
||||||
|
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
|
||||||
|
if (["GET", "HEAD"].includes(method)) {
|
||||||
|
url = addQueryParameters(url, remainingParameters);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ("data" in remainingParameters) {
|
||||||
|
body = remainingParameters.data;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (Object.keys(remainingParameters).length) {
|
||||||
|
body = remainingParameters;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
headers["content-length"] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// default content-type for JSON if body is set
|
||||||
|
if (!headers["content-type"] && typeof body !== "undefined") {
|
||||||
|
headers["content-type"] = "application/json; charset=utf-8";
|
||||||
|
}
|
||||||
|
// GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
|
||||||
|
// fetch does not allow to set `content-length` header, but we can set body to an empty string
|
||||||
|
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
||||||
|
body = "";
|
||||||
|
}
|
||||||
|
// Only return body/request keys if present
|
||||||
|
return Object.assign({ method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
function endpointWithDefaults(defaults, route, options) {
|
||||||
|
return parse(merge(defaults, route, options));
|
||||||
|
}
|
||||||
|
|
||||||
|
function withDefaults(oldDefaults, newDefaults) {
|
||||||
|
const DEFAULTS = merge(oldDefaults, newDefaults);
|
||||||
|
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
|
||||||
|
return Object.assign(endpoint, {
|
||||||
|
DEFAULTS,
|
||||||
|
defaults: withDefaults.bind(null, DEFAULTS),
|
||||||
|
merge: merge.bind(null, DEFAULTS),
|
||||||
|
parse
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const VERSION = "5.5.1";
|
||||||
|
|
||||||
|
const userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
|
||||||
|
// DEFAULTS has all properties set that EndpointOptions has, except url.
|
||||||
|
// So we use RequestParameters and add method as additional required property.
|
||||||
|
const DEFAULTS = {
|
||||||
|
method: "GET",
|
||||||
|
baseUrl: "https://api.github.com",
|
||||||
|
headers: {
|
||||||
|
accept: "application/vnd.github.v3+json",
|
||||||
|
"user-agent": userAgent
|
||||||
|
},
|
||||||
|
mediaType: {
|
||||||
|
format: "",
|
||||||
|
previews: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const endpoint = withDefaults(null, DEFAULTS);
|
||||||
|
|
||||||
|
export { endpoint };
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/endpoint/dist-web/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/endpoint/dist-web/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
21
node_modules/@octokit/endpoint/node_modules/is-plain-object/LICENSE
generated
vendored
Normal file
21
node_modules/@octokit/endpoint/node_modules/is-plain-object/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
119
node_modules/@octokit/endpoint/node_modules/is-plain-object/README.md
generated
vendored
Normal file
119
node_modules/@octokit/endpoint/node_modules/is-plain-object/README.md
generated
vendored
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
# is-plain-object [](https://www.npmjs.com/package/is-plain-object) [](https://npmjs.org/package/is-plain-object) [](https://npmjs.org/package/is-plain-object) [](https://travis-ci.org/jonschlinkert/is-plain-object)
|
||||||
|
|
||||||
|
> Returns true if an object was created by the `Object` constructor.
|
||||||
|
|
||||||
|
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Install with [npm](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install --save is-plain-object
|
||||||
|
```
|
||||||
|
|
||||||
|
Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
import isPlainObject from 'is-plain-object';
|
||||||
|
```
|
||||||
|
|
||||||
|
**true** when created by the `Object` constructor.
|
||||||
|
|
||||||
|
```js
|
||||||
|
isPlainObject(Object.create({}));
|
||||||
|
//=> true
|
||||||
|
isPlainObject(Object.create(Object.prototype));
|
||||||
|
//=> true
|
||||||
|
isPlainObject({foo: 'bar'});
|
||||||
|
//=> true
|
||||||
|
isPlainObject({});
|
||||||
|
//=> true
|
||||||
|
```
|
||||||
|
|
||||||
|
**false** when not created by the `Object` constructor.
|
||||||
|
|
||||||
|
```js
|
||||||
|
isPlainObject(1);
|
||||||
|
//=> false
|
||||||
|
isPlainObject(['foo', 'bar']);
|
||||||
|
//=> false
|
||||||
|
isPlainObject([]);
|
||||||
|
//=> false
|
||||||
|
isPlainObject(new Foo);
|
||||||
|
//=> false
|
||||||
|
isPlainObject(null);
|
||||||
|
//=> false
|
||||||
|
isPlainObject(Object.create(null));
|
||||||
|
//=> false
|
||||||
|
```
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><strong>Contributing</strong></summary>
|
||||||
|
|
||||||
|
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><strong>Running Tests</strong></summary>
|
||||||
|
|
||||||
|
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install && npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><strong>Building docs</strong></summary>
|
||||||
|
|
||||||
|
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||||
|
|
||||||
|
To generate the readme, run the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### Related projects
|
||||||
|
|
||||||
|
You might also be interested in these projects:
|
||||||
|
|
||||||
|
* [is-number](https://www.npmjs.com/package/is-number): Returns true if a number or string value is a finite number. Useful for regex… [more](https://github.com/jonschlinkert/is-number) | [homepage](https://github.com/jonschlinkert/is-number "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.")
|
||||||
|
* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
|
||||||
|
* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
|
||||||
|
| **Commits** | **Contributor** |
|
||||||
|
| --- | --- |
|
||||||
|
| 19 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||||
|
| 6 | [TrySound](https://github.com/TrySound) |
|
||||||
|
| 6 | [stevenvachon](https://github.com/stevenvachon) |
|
||||||
|
| 3 | [onokumus](https://github.com/onokumus) |
|
||||||
|
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
|
||||||
|
|
||||||
|
### Author
|
||||||
|
|
||||||
|
**Jon Schlinkert**
|
||||||
|
|
||||||
|
* [GitHub Profile](https://github.com/jonschlinkert)
|
||||||
|
* [Twitter Profile](https://twitter.com/jonschlinkert)
|
||||||
|
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
|
||||||
|
|
||||||
|
### License
|
||||||
|
|
||||||
|
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||||
|
Released under the [MIT License](LICENSE).
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 28, 2019._
|
48
node_modules/@octokit/endpoint/node_modules/is-plain-object/index.cjs.js
generated
vendored
Normal file
48
node_modules/@octokit/endpoint/node_modules/is-plain-object/index.cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* isobject <https://github.com/jonschlinkert/isobject>
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
* Released under the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isObject(val) {
|
||||||
|
return val != null && typeof val === 'object' && Array.isArray(val) === false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
* Released under the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isObjectObject(o) {
|
||||||
|
return isObject(o) === true
|
||||||
|
&& Object.prototype.toString.call(o) === '[object Object]';
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPlainObject(o) {
|
||||||
|
var ctor,prot;
|
||||||
|
|
||||||
|
if (isObjectObject(o) === false) return false;
|
||||||
|
|
||||||
|
// If has modified constructor
|
||||||
|
ctor = o.constructor;
|
||||||
|
if (typeof ctor !== 'function') return false;
|
||||||
|
|
||||||
|
// If has modified prototype
|
||||||
|
prot = ctor.prototype;
|
||||||
|
if (isObjectObject(prot) === false) return false;
|
||||||
|
|
||||||
|
// If constructor does not have an Object-specific method
|
||||||
|
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Most likely a plain Object
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = isPlainObject;
|
3
node_modules/@octokit/endpoint/node_modules/is-plain-object/index.d.ts
generated
vendored
Normal file
3
node_modules/@octokit/endpoint/node_modules/is-plain-object/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
declare function isPlainObject(o: any): boolean;
|
||||||
|
|
||||||
|
export default isPlainObject;
|
35
node_modules/@octokit/endpoint/node_modules/is-plain-object/index.js
generated
vendored
Normal file
35
node_modules/@octokit/endpoint/node_modules/is-plain-object/index.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*!
|
||||||
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
* Released under the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import isObject from 'isobject';
|
||||||
|
|
||||||
|
function isObjectObject(o) {
|
||||||
|
return isObject(o) === true
|
||||||
|
&& Object.prototype.toString.call(o) === '[object Object]';
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function isPlainObject(o) {
|
||||||
|
var ctor,prot;
|
||||||
|
|
||||||
|
if (isObjectObject(o) === false) return false;
|
||||||
|
|
||||||
|
// If has modified constructor
|
||||||
|
ctor = o.constructor;
|
||||||
|
if (typeof ctor !== 'function') return false;
|
||||||
|
|
||||||
|
// If has modified prototype
|
||||||
|
prot = ctor.prototype;
|
||||||
|
if (isObjectObject(prot) === false) return false;
|
||||||
|
|
||||||
|
// If constructor does not have an Object-specific method
|
||||||
|
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Most likely a plain Object
|
||||||
|
return true;
|
||||||
|
};
|
82
node_modules/@octokit/endpoint/node_modules/is-plain-object/package.json
generated
vendored
Normal file
82
node_modules/@octokit/endpoint/node_modules/is-plain-object/package.json
generated
vendored
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
"name": "is-plain-object",
|
||||||
|
"description": "Returns true if an object was created by the `Object` constructor.",
|
||||||
|
"version": "3.0.0",
|
||||||
|
"homepage": "https://github.com/jonschlinkert/is-plain-object",
|
||||||
|
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||||
|
"contributors": [
|
||||||
|
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
||||||
|
"Osman Nuri Okumuş (http://onokumus.com)",
|
||||||
|
"Steven Vachon (https://svachon.com)",
|
||||||
|
"(https://github.com/wtgtybhertgeghgtwtg)"
|
||||||
|
],
|
||||||
|
"repository": "jonschlinkert/is-plain-object",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/jonschlinkert/is-plain-object/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.cjs.js",
|
||||||
|
"module": "index.js",
|
||||||
|
"types": "index.d.ts",
|
||||||
|
"files": [
|
||||||
|
"index.d.ts",
|
||||||
|
"index.js",
|
||||||
|
"index.cjs.js"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "rollup -c",
|
||||||
|
"test_browser": "mocha-headless-chrome --args=disable-web-security -f test/browser.html",
|
||||||
|
"test_node": "mocha -r esm",
|
||||||
|
"test": "npm run test_node && npm run build && npm run test_browser",
|
||||||
|
"prepare": "rollup -c"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"isobject": "^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"chai": "^4.2.0",
|
||||||
|
"esm": "^3.2.22",
|
||||||
|
"gulp-format-md": "^1.0.0",
|
||||||
|
"mocha": "^6.1.4",
|
||||||
|
"mocha-headless-chrome": "^2.0.2",
|
||||||
|
"rollup": "^1.10.1",
|
||||||
|
"rollup-plugin-node-resolve": "^4.2.3"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"check",
|
||||||
|
"is",
|
||||||
|
"is-object",
|
||||||
|
"isobject",
|
||||||
|
"javascript",
|
||||||
|
"kind",
|
||||||
|
"kind-of",
|
||||||
|
"object",
|
||||||
|
"plain",
|
||||||
|
"type",
|
||||||
|
"typeof",
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"verb": {
|
||||||
|
"toc": false,
|
||||||
|
"layout": "default",
|
||||||
|
"tasks": [
|
||||||
|
"readme"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"gulp-format-md"
|
||||||
|
],
|
||||||
|
"related": {
|
||||||
|
"list": [
|
||||||
|
"is-number",
|
||||||
|
"isobject",
|
||||||
|
"kind-of"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"reflinks": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
node_modules/@octokit/endpoint/node_modules/isobject/LICENSE
generated
vendored
Normal file
21
node_modules/@octokit/endpoint/node_modules/isobject/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
127
node_modules/@octokit/endpoint/node_modules/isobject/README.md
generated
vendored
Normal file
127
node_modules/@octokit/endpoint/node_modules/isobject/README.md
generated
vendored
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
# isobject [](https://www.npmjs.com/package/isobject) [](https://npmjs.org/package/isobject) [](https://npmjs.org/package/isobject) [](https://travis-ci.org/jonschlinkert/isobject)
|
||||||
|
|
||||||
|
> Returns true if the value is an object and not an array or null.
|
||||||
|
|
||||||
|
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Install with [npm](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install --save isobject
|
||||||
|
```
|
||||||
|
|
||||||
|
Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Install with [npm](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install isobject
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
import isObject from 'isobject';
|
||||||
|
```
|
||||||
|
|
||||||
|
**True**
|
||||||
|
|
||||||
|
All of the following return `true`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
isObject({});
|
||||||
|
isObject(Object.create({}));
|
||||||
|
isObject(Object.create(Object.prototype));
|
||||||
|
isObject(Object.create(null));
|
||||||
|
isObject({});
|
||||||
|
isObject(new Foo);
|
||||||
|
isObject(/foo/);
|
||||||
|
```
|
||||||
|
|
||||||
|
**False**
|
||||||
|
|
||||||
|
All of the following return `false`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
isObject();
|
||||||
|
isObject(function () {});
|
||||||
|
isObject(1);
|
||||||
|
isObject([]);
|
||||||
|
isObject(undefined);
|
||||||
|
isObject(null);
|
||||||
|
```
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><strong>Contributing</strong></summary>
|
||||||
|
|
||||||
|
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><strong>Running Tests</strong></summary>
|
||||||
|
|
||||||
|
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install && npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><strong>Building docs</strong></summary>
|
||||||
|
|
||||||
|
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||||
|
|
||||||
|
To generate the readme, run the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### Related projects
|
||||||
|
|
||||||
|
You might also be interested in these projects:
|
||||||
|
|
||||||
|
* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.")
|
||||||
|
* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.")
|
||||||
|
* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")
|
||||||
|
* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.")
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
|
||||||
|
| **Commits** | **Contributor** |
|
||||||
|
| --- | --- |
|
||||||
|
| 30 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||||
|
| 8 | [doowb](https://github.com/doowb) |
|
||||||
|
| 7 | [TrySound](https://github.com/TrySound) |
|
||||||
|
| 3 | [onokumus](https://github.com/onokumus) |
|
||||||
|
| 1 | [LeSuisse](https://github.com/LeSuisse) |
|
||||||
|
| 1 | [tmcw](https://github.com/tmcw) |
|
||||||
|
| 1 | [ZhouHansen](https://github.com/ZhouHansen) |
|
||||||
|
|
||||||
|
### Author
|
||||||
|
|
||||||
|
**Jon Schlinkert**
|
||||||
|
|
||||||
|
* [GitHub Profile](https://github.com/jonschlinkert)
|
||||||
|
* [Twitter Profile](https://twitter.com/jonschlinkert)
|
||||||
|
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
|
||||||
|
|
||||||
|
### License
|
||||||
|
|
||||||
|
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||||
|
Released under the [MIT License](LICENSE).
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 28, 2019._
|
14
node_modules/@octokit/endpoint/node_modules/isobject/index.cjs.js
generated
vendored
Normal file
14
node_modules/@octokit/endpoint/node_modules/isobject/index.cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* isobject <https://github.com/jonschlinkert/isobject>
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
* Released under the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function isObject(val) {
|
||||||
|
return val != null && typeof val === 'object' && Array.isArray(val) === false;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = isObject;
|
3
node_modules/@octokit/endpoint/node_modules/isobject/index.d.ts
generated
vendored
Normal file
3
node_modules/@octokit/endpoint/node_modules/isobject/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
declare function isObject(val: any): boolean;
|
||||||
|
|
||||||
|
export default isObject;
|
10
node_modules/@octokit/endpoint/node_modules/isobject/index.js
generated
vendored
Normal file
10
node_modules/@octokit/endpoint/node_modules/isobject/index.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
/*!
|
||||||
|
* isobject <https://github.com/jonschlinkert/isobject>
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
* Released under the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default function isObject(val) {
|
||||||
|
return val != null && typeof val === 'object' && Array.isArray(val) === false;
|
||||||
|
};
|
80
node_modules/@octokit/endpoint/node_modules/isobject/package.json
generated
vendored
Normal file
80
node_modules/@octokit/endpoint/node_modules/isobject/package.json
generated
vendored
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
{
|
||||||
|
"name": "isobject",
|
||||||
|
"description": "Returns true if the value is an object and not an array or null.",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"homepage": "https://github.com/jonschlinkert/isobject",
|
||||||
|
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||||
|
"contributors": [
|
||||||
|
"(https://github.com/LeSuisse)",
|
||||||
|
"Brian Woodward (https://twitter.com/doowb)",
|
||||||
|
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
||||||
|
"Magnús Dæhlen (https://github.com/magnudae)",
|
||||||
|
"Tom MacWright (https://macwright.org)"
|
||||||
|
],
|
||||||
|
"repository": "jonschlinkert/isobject",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/jonschlinkert/isobject/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"files": [
|
||||||
|
"index.d.ts",
|
||||||
|
"index.cjs.js",
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"main": "index.cjs.js",
|
||||||
|
"module": "index.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "rollup -i index.js -o index.cjs.js -f cjs",
|
||||||
|
"test": "mocha -r esm",
|
||||||
|
"prepublish": "npm run build"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"esm": "^3.2.22",
|
||||||
|
"gulp-format-md": "^0.1.9",
|
||||||
|
"mocha": "^2.4.5",
|
||||||
|
"rollup": "^1.10.1"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"check",
|
||||||
|
"is",
|
||||||
|
"is-object",
|
||||||
|
"isobject",
|
||||||
|
"kind",
|
||||||
|
"kind-of",
|
||||||
|
"kindof",
|
||||||
|
"native",
|
||||||
|
"object",
|
||||||
|
"type",
|
||||||
|
"typeof",
|
||||||
|
"value"
|
||||||
|
],
|
||||||
|
"types": "index.d.ts",
|
||||||
|
"verb": {
|
||||||
|
"related": {
|
||||||
|
"list": [
|
||||||
|
"extend-shallow",
|
||||||
|
"is-plain-object",
|
||||||
|
"kind-of",
|
||||||
|
"merge-deep"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"toc": false,
|
||||||
|
"layout": "default",
|
||||||
|
"tasks": [
|
||||||
|
"readme"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"gulp-format-md"
|
||||||
|
],
|
||||||
|
"lint": {
|
||||||
|
"reflinks": true
|
||||||
|
},
|
||||||
|
"reflinks": [
|
||||||
|
"verb"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
51
node_modules/@octokit/endpoint/package.json
generated
vendored
Normal file
51
node_modules/@octokit/endpoint/package.json
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
"name": "@octokit/endpoint",
|
||||||
|
"description": "Turns REST API endpoints into generic request options",
|
||||||
|
"version": "5.5.1",
|
||||||
|
"license": "MIT",
|
||||||
|
"files": [
|
||||||
|
"dist-*/",
|
||||||
|
"bin/"
|
||||||
|
],
|
||||||
|
"pika": true,
|
||||||
|
"sideEffects": false,
|
||||||
|
"keywords": [
|
||||||
|
"octokit",
|
||||||
|
"github",
|
||||||
|
"api",
|
||||||
|
"rest"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/octokit/endpoint.js#readme",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/octokit/endpoint.js/issues"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/octokit/endpoint.js.git"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/types": "^2.0.0",
|
||||||
|
"is-plain-object": "^3.0.0",
|
||||||
|
"universal-user-agent": "^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@pika/pack": "^0.5.0",
|
||||||
|
"@pika/plugin-build-node": "^0.7.0",
|
||||||
|
"@pika/plugin-build-web": "^0.7.0",
|
||||||
|
"@pika/plugin-ts-standard-pkg": "^0.7.0",
|
||||||
|
"@types/jest": "^24.0.11",
|
||||||
|
"jest": "^24.7.1",
|
||||||
|
"prettier": "1.18.2",
|
||||||
|
"semantic-release": "^15.13.8",
|
||||||
|
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||||
|
"ts-jest": "^24.0.2",
|
||||||
|
"typescript": "^3.4.5"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"source": "dist-src/index.js",
|
||||||
|
"types": "dist-types/index.d.ts",
|
||||||
|
"main": "dist-node/index.js",
|
||||||
|
"deno": "dist-web/index.js"
|
||||||
|
}
|
21
node_modules/@octokit/graphql/LICENSE
generated
vendored
Normal file
21
node_modules/@octokit/graphql/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2018 Octokit contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
380
node_modules/@octokit/graphql/README.md
generated
vendored
Normal file
380
node_modules/@octokit/graphql/README.md
generated
vendored
Normal file
|
@ -0,0 +1,380 @@
|
||||||
|
# graphql.js
|
||||||
|
|
||||||
|
> GitHub GraphQL API client for browsers and Node
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/@octokit/graphql)
|
||||||
|
[](https://travis-ci.com/octokit/graphql.js)
|
||||||
|
[](https://greenkeeper.io/)
|
||||||
|
|
||||||
|
<!-- toc -->
|
||||||
|
|
||||||
|
- [Usage](#usage)
|
||||||
|
- [Send a simple query](#send-a-simple-query)
|
||||||
|
- [Authentication](#authentication)
|
||||||
|
- [Variables](#variables)
|
||||||
|
- [Pass query together with headers and variables](#pass-query-together-with-headers-and-variables)
|
||||||
|
- [Use your own `@octokit/request` instance](#)
|
||||||
|
- [Errors](#errors)
|
||||||
|
- [Partial responses](#partial-responses)
|
||||||
|
- [Writing tests](#writing-tests)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
|
<!-- tocstop -->
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody valign=top align=left>
|
||||||
|
<tr><th>
|
||||||
|
Browsers
|
||||||
|
</th><td width=100%>
|
||||||
|
|
||||||
|
Load `@octokit/graphql` directly from [cdn.pika.dev](https://cdn.pika.dev)
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="module">
|
||||||
|
import { endpoint } from "https://cdn.pika.dev/@octokit/graphql";
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
</td></tr>
|
||||||
|
<tr><th>
|
||||||
|
Node
|
||||||
|
</th><td>
|
||||||
|
|
||||||
|
Install with <code>npm install @octokit/graphql</code>
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { graphql } = require("@octokit/graphql");
|
||||||
|
// or: import { graphql } from "@octokit/graphql";
|
||||||
|
```
|
||||||
|
|
||||||
|
</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
### Send a simple query
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { repository } = await graphql(
|
||||||
|
`
|
||||||
|
{
|
||||||
|
repository(owner: "octokit", name: "graphql.js") {
|
||||||
|
issues(last: 3) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
authorization: `token secret123`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Authentication
|
||||||
|
|
||||||
|
The simplest way to authenticate a request is to set the `Authorization` header, e.g. to a [personal access token](https://github.com/settings/tokens/).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const graphqlWithAuth = graphql.defaults({
|
||||||
|
headers: {
|
||||||
|
authorization: `token secret123`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const { repository } = await graphqlWithAuth(`
|
||||||
|
{
|
||||||
|
repository(owner: "octokit", name: "graphql.js") {
|
||||||
|
issues(last: 3) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
```
|
||||||
|
|
||||||
|
For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by [`@octokit/auth`](https://github.com/octokit/auth.js).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { createAppAuth } = require("@octokit/auth-app");
|
||||||
|
const auth = createAppAuth({
|
||||||
|
id: process.env.APP_ID,
|
||||||
|
privateKey: process.env.PRIVATE_KEY,
|
||||||
|
installationId: 123
|
||||||
|
});
|
||||||
|
const graphqlWithAuth = graphql.defaults({
|
||||||
|
request: {
|
||||||
|
hook: auth.hook
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { repository } = await graphqlWithAuth(
|
||||||
|
`{
|
||||||
|
repository(owner: "octokit", name: "graphql.js") {
|
||||||
|
issues(last: 3) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Variables
|
||||||
|
|
||||||
|
⚠️ Do not use [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) in the query strings as they make your code vulnerable to query injection attacks (see [#2](https://github.com/octokit/graphql.js/issues/2)). Use variables instead:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { lastIssues } = await graphql(`query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||||
|
repository(owner:$owner, name:$repo) {
|
||||||
|
issues(last:$num) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`, {
|
||||||
|
owner: 'octokit',
|
||||||
|
repo: 'graphql.js'
|
||||||
|
headers: {
|
||||||
|
authorization: `token secret123`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pass query together with headers and variables
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { graphql } = require('@octokit/graphql')
|
||||||
|
const { lastIssues } = await graphql({
|
||||||
|
query: `query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||||
|
repository(owner:$owner, name:$repo) {
|
||||||
|
issues(last:$num) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`,
|
||||||
|
owner: 'octokit',
|
||||||
|
repo: 'graphql.js'
|
||||||
|
headers: {
|
||||||
|
authorization: `token secret123`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use with GitHub Enterprise
|
||||||
|
|
||||||
|
```js
|
||||||
|
let { graphql } = require("@octokit/graphql");
|
||||||
|
graphql = graphql.defaults({
|
||||||
|
baseUrl: "https://github-enterprise.acme-inc.com/api",
|
||||||
|
headers: {
|
||||||
|
authorization: `token secret123`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const { repository } = await graphql(`
|
||||||
|
{
|
||||||
|
repository(owner: "acme-project", name: "acme-repo") {
|
||||||
|
issues(last: 3) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use custom `@octokit/request` instance
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { request } = require("@octokit/request");
|
||||||
|
const { withCustomRequest } = require("@octokit/graphql");
|
||||||
|
|
||||||
|
let requestCounter = 0
|
||||||
|
const myRequest = request.defaults({
|
||||||
|
headers: {
|
||||||
|
authentication: 'token secret123'
|
||||||
|
},
|
||||||
|
request: {
|
||||||
|
hook(request, options) {
|
||||||
|
requestCounter++
|
||||||
|
return request(options)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const myGraphql = withCustomRequest(myRequest)
|
||||||
|
await request('/')
|
||||||
|
await myGraphql(`
|
||||||
|
{
|
||||||
|
repository(owner: "acme-project", name: "acme-repo") {
|
||||||
|
issues(last: 3) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
// requestCounter is now 2
|
||||||
|
```
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
|
||||||
|
In case of a GraphQL error, `error.message` is set to the first error from the response’s `errors` array. All errors can be accessed at `error.errors`. `error.request` has the request options such as query, variables and headers set for easier debugging.
|
||||||
|
|
||||||
|
```js
|
||||||
|
let { graphql } = require("@octokit/graphql");
|
||||||
|
graphqlt = graphql.defaults({
|
||||||
|
headers: {
|
||||||
|
authorization: `token secret123`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const query = `{
|
||||||
|
viewer {
|
||||||
|
bioHtml
|
||||||
|
}
|
||||||
|
}`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await graphql(query);
|
||||||
|
} catch (error) {
|
||||||
|
// server responds with
|
||||||
|
// {
|
||||||
|
// "data": null,
|
||||||
|
// "errors": [{
|
||||||
|
// "message": "Field 'bioHtml' doesn't exist on type 'User'",
|
||||||
|
// "locations": [{
|
||||||
|
// "line": 3,
|
||||||
|
// "column": 5
|
||||||
|
// }]
|
||||||
|
// }]
|
||||||
|
// }
|
||||||
|
|
||||||
|
console.log("Request failed:", error.request); // { query, variables: {}, headers: { authorization: 'token secret123' } }
|
||||||
|
console.log(error.message); // Field 'bioHtml' doesn't exist on type 'User'
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Partial responses
|
||||||
|
|
||||||
|
A GraphQL query may respond with partial data accompanied by errors. In this case we will throw an error but the partial data will still be accessible through `error.data`
|
||||||
|
|
||||||
|
```js
|
||||||
|
let { graphql } = require("@octokit/graphql");
|
||||||
|
graphql = graphql.defaults({
|
||||||
|
headers: {
|
||||||
|
authorization: `token secret123`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const query = `{
|
||||||
|
repository(name: "probot", owner: "probot") {
|
||||||
|
name
|
||||||
|
ref(qualifiedName: "master") {
|
||||||
|
target {
|
||||||
|
... on Commit {
|
||||||
|
history(first: 25, after: "invalid cursor") {
|
||||||
|
nodes {
|
||||||
|
message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await graphql(query);
|
||||||
|
} catch (error) {
|
||||||
|
// server responds with
|
||||||
|
// {
|
||||||
|
// "data": {
|
||||||
|
// "repository": {
|
||||||
|
// "name": "probot",
|
||||||
|
// "ref": null
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// "errors": [
|
||||||
|
// {
|
||||||
|
// "type": "INVALID_CURSOR_ARGUMENTS",
|
||||||
|
// "path": [
|
||||||
|
// "repository",
|
||||||
|
// "ref",
|
||||||
|
// "target",
|
||||||
|
// "history"
|
||||||
|
// ],
|
||||||
|
// "locations": [
|
||||||
|
// {
|
||||||
|
// "line": 7,
|
||||||
|
// "column": 11
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "message": "`invalid cursor` does not appear to be a valid cursor."
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
|
||||||
|
console.log("Request failed:", error.request); // { query, variables: {}, headers: { authorization: 'token secret123' } }
|
||||||
|
console.log(error.message); // `invalid cursor` does not appear to be a valid cursor.
|
||||||
|
console.log(error.data); // { repository: { name: 'probot', ref: null } }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Writing tests
|
||||||
|
|
||||||
|
You can pass a replacement for [the built-in fetch implementation](https://github.com/bitinn/node-fetch) as `request.fetch` option. For example, using [fetch-mock](http://www.wheresrhys.co.uk/fetch-mock/) works great to write tests
|
||||||
|
|
||||||
|
```js
|
||||||
|
const assert = require("assert");
|
||||||
|
const fetchMock = require("fetch-mock/es5/server");
|
||||||
|
|
||||||
|
const { graphql } = require("@octokit/graphql");
|
||||||
|
|
||||||
|
graphql("{ viewer { login } }", {
|
||||||
|
headers: {
|
||||||
|
authorization: "token secret123"
|
||||||
|
},
|
||||||
|
request: {
|
||||||
|
fetch: fetchMock
|
||||||
|
.sandbox()
|
||||||
|
.post("https://api.github.com/graphql", (url, options) => {
|
||||||
|
assert.strictEqual(options.headers.authorization, "token secret123");
|
||||||
|
assert.strictEqual(
|
||||||
|
options.body,
|
||||||
|
'{"query":"{ viewer { login } }"}',
|
||||||
|
"Sends correct query"
|
||||||
|
);
|
||||||
|
return { data: {} };
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](LICENSE)
|
85
node_modules/@octokit/graphql/dist-node/index.js
generated
vendored
Normal file
85
node_modules/@octokit/graphql/dist-node/index.js
generated
vendored
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
var request = require('@octokit/request');
|
||||||
|
var universalUserAgent = require('universal-user-agent');
|
||||||
|
|
||||||
|
const VERSION = "4.3.1";
|
||||||
|
|
||||||
|
class GraphqlError extends Error {
|
||||||
|
constructor(request, response) {
|
||||||
|
const message = response.data.errors[0].message;
|
||||||
|
super(message);
|
||||||
|
Object.assign(this, response.data);
|
||||||
|
this.name = "GraphqlError";
|
||||||
|
this.request = request; // Maintains proper stack trace (only available on V8)
|
||||||
|
|
||||||
|
/* istanbul ignore next */
|
||||||
|
|
||||||
|
if (Error.captureStackTrace) {
|
||||||
|
Error.captureStackTrace(this, this.constructor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
|
||||||
|
function graphql(request, query, options) {
|
||||||
|
options = typeof query === "string" ? options = Object.assign({
|
||||||
|
query
|
||||||
|
}, options) : options = query;
|
||||||
|
const requestOptions = Object.keys(options).reduce((result, key) => {
|
||||||
|
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
||||||
|
result[key] = options[key];
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result.variables) {
|
||||||
|
result.variables = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
result.variables[key] = options[key];
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
return request(requestOptions).then(response => {
|
||||||
|
if (response.data.errors) {
|
||||||
|
throw new GraphqlError(requestOptions, {
|
||||||
|
data: response.data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.data.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function withDefaults(request$1, newDefaults) {
|
||||||
|
const newRequest = request$1.defaults(newDefaults);
|
||||||
|
|
||||||
|
const newApi = (query, options) => {
|
||||||
|
return graphql(newRequest, query, options);
|
||||||
|
};
|
||||||
|
|
||||||
|
return Object.assign(newApi, {
|
||||||
|
defaults: withDefaults.bind(null, newRequest),
|
||||||
|
endpoint: request.request.endpoint
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const graphql$1 = withDefaults(request.request, {
|
||||||
|
headers: {
|
||||||
|
"user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
url: "/graphql"
|
||||||
|
});
|
||||||
|
function withCustomRequest(customRequest) {
|
||||||
|
return withDefaults(customRequest, {
|
||||||
|
method: "POST",
|
||||||
|
url: "/graphql"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.graphql = graphql$1;
|
||||||
|
exports.withCustomRequest = withCustomRequest;
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/graphql/dist-node/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/graphql/dist-node/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
node_modules/@octokit/graphql/dist-src/error.js
generated
vendored
Normal file
14
node_modules/@octokit/graphql/dist-src/error.js
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
export class GraphqlError extends Error {
|
||||||
|
constructor(request, response) {
|
||||||
|
const message = response.data.errors[0].message;
|
||||||
|
super(message);
|
||||||
|
Object.assign(this, response.data);
|
||||||
|
this.name = "GraphqlError";
|
||||||
|
this.request = request;
|
||||||
|
// Maintains proper stack trace (only available on V8)
|
||||||
|
/* istanbul ignore next */
|
||||||
|
if (Error.captureStackTrace) {
|
||||||
|
Error.captureStackTrace(this, this.constructor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
34
node_modules/@octokit/graphql/dist-src/graphql.js
generated
vendored
Normal file
34
node_modules/@octokit/graphql/dist-src/graphql.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
import { GraphqlError } from "./error";
|
||||||
|
const NON_VARIABLE_OPTIONS = [
|
||||||
|
"method",
|
||||||
|
"baseUrl",
|
||||||
|
"url",
|
||||||
|
"headers",
|
||||||
|
"request",
|
||||||
|
"query"
|
||||||
|
];
|
||||||
|
export function graphql(request, query, options) {
|
||||||
|
options =
|
||||||
|
typeof query === "string"
|
||||||
|
? (options = Object.assign({ query }, options))
|
||||||
|
: (options = query);
|
||||||
|
const requestOptions = Object.keys(options).reduce((result, key) => {
|
||||||
|
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
||||||
|
result[key] = options[key];
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (!result.variables) {
|
||||||
|
result.variables = {};
|
||||||
|
}
|
||||||
|
result.variables[key] = options[key];
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
return request(requestOptions).then(response => {
|
||||||
|
if (response.data.errors) {
|
||||||
|
throw new GraphqlError(requestOptions, {
|
||||||
|
data: response.data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return response.data.data;
|
||||||
|
});
|
||||||
|
}
|
17
node_modules/@octokit/graphql/dist-src/index.js
generated
vendored
Normal file
17
node_modules/@octokit/graphql/dist-src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { request } from "@octokit/request";
|
||||||
|
import { getUserAgent } from "universal-user-agent";
|
||||||
|
import { VERSION } from "./version";
|
||||||
|
import { withDefaults } from "./with-defaults";
|
||||||
|
export const graphql = withDefaults(request, {
|
||||||
|
headers: {
|
||||||
|
"user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
url: "/graphql"
|
||||||
|
});
|
||||||
|
export function withCustomRequest(customRequest) {
|
||||||
|
return withDefaults(customRequest, {
|
||||||
|
method: "POST",
|
||||||
|
url: "/graphql"
|
||||||
|
});
|
||||||
|
}
|
0
node_modules/@octokit/graphql/dist-src/types.js
generated
vendored
Normal file
0
node_modules/@octokit/graphql/dist-src/types.js
generated
vendored
Normal file
1
node_modules/@octokit/graphql/dist-src/version.js
generated
vendored
Normal file
1
node_modules/@octokit/graphql/dist-src/version.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export const VERSION = "4.3.1";
|
12
node_modules/@octokit/graphql/dist-src/with-defaults.js
generated
vendored
Normal file
12
node_modules/@octokit/graphql/dist-src/with-defaults.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { request as Request } from "@octokit/request";
|
||||||
|
import { graphql } from "./graphql";
|
||||||
|
export function withDefaults(request, newDefaults) {
|
||||||
|
const newRequest = request.defaults(newDefaults);
|
||||||
|
const newApi = (query, options) => {
|
||||||
|
return graphql(newRequest, query, options);
|
||||||
|
};
|
||||||
|
return Object.assign(newApi, {
|
||||||
|
defaults: withDefaults.bind(null, newRequest),
|
||||||
|
endpoint: Request.endpoint
|
||||||
|
});
|
||||||
|
}
|
7
node_modules/@octokit/graphql/dist-types/error.d.ts
generated
vendored
Normal file
7
node_modules/@octokit/graphql/dist-types/error.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import { EndpointOptions, GraphQlQueryResponse } from "./types";
|
||||||
|
export declare class GraphqlError<T extends GraphQlQueryResponse> extends Error {
|
||||||
|
request: EndpointOptions;
|
||||||
|
constructor(request: EndpointOptions, response: {
|
||||||
|
data: Required<GraphQlQueryResponse>;
|
||||||
|
});
|
||||||
|
}
|
3
node_modules/@octokit/graphql/dist-types/graphql.d.ts
generated
vendored
Normal file
3
node_modules/@octokit/graphql/dist-types/graphql.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { request as Request } from "@octokit/request";
|
||||||
|
import { RequestParameters, GraphQlQueryResponseData } from "./types";
|
||||||
|
export declare function graphql(request: typeof Request, query: string | RequestParameters, options?: RequestParameters): Promise<GraphQlQueryResponseData>;
|
3
node_modules/@octokit/graphql/dist-types/index.d.ts
generated
vendored
Normal file
3
node_modules/@octokit/graphql/dist-types/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { request } from "@octokit/request";
|
||||||
|
export declare const graphql: import("./types").graphql;
|
||||||
|
export declare function withCustomRequest(customRequest: typeof request): import("./types").graphql;
|
47
node_modules/@octokit/graphql/dist-types/types.d.ts
generated
vendored
Normal file
47
node_modules/@octokit/graphql/dist-types/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
import * as OctokitTypes from "@octokit/types";
|
||||||
|
import { graphql } from "./graphql";
|
||||||
|
export declare type EndpointOptions = OctokitTypes.EndpointOptions;
|
||||||
|
export declare type RequestParameters = OctokitTypes.RequestParameters;
|
||||||
|
export declare type Query = string;
|
||||||
|
export interface graphql {
|
||||||
|
/**
|
||||||
|
* Sends a GraphQL query request based on endpoint options
|
||||||
|
* The GraphQL query must be specified in `options`.
|
||||||
|
*
|
||||||
|
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||||
|
*/
|
||||||
|
(options: OctokitTypes.RequestParameters): GraphQlResponse;
|
||||||
|
/**
|
||||||
|
* Sends a GraphQL query request based on endpoint options
|
||||||
|
*
|
||||||
|
* @param {string} query GraphQL query. Example: `'query { viewer { login } }'`.
|
||||||
|
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
|
||||||
|
*/
|
||||||
|
(query: Query, parameters?: OctokitTypes.RequestParameters): GraphQlResponse;
|
||||||
|
/**
|
||||||
|
* Returns a new `endpoint` with updated route and parameters
|
||||||
|
*/
|
||||||
|
defaults: (newDefaults: OctokitTypes.RequestParameters) => graphql;
|
||||||
|
/**
|
||||||
|
* Octokit endpoint API, see {@link https://github.com/octokit/endpoint.js|@octokit/endpoint}
|
||||||
|
*/
|
||||||
|
endpoint: OctokitTypes.EndpointInterface;
|
||||||
|
}
|
||||||
|
export declare type GraphQlResponse = ReturnType<typeof graphql>;
|
||||||
|
export declare type GraphQlQueryResponseData = {
|
||||||
|
[key: string]: any;
|
||||||
|
} | null;
|
||||||
|
export declare type GraphQlQueryResponse = {
|
||||||
|
data: GraphQlQueryResponseData;
|
||||||
|
errors?: [{
|
||||||
|
message: string;
|
||||||
|
path: [string];
|
||||||
|
extensions: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
locations: [{
|
||||||
|
line: number;
|
||||||
|
column: number;
|
||||||
|
}];
|
||||||
|
}];
|
||||||
|
};
|
1
node_modules/@octokit/graphql/dist-types/version.d.ts
generated
vendored
Normal file
1
node_modules/@octokit/graphql/dist-types/version.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export declare const VERSION = "4.3.1";
|
3
node_modules/@octokit/graphql/dist-types/with-defaults.d.ts
generated
vendored
Normal file
3
node_modules/@octokit/graphql/dist-types/with-defaults.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { request as Request } from "@octokit/request";
|
||||||
|
import { graphql as ApiInterface, RequestParameters } from "./types";
|
||||||
|
export declare function withDefaults(request: typeof Request, newDefaults: RequestParameters): ApiInterface;
|
81
node_modules/@octokit/graphql/dist-web/index.js
generated
vendored
Normal file
81
node_modules/@octokit/graphql/dist-web/index.js
generated
vendored
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
import { request } from '@octokit/request';
|
||||||
|
import { getUserAgent } from 'universal-user-agent';
|
||||||
|
|
||||||
|
const VERSION = "4.3.1";
|
||||||
|
|
||||||
|
class GraphqlError extends Error {
|
||||||
|
constructor(request, response) {
|
||||||
|
const message = response.data.errors[0].message;
|
||||||
|
super(message);
|
||||||
|
Object.assign(this, response.data);
|
||||||
|
this.name = "GraphqlError";
|
||||||
|
this.request = request;
|
||||||
|
// Maintains proper stack trace (only available on V8)
|
||||||
|
/* istanbul ignore next */
|
||||||
|
if (Error.captureStackTrace) {
|
||||||
|
Error.captureStackTrace(this, this.constructor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const NON_VARIABLE_OPTIONS = [
|
||||||
|
"method",
|
||||||
|
"baseUrl",
|
||||||
|
"url",
|
||||||
|
"headers",
|
||||||
|
"request",
|
||||||
|
"query"
|
||||||
|
];
|
||||||
|
function graphql(request, query, options) {
|
||||||
|
options =
|
||||||
|
typeof query === "string"
|
||||||
|
? (options = Object.assign({ query }, options))
|
||||||
|
: (options = query);
|
||||||
|
const requestOptions = Object.keys(options).reduce((result, key) => {
|
||||||
|
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
||||||
|
result[key] = options[key];
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (!result.variables) {
|
||||||
|
result.variables = {};
|
||||||
|
}
|
||||||
|
result.variables[key] = options[key];
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
return request(requestOptions).then(response => {
|
||||||
|
if (response.data.errors) {
|
||||||
|
throw new GraphqlError(requestOptions, {
|
||||||
|
data: response.data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return response.data.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function withDefaults(request$1, newDefaults) {
|
||||||
|
const newRequest = request$1.defaults(newDefaults);
|
||||||
|
const newApi = (query, options) => {
|
||||||
|
return graphql(newRequest, query, options);
|
||||||
|
};
|
||||||
|
return Object.assign(newApi, {
|
||||||
|
defaults: withDefaults.bind(null, newRequest),
|
||||||
|
endpoint: request.endpoint
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const graphql$1 = withDefaults(request, {
|
||||||
|
headers: {
|
||||||
|
"user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
url: "/graphql"
|
||||||
|
});
|
||||||
|
function withCustomRequest(customRequest) {
|
||||||
|
return withDefaults(customRequest, {
|
||||||
|
method: "POST",
|
||||||
|
url: "/graphql"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { graphql$1 as graphql, withCustomRequest };
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/graphql/dist-web/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/graphql/dist-web/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/error.js","../dist-src/graphql.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"4.3.1\";\n","export class GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n this.name = \"GraphqlError\";\n this.request = request;\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n","import { GraphqlError } from \"./error\";\nconst NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\"\n];\nexport function graphql(request, query, options) {\n options =\n typeof query === \"string\"\n ? (options = Object.assign({ query }, options))\n : (options = query);\n const requestOptions = Object.keys(options).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = options[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = options[key];\n return result;\n }, {});\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n throw new GraphqlError(requestOptions, {\n data: response.data\n });\n }\n return response.data.data;\n });\n}\n","import { request as Request } from \"@octokit/request\";\nimport { graphql } from \"./graphql\";\nexport function withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: Request.endpoint\n });\n}\n","import { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport { withDefaults } from \"./with-defaults\";\nexport const graphql = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nexport function withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n"],"names":["request","Request","graphql"],"mappings":";;;AAAO,MAAM,OAAO,GAAG,mBAAmB,CAAC;;ACApC,MAAM,YAAY,SAAS,KAAK,CAAC;IACpC,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE;QAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;;QAGvB,IAAI,KAAK,CAAC,iBAAiB,EAAE;YACzB,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACnD;KACJ;CACJ;;ACZD,MAAM,oBAAoB,GAAG;IACzB,QAAQ;IACR,SAAS;IACT,KAAK;IACL,SAAS;IACT,SAAS;IACT,OAAO;CACV,CAAC;AACF,AAAO,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7C,OAAO;QACH,OAAO,KAAK,KAAK,QAAQ;eAClB,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC;eAC3C,OAAO,GAAG,KAAK,CAAC,CAAC;IAC5B,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK;QAChE,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACpC,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YAC3B,OAAO,MAAM,CAAC;SACjB;QACD,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;YACnB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;SACzB;QACD,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,OAAO,MAAM,CAAC;KACjB,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI;QAC5C,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE;YACtB,MAAM,IAAI,YAAY,CAAC,cAAc,EAAE;gBACnC,IAAI,EAAE,QAAQ,CAAC,IAAI;aACtB,CAAC,CAAC;SACN;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;KAC7B,CAAC,CAAC;CACN;;AC/BM,SAAS,YAAY,CAACA,SAAO,EAAE,WAAW,EAAE;IAC/C,MAAM,UAAU,GAAGA,SAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK;QAC/B,OAAO,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KAC9C,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;QACzB,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;QAC7C,QAAQ,EAAEC,OAAO,CAAC,QAAQ;KAC7B,CAAC,CAAC;CACN;;ACPW,MAACC,SAAO,GAAG,YAAY,CAAC,OAAO,EAAE;IACzC,OAAO,EAAE;QACL,YAAY,EAAE,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;KAClE;IACD,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,UAAU;CAClB,CAAC,CAAC;AACH,AAAO,SAAS,iBAAiB,CAAC,aAAa,EAAE;IAC7C,OAAO,YAAY,CAAC,aAAa,EAAE;QAC/B,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,UAAU;KAClB,CAAC,CAAC;CACN;;;;"}
|
54
node_modules/@octokit/graphql/package.json
generated
vendored
Normal file
54
node_modules/@octokit/graphql/package.json
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
"name": "@octokit/graphql",
|
||||||
|
"description": "GitHub GraphQL API client for browsers and Node",
|
||||||
|
"version": "4.3.1",
|
||||||
|
"license": "MIT",
|
||||||
|
"files": [
|
||||||
|
"dist-*/",
|
||||||
|
"bin/"
|
||||||
|
],
|
||||||
|
"pika": true,
|
||||||
|
"sideEffects": false,
|
||||||
|
"keywords": [
|
||||||
|
"octokit",
|
||||||
|
"github",
|
||||||
|
"api",
|
||||||
|
"graphql"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/octokit/graphql.js#readme",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/octokit/graphql.js/issues"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/octokit/graphql.js.git"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/request": "^5.3.0",
|
||||||
|
"@octokit/types": "^2.0.0",
|
||||||
|
"universal-user-agent": "^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@pika/pack": "^0.5.0",
|
||||||
|
"@pika/plugin-build-node": "^0.7.0",
|
||||||
|
"@pika/plugin-build-web": "^0.7.0",
|
||||||
|
"@pika/plugin-ts-standard-pkg": "^0.7.0",
|
||||||
|
"@types/fetch-mock": "^7.2.5",
|
||||||
|
"@types/jest": "^24.0.13",
|
||||||
|
"@types/node": "^12.0.2",
|
||||||
|
"fetch-mock": "^7.3.1",
|
||||||
|
"jest": "^24.8.0",
|
||||||
|
"prettier": "^1.17.1",
|
||||||
|
"semantic-release": "^15.13.3",
|
||||||
|
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||||
|
"ts-jest": "^24.0.2",
|
||||||
|
"typescript": "^3.4.5"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"source": "dist-src/index.js",
|
||||||
|
"types": "dist-types/index.d.ts",
|
||||||
|
"main": "dist-node/index.js",
|
||||||
|
"deno": "dist-web/index.js"
|
||||||
|
}
|
21
node_modules/@octokit/plugin-retry/LICENSE
generated
vendored
Normal file
21
node_modules/@octokit/plugin-retry/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2018 Octokit contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
105
node_modules/@octokit/plugin-retry/README.md
generated
vendored
Normal file
105
node_modules/@octokit/plugin-retry/README.md
generated
vendored
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
# plugin-retry.js
|
||||||
|
|
||||||
|
> Retries requests for server 4xx/5xx responses except `400`, `401`, `403` and `404`.
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/@octokit/plugin-retry)
|
||||||
|
[](https://github.com/octokit/plugin-retry.js/actions?workflow=Test)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody valign=top align=left>
|
||||||
|
<tr><th>
|
||||||
|
Browsers
|
||||||
|
</th><td width=100%>
|
||||||
|
|
||||||
|
Load `@octokit/plugin-retry` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev)
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="module">
|
||||||
|
import { Octokit } from "https://cdn.pika.dev/@octokit/core";
|
||||||
|
import { retry } from "https://cdn.pika.dev/@octokit/plugin-retry";
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
</td></tr>
|
||||||
|
<tr><th>
|
||||||
|
Node
|
||||||
|
</th><td>
|
||||||
|
|
||||||
|
Install with `npm install @octokit/core @octokit/plugin-retry`. Optionally replace `@octokit/core` with a core-compatible module
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { Octokit } = require("@octokit/core");
|
||||||
|
const { retry } = require("@octokit/plugin-retry");
|
||||||
|
```
|
||||||
|
|
||||||
|
</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
**Note**: If you use it with `@octokit/rest` v16, install `@octokit/core` as a devDependency. This is only temporary and will no longer be necessary with `@octokit/rest` v17.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const MyOctokit = Octokit.plugin(retry);
|
||||||
|
const octokit = new MyOctokit({ auth: "secret123" });
|
||||||
|
|
||||||
|
// retries request up to 3 times in case of a 500 response
|
||||||
|
octokit.request("/").catch((error) => {
|
||||||
|
if (error.request.request.retryCount) {
|
||||||
|
console.log(
|
||||||
|
`request failed after ${error.request.request.retryCount} retries`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
To override the default `doNotRetry` list:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const octokit = new MyOctokit({
|
||||||
|
auth: "secret123",
|
||||||
|
retry: {
|
||||||
|
doNotRetry: [
|
||||||
|
/* List of HTTP 4xx/5xx status codes */
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
To override the number of retries:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const octokit = new MyOctokit({
|
||||||
|
auth: "secret123",
|
||||||
|
request: { retries: 1 },
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
You can manually ask for retries for any request by passing `{ request: { retries: numRetries, retryAfter: delayInSeconds }}`
|
||||||
|
|
||||||
|
```js
|
||||||
|
octokit
|
||||||
|
.request("/", { request: { retries: 1, retryAfter: 1 } })
|
||||||
|
.catch((error) => {
|
||||||
|
if (error.request.request.retryCount) {
|
||||||
|
console.log(
|
||||||
|
`request failed after ${error.request.request.retryCount} retries`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Pass `{ retry: { enabled: false } }` to disable this plugin.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](LICENSE)
|
75
node_modules/@octokit/plugin-retry/dist-node/index.js
generated
vendored
Normal file
75
node_modules/@octokit/plugin-retry/dist-node/index.js
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||||
|
|
||||||
|
var Bottleneck = _interopDefault(require('bottleneck/light'));
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
async function errorRequest(octokit, state, error, options) {
|
||||||
|
if (!error.request || !error.request.request) {
|
||||||
|
// address https://github.com/octokit/plugin-retry.js/issues/8
|
||||||
|
throw error;
|
||||||
|
} // retry all >= 400 && not doNotRetry
|
||||||
|
|
||||||
|
|
||||||
|
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
|
||||||
|
const retries = options.request.retries != null ? options.request.retries : state.retries;
|
||||||
|
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
|
||||||
|
throw octokit.retry.retryRequest(error, retries, retryAfter);
|
||||||
|
} // Maybe eventually there will be more cases here
|
||||||
|
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
|
||||||
|
async function wrapRequest(state, request, options) {
|
||||||
|
const limiter = new Bottleneck(); // @ts-ignore
|
||||||
|
|
||||||
|
limiter.on("failed", function (error, info) {
|
||||||
|
const maxRetries = ~~error.request.request.retries;
|
||||||
|
const after = ~~error.request.request.retryAfter;
|
||||||
|
options.request.retryCount = info.retryCount + 1;
|
||||||
|
|
||||||
|
if (maxRetries > info.retryCount) {
|
||||||
|
// Returning a number instructs the limiter to retry
|
||||||
|
// the request after that number of milliseconds have passed
|
||||||
|
return after * state.retryAfterBaseValue;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return limiter.schedule(request, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
const VERSION = "3.0.2";
|
||||||
|
function retry(octokit, octokitOptions = {}) {
|
||||||
|
const state = Object.assign({
|
||||||
|
enabled: true,
|
||||||
|
retryAfterBaseValue: 1000,
|
||||||
|
doNotRetry: [400, 401, 403, 404, 422],
|
||||||
|
retries: 3
|
||||||
|
}, octokitOptions.retry);
|
||||||
|
octokit.retry = {
|
||||||
|
retryRequest: (error, retries, retryAfter) => {
|
||||||
|
error.request.request = Object.assign({}, error.request.request, {
|
||||||
|
retries: retries,
|
||||||
|
retryAfter: retryAfter
|
||||||
|
});
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!state.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
|
||||||
|
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
||||||
|
}
|
||||||
|
retry.VERSION = VERSION;
|
||||||
|
|
||||||
|
exports.VERSION = VERSION;
|
||||||
|
exports.retry = retry;
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/plugin-retry/dist-node/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/plugin-retry/dist-node/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/@octokit/plugin-retry/dist-src/error-request.js
generated
vendored
Normal file
15
node_modules/@octokit/plugin-retry/dist-src/error-request.js
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
// @ts-ignore
|
||||||
|
export async function errorRequest(octokit, state, error, options) {
|
||||||
|
if (!error.request || !error.request.request) {
|
||||||
|
// address https://github.com/octokit/plugin-retry.js/issues/8
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
// retry all >= 400 && not doNotRetry
|
||||||
|
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
|
||||||
|
const retries = options.request.retries != null ? options.request.retries : state.retries;
|
||||||
|
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
|
||||||
|
throw octokit.retry.retryRequest(error, retries, retryAfter);
|
||||||
|
}
|
||||||
|
// Maybe eventually there will be more cases here
|
||||||
|
throw error;
|
||||||
|
}
|
26
node_modules/@octokit/plugin-retry/dist-src/index.js
generated
vendored
Normal file
26
node_modules/@octokit/plugin-retry/dist-src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import { errorRequest } from "./error-request";
|
||||||
|
import { wrapRequest } from "./wrap-request";
|
||||||
|
export const VERSION = "0.0.0-development";
|
||||||
|
export function retry(octokit, octokitOptions = {}) {
|
||||||
|
const state = Object.assign({
|
||||||
|
enabled: true,
|
||||||
|
retryAfterBaseValue: 1000,
|
||||||
|
doNotRetry: [400, 401, 403, 404, 422],
|
||||||
|
retries: 3,
|
||||||
|
}, octokitOptions.retry);
|
||||||
|
octokit.retry = {
|
||||||
|
retryRequest: (error, retries, retryAfter) => {
|
||||||
|
error.request.request = Object.assign({}, error.request.request, {
|
||||||
|
retries: retries,
|
||||||
|
retryAfter: retryAfter,
|
||||||
|
});
|
||||||
|
return error;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
if (!state.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
|
||||||
|
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
||||||
|
}
|
||||||
|
retry.VERSION = VERSION;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue