n8n-nodes-ms-dataverse 0.7.19 → 0.9.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.
@@ -1,5 +1,5 @@
1
1
  import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- import { searchTables, getTableFieldsForDisplay, getTableFieldNames, getAlternateKeyFields, getChoiceFieldOptions, getSolutions, getGlobalChoicesForDropdown, getRelationships } from './GenericFunctions';
2
+ import { searchTables, getTableFieldsForDisplay, getTableFieldNames, getAlternateKeyFields, getSolutions, getGlobalChoicesForDropdown, getRelationships } from './GenericFunctions';
3
3
  export type RecordIdType = 'id' | 'alternateKey';
4
4
  export type QueryType = 'odata' | 'fetchxml';
5
5
  export type Operation = 'assign' | 'associate' | 'create' | 'delete' | 'disassociate' | 'get' | 'getMany' | 'update' | 'upsert' | 'shareAccessAdd' | 'shareAccessList' | 'shareAccessRevoke' | 'list' | 'addOption' | 'updateOption' | 'deleteOption' | 'executeQuery' | 'registerEndpoint' | 'registerWebhookStep' | 'listEndpoints' | 'deleteEndpoint' | 'listEndpointSteps' | 'deleteStep' | 'listSdkMessageFilters' | 'uploadPluginAssembly' | 'registerPluginStep' | 'listPluginAssemblies' | 'deletePluginAssembly' | 'uploadWebResource' | 'updateWebResource' | 'listWebResources' | 'deleteWebResource';
