(
baseUrl: string,
oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string },
)
| 98 | ); |
| 99 | |
| 100 | const spec = ( |
| 101 | baseUrl: string, |
| 102 | oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string }, |
| 103 | ): string => |
| 104 | JSON.stringify({ |
| 105 | openapi: "3.0.3", |
| 106 | info: { title: "Issues API", version: "1.0.0" }, |
| 107 | servers: [{ url: baseUrl }], |
| 108 | paths: { |
| 109 | "/issues": { |
| 110 | get: { |
| 111 | operationId: "listIssues", |
| 112 | security: [{ oauth: ["issues.read"] }], |
| 113 | responses: { "200": { description: "issues" } }, |
| 114 | }, |
| 115 | }, |
| 116 | }, |
| 117 | components: { |
| 118 | securitySchemes: { |
| 119 | oauth: { |
| 120 | type: "oauth2", |
| 121 | flows: { |
| 122 | authorizationCode: { |
| 123 | authorizationUrl: oauth.authorizationEndpoint, |
| 124 | tokenUrl: oauth.tokenEndpoint, |
| 125 | scopes: { "issues.read": "Read issues" }, |
| 126 | }, |
| 127 | }, |
| 128 | }, |
| 129 | }, |
| 130 | }, |
| 131 | }); |
| 132 | |
| 133 | const invokeByAddressCode = (address: string) => ` |
| 134 | const segments = ${JSON.stringify(address)}.split(".").slice(1); |
no outgoing calls
no test coverage detected