UNPKG

@docyrus/tanstack-db-generator

Version:

Code generator utilities for TanStack Query / Database integration with Docyrus API

131 lines (130 loc) 5.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.listParameterDefinitions = void 0; exports.listParameterDefinitions = { "AppSlug": { "name": "appSlug", "required": true, "in": "path", "description": "App slug", "schema": { "type": "string" } }, "DataSourceSlug": { "name": "dataSourceSlug", "required": true, "in": "path", "description": "Data source slug", "schema": { "type": "string" } }, "Columns": { "name": "columns", "in": "query", "description": "\nList of columns.\n\nEach column can be specified by its name or as an array of expanded columns inside parentheses. They can also take aliases by using the \":\" character.\n\n**Example**: Suppose that you have \"account\" records, and \"contact\" records for each account connecting through \"related_account\" column. You can use following column syntax to get account and contact data together:\n\n**Fetch given columns as they are:**\n\n ```\n [\"firstname\",\"lastname\",\"related_account\"]` \n =>\n { firstname: \"...\", lastname: \"...\", related_account: { \"id\": \"...\" } }\n ```\n\n**Fetch related account columns:**\n\n ```\n [\"firstname\",\"lastname\",\"related_account(name,phone)\"]\n =>\n { firstname: \"...\", lastname: \"...\", related_account: { \"name\": \"...\", \"phone\": \"...\" } }\n ```\n\n**Use aliases:**\n\n ```\n [\"f:firstname\",\"l:lastname\",\"a:related_account(name,phone)\"]\n =>\n { f: \"...\", l: \"...\", a: { \"name\": \"...\", \"phone\": \"...\" } }\n ```\n\n**Use spread operator:** \n\n ```\n [\"firstname\",\"lastname\",\"...related_account(accountName:name,accountPhone:phone)\"]\n =>\n { firstname: \"...\", lastname: \"...\", \"accountName\": \"...\", \"accountPhone\": \"...\" }\n ```\n\n", "schema": { "type": "array", "items": { "type": "string" } } }, "DistinctColumns": { "name": "distinctColumns", "in": "query", "description": "List of distinct columns in order to deduplicate data. Should be avoided unless it is strictly necessary for performance reasons.", "schema": { "type": "array", "items": { "type": "string" } } }, "Rows": { "name": "rows", "in": "query", "description": "List of columns for second axis. Used for pivotal queries.", "schema": { "type": "array", "items": { "type": "string" } } }, "Formulas": { "name": "formulas", "in": "query", "schema": { "format": "object", "type": "string" } }, "Calculations": { "name": "calculations", "in": "query", "description": "List of calculation objects to aggregate data.", "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QueryCalculationRuleParams" } } }, "Filters": { "name": "filters", "in": "query", "description": "List of filter rules.", "schema": { "properties": { "rules": { "description": "List of filter rules or groups", "type": "array", "items": { "anyOf": [ { "$ref": "#/components/schemas/QueryFilterRuleParams" }, { "$ref": "#/components/schemas/QueryFilterGroupParams" } ] } }, "combinator": { "type": "string", "enum": ["and", "or"], "description": "Combinator for filter rules", "default": "and" }, "not": { "type": "boolean", "description": "Negate the filter", "default": false } }, "type": "object" } }, "FilterKeyword": { "name": "filterKeyword", "in": "query", "description": "Text for keyword search.", "schema": { "type": "string" } }, "OrderBy": { "name": "orderBy", "in": "query", "description": "List of columns or orderBy rules to sort data.", "schema": { "format": "orderBy object", "type": "string" } }, "Limit": { "name": "limit", "in": "query", "description": "Number of records to return.", "schema": { "default": 100, "type": "integer" } }, "Offset": { "name": "offset", "in": "query", "description": "Number of records to skip.", "schema": { "default": 0, "type": "integer" } }, "FullCount": { "name": "fullCount", "in": "query", "description": "Return full count of records that match the given filters.", "schema": { "default": false, "type": "boolean" } }, "Expand": { "name": "expand", "in": "query", "description": "List of relation, user and enum columns to expand.", "schema": { "type": "string" } }, "XConnectionId": { "name": "x-connection-id", "in": "header", "description": "Connection configuration ID of related data provider", "schema": { "type": "string", "format": "uuid" } }, "XConnectionAccountId": { "name": "x-connection-account-id", "in": "header", "description": "Tenant/Account ID of related data provider, if it is a multi-tenant system", "schema": { "type": "string", "format": "uuid" } } };