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