UNPKG

omnisend-node-sdk

Version:

🔹 Typesafe Omnisend API SDK for Node.js

118 lines (117 loc) • 3.68 kB
import type { CategoryOutput, CategoryPartial, PagingLink } from "../data-contracts"; import type { HttpClient, RequestParams } from "../http-client"; export declare class Categories<SecurityDataType = unknown, SafeMode extends true | false = false> { http: HttpClient<SecurityDataType, SafeMode>; constructor(http: HttpClient<SecurityDataType, SafeMode>); /** * No description * * @tags Products * @name GetCategoriesCategoryId * @summary Get category * @request GET:/categories/{categoryID} * @secure */ getCategoriesCategoryId: (categoryId: string, params?: RequestParams) => Promise<SafeMode extends true ? { success: false; error?: string | undefined; } | { success: true; data: CategoryOutput; } : CategoryOutput>; /** * @description Replace category. Pass all category info. Not passed fields will be deleted. For example if `createdAt` won't be passed, it will be overwritten with current date. * * @tags Products * @name PutCategories * @summary Replace category * @request PUT:/categories/{categoryID} * @secure */ putCategories: (categoryId: string, data: CategoryPartial, params?: RequestParams) => Promise<SafeMode extends true ? { success: false; error?: string | undefined; } | { success: true; data: { categoryID?: string | undefined; }; } : { categoryID?: string | undefined; }>; /** * @description Delete category * * @tags Products * @name DeleteCategory * @summary Delete category * @request DELETE:/categories/{categoryID} * @secure */ deleteCategory: (categoryId: string, params?: RequestParams) => Promise<SafeMode extends true ? { success: false; error?: string | undefined; } | { success: true; data: void; } : void>; /** * @description **Sorting:** | **Parameter** | **Sort order** | **Description** | | --- | ---| --- | |title|ASC|Category title| | createdAt | DESC | Category creation date - recent first | | updatedAt | DESC | Category update date - recent first | * * @tags Products * @name GetCategories * @summary List categories * @request GET:/categories * @secure */ getCategories: (query?: { sort?: string; /** * Number of results to skip. Default is 0. * @min 0 * @default 0 */ offset?: number; /** * Number of results to fetch. Default is 100, max 250. * @min 1 * @max 250 * @default 100 */ limit?: number; }, params?: RequestParams) => Promise<SafeMode extends true ? { success: false; error?: string | undefined; } | { success: true; data: { categories?: CategoryOutput[] | undefined; paging?: PagingLink | undefined; }; } : { categories?: CategoryOutput[] | undefined; paging?: PagingLink | undefined; }>; /** * @description Create new category. * * @tags Products * @name PostCategories * @summary Create category * @request POST:/categories * @secure */ postCategories: (data: { categoryID: string; } & CategoryPartial, params?: RequestParams) => Promise<SafeMode extends true ? { success: false; error?: string | undefined; } | { success: true; data: { categoryID?: string | undefined; }; } : { categoryID?: string | undefined; }>; }