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