n8n-nodes-hudu 1.3.5 → 1.4.1
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/README.md +28 -12
- package/dist/nodes/Hudu/Hudu.node.js +2 -18
- package/dist/nodes/Hudu/Hudu.node.js.map +1 -1
- package/dist/nodes/Hudu/Hudu.node.ts +2 -30
- package/dist/nodes/Hudu/descriptions/asset_layout_fields.description.js +38 -32
- package/dist/nodes/Hudu/descriptions/asset_layout_fields.description.js.map +1 -1
- package/dist/nodes/Hudu/descriptions/asset_layout_fields.description.ts +450 -446
- package/dist/nodes/Hudu/descriptions/asset_layouts.description.js +112 -18
- package/dist/nodes/Hudu/descriptions/asset_layouts.description.js.map +1 -1
- package/dist/nodes/Hudu/descriptions/asset_layouts.description.ts +112 -18
- package/dist/nodes/Hudu/descriptions/assets.description.js +100 -123
- package/dist/nodes/Hudu/descriptions/assets.description.js.map +1 -1
- package/dist/nodes/Hudu/descriptions/assets.description.ts +587 -609
- package/dist/nodes/Hudu/descriptions/index.js +0 -3
- package/dist/nodes/Hudu/descriptions/index.js.map +1 -1
- package/dist/nodes/Hudu/descriptions/index.ts +0 -3
- package/dist/nodes/Hudu/descriptions/resources.js +0 -12
- package/dist/nodes/Hudu/descriptions/resources.js.map +1 -1
- package/dist/nodes/Hudu/descriptions/resources.ts +0 -12
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFields.js +122 -70
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFields.js.map +1 -1
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLayoutFields.ts +143 -107
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/index.js +0 -1
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/index.js.map +1 -1
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/index.ts +0 -1
- package/dist/nodes/Hudu/optionLoaders/assets/index.js +1 -2
- package/dist/nodes/Hudu/optionLoaders/assets/index.js.map +1 -1
- package/dist/nodes/Hudu/optionLoaders/assets/index.ts +1 -2
- package/dist/nodes/Hudu/resources/asset_layout_fields/asset_layout_fields.handler.js +32 -75
- package/dist/nodes/Hudu/resources/asset_layout_fields/asset_layout_fields.handler.js.map +1 -1
- package/dist/nodes/Hudu/resources/asset_layout_fields/asset_layout_fields.handler.ts +43 -139
- package/dist/nodes/Hudu/resources/asset_layouts/asset_layouts.handler.js +9 -11
- package/dist/nodes/Hudu/resources/asset_layouts/asset_layouts.handler.js.map +1 -1
- package/dist/nodes/Hudu/resources/asset_layouts/asset_layouts.handler.ts +12 -12
- package/dist/nodes/Hudu/resources/assets/assets.handler.js +116 -56
- package/dist/nodes/Hudu/resources/assets/assets.handler.js.map +1 -1
- package/dist/nodes/Hudu/resources/assets/assets.handler.ts +171 -60
- package/dist/nodes/Hudu/resources/assets/assets.types.ts +43 -43
- package/dist/nodes/Hudu/resources/index.js +0 -6
- package/dist/nodes/Hudu/resources/index.js.map +1 -1
- package/dist/nodes/Hudu/resources/index.ts +0 -12
- package/dist/nodes/Hudu/resources/procedures/procedures.handler.js +1 -3
- package/dist/nodes/Hudu/resources/procedures/procedures.handler.js.map +1 -1
- package/dist/nodes/Hudu/resources/procedures/procedures.handler.ts +1 -3
- package/dist/nodes/Hudu/utils/assetFieldUtils.js +273 -0
- package/dist/nodes/Hudu/utils/assetFieldUtils.js.map +1 -0
- package/dist/nodes/Hudu/utils/assetFieldUtils.ts +437 -0
- package/dist/nodes/Hudu/utils/constants.js +1 -0
- package/dist/nodes/Hudu/utils/constants.js.map +1 -1
- package/dist/nodes/Hudu/utils/constants.ts +1 -0
- package/dist/nodes/Hudu/utils/debugConfig.js +4 -1
- package/dist/nodes/Hudu/utils/debugConfig.js.map +1 -1
- package/dist/nodes/Hudu/utils/debugConfig.ts +6 -1
- package/dist/nodes/Hudu/utils/errorParser.js +57 -0
- package/dist/nodes/Hudu/utils/errorParser.js.map +1 -0
- package/dist/nodes/Hudu/utils/errorParser.ts +90 -0
- package/dist/nodes/Hudu/utils/fieldErrorUtils.js +17 -0
- package/dist/nodes/Hudu/utils/fieldErrorUtils.js.map +1 -0
- package/dist/nodes/Hudu/utils/fieldErrorUtils.ts +57 -0
- package/dist/nodes/Hudu/utils/fieldTypeUtils.js +145 -0
- package/dist/nodes/Hudu/utils/fieldTypeUtils.js.map +1 -0
- package/dist/nodes/Hudu/utils/fieldTypeUtils.ts +220 -0
- package/dist/nodes/Hudu/utils/index.js +3 -0
- package/dist/nodes/Hudu/utils/index.js.map +1 -1
- package/dist/nodes/Hudu/utils/index.ts +25 -19
- package/dist/nodes/Hudu/utils/requestUtils.js +71 -24
- package/dist/nodes/Hudu/utils/requestUtils.js.map +1 -1
- package/dist/nodes/Hudu/utils/requestUtils.ts +88 -26
- package/package.json +1 -1
- package/dist/nodes/Hudu/descriptions/HuduAssetCustomFieldDescription.js +0 -75
- package/dist/nodes/Hudu/descriptions/HuduAssetCustomFieldDescription.js.map +0 -1
- package/dist/nodes/Hudu/descriptions/HuduAssetCustomFieldDescription.ts +0 -73
- package/dist/nodes/Hudu/descriptions/HuduAssetLinkFieldDescription.js +0 -77
- package/dist/nodes/Hudu/descriptions/HuduAssetLinkFieldDescription.js.map +0 -1
- package/dist/nodes/Hudu/descriptions/HuduAssetLinkFieldDescription.ts +0 -75
- package/dist/nodes/Hudu/descriptions/HuduAssetStandardFieldDescription.js +0 -74
- package/dist/nodes/Hudu/descriptions/HuduAssetStandardFieldDescription.js.map +0 -1
- package/dist/nodes/Hudu/descriptions/HuduAssetStandardFieldDescription.ts +0 -72
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLinkFields.js +0 -51
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLinkFields.js.map +0 -1
- package/dist/nodes/Hudu/optionLoaders/asset_layouts/getAssetLinkFields.ts +0 -70
- package/dist/nodes/Hudu/optionLoaders/assets/getAssetCustomFields.js +0 -71
- package/dist/nodes/Hudu/optionLoaders/assets/getAssetCustomFields.js.map +0 -1
- package/dist/nodes/Hudu/optionLoaders/assets/getAssetCustomFields.ts +0 -80
- package/dist/nodes/Hudu/optionLoaders/assets/getLinkableAssets.js +0 -117
- package/dist/nodes/Hudu/optionLoaders/assets/getLinkableAssets.js.map +0 -1
- package/dist/nodes/Hudu/optionLoaders/assets/getLinkableAssets.ts +0 -147
- package/dist/nodes/Hudu/resources/assetCustomField/assetCustomField.handler.js +0 -222
- package/dist/nodes/Hudu/resources/assetCustomField/assetCustomField.handler.js.map +0 -1
- package/dist/nodes/Hudu/resources/assetCustomField/assetCustomField.handler.ts +0 -293
- package/dist/nodes/Hudu/resources/assetCustomField/assetCustomField.types.js +0 -3
- package/dist/nodes/Hudu/resources/assetCustomField/assetCustomField.types.js.map +0 -1
- package/dist/nodes/Hudu/resources/assetCustomField/assetCustomField.types.ts +0 -1
- package/dist/nodes/Hudu/resources/assetLinkField/assetLinkField.handler.js +0 -262
- package/dist/nodes/Hudu/resources/assetLinkField/assetLinkField.handler.js.map +0 -1
- package/dist/nodes/Hudu/resources/assetLinkField/assetLinkField.handler.ts +0 -363
- package/dist/nodes/Hudu/resources/assetLinkField/assetLinkField.types.js +0 -3
- package/dist/nodes/Hudu/resources/assetLinkField/assetLinkField.types.js.map +0 -1
- package/dist/nodes/Hudu/resources/assetLinkField/assetLinkField.types.ts +0 -1
- package/dist/nodes/Hudu/resources/assetStandardField/assetStandardField.handler.js +0 -93
- package/dist/nodes/Hudu/resources/assetStandardField/assetStandardField.handler.js.map +0 -1
- package/dist/nodes/Hudu/resources/assetStandardField/assetStandardField.handler.ts +0 -141
- package/dist/nodes/Hudu/resources/assetStandardField/assetStandardField.types.js +0 -3
- package/dist/nodes/Hudu/resources/assetStandardField/assetStandardField.types.js.map +0 -1
- package/dist/nodes/Hudu/resources/assetStandardField/assetStandardField.types.ts +0 -1
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import type { ILoadOptionsFunctions, INodePropertyOptions, IDataObject } from 'n8n-workflow';
|
|
2
|
-
import { huduApiRequest } from '../../utils/requestUtils';
|
|
3
|
-
import { debugLog } from '../../utils/debugConfig';
|
|
4
|
-
import { handleListing } from '../../utils';
|
|
5
|
-
|
|
6
|
-
export async function getLinkableAssets(
|
|
7
|
-
this: ILoadOptionsFunctions,
|
|
8
|
-
): Promise<INodePropertyOptions[]> {
|
|
9
|
-
try {
|
|
10
|
-
const assetId = this.getCurrentNodeParameter('assetId') as number;
|
|
11
|
-
const fieldIdentifier = this.getCurrentNodeParameter('fieldIdentifier') as string;
|
|
12
|
-
let sameCompanyOnly: boolean;
|
|
13
|
-
try {
|
|
14
|
-
const rawValue = this.getCurrentNodeParameter('sameCompanyOnly');
|
|
15
|
-
if (typeof rawValue === 'boolean') {
|
|
16
|
-
sameCompanyOnly = rawValue;
|
|
17
|
-
} else if (rawValue === 'true') {
|
|
18
|
-
sameCompanyOnly = true;
|
|
19
|
-
} else if (rawValue === 'false') {
|
|
20
|
-
sameCompanyOnly = false;
|
|
21
|
-
} else {
|
|
22
|
-
sameCompanyOnly = true;
|
|
23
|
-
}
|
|
24
|
-
} catch (error) {
|
|
25
|
-
sameCompanyOnly = true;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
debugLog('[OPTION_LOADING] getLinkableAssets parameters:', {
|
|
29
|
-
assetId,
|
|
30
|
-
fieldIdentifier,
|
|
31
|
-
sameCompanyOnly,
|
|
32
|
-
sameCompanyOnlyType: typeof sameCompanyOnly
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
if (!assetId || !fieldIdentifier) {
|
|
36
|
-
debugLog('[OPTION_LOADING] Missing required parameters:', { assetId, fieldIdentifier });
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Fetch the asset to get company_id and asset_layout_id
|
|
41
|
-
debugLog('[OPTION_LOADING] Fetching asset details for ID:', assetId);
|
|
42
|
-
const assetResp = await huduApiRequest.call(this, 'GET', '/assets', {}, { id: assetId }) as IDataObject;
|
|
43
|
-
debugLog('[OPTION_LOADING] Asset API response:', assetResp);
|
|
44
|
-
|
|
45
|
-
const assetsArr = Array.isArray(assetResp.assets) ? assetResp.assets : [];
|
|
46
|
-
if (!assetsArr.length) {
|
|
47
|
-
debugLog('[OPTION_LOADING] No asset found with ID:', assetId);
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const asset = assetsArr[0] as IDataObject;
|
|
52
|
-
debugLog('[OPTION_LOADING] Found asset:', asset);
|
|
53
|
-
|
|
54
|
-
const companyId = asset.company_id;
|
|
55
|
-
const assetLayoutId = asset.asset_layout_id;
|
|
56
|
-
if (!companyId || !assetLayoutId) {
|
|
57
|
-
debugLog('[OPTION_LOADING] Asset missing company_id or asset_layout_id:', { companyId, assetLayoutId });
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Fetch the asset layout to get the link field definition
|
|
62
|
-
debugLog('[OPTION_LOADING] Fetching asset layout:', assetLayoutId);
|
|
63
|
-
const layoutResp = await huduApiRequest.call(this, 'GET', `/asset_layouts/${assetLayoutId}`) as IDataObject;
|
|
64
|
-
debugLog('[OPTION_LOADING] Asset layout response:', layoutResp);
|
|
65
|
-
|
|
66
|
-
// Here's a key change: check if the layout has asset_layout property
|
|
67
|
-
const layoutData = layoutResp.asset_layout as IDataObject || layoutResp;
|
|
68
|
-
debugLog('[OPTION_LOADING] Using layout data:', layoutData);
|
|
69
|
-
|
|
70
|
-
// Check if fields exist and are an array
|
|
71
|
-
const layoutFields = Array.isArray(layoutData.fields) ? layoutData.fields : [];
|
|
72
|
-
debugLog('[OPTION_LOADING] Found layout fields:', layoutFields);
|
|
73
|
-
if (layoutFields.length === 0) {
|
|
74
|
-
debugLog('[OPTION_LOADING] No fields found in layout');
|
|
75
|
-
return [];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Find the field by label
|
|
79
|
-
debugLog('[OPTION_LOADING] Looking for field with label:', fieldIdentifier);
|
|
80
|
-
const linkField = layoutFields.find((f: any) => {
|
|
81
|
-
debugLog('[OPTION_LOADING] Comparing field:', { fieldLabel: f.label, fieldIdentifier });
|
|
82
|
-
return f.label === fieldIdentifier;
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
if (!linkField) {
|
|
86
|
-
debugLog('[OPTION_LOADING] No field found with label:', fieldIdentifier);
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
debugLog('[OPTION_LOADING] Found link field:', linkField);
|
|
91
|
-
const linkableId = linkField.linkable_id;
|
|
92
|
-
debugLog('[OPTION_LOADING] Link field linkable_id:', linkableId);
|
|
93
|
-
|
|
94
|
-
// Build query for assets
|
|
95
|
-
const qs: IDataObject = { archived: false };
|
|
96
|
-
if (linkableId && linkableId > 0) {
|
|
97
|
-
qs.asset_layout_id = linkableId;
|
|
98
|
-
debugLog('[OPTION_LOADING] Filtering by asset_layout_id:', linkableId);
|
|
99
|
-
} else {
|
|
100
|
-
debugLog('[OPTION_LOADING] Not filtering by asset_layout_id (linkable_id is 0 or missing)');
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
debugLog('[OPTION_LOADING] sameCompanyOnly value and type:', {
|
|
104
|
-
value: sameCompanyOnly,
|
|
105
|
-
type: typeof sameCompanyOnly,
|
|
106
|
-
truthyCheck: !!sameCompanyOnly
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
if (sameCompanyOnly === true) {
|
|
110
|
-
qs.company_id = companyId;
|
|
111
|
-
debugLog('[OPTION_LOADING] Filtering by company_id:', companyId);
|
|
112
|
-
} else {
|
|
113
|
-
delete qs.company_id;
|
|
114
|
-
debugLog('[OPTION_LOADING] NOT filtering by company_id (sameCompanyOnly is false)');
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Use the handleListing function to fetch all pages of assets
|
|
118
|
-
debugLog('[OPTION_LOADING] Beginning paginated asset fetch with query:', qs);
|
|
119
|
-
|
|
120
|
-
const allAssets = await handleListing.call(
|
|
121
|
-
this,
|
|
122
|
-
'GET',
|
|
123
|
-
'/assets',
|
|
124
|
-
'assets',
|
|
125
|
-
{}, // body
|
|
126
|
-
qs, // query parameters
|
|
127
|
-
true, // returnAll
|
|
128
|
-
0, // limit
|
|
129
|
-
) as IDataObject[];
|
|
130
|
-
|
|
131
|
-
debugLog('[OPTION_LOADING] Finished fetching assets, total count:', allAssets.length);
|
|
132
|
-
|
|
133
|
-
// Return as options
|
|
134
|
-
const result = allAssets.map((a: any) => ({
|
|
135
|
-
name: a.name,
|
|
136
|
-
value: a.id,
|
|
137
|
-
description: a.asset_type ? `Type: ${a.asset_type}` : undefined,
|
|
138
|
-
}));
|
|
139
|
-
|
|
140
|
-
debugLog('[OPTION_LOADING] Returning options count:', result.length);
|
|
141
|
-
return result;
|
|
142
|
-
} catch (error) {
|
|
143
|
-
debugLog('[OPTION_LOADING] Error in getLinkableAssets:', error);
|
|
144
|
-
// Return empty array rather than throwing, to avoid breaking the UI
|
|
145
|
-
return [];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.handleAssetCustomFieldOperation = void 0;
|
|
27
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
28
|
-
const requestUtils_1 = require("../../utils/requestUtils");
|
|
29
|
-
const constants_1 = require("../../utils/constants");
|
|
30
|
-
const debugConfig_1 = require("../../utils/debugConfig");
|
|
31
|
-
async function handleAssetCustomFieldOperation(operation, itemIndex) {
|
|
32
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PROCESSING] Starting asset custom field operation', { operation, itemIndex });
|
|
33
|
-
const assetId = this.getNodeParameter('assetId', itemIndex);
|
|
34
|
-
const rawFieldIdentifier = this.getNodeParameter('fieldIdentifier', itemIndex);
|
|
35
|
-
if (typeof rawFieldIdentifier !== 'string' || !rawFieldIdentifier) {
|
|
36
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom Field Identifier is required and must be a string.', { itemIndex });
|
|
37
|
-
}
|
|
38
|
-
const fieldIdentifier = rawFieldIdentifier;
|
|
39
|
-
const fieldIdentifierString = String(fieldIdentifier);
|
|
40
|
-
if (!assetId) {
|
|
41
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Asset ID is required.', { itemIndex });
|
|
42
|
-
}
|
|
43
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PARAMS] Asset custom field parameters', { assetId, fieldIdentifier });
|
|
44
|
-
if (fieldIdentifier === 'NO_CUSTOM_FIELDS_FOUND') {
|
|
45
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `This asset doesn't have any custom fields. Please select an asset that has custom fields defined in its layout.`, { itemIndex });
|
|
46
|
-
}
|
|
47
|
-
let response;
|
|
48
|
-
if (operation === 'get') {
|
|
49
|
-
(0, debugConfig_1.debugLog)('[OPERATION_GET] Getting asset custom field value');
|
|
50
|
-
const rawResponse = await requestUtils_1.huduApiRequest.call(this, 'GET', '/assets', {}, { id: assetId });
|
|
51
|
-
(0, debugConfig_1.debugLog)('[API_RESPONSE] Asset response received');
|
|
52
|
-
if (!rawResponse || typeof rawResponse !== 'object' || !Array.isArray(rawResponse.assets)) {
|
|
53
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unexpected API response format when fetching asset ID '${assetId}'.`, { itemIndex });
|
|
54
|
-
}
|
|
55
|
-
const assetsArray = rawResponse.assets;
|
|
56
|
-
if (!assetsArray.length) {
|
|
57
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No asset found with ID '${assetId}'.`, { itemIndex });
|
|
58
|
-
}
|
|
59
|
-
const assetObject = assetsArray[0];
|
|
60
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PROCESSING] Found asset', { assetId, layoutId: assetObject.asset_layout_id });
|
|
61
|
-
const assetFields = (assetObject.fields || []);
|
|
62
|
-
const targetField = assetFields.find(field => field.label === fieldIdentifier);
|
|
63
|
-
let fieldValue = null;
|
|
64
|
-
let fieldType = null;
|
|
65
|
-
if (targetField) {
|
|
66
|
-
fieldValue = targetField.value;
|
|
67
|
-
fieldType = targetField.field_type || null;
|
|
68
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Found field', {
|
|
69
|
-
label: targetField.label,
|
|
70
|
-
value: fieldValue,
|
|
71
|
-
type: fieldType
|
|
72
|
-
});
|
|
73
|
-
if (fieldType === constants_1.ASSET_LAYOUT_FIELD_TYPES.DATE && fieldValue) {
|
|
74
|
-
try {
|
|
75
|
-
const dateObj = new Date(fieldValue);
|
|
76
|
-
if (!isNaN(dateObj.getTime())) {
|
|
77
|
-
fieldValue = dateObj.toISOString();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Error parsing date value', { error });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
else if (fieldType === constants_1.ASSET_LAYOUT_FIELD_TYPES.CHECKBOX) {
|
|
85
|
-
fieldValue = String(fieldValue).toLowerCase() === 'true';
|
|
86
|
-
}
|
|
87
|
-
else if (fieldType === constants_1.ASSET_LAYOUT_FIELD_TYPES.NUMBER && fieldValue !== null && fieldValue !== undefined) {
|
|
88
|
-
const numValue = parseFloat(String(fieldValue));
|
|
89
|
-
if (!isNaN(numValue)) {
|
|
90
|
-
fieldValue = numValue;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Field not found', { fieldIdentifier });
|
|
96
|
-
}
|
|
97
|
-
response = {
|
|
98
|
-
asset_id: assetId,
|
|
99
|
-
field_identifier: fieldIdentifier,
|
|
100
|
-
value: fieldValue,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
else if (operation === 'update') {
|
|
104
|
-
(0, debugConfig_1.debugLog)('[OPERATION_UPDATE] Updating asset custom field value');
|
|
105
|
-
const valueToSet = this.getNodeParameter('value', itemIndex);
|
|
106
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PARAMS] Value to set', { valueToSet });
|
|
107
|
-
const assetLookup = await requestUtils_1.huduApiRequest.call(this, 'GET', '/assets', {}, { id: assetId });
|
|
108
|
-
(0, debugConfig_1.debugLog)('[API_RESPONSE] Asset lookup response received');
|
|
109
|
-
const assetsArray = assetLookup.assets;
|
|
110
|
-
if (!(assetsArray === null || assetsArray === void 0 ? void 0 : assetsArray.length)) {
|
|
111
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No asset found with ID '${assetId}'.`, { itemIndex });
|
|
112
|
-
}
|
|
113
|
-
const assetObject = assetsArray[0];
|
|
114
|
-
const companyId = assetObject.company_id;
|
|
115
|
-
const assetLayoutId = assetObject.asset_layout_id;
|
|
116
|
-
if (!companyId) {
|
|
117
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Asset with ID '${assetId}' does not have a company_id.`, { itemIndex });
|
|
118
|
-
}
|
|
119
|
-
if (!assetLayoutId) {
|
|
120
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Asset with ID '${assetId}' does not have an asset_layout_id.`, { itemIndex });
|
|
121
|
-
}
|
|
122
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PROCESSING] Found asset metadata', { companyId, assetLayoutId });
|
|
123
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PROCESSING] Fetching asset layout to validate custom field');
|
|
124
|
-
const layoutResponse = await requestUtils_1.huduApiRequest.call(this, 'GET', `/asset_layouts/${assetLayoutId}`);
|
|
125
|
-
const layoutData = layoutResponse.asset_layout || layoutResponse;
|
|
126
|
-
if (!layoutData || !layoutData.fields || !Array.isArray(layoutData.fields)) {
|
|
127
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Could not retrieve field definitions for asset layout ID '${assetLayoutId}'.`, { itemIndex });
|
|
128
|
-
}
|
|
129
|
-
const customField = layoutData.fields.find(field => typeof field.label === 'string' && field.label === fieldIdentifier && field.field_type !== constants_1.ASSET_LAYOUT_FIELD_TYPES.ASSET_TAG);
|
|
130
|
-
if (!customField) {
|
|
131
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Field '${fieldIdentifier}' is not found or is not a Custom Field in asset layout ID '${assetLayoutId}'.`, { itemIndex });
|
|
132
|
-
}
|
|
133
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Found custom field in layout', {
|
|
134
|
-
fieldId: customField.id,
|
|
135
|
-
fieldType: customField.field_type,
|
|
136
|
-
});
|
|
137
|
-
const unsupportedTypes = ['Dropdown'];
|
|
138
|
-
if (typeof customField.field_type === 'string' && unsupportedTypes.includes(customField.field_type)) {
|
|
139
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PARAMS] Attempted to update unsupported legacy field type', {
|
|
140
|
-
fieldLabel: customField.label,
|
|
141
|
-
fieldType: customField.field_type,
|
|
142
|
-
});
|
|
143
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The field '${customField.label}' is a legacy Dropdown field, which cannot be updated via the Hudu API. Please convert it to a List field in Hudu to enable API updates.`, { itemIndex });
|
|
144
|
-
}
|
|
145
|
-
const { toSnakeCase } = await Promise.resolve().then(() => __importStar(require('../../utils/formatters')));
|
|
146
|
-
const snakeCaseFieldLabel = toSnakeCase(fieldIdentifierString);
|
|
147
|
-
if (!snakeCaseFieldLabel) {
|
|
148
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Could not convert field label '${fieldIdentifier}' to snake_case.`, { itemIndex });
|
|
149
|
-
}
|
|
150
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Converted field name to snake_case', {
|
|
151
|
-
original: fieldIdentifierString,
|
|
152
|
-
snakeCase: snakeCaseFieldLabel
|
|
153
|
-
});
|
|
154
|
-
let processedValue = valueToSet;
|
|
155
|
-
if (customField.field_type === constants_1.ASSET_LAYOUT_FIELD_TYPES.DATE && valueToSet) {
|
|
156
|
-
if (typeof valueToSet === 'string' || typeof valueToSet === 'number') {
|
|
157
|
-
const dateObj = new Date(valueToSet);
|
|
158
|
-
if (!isNaN(dateObj.getTime())) {
|
|
159
|
-
processedValue = dateObj.toISOString().split('T')[0];
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
else if (customField.field_type === constants_1.ASSET_LAYOUT_FIELD_TYPES.CHECKBOX) {
|
|
164
|
-
processedValue = String(valueToSet !== null && valueToSet !== void 0 ? valueToSet : '').toLowerCase() === 'true';
|
|
165
|
-
}
|
|
166
|
-
else if (customField.field_type === constants_1.ASSET_LAYOUT_FIELD_TYPES.NUMBER && valueToSet !== null && valueToSet !== undefined) {
|
|
167
|
-
const numValue = parseFloat(String(valueToSet));
|
|
168
|
-
if (!isNaN(numValue)) {
|
|
169
|
-
processedValue = numValue;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (typeof processedValue === 'object' && processedValue !== null) {
|
|
173
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Stringifying value for custom field', {
|
|
174
|
-
fieldType: customField.field_type,
|
|
175
|
-
originalValue: processedValue
|
|
176
|
-
});
|
|
177
|
-
processedValue = JSON.stringify(processedValue);
|
|
178
|
-
}
|
|
179
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Processed value for field', {
|
|
180
|
-
fieldType: customField.field_type,
|
|
181
|
-
originalValue: valueToSet,
|
|
182
|
-
processedValue
|
|
183
|
-
});
|
|
184
|
-
const customFieldsArray = [
|
|
185
|
-
{ [snakeCaseFieldLabel]: processedValue }
|
|
186
|
-
];
|
|
187
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_TRANSFORM] Built custom_fields array for update', {
|
|
188
|
-
customFieldsArray
|
|
189
|
-
});
|
|
190
|
-
const updatePayload = {
|
|
191
|
-
name: assetObject.name,
|
|
192
|
-
asset_layout_id: assetObject.asset_layout_id,
|
|
193
|
-
custom_fields: customFieldsArray,
|
|
194
|
-
};
|
|
195
|
-
if (assetObject.primary_serial)
|
|
196
|
-
updatePayload.primary_serial = assetObject.primary_serial;
|
|
197
|
-
if (assetObject.primary_mail)
|
|
198
|
-
updatePayload.primary_mail = assetObject.primary_mail;
|
|
199
|
-
if (assetObject.primary_model)
|
|
200
|
-
updatePayload.primary_model = assetObject.primary_model;
|
|
201
|
-
if (assetObject.primary_manufacturer)
|
|
202
|
-
updatePayload.primary_manufacturer = assetObject.primary_manufacturer;
|
|
203
|
-
(0, debugConfig_1.debugLog)('[API_REQUEST] Updating asset with payload', updatePayload);
|
|
204
|
-
const updateEndpoint = `/companies/${companyId}/assets/${assetId}`;
|
|
205
|
-
const updateResponseData = await requestUtils_1.huduApiRequest.call(this, 'PUT', updateEndpoint, updatePayload);
|
|
206
|
-
(0, debugConfig_1.debugLog)('[API_RESPONSE] Update asset response received');
|
|
207
|
-
response = {
|
|
208
|
-
message: `Successfully updated custom field '${fieldIdentifierString}' for asset ID '${assetId}'.`,
|
|
209
|
-
asset_id: assetId,
|
|
210
|
-
field_identifier: fieldIdentifierString,
|
|
211
|
-
processed_value: processedValue,
|
|
212
|
-
response: updateResponseData,
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
if (response) {
|
|
216
|
-
(0, debugConfig_1.debugLog)('[RESOURCE_PROCESSING] Completed asset custom field operation', { operation });
|
|
217
|
-
return response;
|
|
218
|
-
}
|
|
219
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation '${operation}' not implemented in handleAssetCustomFieldOperation`, { itemIndex });
|
|
220
|
-
}
|
|
221
|
-
exports.handleAssetCustomFieldOperation = handleAssetCustomFieldOperation;
|
|
222
|
-
//# sourceMappingURL=assetCustomField.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assetCustomField.handler.js","sourceRoot":"","sources":["../../../../../../src/nodes/Hudu/resources/assetCustomField/assetCustomField.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAkD;AAClD,2DAA0D;AAE1D,qDAAiE;AACjE,yDAAmD;AAoB5C,KAAK,UAAU,+BAA+B,CAEjD,SAAoC,EACpC,SAAiB;IAEjB,IAAA,sBAAQ,EAAC,6DAA6D,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAElG,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAW,CAAC;IACtE,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IA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