n8n-nodes-steyi-ss 1.0.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/README.md +192 -0
- package/dist/credentials/SteyiSmartsheetCreds.credentials.d.ts +9 -0
- package/dist/credentials/SteyiSmartsheetCreds.credentials.js +38 -0
- package/dist/nodes/SteyiSmartsheet/SteyiGenericFunction.d.ts +3 -0
- package/dist/nodes/SteyiSmartsheet/SteyiGenericFunction.js +58 -0
- package/dist/nodes/SteyiSmartsheet/SteyiSmartsheet.node.d.ts +19 -0
- package/dist/nodes/SteyiSmartsheet/SteyiSmartsheet.node.js +1988 -0
- package/dist/nodes/SteyiSmartsheet/SteyiSmartsheetApi.d.ts +24 -0
- package/dist/nodes/SteyiSmartsheet/SteyiSmartsheetApi.js +174 -0
- package/dist/nodes/SteyiSmartsheet/SteyiSmartsheetTrigger.node.d.ts +17 -0
- package/dist/nodes/SteyiSmartsheet/SteyiSmartsheetTrigger.node.js +173 -0
- package/dist/nodes/SteyiSmartsheet/executors/Admin.d.ts +2 -0
- package/dist/nodes/SteyiSmartsheet/executors/Admin.js +180 -0
- package/dist/nodes/SteyiSmartsheet/executors/Columns.d.ts +2 -0
- package/dist/nodes/SteyiSmartsheet/executors/Columns.js +53 -0
- package/dist/nodes/SteyiSmartsheet/executors/Reports.d.ts +2 -0
- package/dist/nodes/SteyiSmartsheet/executors/Reports.js +27 -0
- package/dist/nodes/SteyiSmartsheet/executors/Rows.d.ts +2 -0
- package/dist/nodes/SteyiSmartsheet/executors/Rows.js +845 -0
- package/dist/nodes/SteyiSmartsheet/executors/Sheets.d.ts +2 -0
- package/dist/nodes/SteyiSmartsheet/executors/Sheets.js +85 -0
- package/dist/nodes/SteyiSmartsheet/executors/Webhooks.d.ts +2 -0
- package/dist/nodes/SteyiSmartsheet/executors/Webhooks.js +67 -0
- package/dist/nodes/SteyiSmartsheet/steyi-smartsheet.svg +6 -0
- package/package.json +56 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeSheetOperation = void 0;
|
|
4
|
+
const SteyiGenericFunction_1 = require("../SteyiGenericFunction");
|
|
5
|
+
async function executeSheetOperation(operation, itemIndex) {
|
|
6
|
+
let responseData;
|
|
7
|
+
// Helper function to get sheetId
|
|
8
|
+
const getSheetId = (index) => {
|
|
9
|
+
return this.getNodeParameter('sheetId', index);
|
|
10
|
+
};
|
|
11
|
+
switch (operation) {
|
|
12
|
+
case 'listSheets':
|
|
13
|
+
case 'fetchAllSheets': {
|
|
14
|
+
const includeAll = operation === 'fetchAllSheets';
|
|
15
|
+
const endpoint = includeAll ? '/sheets?includeAll=true' : '/sheets';
|
|
16
|
+
responseData = await SteyiGenericFunction_1.smartsheetApiRequest.call(this, 'GET', endpoint, {}, itemIndex);
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
case 'getSheet':
|
|
20
|
+
case 'fetchSheet': {
|
|
21
|
+
const sheetId = getSheetId(itemIndex);
|
|
22
|
+
const include = this.getNodeParameter('include', itemIndex, []);
|
|
23
|
+
const includeParam = include.length > 0 ? `?include=${include.join(',')}` : '';
|
|
24
|
+
responseData = await SteyiGenericFunction_1.smartsheetApiRequest.call(this, 'GET', `/sheets/${sheetId}${includeParam}`, {}, itemIndex);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case 'createSheet': {
|
|
28
|
+
const sheetName = this.getNodeParameter('sheetName', itemIndex);
|
|
29
|
+
const workspaceId = this.getNodeParameter('workspaceId', itemIndex, '');
|
|
30
|
+
const folderID = this.getNodeParameter('folderID', itemIndex, '');
|
|
31
|
+
const columnsData = this.getNodeParameter('columns', itemIndex, {});
|
|
32
|
+
let sheetColumns = [];
|
|
33
|
+
if (columnsData.column && Array.isArray(columnsData.column) && columnsData.column.length > 0) {
|
|
34
|
+
sheetColumns = columnsData.column.map((column) => {
|
|
35
|
+
const col = {
|
|
36
|
+
title: column.title || '',
|
|
37
|
+
type: column.type || 'TEXT_NUMBER',
|
|
38
|
+
primary: column.primary || false,
|
|
39
|
+
};
|
|
40
|
+
if (column.options && column.options.option && Array.isArray(column.options.option)) {
|
|
41
|
+
col.options = column.options.option.map((opt) => {
|
|
42
|
+
if (typeof opt === 'string')
|
|
43
|
+
return opt;
|
|
44
|
+
return opt.option || opt;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return col;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// Determine endpoint based on workspace and folder
|
|
51
|
+
let endpoint = '/sheets';
|
|
52
|
+
if (folderID && folderID !== '') {
|
|
53
|
+
// Create in folder
|
|
54
|
+
endpoint = `/folders/${folderID}/sheets`;
|
|
55
|
+
}
|
|
56
|
+
else if (workspaceId && workspaceId !== '') {
|
|
57
|
+
// Create in workspace
|
|
58
|
+
endpoint = `/workspaces/${workspaceId}/sheets`;
|
|
59
|
+
}
|
|
60
|
+
responseData = await SteyiGenericFunction_1.smartsheetApiRequest.call(this, 'POST', endpoint, {
|
|
61
|
+
name: sheetName,
|
|
62
|
+
columns: sheetColumns,
|
|
63
|
+
}, itemIndex);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 'updateSheet': {
|
|
67
|
+
const sheetId = getSheetId(itemIndex);
|
|
68
|
+
const sheetName = this.getNodeParameter('sheetName', itemIndex);
|
|
69
|
+
responseData = await SteyiGenericFunction_1.smartsheetApiRequest.call(this, 'PUT', `/sheets/${sheetId}`, { name: sheetName }, itemIndex);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case 'deleteSheet': {
|
|
73
|
+
const sheetId = getSheetId(itemIndex);
|
|
74
|
+
responseData = await SteyiGenericFunction_1.smartsheetApiRequest.call(this, 'DELETE', `/sheets/${sheetId}`, {}, itemIndex);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
default:
|
|
78
|
+
throw new Error(`Unknown sheet operation: ${operation}`);
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
json: responseData,
|
|
82
|
+
pairedItem: { item: itemIndex },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
exports.executeSheetOperation = executeSheetOperation;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeWebhookOperation = void 0;
|
|
4
|
+
const SteyiSmartsheetApi_1 = require("../SteyiSmartsheetApi");
|
|
5
|
+
async function executeWebhookOperation(operation, itemIndex) {
|
|
6
|
+
let responseData;
|
|
7
|
+
switch (operation) {
|
|
8
|
+
case 'listWebhooks': {
|
|
9
|
+
responseData = await SteyiSmartsheetApi_1.listWebhooks.call(this);
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
case 'createWebhook': {
|
|
13
|
+
const sheetId = this.getNodeParameter('sheetId', itemIndex);
|
|
14
|
+
const webhookName = this.getNodeParameter('webhookName', itemIndex, '');
|
|
15
|
+
let callbackUrl = this.getNodeParameter('callbackUrl', itemIndex, '');
|
|
16
|
+
const events = this.getNodeParameter('events', itemIndex, ['*.*']);
|
|
17
|
+
// Auto-generate callback URL if not provided
|
|
18
|
+
// The default expression in the UI will handle this, but we also check here as fallback
|
|
19
|
+
if (!callbackUrl || callbackUrl.trim() === '' || callbackUrl.includes('{{')) {
|
|
20
|
+
// If the expression wasn't evaluated, use a simple default
|
|
21
|
+
// User should configure WEBHOOK_URL in n8n settings or provide the URL manually
|
|
22
|
+
const workflowId = this.getWorkflow().id;
|
|
23
|
+
callbackUrl = `https://your-n8n-instance.com/webhook/${workflowId}`;
|
|
24
|
+
}
|
|
25
|
+
const body = {
|
|
26
|
+
name: webhookName || `n8n - Webhook [Sheet ID: ${sheetId}]`,
|
|
27
|
+
callbackUrl,
|
|
28
|
+
events,
|
|
29
|
+
version: 1,
|
|
30
|
+
scopeObjectId: parseInt(sheetId.toString()),
|
|
31
|
+
scope: 'sheet',
|
|
32
|
+
};
|
|
33
|
+
responseData = await SteyiSmartsheetApi_1.createWebhook.call(this, body);
|
|
34
|
+
// Enable the webhook after creation
|
|
35
|
+
if (responseData && responseData.result && responseData.result.id) {
|
|
36
|
+
await SteyiSmartsheetApi_1.updateWebhook.call(this, responseData.result.id, { enabled: true });
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case 'updateWebhook': {
|
|
41
|
+
const webhookId = this.getNodeParameter('webhookId', itemIndex);
|
|
42
|
+
const updateFields = this.getNodeParameter('updateFields', itemIndex, {});
|
|
43
|
+
const body = {};
|
|
44
|
+
if (updateFields.name)
|
|
45
|
+
body.name = updateFields.name;
|
|
46
|
+
if (updateFields.enabled !== undefined)
|
|
47
|
+
body.enabled = updateFields.enabled;
|
|
48
|
+
if (updateFields.events)
|
|
49
|
+
body.events = updateFields.events;
|
|
50
|
+
responseData = await SteyiSmartsheetApi_1.updateWebhook.call(this, parseInt(webhookId.toString()), body);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case 'deleteWebhook': {
|
|
54
|
+
const webhookId = this.getNodeParameter('webhookId', itemIndex);
|
|
55
|
+
await SteyiSmartsheetApi_1.deleteWebhook.call(this, parseInt(webhookId.toString()));
|
|
56
|
+
responseData = { success: true, message: 'Webhook deleted successfully' };
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
default:
|
|
60
|
+
throw new Error(`Unknown webhook operation: ${operation}`);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
json: responseData,
|
|
64
|
+
pairedItem: { item: itemIndex },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
exports.executeWebhookOperation = executeWebhookOperation;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="512" height="512">
|
|
3
|
+
<path d="M0 0 C0.91942383 0.00215515 1.83884766 0.0043103 2.78613281 0.00653076 C17.16224508 0.06044742 31.22198153 0.58373081 45.375 3.3125 C46.39303711 3.50585938 47.41107422 3.69921875 48.45996094 3.8984375 C90.02807788 12.06833128 129.85914842 29.95709944 162.375 57.3125 C162.8817627 57.73047852 163.38852539 58.14845703 163.91064453 58.57910156 C177.2990106 69.62618156 189.74724574 81.55193758 200.375 95.3125 C201.53515625 96.74722656 201.53515625 96.74722656 202.71875 98.2109375 C228.78985813 130.96482967 245.54540798 170.34619201 253.375 211.3125 C253.54161133 212.18277832 253.70822266 213.05305664 253.87988281 213.94970703 C258.90043983 241.8018448 258.73054304 273.53547151 253.375 301.3125 C253.18164062 302.33053711 252.98828125 303.34857422 252.7890625 304.39746094 C243.95402349 349.34981219 223.72875786 391.00355551 193.375 425.3125 C192.62734375 426.17101562 191.8796875 427.02953125 191.109375 427.9140625 C181.95378658 438.28820046 172.29277114 447.79573247 161.375 456.3125 C160.39144531 457.10140625 159.40789062 457.8903125 158.39453125 458.703125 C136.05889962 476.47450356 110.44657601 490.29756877 83.375 499.3125 C82.56579102 499.58497559 81.75658203 499.85745117 80.92285156 500.13818359 C71.16673129 503.37269772 61.2987 505.91132613 51.25 508.0625 C50.33371826 508.26125732 49.41743652 508.46001465 48.47338867 508.66479492 C32.65215882 511.89042887 16.85752368 512.69335755 0.75 512.625 C-0.16942383 512.62284485 -1.08884766 512.6206897 -2.03613281 512.61846924 C-16.41224508 512.56455258 -30.47198153 512.04126919 -44.625 509.3125 C-45.64303711 509.11914062 -46.66107422 508.92578125 -47.70996094 508.7265625 C-89.27807788 500.55666872 -129.10914842 482.66790056 -161.625 455.3125 C-162.38514404 454.68553223 -162.38514404 454.68553223 -163.16064453 454.04589844 C-176.5490106 442.99881844 -188.99724574 431.07306242 -199.625 417.3125 C-200.78515625 415.87777344 -200.78515625 415.87777344 -201.96875 414.4140625 C-228.03985813 381.66017033 -244.79540798 342.27880799 -252.625 301.3125 C-252.79161133 300.44222168 -252.95822266 299.57194336 -253.12988281 298.67529297 C-258.15043983 270.8231552 -257.98054304 239.08952849 -252.625 211.3125 C-252.43164062 210.29446289 -252.23828125 209.27642578 -252.0390625 208.22753906 C-243.20402349 163.27518781 -222.97875786 121.62144449 -192.625 87.3125 C-191.87734375 86.45398438 -191.1296875 85.59546875 -190.359375 84.7109375 C-181.20378658 74.33679954 -171.54277114 64.82926753 -160.625 56.3125 C-159.64144531 55.52359375 -158.65789062 54.7346875 -157.64453125 53.921875 C-135.30889962 36.15049644 -109.69657601 22.32743123 -82.625 13.3125 C-81.81579102 13.04002441 -81.00658203 12.76754883 -80.17285156 12.48681641 C-70.41673129 9.25230228 -60.5487 6.71367387 -50.5 4.5625 C-49.58371826 4.36374268 -48.66743652 4.16498535 -47.72338867 3.96020508 C-31.90215882 0.73457113 -16.10752368 -0.06835755 0 0 Z " fill="#034D20" transform="translate(255.625,-0.3125)"/>
|
|
4
|
+
<path d="M0 0 C66 0 132 0 200 0 C193.26172811 7.8613172 193.26172811 7.8613172 189.94140625 11.12109375 C189.22533203 11.82943359 188.50925781 12.53777344 187.77148438 13.26757812 C186.30276891 14.71032161 184.83401909 16.15303014 183.36523438 17.59570312 C179.24210554 21.67437774 175.30297597 25.83611214 171.52124023 30.23364258 C169.64659245 32.41035206 167.69900398 34.51485789 165.75 36.625 C160.65056147 42.27853712 155.99170907 48.2371607 151.34667969 54.26367188 C150.1016976 55.86887721 148.83684535 57.45861837 147.5703125 59.046875 C130.78217682 80.29349917 113.51608956 105.45940728 104 131 C103.34 131 102.68 131 102 131 C101.74943848 130.49251221 101.49887695 129.98502441 101.24072266 129.4621582 C93.4795741 113.88178447 85.10582156 98.17382018 69.625 89 C61.50796032 86.76081664 54.76672593 87.24941376 47.37109375 91.35546875 C43.42236117 94.09421078 40.18215293 97.41785579 37 101 C37.75023437 101.25652344 38.50046875 101.51304687 39.2734375 101.77734375 C57.30982627 108.52395265 66.23749446 123.73668566 75 140 C75.93779297 141.71509766 75.93779297 141.71509766 76.89453125 143.46484375 C97 181.34068716 97 181.34068716 97 197 C97.66 197 98.32 197 99 197 C99.14767822 196.42967041 99.29535645 195.85934082 99.44750977 195.27172852 C101.52629322 187.7811068 104.60801163 180.94707788 107.9375 173.9375 C108.52005075 172.70015735 109.10215519 171.46260448 109.68383789 170.22485352 C111.16493116 167.07855002 112.65520666 163.93668827 114.14794922 160.79589844 C115.44864154 158.05438189 116.73887385 155.30794457 118.03125 152.5625 C129.28819093 128.7620028 141.46145778 105.58182119 155 83 C155.58281738 82.02015137 156.16563477 81.04030273 156.76611328 80.03076172 C167.77050652 61.54228763 179.59677417 43.85195455 192.6796875 26.77148438 C194.07750339 24.89601247 195.39557933 22.97553167 196.71875 21.046875 C197.4715625 20.04140625 198.224375 19.0359375 199 18 C199.66 18 200.32 18 201 18 C201.02349041 38.05575799 201.04105771 58.11151315 201.05181217 78.1672821 C201.05694115 87.48213159 201.06391805 96.79697246 201.07543945 106.11181641 C201.08549122 114.24244506 201.09187805 122.37306747 201.09408849 130.50370216 C201.09537802 134.7980489 201.09834977 139.0923778 201.10573006 143.38671875 C201.21477523 209.521949 201.21477523 209.521949 195 220 C192 222 192 222 189.375 222.125 C174.45371998 217.15123999 166.9118718 197.79480535 160 185 C159.42636719 185.51046875 158.85273438 186.0209375 158.26171875 186.546875 C119.44876199 219.76464072 66.49937449 236.03209092 17.5 246.875 C16.58726318 247.07826904 15.67452637 247.28153809 14.73413086 247.4909668 C8.84024092 248.74931094 3.00308743 249.50102637 -3 250 C-2.85932413 249.25915098 -2.71864826 248.51830196 -2.57370949 247.75500298 C-0.61765874 236.09296133 -0.69201465 224.54083946 -0.68115234 212.74658203 C-0.67183975 210.41941993 -0.66166913 208.09226113 -0.65071106 205.7651062 C-0.62354707 199.48515077 -0.60830218 193.2052176 -0.59528303 186.92521906 C-0.57959267 180.34822205 -0.55282142 173.7712701 -0.5272522 167.19430542 C-0.48554075 156.16747529 -0.45124015 145.14063908 -0.421875 134.11376953 C-0.39162813 122.76283996 -0.3572277 111.41193526 -0.31738281 100.06103516 C-0.3149013 99.35265641 -0.3124198 98.64427766 -0.30986309 97.91443288 C-0.28823724 91.7512564 -0.2662996 85.58808104 -0.24433136 79.42490578 C-0.15036636 52.94996531 -0.0768564 26.47500847 0 0 Z " fill="#FDFEFD" transform="translate(157,140)"/>
|
|
5
|
+
<path d="M0 0 C-1.55500981 3.81684226 -4.03595495 6.19195732 -7 9 C-7.99 8.67 -8.98 8.34 -10 8 C-8.71451591 6.66070495 -7.42141845 5.32871357 -6.125 4 C-5.04605469 2.88625 -5.04605469 2.88625 -3.9453125 1.75 C-2 0 -2 0 0 0 Z " fill="#002E19" transform="translate(203,233)"/>
|
|
6
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-steyi-ss",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "n8n node for Smartsheet API integration",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-node-package",
|
|
7
|
+
"smartsheet"
|
|
8
|
+
],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"homepage": "",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "",
|
|
13
|
+
"email": ""
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": ""
|
|
18
|
+
},
|
|
19
|
+
"main": "index.js",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc && gulp build:icons",
|
|
22
|
+
"dev": "tsc --watch",
|
|
23
|
+
"format": "prettier nodes credentials --write",
|
|
24
|
+
"lint": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\" package.json",
|
|
25
|
+
"lintfix": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\" package.json --fix",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"n8n": {
|
|
32
|
+
"n8nNodesApiVersion": 1,
|
|
33
|
+
"nodes": [
|
|
34
|
+
"dist/nodes/SteyiSmartsheet/SteyiSmartsheet.node.js",
|
|
35
|
+
"dist/nodes/SteyiSmartsheet/SteyiSmartsheetTrigger.node.js"
|
|
36
|
+
],
|
|
37
|
+
"credentials": [
|
|
38
|
+
"dist/credentials/SteyiSmartsheetCreds.credentials.js"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
43
|
+
"eslint-plugin-n8n-nodes-base": "~1.11.0",
|
|
44
|
+
"gulp": "^4.0.2",
|
|
45
|
+
"n8n-workflow": "*",
|
|
46
|
+
"prettier": "^2.7.1",
|
|
47
|
+
"typescript": "~5.3.0"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"n8n-workflow": "*"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"n8n-workflow": "*"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|