@back23/promptly-sdk 2.11.0 → 2.12.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 +58 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,64 @@ const { data: posts } = await client.blog.list();
|
|
|
24
24
|
const products = await client.shop.listProducts();
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## v2.11.0 Changes
|
|
28
|
+
|
|
29
|
+
### Blog API Enhancement
|
|
30
|
+
|
|
31
|
+
Added missing fields to blog post responses and new endpoints for categories/tags.
|
|
32
|
+
|
|
33
|
+
**New API Endpoints:**
|
|
34
|
+
- `GET /api/{tenant}/blog/categories` - List all blog categories
|
|
35
|
+
- `GET /api/{tenant}/blog/tags` - List all blog tags
|
|
36
|
+
|
|
37
|
+
**BlogPost Type Updated:**
|
|
38
|
+
```typescript
|
|
39
|
+
interface BlogPost {
|
|
40
|
+
id: number;
|
|
41
|
+
title: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
excerpt: string;
|
|
44
|
+
featured_image: string | null;
|
|
45
|
+
category: string | null; // NEW
|
|
46
|
+
tags: string[]; // NEW
|
|
47
|
+
author: string;
|
|
48
|
+
views: number; // NEW
|
|
49
|
+
status: string;
|
|
50
|
+
published_at: string | null; // NEW
|
|
51
|
+
created_at: string;
|
|
52
|
+
content?: string; // Detail only
|
|
53
|
+
updated_at?: string; // Detail only
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**SDK Usage:**
|
|
58
|
+
```typescript
|
|
59
|
+
// Get all categories
|
|
60
|
+
const categories = await client.blog.categories();
|
|
61
|
+
// Returns: string[]
|
|
62
|
+
|
|
63
|
+
// Get all tags
|
|
64
|
+
const tags = await client.blog.tags();
|
|
65
|
+
// Returns: string[]
|
|
66
|
+
|
|
67
|
+
// Filter by category
|
|
68
|
+
const { data: posts } = await client.blog.byCategory('tech');
|
|
69
|
+
|
|
70
|
+
// Filter by tag
|
|
71
|
+
const { data: posts } = await client.blog.byTag('laravel');
|
|
72
|
+
|
|
73
|
+
// Access new fields
|
|
74
|
+
const { data: posts } = await client.blog.list();
|
|
75
|
+
posts.forEach(post => {
|
|
76
|
+
console.log(post.category); // 'tech' | null
|
|
77
|
+
console.log(post.tags); // ['laravel', 'php']
|
|
78
|
+
console.log(post.views); // 1234
|
|
79
|
+
console.log(post.published_at); // '2026-01-06T12:00:00+00:00'
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
27
85
|
## v2.5.0 Changes
|
|
28
86
|
|
|
29
87
|
### BoardPost Type Extension
|