-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcontentstack-delivery-typescript.mdc
More file actions
33 lines (20 loc) · 1.46 KB
/
contentstack-delivery-typescript.mdc
File metadata and controls
33 lines (20 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
description: "CDA Delivery SDK — stack, queries, cache, live preview, @contentstack/core"
globs: ["src/**/*.ts"]
alwaysApply: false
---
# Contentstack TypeScript Delivery SDK (`src/`)
## Stack entry
- **`stack(config: StackConfig)`** in **`src/stack/contentstack.ts`** resolves **region → host** (`getHostforRegion`), merges **live_preview**, builds the Axios stack via **`httpClient`** + **`retryRequestHandler`** / **`retryResponseHandler`** / **`retryResponseErrorHandler`**, and returns **`Stack`**.
## Features
- **Queries** — **`src/query/*`**: base query, entry/asset/taxonomy/content-type/global-field queryables; chain methods match CDA query parameters.
- **Cache** — **`src/cache`** + **`Policy`** on **StackConfig**; persistence plugins may be documented as optional packages in JSDoc.
- **Sync** — **`src/sync/synchronization.ts`** for sync token workflows.
## Live preview
- **StackConfig.live_preview** — **enable**, **preview_token**, **host**, etc.; keep behavior aligned with tests under **`test/api/live-preview*.spec.ts`**.
## Plugins
- **ContentstackPlugin** interceptors should follow existing **preRequest**/**onData** patterns in **Stack** if extending.
## Core alignment
- HTTP defaults (**timeout**, retries, headers) must stay consistent with **`@contentstack/core`** capabilities; avoid duplicating retry logic that belongs in **core**.
## Docs
- [Content Delivery API](https://www.contentstack.com/docs/developers/apis/content-delivery-api/)