n8n-nodes-base 1.33.0 → 1.34.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/dist/build.tsbuildinfo +1 -1
- package/dist/known/credentials.json +3 -1
- package/dist/known/nodes.json +4 -0
- package/dist/methods/defined.json +1 -0
- package/dist/nodes/Microsoft/OneDrive/GenericFunctions.d.ts +7 -4
- package/dist/nodes/Microsoft/OneDrive/GenericFunctions.js +53 -1
- package/dist/nodes/Microsoft/OneDrive/GenericFunctions.js.map +1 -1
- package/dist/nodes/Microsoft/OneDrive/MicrosoftOneDriveTrigger.node.d.ts +8 -0
- package/dist/nodes/Microsoft/OneDrive/MicrosoftOneDriveTrigger.node.js +138 -0
- package/dist/nodes/Microsoft/OneDrive/MicrosoftOneDriveTrigger.node.js.map +1 -0
- package/dist/nodes/Microsoft/OneDrive/MicrosoftOneDriveTrigger.node.json +25 -0
- package/dist/nodes/Microsoft/OneDrive/TriggerDescription.d.ts +4 -0
- package/dist/nodes/Microsoft/OneDrive/TriggerDescription.js +281 -0
- package/dist/nodes/Microsoft/OneDrive/TriggerDescription.js.map +1 -0
- package/dist/nodes/Microsoft/OneDrive/constants.d.ts +2 -0
- package/dist/nodes/Microsoft/OneDrive/constants.js +6 -0
- package/dist/nodes/Microsoft/OneDrive/constants.js.map +1 -0
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +2 -4
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
- package/dist/nodes/MySql/v2/helpers/utils.js +2 -2
- package/dist/nodes/MySql/v2/helpers/utils.js.map +1 -1
- package/dist/types/nodes.json +3 -2
- package/package.json +11 -10
|
@@ -1570,6 +1570,7 @@
|
|
|
1570
1570
|
"microsoftExcel",
|
|
1571
1571
|
"microsoftGraphSecurity",
|
|
1572
1572
|
"microsoftOneDrive",
|
|
1573
|
+
"microsoftOneDriveTrigger",
|
|
1573
1574
|
"microsoftOutlook",
|
|
1574
1575
|
"microsoftOutlookTrigger",
|
|
1575
1576
|
"microsoftTeams",
|
|
@@ -1583,7 +1584,8 @@
|
|
|
1583
1584
|
"microsoftOAuth2Api"
|
|
1584
1585
|
],
|
|
1585
1586
|
"supportedNodes": [
|
|
1586
|
-
"microsoftOneDrive"
|
|
1587
|
+
"microsoftOneDrive",
|
|
1588
|
+
"microsoftOneDriveTrigger"
|
|
1587
1589
|
]
|
|
1588
1590
|
},
|
|
1589
1591
|
"microsoftOutlookOAuth2Api": {
|
package/dist/known/nodes.json
CHANGED
|
@@ -1575,6 +1575,10 @@
|
|
|
1575
1575
|
"className": "MicrosoftOneDrive",
|
|
1576
1576
|
"sourcePath": "dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js"
|
|
1577
1577
|
},
|
|
1578
|
+
"microsoftOneDriveTrigger": {
|
|
1579
|
+
"className": "MicrosoftOneDriveTrigger",
|
|
1580
|
+
"sourcePath": "dist/nodes/Microsoft/OneDrive/MicrosoftOneDriveTrigger.node.js"
|
|
1581
|
+
},
|
|
1578
1582
|
"microsoftOutlook": {
|
|
1579
1583
|
"className": "MicrosoftOutlook",
|
|
1580
1584
|
"sourcePath": "dist/nodes/Microsoft/Outlook/MicrosoftOutlook.node.js"
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type { IExecuteFunctions, ILoadOptionsFunctions, IDataObject, IHttpRequestMethods } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
1
|
+
import type { IExecuteFunctions, ILoadOptionsFunctions, IDataObject, IHttpRequestMethods, IPollFunctions } from 'n8n-workflow';
|
|
2
|
+
import { DateTime } from 'luxon';
|
|
3
|
+
export declare function microsoftApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, method: IHttpRequestMethods, resource: string, body?: any, qs?: IDataObject, uri?: string, headers?: IDataObject, option?: IDataObject): Promise<any>;
|
|
4
|
+
export declare function microsoftApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, propertyName: string, method: IHttpRequestMethods, endpoint: string, body?: any, query?: IDataObject): Promise<any>;
|
|
5
|
+
export declare function microsoftApiRequestAllItemsSkip(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, propertyName: string, method: IHttpRequestMethods, endpoint: string, body?: any, query?: IDataObject): Promise<any>;
|
|
6
|
+
export declare function microsoftApiRequestAllItemsDelta(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, link: string, lastDate: DateTime, eventType: string): Promise<any>;
|
|
7
|
+
export declare function getPath(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, itemId: string): Promise<string>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.microsoftApiRequestAllItemsSkip = exports.microsoftApiRequestAllItems = exports.microsoftApiRequest = void 0;
|
|
3
|
+
exports.getPath = exports.microsoftApiRequestAllItemsDelta = exports.microsoftApiRequestAllItemsSkip = exports.microsoftApiRequestAllItems = exports.microsoftApiRequest = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const luxon_1 = require("luxon");
|
|
5
6
|
async function microsoftApiRequest(method, resource, body = {}, qs = {}, uri, headers = {}, option = { json: true }) {
|
|
6
7
|
const options = {
|
|
7
8
|
headers: {
|
|
@@ -59,4 +60,55 @@ async function microsoftApiRequestAllItemsSkip(propertyName, method, endpoint, b
|
|
|
59
60
|
return returnData;
|
|
60
61
|
}
|
|
61
62
|
exports.microsoftApiRequestAllItemsSkip = microsoftApiRequestAllItemsSkip;
|
|
63
|
+
async function microsoftApiRequestAllItemsDelta(link, lastDate, eventType) {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
const returnData = [];
|
|
66
|
+
let responseData;
|
|
67
|
+
let deltaLink = '';
|
|
68
|
+
let uri = link;
|
|
69
|
+
do {
|
|
70
|
+
responseData = (await microsoftApiRequest.call(this, 'GET', '', {}, {}, uri));
|
|
71
|
+
uri = responseData['@odata.nextLink'];
|
|
72
|
+
for (const value of responseData.value) {
|
|
73
|
+
if (value.fileSystemInfo) {
|
|
74
|
+
const updatedTimeStamp = (_a = value.fileSystemInfo) === null || _a === void 0 ? void 0 : _a.lastModifiedDateTime;
|
|
75
|
+
const createdTimeStamp = (_b = value.fileSystemInfo) === null || _b === void 0 ? void 0 : _b.createdDateTime;
|
|
76
|
+
if (eventType === 'created') {
|
|
77
|
+
if (luxon_1.DateTime.fromISO(createdTimeStamp) >= lastDate) {
|
|
78
|
+
returnData.push(value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (eventType === 'updated') {
|
|
82
|
+
if (luxon_1.DateTime.fromISO(updatedTimeStamp) >= lastDate &&
|
|
83
|
+
luxon_1.DateTime.fromISO(createdTimeStamp) < lastDate) {
|
|
84
|
+
returnData.push(value);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
deltaLink = responseData['@odata.deltaLink'] || '';
|
|
90
|
+
} while (responseData['@odata.nextLink'] !== undefined);
|
|
91
|
+
return { deltaLink, returnData };
|
|
92
|
+
}
|
|
93
|
+
exports.microsoftApiRequestAllItemsDelta = microsoftApiRequestAllItemsDelta;
|
|
94
|
+
async function getPath(itemId) {
|
|
95
|
+
var _a;
|
|
96
|
+
const responseData = (await microsoftApiRequest.call(this, 'GET', '', {}, {}, `https://graph.microsoft.com/v1.0/me/drive/items/${itemId}`));
|
|
97
|
+
if (responseData.folder) {
|
|
98
|
+
return ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.parentReference) === null || _a === void 0 ? void 0 : _a.path) + `/${responseData === null || responseData === void 0 ? void 0 : responseData.name}`;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const workflow = this.getWorkflow();
|
|
102
|
+
const node = this.getNode();
|
|
103
|
+
this.logger.error(`There was a problem in '${node.name}' node in workflow '${workflow.id}': 'Item to watch is not a folder'`, {
|
|
104
|
+
node: node.name,
|
|
105
|
+
workflowId: workflow.id,
|
|
106
|
+
error: 'Item to watch is not a folder',
|
|
107
|
+
});
|
|
108
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
109
|
+
error: 'Item to watch is not a folder',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.getPath = getPath;
|
|
62
114
|
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../../nodes/Microsoft/OneDrive/GenericFunctions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../../nodes/Microsoft/OneDrive/GenericFunctions.ts"],"names":[],"mappings":";;;AASA,+CAA4C;AAC5C,iCAAiC;AAE1B,KAAK,UAAU,mBAAmB,CAExC,MAA2B,EAC3B,QAAgB,EAEhB,OAAY,EAAE,EACd,KAAkB,EAAE,EACpB,GAAY,EACZ,UAAuB,EAAE,EACzB,SAAsB,EAAE,IAAI,EAAE,IAAI,EAAE;IAEpC,MAAM,OAAO,GAAoB;QAChC,OAAO,EAAE;YACR,cAAc,EAAE,kBAAkB;SAClC;QACD,MAAM;QACN,IAAI;QACJ,EAAE;QACF,GAAG,EAAE,GAAG,IAAI,sCAAsC,QAAQ,EAAE;KAC5D,CAAC;IACF,IAAI,CAAC;QACJ,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/B,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE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QACP,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,2BAA2B,IAAI,CAAC,IAAI,uBAAuB,QAAQ,CAAC,EAAE,oCAAoC,EAC1G;YACC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,QAAQ,CAAC,EAAE;YACvB,KAAK,EAAE,+BAA+B;SACtC,CACD,CAAC;QACF,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE;YACtC,KAAK,EAAE,+BAA+B;SACxB,CAAC,CAAC;IAClB,CAAC;AACF,CAAC;AA7BD,0BA6BC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IPollFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class MicrosoftOneDriveTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {};
|
|
6
|
+
};
|
|
7
|
+
poll(this: IPollFunctions): Promise<INodeExecutionData[][] | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MicrosoftOneDriveTrigger = void 0;
|
|
4
|
+
const luxon_1 = require("luxon");
|
|
5
|
+
const TriggerDescription_1 = require("./TriggerDescription");
|
|
6
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
7
|
+
class MicrosoftOneDriveTrigger {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.description = {
|
|
10
|
+
displayName: 'Microsoft OneDrive Trigger',
|
|
11
|
+
name: 'microsoftOneDriveTrigger',
|
|
12
|
+
icon: 'file:oneDrive.svg',
|
|
13
|
+
group: ['trigger'],
|
|
14
|
+
version: 1,
|
|
15
|
+
description: 'Trigger for Microsoft OneDrive API.',
|
|
16
|
+
subtitle: '={{($parameter["event"])}}',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Microsoft OneDrive Trigger',
|
|
19
|
+
},
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'microsoftOneDriveOAuth2Api',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
polling: true,
|
|
27
|
+
inputs: [],
|
|
28
|
+
outputs: ['main'],
|
|
29
|
+
properties: [...TriggerDescription_1.triggerDescription],
|
|
30
|
+
};
|
|
31
|
+
this.methods = {
|
|
32
|
+
loadOptions: {},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async poll() {
|
|
36
|
+
const workflowData = this.getWorkflowStaticData('node');
|
|
37
|
+
let responseData;
|
|
38
|
+
const lastLink = workflowData.LastLink ||
|
|
39
|
+
'https://graph.microsoft.com/v1.0/me/drive/root/delta?token=latest';
|
|
40
|
+
const now = luxon_1.DateTime.now().toUTC();
|
|
41
|
+
const start = luxon_1.DateTime.fromISO(workflowData.lastTimeChecked) || now;
|
|
42
|
+
const end = now;
|
|
43
|
+
const event = this.getNodeParameter('event', 'fileCreated');
|
|
44
|
+
const watch = this.getNodeParameter('watch', 'anyFile');
|
|
45
|
+
const watchFolder = this.getNodeParameter('watchFolder', false) || false;
|
|
46
|
+
const folderChild = this.getNodeParameter('options.folderChild', false) || false;
|
|
47
|
+
let eventType = 'created';
|
|
48
|
+
let eventResource = 'file';
|
|
49
|
+
if (event.includes('Updated')) {
|
|
50
|
+
eventType = 'updated';
|
|
51
|
+
}
|
|
52
|
+
if (event.includes('folder')) {
|
|
53
|
+
eventResource = 'folder';
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
if (this.getMode() === 'manual') {
|
|
57
|
+
responseData = (await GenericFunctions_1.microsoftApiRequest.call(this, 'GET', '', {}, {}, 'https://graph.microsoft.com/v1.0/me/drive/root/delta')).value;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const response = (await GenericFunctions_1.microsoftApiRequestAllItemsDelta.call(this, lastLink, start, eventType));
|
|
61
|
+
responseData = response.returnData;
|
|
62
|
+
workflowData.LastLink = response.deltaLink;
|
|
63
|
+
}
|
|
64
|
+
workflowData.lastTimeChecked = end.toISO();
|
|
65
|
+
if (watch === 'selectedFile') {
|
|
66
|
+
const fileId = this.getNodeParameter('fileId', '', {
|
|
67
|
+
extractValue: true,
|
|
68
|
+
}).replace('%21', '!');
|
|
69
|
+
if (fileId) {
|
|
70
|
+
responseData = responseData.filter((item) => item.id === fileId);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!folderChild &&
|
|
74
|
+
(watch === 'oneSelectedFolder' || watch === 'selectedFolder' || watchFolder)) {
|
|
75
|
+
const folderId = this.getNodeParameter('folderId', '', {
|
|
76
|
+
extractValue: true,
|
|
77
|
+
}).replace('%21', '!');
|
|
78
|
+
if (folderId) {
|
|
79
|
+
if (watch === 'oneSelectedFolder') {
|
|
80
|
+
responseData = responseData.filter((item) => item.id === folderId);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
responseData = responseData.filter((item) => item.parentReference.id === folderId);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (folderChild && (watch === 'selectedFolder' || watchFolder)) {
|
|
88
|
+
const folderId = this.getNodeParameter('folderId', '', {
|
|
89
|
+
extractValue: true,
|
|
90
|
+
}).replace('%21', '!');
|
|
91
|
+
const folderPath = await GenericFunctions_1.getPath.call(this, folderId);
|
|
92
|
+
responseData = responseData.filter((item) => item.parentReference.path.startsWith(folderPath));
|
|
93
|
+
}
|
|
94
|
+
responseData = responseData.filter((item) => item[eventResource]);
|
|
95
|
+
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.length)) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const simplify = this.getNodeParameter('simple');
|
|
99
|
+
if (simplify) {
|
|
100
|
+
responseData = responseData.map((x) => {
|
|
101
|
+
var _a, _b, _c, _d;
|
|
102
|
+
return ({
|
|
103
|
+
id: x.id,
|
|
104
|
+
createdDateTime: (_a = x.fileSystemInfo) === null || _a === void 0 ? void 0 : _a.createdDateTime,
|
|
105
|
+
lastModifiedDateTime: (_b = x.fileSystemInfo) === null || _b === void 0 ? void 0 : _b.lastModifiedDateTime,
|
|
106
|
+
name: x.name,
|
|
107
|
+
webUrl: x.webUrl,
|
|
108
|
+
size: x.size,
|
|
109
|
+
path: ((_c = x.parentReference) === null || _c === void 0 ? void 0 : _c.path) || '',
|
|
110
|
+
mimeType: ((_d = x.file) === null || _d === void 0 ? void 0 : _d.mimeType) || '',
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (this.getMode() === 'manual') {
|
|
115
|
+
return [this.helpers.returnJsonArray(responseData[0])];
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return [this.helpers.returnJsonArray(responseData)];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (this.getMode() === 'manual' || !workflowData.lastTimeChecked) {
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
const workflow = this.getWorkflow();
|
|
126
|
+
const node = this.getNode();
|
|
127
|
+
this.logger.error(`There was a problem in '${node.name}' node in workflow '${workflow.id}': '${error.description}'`, {
|
|
128
|
+
node: node.name,
|
|
129
|
+
workflowId: workflow.id,
|
|
130
|
+
error,
|
|
131
|
+
});
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.MicrosoftOneDriveTrigger = MicrosoftOneDriveTrigger;
|
|
138
|
+
//# sourceMappingURL=MicrosoftOneDriveTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MicrosoftOneDriveTrigger.node.js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AAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;YACrD,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;gBAClE,MAAM,KAAK,CAAC;YACb,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,2BAA2B,IAAI,CAAC,IAAI,uBAAuB,QAAQ,CAAC,EAAE,OAAO,KAAK,CAAC,WAAW,GAAG,EACjG;gBACC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,QAAQ,CAAC,EAAE;gBACvB,KAAK;aACL,CACD,CAAC;YACF,MAAM,KAAK,CAAC;QACb,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAhKD,4DAgKC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.microsoftOneDriveTrigger",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Data & Storage"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://docs.n8n.io/credentials/microsoft"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftonedrivetrigger/"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"generic": [
|
|
18
|
+
{
|
|
19
|
+
"label": "Hey founders! Your business doesn't need you to operate",
|
|
20
|
+
"icon": " 🖥️",
|
|
21
|
+
"url": "https://n8n.io/blog/your-business-doesnt-need-you-to-operate/"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggerDescription = exports.folderRLC = exports.fileRLC = void 0;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
exports.fileRLC = {
|
|
6
|
+
displayName: 'File',
|
|
7
|
+
name: 'fileId',
|
|
8
|
+
type: 'resourceLocator',
|
|
9
|
+
default: { mode: 'id', value: '' },
|
|
10
|
+
required: true,
|
|
11
|
+
modes: [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Link',
|
|
14
|
+
name: 'url',
|
|
15
|
+
type: 'string',
|
|
16
|
+
placeholder: 'e.g. https://onedrive.live.com/edit.aspx?resid=170B5C65E30736A3!257&cid=170b5c65e30736a3&CT=1708697995542&OR=ItemsView',
|
|
17
|
+
extractValue: {
|
|
18
|
+
type: 'regex',
|
|
19
|
+
regex: constants_1.MICROSOFT_DRIVE_FILE_URL_REGEX,
|
|
20
|
+
},
|
|
21
|
+
validation: [
|
|
22
|
+
{
|
|
23
|
+
type: 'regex',
|
|
24
|
+
properties: {
|
|
25
|
+
regex: constants_1.MICROSOFT_DRIVE_FILE_URL_REGEX,
|
|
26
|
+
errorMessage: 'Not a valid Microsoft Drive File URL',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
displayName: 'ID',
|
|
33
|
+
name: 'id',
|
|
34
|
+
type: 'string',
|
|
35
|
+
placeholder: 'e.g. 170B5C65E30736A3!257',
|
|
36
|
+
validation: [
|
|
37
|
+
{
|
|
38
|
+
type: 'regex',
|
|
39
|
+
properties: {
|
|
40
|
+
regex: '[a-zA-Z0-9\\!%21]{5,}',
|
|
41
|
+
errorMessage: 'Not a valid Microsoft Drive File ID',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
url: '=https://onedrive.live.com/?id={{$value}}',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
description: "The file to operate on. The 'By URL' option only accepts URLs that start with 'https://onedrive.live.com'.",
|
|
49
|
+
};
|
|
50
|
+
exports.folderRLC = {
|
|
51
|
+
displayName: 'Folder',
|
|
52
|
+
name: 'folderId',
|
|
53
|
+
type: 'resourceLocator',
|
|
54
|
+
default: { mode: 'id', value: '', cachedResultName: '' },
|
|
55
|
+
required: true,
|
|
56
|
+
modes: [
|
|
57
|
+
{
|
|
58
|
+
displayName: 'Link',
|
|
59
|
+
name: 'url',
|
|
60
|
+
type: 'string',
|
|
61
|
+
placeholder: 'e.g. https://onedrive.live.com/?id=170B5C65E30736A3%21103&cid=170B5C65E30736A3',
|
|
62
|
+
extractValue: {
|
|
63
|
+
type: 'regex',
|
|
64
|
+
regex: constants_1.MICROSOFT_DRIVE_FOLDER_URL_REGEX,
|
|
65
|
+
},
|
|
66
|
+
validation: [
|
|
67
|
+
{
|
|
68
|
+
type: 'regex',
|
|
69
|
+
properties: {
|
|
70
|
+
regex: constants_1.MICROSOFT_DRIVE_FOLDER_URL_REGEX,
|
|
71
|
+
errorMessage: 'Not a valid Microsoft Drive Folder URL',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'ID',
|
|
78
|
+
name: 'id',
|
|
79
|
+
type: 'string',
|
|
80
|
+
placeholder: 'e.g. 170B5C65E30736A3%21136',
|
|
81
|
+
validation: [
|
|
82
|
+
{
|
|
83
|
+
type: 'regex',
|
|
84
|
+
properties: {
|
|
85
|
+
regex: '[a-zA-Z0-9\\!%21]{5,}',
|
|
86
|
+
errorMessage: 'Not a valid Microsoft Drive Folder ID',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
url: '=https://onedrive.live.com/?id={{$value}}',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
description: "The folder to operate on. The 'By URL' option only accepts URLs that start with 'https://onedrive.live.com'.",
|
|
94
|
+
};
|
|
95
|
+
exports.triggerDescription = [
|
|
96
|
+
{
|
|
97
|
+
displayName: 'Trigger On',
|
|
98
|
+
name: 'event',
|
|
99
|
+
type: 'options',
|
|
100
|
+
default: 'fileCreated',
|
|
101
|
+
options: [
|
|
102
|
+
{
|
|
103
|
+
name: 'File Created',
|
|
104
|
+
value: 'fileCreated',
|
|
105
|
+
description: 'When a new file is created',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'File Updated',
|
|
109
|
+
value: 'fileUpdated',
|
|
110
|
+
description: 'When an existing file is modified',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'Folder Created',
|
|
114
|
+
value: 'folderCreated',
|
|
115
|
+
description: 'When a new folder is created',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'Folder Updated',
|
|
119
|
+
value: 'folderUpdated',
|
|
120
|
+
description: 'When an existing folder is modified',
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
displayName: 'Simplify',
|
|
126
|
+
name: 'simple',
|
|
127
|
+
description: 'Whether to return a simplified version of the response instead of the raw data',
|
|
128
|
+
type: 'boolean',
|
|
129
|
+
default: true,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
displayName: 'Watch Folder',
|
|
133
|
+
name: 'watchFolder',
|
|
134
|
+
description: 'Whether to watch for the created file in a given folder, rather than the entire OneDrive',
|
|
135
|
+
type: 'boolean',
|
|
136
|
+
default: false,
|
|
137
|
+
displayOptions: {
|
|
138
|
+
show: {
|
|
139
|
+
event: ['fileCreated'],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
displayName: 'Watch',
|
|
145
|
+
name: 'watch',
|
|
146
|
+
description: 'How to select which file to watch',
|
|
147
|
+
type: 'options',
|
|
148
|
+
default: 'anyFile',
|
|
149
|
+
displayOptions: {
|
|
150
|
+
show: {
|
|
151
|
+
event: ['fileUpdated'],
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
options: [
|
|
155
|
+
{
|
|
156
|
+
name: 'Any File',
|
|
157
|
+
value: 'anyFile',
|
|
158
|
+
description: 'Watch for updated files in the entire OneDrive',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'Inside a Folder',
|
|
162
|
+
value: 'selectedFolder',
|
|
163
|
+
description: 'Watch for updated files inside a selected folder',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'A Selected File',
|
|
167
|
+
value: 'selectedFile',
|
|
168
|
+
description: 'Watch a specific file for updates',
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Watch Folder',
|
|
174
|
+
name: 'watchFolder',
|
|
175
|
+
description: 'Whether to watch for the created folder in a given folder, rather than the entire OneDrive',
|
|
176
|
+
type: 'boolean',
|
|
177
|
+
default: false,
|
|
178
|
+
displayOptions: {
|
|
179
|
+
show: {
|
|
180
|
+
event: ['folderCreated'],
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
displayName: 'Watch',
|
|
186
|
+
name: 'watch',
|
|
187
|
+
description: 'How to select which folder to watch',
|
|
188
|
+
type: 'options',
|
|
189
|
+
default: 'anyFolder',
|
|
190
|
+
displayOptions: {
|
|
191
|
+
show: {
|
|
192
|
+
event: ['folderUpdated'],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
options: [
|
|
196
|
+
{
|
|
197
|
+
name: 'Any Folder',
|
|
198
|
+
value: 'anyFolder',
|
|
199
|
+
description: 'Watch for updated folders in the entire OneDrive',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'Inside a Folder',
|
|
203
|
+
value: 'selectedFolder',
|
|
204
|
+
description: 'Watch for updated folders inside a selected folder',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'A Selected Folder',
|
|
208
|
+
value: 'oneSelectedFolder',
|
|
209
|
+
description: 'Watch a specific folder for updates',
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
...exports.fileRLC,
|
|
215
|
+
displayOptions: {
|
|
216
|
+
show: {
|
|
217
|
+
event: ['fileUpdated'],
|
|
218
|
+
watch: ['selectedFile'],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
...exports.folderRLC,
|
|
224
|
+
displayOptions: {
|
|
225
|
+
show: {
|
|
226
|
+
watch: ['selectedFolder', 'oneSelectedFolder'],
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
...exports.folderRLC,
|
|
232
|
+
displayOptions: {
|
|
233
|
+
show: {
|
|
234
|
+
watchFolder: [true],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
displayName: 'Options',
|
|
240
|
+
name: 'options',
|
|
241
|
+
type: 'collection',
|
|
242
|
+
placeholder: 'Add Option',
|
|
243
|
+
default: {},
|
|
244
|
+
displayOptions: {
|
|
245
|
+
show: {
|
|
246
|
+
watch: ['selectedFolder'],
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
options: [
|
|
250
|
+
{
|
|
251
|
+
displayName: 'Watch Nested Folders',
|
|
252
|
+
name: 'folderChild',
|
|
253
|
+
type: 'boolean',
|
|
254
|
+
default: false,
|
|
255
|
+
description: 'Whether to look for modified files/folders in all nested folders, rather than only direct descendants',
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
displayName: 'Options',
|
|
261
|
+
name: 'options',
|
|
262
|
+
type: 'collection',
|
|
263
|
+
placeholder: 'Add Option',
|
|
264
|
+
default: {},
|
|
265
|
+
displayOptions: {
|
|
266
|
+
show: {
|
|
267
|
+
watchFolder: [true],
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
options: [
|
|
271
|
+
{
|
|
272
|
+
displayName: 'Watch Nested Folders',
|
|
273
|
+
name: 'folderChild',
|
|
274
|
+
type: 'boolean',
|
|
275
|
+
default: false,
|
|
276
|
+
description: 'Whether to look for modified files/folders in all nested folders, rather than only direct descendants',
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
];
|
|
281
|
+
//# sourceMappingURL=TriggerDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriggerDescription.js","sourceRoot":"","sources":["../../../../nodes/Microsoft/OneDrive/TriggerDescription.ts"],"names":[],"mappings":";;;AACA,2CAA+F;AAElF,QAAA,OAAO,GAAoB;IACvC,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;IAClC,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACN;YACC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EACV,wHAAwH;YACzH,YAAY,EAAE;gBACb,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,0CAA8B;aACrC;YACD,UAAU,EAAE;gBACX;oBACC,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE;wBACX,KAAK,EAAE,0CAA8B;wBACrC,YAAY,EAAE,sCAAsC;qBACpD;iBACD;aACD;SACD;QACD;YACC,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2BAA2B;YACxC,UAAU,EAAE;gBACX;oBACC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AAC,gBAAgB,CAAC;aACzB;SACD;QACD,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EACV,uGAAuG;aACxG;SACD;KACD;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,WAAW,EAAE,CAAC,IAAI,CAAC;aACnB;SACD;QACD,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EACV,uGAAuG;aACxG;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MICROSOFT_DRIVE_FOLDER_URL_REGEX = exports.MICROSOFT_DRIVE_FILE_URL_REGEX = void 0;
|
|
4
|
+
exports.MICROSOFT_DRIVE_FILE_URL_REGEX = 'https:\\/\\/onedrive.live.com(?:\\/.*?(?:\\&|\\?)(?:id=|resid=))(.+?)(?:\\&.*)';
|
|
5
|
+
exports.MICROSOFT_DRIVE_FOLDER_URL_REGEX = 'https:\\/\\/onedrive.live.com(?:\\/.*id=)(.+)(?:\\&cid.*)';
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../nodes/Microsoft/OneDrive/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,8BAA8B,GAC1C,gFAAgF,CAAC;AAErE,QAAA,gCAAgC,GAC5C,2DAA2D,CAAC"}
|
|
@@ -211,10 +211,8 @@ class MicrosoftSql {
|
|
|
211
211
|
for (const resolvable of (0, utilities_1.getResolvables)(rawQuery)) {
|
|
212
212
|
rawQuery = rawQuery.replace(resolvable, this.evaluateExpression(resolvable, 0));
|
|
213
213
|
}
|
|
214
|
-
const
|
|
215
|
-
const result =
|
|
216
|
-
? (0, utilities_1.flatten)(queryResult.recordsets)
|
|
217
|
-
: queryResult.recordsets[0];
|
|
214
|
+
const { recordsets } = await pool.request().query(rawQuery);
|
|
215
|
+
const result = recordsets.length > 1 ? (0, utilities_1.flatten)(recordsets) : recordsets[0];
|
|
218
216
|
responseData = result;
|
|
219
217
|
}
|
|
220
218
|
else if (operation === 'insert') {
|