forked from kadena-io/pact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.json
1 lines (1 loc) · 8.02 KB
/
swagger.json
1
{"swagger":"2.0","info":{"version":"","title":""},"paths":{"/api/v1/send":{"post":{"consumes":["application/json;charset=utf-8"],"produces":["application/json;charset=utf-8"],"parameters":[{"required":true,"schema":{"$ref":"#/definitions/SubmitBatch"},"in":"body","name":"body"}],"responses":{"400":{"description":"Invalid `body`"},"200":{"schema":{"$ref":"#/definitions/RequestKeys"},"description":""}}}},"/api/v1/poll":{"post":{"consumes":["application/json;charset=utf-8"],"produces":["application/json;charset=utf-8"],"parameters":[{"required":true,"schema":{"$ref":"#/definitions/Poll"},"in":"body","name":"body"}],"responses":{"400":{"description":"Invalid `body`"},"200":{"schema":{"items":{"$ref":"#/definitions/PollResponse"},"type":"array","description":"request key to command result map"},"description":""}}}},"/api/v1/listen":{"post":{"consumes":["application/json;charset=utf-8"],"produces":["application/json;charset=utf-8"],"parameters":[{"required":true,"schema":{"$ref":"#/definitions/ListenerRequest"},"in":"body","name":"body"}],"responses":{"400":{"description":"Invalid `body`"},"200":{"schema":{"$ref":"#/definitions/ListenResponse"},"description":""}}}},"/api/v1/local":{"post":{"consumes":["application/json;charset=utf-8"],"produces":["application/json;charset=utf-8"],"parameters":[{"required":true,"schema":{"$ref":"#/definitions/Command"},"in":"body","name":"body"}],"responses":{"400":{"description":"Invalid `body`"},"200":{"schema":{"$ref":"#/definitions/CommandResult"},"description":""}}}}},"definitions":{"RequestKeys":{"required":["requestKeys"],"properties":{"requestKeys":{"minItems":1,"items":{"$ref":"#/definitions/RequestKey"},"type":"array"}},"type":"object"},"RequestKey":{"description":"command's request key (i.e. the hash of command payload)","maxLength":32,"format":"base64url","minLength":32,"type":"string"},"SubmitBatch":{"required":["cmds"],"properties":{"cmds":{"minItems":1,"items":{"$ref":"#/definitions/Command"},"type":"array"}},"type":"object"},"Command":{"description":"transaction command with stringified JSON payload (cmd)","required":["cmd","sigs","hash"],"properties":{"cmd":{"type":"string"},"sigs":{"items":{"$ref":"#/definitions/UserSig"},"type":"array"},"hash":{"$ref":"#/definitions/TypedHash"}},"type":"object"},"UserSig":{"description":"crypto signature by secret key of command payload","required":["sig"],"properties":{"sig":{"type":"string"}},"type":"object"},"TypedHash":{"description":"blake2 hash in base64 of command payload","maxLength":32,"format":"base64url","minLength":32,"type":"string"},"PollResponse":{"required":["requestKey","response"],"properties":{"requestKey":{"$ref":"#/definitions/RequestKey"},"response":{"$ref":"#/definitions/CommandResult"}},"type":"object"},"CommandResult":{"description":"result of attempting to execute a pact command","required":["reqKey","result","gas"],"properties":{"reqKey":{"$ref":"#/definitions/RequestKey"},"txId":{"$ref":"#/definitions/TxId"},"result":{"$ref":"#/definitions/PactResult"},"gas":{"$ref":"#/definitions/Gas"},"logs":{"$ref":"#/definitions/Hash"},"continuation":{"$ref":"#/definitions/PactExec"},"metaData":{"$ref":"#/definitions/Value"}},"type":"object"},"TxId":{"description":"command's transaction id","maximum":18446744073709551615,"minimum":0,"type":"integer"},"PactResult":{"description":"either a pact error or the last pact expression output as a pact value","properties":{"status":{"$ref":"#/definitions/PactResultStatus"},"error":{"$ref":"#/definitions/PactError"},"data":{"$ref":"#/definitions/PactValue"}},"maxProperties":2,"minProperties":2,"type":"object"},"PactError":{"required":["type","info","callStack","message"],"properties":{"type":{"$ref":"#/definitions/PactErrorType"},"info":{"$ref":"#/definitions/Info"},"callStack":{"items":{"$ref":"#/definitions/StackFrame"},"type":"array"},"message":{"$ref":"#/definitions/Doc"}},"type":"object"},"PactErrorType":{"type":"string","enum":["EvalError","ArgsError","DbError","TxFailure","SyntaxError","GasError"]},"Info":{"type":"string"},"StackFrame":{"type":"string"},"Doc":{"type":"string"},"PactValue":{"description":"data from Pact execution represented as JSON","properties":{"literal":{"$ref":"#/definitions/Literal"},"list":{"items":{"$ref":"#/definitions/PactValue"},"type":"array"},"object":{"$ref":"#/definitions/ObjectMap"},"guard":{"$ref":"#/definitions/Guard"}},"maxProperties":1,"minProperties":1,"type":"object"},"Literal":{"properties":{"string":{"type":"string"},"integer":{"type":"integer"},"decimal":{"$ref":"#/definitions/Decimal"},"bool":{"type":"boolean"},"time":{"$ref":"#/definitions/UTCTime"}},"maxProperties":1,"minProperties":1,"type":"object"},"Decimal":{"type":"number"},"UTCTime":{"required":["time"],"properties":{"time":{"type":"string"}},"example":{"time":"1970-01-01T00:00:00Z"},"type":"object"},"ObjectMap":{"additionalProperties":{"$ref":"#/definitions/PactValue"},"type":"object"},"Guard":{"properties":{"pact":{"$ref":"#/definitions/PactGuard"},"keyset":{"$ref":"#/definitions/KeySet"},"keysetref":{"$ref":"#/definitions/KeySetName"},"module":{"$ref":"#/definitions/ModuleGuard"},"user":{"$ref":"#/definitions/UserGuard"}},"maxProperties":1,"minProperties":1,"type":"object"},"PactGuard":{"required":["pactId","name"],"properties":{"pactId":{"$ref":"#/definitions/PactId"},"name":{"type":"string"}},"type":"object"},"PactId":{"type":"string"},"KeySet":{"required":["keys","predFun"],"properties":{"keys":{"items":{"$ref":"#/definitions/PublicKey"},"type":"array"},"predFun":{"$ref":"#/definitions/Name"}},"type":"object"},"PublicKey":{"type":"string"},"Name":{"type":"string"},"KeySetName":{"type":"string"},"ModuleGuard":{"required":["moduleName","name"],"properties":{"moduleName":{"$ref":"#/definitions/ModuleName"},"name":{"type":"string"}},"type":"object"},"ModuleName":{"required":["name"],"properties":{"name":{"type":"string"},"namespace":{"$ref":"#/definitions/NamespaceName"}},"type":"object"},"NamespaceName":{"type":"string"},"UserGuard":{"required":["data","predFun"],"properties":{"data":{"$ref":"#/definitions/Object"},"predFun":{"$ref":"#/definitions/Name"}},"type":"object"},"Object":{"type":"object"},"PactResultStatus":{"type":"string","enum":["Success","Failure"]},"Gas":{"description":"gas consummed by command","maximum":9223372036854775807,"format":"int64","minimum":-9223372036854775808,"type":"integer"},"Hash":{"description":"the hash of the pact execution's logs","maxLength":32,"format":"base64url","minLength":32,"type":"string"},"PactExec":{"description":"output of a Continuation if one occurred in the command.","required":["stepCount","step","pactId","continuation"],"properties":{"stepCount":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"},"yield":{"$ref":"#/definitions/Yield"},"executed":{"type":"boolean"},"step":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"},"pactId":{"$ref":"#/definitions/PactId"},"continuation":{"$ref":"#/definitions/PactContinuation"}},"type":"object"},"Yield":{"required":["data"],"properties":{"data":{"$ref":"#/definitions/ObjectMap"},"provenance":{"$ref":"#/definitions/Provenance"}},"type":"object"},"Provenance":{"required":["targetChainId","moduleHash"],"properties":{"targetChainId":{"$ref":"#/definitions/ChainId"},"moduleHash":{"$ref":"#/definitions/ModuleHash"}},"type":"object"},"ChainId":{"type":"string"},"ModuleHash":{"maxLength":32,"format":"base64url","minLength":32,"type":"string"},"PactContinuation":{"required":["def","args"],"properties":{"def":{"$ref":"#/definitions/Name"},"args":{"items":{"$ref":"#/definitions/PactValue"},"type":"array"}},"type":"object"},"Value":{"description":"Platform-specific data","type":"object"},"Poll":{"required":["requestKeys"],"properties":{"requestKeys":{"minItems":1,"items":{"$ref":"#/definitions/RequestKey"},"type":"array"}},"type":"object"},"ListenResponse":{"properties":{"timeout-micros":{"maximum":9223372036854775807,"minimum":-9223372036854775808,"type":"integer"},"response":{"$ref":"#/definitions/CommandResult"}},"maxProperties":1,"minProperties":1,"type":"object"},"ListenerRequest":{"required":["listen"],"properties":{"listen":{"$ref":"#/definitions/RequestKey"}},"type":"object"}}}