@octokit/types 2.16.1 → 2.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist-node/index.js +8 -0
  2. package/dist-node/index.js.map +1 -0
  3. package/dist-src/AuthInterface.js +0 -0
  4. package/dist-src/EndpointDefaults.js +0 -0
  5. package/dist-src/EndpointInterface.js +0 -0
  6. package/dist-src/EndpointOptions.js +0 -0
  7. package/dist-src/Fetch.js +0 -0
  8. package/dist-src/GetResponseTypeFromEndpointMethod.js +0 -0
  9. package/dist-src/OctokitResponse.js +0 -0
  10. package/dist-src/RequestHeaders.js +0 -0
  11. package/dist-src/RequestInterface.js +0 -0
  12. package/dist-src/RequestMethod.js +0 -0
  13. package/dist-src/RequestOptions.js +0 -0
  14. package/dist-src/RequestParameters.js +0 -0
  15. package/dist-src/RequestRequestOptions.js +0 -0
  16. package/dist-src/ResponseHeaders.js +0 -0
  17. package/dist-src/Route.js +0 -0
  18. package/dist-src/Signal.js +0 -0
  19. package/dist-src/StrategyInterface.js +0 -0
  20. package/dist-src/Url.js +0 -0
  21. package/dist-src/VERSION.js +1 -0
  22. package/dist-src/generated/Endpoints.js +0 -0
  23. package/dist-src/index.js +1 -0
  24. package/dist-types/AuthInterface.d.ts +31 -0
  25. package/{src/EndpointDefaults.ts → dist-types/EndpointDefaults.d.ts} +12 -13
  26. package/dist-types/EndpointInterface.d.ts +65 -0
  27. package/{src/EndpointOptions.ts → dist-types/EndpointOptions.d.ts} +3 -4
  28. package/{src/Fetch.ts → dist-types/Fetch.d.ts} +1 -1
  29. package/dist-types/GetResponseTypeFromEndpointMethod.d.ts +5 -0
  30. package/dist-types/OctokitResponse.d.ts +17 -0
  31. package/dist-types/RequestHeaders.d.ts +15 -0
  32. package/dist-types/RequestInterface.d.ts +34 -0
  33. package/dist-types/RequestMethod.d.ts +4 -0
  34. package/{src/RequestOptions.ts → dist-types/RequestOptions.d.ts} +6 -7
  35. package/dist-types/RequestParameters.d.ts +45 -0
  36. package/dist-types/RequestRequestOptions.d.ts +26 -0
  37. package/dist-types/ResponseHeaders.d.ts +20 -0
  38. package/{src/Route.ts → dist-types/Route.d.ts} +1 -1
  39. package/{src/Signal.ts → dist-types/Signal.d.ts} +1 -1
  40. package/dist-types/StrategyInterface.d.ts +4 -0
  41. package/{src/Url.ts → dist-types/Url.d.ts} +1 -1
  42. package/dist-types/VERSION.d.ts +1 -0
  43. package/dist-types/generated/Endpoints.d.ts +41416 -0
  44. package/{src/index.ts → dist-types/index.d.ts} +0 -0
  45. package/dist-web/index.js +4 -0
  46. package/dist-web/index.js.map +1 -0
  47. package/package.json +18 -57
  48. package/.github/ISSUE_TEMPLATE/01_help.md +0 -5
  49. package/.github/ISSUE_TEMPLATE/02_bug.md +0 -19
  50. package/.github/ISSUE_TEMPLATE/03_feature_request.md +0 -19
  51. package/.github/ISSUE_TEMPLATE/04_thanks.md +0 -19
  52. package/.github/workflows/release.yml +0 -29
  53. package/.github/workflows/routes-update.yml +0 -39
  54. package/.github/workflows/test.yml +0 -19
  55. package/CODE_OF_CONDUCT.md +0 -75
  56. package/CONTRIBUTING.md +0 -59
  57. package/scripts/update-endpoints/fetch-json.js +0 -65
  58. package/scripts/update-endpoints/generated/README.md +0 -3
  59. package/scripts/update-endpoints/generated/endpoints.json +0 -41962
  60. package/scripts/update-endpoints/templates/endpoints.ts.template +0 -49
  61. package/scripts/update-endpoints/typescript.js +0 -268
  62. package/src/AuthInterface.ts +0 -43
  63. package/src/EndpointInterface.ts +0 -99
  64. package/src/GetResponseTypeFromEndpointMethod.ts +0 -9
  65. package/src/OctokitResponse.ts +0 -18
  66. package/src/RequestHeaders.ts +0 -15
  67. package/src/RequestInterface.ts +0 -46
  68. package/src/RequestMethod.ts +0 -10
  69. package/src/RequestParameters.ts +0 -46
  70. package/src/RequestRequestOptions.ts +0 -27
  71. package/src/ResponseHeaders.ts +0 -21
  72. package/src/StrategyInterface.ts +0 -9
  73. package/src/VERSION.ts +0 -1
  74. package/src/generated/Endpoints.ts +0 -42909
  75. package/src/generated/README.md +0 -3
  76. package/test.ts +0 -90
  77. package/tsconfig.json +0 -10
