@gethydra/sdk 0.1.13 → 0.1.14
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/dist/index.d.ts +30 -0
- package/dist/index.js +20 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18403,6 +18403,36 @@ declare class ContentCategoriesResource {
|
|
|
18403
18403
|
create(body: CreateBody$1, options?: ResourceRequestOptions): Promise<DataResponse<ContentCategory>>;
|
|
18404
18404
|
update(id: string, body: UpdateBody$1): Promise<DataResponse<ContentCategory>>;
|
|
18405
18405
|
delete(id: string): Promise<void>;
|
|
18406
|
+
listPosts(categoryId: string, params?: {
|
|
18407
|
+
limit?: number;
|
|
18408
|
+
cursor?: string;
|
|
18409
|
+
type?: 'post' | 'page';
|
|
18410
|
+
}): Promise<ListResponse<CategoryPost>>;
|
|
18411
|
+
addPosts(categoryId: string, body: {
|
|
18412
|
+
post_ids: string[];
|
|
18413
|
+
}): Promise<DataResponse<ContentCategory>>;
|
|
18414
|
+
removePost(categoryId: string, postId: string): Promise<void>;
|
|
18415
|
+
reorderPosts(categoryId: string, body: {
|
|
18416
|
+
posts: Array<{
|
|
18417
|
+
id: string;
|
|
18418
|
+
position: number;
|
|
18419
|
+
}>;
|
|
18420
|
+
}): Promise<void>;
|
|
18421
|
+
}
|
|
18422
|
+
/** Post within a content category, sorted by position. */
|
|
18423
|
+
interface CategoryPost {
|
|
18424
|
+
id: string;
|
|
18425
|
+
type: string;
|
|
18426
|
+
title: string;
|
|
18427
|
+
handle: string;
|
|
18428
|
+
status: string;
|
|
18429
|
+
position: number;
|
|
18430
|
+
featured_image: {
|
|
18431
|
+
id: string;
|
|
18432
|
+
src: string;
|
|
18433
|
+
alt: string | null;
|
|
18434
|
+
} | null;
|
|
18435
|
+
created_at: string;
|
|
18406
18436
|
}
|
|
18407
18437
|
|
|
18408
18438
|
type MembershipPlan = components['schemas']['MembershipPlan'];
|
package/dist/index.js
CHANGED
|
@@ -1557,6 +1557,26 @@ var ContentCategoriesResource = class {
|
|
|
1557
1557
|
async delete(id) {
|
|
1558
1558
|
return this.client.request("DELETE", `/v1/content-categories/${id}`);
|
|
1559
1559
|
}
|
|
1560
|
+
// ── Post sub-resources ──
|
|
1561
|
+
async listPosts(categoryId, params) {
|
|
1562
|
+
return this.client.request("GET", `/v1/content-categories/${categoryId}/posts`, { params });
|
|
1563
|
+
}
|
|
1564
|
+
async addPosts(categoryId, body) {
|
|
1565
|
+
return this.client.request("POST", `/v1/content-categories/${categoryId}/posts`, { body });
|
|
1566
|
+
}
|
|
1567
|
+
async removePost(categoryId, postId) {
|
|
1568
|
+
return this.client.request(
|
|
1569
|
+
"DELETE",
|
|
1570
|
+
`/v1/content-categories/${categoryId}/posts/${postId}`
|
|
1571
|
+
);
|
|
1572
|
+
}
|
|
1573
|
+
async reorderPosts(categoryId, body) {
|
|
1574
|
+
return this.client.request(
|
|
1575
|
+
"PATCH",
|
|
1576
|
+
`/v1/content-categories/${categoryId}/posts/reorder`,
|
|
1577
|
+
{ body }
|
|
1578
|
+
);
|
|
1579
|
+
}
|
|
1560
1580
|
};
|
|
1561
1581
|
|
|
1562
1582
|
// src/resources/membership-plans.ts
|