{"openapi":"3.1.0","info":{"title":"Electric Auth Proxy API","version":"0.0.1"},"paths":{"/":{"get":{"tags":["Root"],"operationId":"Root.health","parameters":[],"security":[],"responses":{"200":{"description":"a string","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}}},"summary":"Health Check"}},"/electric/{id}/v1/shape":{"get":{"tags":["Electric"],"operationId":"Electric.v1/shape","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[],"responses":{"204":{"description":"Success"},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}}}}},"/electric/v1/verify-url":{"post":{"tags":["Electric"],"operationId":"Electric.v1/verifyUrl","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["valid"],"properties":{"valid":{"type":"boolean"}},"additionalProperties":false}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url","auth"],"properties":{"url":{"type":"string"},"auth":{"anyOf":[{"type":"object","required":["type","credentials"],"properties":{"type":{"type":"string","enum":["bearer"]},"credentials":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","username","password"],"properties":{"type":{"type":"string","enum":["basic"]},"username":{"type":"string"},"password":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","sourceId","sourceSecret"],"properties":{"type":{"type":"string","enum":["electric-cloud"]},"sourceId":{"type":"string"},"sourceSecret":{"type":"string"}},"additionalProperties":false}]}},"additionalProperties":false}}},"required":true}}},"/app":{"post":{"tags":["App"],"operationId":"App.createApp","parameters":[],"security":[{"bearer":[]}],"responses":{"200":{"description":"App.json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/App.json"}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}}}},"summary":"Create a new app","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/App.jsonCreate"}}},"required":true}}},"/app/{id}/jwt":{"post":{"tags":["App"],"operationId":"App.upsertJwt","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Jwt.json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Jwt.json"}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Jwt.jsonUpdate"}}},"required":true}}},"/apps":{"get":{"tags":["App"],"operationId":"App.getApps","parameters":[],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/App.json"}}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}}}}}},"/app/{id}":{"get":{"tags":["App"],"operationId":"App.getApp","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["id","name","clerkSecretKey","electricUrl","publicTables","tenantColumnKey","auth","jwtId","tenantId","jwt"],"properties":{"id":{"type":"string"},"name":{"type":"string","description":"a string at least 3 character(s) long","title":"minLength(3)","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":3},"clerkSecretKey":{"type":"string","description":"a string with no leading or trailing whitespace","title":"trimmed","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","nullable":true},"electricUrl":{"type":"string"},"publicTables":{"type":"array","items":{"type":"string"}},"tenantColumnKey":{"type":"string"},"auth":{"anyOf":[{"type":"object","required":["type","credentials"],"properties":{"type":{"type":"string","enum":["bearer"]},"credentials":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","username","password"],"properties":{"type":{"type":"string","enum":["basic"]},"username":{"type":"string"},"password":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","sourceId","sourceSecret"],"properties":{"type":{"type":"string","enum":["electric-cloud"]},"sourceId":{"type":"string"},"sourceSecret":{"type":"string"}},"additionalProperties":false}],"nullable":true},"jwtId":{"type":"string","nullable":true},"tenantId":{"type":"string"},"jwt":{"$ref":"#/components/schemas/Jwt.json","nullable":true}},"additionalProperties":false}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}}},"404":{"description":"AppNotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppNotFound"}}}}}},"put":{"tags":["App"],"operationId":"App.updateApp","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"App.json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/App.json"}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}}},"404":{"description":"AppNotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppNotFound"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/App.jsonUpdate"}}},"required":true}},"delete":{"tags":["App"],"operationId":"App.deleteApp","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"Success"},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}}},"404":{"description":"AppNotFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppNotFound"}}}}}}},"/app/{id}/analytics":{"get":{"tags":["App"],"operationId":"App.getAnalytics","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true},{"name":"duration","in":"query","schema":{"type":"string"},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UniqueSchema"}}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/HttpApiDecodeError"},{"$ref":"#/components/schemas/InvalidDuration"}]}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}}}}}},"/auth/verify-token":{"post":{"tags":["Auth"],"operationId":"Auth.verifyAuthToken","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["valid","id","environmentType"],"properties":{"valid":{"type":"boolean"},"id":{"type":"string","nullable":true},"environmentType":{"type":"string","nullable":true}},"additionalProperties":false}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type","credentials"],"properties":{"type":{"type":"string","enum":["clerk"]},"credentials":{"type":"string"}},"additionalProperties":false}}},"required":true}}},"/auth/verify-jwt":{"post":{"tags":["Auth"],"operationId":"Auth.verifyJwt","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["tenantId"],"properties":{"tenantId":{"type":"string","nullable":true}},"additionalProperties":false}}}},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}},"500":{"description":"JoseError","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoseError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["alg","jwtPublicKey","jwt"],"properties":{"alg":{"type":"string","enum":["RS256","PS256","RS256","EdDSA"]},"jwtPublicKey":{"type":"string","description":"a string with no leading or trailing whitespace","title":"trimmed","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$"},"jwt":{"type":"string"}},"additionalProperties":false}}},"required":true}}},"/better-auth/*":{"get":{"tags":["BetterAuth"],"operationId":"BetterAuth.betterAuthGet","parameters":[],"security":[],"responses":{"204":{"description":"Success"},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}}}},"post":{"tags":["BetterAuth"],"operationId":"BetterAuth.betterAuthPost","parameters":[],"security":[],"responses":{"204":{"description":"Success"},"400":{"description":"The request did not match the expected schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiDecodeError"}}}}}}}},"components":{"schemas":{"HttpApiDecodeError":{"type":"object","required":["issues","message","_tag"],"properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}},"message":{"type":"string"},"_tag":{"type":"string","enum":["HttpApiDecodeError"]}},"additionalProperties":false,"description":"The request did not match the expected schema"},"Issue":{"type":"object","required":["_tag","path","message"],"properties":{"_tag":{"type":"string","enum":["Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden"],"description":"The tag identifying the type of parse issue"},"path":{"type":"array","items":{"$ref":"#/components/schemas/PropertyKey"},"description":"The path to the property where the issue occurred"},"message":{"type":"string","description":"A descriptive message explaining the issue"}},"additionalProperties":false,"description":"Represents an error encountered while parsing a value to match the schema"},"PropertyKey":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"object","required":["_tag","key"],"properties":{"_tag":{"type":"string","enum":["symbol"]},"key":{"type":"string"}},"additionalProperties":false,"description":"an object to be decoded into a globally shared symbol"}]},"App.jsonCreate":{"type":"object","required":["name","clerkSecretKey","electricUrl","publicTables","tenantColumnKey","auth"],"properties":{"name":{"type":"string","description":"a string at least 3 character(s) long","title":"minLength(3)","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":3},"clerkSecretKey":{"type":"string","description":"a string with no leading or trailing whitespace","title":"trimmed","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","nullable":true},"electricUrl":{"type":"string"},"publicTables":{"type":"array","items":{"type":"string"}},"tenantColumnKey":{"type":"string"},"auth":{"anyOf":[{"type":"object","required":["type","credentials"],"properties":{"type":{"type":"string","enum":["bearer"]},"credentials":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","username","password"],"properties":{"type":{"type":"string","enum":["basic"]},"username":{"type":"string"},"password":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","sourceId","sourceSecret"],"properties":{"type":{"type":"string","enum":["electric-cloud"]},"sourceId":{"type":"string"},"sourceSecret":{"type":"string"}},"additionalProperties":false}],"nullable":true}},"additionalProperties":false,"title":"App.jsonCreate"},"App.json":{"type":"object","required":["id","name","clerkSecretKey","electricUrl","publicTables","tenantColumnKey","auth","jwtId","tenantId"],"properties":{"id":{"type":"string"},"name":{"type":"string","description":"a string at least 3 character(s) long","title":"minLength(3)","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":3},"clerkSecretKey":{"type":"string","description":"a string with no leading or trailing whitespace","title":"trimmed","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","nullable":true},"electricUrl":{"type":"string"},"publicTables":{"type":"array","items":{"type":"string"}},"tenantColumnKey":{"type":"string"},"auth":{"anyOf":[{"type":"object","required":["type","credentials"],"properties":{"type":{"type":"string","enum":["bearer"]},"credentials":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","username","password"],"properties":{"type":{"type":"string","enum":["basic"]},"username":{"type":"string"},"password":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","sourceId","sourceSecret"],"properties":{"type":{"type":"string","enum":["electric-cloud"]},"sourceId":{"type":"string"},"sourceSecret":{"type":"string"}},"additionalProperties":false}],"nullable":true},"jwtId":{"type":"string","nullable":true},"tenantId":{"type":"string"}},"additionalProperties":false,"title":"App.json"},"Unauthorized":{"type":"object","required":["actorId","entity","action","_tag"],"properties":{"actorId":{"type":"string"},"entity":{"type":"string"},"action":{"type":"string"},"_tag":{"type":"string","enum":["Unauthorized"]}},"additionalProperties":false},"Jwt.jsonUpdate":{"type":"object","required":["publicKey","publicKeyRemote","alg","provider"],"properties":{"publicKey":{"type":"string","description":"a string with no leading or trailing whitespace","title":"trimmed","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","nullable":true},"publicKeyRemote":{"type":"string","nullable":true},"alg":{"type":"string","enum":["RS256","PS256","RS256","EdDSA"],"nullable":true},"provider":{"type":"string","enum":["clerk","custom","custom-remote"],"nullable":true}},"additionalProperties":false,"title":"Jwt.jsonUpdate"},"Jwt.json":{"type":"object","required":["id","publicKey","publicKeyRemote","alg","provider"],"properties":{"id":{"type":"string"},"publicKey":{"type":"string","description":"a string with no leading or trailing whitespace","title":"trimmed","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","nullable":true},"publicKeyRemote":{"type":"string","nullable":true},"alg":{"type":"string","enum":["RS256","PS256","RS256","EdDSA"],"nullable":true},"provider":{"type":"string","enum":["clerk","custom","custom-remote"],"nullable":true}},"additionalProperties":false,"title":"Jwt.json"},"AppNotFound":{"type":"object","required":["id","_tag"],"properties":{"id":{"type":"string"},"_tag":{"type":"string","enum":["AppNotFound"]}},"additionalProperties":false},"App.jsonUpdate":{"type":"object","required":["name","clerkSecretKey","electricUrl","publicTables","tenantColumnKey","auth"],"properties":{"name":{"type":"string","description":"a string at least 3 character(s) long","title":"minLength(3)","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":3},"clerkSecretKey":{"type":"string","description":"a string with no leading or trailing whitespace","title":"trimmed","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","nullable":true},"electricUrl":{"type":"string"},"publicTables":{"type":"array","items":{"type":"string"}},"tenantColumnKey":{"type":"string"},"auth":{"anyOf":[{"type":"object","required":["type","credentials"],"properties":{"type":{"type":"string","enum":["bearer"]},"credentials":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","username","password"],"properties":{"type":{"type":"string","enum":["basic"]},"username":{"type":"string"},"password":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["type","sourceId","sourceSecret"],"properties":{"type":{"type":"string","enum":["electric-cloud"]},"sourceId":{"type":"string"},"sourceSecret":{"type":"string"}},"additionalProperties":false}],"nullable":true}},"additionalProperties":false,"title":"App.jsonUpdate"},"UniqueSchema":{"type":"object","required":["hour","uniqueUsers","totalRequests","errorCount"],"properties":{"hour":{"type":"string"},"uniqueUsers":{"$ref":"#/components/schemas/NumberFromString"},"totalRequests":{"$ref":"#/components/schemas/NumberFromString"},"errorCount":{"$ref":"#/components/schemas/NumberFromString"}},"additionalProperties":false},"NumberFromString":{"type":"string","description":"a string to be decoded into a number"},"InvalidDuration":{"type":"object","required":["message","_tag"],"properties":{"message":{"type":"string"},"_tag":{"type":"string","enum":["InvalidDuration"]}},"additionalProperties":false},"JoseError":{"type":"object","required":["message","_tag"],"properties":{"message":{"type":"string"},"_tag":{"type":"string","enum":["JoseError"]}},"additionalProperties":false}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"security":[],"tags":[{"name":"Root"},{"name":"Electric"},{"name":"App"},{"name":"Auth"},{"name":"BetterAuth"}]}