@@ -1,3 +0,0 @@
1
- # ⚠️ Do not edit files in this folder
2
-
3
- All files are generated. Manual changes will be overwritten. If you find a problem, please look into how they are generated. When in doubt, please open a new issue.
package/test.ts DELETED
@@ -1,90 +0,0 @@
1
- // This code is not executed, only statically analyzed using `tsc --noEmit`
2
- import { EndpointInterface, RequestMethod, RequestInterface } from "./src";
3
-
4
- const endpoint = null as EndpointInterface;
5
-
6
- const fooOptions = { foo: "bar" };
7
- const bazOptions = { baz: "daz" };
8
- const overrideOptions = { foo: "newbar" };
9
- const routeOptions = { method: "GET", url: "/foo" };
10
-
11
- const test = endpoint.defaults(fooOptions);
12
- const test2 = test.defaults(bazOptions);
13
- const test3 = test2.defaults(overrideOptions);
14
- const test4 = test3.defaults(routeOptions);
15
-
16
- function assertString(type: string) {}
17
- function assertRequestMethod(type: RequestMethod) {}
18
-
19
- assertString(test.DEFAULTS.foo);
20
- assertString(test2.DEFAULTS.foo);
21
- assertString(test2.DEFAULTS.baz);
22
- assertString(test3.DEFAULTS.foo);
23
- assertRequestMethod(test4.DEFAULTS.method);
24
-
25
- const result4 = test4({ method: "PUT", url: "/funk", headers: { foo: "bar" } });
26
- assertString(result4.headers.foo);
27
- // "url" parameter is required
28
- // endpoint({});
29
- // "url" is optional if set on defaults
30
- assertString(test4({}).url);
31
-
32
- const test5 = test4.defaults({
33
- method: "PUT",
34
- url: "/funk",
35
- headers: { foo: "bar" },
36
- });
37
-
38
- assertRequestMethod(test5({}).method);
39
- assertString(test5({}).url);
40
- assertString(test5({}).headers.foo);
41
-
42
- const createIssueOptions = {
43
- owner: "octocat",
44
- repo: "hello-world",
45
- title: "My new issue!",
46
- headers: {
47
- "x-foo": "bar",
48
- },
49
- };
50
- const result5 = test5("POST /repos/:owner/:repo/issues", createIssueOptions);
51
- const result5merge = test5.merge(
52
- "POST /repos/:owner/:repo/issues",
53
- createIssueOptions
54
- );
55
- const result5merge2 = test5.merge(createIssueOptions);
56
-
57
- assertString(result5.headers["x-foo"]);
58
- assertString(result5merge.title);
59
- assertString(result5merge.headers["x-foo"]);
60
- assertString(result5merge2.url);
61
-
62
- const staticParseResult = endpoint.parse({
63
- baseUrl: "https://api.github.com",
64
- method: "GET",
65
- url: "/funk",
66
- mediaType: {
67
- format: "",
68
- previews: [],
69
- },
70
- headers: {
71
- "user-agent": "MyApp/1.2.3",
72
- accept: "foo",
73
- "x-foo": "bar",
74
- },
75
- });
76
-
77
- assertString(staticParseResult.headers["x-foo"]);
78
-
79
- const request = null as RequestInterface;
80
-
81
- const rtest = request.defaults(fooOptions);
82
- const rtest2 = rtest.defaults(bazOptions);
83
- const rtest3 = rtest2.defaults(overrideOptions);
84
- const rtest4 = rtest3.defaults(routeOptions);
85
-
86
- assertString(rtest.endpoint.DEFAULTS.foo);
87
- assertString(rtest2.endpoint.DEFAULTS.foo);
88
- assertString(rtest2.endpoint.DEFAULTS.baz);
89
- assertString(rtest3.endpoint.DEFAULTS.foo);
90
- assertRequestMethod(rtest4.endpoint.DEFAULTS.method);
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "esModuleInterop": true,
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "strict": true,
7
- "target": "es2018"
8
- },
9
- "include": ["src/**/*"]
10
- }