SDK Reference
Complete reference documentation for the dcupl SDK.
API Reference
Detailed API documentation for all SDK components.
| Reference | Description |
|---|---|
| Dcupl Class | Main entry point - constructor, init, update, destroy, events |
| Models API | Model definition and management |
| Data API | Data operations - set, update, upsert, remove, reset |
| Lists API | List creation, management, and querying |
| Catalog API | Query execution, filtering, and pagination |
Query Reference
Everything about querying and filtering data.
| Reference | Description |
|---|---|
| Query Operators | Complete operator reference (eq, gt, find, gte, lte, etc.) |
| Filtering | Filtering fundamentals |
| Query Logic | AND/OR logic and grouped queries |
| Deep Queries | Query across references |
| Results & Pagination | Result ordering and pagination |
Functions Reference
Analytical and data processing functions.
| Reference | Description |
|---|---|
| Functions API | Facets, aggregations, suggestions, groupBy, pivot |
| Facets | Faceted filter generation |
| Aggregations | Sum, avg, min, max, count |
| Suggestions | Autocomplete suggestions |
| Pivot Tables | Pivot table creation |
Type Reference
TypeScript type definitions.
| Reference | Description |
|---|---|
| Type Definitions | Complete TypeScript types |
Quick Reference
Installation
npm install @dcupl/core @dcupl/loaderyarn add @dcupl/core @dcupl/loaderpnpm add @dcupl/core @dcupl/loaderBasic Setup
setup.ts
import { Dcupl } from '@dcupl/core';
import { DcuplAppLoader } from '@dcupl/loader';
// Create instance
const dcupl = new Dcupl({
performance: {
cache: { enabled: true },
},
});
// Add loader
const loader = new DcuplAppLoader();
dcupl.loaders.add(loader);
// Load configuration
await loader.loadFromUrl('/dcupl.lc.json');
// Initialize
await dcupl.init();Query Data
query.ts
// Single item
const product = dcupl.query.one({
modelKey: 'Product',
itemKey: 'p1',
});
// Multiple items
const products = dcupl.query.execute({
modelKey: 'Product',
queries: [
{ operator: 'eq', attribute: 'status', value: 'active' },
{ operator: 'gte', attribute: 'price', value: 50 },
],
sort: [{ attribute: 'price', direction: 'asc' }],
count: 20,
});Update Data
update.ts
// Update items
dcupl.data.update([{ key: 'p1', price: 150 }], { model: 'Product' });
// Process changes
await dcupl.update();See Also
- Quick Start - Get started in 5 minutes
- Core Concepts - Understand the fundamentals
- Setup Options - Configuration reference