(
baseUrl: string,
oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string },
)
| 122 | ); |
| 123 | |
| 124 | const spec = ( |
| 125 | baseUrl: string, |
| 126 | oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string }, |
| 127 | ): string => |
| 128 | JSON.stringify({ |
| 129 | openapi: "3.0.3", |
| 130 | info: { title: "Issues API", version: "1.0.0" }, |
| 131 | servers: [{ url: baseUrl }], |
| 132 | paths: { |
| 133 | "/issues": { |
| 134 | get: { |
| 135 | operationId: "listIssues", |
| 136 | summary: "List issues", |
| 137 | security: [{ oauth: ["issues.read"] }], |
| 138 | responses: { "200": { description: "issues" } }, |
| 139 | }, |
| 140 | }, |
| 141 | }, |
| 142 | components: { |
| 143 | securitySchemes: { |
| 144 | oauth: { |
| 145 | type: "oauth2", |
| 146 | flows: { |
| 147 | authorizationCode: { |
| 148 | authorizationUrl: oauth.authorizationEndpoint, |
| 149 | tokenUrl: oauth.tokenEndpoint, |
| 150 | scopes: { "issues.read": "Read issues" }, |
| 151 | }, |
| 152 | }, |
| 153 | }, |
| 154 | }, |
| 155 | }, |
| 156 | }); |
| 157 | |
| 158 | const invokeByAddressCode = (address: string, args: unknown) => ` |
| 159 | const segments = ${JSON.stringify(address)}.split(".").slice(1); |
no outgoing calls
no test coverage detected