mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add product API for legacy connections
This commit is contained in:
39
src/Types/Product.ts
Normal file
39
src/Types/Product.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
export type CatalogResult = {
|
||||
data: {
|
||||
paging: { cursors: { before: string, after: string } },
|
||||
data: any[]
|
||||
}
|
||||
}
|
||||
|
||||
export type ProductCreateResult = {
|
||||
data: { product: any }
|
||||
}
|
||||
|
||||
export type ProductAvailability = 'in stock'
|
||||
|
||||
export type ProductBase = {
|
||||
name: string
|
||||
retailerId?: string
|
||||
url?: string
|
||||
description: string
|
||||
price: number
|
||||
currency: string
|
||||
isHidden?: boolean
|
||||
}
|
||||
|
||||
export type ProductCreate = ProductBase & {
|
||||
/** ISO country code for product origin. Set to undefined for no country */
|
||||
originCountryCode: string | undefined
|
||||
|
||||
imageUrls: string[]
|
||||
}
|
||||
|
||||
export type ProductUpdate = Omit<ProductCreate, 'originCountryCode'>
|
||||
|
||||
export type Product = ProductBase & {
|
||||
id: string
|
||||
imageUrls: { [_: string]: string }
|
||||
reviewStatus: { [_: string]: string }
|
||||
availability: ProductAvailability
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export * from './Message'
|
||||
export * from './Legacy'
|
||||
export * from './Socket'
|
||||
export * from './Events'
|
||||
export * from './Product'
|
||||
|
||||
import type NodeCache from 'node-cache'
|
||||
import { proto } from '../../WAProto'
|
||||
|
||||
Reference in New Issue
Block a user