docyrus-api-dev

Develop applications using the Docyrus API with @docyrus/api-client and @docyrus/signin libraries. Use when building apps that authenticate with Docyrus OAuth2 (PKCE, iframe, client credentials, device code), make REST API calls to Docyrus data source endpoints, construct query payloads with filters

By docyrus · 795 installs

npx skills add docyrus/agent-skills --skill docyrus-api-dev

Source repository · Upstream listing

Docyrus API Developer Integrate with the Docyrus API using @docyrus/api client (REST client) and @docyrus/signin (React auth provider). Authenticate via OAuth2 PKCE, query data sources with powerful filtering/aggregation, and consume REST endpoints. Authentication Quick Start React Apps — Use @docyrus/signin Non React / Server — Use OAuth2Client Directly API Endpoints Data Source Items (Dynamic per tenant) Endpoints exist only if the data source is defined in the tenant. Check the tenant's OpenAPI spec at GET /v1/api/openapi.json . System Endpoints (Always Available) Connector Discovery & External Request Endpoints Scopes: Read.All , ReadWrite.All , or Connectors.Read.All . The PUT endpoint requires ReadWrite.All . PUT request body for sending requests through a connector: The connector resolves auth credentials (OAuth tokens, base URL) from the provider configuration and stored connections. Custom headers.Authorization overrides the stored token. Action Run Endpoints Action run accepts arbitrary JSON body as input. Optional headers: x connection id , x connection account id . ACL / Role Management Endpoints ACL routes require the normal authenticated API session, but they may not appear in generated Swagger/OpenAPI output because the backend currently excludes them from public docs. Integrate them with direct RestApiClient calls when you need record sharing, role CRUD, user role assignment management, or role query management. For all ACL role operations, prefer using role uid values returned by the API. Nested role objects expose both id and uid , and both map to the role UID value. To configure ACL (create roles, assign operation level permissions, build role queries and an org hierarchy) use the docyrus acl design skill ( docyrus acl … ). The endpoints above are the runtime REST surface for app/frontend integration. Making API Calls Query Payload Summary The GET items endpoint accepts a powerful query payload: Feature Purpose columns Select fields, expand relations field(subfields) , alias alias:field , spread ...field() filters Nested AND/OR groups with 50+ operators (comparison, date shortcuts, user related) filterKeyword Full text search across all searchable fields orderBy Sort by fields with direction, including related fields limit / offset Pagination (default limit: 100) fullCount Return total matching count alongside results calculations Aggregations: count, sum, avg, min, max with grouping formulas Computed virtual columns (simple functions, block AST, correlated subqueries) childQueries Fetch related child records as nested JSON arrays pivot Cross tab matrix queries with date range series expand Return full objects for relation/user/enum fields instead of IDs For full query and formula references, read : references/data source query guide.md references/formula design guide llm.md Critical Rules 1. Always send columns in list/get calls. Without it, only id is returned. 2. Data source endpoints are dynamic — they exist only for data sources defined in the tenant. 3. Use id field for count calculations. Use the actual field slug for sum , avg , min , max . 4. Child query keys must appear in columns — if childQuery key is orders , include orders in columns. 5. Formula keys must appear in columns — if formula key is total , include total in columns. 6. Filter by related field using rel {{relation field}}/{{field}} syntax. 7. ACL routes may be hidden from generated OpenAPI — call them directly via RestApiClient instead of expecting generated collection support. 8. Prefer role uid values for ACL role writes, user role roleIds , and role query roleIds . 9. Treat PUT /v1/users/acl/users/:userId/roles as full replacement and POST /v1/users/acl/users/:userId/roles as additive. 10. Send role query query as raw JSON and let backend derive tenantAppId from dataSourceId when applicable. 11. After deleting a role, refresh dependent ACL state — role lists, user role lists, role query lists, and any UI showing primary role labels. References Read these files when you need detailed information: references/api client.md — Full RestApiClient API, OAuth2Client (all flows: PKCE, client credentials, device code), token managers, interceptors, error classes, SSE/streaming, file upload/download, HTML to PDF, retry logic references/authentication.md — @docyrus/signin React provider, useDocyrusAuth/useDocyrusClient hooks, hasRole/hasPermission authorization helpers, SignInButton, standalone vs iframe auth modes, env vars, API client access pattern references/data source query guide.md — Up to date query payload guide: columns, filters, orderBy, pagination, calculations, formulas, child queries, pivots, and operator reference references/formula design guide llm.md — Up to date formula design guide for building and validating formulas payloads