n8n-nodes-proiectro 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/Proiectro/Proiectro.node.d.ts +1 -0
- package/dist/nodes/Proiectro/Proiectro.node.js +366 -1
- package/dist/nodes/Proiectro/ProiectroTrigger.node.js +12 -0
- package/dist/nodes/Proiectro/descriptions/AssetCategoryDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/AssetCategoryDescription.js +109 -0
- package/dist/nodes/Proiectro/descriptions/CustomerAssetDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/CustomerAssetDescription.js +248 -0
- package/dist/nodes/Proiectro/descriptions/CustomerLocationDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/CustomerLocationDescription.js +148 -0
- package/dist/nodes/Proiectro/descriptions/LocationDescription.d.ts +3 -0
- package/dist/nodes/Proiectro/descriptions/LocationDescription.js +129 -0
- package/dist/nodes/Proiectro/descriptions/OperationalWorkItemDescription.js +12 -0
- package/dist/nodes/Proiectro/descriptions/SupportRequestDescription.js +12 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ export declare class Proiectro implements INodeType {
|
|
|
11
11
|
getProcesses(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
12
12
|
getWorkItemTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
13
13
|
getLabels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
14
|
+
getAssetCategories(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Proiectro = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const AssetCategoryDescription_1 = require("./descriptions/AssetCategoryDescription");
|
|
5
6
|
const ContactDescription_1 = require("./descriptions/ContactDescription");
|
|
6
7
|
const CustomerDescription_1 = require("./descriptions/CustomerDescription");
|
|
8
|
+
const CustomerAssetDescription_1 = require("./descriptions/CustomerAssetDescription");
|
|
9
|
+
const CustomerLocationDescription_1 = require("./descriptions/CustomerLocationDescription");
|
|
7
10
|
const LabelDescription_1 = require("./descriptions/LabelDescription");
|
|
11
|
+
const LocationDescription_1 = require("./descriptions/LocationDescription");
|
|
8
12
|
const OperationalWorkItemDescription_1 = require("./descriptions/OperationalWorkItemDescription");
|
|
9
13
|
const PaymentDescription_1 = require("./descriptions/PaymentDescription");
|
|
10
14
|
const ProcessDefinitionDescription_1 = require("./descriptions/ProcessDefinitionDescription");
|
|
@@ -44,6 +48,11 @@ class Proiectro {
|
|
|
44
48
|
type: 'options',
|
|
45
49
|
noDataExpression: true,
|
|
46
50
|
options: [
|
|
51
|
+
{
|
|
52
|
+
name: 'Asset Category',
|
|
53
|
+
value: 'assetCategory',
|
|
54
|
+
description: 'Manage asset categories',
|
|
55
|
+
},
|
|
47
56
|
{
|
|
48
57
|
name: 'Contact',
|
|
49
58
|
value: 'contact',
|
|
@@ -54,11 +63,26 @@ class Proiectro {
|
|
|
54
63
|
value: 'customer',
|
|
55
64
|
description: 'Manage customers (organizations)',
|
|
56
65
|
},
|
|
66
|
+
{
|
|
67
|
+
name: 'Customer Asset',
|
|
68
|
+
value: 'customerAsset',
|
|
69
|
+
description: 'Manage customer assets (equipment, devices, etc.)',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Customer Location',
|
|
73
|
+
value: 'customerLocation',
|
|
74
|
+
description: 'Manage customer locations (link customers to locations)',
|
|
75
|
+
},
|
|
57
76
|
{
|
|
58
77
|
name: 'Label',
|
|
59
78
|
value: 'label',
|
|
60
79
|
description: 'Manage labels (key-value pairs) and attach them to entities',
|
|
61
80
|
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Location',
|
|
83
|
+
value: 'location',
|
|
84
|
+
description: 'Manage workspace locations',
|
|
85
|
+
},
|
|
62
86
|
{
|
|
63
87
|
name: 'Operational Work Item',
|
|
64
88
|
value: 'operationalWorkItem',
|
|
@@ -115,14 +139,22 @@ class Proiectro {
|
|
|
115
139
|
description: 'Manage project work items (tasks/deliverables)',
|
|
116
140
|
},
|
|
117
141
|
],
|
|
118
|
-
default: '
|
|
142
|
+
default: 'assetCategory',
|
|
119
143
|
},
|
|
144
|
+
...AssetCategoryDescription_1.assetCategoryOperations,
|
|
145
|
+
...AssetCategoryDescription_1.assetCategoryFields,
|
|
120
146
|
...ContactDescription_1.contactOperations,
|
|
121
147
|
...ContactDescription_1.contactFields,
|
|
122
148
|
...CustomerDescription_1.customerOperations,
|
|
123
149
|
...CustomerDescription_1.customerFields,
|
|
150
|
+
...CustomerAssetDescription_1.customerAssetOperations,
|
|
151
|
+
...CustomerAssetDescription_1.customerAssetFields,
|
|
152
|
+
...CustomerLocationDescription_1.customerLocationOperations,
|
|
153
|
+
...CustomerLocationDescription_1.customerLocationFields,
|
|
124
154
|
...LabelDescription_1.labelOperations,
|
|
125
155
|
...LabelDescription_1.labelFields,
|
|
156
|
+
...LocationDescription_1.locationOperations,
|
|
157
|
+
...LocationDescription_1.locationFields,
|
|
126
158
|
...OperationalWorkItemDescription_1.operationalWorkItemOperations,
|
|
127
159
|
...OperationalWorkItemDescription_1.operationalWorkItemFields,
|
|
128
160
|
...PaymentDescription_1.paymentOperations,
|
|
@@ -245,6 +277,18 @@ class Proiectro {
|
|
|
245
277
|
value: item.id,
|
|
246
278
|
}));
|
|
247
279
|
},
|
|
280
|
+
async getAssetCategories() {
|
|
281
|
+
const credentials = await this.getCredentials('proiectroApi');
|
|
282
|
+
const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
283
|
+
method: 'GET',
|
|
284
|
+
url: `${credentials.baseUrl}/api/v1/${credentials.workspacePath}/list_asset_categories`,
|
|
285
|
+
json: true,
|
|
286
|
+
}));
|
|
287
|
+
return (response.asset_categories ?? []).map((item) => ({
|
|
288
|
+
name: item.name,
|
|
289
|
+
value: item.id,
|
|
290
|
+
}));
|
|
291
|
+
},
|
|
248
292
|
},
|
|
249
293
|
};
|
|
250
294
|
async execute() {
|
|
@@ -288,6 +332,9 @@ class Proiectro {
|
|
|
288
332
|
const customer = this.getNodeParameter('customer', i, undefined);
|
|
289
333
|
if (customer !== undefined && customer !== '')
|
|
290
334
|
body['customer'] = customer;
|
|
335
|
+
const customer_asset = this.getNodeParameter('customer_asset', i, undefined);
|
|
336
|
+
if (customer_asset !== undefined && customer_asset !== '')
|
|
337
|
+
body['customer_asset'] = customer_asset;
|
|
291
338
|
const priority = this.getNodeParameter('priority', i, undefined);
|
|
292
339
|
if (priority !== undefined && priority !== '')
|
|
293
340
|
body['priority'] = priority;
|
|
@@ -313,6 +360,9 @@ class Proiectro {
|
|
|
313
360
|
const customer = this.getNodeParameter('customer', i, undefined);
|
|
314
361
|
if (customer !== undefined && customer !== '')
|
|
315
362
|
body['customer'] = customer;
|
|
363
|
+
const customer_asset = this.getNodeParameter('customer_asset', i, undefined);
|
|
364
|
+
if (customer_asset !== undefined && customer_asset !== '')
|
|
365
|
+
body['customer_asset'] = customer_asset;
|
|
316
366
|
const priority = this.getNodeParameter('priority', i, undefined);
|
|
317
367
|
if (priority !== undefined && priority !== '')
|
|
318
368
|
body['priority'] = priority;
|
|
@@ -1076,6 +1126,9 @@ class Proiectro {
|
|
|
1076
1126
|
const request_severity = this.getNodeParameter('request_severity', i);
|
|
1077
1127
|
if (request_severity !== undefined && request_severity !== '')
|
|
1078
1128
|
body['request_severity'] = request_severity;
|
|
1129
|
+
const root_cause_asset = this.getNodeParameter('root_cause_asset', i, undefined);
|
|
1130
|
+
if (root_cause_asset !== undefined && root_cause_asset !== '')
|
|
1131
|
+
body['root_cause_asset'] = root_cause_asset;
|
|
1079
1132
|
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
1080
1133
|
method: 'PATCH',
|
|
1081
1134
|
url: `${apiBase}/internal_support_request/${support_request_id}/edit`,
|
|
@@ -1846,6 +1899,318 @@ class Proiectro {
|
|
|
1846
1899
|
json: true,
|
|
1847
1900
|
}));
|
|
1848
1901
|
}
|
|
1902
|
+
else if (resource === 'location' && operation === 'list') {
|
|
1903
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
1904
|
+
method: 'GET',
|
|
1905
|
+
url: `${apiBase}/locations`,
|
|
1906
|
+
json: true,
|
|
1907
|
+
}));
|
|
1908
|
+
}
|
|
1909
|
+
else if (resource === 'location' && operation === 'create') {
|
|
1910
|
+
const body = {};
|
|
1911
|
+
const name = this.getNodeParameter('name', i);
|
|
1912
|
+
if (name !== undefined && name !== '')
|
|
1913
|
+
body['name'] = name;
|
|
1914
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
1915
|
+
if (description !== undefined && description !== '')
|
|
1916
|
+
body['description'] = description;
|
|
1917
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
1918
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
1919
|
+
body['internal_code'] = internal_code;
|
|
1920
|
+
const country = this.getNodeParameter('country', i, undefined);
|
|
1921
|
+
if (country !== undefined && country !== '')
|
|
1922
|
+
body['country'] = country;
|
|
1923
|
+
const parent = this.getNodeParameter('parent', i, undefined);
|
|
1924
|
+
if (parent !== undefined && parent !== '')
|
|
1925
|
+
body['parent'] = parent;
|
|
1926
|
+
const is_active = this.getNodeParameter('is_active', i, undefined);
|
|
1927
|
+
if (is_active !== undefined && is_active !== '')
|
|
1928
|
+
body['is_active'] = is_active;
|
|
1929
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
1930
|
+
method: 'POST',
|
|
1931
|
+
url: `${apiBase}/add_location`,
|
|
1932
|
+
body,
|
|
1933
|
+
json: true,
|
|
1934
|
+
}));
|
|
1935
|
+
}
|
|
1936
|
+
else if (resource === 'location' && operation === 'update') {
|
|
1937
|
+
const location_id = this.getNodeParameter('location_id', i);
|
|
1938
|
+
const body = {};
|
|
1939
|
+
const name = this.getNodeParameter('name', i);
|
|
1940
|
+
if (name !== undefined && name !== '')
|
|
1941
|
+
body['name'] = name;
|
|
1942
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
1943
|
+
if (description !== undefined && description !== '')
|
|
1944
|
+
body['description'] = description;
|
|
1945
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
1946
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
1947
|
+
body['internal_code'] = internal_code;
|
|
1948
|
+
const country = this.getNodeParameter('country', i, undefined);
|
|
1949
|
+
if (country !== undefined && country !== '')
|
|
1950
|
+
body['country'] = country;
|
|
1951
|
+
const parent = this.getNodeParameter('parent', i, undefined);
|
|
1952
|
+
if (parent !== undefined && parent !== '')
|
|
1953
|
+
body['parent'] = parent;
|
|
1954
|
+
const is_active = this.getNodeParameter('is_active', i, undefined);
|
|
1955
|
+
if (is_active !== undefined && is_active !== '')
|
|
1956
|
+
body['is_active'] = is_active;
|
|
1957
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
1958
|
+
method: 'PATCH',
|
|
1959
|
+
url: `${apiBase}/edit_location/${location_id}`,
|
|
1960
|
+
body,
|
|
1961
|
+
json: true,
|
|
1962
|
+
}));
|
|
1963
|
+
}
|
|
1964
|
+
else if (resource === 'location' && operation === 'delete') {
|
|
1965
|
+
const location_id = this.getNodeParameter('location_id', i);
|
|
1966
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
1967
|
+
method: 'DELETE',
|
|
1968
|
+
url: `${apiBase}/delete_location/${location_id}`,
|
|
1969
|
+
json: true,
|
|
1970
|
+
}));
|
|
1971
|
+
}
|
|
1972
|
+
else if (resource === 'customerLocation' && operation === 'list') {
|
|
1973
|
+
const org_id = this.getNodeParameter('org_id', i);
|
|
1974
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
1975
|
+
method: 'GET',
|
|
1976
|
+
url: `${apiBase}/list_customer_locations/${org_id}`,
|
|
1977
|
+
json: true,
|
|
1978
|
+
}));
|
|
1979
|
+
}
|
|
1980
|
+
else if (resource === 'customerLocation' && operation === 'create') {
|
|
1981
|
+
const body = {};
|
|
1982
|
+
const customer = this.getNodeParameter('customer', i);
|
|
1983
|
+
if (customer !== undefined && customer !== '')
|
|
1984
|
+
body['customer'] = customer;
|
|
1985
|
+
const location = this.getNodeParameter('location', i);
|
|
1986
|
+
if (location !== undefined && location !== '')
|
|
1987
|
+
body['location'] = location;
|
|
1988
|
+
const name = this.getNodeParameter('name', i);
|
|
1989
|
+
if (name !== undefined && name !== '')
|
|
1990
|
+
body['name'] = name;
|
|
1991
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
1992
|
+
if (description !== undefined && description !== '')
|
|
1993
|
+
body['description'] = description;
|
|
1994
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
1995
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
1996
|
+
body['internal_code'] = internal_code;
|
|
1997
|
+
const is_active = this.getNodeParameter('is_active', i, undefined);
|
|
1998
|
+
if (is_active !== undefined && is_active !== '')
|
|
1999
|
+
body['is_active'] = is_active;
|
|
2000
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2001
|
+
method: 'POST',
|
|
2002
|
+
url: `${apiBase}/add_customer_location`,
|
|
2003
|
+
body,
|
|
2004
|
+
json: true,
|
|
2005
|
+
}));
|
|
2006
|
+
}
|
|
2007
|
+
else if (resource === 'customerLocation' && operation === 'update') {
|
|
2008
|
+
const customer_location_id = this.getNodeParameter('customer_location_id', i);
|
|
2009
|
+
const body = {};
|
|
2010
|
+
const location = this.getNodeParameter('location', i);
|
|
2011
|
+
if (location !== undefined && location !== '')
|
|
2012
|
+
body['location'] = location;
|
|
2013
|
+
const name = this.getNodeParameter('name', i);
|
|
2014
|
+
if (name !== undefined && name !== '')
|
|
2015
|
+
body['name'] = name;
|
|
2016
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
2017
|
+
if (description !== undefined && description !== '')
|
|
2018
|
+
body['description'] = description;
|
|
2019
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
2020
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
2021
|
+
body['internal_code'] = internal_code;
|
|
2022
|
+
const is_active = this.getNodeParameter('is_active', i, undefined);
|
|
2023
|
+
if (is_active !== undefined && is_active !== '')
|
|
2024
|
+
body['is_active'] = is_active;
|
|
2025
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2026
|
+
method: 'PATCH',
|
|
2027
|
+
url: `${apiBase}/edit_customer_location/${customer_location_id}`,
|
|
2028
|
+
body,
|
|
2029
|
+
json: true,
|
|
2030
|
+
}));
|
|
2031
|
+
}
|
|
2032
|
+
else if (resource === 'customerLocation' && operation === 'delete') {
|
|
2033
|
+
const customer_location_id = this.getNodeParameter('customer_location_id', i);
|
|
2034
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2035
|
+
method: 'DELETE',
|
|
2036
|
+
url: `${apiBase}/delete_customer_location/${customer_location_id}`,
|
|
2037
|
+
json: true,
|
|
2038
|
+
}));
|
|
2039
|
+
}
|
|
2040
|
+
else if (resource === 'customerAsset' && operation === 'list') {
|
|
2041
|
+
const org_id = this.getNodeParameter('org_id', i);
|
|
2042
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2043
|
+
method: 'GET',
|
|
2044
|
+
url: `${apiBase}/list_customer_assets/${org_id}`,
|
|
2045
|
+
json: true,
|
|
2046
|
+
}));
|
|
2047
|
+
}
|
|
2048
|
+
else if (resource === 'customerAsset' && operation === 'create') {
|
|
2049
|
+
const body = {};
|
|
2050
|
+
const customer = this.getNodeParameter('customer', i);
|
|
2051
|
+
if (customer !== undefined && customer !== '')
|
|
2052
|
+
body['customer'] = customer;
|
|
2053
|
+
const category = this.getNodeParameter('category', i);
|
|
2054
|
+
if (category !== undefined && category !== '')
|
|
2055
|
+
body['category'] = category;
|
|
2056
|
+
const customer_location = this.getNodeParameter('customer_location', i, undefined);
|
|
2057
|
+
if (customer_location !== undefined && customer_location !== '')
|
|
2058
|
+
body['customer_location'] = customer_location;
|
|
2059
|
+
const project = this.getNodeParameter('project', i, undefined);
|
|
2060
|
+
if (project !== undefined && project !== '')
|
|
2061
|
+
body['project'] = project;
|
|
2062
|
+
const product = this.getNodeParameter('product', i, undefined);
|
|
2063
|
+
if (product !== undefined && product !== '')
|
|
2064
|
+
body['product'] = product;
|
|
2065
|
+
const parent = this.getNodeParameter('parent', i, undefined);
|
|
2066
|
+
if (parent !== undefined && parent !== '')
|
|
2067
|
+
body['parent'] = parent;
|
|
2068
|
+
const name = this.getNodeParameter('name', i);
|
|
2069
|
+
if (name !== undefined && name !== '')
|
|
2070
|
+
body['name'] = name;
|
|
2071
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
2072
|
+
if (description !== undefined && description !== '')
|
|
2073
|
+
body['description'] = description;
|
|
2074
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
2075
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
2076
|
+
body['internal_code'] = internal_code;
|
|
2077
|
+
const serial_number_or_uri = this.getNodeParameter('serial_number_or_uri', i, undefined);
|
|
2078
|
+
if (serial_number_or_uri !== undefined && serial_number_or_uri !== '')
|
|
2079
|
+
body['serial_number_or_uri'] = serial_number_or_uri;
|
|
2080
|
+
const status = this.getNodeParameter('status', i, undefined);
|
|
2081
|
+
if (status !== undefined && status !== '')
|
|
2082
|
+
body['status'] = status;
|
|
2083
|
+
const installation_date = this.getNodeParameter('installation_date', i, undefined);
|
|
2084
|
+
if (installation_date !== undefined && installation_date !== '')
|
|
2085
|
+
body['installation_date'] = installation_date;
|
|
2086
|
+
const warranty_expiration = this.getNodeParameter('warranty_expiration', i, undefined);
|
|
2087
|
+
if (warranty_expiration !== undefined && warranty_expiration !== '')
|
|
2088
|
+
body['warranty_expiration'] = warranty_expiration;
|
|
2089
|
+
const is_customer_visible = this.getNodeParameter('is_customer_visible', i, undefined);
|
|
2090
|
+
if (is_customer_visible !== undefined && is_customer_visible !== '')
|
|
2091
|
+
body['is_customer_visible'] = is_customer_visible;
|
|
2092
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2093
|
+
method: 'POST',
|
|
2094
|
+
url: `${apiBase}/add_customer_asset`,
|
|
2095
|
+
body,
|
|
2096
|
+
json: true,
|
|
2097
|
+
}));
|
|
2098
|
+
}
|
|
2099
|
+
else if (resource === 'customerAsset' && operation === 'update') {
|
|
2100
|
+
const asset_id = this.getNodeParameter('asset_id', i);
|
|
2101
|
+
const body = {};
|
|
2102
|
+
const category = this.getNodeParameter('category', i);
|
|
2103
|
+
if (category !== undefined && category !== '')
|
|
2104
|
+
body['category'] = category;
|
|
2105
|
+
const customer_location = this.getNodeParameter('customer_location', i, undefined);
|
|
2106
|
+
if (customer_location !== undefined && customer_location !== '')
|
|
2107
|
+
body['customer_location'] = customer_location;
|
|
2108
|
+
const project = this.getNodeParameter('project', i, undefined);
|
|
2109
|
+
if (project !== undefined && project !== '')
|
|
2110
|
+
body['project'] = project;
|
|
2111
|
+
const product = this.getNodeParameter('product', i, undefined);
|
|
2112
|
+
if (product !== undefined && product !== '')
|
|
2113
|
+
body['product'] = product;
|
|
2114
|
+
const parent = this.getNodeParameter('parent', i, undefined);
|
|
2115
|
+
if (parent !== undefined && parent !== '')
|
|
2116
|
+
body['parent'] = parent;
|
|
2117
|
+
const name = this.getNodeParameter('name', i);
|
|
2118
|
+
if (name !== undefined && name !== '')
|
|
2119
|
+
body['name'] = name;
|
|
2120
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
2121
|
+
if (description !== undefined && description !== '')
|
|
2122
|
+
body['description'] = description;
|
|
2123
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
2124
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
2125
|
+
body['internal_code'] = internal_code;
|
|
2126
|
+
const serial_number_or_uri = this.getNodeParameter('serial_number_or_uri', i, undefined);
|
|
2127
|
+
if (serial_number_or_uri !== undefined && serial_number_or_uri !== '')
|
|
2128
|
+
body['serial_number_or_uri'] = serial_number_or_uri;
|
|
2129
|
+
const status = this.getNodeParameter('status', i, undefined);
|
|
2130
|
+
if (status !== undefined && status !== '')
|
|
2131
|
+
body['status'] = status;
|
|
2132
|
+
const installation_date = this.getNodeParameter('installation_date', i, undefined);
|
|
2133
|
+
if (installation_date !== undefined && installation_date !== '')
|
|
2134
|
+
body['installation_date'] = installation_date;
|
|
2135
|
+
const warranty_expiration = this.getNodeParameter('warranty_expiration', i, undefined);
|
|
2136
|
+
if (warranty_expiration !== undefined && warranty_expiration !== '')
|
|
2137
|
+
body['warranty_expiration'] = warranty_expiration;
|
|
2138
|
+
const is_customer_visible = this.getNodeParameter('is_customer_visible', i, undefined);
|
|
2139
|
+
if (is_customer_visible !== undefined && is_customer_visible !== '')
|
|
2140
|
+
body['is_customer_visible'] = is_customer_visible;
|
|
2141
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2142
|
+
method: 'PATCH',
|
|
2143
|
+
url: `${apiBase}/edit_customer_asset/${asset_id}`,
|
|
2144
|
+
body,
|
|
2145
|
+
json: true,
|
|
2146
|
+
}));
|
|
2147
|
+
}
|
|
2148
|
+
else if (resource === 'customerAsset' && operation === 'delete') {
|
|
2149
|
+
const asset_id = this.getNodeParameter('asset_id', i);
|
|
2150
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2151
|
+
method: 'DELETE',
|
|
2152
|
+
url: `${apiBase}/delete_customer_asset/${asset_id}`,
|
|
2153
|
+
json: true,
|
|
2154
|
+
}));
|
|
2155
|
+
}
|
|
2156
|
+
else if (resource === 'assetCategory' && operation === 'list') {
|
|
2157
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2158
|
+
method: 'GET',
|
|
2159
|
+
url: `${apiBase}/list_asset_categories`,
|
|
2160
|
+
json: true,
|
|
2161
|
+
}));
|
|
2162
|
+
}
|
|
2163
|
+
else if (resource === 'assetCategory' && operation === 'create') {
|
|
2164
|
+
const body = {};
|
|
2165
|
+
const name = this.getNodeParameter('name', i);
|
|
2166
|
+
if (name !== undefined && name !== '')
|
|
2167
|
+
body['name'] = name;
|
|
2168
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
2169
|
+
if (description !== undefined && description !== '')
|
|
2170
|
+
body['description'] = description;
|
|
2171
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
2172
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
2173
|
+
body['internal_code'] = internal_code;
|
|
2174
|
+
const is_active = this.getNodeParameter('is_active', i, undefined);
|
|
2175
|
+
if (is_active !== undefined && is_active !== '')
|
|
2176
|
+
body['is_active'] = is_active;
|
|
2177
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2178
|
+
method: 'POST',
|
|
2179
|
+
url: `${apiBase}/add_asset_category`,
|
|
2180
|
+
body,
|
|
2181
|
+
json: true,
|
|
2182
|
+
}));
|
|
2183
|
+
}
|
|
2184
|
+
else if (resource === 'assetCategory' && operation === 'update') {
|
|
2185
|
+
const category_id = this.getNodeParameter('category_id', i);
|
|
2186
|
+
const body = {};
|
|
2187
|
+
const name = this.getNodeParameter('name', i);
|
|
2188
|
+
if (name !== undefined && name !== '')
|
|
2189
|
+
body['name'] = name;
|
|
2190
|
+
const description = this.getNodeParameter('description', i, undefined);
|
|
2191
|
+
if (description !== undefined && description !== '')
|
|
2192
|
+
body['description'] = description;
|
|
2193
|
+
const internal_code = this.getNodeParameter('internal_code', i, undefined);
|
|
2194
|
+
if (internal_code !== undefined && internal_code !== '')
|
|
2195
|
+
body['internal_code'] = internal_code;
|
|
2196
|
+
const is_active = this.getNodeParameter('is_active', i, undefined);
|
|
2197
|
+
if (is_active !== undefined && is_active !== '')
|
|
2198
|
+
body['is_active'] = is_active;
|
|
2199
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2200
|
+
method: 'PATCH',
|
|
2201
|
+
url: `${apiBase}/edit_asset_category/${category_id}`,
|
|
2202
|
+
body,
|
|
2203
|
+
json: true,
|
|
2204
|
+
}));
|
|
2205
|
+
}
|
|
2206
|
+
else if (resource === 'assetCategory' && operation === 'delete') {
|
|
2207
|
+
const category_id = this.getNodeParameter('category_id', i);
|
|
2208
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'proiectroApi', {
|
|
2209
|
+
method: 'DELETE',
|
|
2210
|
+
url: `${apiBase}/delete_asset_category/${category_id}`,
|
|
2211
|
+
json: true,
|
|
2212
|
+
}));
|
|
2213
|
+
}
|
|
1849
2214
|
else {
|
|
1850
2215
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource/operation: ${resource}/${operation}`);
|
|
1851
2216
|
}
|
|
@@ -65,12 +65,21 @@ class ProiectroTrigger {
|
|
|
65
65
|
required: true,
|
|
66
66
|
default: [],
|
|
67
67
|
options: [
|
|
68
|
+
{ name: 'Asset Category Created', value: 'addAssetCategory' },
|
|
69
|
+
{ name: 'Asset Category Deleted', value: 'deleteAssetCategory' },
|
|
70
|
+
{ name: 'Asset Category Updated', value: 'editAssetCategory' },
|
|
68
71
|
{ name: 'Contact Created', value: 'addContact' },
|
|
69
72
|
{ name: 'Contact Deleted', value: 'deleteContact' },
|
|
70
73
|
{ name: 'Contact Updated', value: 'editContact' },
|
|
74
|
+
{ name: 'Customer Asset Created', value: 'addCustomerAsset' },
|
|
75
|
+
{ name: 'Customer Asset Deleted', value: 'deleteCustomerAsset' },
|
|
76
|
+
{ name: 'Customer Asset Updated', value: 'editCustomerAsset' },
|
|
71
77
|
{ name: 'Customer Created', value: 'addOrg' },
|
|
72
78
|
{ name: 'Customer Deleted', value: 'deleteOrg' },
|
|
73
79
|
{ name: 'Customer Labeled', value: 'labelOrg' },
|
|
80
|
+
{ name: 'Customer Location Created', value: 'addCustomerLocation' },
|
|
81
|
+
{ name: 'Customer Location Deleted', value: 'deleteCustomerLocation' },
|
|
82
|
+
{ name: 'Customer Location Updated', value: 'editCustomerLocation' },
|
|
74
83
|
{ name: 'Customer Tagged', value: 'tagOrg' },
|
|
75
84
|
{ name: 'Customer Unlabeled', value: 'unlabelOrg' },
|
|
76
85
|
{ name: 'Customer Untagged', value: 'untagOrg' },
|
|
@@ -78,6 +87,9 @@ class ProiectroTrigger {
|
|
|
78
87
|
{ name: 'Label Created', value: 'addLabel' },
|
|
79
88
|
{ name: 'Label Deleted', value: 'deleteLabel' },
|
|
80
89
|
{ name: 'Label Updated', value: 'editLabel' },
|
|
90
|
+
{ name: 'Location Created', value: 'addLocation' },
|
|
91
|
+
{ name: 'Location Deleted', value: 'deleteLocation' },
|
|
92
|
+
{ name: 'Location Updated', value: 'editLocation' },
|
|
81
93
|
{ name: 'Operational Work Item Tagged', value: 'tagOperationalWorkItem' },
|
|
82
94
|
{ name: 'Operational Work Item Untagged', value: 'untagOperationalWorkItem' },
|
|
83
95
|
{ name: 'Payment Created', value: 'addPayment' },
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assetCategoryFields = exports.assetCategoryOperations = void 0;
|
|
4
|
+
exports.assetCategoryOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['assetCategory'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
action: 'Create an asset category',
|
|
18
|
+
description: 'Create a new asset category',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Delete',
|
|
22
|
+
value: 'delete',
|
|
23
|
+
action: 'Delete an asset category',
|
|
24
|
+
description: 'Delete an asset category',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'List All',
|
|
28
|
+
value: 'list',
|
|
29
|
+
action: 'List all asset categories',
|
|
30
|
+
description: 'List all asset categories',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Update',
|
|
34
|
+
value: 'update',
|
|
35
|
+
action: 'Update an asset category',
|
|
36
|
+
description: 'Update an asset category',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
default: 'create',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
exports.assetCategoryFields = [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Name',
|
|
45
|
+
name: 'name',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true,
|
|
48
|
+
default: '',
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: {
|
|
51
|
+
resource: ['assetCategory'],
|
|
52
|
+
operation: ["create", "update"],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Description',
|
|
58
|
+
name: 'description',
|
|
59
|
+
type: 'string',
|
|
60
|
+
default: '',
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: {
|
|
63
|
+
resource: ['assetCategory'],
|
|
64
|
+
operation: ["create", "update"],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Internal Code',
|
|
70
|
+
name: 'internal_code',
|
|
71
|
+
type: 'string',
|
|
72
|
+
default: '',
|
|
73
|
+
displayOptions: {
|
|
74
|
+
show: {
|
|
75
|
+
resource: ['assetCategory'],
|
|
76
|
+
operation: ["create", "update"],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: 'Is Active',
|
|
82
|
+
name: 'is_active',
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
default: false,
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
resource: ['assetCategory'],
|
|
88
|
+
operation: ["create", "update"],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Category Name or ID',
|
|
94
|
+
name: 'category_id',
|
|
95
|
+
type: 'options',
|
|
96
|
+
required: true,
|
|
97
|
+
typeOptions: {
|
|
98
|
+
loadOptionsMethod: 'getAssetCategories',
|
|
99
|
+
},
|
|
100
|
+
default: '',
|
|
101
|
+
displayOptions: {
|
|
102
|
+
show: {
|
|
103
|
+
resource: ['assetCategory'],
|
|
104
|
+
operation: ["update", "delete"],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
108
|
+
},
|
|
109
|
+
];
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customerAssetFields = exports.customerAssetOperations = void 0;
|
|
4
|
+
exports.customerAssetOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['customerAsset'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
action: 'Create a customer asset',
|
|
18
|
+
description: 'Create a new customer asset',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Delete',
|
|
22
|
+
value: 'delete',
|
|
23
|
+
action: 'Delete a customer asset',
|
|
24
|
+
description: 'Delete a customer asset',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'List',
|
|
28
|
+
value: 'list',
|
|
29
|
+
action: 'List customer assets',
|
|
30
|
+
description: 'List assets for a customer',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Update',
|
|
34
|
+
value: 'update',
|
|
35
|
+
action: 'Update a customer asset',
|
|
36
|
+
description: 'Update a customer asset',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
default: 'create',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
exports.customerAssetFields = [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Org Name or ID',
|
|
45
|
+
name: 'org_id',
|
|
46
|
+
type: 'options',
|
|
47
|
+
required: true,
|
|
48
|
+
typeOptions: {
|
|
49
|
+
loadOptionsMethod: 'getCustomers',
|
|
50
|
+
},
|
|
51
|
+
default: '',
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
resource: ['customerAsset'],
|
|
55
|
+
operation: ["list"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Customer',
|
|
62
|
+
name: 'customer',
|
|
63
|
+
type: 'string',
|
|
64
|
+
required: true,
|
|
65
|
+
default: '',
|
|
66
|
+
displayOptions: {
|
|
67
|
+
show: {
|
|
68
|
+
resource: ['customerAsset'],
|
|
69
|
+
operation: ["create"],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Category Name or ID',
|
|
75
|
+
name: 'category',
|
|
76
|
+
type: 'options',
|
|
77
|
+
required: true,
|
|
78
|
+
typeOptions: {
|
|
79
|
+
loadOptionsMethod: 'getAssetCategories',
|
|
80
|
+
},
|
|
81
|
+
default: '',
|
|
82
|
+
displayOptions: {
|
|
83
|
+
show: {
|
|
84
|
+
resource: ['customerAsset'],
|
|
85
|
+
operation: ["create", "update"],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Customer Location',
|
|
92
|
+
name: 'customer_location',
|
|
93
|
+
type: 'string',
|
|
94
|
+
default: '',
|
|
95
|
+
displayOptions: {
|
|
96
|
+
show: {
|
|
97
|
+
resource: ['customerAsset'],
|
|
98
|
+
operation: ["create", "update"],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
displayName: 'Project',
|
|
104
|
+
name: 'project',
|
|
105
|
+
type: 'string',
|
|
106
|
+
default: '',
|
|
107
|
+
displayOptions: {
|
|
108
|
+
show: {
|
|
109
|
+
resource: ['customerAsset'],
|
|
110
|
+
operation: ["create", "update"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
displayName: 'Product',
|
|
116
|
+
name: 'product',
|
|
117
|
+
type: 'string',
|
|
118
|
+
default: '',
|
|
119
|
+
displayOptions: {
|
|
120
|
+
show: {
|
|
121
|
+
resource: ['customerAsset'],
|
|
122
|
+
operation: ["create", "update"],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
displayName: 'Parent',
|
|
128
|
+
name: 'parent',
|
|
129
|
+
type: 'string',
|
|
130
|
+
default: '',
|
|
131
|
+
displayOptions: {
|
|
132
|
+
show: {
|
|
133
|
+
resource: ['customerAsset'],
|
|
134
|
+
operation: ["create", "update"],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
displayName: 'Name',
|
|
140
|
+
name: 'name',
|
|
141
|
+
type: 'string',
|
|
142
|
+
required: true,
|
|
143
|
+
default: '',
|
|
144
|
+
displayOptions: {
|
|
145
|
+
show: {
|
|
146
|
+
resource: ['customerAsset'],
|
|
147
|
+
operation: ["create", "update"],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Description',
|
|
153
|
+
name: 'description',
|
|
154
|
+
type: 'string',
|
|
155
|
+
default: '',
|
|
156
|
+
displayOptions: {
|
|
157
|
+
show: {
|
|
158
|
+
resource: ['customerAsset'],
|
|
159
|
+
operation: ["create", "update"],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
displayName: 'Internal Code',
|
|
165
|
+
name: 'internal_code',
|
|
166
|
+
type: 'string',
|
|
167
|
+
default: '',
|
|
168
|
+
displayOptions: {
|
|
169
|
+
show: {
|
|
170
|
+
resource: ['customerAsset'],
|
|
171
|
+
operation: ["create", "update"],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
displayName: 'Serial Number Or Uri',
|
|
177
|
+
name: 'serial_number_or_uri',
|
|
178
|
+
type: 'string',
|
|
179
|
+
default: '',
|
|
180
|
+
displayOptions: {
|
|
181
|
+
show: {
|
|
182
|
+
resource: ['customerAsset'],
|
|
183
|
+
operation: ["create", "update"],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
displayName: 'Status',
|
|
189
|
+
name: 'status',
|
|
190
|
+
type: 'string',
|
|
191
|
+
default: '',
|
|
192
|
+
displayOptions: {
|
|
193
|
+
show: {
|
|
194
|
+
resource: ['customerAsset'],
|
|
195
|
+
operation: ["create", "update"],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
displayName: 'Installation Date',
|
|
201
|
+
name: 'installation_date',
|
|
202
|
+
type: 'string',
|
|
203
|
+
default: '',
|
|
204
|
+
displayOptions: {
|
|
205
|
+
show: {
|
|
206
|
+
resource: ['customerAsset'],
|
|
207
|
+
operation: ["create", "update"],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
displayName: 'Warranty Expiration',
|
|
213
|
+
name: 'warranty_expiration',
|
|
214
|
+
type: 'string',
|
|
215
|
+
default: '',
|
|
216
|
+
displayOptions: {
|
|
217
|
+
show: {
|
|
218
|
+
resource: ['customerAsset'],
|
|
219
|
+
operation: ["create", "update"],
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Is Customer Visible',
|
|
225
|
+
name: 'is_customer_visible',
|
|
226
|
+
type: 'boolean',
|
|
227
|
+
default: false,
|
|
228
|
+
displayOptions: {
|
|
229
|
+
show: {
|
|
230
|
+
resource: ['customerAsset'],
|
|
231
|
+
operation: ["create", "update"],
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
displayName: 'Asset ID',
|
|
237
|
+
name: 'asset_id',
|
|
238
|
+
type: 'string',
|
|
239
|
+
required: true,
|
|
240
|
+
default: '',
|
|
241
|
+
displayOptions: {
|
|
242
|
+
show: {
|
|
243
|
+
resource: ['customerAsset'],
|
|
244
|
+
operation: ["update", "delete"],
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
];
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customerLocationFields = exports.customerLocationOperations = void 0;
|
|
4
|
+
exports.customerLocationOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['customerLocation'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
action: 'Create a customer location',
|
|
18
|
+
description: 'Link a customer to a location',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Delete',
|
|
22
|
+
value: 'delete',
|
|
23
|
+
action: 'Delete a customer location',
|
|
24
|
+
description: 'Remove a customer from a location',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'List',
|
|
28
|
+
value: 'list',
|
|
29
|
+
action: 'List customer locations',
|
|
30
|
+
description: 'List locations for a customer',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Update',
|
|
34
|
+
value: 'update',
|
|
35
|
+
action: 'Update a customer location',
|
|
36
|
+
description: 'Update a customer location',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
default: 'create',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
exports.customerLocationFields = [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Org Name or ID',
|
|
45
|
+
name: 'org_id',
|
|
46
|
+
type: 'options',
|
|
47
|
+
required: true,
|
|
48
|
+
typeOptions: {
|
|
49
|
+
loadOptionsMethod: 'getCustomers',
|
|
50
|
+
},
|
|
51
|
+
default: '',
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
resource: ['customerLocation'],
|
|
55
|
+
operation: ["list"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Customer',
|
|
62
|
+
name: 'customer',
|
|
63
|
+
type: 'string',
|
|
64
|
+
required: true,
|
|
65
|
+
default: '',
|
|
66
|
+
displayOptions: {
|
|
67
|
+
show: {
|
|
68
|
+
resource: ['customerLocation'],
|
|
69
|
+
operation: ["create"],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Location',
|
|
75
|
+
name: 'location',
|
|
76
|
+
type: 'string',
|
|
77
|
+
required: true,
|
|
78
|
+
default: '',
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: {
|
|
81
|
+
resource: ['customerLocation'],
|
|
82
|
+
operation: ["create", "update"],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Name',
|
|
88
|
+
name: 'name',
|
|
89
|
+
type: 'string',
|
|
90
|
+
required: true,
|
|
91
|
+
default: '',
|
|
92
|
+
displayOptions: {
|
|
93
|
+
show: {
|
|
94
|
+
resource: ['customerLocation'],
|
|
95
|
+
operation: ["create", "update"],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Description',
|
|
101
|
+
name: 'description',
|
|
102
|
+
type: 'string',
|
|
103
|
+
default: '',
|
|
104
|
+
displayOptions: {
|
|
105
|
+
show: {
|
|
106
|
+
resource: ['customerLocation'],
|
|
107
|
+
operation: ["create", "update"],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
displayName: 'Internal Code',
|
|
113
|
+
name: 'internal_code',
|
|
114
|
+
type: 'string',
|
|
115
|
+
default: '',
|
|
116
|
+
displayOptions: {
|
|
117
|
+
show: {
|
|
118
|
+
resource: ['customerLocation'],
|
|
119
|
+
operation: ["create", "update"],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
displayName: 'Is Active',
|
|
125
|
+
name: 'is_active',
|
|
126
|
+
type: 'boolean',
|
|
127
|
+
default: false,
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
resource: ['customerLocation'],
|
|
131
|
+
operation: ["create", "update"],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
displayName: 'Customer Location ID',
|
|
137
|
+
name: 'customer_location_id',
|
|
138
|
+
type: 'string',
|
|
139
|
+
required: true,
|
|
140
|
+
default: '',
|
|
141
|
+
displayOptions: {
|
|
142
|
+
show: {
|
|
143
|
+
resource: ['customerLocation'],
|
|
144
|
+
operation: ["update", "delete"],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
];
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.locationFields = exports.locationOperations = void 0;
|
|
4
|
+
exports.locationOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['location'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Create',
|
|
16
|
+
value: 'create',
|
|
17
|
+
action: 'Create a location',
|
|
18
|
+
description: 'Create a new location',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Delete',
|
|
22
|
+
value: 'delete',
|
|
23
|
+
action: 'Delete a location',
|
|
24
|
+
description: 'Delete a location',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'List All',
|
|
28
|
+
value: 'list',
|
|
29
|
+
action: 'List all locations',
|
|
30
|
+
description: 'List all locations in the workspace',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Update',
|
|
34
|
+
value: 'update',
|
|
35
|
+
action: 'Update a location',
|
|
36
|
+
description: 'Update a location',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
default: 'create',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
exports.locationFields = [
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Name',
|
|
45
|
+
name: 'name',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true,
|
|
48
|
+
default: '',
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: {
|
|
51
|
+
resource: ['location'],
|
|
52
|
+
operation: ["create", "update"],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Description',
|
|
58
|
+
name: 'description',
|
|
59
|
+
type: 'string',
|
|
60
|
+
default: '',
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: {
|
|
63
|
+
resource: ['location'],
|
|
64
|
+
operation: ["create", "update"],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Internal Code',
|
|
70
|
+
name: 'internal_code',
|
|
71
|
+
type: 'string',
|
|
72
|
+
default: '',
|
|
73
|
+
displayOptions: {
|
|
74
|
+
show: {
|
|
75
|
+
resource: ['location'],
|
|
76
|
+
operation: ["create", "update"],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: 'Country',
|
|
82
|
+
name: 'country',
|
|
83
|
+
type: 'string',
|
|
84
|
+
default: '',
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
resource: ['location'],
|
|
88
|
+
operation: ["create", "update"],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Parent',
|
|
94
|
+
name: 'parent',
|
|
95
|
+
type: 'string',
|
|
96
|
+
default: '',
|
|
97
|
+
displayOptions: {
|
|
98
|
+
show: {
|
|
99
|
+
resource: ['location'],
|
|
100
|
+
operation: ["create", "update"],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Is Active',
|
|
106
|
+
name: 'is_active',
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
default: false,
|
|
109
|
+
displayOptions: {
|
|
110
|
+
show: {
|
|
111
|
+
resource: ['location'],
|
|
112
|
+
operation: ["create", "update"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
displayName: 'Location ID',
|
|
118
|
+
name: 'location_id',
|
|
119
|
+
type: 'string',
|
|
120
|
+
required: true,
|
|
121
|
+
default: '',
|
|
122
|
+
displayOptions: {
|
|
123
|
+
show: {
|
|
124
|
+
resource: ['location'],
|
|
125
|
+
operation: ["update", "delete"],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
];
|
|
@@ -157,6 +157,18 @@ exports.operationalWorkItemFields = [
|
|
|
157
157
|
},
|
|
158
158
|
},
|
|
159
159
|
},
|
|
160
|
+
{
|
|
161
|
+
displayName: 'Customer Asset',
|
|
162
|
+
name: 'customer_asset',
|
|
163
|
+
type: 'string',
|
|
164
|
+
default: '',
|
|
165
|
+
displayOptions: {
|
|
166
|
+
show: {
|
|
167
|
+
resource: ['operationalWorkItem'],
|
|
168
|
+
operation: ["create", "update"],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
160
172
|
{
|
|
161
173
|
displayName: 'Priority',
|
|
162
174
|
name: 'priority',
|
|
@@ -141,6 +141,18 @@ exports.supportRequestFields = [
|
|
|
141
141
|
},
|
|
142
142
|
},
|
|
143
143
|
},
|
|
144
|
+
{
|
|
145
|
+
displayName: 'Root Cause Asset',
|
|
146
|
+
name: 'root_cause_asset',
|
|
147
|
+
type: 'string',
|
|
148
|
+
default: '',
|
|
149
|
+
displayOptions: {
|
|
150
|
+
show: {
|
|
151
|
+
resource: ['supportRequest'],
|
|
152
|
+
operation: ["edit"],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
144
156
|
{
|
|
145
157
|
displayName: 'Status ID',
|
|
146
158
|
name: 'status_id',
|