/** * - the GET document interface query parameters */ export type DocParamsGet = { /** * - object that descrive the document query */ query?: object; /** * - instance|schema, default value is instance. * Used to switch between getting documents from the instance or the schema graph. */ graph_type?: GraphType; /** * - only documents of the given type are returned. */ type?: string; /** * - only the document with the given ID is returned. */ id?: string; /** * - default is true, return IRIs using a prefixed notation wherever * possible. If false, full IRIs are used. */ prefixed?: boolean; /** * - default is false, return the documents with very * little whitespace. Each json document will be on its own line. */ minimized?: boolean; /** * - default is false, any subdocuments contained in the returned * document are returned too. If false, these are referred to by their ID instead. */ unfold?: boolean; /** * - default is 0, How many results to skip */ skip?: number; /** * count - How many results to return. If this option is absent, all * results are returned. */ count?: number; /** * default is false, If true, don't return a stream of json objects, * but a json list. */ as_list?: boolean; }; /** * - the POST document interface query parameters */ export type DocParamsPost = { /** * - default is false, If true, the input documents * are treated as raw JSON, inserted as type sys:JSONDocument and are not subject * to schema restrictions. */ raw_json?: boolean; /** * - default is instance instance|schema Used to switch between * getting documents from the instance or the schema graph. */ graph_type?: GraphType; /** * - default is false, If true, all existing documents are deleted * before inserting the posted documents. This allows the full replacement of the contents of a * database. This is especially useful for replacing the schema. */ full_replace?: boolean; }; /** * - the PUT document interface query parameters */ export type DocParamsPut = { /** * - default is false, If true, the input documents * are treated as raw JSON, inserted as type sys:JSONDocument and are not subject * to schema restrictions. */ raw_json?: boolean; /** * - If true, the function will create * a new document if it doesn't exist. */ create?: boolean; /** * - default is instance, instance|schema Used to switch between * getting documents from the instance or the schema graph. */ graph_type?: GraphType; }; /** * - the DELETE document interface query parameters */ export type DocParamsDelete = { /** * - default is instance, instance|schema Used to switch between * getting documents from the instance or the schema graph. */ graph_type?: GraphType; /** * - a single id or a list of ids to delete. */ id: string | any[]; /** * - default is false, If true, delete everything at this resource * location (dangerous!). */ nuke?: boolean; }; export type GraphRef = "schema/main" | "instance/main" | string; /** * (export/import) */ export type DataFormatObj = { /** * the format type */ type?: "csv" | "turtle"; /** * header format type */ format_header?: string; }; export type FuntionType = "add_quad" | "delete_quad" | "add_triple" | "delete_triple" | "quad" | "triple"; export type ResourceType = "commits" | "meta" | "branch" | "ref" | "repo" | "db"; export type GraphType = "instance" | "schema"; export type CredentialObj = { /** * - the authorization type of an TerminusDB connection */ type: 'basic' | 'jwt' | 'apikey'; /** * - the user id | I don't need the user with the jwt token */ user?: string | boolean; /** * - the connection key */ key: string; }; export type ActionType = 'graph' | 'db' | 'clone' | 'triples' | 'woql' | 'fetch' | 'pull' | 'rebase' | 'branch' | 'reset' | 'push' | 'squash'; export type ParamsObj = { /** * - api key for basic auth */ key?: string; /** * - jwt token to connect with terminusX server */ jwt?: string; /** * - the user id, we use this for basic authentication and for * identify the commits author */ user?: string; /** * - set organization to this id */ organization?: string; /** * - set cursor to this db */ db?: string; /** * - set cursor to this repo */ repo?: RepoType | string; /** * - set branch to this id */ branch?: string; /** * - set commit ref */ ref?: string; /** * - set the default branch id */ default_branch_id?: string; /** * - Api token to connect with TerminusX */ token?: string; }; export type RolesObj = { /** * - the Authorization connection's type */ agent_name: string; /** * - the user id | I don't need the user with the jwt token */ database_name?: string; /** * - the connection key */ organization_name?: string; /** * - list of roles */ actions?: any[]; /** * - */ invitation?: string; }; export type ScopeType = "database" | "organization"; export type RepoType = "local" | "remote"; export type DbDetails = { /** * - "Textual DB Name" */ label: string; /** * - "Text description of DB" */ comment?: string; /** * - */ public?: boolean; /** * - if set to true, a schema graph will be created */ schema?: boolean; }; export type DbDoc = { /** * - "Database ID" */ id: string; /** * - "Textual DB Name" */ label?: string; /** * - "Text description of DB" */ comment?: string; /** * - "Organization to which the db belongs" */ organization?: string; /** * - */ public?: boolean; /** * - if set to true, a schema graph will be created */ schema?: boolean; }; /** * - {remote: "origin", "remote_branch": "main", "author": * "admin","message": "message"} */ export type RemoteRepoDetails = { /** * - remote server url */ remote?: string; /** * - remote branch name */ remote_branch: string; /** * - if it is undefined it get the current author */ author?: string; /** * - the update commit message */ message?: string; }; export type CloneSourceDetails = { /** * - the remote db source url */ remote_url: string; label?: string; comment?: string; }; /** * - the manage capability command type */ export type CapabilityCommand = "grant" | "revoke"; /** * - [ACTIONS.CREATE_DATABASE | ACTIONS.DELETE_DATABASE] */ export type RolesActions = any[]; export type DocHistoryParams = { /** * - Index to start from, 0 is the default */ start?: number; /** * - Amount of commits to show, 10 is the default */ count?: number; /** * - Last updated time (excludes history) false is the default */ updated?: boolean; /** * - Created date of object (excludes history) false is the default */ created?: boolean; }; export type DiffObject = { /** * - Index to start from, 0 is the default */ keep?: any; /** * - Last updated time (excludes history) false is the default */ count?: number; /** * - Amount of commits to show, 10 is the default */ start?: number; }; /** * - { filename: "data.csv", data: "col1;col2\nval1;val2" } */ export type NamedResourceData = { /** * - Filename referenced in the WOQL query */ filename: string; /** * - Attached data, such as CSV contents */ data: string | Blob | Buffer; }; /** * - Represents a document frame, object frame, or property frame * in the viewer system. Frames are used to describe the structure and properties of data * being displayed or validated. */ export type Frame = { /** * - Subject identifier */ subject?: string; /** * - Property name */ property?: string; /** * - Type information (e.g., xsd:string, schema:Person) */ type?: string; /** * - Frame value */ value?: any; /** * - Depth in frame hierarchy */ depth?: number; /** * - Property range/type */ range?: string; /** * - Display label */ label?: string; /** * - Parent frame reference */ parent?: any; /** * - Child frames */ children?: any[]; /** * - Frame status: 'updated' | 'error' | 'new' | 'ok' */ status?: string; /** * - Whether this represents a literal value */ literal?: boolean; /** * - Index in parent collection */ index?: number; /** * - Nested frame data */ frame?: any; /** * - Class of the subject */ subjectClass?: string; };