14994 lines · 416.5 KB · JSON
RawDownload
{  "openapi": "3.1.1",  "info": {    "title": "openscience",    "description": "openscience api",    "version": "1.0.0"  },  "paths": {    "/global/health": {      "get": {        "operationId": "global.health",        "summary": "Get health",        "description": "Get health information about the OpenScience server.",        "responses": {          "200": {            "description": "Health information",            "content": {              "application/json": {                "schema": {                  "type": "object",                  "properties": {                    "healthy": {                      "type": "boolean",                      "const": true                    },                    "version": {                      "type": "string"                    }                  },                  "required": [                    "healthy",                    "version"                  ]                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.health({\n  ...\n})"          }        ]      }    },    "/global/event": {      "get": {        "operationId": "global.event",        "summary": "Get global events",        "description": "Subscribe to global events from the OpenScience system using server-sent events.",        "responses": {          "200": {            "description": "Event stream",            "content": {              "text/event-stream": {                "schema": {                  "$ref": "#/components/schemas/GlobalEvent"                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.event({\n  ...\n})"          }        ]      }    },    "/global/config": {      "get": {        "operationId": "global.config.get",        "summary": "Get global configuration",        "description": "Retrieve the current global OpenScience configuration settings and preferences.",        "responses": {          "200": {            "description": "Get global config info",            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/Config"                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.config.get({\n  ...\n})"          }        ]      },      "patch": {        "operationId": "global.config.update",        "summary": "Update global configuration",        "description": "Update global OpenScience configuration settings and preferences.",        "responses": {          "200": {            "description": "Successfully updated global config",            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/Config"                }              }            }          },          "400": {            "description": "Bad request",            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/BadRequestError"                }              }            }          }        },        "requestBody": {          "content": {            "application/json": {              "schema": {                "$ref": "#/components/schemas/Config"              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.config.update({\n  ...\n})"          }        ]      }    },    "/global/config/raw": {      "get": {        "operationId": "global.configRawGet",        "summary": "Get raw global configuration",        "description": "Read the verbatim global config file for the advanced editor.",        "responses": {          "200": {            "description": "Raw global config",            "content": {              "application/json": {                "schema": {                  "type": "object",                  "properties": {                    "content": {                      "type": "string"                    },                    "path": {                      "type": "string"                    }                  },                  "required": [                    "content",                    "path"                  ]                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.configRawGet({\n  ...\n})"          }        ]      },      "put": {        "operationId": "global.configRawSet",        "summary": "Replace raw global configuration",        "description": "Overwrite the global config file verbatim (supports removing keys).",        "responses": {          "200": {            "description": "Replaced global config",            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/Config"                }              }            }          },          "400": {            "description": "Bad request",            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/BadRequestError"                }              }            }          }        },        "requestBody": {          "content": {            "application/json": {              "schema": {                "type": "object",                "properties": {                  "content": {                    "type": "string"                  }                },                "required": [                  "content"                ]              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.configRawSet({\n  ...\n})"          }        ]      }    },    "/global/config/unset": {      "post": {        "operationId": "global.configUnset",        "summary": "Unset a global config key",        "description": "Remove a key path from the global config (deep-merge cannot unset).",        "responses": {          "200": {            "description": "Updated global config",            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/Config"                }              }            }          },          "400": {            "description": "Bad request",            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/BadRequestError"                }              }            }          }        },        "requestBody": {          "content": {            "application/json": {              "schema": {                "type": "object",                "properties": {                  "path": {                    "minItems": 1,                    "type": "array",                    "items": {                      "type": "string"                    }                  }                },                "required": [                  "path"                ]              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.configUnset({\n  ...\n})"          }        ]      }    },    "/global/dispose": {      "post": {        "operationId": "global.dispose",        "summary": "Dispose instance",        "description": "Clean up and dispose all OpenScience instances, releasing all resources.",        "responses": {          "200": {            "description": "Global disposed",            "content": {              "application/json": {                "schema": {                  "type": "boolean"                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.dispose({\n  ...\n})"          }        ]      }    },    "/global/sync": {      "post": {        "operationId": "global.sync",        "summary": "Sync account services",        "description": "Refresh OpenScience account services and reload local provider/config state.",        "responses": {          "200": {            "description": "Services synced",            "content": {              "application/json": {                "schema": {                  "type": "object",                  "properties": {                    "user": {},                    "credentials": {                      "type": "number"                    },                    "last_synced": {                      "type": "number"                    }                  },                  "required": [                    "credentials",                    "last_synced"                  ]                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.global.sync({\n  ...\n})"          }        ]      }    },    "/account": {      "get": {        "operationId": "account.get",        "summary": "Get account",        "description": "Get synced OpenScience account and billing summary.",        "responses": {          "200": {            "description": "Account summary",            "content": {              "application/json": {                "schema": {                  "type": "object",                  "properties": {                    "session": {                      "type": "boolean"                    },                    "user": {},                    "balance_usd": {                      "type": "number"                    },                    "billing_mode": {                      "anyOf": [                        {                          "type": "object",                          "properties": {                            "mode": {                              "type": "string",                              "enum": [                                "byok",                                "managed"                              ]                            },                            "balance_cents": {                              "type": "number"                            },                            "balance_usd": {                              "type": "number"                            },                            "managed_supported": {                              "type": "boolean"                            }                          },                          "required": [                            "mode",                            "balance_cents",                            "balance_usd",                            "managed_supported"                          ]                        },                        {                          "type": "null"                        }                      ]                    }                  },                  "required": [                    "session",                    "balance_usd",                    "billing_mode"                  ]                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.account.get({\n  ...\n})"          }        ]      }    },    "/account/balance": {      "get": {        "operationId": "account.balance",        "summary": "Get balance",        "responses": {          "200": {            "description": "Balance",            "content": {              "application/json": {                "schema": {                  "type": "object",                  "properties": {                    "balance_usd": {                      "type": "number"                    }                  },                  "required": [                    "balance_usd"                  ]                }              }            }          }        },        "x-codeSamples": [          {            "lang": "js",            "source": "import { createOpenScienceClient } from \"@synsci/sdk\n\nconst client = createOpenScienceClient()\nawait client.account.balance({\n  ...\n})"          }        ]      }    },    "/account/devices": {      "get": {        "operationId": "account.devices",        "summary": "List devices",        "responses": {          "200": {            "description": "Devices",            "content": {              "application/json": {                "schema": {                  "type": "array",                  "items": {                    "type": "object",                    "properties": {                      "key_id": {                        "type": "string"                      },                      "name": {                        "type": "string"                      },                      "key_prefix": {                        "type": "string"                      },                      "created_at": {                        "type": "string"                      },                      "last_used_at": {                        "anyOf": [                          {                            "type": "string"                          },                          {                            "type": "null"                          }                        ]                      },                      "expires_at": {                        "anyOf": [                          {                            "type": "string"                          },                          {                            "type": "null"                          }                        ]                      }                    },                    "required": [                      "key_id",                      "name",                      "key_prefix",

Lines 1–500 of 14994.