@blickwerk/n8n-nodes-microsoft-planner 1.0.0 → 1.0.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.
|
@@ -2,3 +2,4 @@ import { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, IL
|
|
|
2
2
|
export declare function microsoftApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, resource: string, body?: IDataObject, qs?: IDataObject, uri?: string, headers?: IDataObject): Promise<any>;
|
|
3
3
|
export declare function microsoftApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, query?: IDataObject): Promise<any>;
|
|
4
4
|
export declare function cleanETag(eTag: string): string;
|
|
5
|
+
export declare function formatDateTime(dateTime: string | undefined): string | undefined;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.microsoftApiRequest = microsoftApiRequest;
|
|
4
4
|
exports.microsoftApiRequestAllItems = microsoftApiRequestAllItems;
|
|
5
5
|
exports.cleanETag = cleanETag;
|
|
6
|
+
exports.formatDateTime = formatDateTime;
|
|
6
7
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
8
|
async function microsoftApiRequest(method, resource, body = {}, qs = {}, uri, headers = {}) {
|
|
8
9
|
const options = {
|
|
@@ -45,3 +46,18 @@ function cleanETag(eTag) {
|
|
|
45
46
|
}
|
|
46
47
|
return eTag;
|
|
47
48
|
}
|
|
49
|
+
function formatDateTime(dateTime) {
|
|
50
|
+
if (!dateTime) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
// If already in ISO format with timezone, return as is
|
|
54
|
+
if (dateTime.includes('T') && (dateTime.endsWith('Z') || dateTime.includes('+'))) {
|
|
55
|
+
return dateTime;
|
|
56
|
+
}
|
|
57
|
+
// Convert to ISO 8601 format with UTC timezone
|
|
58
|
+
const date = new Date(dateTime);
|
|
59
|
+
if (isNaN(date.getTime())) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return date.toISOString();
|
|
63
|
+
}
|
|
@@ -69,10 +69,10 @@ class MicrosoftPlanner {
|
|
|
69
69
|
body.priority = additionalFields.priority;
|
|
70
70
|
}
|
|
71
71
|
if (additionalFields.dueDateTime) {
|
|
72
|
-
body.dueDateTime = additionalFields.dueDateTime;
|
|
72
|
+
body.dueDateTime = (0, GenericFunctions_1.formatDateTime)(additionalFields.dueDateTime);
|
|
73
73
|
}
|
|
74
74
|
if (additionalFields.startDateTime) {
|
|
75
|
-
body.startDateTime = additionalFields.startDateTime;
|
|
75
|
+
body.startDateTime = (0, GenericFunctions_1.formatDateTime)(additionalFields.startDateTime);
|
|
76
76
|
}
|
|
77
77
|
if (additionalFields.percentComplete !== undefined) {
|
|
78
78
|
body.percentComplete = additionalFields.percentComplete;
|
|
@@ -149,10 +149,10 @@ class MicrosoftPlanner {
|
|
|
149
149
|
body.priority = updateFields.priority;
|
|
150
150
|
}
|
|
151
151
|
if (updateFields.dueDateTime) {
|
|
152
|
-
body.dueDateTime = updateFields.dueDateTime;
|
|
152
|
+
body.dueDateTime = (0, GenericFunctions_1.formatDateTime)(updateFields.dueDateTime);
|
|
153
153
|
}
|
|
154
154
|
if (updateFields.startDateTime) {
|
|
155
|
-
body.startDateTime = updateFields.startDateTime;
|
|
155
|
+
body.startDateTime = (0, GenericFunctions_1.formatDateTime)(updateFields.startDateTime);
|
|
156
156
|
}
|
|
157
157
|
if (updateFields.percentComplete !== undefined) {
|
|
158
158
|
body.percentComplete = updateFields.percentComplete;
|