mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
Merge branch 'n8n-io:master' into Add-schema-registry-into-kafka
This commit is contained in:
commit
0621933e54
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "n8n",
|
||||
"version": "0.132.0",
|
||||
"version": "0.132.2",
|
||||
"description": "n8n Workflow Automation Tool",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"homepage": "https://n8n.io",
|
||||
|
@ -110,7 +110,7 @@
|
|||
"mysql2": "~2.2.0",
|
||||
"n8n-core": "~0.78.0",
|
||||
"n8n-editor-ui": "~0.100.0",
|
||||
"n8n-nodes-base": "~0.129.0",
|
||||
"n8n-nodes-base": "~0.129.1",
|
||||
"n8n-workflow": "~0.64.0",
|
||||
"oauth-1.0a": "^2.2.6",
|
||||
"open": "^7.0.0",
|
||||
|
@ -120,7 +120,7 @@
|
|||
"sqlite3": "^5.0.1",
|
||||
"sse-channel": "^3.1.1",
|
||||
"tslib": "1.14.1",
|
||||
"typeorm": "^0.2.30",
|
||||
"typeorm": "0.2.34",
|
||||
"winston": "^3.3.3"
|
||||
},
|
||||
"jest": {
|
||||
|
|
|
@ -35,7 +35,7 @@ export class CiscoWebex implements INodeType {
|
|||
description: INodeTypeDescription = {
|
||||
displayName: 'Cisco Webex',
|
||||
name: 'ciscoWebex',
|
||||
icon: 'file:ciscoWebex.svg',
|
||||
icon: 'file:ciscoWebex.png',
|
||||
group: ['transform'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
|
|
|
@ -26,7 +26,7 @@ export class CiscoWebexTrigger implements INodeType {
|
|||
description: INodeTypeDescription = {
|
||||
displayName: 'Cisco Webex Trigger',
|
||||
name: 'ciscoWebexTrigger',
|
||||
icon: 'file:ciscoWebex.svg',
|
||||
icon: 'file:ciscoWebex.png',
|
||||
group: ['trigger'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["resource"] + ":" + $parameter["event"]}}',
|
||||
|
|
BIN
packages/nodes-base/nodes/Cisco/Webex/ciscoWebex.png
Normal file
BIN
packages/nodes-base/nodes/Cisco/Webex/ciscoWebex.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 216 KiB |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px"><path fill="#7cb342" d="M32.334,13.733c0.092,0.706,0.144,1.424,0.144,2.155c0,9.181-7.463,16.623-16.669,16.623 c-0.733,0-1.453-0.052-2.161-0.144C14.305,33.584,15.895,36.132,19,38c0.699,0.421,3.13,1.851,6,2c7.195,0.374,14.844-7.424,15-15 c0.021-1.024,0.041-4.057-2-7C36.061,15.203,33.379,14.101,32.334,13.733z"/><path fill="#29b6f6" d="M10.661,24c0-7.315,5.947-13.246,13.283-13.246c3.668,0,6.989,1.483,9.392,3.88l4.789-4.776 C34.496,6.239,29.482,4,23.944,4C12.867,4,3.888,12.954,3.888,24c0,5.523,2.245,10.523,5.874,14.142l4.789-4.776 C12.148,30.969,10.661,27.658,10.661,24z"/><path fill="#244b71" d="M38.126,9.858c-1.323-1.319-3.467-1.319-4.789,0c-1.323,1.319-1.323,3.457,0,4.776c0,0,0,0,0,0 c2.404,2.397,3.89,5.708,3.89,9.366c0,7.315-5.947,13.246-13.283,13.246c-3.668,0-6.989-1.483-9.392-3.88l0,0 c-1.323-1.319-3.467-1.319-4.789,0c-1.323,1.319-1.323,3.457,0,4.776C13.392,41.761,18.406,44,23.944,44C35.021,44,44,35.046,44,24 C44,18.477,41.755,13.477,38.126,9.858z"/></svg>
|
Before Width: | Height: | Size: 1 KiB |
|
@ -84,7 +84,7 @@ export class Interval implements INodeType {
|
|||
throw new Error('The interval value is too large.');
|
||||
}
|
||||
|
||||
const intervalObj = setInterval(executeTrigger, );
|
||||
const intervalObj = setInterval(executeTrigger, intervalValue);
|
||||
|
||||
async function closeFunction() {
|
||||
clearInterval(intervalObj);
|
||||
|
|
|
@ -149,6 +149,17 @@ export function toSnakeCase(data:
|
|||
}
|
||||
}
|
||||
|
||||
export function setFields(fieldsToSet: IDataObject, body: IDataObject) {
|
||||
for(const fields in fieldsToSet) {
|
||||
if (fields === 'tags') {
|
||||
body['tags'] = (fieldsToSet[fields] as string[]).map(tag => ({id: parseInt(tag, 10)}));
|
||||
} else {
|
||||
body[snakeCase(fields.toString())] = fieldsToSet[fields];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export function adjustMetadata(fields: IDataObject & Metadata) {
|
||||
if (!fields.meta_data) return fields;
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ export interface ICouponLine {
|
|||
}
|
||||
|
||||
export interface IOrder {
|
||||
[index: string]: any; // tslint:disable-line:no-any
|
||||
billing?: IAddress;
|
||||
coupon_lines?: ICouponLine[];
|
||||
currency?: string;
|
||||
|
|
|
@ -13,42 +13,5 @@ export interface IImage {
|
|||
}
|
||||
|
||||
export interface IProduct {
|
||||
backorders?: string;
|
||||
button_text?: string;
|
||||
catalog_visibility?: string;
|
||||
categories?: IDataObject[];
|
||||
cross_sell_ids?: string[];
|
||||
date_on_sale_from?: string;
|
||||
date_on_sale_to?: string;
|
||||
description?: string;
|
||||
dimensions?: IDimension;
|
||||
downloadable?: boolean;
|
||||
external_url?: string;
|
||||
featured?: boolean;
|
||||
images?: IImage[];
|
||||
manage_stock?: boolean;
|
||||
menu_order?: number;
|
||||
meta_data?: IDataObject[];
|
||||
name?: string;
|
||||
parent_id?: string;
|
||||
price?: string;
|
||||
purchase_note?: string;
|
||||
regular_price?: string;
|
||||
reviews_allowed?: boolean;
|
||||
sale_price?: string;
|
||||
shipping_class?: string;
|
||||
short_description?: string;
|
||||
sku?: string;
|
||||
slug?: string;
|
||||
sold_individually?: boolean;
|
||||
status?: string;
|
||||
stock_quantity?: number;
|
||||
stock_status?: string;
|
||||
tags?: IDataObject[];
|
||||
tax_class?: string;
|
||||
tax_status?: string;
|
||||
type?: string;
|
||||
upsell_ids?: string[];
|
||||
virtual?: boolean;
|
||||
weight?: string;
|
||||
[index: string]: string | number | string[] | number[] | IDataObject | IDataObject[] | IImage[] | IDimension;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
} from 'n8n-workflow';
|
||||
import {
|
||||
adjustMetadata,
|
||||
setFields,
|
||||
setMetadata,
|
||||
toSnakeCase,
|
||||
woocommerceApiRequest,
|
||||
|
@ -252,102 +253,13 @@ export class WooCommerce implements INodeType {
|
|||
const body: IProduct = {
|
||||
name,
|
||||
};
|
||||
if (additionalFields.backorders) {
|
||||
body.backorders = additionalFields.backorders as string;
|
||||
}
|
||||
if (additionalFields.buttonText) {
|
||||
body.button_text = additionalFields.buttonText as string;
|
||||
}
|
||||
if (additionalFields.catalogVisibility) {
|
||||
body.catalog_visibility = additionalFields.catalogVisibility as string;
|
||||
}
|
||||
|
||||
setFields(additionalFields, body);
|
||||
|
||||
if (additionalFields.categories) {
|
||||
body.categories = (additionalFields.categories as string[]).map(category => ({ id: parseInt(category, 10) })) as unknown as IDataObject[];
|
||||
}
|
||||
if (additionalFields.crossSellIds) {
|
||||
body.cross_sell_ids = (additionalFields.crossSellIds as string).split(',') as string[];
|
||||
}
|
||||
if (additionalFields.dateOnSaleFrom) {
|
||||
body.date_on_sale_from = additionalFields.dateOnSaleFrom as string;
|
||||
}
|
||||
if (additionalFields.dateOnSaleTo) {
|
||||
body.date_on_sale_to = additionalFields.dateOnSaleTo as string;
|
||||
}
|
||||
if (additionalFields.description) {
|
||||
body.description = additionalFields.description as string;
|
||||
}
|
||||
if (additionalFields.downloadable) {
|
||||
body.downloadable = additionalFields.downloadable as boolean;
|
||||
}
|
||||
if (additionalFields.externalUrl) {
|
||||
body.external_url = additionalFields.externalUrl as string;
|
||||
}
|
||||
if (additionalFields.featured) {
|
||||
body.featured = additionalFields.featured as boolean;
|
||||
}
|
||||
if (additionalFields.manageStock) {
|
||||
body.manage_stock = additionalFields.manageStock as boolean;
|
||||
}
|
||||
if (additionalFields.parentId) {
|
||||
body.parent_id = additionalFields.parentId as string;
|
||||
}
|
||||
if (additionalFields.purchaseNote) {
|
||||
body.purchase_note = additionalFields.purchaseNote as string;
|
||||
}
|
||||
if (additionalFields.regularPrice) {
|
||||
body.regular_price = additionalFields.regularPrice as string;
|
||||
}
|
||||
if (additionalFields.reviewsAllowed) {
|
||||
body.reviews_allowed = additionalFields.reviewsAllowed as boolean;
|
||||
}
|
||||
if (additionalFields.salePrice) {
|
||||
body.sale_price = additionalFields.salePrice as string;
|
||||
}
|
||||
if (additionalFields.shippingClass) {
|
||||
body.shipping_class = additionalFields.shippingClass as string;
|
||||
}
|
||||
if (additionalFields.shortDescription) {
|
||||
body.short_description = additionalFields.shortDescription as string;
|
||||
}
|
||||
if (additionalFields.sku) {
|
||||
body.sku = additionalFields.sku as string;
|
||||
}
|
||||
if (additionalFields.slug) {
|
||||
body.slug = additionalFields.slug as string;
|
||||
}
|
||||
if (additionalFields.soldIndividually) {
|
||||
body.sold_individually = additionalFields.soldIndividually as boolean;
|
||||
}
|
||||
if (additionalFields.status) {
|
||||
body.status = additionalFields.status as string;
|
||||
}
|
||||
if (additionalFields.stockQuantity) {
|
||||
body.stock_quantity = additionalFields.stockQuantity as number;
|
||||
}
|
||||
if (additionalFields.stockStatus) {
|
||||
body.stock_status = additionalFields.stockStatus as string;
|
||||
}
|
||||
if (additionalFields.tags) {
|
||||
body.tags = (additionalFields.tags as string[]).map(tag => ({ 'id': parseInt(tag, 10) })) as unknown as IDataObject[];
|
||||
}
|
||||
if (additionalFields.taxClass) {
|
||||
body.tax_class = additionalFields.taxClass as string;
|
||||
}
|
||||
if (additionalFields.taxStatus) {
|
||||
body.tax_status = additionalFields.taxStatus as string;
|
||||
}
|
||||
if (additionalFields.type) {
|
||||
body.type = additionalFields.type as string;
|
||||
}
|
||||
if (additionalFields.upsellIds) {
|
||||
body.upsell_ids = (additionalFields.upsellIds as string).split(',') as string[];
|
||||
}
|
||||
if (additionalFields.virtual) {
|
||||
body.virtual = additionalFields.virtual as boolean;
|
||||
}
|
||||
if (additionalFields.weight) {
|
||||
body.weight = additionalFields.weight as string;
|
||||
}
|
||||
|
||||
const images = (this.getNodeParameter('imagesUi', i) as IDataObject).imagesValues as IImage[];
|
||||
if (images) {
|
||||
body.images = images;
|
||||
|
@ -367,105 +279,9 @@ export class WooCommerce implements INodeType {
|
|||
const productId = this.getNodeParameter('productId', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const body: IProduct = {};
|
||||
if (updateFields.name) {
|
||||
body.name = updateFields.name as string;
|
||||
}
|
||||
if (updateFields.backorders) {
|
||||
body.backorders = updateFields.backorders as string;
|
||||
}
|
||||
if (updateFields.buttonText) {
|
||||
body.button_text = updateFields.buttonText as string;
|
||||
}
|
||||
if (updateFields.catalogVisibility) {
|
||||
body.catalog_visibility = updateFields.catalogVisibility as string;
|
||||
}
|
||||
if (updateFields.categories) {
|
||||
body.categories = (updateFields.categories as string[]).map(category => ({ id: parseInt(category, 10) })) as unknown as IDataObject[];
|
||||
}
|
||||
if (updateFields.crossSellIds) {
|
||||
body.cross_sell_ids = (updateFields.crossSellIds as string).split(',') as string[];
|
||||
}
|
||||
if (updateFields.dateOnSaleFrom) {
|
||||
body.date_on_sale_from = updateFields.dateOnSaleFrom as string;
|
||||
}
|
||||
if (updateFields.dateOnSaleTo) {
|
||||
body.date_on_sale_to = updateFields.dateOnSaleTo as string;
|
||||
}
|
||||
if (updateFields.description) {
|
||||
body.description = updateFields.description as string;
|
||||
}
|
||||
if (updateFields.downloadable) {
|
||||
body.downloadable = updateFields.downloadable as boolean;
|
||||
}
|
||||
if (updateFields.externalUrl) {
|
||||
body.external_url = updateFields.externalUrl as string;
|
||||
}
|
||||
if (updateFields.featured) {
|
||||
body.featured = updateFields.featured as boolean;
|
||||
}
|
||||
if (updateFields.manageStock) {
|
||||
body.manage_stock = updateFields.manageStock as boolean;
|
||||
}
|
||||
if (updateFields.parentId) {
|
||||
body.parent_id = updateFields.parentId as string;
|
||||
}
|
||||
if (updateFields.purchaseNote) {
|
||||
body.purchase_note = updateFields.purchaseNote as string;
|
||||
}
|
||||
if (updateFields.regularPrice) {
|
||||
body.regular_price = updateFields.regularPrice as string;
|
||||
}
|
||||
if (updateFields.reviewsAllowed) {
|
||||
body.reviews_allowed = updateFields.reviewsAllowed as boolean;
|
||||
}
|
||||
if (updateFields.salePrice) {
|
||||
body.sale_price = updateFields.salePrice as string;
|
||||
}
|
||||
if (updateFields.shippingClass) {
|
||||
body.shipping_class = updateFields.shippingClass as string;
|
||||
}
|
||||
if (updateFields.shortDescription) {
|
||||
body.short_description = updateFields.shortDescription as string;
|
||||
}
|
||||
if (updateFields.sku) {
|
||||
body.sku = updateFields.sku as string;
|
||||
}
|
||||
if (updateFields.slug) {
|
||||
body.slug = updateFields.slug as string;
|
||||
}
|
||||
if (updateFields.soldIndividually) {
|
||||
body.sold_individually = updateFields.soldIndividually as boolean;
|
||||
}
|
||||
if (updateFields.status) {
|
||||
body.status = updateFields.status as string;
|
||||
}
|
||||
if (updateFields.stockQuantity) {
|
||||
body.stock_quantity = updateFields.stockQuantity as number;
|
||||
}
|
||||
if (updateFields.stockStatus) {
|
||||
body.stock_status = updateFields.stockStatus as string;
|
||||
}
|
||||
if (updateFields.tags) {
|
||||
body.tags = (updateFields.tags as string[]).map(tag => ({ id: parseInt(tag, 10) })) as unknown as IDataObject[];
|
||||
}
|
||||
if (updateFields.taxClass) {
|
||||
body.tax_class = updateFields.taxClass as string;
|
||||
}
|
||||
if (updateFields.taxStatus) {
|
||||
body.tax_status = updateFields.taxStatus as string;
|
||||
}
|
||||
if (updateFields.type) {
|
||||
body.type = updateFields.type as string;
|
||||
}
|
||||
if (updateFields.upsellIds) {
|
||||
body.upsell_ids = (updateFields.upsellIds as string).split(',') as string[];
|
||||
}
|
||||
if (updateFields.virtual) {
|
||||
body.virtual = updateFields.virtual as boolean;
|
||||
}
|
||||
if (updateFields.weight) {
|
||||
body.weight = updateFields.weight as string;
|
||||
}
|
||||
|
||||
setFields(updateFields, body);
|
||||
|
||||
const images = (this.getNodeParameter('imagesUi', i) as IDataObject).imagesValues as IImage[];
|
||||
if (images) {
|
||||
body.images = images;
|
||||
|
@ -558,33 +374,9 @@ export class WooCommerce implements INodeType {
|
|||
if (operation === 'create') {
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const body: IOrder = {};
|
||||
if (additionalFields.currency) {
|
||||
body.currency = additionalFields.currency as string;
|
||||
}
|
||||
if (additionalFields.customerId) {
|
||||
body.customer_id = parseInt(additionalFields.customerId as string, 10);
|
||||
}
|
||||
if (additionalFields.customerNote) {
|
||||
body.customer_note = additionalFields.customerNote as string;
|
||||
}
|
||||
if (additionalFields.parentId) {
|
||||
body.parent_id = parseInt(additionalFields.parentId as string, 10);
|
||||
}
|
||||
if (additionalFields.paymentMethodId) {
|
||||
body.payment_method = additionalFields.paymentMethodId as string;
|
||||
}
|
||||
if (additionalFields.paymentMethodTitle) {
|
||||
body.payment_method_title = additionalFields.paymentMethodTitle as string;
|
||||
}
|
||||
if (additionalFields.setPaid) {
|
||||
body.set_paid = additionalFields.setPaid as boolean;
|
||||
}
|
||||
if (additionalFields.status) {
|
||||
body.status = additionalFields.status as string;
|
||||
}
|
||||
if (additionalFields.transactionID) {
|
||||
body.transaction_id = additionalFields.transactionID as string;
|
||||
}
|
||||
|
||||
setFields(additionalFields, body);
|
||||
|
||||
const billing = (this.getNodeParameter('billingUi', i) as IDataObject).billingValues as IAddress;
|
||||
if (billing !== undefined) {
|
||||
body.billing = billing;
|
||||
|
@ -631,6 +423,7 @@ export class WooCommerce implements INodeType {
|
|||
const orderId = this.getNodeParameter('orderId', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const body: IOrder = {};
|
||||
|
||||
if (updateFields.currency) {
|
||||
body.currency = updateFields.currency as string;
|
||||
}
|
||||
|
@ -694,6 +487,7 @@ export class WooCommerce implements INodeType {
|
|||
setMetadata(shippingLines);
|
||||
toSnakeCase(shippingLines);
|
||||
}
|
||||
|
||||
responseData = await woocommerceApiRequest.call(this, 'PUT', `/orders/${orderId}`, body);
|
||||
}
|
||||
//https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-an-order
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "n8n-nodes-base",
|
||||
"version": "0.129.0",
|
||||
"version": "0.129.1",
|
||||
"description": "Base nodes of n8n",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"homepage": "https://n8n.io",
|
||||
|
|
Loading…
Reference in a new issue