(
baseUrl: string,
oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string },
)
| 74 | ); |
| 75 | |
| 76 | const spec = ( |
| 77 | baseUrl: string, |
| 78 | oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string }, |
| 79 | ): string => |
| 80 | JSON.stringify({ |
| 81 | openapi: "3.0.3", |
| 82 | info: { title: "Issues API", version: "1.0.0" }, |
| 83 | servers: [{ url: baseUrl }], |
| 84 | paths: { |
| 85 | "/issues": { |
| 86 | get: { |
| 87 | operationId: "listIssues", |
| 88 | summary: "List issues", |
| 89 | security: [{ oauth: ["issues.read"] }], |
| 90 | responses: { "200": { description: "issues" } }, |
| 91 | }, |
| 92 | }, |
| 93 | }, |
| 94 | components: { |
| 95 | securitySchemes: { |
| 96 | oauth: { |
| 97 | type: "oauth2", |
| 98 | flows: { |
| 99 | authorizationCode: { |
| 100 | authorizationUrl: oauth.authorizationEndpoint, |
| 101 | tokenUrl: oauth.tokenEndpoint, |
| 102 | scopes: { "issues.read": "Read issues", "issues.write": "Write issues" }, |
| 103 | }, |
| 104 | }, |
| 105 | }, |
| 106 | }, |
| 107 | }, |
| 108 | }); |
| 109 | |
| 110 | const invokeByAddressCode = (address: string, args: unknown) => ` |
| 111 | const segments = ${JSON.stringify(address)}.split(".").slice(1); |
no outgoing calls
no test coverage detected