refactor(core): simplify integration credentials (#31968)
This commit is contained in:
@@ -115,25 +115,27 @@ describe("PublicApi OpenAPI v2 errors", () => {
|
||||
}
|
||||
})
|
||||
|
||||
test("documents connector discovery and connection routes", () => {
|
||||
test("documents integration discovery and connection routes", () => {
|
||||
const spec = OpenApi.fromApi(PublicApi) as OpenApiSpec
|
||||
|
||||
for (const [method, path] of [
|
||||
["get", "/api/connector"],
|
||||
["get", "/api/connector/{connectorID}"],
|
||||
["post", "/api/connector/{connectorID}/connect/key"],
|
||||
["post", "/api/connector/{connectorID}/connect/oauth"],
|
||||
["get", "/api/connector/oauth/{attemptID}"],
|
||||
["post", "/api/connector/oauth/{attemptID}/complete"],
|
||||
["delete", "/api/connector/oauth/{attemptID}"],
|
||||
["get", "/api/integration"],
|
||||
["get", "/api/integration/{integrationID}"],
|
||||
["post", "/api/integration/{integrationID}/connect/key"],
|
||||
["post", "/api/integration/{integrationID}/connect/oauth"],
|
||||
["get", "/api/integration/attempt/{attemptID}"],
|
||||
["post", "/api/integration/attempt/{attemptID}/complete"],
|
||||
["delete", "/api/integration/attempt/{attemptID}"],
|
||||
["delete", "/api/credential/{credentialID}"],
|
||||
["patch", "/api/credential/{credentialID}"],
|
||||
] as const) {
|
||||
expect(spec.paths[path]?.[method], `${method.toUpperCase()} ${path}`).toBeDefined()
|
||||
}
|
||||
|
||||
for (const path of [
|
||||
"/api/connector/{connectorID}/connect/key",
|
||||
"/api/connector/{connectorID}/connect/oauth",
|
||||
"/api/connector/oauth/{attemptID}/complete",
|
||||
"/api/integration/{integrationID}/connect/key",
|
||||
"/api/integration/{integrationID}/connect/oauth",
|
||||
"/api/integration/attempt/{attemptID}/complete",
|
||||
]) {
|
||||
expect(spec.paths[path]?.post?.requestBody?.required, path).toBe(true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user