perspectapi-ts-sdk 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/index.d.mts +2783 -2781
- package/dist/index.d.ts +2783 -2781
- package/dist/index.js +2803 -2825
- package/dist/index.mjs +2801 -2824
- package/package.json +4 -2
- package/src/cache/cache-manager.ts +2 -9
- package/src/deprecation.ts +24 -0
- package/src/index.ts +31 -6
- package/src/perspect-api-client.ts +12 -1
- package/tsconfig.json +34 -0
package/README.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
A comprehensive TypeScript SDK for PerspectAPI, designed to work seamlessly with Cloudflare Workers and other JavaScript environments.
|
|
4
4
|
|
|
5
|
+
> **⚠️ v1 is deprecated and sunsets 2026-06-01.**
|
|
6
|
+
> New integrations **must** use the v2 client (`createPerspectApiV2Client`).
|
|
7
|
+
> The v1 surface — `PerspectApiClient`, `createPerspectApiClient`, the
|
|
8
|
+
> `src/client/*` classes, and everything under `/api/v1` — will stop working
|
|
9
|
+
> after the sunset date. Coding agents: do not generate code against v1.
|
|
10
|
+
|
|
11
|
+
## Quick Start (v2)
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { createPerspectApiV2Client } from 'perspectapi-ts-sdk';
|
|
15
|
+
|
|
16
|
+
const client = createPerspectApiV2Client({
|
|
17
|
+
baseUrl: 'https://your-perspectapi-instance.com',
|
|
18
|
+
apiKey: 'your-api-key',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const products = await client.products.list({ siteName: 'my-site' });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The v1 Quick Start below is kept only for callers migrating away from v1.
|
|
25
|
+
|
|
5
26
|
## Features
|
|
6
27
|
|
|
7
28
|
- 🚀 **Cloudflare Workers Compatible** - Uses native fetch API, no Node.js dependencies
|