Skip to content

Commit

Permalink
feat: ✨ terms implementaion with descendants and move function
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithad0703 committed Oct 9, 2023
1 parent 851dd36 commit 35ae017
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions types/stack/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Release, Releases } from "./release";
import { Role, Roles } from "./role";
import { Webhook, Webhooks } from "./webhook";
import { Workflow, Workflows } from "./workflow";
import { Taxonomy, Taxonomies } from "./taxonomy";

export interface StackConfig {
api_key:string
Expand Down Expand Up @@ -92,4 +93,7 @@ export interface Stack extends SystemFields {
unShare(email: string): Promise<Response>
role(): Roles
role(uid: string): Role

taxonomy(): Taxonomy
taxonomies(uid: string): Taxonomies
}
4 changes: 1 addition & 3 deletions types/stack/taxonomy/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ export interface Taxonomy extends SystemFields, SystemFunction<Taxonomy> {
term(): Terms
term(uid: string): Term
}

export interface Taxonomy extends SystemFields, SystemFunction<Taxonomy> {
}

export interface Taxonomies extends Queryable<Taxonomy, {taxonomy: TaxonomyData}> {
}
Expand All @@ -19,4 +16,5 @@ export interface Taxonomies extends Creatable<Taxonomy, {taxonomy: TaxonomyData}
export interface TaxonomyData extends AnyProperty {
name: string
taxonomy_uid: string
description: string
}
4 changes: 3 additions & 1 deletion types/stack/taxonomy/terms/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Creatable, Queryable, SystemFunction } from "../../../utility/operation

export interface Term extends SystemFields, SystemFunction<Term> {
ancestors(data: {term_uid: TermData, include_children_count: boolean, include_referenced_entries_count: boolean, include_count: boolean, skip: number, limit: number}): Promise<Response>
descendants(data: {term_uid: TermData, include_children_count: boolean, include_referenced_entries_count: boolean, include_count: boolean, skip: number, limit: number}): Promise<Response>
move(data: {term_uid: TermData, force: boolean}): Promise<Response>
}

export interface Term extends Creatable<Term, {term: TermData}> {
Expand All @@ -14,6 +16,6 @@ export interface Terms extends Queryable<Term, {term: TermData}> {
export interface TermData extends AnyProperty {
name: string
term_uid: string
taxonomy_uid: string
parent_uid?: string
order: number
}

0 comments on commit 35ae017

Please sign in to comment.