@@ -13,7 +13,6 @@ export declare class Dataverse implements INodeType {
13
13
  getTableFieldsForDisplay: typeof getTableFieldsForDisplay;
14
14
  getTableFieldNames: typeof getTableFieldNames;
15
15
  getAlternateKeyFields: typeof getAlternateKeyFields;
16
- getChoiceFieldOptions: typeof getChoiceFieldOptions;
17
16
  getSolutions: typeof getSolutions;
18
17
  getGlobalChoicesForDropdown: typeof getGlobalChoicesForDropdown;
19
18
  getRelationships: typeof getRelationships;
@@ -56,8 +56,6 @@ class Dataverse {
56
56
  ...descriptions_1.webhookOperationFields,
57
57
  descriptions_1.tableDescription,
58
58
  descriptions_1.fieldSchemaSelector,
59
- descriptions_1.choiceFieldSelector,
60
- descriptions_1.choiceOptionsViewer,
61
59
  ...descriptions_1.createOperationFields,
62
60
  ...descriptions_1.getOperationFields,
63
61
  ...descriptions_1.updateOperationFields,
@@ -81,7 +79,6 @@ class Dataverse {
81
79
  getTableFieldsForDisplay: GenericFunctions_1.getTableFieldsForDisplay,
82
80
  getTableFieldNames: GenericFunctions_1.getTableFieldNames,
83
81
  getAlternateKeyFields: GenericFunctions_1.getAlternateKeyFields,
84
- getChoiceFieldOptions: GenericFunctions_1.getChoiceFieldOptions,
85
82
  getSolutions: GenericFunctions_1.getSolutions,
86
83
  getGlobalChoicesForDropdown: GenericFunctions_1.getGlobalChoicesForDropdown,
87
84
  getRelationships: GenericFunctions_1.getRelationships,
@@ -157,7 +154,11 @@ class Dataverse {
157
154
  returnData.push({ json: result, pairedItem: { item: i } });
158
155
  }
159
156
  else if (resource === 'record') {
160
- const table = this.getNodeParameter('table', i, '', { extractValue: true });
157
+ const tableParam = this.getNodeParameter('table', i);
158
+ let table = this.getNodeParameter('table', i, '', { extractValue: true });
159
+ if ((tableParam === null || tableParam === void 0 ? void 0 : tableParam.mode) !== 'list') {
160
+ table = await GenericFunctions_1.resolveEntitySetName.call(this, table, i);
161
+ }
161
162
  let result;
162
163
  switch (operation) {
163
164
  case 'assign': {
@@ -1 +1 @@
1
- {"version":3,"file":"Dataverse.node.js","sourceRoot":"","sources":["../../../nodes/Dataverse/Dataverse.node.ts"],"names":[],"mappings":";;;AAOA,+CAAkD;AAElD,yDAA2M;AAC3M,iDA8BwB;AACxB,oEAWuC;AACvC,gFAQ6C;AAC7C,gFAG6C;AAC7C,kEAEsC;AACtC,oEAKuC;AACvC,8EAK4C;AAC5C,8DAA6D;AAC7D,sEAQwC;AAMxC,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,oBAAoB;YAC1B,KA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MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE;oBACnD,SAAS,EAAE,CAAC;iBACZ,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA/XD,8BA+XC"}
1
+ {"version":3,"file":"Dataverse.node.js","sourceRoot":"","sources":["../../../nodes/Dataverse/Dataverse.node.ts"],"names":[],"mappings":";;;AAOA,+CAAkD;AAElD,yDAA0M;AAC1M,iDA4BwB;AACxB,oEAWuC;AACvC,gFAQ6C;AAC7C,gFAG6C;AAC7C,kEAEsC;AACtC,oEAKuC;AACvC,8EAK4C;AAC5C,8DAA6D;AAC7D,sEAQwC;AAMxC,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,oBAAoB;oBAC1B,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,kCAAkC;gBAC3C,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBACX,kCAAmB;gBACnB,mCAAoB;gBACpB,+CAAgC;gBAChC,+CAAgC;gBAChC,wCAAyB;gBACzB,sCAAuB;gBACvB,yCAA0B;gBAC1B,GAAG,oCAAqB;gBACxB,8CAA+B;gBA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AAC,CAAC,CAAC;4BAC9C,MAAM;wBACP,CAAC;wBAED,KAAK,mBAAmB,CAAC,CAAC,CAAC;4BAC1B,MAAM,GAAG,MAAM,yCAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;4BAC/C,MAAM;wBACP,CAAC;wBAED;4BACC,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,+BAA+B,SAAS,oBAAoB,CAC5D,CAAC;oBACJ,CAAC;oBAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;wBAC3B,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;oBAC5B,CAAC;yBAAM,CAAC;wBACP,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBACzB,CAAC;gBACF,CAAC;YACF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE;4BACL,KAAK,EAAE,KAAK,CAAC,OAAO;yBACpB;wBACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE;oBACnD,SAAS,EAAE,CAAC;iBACZ,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AApYD,8BAoYC"}
@@ -6,6 +6,7 @@ export declare function dataverseApiRequestFull(this: IExecuteFunctions, method:
6
6
  }>;
7
7
  export declare function dataverseApiBinaryRequest(this: IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, itemIndex?: number): Promise<Buffer>;
8
8
  export declare function searchTables(this: ILoadOptionsFunctions, filter?: string): Promise<INodeListSearchResult>;
9
+ export declare function resolveEntitySetName(this: IExecuteFunctions | ILoadOptionsFunctions, table: string, itemIndex?: number): Promise<string>;
9
10
  export declare function getImageAndFileFields(this: IExecuteFunctions, table: string, itemIndex: number): Promise<{
10
11
  imageFields: string[];
11
12
  fileFields: string[];
@@ -21,8 +22,11 @@ export declare function fieldsToObject(fields: Array<{
21
22
  name: string;
22
23
  value: string;
23
24
  }>): IDataObject;
25
+ export declare function fieldsToRequestBody(this: IExecuteFunctions, table: string, fields: Array<{
26
+ name: string;
27
+ value: string;
28
+ }>, itemIndex?: number): Promise<IDataObject>;
24
29
  export declare function buildODataQuery(filter?: string, orderBy?: string, selectFields?: string, limit?: number): IDataObject;
25
- export declare function getChoiceFieldOptions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
26
30
  export declare function getGlobalChoicesForDropdown(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
27
31
  export declare function getRelationships(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
28
32
  export declare function getSolutions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
@@ -4,20 +4,70 @@ exports.dataverseApiRequest = dataverseApiRequest;
4
4
  exports.dataverseApiRequestFull = dataverseApiRequestFull;
5
5
  exports.dataverseApiBinaryRequest = dataverseApiBinaryRequest;
6
6
  exports.searchTables = searchTables;
7
+ exports.resolveEntitySetName = resolveEntitySetName;
7
8
  exports.getImageAndFileFields = getImageAndFileFields;
8
9
  exports.getTableFieldsForDisplay = getTableFieldsForDisplay;
9
10
  exports.getTableFieldNames = getTableFieldNames;
10
11
  exports.getAlternateKeyFields = getAlternateKeyFields;
11
12
  exports.buildRecordIdentifier = buildRecordIdentifier;
12
13
  exports.fieldsToObject = fieldsToObject;
14
+ exports.fieldsToRequestBody = fieldsToRequestBody;
13
15
  exports.buildODataQuery = buildODataQuery;
14
- exports.getChoiceFieldOptions = getChoiceFieldOptions;
15
16
  exports.getGlobalChoicesForDropdown = getGlobalChoicesForDropdown;
16
17
  exports.getRelationships = getRelationships;
17
18
  exports.getSolutions = getSolutions;
18
19
  const n8n_workflow_1 = require("n8n-workflow");
20
+ function extractDataverseErrorDetails(errorObj) {
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
22
+ let errorMessage = 'Unknown error';
23
+ let errorCode = '';
24
+ let httpStatus = '';
25
+ let dataverseError = null;
26
+ if ((_c = (_b = (_a = errorObj === null || errorObj === void 0 ? void 0 : errorObj.cause) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.body) === null || _c === void 0 ? void 0 : _c.error) {
27
+ dataverseError = errorObj.cause.response.body.error;
28
+ }
29
+ else if ((_e = (_d = errorObj === null || errorObj === void 0 ? void 0 : errorObj.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) {
30
+ dataverseError = errorObj.response.data.error;
31
+ }
32
+ else if ((_g = (_f = errorObj === null || errorObj === void 0 ? void 0 : errorObj.context) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.error) {
33
+ dataverseError = errorObj.context.data.error;
34
+ }
35
+ else if ((_h = errorObj === null || errorObj === void 0 ? void 0 : errorObj.cause) === null || _h === void 0 ? void 0 : _h.error) {
36
+ dataverseError = errorObj.cause.error;
37
+ }
38
+ else if (errorObj === null || errorObj === void 0 ? void 0 : errorObj.error) {
39
+ dataverseError = errorObj.error;
40
+ }
41
+ if (dataverseError === null || dataverseError === void 0 ? void 0 : dataverseError.message) {
42
+ errorMessage = dataverseError.message;
43
+ if (dataverseError.code) {
44
+ errorCode = dataverseError.code;
45
+ }
46
+ }
47
+ else if ((errorObj === null || errorObj === void 0 ? void 0 : errorObj.description) && typeof errorObj.description === 'string') {
48
+ errorMessage = errorObj.description;
49
+ }
50
+ else if (Array.isArray(errorObj === null || errorObj === void 0 ? void 0 : errorObj.messages) && errorObj.messages.length > 0) {
51
+ errorMessage = errorObj.messages.join(' | ');
52
+ }
53
+ else if (errorObj instanceof Error) {
54
+ errorMessage = errorObj.message;
55
+ }
56
+ if (errorObj === null || errorObj === void 0 ? void 0 : errorObj.httpCode) {
57
+ httpStatus = errorObj.httpCode;
58
+ }
59
+ else if ((_k = (_j = errorObj === null || errorObj === void 0 ? void 0 : errorObj.cause) === null || _j === void 0 ? void 0 : _j.response) === null || _k === void 0 ? void 0 : _k.statusCode) {
60
+ httpStatus = errorObj.cause.response.statusCode;
61
+ }
62
+ else if ((_l = errorObj === null || errorObj === void 0 ? void 0 : errorObj.response) === null || _l === void 0 ? void 0 : _l.status) {
63
+ httpStatus = errorObj.response.status;
64
+ }
65
+ else if (errorObj === null || errorObj === void 0 ? void 0 : errorObj.statusCode) {
66
+ httpStatus = errorObj.statusCode;
67
+ }
68
+ return { errorMessage, errorCode, httpStatus };
69
+ }
19
70
  async function dataverseApiRequest(method, endpoint, body, qs, itemIndex) {
20
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21
71
  let useCustomAuth = false;
22
72
  let accessTokenOverride = '';
23
73
  let customEnvironmentUrl = '';
@@ -78,43 +128,8 @@ async function dataverseApiRequest(method, endpoint, body, qs, itemIndex) {
78
128
  }
79
129
  }
80
130
  catch (error) {
81
- let errorMessage = 'Unknown error';
82
- let errorCode = '';
83
- let httpStatus = '';
84
131
  const errorObj = error;
85
- let dataverseError = null;
86
- if ((_c = (_b = (_a = errorObj === null || errorObj === void 0 ? void 0 : errorObj.cause) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.body) === null || _c === void 0 ? void 0 : _c.error) {
87
- dataverseError = errorObj.cause.response.body.error;
88
- }
89
- else if ((_e = (_d = errorObj === null || errorObj === void 0 ? void 0 : errorObj.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) {
90
- dataverseError = errorObj.response.data.error;
91
- }
92
- else if ((_f = errorObj === null || errorObj === void 0 ? void 0 : errorObj.cause) === null || _f === void 0 ? void 0 : _f.error) {
93
- dataverseError = errorObj.cause.error;
94
- }
95
- else if (errorObj === null || errorObj === void 0 ? void 0 : errorObj.error) {
96
- dataverseError = errorObj.error;
97
- }
98
- if (dataverseError) {
99
- if (dataverseError.message) {
100
- errorMessage = dataverseError.message;
101
- }
102
- if (dataverseError.code) {
103
- errorCode = dataverseError.code;
104
- }
105
- }
106
- else if (error instanceof Error) {
107
- errorMessage = error.message;
108
- }
109
- if ((_h = (_g = errorObj === null || errorObj === void 0 ? void 0 : errorObj.cause) === null || _g === void 0 ? void 0 : _g.response) === null || _h === void 0 ? void 0 : _h.statusCode) {
110
- httpStatus = errorObj.cause.response.statusCode;
111
- }
112
- else if ((_j = errorObj === null || errorObj === void 0 ? void 0 : errorObj.response) === null || _j === void 0 ? void 0 : _j.status) {
113
- httpStatus = errorObj.response.status;
114
- }
115
- else if (errorObj === null || errorObj === void 0 ? void 0 : errorObj.statusCode) {
116
- httpStatus = errorObj.statusCode;
117
- }
132
+ const { errorMessage, errorCode, httpStatus } = extractDataverseErrorDetails(errorObj);
118
133
  let fullErrorMessage = `Dataverse API request failed: ${errorMessage}`;
119
134
  if (httpStatus) {
120
135
  fullErrorMessage += ` (HTTP ${httpStatus})`;
@@ -127,7 +142,6 @@ async function dataverseApiRequest(method, endpoint, body, qs, itemIndex) {
127
142
  }
128
143
  }
129
144
  async function dataverseApiRequestFull(method, endpoint, body, itemIndex) {
130
- var _a, _b, _c, _d;
131
145
  let useCustomAuth = false;
132
146
  let accessTokenOverride = '';
133
147
  let customEnvironmentUrl = '';
@@ -182,11 +196,16 @@ async function dataverseApiRequestFull(method, endpoint, body, itemIndex) {
182
196
  }
183
197
  catch (error) {
184
198
  const errorObj = error;
185
- let errorMessage = error instanceof Error ? error.message : 'Unknown error';
186
- if ((_d = (_c = (_b = (_a = errorObj === null || errorObj === void 0 ? void 0 : errorObj.cause) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.body) === null || _c === void 0 ? void 0 : _c.error) === null || _d === void 0 ? void 0 : _d.message) {
187
- errorMessage = errorObj.cause.response.body.error.message;
199
+ const { errorMessage, errorCode, httpStatus } = extractDataverseErrorDetails(errorObj);
200
+ let fullErrorMessage = `Dataverse API request failed: ${errorMessage}`;
201
+ if (httpStatus) {
202
+ fullErrorMessage += ` (HTTP ${httpStatus})`;
188
203
  }
189
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Dataverse API request failed: ${errorMessage}\nURL: ${options.url}`);
204
+ if (errorCode) {
205
+ fullErrorMessage += ` [Error Code: ${errorCode}]`;
206
+ }
207
+ fullErrorMessage += `\nURL: ${options.url}`;
208
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), fullErrorMessage);
190
209
  }
191
210
  }
192
211
  async function dataverseApiBinaryRequest(method, endpoint, itemIndex) {
@@ -292,6 +311,23 @@ async function searchTables(filter) {
292
311
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to load tables: ${error.message}`);
293
312
  }
294
313
  }
314
+ async function resolveEntitySetName(table, itemIndex) {
315
+ try {
316
+ const entityResponse = (await dataverseApiRequest.call(this, 'GET', '/EntityDefinitions', undefined, {
317
+ $select: 'LogicalName,EntitySetName',
318
+ $filter: `LogicalName eq '${table}' or EntitySetName eq '${table}'`,
319
+ }, itemIndex));
320
+ if (entityResponse.value && entityResponse.value.length > 0) {
321
+ const entitySetName = entityResponse.value[0].EntitySetName;
322
+ if (entitySetName) {
323
+ return entitySetName;
324
+ }
325
+ }
326
+ }
327
+ catch {
328
+ }
329
+ return table;
330
+ }
295
331
  async function getImageAndFileFields(table, itemIndex) {
296
332
  const imageFields = [];
297
333
  const fileFields = [];
@@ -610,7 +646,7 @@ function buildRecordIdentifier(recordIdType, recordId, alternateKeys) {
610
646
  return recordId;
611
647
  }
612
648
  if (recordIdType === 'alternateKey' && alternateKeys) {
613
- const keyPairs = alternateKeys.map((key) => `${key.name}='${key.value}'`);
649
+ const keyPairs = alternateKeys.map((key) => `${key.name}='${key.value.replace(/'/g, "''")}'`);
614
650
  return keyPairs.join(',');
615
651
  }
616
652
  throw new Error('Invalid record identifier configuration');
@@ -622,6 +658,157 @@ function fieldsToObject(fields) {
622
658
  }
623
659
  return body;
624
660
  }
661
+ async function resolveLogicalName(table, itemIndex) {
662
+ try {
663
+ const entityResponse = (await dataverseApiRequest.call(this, 'GET', '/EntityDefinitions', undefined, {
664
+ $select: 'LogicalName,EntitySetName',
665
+ $filter: `LogicalName eq '${table}' or EntitySetName eq '${table}'`,
666
+ }, itemIndex));
667
+ if (entityResponse.value && entityResponse.value.length > 0) {
668
+ return entityResponse.value[0].LogicalName;
669
+ }
670
+ }
671
+ catch {
672
+ }
673
+ return table;
674
+ }
675
+ async function getLookupFieldTargets(logicalName, itemIndex) {
676
+ const lookupTargets = new Map();
677
+ try {
678
+ const response = (await dataverseApiRequest.call(this, 'GET', `/EntityDefinitions(LogicalName='${logicalName}')/Attributes/Microsoft.Dynamics.CRM.LookupAttributeMetadata`, undefined, { $select: 'LogicalName,Targets' }, itemIndex));
679
+ for (const attr of (response.value || [])) {
680
+ if (attr.LogicalName && attr.Targets && attr.Targets.length > 0) {
681
+ lookupTargets.set(attr.LogicalName, attr.Targets);
682
+ }
683
+ }
684
+ }
685
+ catch {
686
+ }
687
+ return lookupTargets;
688
+ }
689
+ async function getFieldAttributeTypes(logicalName, itemIndex) {
690
+ const attributeTypes = new Map();
691
+ try {
692
+ const response = (await dataverseApiRequest.call(this, 'GET', `/EntityDefinitions(LogicalName='${logicalName}')/Attributes`, undefined, { $select: 'LogicalName,AttributeType' }, itemIndex));
693
+ for (const attr of (response.value || [])) {
694
+ if (attr.LogicalName && attr.AttributeType) {
695
+ attributeTypes.set(attr.LogicalName, attr.AttributeType);
696
+ }
697
+ }
698
+ }
699
+ catch {
700
+ }
701
+ return attributeTypes;
702
+ }
703
+ const GUID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
704
+ function buildLookupBindIdentifier(rawValue) {
705
+ const trimmed = rawValue.trim();
706
+ if (GUID_REGEX.test(trimmed)) {
707
+ return trimmed;
708
+ }
709
+ const invalidValueError = new Error(`Invalid lookup value "${rawValue}". Expected a GUID or a JSON object of alternate key field/value pairs, e.g. {"keyname": "value"}.`);
710
+ let parsed;
711
+ try {
712
+ parsed = JSON.parse(trimmed);
713
+ }
714
+ catch {
715
+ throw invalidValueError;
716
+ }
717
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
718
+ throw invalidValueError;
719
+ }
720
+ const alternateKeys = Object.entries(parsed).map(([name, value]) => ({
721
+ name,
722
+ value: String(value),
723
+ }));
724
+ if (alternateKeys.length === 0) {
725
+ throw new Error(`Invalid lookup value "${rawValue}". The alternate key object must have at least one field.`);
726
+ }
727
+ return buildRecordIdentifier('alternateKey', undefined, alternateKeys);
728
+ }
729
+ async function resolveChoiceLabelToValue(logicalName, fieldName, label, itemIndex) {
730
+ var _a, _b;
731
+ try {
732
+ const response = (await dataverseApiRequest.call(this, 'GET', `/EntityDefinitions(LogicalName='${logicalName}')/Attributes(LogicalName='${fieldName}')`, undefined, {
733
+ $select: 'LogicalName,AttributeType',
734
+ $expand: 'OptionSet($select=Options),GlobalOptionSet($select=Options,Name)',
735
+ }, itemIndex));
736
+ const optionSet = ((_a = response.OptionSet) !== null && _a !== void 0 ? _a : response.GlobalOptionSet);
737
+ const options = ((_b = optionSet === null || optionSet === void 0 ? void 0 : optionSet.Options) !== null && _b !== void 0 ? _b : []);
738
+ const normalizedLabel = label.trim().toLowerCase();
739
+ const match = options.find((option) => { var _a, _b, _c; return ((_c = (_b = (_a = option.Label) === null || _a === void 0 ? void 0 : _a.UserLocalizedLabel) === null || _b === void 0 ? void 0 : _b.Label) === null || _c === void 0 ? void 0 : _c.trim().toLowerCase()) === normalizedLabel; });
740
+ return match ? match.Value : null;
741
+ }
742
+ catch {
743
+ return null;
744
+ }
745
+ }
746
+ async function coerceFieldValue(value, attributeType, logicalName, fieldName, itemIndex) {
747
+ const isEmpty = value === '' || value === undefined || value === null;
748
+ switch (attributeType) {
749
+ case 'Boolean':
750
+ if (isEmpty) {
751
+ return null;
752
+ }
753
+ return ['true', '1', 'yes'].includes(String(value).trim().toLowerCase());
754
+ case 'Integer':
755
+ case 'BigInt':
756
+ case 'Decimal':
757
+ case 'Double':
758
+ case 'Money': {
759
+ if (isEmpty) {
760
+ return null;
761
+ }
762
+ const numericValue = Number(value);
763
+ return Number.isNaN(numericValue) ? value : numericValue;
764
+ }
765
+ case 'Picklist':
766
+ case 'State':
767
+ case 'Status': {
768
+ if (isEmpty) {
769
+ return null;
770
+ }
771
+ const numericValue = Number(value);
772
+ if (!Number.isNaN(numericValue)) {
773
+ return numericValue;
774
+ }
775
+ const resolvedValue = await resolveChoiceLabelToValue.call(this, logicalName, fieldName, String(value), itemIndex);
776
+ return resolvedValue !== null && resolvedValue !== void 0 ? resolvedValue : value;
777
+ }
778
+ default:
779
+ if (typeof value === 'number' || typeof value === 'boolean') {
780
+ return String(value);
781
+ }
782
+ return value;
783
+ }
784
+ }
785
+ async function fieldsToRequestBody(table, fields, itemIndex) {
786
+ const body = {};
787
+ if (fields.length === 0) {
788
+ return body;
789
+ }
790
+ const logicalName = await resolveLogicalName.call(this, table, itemIndex);
791
+ const [lookupTargets, attributeTypes] = await Promise.all([
792
+ getLookupFieldTargets.call(this, logicalName, itemIndex),
793
+ getFieldAttributeTypes.call(this, logicalName, itemIndex),
794
+ ]);
795
+ for (const field of fields) {
796
+ const targets = lookupTargets.get(field.name);
797
+ if (targets && targets.length > 0) {
798
+ if (!field.value) {
799
+ body[`${field.name}@odata.bind`] = null;
800
+ continue;
801
+ }
802
+ const targetEntitySet = await resolveEntitySetName.call(this, targets[0], itemIndex);
803
+ const identifier = buildLookupBindIdentifier(field.value);
804
+ body[`${field.name}@odata.bind`] = `/${targetEntitySet}(${identifier})`;
805
+ }
806
+ else {
807
+ body[field.name] = (await coerceFieldValue.call(this, field.value, attributeTypes.get(field.name), logicalName, field.name, itemIndex));
808
+ }
809
+ }
810
+ return body;
811
+ }
625
812
  function buildODataQuery(filter, orderBy, selectFields, limit) {
626
813
  const qs = {};
627
814
  if (filter) {
@@ -638,122 +825,6 @@ function buildODataQuery(filter, orderBy, selectFields, limit) {
638
825
  }
639
826
  return qs;
640
827
  }
641
- async function getChoiceFieldOptions() {
642
- var _a, _b;
643
- const returnData = [];
644
- try {
645
- const table = this.getNodeParameter('table', 0);
646
- const tableValue = table === null || table === void 0 ? void 0 : table.value;
647
- if (!tableValue) {
648
- return [
649
- {
650
- name: 'Please select a table first',
651
- value: '',
652
- },
653
- ];
654
- }
655
- const choiceFieldName = this.getNodeParameter('viewChoiceField', 0);
656
- if (!choiceFieldName) {
657
- return [
658
- {
659
- name: 'Please select a field to view its options',
660
- value: '',
661
- },
662
- ];
663
- }
664
- let logicalName = tableValue;
665
- try {
666
- const entityResponse = (await dataverseApiRequest.call(this, 'GET', '/EntityDefinitions', undefined, {
667
- $select: 'LogicalName,EntitySetName',
668
- $filter: `EntitySetName eq '${tableValue}'`,
669
- }));
670
- if (entityResponse.value && entityResponse.value.length > 0) {
671
- logicalName = entityResponse.value[0].LogicalName;
672
- }
673
- }
674
- catch {
675
- }
676
- let response;
677
- try {
678
- response = (await dataverseApiRequest.call(this, 'GET', `/EntityDefinitions(LogicalName='${logicalName}')/Attributes(LogicalName='${choiceFieldName}')`, undefined, {
679
- $select: 'LogicalName,AttributeType',
680
- $expand: 'OptionSet($select=Options),GlobalOptionSet($select=Options,Name)',
681
- }));
682
- }
683
- catch (error) {
684
- const errorMsg = error instanceof Error ? error.message : String(error);
685
- return [
686
- {
687
- name: `⚠️ Could not load field: ${choiceFieldName}`,
688
- value: '',
689
- },
690
- {
691
- name: `Error: ${errorMsg}`,
692
- value: '',
693
- },
694
- ];
695
- }
696
- const attributeType = response.AttributeType;
697
- if (!['Picklist', 'State', 'Status'].includes(attributeType)) {
698
- return [
699
- {
700
- name: `⚠️ Field "${choiceFieldName}" is not a choice field`,
701
- value: '',
702
- },
703
- {
704
- name: `Type: ${attributeType}`,
705
- value: '',
706
- },
707
- ];
708
- }
709
- let options = [];
710
- let choiceType = 'Local Choice';
711
- if (response.OptionSet && response.OptionSet.Options) {
712
- options = response.OptionSet.Options;
713
- choiceType = 'Local Choice';
714
- }
715
- else if (response.GlobalOptionSet && response.GlobalOptionSet.Options) {
716
- options = response.GlobalOptionSet.Options;
717
- const globalName = response.GlobalOptionSet.Name;
718
- choiceType = `Global Choice (${globalName})`;
719
- }
720
- if (options.length === 0) {
721
- return [
722
- {
723
- name: 'No options available for this field',
724
- value: '',
725
- },
726
- ];
727
- }
728
- returnData.push({
729
- name: `━━━ ${choiceType} ━━━`,
730
- value: '',
731
- });
732
- for (const option of options) {
733
- const label = ((_b = (_a = option.Label) === null || _a === void 0 ? void 0 : _a.UserLocalizedLabel) === null || _b === void 0 ? void 0 : _b.Label) || `Option ${option.Value}`;
734
- const value = option.Value;
735
- const name = `${label} (${value})`;
736
- returnData.push({
737
- name,
738
- value: value.toString(),
739
- });
740
- }
741
- return returnData;
742
- }
743
- catch (error) {
744
- const errorMsg = error instanceof Error ? error.message : String(error);
745
- return [
746
- {
747
- name: `⚠️ Error loading choice options`,
748
- value: '',
749
- },
750
- {
751
- name: `${errorMsg}`,
752
- value: '',
753
- },
754
- ];
755
- }
756
- }
757
828
  async function getGlobalChoicesForDropdown() {
758
829
  try {
759
830
  const response = (await dataverseApiRequest.call(this, 'GET', '/GlobalOptionSetDefinitions', undefined, {