index.js 539 B

123456789101112131415161718
  1. import ENDPOINTS from "./generated/endpoints";
  2. import { VERSION } from "./version";
  3. import { endpointsToMethods } from "./endpoints-to-methods";
  4. export function restEndpointMethods(octokit) {
  5. const api = endpointsToMethods(octokit, ENDPOINTS);
  6. return {
  7. rest: api,
  8. };
  9. }
  10. restEndpointMethods.VERSION = VERSION;
  11. export function legacyRestEndpointMethods(octokit) {
  12. const api = endpointsToMethods(octokit, ENDPOINTS);
  13. return {
  14. ...api,
  15. rest: api,
  16. };
  17. }
  18. legacyRestEndpointMethods.VERSION = VERSION;