Skip to content

Commit 6a8122f

Browse files
feat: type definitions for taxonomy management
1 parent 62e3994 commit 6a8122f

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

src/lib/types.ts

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ export type queryParams = {
1414

1515
/**
1616
* Interface for creating Contentstack plugins
17-
*
17+
*
1818
* @example
1919
* ```typescript
2020
* import { ContentstackPlugin } from '@contentstack/delivery-sdk';
21-
*
21+
*
2222
* class MyPlugin implements ContentstackPlugin {
2323
* onRequest(config: any): any {
2424
* // Modify request configuration
2525
* console.log('Processing request:', config.url);
2626
* return { ...config, headers: { ...config.headers, 'X-Custom-Header': 'value' } };
2727
* }
28-
*
28+
*
2929
* onResponse(request: any, response: any, data: any): any {
3030
* // Process response data
3131
* console.log('Processing response:', response.status);
3232
* return { ...response, data: { ...data, processed: true } };
3333
* }
3434
* }
35-
*
35+
*
3636
* const stack = contentstack.stack({
3737
* apiKey: 'your-api-key',
3838
* deliveryToken: 'your-delivery-token',
@@ -342,3 +342,31 @@ export type LivePreview = {
342342
management_token?: string;
343343
preview_token?: string;
344344
};
345+
346+
export interface BaseTaxonomy {
347+
uid: string;
348+
name: string;
349+
description?: string;
350+
terms_count?: number;
351+
created_at: string;
352+
updated_at: string;
353+
created_by: string;
354+
updated_by: string;
355+
type: string;
356+
ACL: ACL;
357+
publish_details?: PublishDetails;
358+
}
359+
360+
export interface BaseTerm {
361+
taxonomy_uid: string;
362+
uid: string;
363+
name: string;
364+
created_by: string;
365+
created_at: string;
366+
updated_by: string;
367+
updated_at: string;
368+
children_count?: number;
369+
depth?: number;
370+
ACL: ACL;
371+
publish_details?: PublishDetails;
372+
}

0 commit comments

Comments
 (0)