pull:初次提交
This commit is contained in:
1
n8n-n8n-1.109.2/packages/nodes-base/nodes/SyncroMSP/v1/methods/index.ts
Executable file
1
n8n-n8n-1.109.2/packages/nodes-base/nodes/SyncroMSP/v1/methods/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export * as loadOptions from './loadOptions';
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { apiRequestAllItems } from '../transport';
|
||||
|
||||
// Get all the available channels
|
||||
|
||||
export async function getCustomers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const endpoint = 'customers';
|
||||
const responseData = await apiRequestAllItems.call(this, 'GET', endpoint, {});
|
||||
|
||||
if (responseData === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'No data got returned');
|
||||
}
|
||||
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
for (const data of responseData) {
|
||||
returnData.push({
|
||||
name: data.fullname as string,
|
||||
value: data.id as number,
|
||||
});
|
||||
}
|
||||
|
||||
returnData.sort((a, b) => {
|
||||
if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
return returnData;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const addressFixedCollection: INodeProperties = {
|
||||
displayName: 'Address',
|
||||
name: 'address',
|
||||
placeholder: 'Add Address Fields',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Address Fields',
|
||||
name: 'addressFields',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Line 1',
|
||||
name: 'address',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Line 2',
|
||||
name: 'address2',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'City',
|
||||
name: 'city',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'State',
|
||||
name: 'state',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'ZIP',
|
||||
name: 'zip',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user