n8n-nodes-base
Version:
Base nodes of n8n
299 lines (294 loc) • 8.13 kB
text/typescript
/**
* WooCommerce Node - Version 1
* Discriminator: resource=product, operation=create
*/
interface Credentials {
wooCommerceApi: CredentialReference;
}
/** Create a customer */
export type WooCommerceV1ProductCreateParams = {
resource: 'product';
operation: 'create';
/**
* Product name
*/
name?: string | Expression<string> | PlaceholderValue;
/**
* Additional Fields
* @default {}
*/
additionalFields?: {
/** If managing stock, this controls if backorders are allowed
* @default no
*/
backorders?: 'no' | 'notify' | 'yes' | Expression<string>;
/** Product external button text. Only for external products.
*/
buttonText?: string | Expression<string> | PlaceholderValue;
/** Catalog Visibility
* @default visible
*/
catalogVisibility?: 'catalog' | 'hidden' | 'search' | 'visible' | Expression<string>;
/** List of categories. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
* @default []
*/
categories?: string[];
/** List of cross-sell products IDs. Multiple can be added separated by ,.
*/
crossSellIds?: string | Expression<string> | PlaceholderValue;
/** Start date of sale price, in the site's timezone
*/
dateOnSaleFrom?: string | Expression<string>;
/** Ennd date of sale price, in the site's timezone
*/
dateOnSaleTo?: string | Expression<string>;
/** Product description
*/
description?: string | Expression<string> | PlaceholderValue;
/** Whether the product is downloadable
* @default false
*/
downloadable?: boolean | Expression<boolean>;
/** Product external URL. Only for external products.
*/
externalUrl?: string | Expression<string> | PlaceholderValue;
/** Whether the product is featured
* @default false
*/
featured?: boolean | Expression<boolean>;
/** Stock management at product level
* @default false
*/
manageStock?: boolean | Expression<boolean>;
/** Menu order, used to custom sort products
* @default 1
*/
menuOrder?: number | Expression<number>;
/** Product parent ID
*/
parentId?: string | Expression<string> | PlaceholderValue;
/** Optional note to send the customer after purchase
*/
purchaseNote?: string | Expression<string> | PlaceholderValue;
/** Product regular price
*/
regularPrice?: string | Expression<string> | PlaceholderValue;
/** Whether to allow reviews
* @default true
*/
reviewsAllowed?: boolean | Expression<boolean>;
/** Product sale price
*/
salePrice?: string | Expression<string> | PlaceholderValue;
/** Shipping class slug
*/
shippingClass?: string | Expression<string> | PlaceholderValue;
/** Product short description
*/
shortDescription?: string | Expression<string> | PlaceholderValue;
/** Unique identifier
*/
sku?: string | Expression<string> | PlaceholderValue;
/** Product slug
*/
slug?: string | Expression<string> | PlaceholderValue;
/** Whether to allow one item to be bought in a single order
* @default false
*/
soldIndividually?: boolean | Expression<boolean>;
/** A named status for the product
* @default publish
*/
status?: 'draft' | 'pending' | 'private' | 'publish' | Expression<string>;
/** Stock Quantity
* @default 1
*/
stockQuantity?: number | Expression<number>;
/** Controls the stock status of the product
* @default instock
*/
stockStatus?: 'instock' | 'outofstock' | 'onbackorder' | Expression<string>;
/** List of tags. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
* @default []
*/
tags?: string[];
/** Tax Class
*/
taxClass?: string | Expression<string> | PlaceholderValue;
/** Tax Status
* @default taxable
*/
taxStatus?: 'taxable' | 'shipping' | 'none' | Expression<string>;
/** Product type
* @default simple
*/
type?: 'simple' | 'grouped' | 'external' | 'variable' | Expression<string>;
/** List of up-sell products IDs. Multiple can be added separated by ,.
*/
upsellIds?: string | Expression<string> | PlaceholderValue;
/** Whether the product is virtual
* @default false
*/
virtual?: boolean | Expression<boolean>;
/** Product weight
*/
weight?: string | Expression<string> | PlaceholderValue;
};
/**
* Product dimensions
* @default {}
*/
dimensionsUi?: {
/** Dimension
*/
dimensionsValues?: {
/** Product height
*/
height?: string | Expression<string> | PlaceholderValue;
/** Product length
*/
length?: string | Expression<string> | PlaceholderValue;
/** Product width
*/
width?: string | Expression<string> | PlaceholderValue;
};
};
/**
* Product Image
* @default {}
*/
imagesUi?: {
/** Image
*/
imagesValues?: Array<{
/** Image alternative text
*/
alt?: string | Expression<string> | PlaceholderValue;
/** Image URL
*/
src?: string | Expression<string> | PlaceholderValue;
/** Image name
*/
name?: string | Expression<string> | PlaceholderValue;
}>;
};
/**
* Meta data
* @default {}
*/
metadataUi?: {
/** Metadata
*/
metadataValues?: Array<{
/** Name of the metadata key to add
*/
key?: string | Expression<string> | PlaceholderValue;
/** Value to set for the metadata key
*/
value?: string | Expression<string> | PlaceholderValue;
}>;
};
};
export type WooCommerceV1ProductCreateOutput = {
_links?: {
collection?: Array<{
href?: string;
}>;
self?: Array<{
href?: string;
}>;
};
average_rating?: string;
backordered?: boolean;
backorders?: string;
backorders_allowed?: boolean;
button_text?: string;
catalog_visibility?: string;
categories?: Array<{
id?: number;
name?: string;
slug?: string;
}>;
date_created?: string;
date_created_gmt?: string;
date_modified?: string;
date_modified_gmt?: string;
date_on_sale_from?: null;
date_on_sale_from_gmt?: null;
date_on_sale_to?: null;
date_on_sale_to_gmt?: null;
description?: string;
dimensions?: {
height?: string;
length?: string;
width?: string;
};
download_expiry?: number;
download_limit?: number;
downloadable?: boolean;
external_url?: string;
featured?: boolean;
generated_slug?: string;
global_unique_id?: string;
has_options?: boolean;
id?: number;
images?: Array<{
alt?: string;
date_created?: string;
date_created_gmt?: string;
date_modified?: string;
date_modified_gmt?: string;
id?: number;
name?: string;
src?: string;
}>;
manage_stock?: boolean;
menu_order?: number;
meta_data?: Array<{
id?: number;
key?: string;
}>;
name?: string;
on_sale?: boolean;
parent_id?: number;
permalink?: string;
permalink_template?: string;
post_password?: string;
price?: string;
price_html?: string;
purchasable?: boolean;
purchase_note?: string;
rating_count?: number;
regular_price?: string;
related_ids?: Array<number>;
reviews_allowed?: boolean;
sale_price?: string;
shipping_class?: string;
shipping_class_id?: number;
shipping_required?: boolean;
shipping_taxable?: boolean;
short_description?: string;
sku?: string;
slug?: string;
sold_individually?: boolean;
status?: string;
stock_status?: string;
tags?: Array<{
id?: number;
name?: string;
slug?: string;
}>;
tax_class?: string;
tax_status?: string;
total_sales?: number;
type?: string;
virtual?: boolean;
weight?: string;
};
export type WooCommerceV1ProductCreateNode = {
type: 'n8n-nodes-base.wooCommerce';
version: 1;
credentials?: Credentials;
config: NodeConfig<WooCommerceV1ProductCreateParams>;
output?: Items<WooCommerceV1ProductCreateOutput>;
};