n8n-nodes-smartsuite 2.0.6

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.
Files changed (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +163 -0
  3. package/dist/credentials/SmartSuiteApi.credentials.d.ts +8 -0
  4. package/dist/credentials/SmartSuiteApi.credentials.js +38 -0
  5. package/dist/credentials/SmartSuiteApi.credentials.js.map +1 -0
  6. package/dist/credentials/SmartSuiteApi.svg +6 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +12 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/nodes/SmartSuite/SmartSuite.node.d.ts +27 -0
  11. package/dist/nodes/SmartSuite/SmartSuite.node.js +108 -0
  12. package/dist/nodes/SmartSuite/SmartSuite.node.js.map +1 -0
  13. package/dist/nodes/SmartSuite/SmartSuite.node.json +48 -0
  14. package/dist/nodes/SmartSuite/SmartSuiteTrigger.node.d.ts +23 -0
  15. package/dist/nodes/SmartSuite/SmartSuiteTrigger.node.js +173 -0
  16. package/dist/nodes/SmartSuite/SmartSuiteTrigger.node.js.map +1 -0
  17. package/dist/nodes/SmartSuite/SmartSuiteTrigger.node.json +14 -0
  18. package/dist/nodes/SmartSuite/__tests__/actions/api/makeApiRequest.test.d.ts +1 -0
  19. package/dist/nodes/SmartSuite/__tests__/actions/api/makeApiRequest.test.js +74 -0
  20. package/dist/nodes/SmartSuite/__tests__/actions/api/makeApiRequest.test.js.map +1 -0
  21. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/getCurrentUser.test.d.ts +1 -0
  22. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/getCurrentUser.test.js +22 -0
  23. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/getCurrentUser.test.js.map +1 -0
  24. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/listMembers.test.d.ts +1 -0
  25. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/listMembers.test.js +70 -0
  26. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/listMembers.test.js.map +1 -0
  27. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/listTeams.test.d.ts +1 -0
  28. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/listTeams.test.js +43 -0
  29. package/dist/nodes/SmartSuite/__tests__/actions/orgManagement/listTeams.test.js.map +1 -0
  30. package/dist/nodes/SmartSuite/__tests__/actions/record/createRecord.test.d.ts +1 -0
  31. package/dist/nodes/SmartSuite/__tests__/actions/record/createRecord.test.js +178 -0
  32. package/dist/nodes/SmartSuite/__tests__/actions/record/createRecord.test.js.map +1 -0
  33. package/dist/nodes/SmartSuite/__tests__/actions/record/deleteRecord.test.d.ts +1 -0
  34. package/dist/nodes/SmartSuite/__tests__/actions/record/deleteRecord.test.js +159 -0
  35. package/dist/nodes/SmartSuite/__tests__/actions/record/deleteRecord.test.js.map +1 -0
  36. package/dist/nodes/SmartSuite/__tests__/actions/record/getRecord.test.d.ts +1 -0
  37. package/dist/nodes/SmartSuite/__tests__/actions/record/getRecord.test.js +127 -0
  38. package/dist/nodes/SmartSuite/__tests__/actions/record/getRecord.test.js.map +1 -0
  39. package/dist/nodes/SmartSuite/__tests__/actions/record/listRecord.test.d.ts +1 -0
  40. package/dist/nodes/SmartSuite/__tests__/actions/record/listRecord.test.js +162 -0
  41. package/dist/nodes/SmartSuite/__tests__/actions/record/listRecord.test.js.map +1 -0
  42. package/dist/nodes/SmartSuite/__tests__/actions/record/searchRecord.test.d.ts +1 -0
  43. package/dist/nodes/SmartSuite/__tests__/actions/record/searchRecord.test.js +210 -0
  44. package/dist/nodes/SmartSuite/__tests__/actions/record/searchRecord.test.js.map +1 -0
  45. package/dist/nodes/SmartSuite/__tests__/actions/record/updateRecord.test.d.ts +1 -0
  46. package/dist/nodes/SmartSuite/__tests__/actions/record/updateRecord.test.js +198 -0
  47. package/dist/nodes/SmartSuite/__tests__/actions/record/updateRecord.test.js.map +1 -0
  48. package/dist/nodes/SmartSuite/__tests__/actions/record/upsertRecord.test.d.ts +1 -0
  49. package/dist/nodes/SmartSuite/__tests__/actions/record/upsertRecord.test.js +138 -0
  50. package/dist/nodes/SmartSuite/__tests__/actions/record/upsertRecord.test.js.map +1 -0
  51. package/dist/nodes/SmartSuite/__tests__/actions/solution/getSolution.test.d.ts +1 -0
  52. package/dist/nodes/SmartSuite/__tests__/actions/solution/getSolution.test.js +57 -0
  53. package/dist/nodes/SmartSuite/__tests__/actions/solution/getSolution.test.js.map +1 -0
  54. package/dist/nodes/SmartSuite/__tests__/actions/solution/listSolution.test.d.ts +1 -0
  55. package/dist/nodes/SmartSuite/__tests__/actions/solution/listSolution.test.js +48 -0
  56. package/dist/nodes/SmartSuite/__tests__/actions/solution/listSolution.test.js.map +1 -0
  57. package/dist/nodes/SmartSuite/__tests__/actions/table/createTable.test.d.ts +1 -0
  58. package/dist/nodes/SmartSuite/__tests__/actions/table/createTable.test.js +50 -0
  59. package/dist/nodes/SmartSuite/__tests__/actions/table/createTable.test.js.map +1 -0
  60. package/dist/nodes/SmartSuite/__tests__/actions/table/createTableField.test.d.ts +1 -0
  61. package/dist/nodes/SmartSuite/__tests__/actions/table/createTableField.test.js +93 -0
  62. package/dist/nodes/SmartSuite/__tests__/actions/table/createTableField.test.js.map +1 -0
  63. package/dist/nodes/SmartSuite/__tests__/actions/table/getTable.test.d.ts +1 -0
  64. package/dist/nodes/SmartSuite/__tests__/actions/table/getTable.test.js +70 -0
  65. package/dist/nodes/SmartSuite/__tests__/actions/table/getTable.test.js.map +1 -0
  66. package/dist/nodes/SmartSuite/__tests__/actions/table/listTable.test.d.ts +1 -0
  67. package/dist/nodes/SmartSuite/__tests__/actions/table/listTable.test.js +78 -0
  68. package/dist/nodes/SmartSuite/__tests__/actions/table/listTable.test.js.map +1 -0
  69. package/dist/nodes/SmartSuite/__tests__/helpers/mockResourceInputs.d.ts +10 -0
  70. package/dist/nodes/SmartSuite/__tests__/helpers/mockResourceInputs.js +26 -0
  71. package/dist/nodes/SmartSuite/__tests__/helpers/mockResourceInputs.js.map +1 -0
  72. package/dist/nodes/SmartSuite/actions/api/ApiRequestDescription.d.ts +2 -0
  73. package/dist/nodes/SmartSuite/actions/api/ApiRequestDescription.js +185 -0
  74. package/dist/nodes/SmartSuite/actions/api/ApiRequestDescription.js.map +1 -0
  75. package/dist/nodes/SmartSuite/actions/api/makeApiRequest.operation.d.ts +3 -0
  76. package/dist/nodes/SmartSuite/actions/api/makeApiRequest.operation.js +65 -0
  77. package/dist/nodes/SmartSuite/actions/api/makeApiRequest.operation.js.map +1 -0
  78. package/dist/nodes/SmartSuite/actions/orgManagement/OrgManagementDescription.d.ts +2 -0
  79. package/dist/nodes/SmartSuite/actions/orgManagement/OrgManagementDescription.js +21 -0
  80. package/dist/nodes/SmartSuite/actions/orgManagement/OrgManagementDescription.js.map +1 -0
  81. package/dist/nodes/SmartSuite/actions/orgManagement/getCurrentUser.operation.d.ts +18 -0
  82. package/dist/nodes/SmartSuite/actions/orgManagement/getCurrentUser.operation.js +39 -0
  83. package/dist/nodes/SmartSuite/actions/orgManagement/getCurrentUser.operation.js.map +1 -0
  84. package/dist/nodes/SmartSuite/actions/orgManagement/listMembers.operation.d.ts +18 -0
  85. package/dist/nodes/SmartSuite/actions/orgManagement/listMembers.operation.js +41 -0
  86. package/dist/nodes/SmartSuite/actions/orgManagement/listMembers.operation.js.map +1 -0
  87. package/dist/nodes/SmartSuite/actions/orgManagement/listTeams.operation.d.ts +18 -0
  88. package/dist/nodes/SmartSuite/actions/orgManagement/listTeams.operation.js +41 -0
  89. package/dist/nodes/SmartSuite/actions/orgManagement/listTeams.operation.js.map +1 -0
  90. package/dist/nodes/SmartSuite/actions/record/RecordDescription.d.ts +2 -0
  91. package/dist/nodes/SmartSuite/actions/record/RecordDescription.js +370 -0
  92. package/dist/nodes/SmartSuite/actions/record/RecordDescription.js.map +1 -0
  93. package/dist/nodes/SmartSuite/actions/record/createRecord.operation.d.ts +87 -0
  94. package/dist/nodes/SmartSuite/actions/record/createRecord.operation.js +55 -0
  95. package/dist/nodes/SmartSuite/actions/record/createRecord.operation.js.map +1 -0
  96. package/dist/nodes/SmartSuite/actions/record/deleteRecord.operation.d.ts +24 -0
  97. package/dist/nodes/SmartSuite/actions/record/deleteRecord.operation.js +49 -0
  98. package/dist/nodes/SmartSuite/actions/record/deleteRecord.operation.js.map +1 -0
  99. package/dist/nodes/SmartSuite/actions/record/getRecord.operation.d.ts +2 -0
  100. package/dist/nodes/SmartSuite/actions/record/getRecord.operation.js +31 -0
  101. package/dist/nodes/SmartSuite/actions/record/getRecord.operation.js.map +1 -0
  102. package/dist/nodes/SmartSuite/actions/record/listRecord.operation.d.ts +2 -0
  103. package/dist/nodes/SmartSuite/actions/record/listRecord.operation.js +52 -0
  104. package/dist/nodes/SmartSuite/actions/record/listRecord.operation.js.map +1 -0
  105. package/dist/nodes/SmartSuite/actions/record/searchRecord.operation.d.ts +2 -0
  106. package/dist/nodes/SmartSuite/actions/record/searchRecord.operation.js +77 -0
  107. package/dist/nodes/SmartSuite/actions/record/searchRecord.operation.js.map +1 -0
  108. package/dist/nodes/SmartSuite/actions/record/updateRecord.operation.d.ts +2 -0
  109. package/dist/nodes/SmartSuite/actions/record/updateRecord.operation.js +42 -0
  110. package/dist/nodes/SmartSuite/actions/record/updateRecord.operation.js.map +1 -0
  111. package/dist/nodes/SmartSuite/actions/record/upsertRecord.operation.d.ts +2 -0
  112. package/dist/nodes/SmartSuite/actions/record/upsertRecord.operation.js +66 -0
  113. package/dist/nodes/SmartSuite/actions/record/upsertRecord.operation.js.map +1 -0
  114. package/dist/nodes/SmartSuite/actions/solution/SolutionDescription.d.ts +2 -0
  115. package/dist/nodes/SmartSuite/actions/solution/SolutionDescription.js +54 -0
  116. package/dist/nodes/SmartSuite/actions/solution/SolutionDescription.js.map +1 -0
  117. package/dist/nodes/SmartSuite/actions/solution/getSolution.operation.d.ts +3 -0
  118. package/dist/nodes/SmartSuite/actions/solution/getSolution.operation.js +25 -0
  119. package/dist/nodes/SmartSuite/actions/solution/getSolution.operation.js.map +1 -0
  120. package/dist/nodes/SmartSuite/actions/solution/listSolution.operation.d.ts +3 -0
  121. package/dist/nodes/SmartSuite/actions/solution/listSolution.operation.js +54 -0
  122. package/dist/nodes/SmartSuite/actions/solution/listSolution.operation.js.map +1 -0
  123. package/dist/nodes/SmartSuite/actions/table/TableDescription.d.ts +6 -0
  124. package/dist/nodes/SmartSuite/actions/table/TableDescription.js +153 -0
  125. package/dist/nodes/SmartSuite/actions/table/TableDescription.js.map +1 -0
  126. package/dist/nodes/SmartSuite/actions/table/createTable.operation.d.ts +2 -0
  127. package/dist/nodes/SmartSuite/actions/table/createTable.operation.js +45 -0
  128. package/dist/nodes/SmartSuite/actions/table/createTable.operation.js.map +1 -0
  129. package/dist/nodes/SmartSuite/actions/table/createTableField.operation.d.ts +2 -0
  130. package/dist/nodes/SmartSuite/actions/table/createTableField.operation.js +49 -0
  131. package/dist/nodes/SmartSuite/actions/table/createTableField.operation.js.map +1 -0
  132. package/dist/nodes/SmartSuite/actions/table/getTable.operation.d.ts +2 -0
  133. package/dist/nodes/SmartSuite/actions/table/getTable.operation.js +23 -0
  134. package/dist/nodes/SmartSuite/actions/table/getTable.operation.js.map +1 -0
  135. package/dist/nodes/SmartSuite/actions/table/listTable.operation.d.ts +2 -0
  136. package/dist/nodes/SmartSuite/actions/table/listTable.operation.js +42 -0
  137. package/dist/nodes/SmartSuite/actions/table/listTable.operation.js.map +1 -0
  138. package/dist/nodes/SmartSuite/helpers/getFilterOptions.d.ts +11 -0
  139. package/dist/nodes/SmartSuite/helpers/getFilterOptions.js +376 -0
  140. package/dist/nodes/SmartSuite/helpers/getFilterOptions.js.map +1 -0
  141. package/dist/nodes/SmartSuite/helpers/getValidFilters.d.ts +6 -0
  142. package/dist/nodes/SmartSuite/helpers/getValidFilters.js +47 -0
  143. package/dist/nodes/SmartSuite/helpers/getValidFilters.js.map +1 -0
  144. package/dist/nodes/SmartSuite/helpers/utils.d.ts +21 -0
  145. package/dist/nodes/SmartSuite/helpers/utils.js +62 -0
  146. package/dist/nodes/SmartSuite/helpers/utils.js.map +1 -0
  147. package/dist/nodes/SmartSuite/helpers/validation.d.ts +9 -0
  148. package/dist/nodes/SmartSuite/helpers/validation.js +41 -0
  149. package/dist/nodes/SmartSuite/helpers/validation.js.map +1 -0
  150. package/dist/nodes/SmartSuite/index.d.ts +2 -0
  151. package/dist/nodes/SmartSuite/index.js +12 -0
  152. package/dist/nodes/SmartSuite/index.js.map +1 -0
  153. package/dist/nodes/SmartSuite/methods/listSearch.d.ts +11 -0
  154. package/dist/nodes/SmartSuite/methods/listSearch.js +81 -0
  155. package/dist/nodes/SmartSuite/methods/listSearch.js.map +1 -0
  156. package/dist/nodes/SmartSuite/methods/loadOptions.d.ts +30 -0
  157. package/dist/nodes/SmartSuite/methods/loadOptions.js +133 -0
  158. package/dist/nodes/SmartSuite/methods/loadOptions.js.map +1 -0
  159. package/dist/nodes/SmartSuite/methods/resourceMapping.d.ts +48 -0
  160. package/dist/nodes/SmartSuite/methods/resourceMapping.js +122 -0
  161. package/dist/nodes/SmartSuite/methods/resourceMapping.js.map +1 -0
  162. package/dist/nodes/SmartSuite/methods/router.d.ts +2 -0
  163. package/dist/nodes/SmartSuite/methods/router.js +65 -0
  164. package/dist/nodes/SmartSuite/methods/router.js.map +1 -0
  165. package/dist/nodes/SmartSuite/shared/__testHelpers__/mockExecuteFunctions.d.ts +9 -0
  166. package/dist/nodes/SmartSuite/shared/__testHelpers__/mockExecuteFunctions.js +84 -0
  167. package/dist/nodes/SmartSuite/shared/__testHelpers__/mockExecuteFunctions.js.map +1 -0
  168. package/dist/nodes/SmartSuite/shared/resourceInputs.d.ts +15 -0
  169. package/dist/nodes/SmartSuite/shared/resourceInputs.js +112 -0
  170. package/dist/nodes/SmartSuite/shared/resourceInputs.js.map +1 -0
  171. package/dist/nodes/SmartSuite/smartsuite.svg +6 -0
  172. package/dist/nodes/SmartSuite/transport/smartSuiteApi.d.ts +12 -0
  173. package/dist/nodes/SmartSuite/transport/smartSuiteApi.js +111 -0
  174. package/dist/nodes/SmartSuite/transport/smartSuiteApi.js.map +1 -0
  175. package/dist/nodes/SmartSuite/types.d.ts +11 -0
  176. package/dist/nodes/SmartSuite/types.js +4 -0
  177. package/dist/nodes/SmartSuite/types.js.map +1 -0
  178. package/package.json +99 -0
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // src/nodes/SmartSuite/actions/solution/getSolution.operation.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.description = void 0;
5
+ exports.execute = execute;
6
+ const smartSuiteApi_1 = require("../../transport/smartSuiteApi");
7
+ const validation_1 = require("../../helpers/validation");
8
+ const resourceInputs_1 = require("../../shared/resourceInputs");
9
+ exports.description = [
10
+ {
11
+ ...resourceInputs_1.solutionInput,
12
+ required: true,
13
+ displayOptions: { show: { resource: ['solution'], operation: ['getSolution'] } },
14
+ description: 'The Solution to retrieve',
15
+ },
16
+ ];
17
+ async function execute() {
18
+ // 1) Validate & get solutionId
19
+ const solutionId = await validation_1.getSolutionId.call(this, 0);
20
+ // 2) Fetch solution data
21
+ const response = (await smartSuiteApi_1.apiRequest.call(this, 'GET', `/solutions/${solutionId}/`));
22
+ // 3) Return the single solution object
23
+ return this.helpers.returnJsonArray([response]);
24
+ }
25
+ //# sourceMappingURL=getSolution.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSolution.operation.js","sourceRoot":"","sources":["../../../../../src/nodes/SmartSuite/actions/solution/getSolution.operation.ts"],"names":[],"mappings":";AAAA,iEAAiE;;;AAqBjE,0BAeC;AA5BD,iEAA2D;AAC3D,yDAAyD;AACzD,gEAA4D;AAE/C,QAAA,WAAW,GAAsB;IAC5C;QACE,GAAG,8BAAa;QAChB,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE;QAChF,WAAW,EAAE,0BAA0B;KACxC;CACF,CAAC;AAEK,KAAK,UAAU,OAAO;IAG3B,+BAA+B;IAC/B,MAAM,UAAU,GAAG,MAAM,0BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAErD,yBAAyB;IACzB,MAAM,QAAQ,GAAG,CAAC,MAAM,0BAAU,CAAC,IAAI,CACrC,IAAI,EACJ,KAAK,EACL,cAAc,UAAU,GAAG,CAC5B,CAAgB,CAAC;IAElB,uCAAuC;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // src/nodes/SmartSuite/actions/solution/listSolution.operation.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.description = void 0;
5
+ exports.execute = execute;
6
+ const smartSuiteApi_1 = require("../../transport/smartSuiteApi");
7
+ exports.description = [
8
+ {
9
+ displayName: 'Return All',
10
+ name: 'returnAll',
11
+ type: 'boolean',
12
+ default: false,
13
+ description: 'Return all solutions (paginated)',
14
+ displayOptions: {
15
+ show: { resource: ['solution'], operation: ['listSolution'] },
16
+ },
17
+ },
18
+ {
19
+ displayName: 'Limit',
20
+ name: 'limit',
21
+ type: 'number',
22
+ default: 50,
23
+ typeOptions: { minValue: 1, maxValue: 1000 },
24
+ description: 'Max number of results to return when not returning all',
25
+ displayOptions: {
26
+ show: {
27
+ resource: ['solution'],
28
+ operation: ['listSolution'],
29
+ returnAll: [false],
30
+ },
31
+ },
32
+ },
33
+ ];
34
+ async function execute() {
35
+ const returnAll = this.getNodeParameter('returnAll', 0);
36
+ const limit = this.getNodeParameter('limit', 0, 50);
37
+ const endpoint = '/solutions/';
38
+ if (returnAll) {
39
+ // Use native paginatedRequest helper for all pages
40
+ const allResults = await smartSuiteApi_1.paginatedRequest.call(this, 'GET', endpoint, {}, { limit, offset: 0 });
41
+ return this.helpers.returnJsonArray(allResults);
42
+ }
43
+ else {
44
+ // Single-page mode via apiRequest
45
+ const qs = { limit, offset: 0 };
46
+ const resp = (await smartSuiteApi_1.apiRequest.call(this, 'GET', endpoint, {}, qs));
47
+ const pageItems = Array.isArray(resp)
48
+ ? resp
49
+ : resp.response ?? resp.results ?? resp.items ?? resp.solutions ?? [];
50
+ const limited = pageItems.slice(0, limit);
51
+ return this.helpers.returnJsonArray(limited);
52
+ }
53
+ }
54
+ //# sourceMappingURL=listSolution.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listSolution.operation.js","sourceRoot":"","sources":["../../../../../src/nodes/SmartSuite/actions/solution/listSolution.operation.ts"],"names":[],"mappings":";AAAA,kEAAkE;;;AAsClE,0BAoCC;AAlED,iEAA6E;AAEhE,QAAA,WAAW,GAAsB;IAC5C;QACE,WAAW,EAAE,YAAY;QACzB,IAAI,EAAS,WAAW;QACxB,IAAI,EAAS,SAAS;QACtB,OAAO,EAAM,KAAK;QAClB,WAAW,EAAE,kCAAkC;QAC/C,cAAc,EAAE;YACd,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,cAAc,CAAC,EAAE;SAC9D;KACF;IACD;QACE,WAAW,EAAE,OAAO;QACpB,IAAI,EAAS,OAAO;QACpB,IAAI,EAAS,QAAQ;QACrB,OAAO,EAAM,EAAE;QACf,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5C,WAAW,EAAE,wDAAwD;QACrE,cAAc,EAAE;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAI,CAAC,UAAU,CAAC;gBACxB,SAAS,EAAG,CAAC,cAA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{ INodeProperties } from 'n8n-workflow';
2
+ /**
3
+ * Table operations and fields for SmartSuite node
4
+ */
5
+ export declare const tableOperations: INodeProperties[];
6
+ export declare const tableFields: INodeProperties[];
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ // src/nodes/SmartSuite/actions/table/TableDescription.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.tableFields = exports.tableOperations = void 0;
5
+ const resourceInputs_1 = require("../../shared/resourceInputs");
6
+ /**
7
+ * Table operations and fields for SmartSuite node
8
+ */
9
+ exports.tableOperations = [
10
+ {
11
+ displayName: 'Operation',
12
+ name: 'operation',
13
+ type: 'options',
14
+ noDataExpression: true,
15
+ displayOptions: { show: { resource: ['table'] } },
16
+ options: [
17
+ { name: 'List Tables', value: 'listTable', action: 'List Tables' },
18
+ { name: 'Get Table', value: 'getTable', action: 'Get Table' },
19
+ { name: 'Create Table Field', value: 'createTableField', action: 'Create Table Field' },
20
+ { name: 'Create Table', value: 'createTable', action: 'Create Table' },
21
+ ],
22
+ default: 'listTable',
23
+ description: 'The operation to perform',
24
+ },
25
+ ];
26
+ exports.tableFields = [
27
+ // Solution selector
28
+ {
29
+ ...resourceInputs_1.solutionInput,
30
+ required: true,
31
+ displayOptions: {
32
+ show: {
33
+ resource: ['table'],
34
+ operation: ['listTable', 'getTable', 'createTableField', 'createTable'],
35
+ },
36
+ },
37
+ },
38
+ // List Tables
39
+ {
40
+ displayName: 'Return All',
41
+ name: 'returnAll',
42
+ type: 'boolean',
43
+ default: false,
44
+ displayOptions: { show: { resource: ['table'], operation: ['listTable'] } },
45
+ description: 'Return all tables (ignore Limit)',
46
+ },
47
+ {
48
+ displayName: 'Limit',
49
+ name: 'limit',
50
+ type: 'number',
51
+ default: 50,
52
+ typeOptions: { minValue: 1, maxValue: 100 },
53
+ displayOptions: {
54
+ show: { resource: ['table'], operation: ['listTable'], returnAll: [false] },
55
+ },
56
+ description: 'Maximum number of tables to return when not returning all',
57
+ },
58
+ // Get Table
59
+ {
60
+ ...resourceInputs_1.tableInput,
61
+ required: true,
62
+ displayOptions: { show: { resource: ['table'], operation: ['getTable'] } },
63
+ },
64
+ // Create Table Field
65
+ {
66
+ ...resourceInputs_1.tableInput,
67
+ required: true,
68
+ displayOptions: { show: { resource: ['table'], operation: ['createTableField'] } },
69
+ },
70
+ {
71
+ displayName: 'Field Name',
72
+ name: 'fieldName',
73
+ type: 'string',
74
+ default: '',
75
+ required: true,
76
+ displayOptions: { show: { resource: ['table'], operation: ['createTableField'] } },
77
+ description: 'The name of the field',
78
+ },
79
+ {
80
+ displayName: 'Field Type',
81
+ name: 'fieldType',
82
+ type: 'options',
83
+ options: [
84
+ { name: 'Text', value: 'textfield' },
85
+ { name: 'Text Area', value: 'textareafield' },
86
+ { name: 'Single Select', value: 'singleselectfield' },
87
+ { name: 'Multiple Select', value: 'multipleselectfield' },
88
+ { name: 'Number', value: 'numberfield' },
89
+ { name: 'Date', value: 'datefield' },
90
+ { name: 'Due Date', value: 'duedatefield' },
91
+ { name: 'Address', value: 'addressfield' },
92
+ { name: 'Assigned To', value: 'assignedtofield' },
93
+ { name: 'Checklist', value: 'checklistfield' },
94
+ { name: 'Email', value: 'emailfield' },
95
+ { name: 'Files & Images', value: 'filesimagesfield' },
96
+ { name: 'Formula', value: 'formulafield' },
97
+ { name: 'Full Name', value: 'fullnamefield' },
98
+ { name: 'Linked Record', value: 'linkedrecordfield' },
99
+ { name: 'Lookup', value: 'lookupfield' },
100
+ { name: 'Phone', value: 'phonefield' },
101
+ { name: 'Rating', value: 'ratingfield' },
102
+ { name: 'Record ID', value: 'recordidfield' },
103
+ { name: 'Rollup', value: 'rollupfield' },
104
+ { name: 'Signature', value: 'signaturefield' },
105
+ { name: 'SmartDoc', value: 'smartdocfield' },
106
+ { name: 'Social Networks', value: 'socialnetworksfield' },
107
+ { name: 'Status', value: 'statusfield' },
108
+ { name: 'Sub Items', value: 'subitemsfield' },
109
+ { name: 'Tag', value: 'tagfield' },
110
+ { name: 'Time', value: 'timefield' },
111
+ { name: 'Vote', value: 'votefield' },
112
+ { name: 'Yes/No', value: 'yesnofield' },
113
+ ],
114
+ default: 'textfield',
115
+ displayOptions: { show: { resource: ['table'], operation: ['createTableField'] } },
116
+ description: 'The type of the new field',
117
+ },
118
+ {
119
+ displayName: 'Help Text',
120
+ name: 'helpText',
121
+ type: 'string',
122
+ default: '',
123
+ displayOptions: { show: { resource: ['table'], operation: ['createTableField'] } },
124
+ description: 'Help text for the field',
125
+ },
126
+ // Create Table
127
+ {
128
+ displayName: 'Table Name',
129
+ name: 'tableName',
130
+ type: 'string',
131
+ required: true,
132
+ default: '',
133
+ displayOptions: { show: { resource: ['table'], operation: ['createTable'] } },
134
+ description: 'API name for the new table (unique, no spaces)',
135
+ },
136
+ {
137
+ displayName: 'Table Description',
138
+ name: 'tableDescription',
139
+ type: 'string',
140
+ default: '',
141
+ displayOptions: { show: { resource: ['table'], operation: ['createTable'] } },
142
+ description: 'Optional description for the new table',
143
+ },
144
+ {
145
+ displayName: 'Icon',
146
+ name: 'icon',
147
+ type: 'string',
148
+ default: 'table',
149
+ displayOptions: { show: { resource: ['table'], operation: ['createTable'] } },
150
+ description: 'Icon for the new table',
151
+ },
152
+ ];
153
+ //# sourceMappingURL=TableDescription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableDescription.js","sourceRoot":"","sources":["../../../../../src/nodes/SmartSuite/actions/table/TableDescription.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,gEAAwE;AAExE;;GAEG;AACU,QAAA,eAAe,GAAsB;IAChD;QACE,WAAW,EAAO,WAAW;QAC7B,IAAI,EAAc,WAAW;QAC7B,IAAI,EAAc,SAAS;QAC3B,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;QACnD,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,aAAa,EAAS,KAAK,EAAE,WAAW,EA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AE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE;QAC7E,WAAW,EAAE,wBAAwB;KACtC;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function execute(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execute = execute;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const utils_1 = require("../../helpers/utils");
6
+ const smartSuiteApi_1 = require("../../transport/smartSuiteApi");
7
+ const validation_1 = require("../../helpers/validation");
8
+ async function execute() {
9
+ (0, utils_1.debugLog)('[Table] createTable.execute called', this.getNode().parameters, 2);
10
+ // 1) Validate solution
11
+ const solutionId = await validation_1.getSolutionId.call(this, 0);
12
+ // 2) Gather inputs
13
+ const tableName = this.getNodeParameter('tableName', 0);
14
+ const tableDescription = this.getNodeParameter('tableDescription', 0);
15
+ const icon = this.getNodeParameter('icon', 0);
16
+ if (!tableName.trim()) {
17
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Table name cannot be blank.');
18
+ }
19
+ // 3) Build payload
20
+ const body = {
21
+ name: tableName,
22
+ solution: solutionId,
23
+ description: tableDescription,
24
+ icon,
25
+ structure: [
26
+ {
27
+ slug: 'title',
28
+ label: 'Title',
29
+ field_type: 'recordtitlefield',
30
+ },
31
+ ],
32
+ };
33
+ (0, utils_1.debugLog)('[Table] createTable.payload', body, 2);
34
+ const returnData = [];
35
+ try {
36
+ const response = await smartSuiteApi_1.apiRequest.call(this, 'POST', '/applications/', body);
37
+ (0, utils_1.debugLog)('[Table] createTable.response', response, 2);
38
+ returnData.push({ json: { success: true, data: response } });
39
+ }
40
+ catch (err) {
41
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), err.message);
42
+ }
43
+ return returnData;
44
+ }
45
+ //# sourceMappingURL=createTable.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTable.operation.js","sourceRoot":"","sources":["../../../../../src/nodes/SmartSuite/actions/table/createTable.operation.ts"],"names":[],"mappings":";;AAOA,0BA+CC;AApDD,+CAAkD;AAClD,+CAA+C;AAC/C,iEAA2D;AAC3D,yDAAyD;AAElD,KAAK,UAAU,OAAO;IAG3B,IAAA,gBAAQ,EAAC,oCAAoC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC7E,uBAAuB;IACvB,MAAM,UAAU,GAAG,MAAM,0BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAErD,mBAAmB;IACnB,MAAM,SAAS,GAAU,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;IACzE,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,CAAW,CAAC;IAChF,MAAM,IAAI,GAAe,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAW,CAAC;IAEpE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,6BAA6B,CAAC,CAAC;IAC9E,CAAC;IAED,mBAAmB;IACnB,MAAM,IAAI,GAAgB;QACxB,IAAI,EAAS,SAAS;QACtB,QAAQ,EAAK,UAAU;QACvB,WAAW,EAAE,gBAAgB;QAC7B,IAAI;QACJ,SAAS,EAAE;YACT;gBACE,IAAI,EAAQ,OAAO;gBACnB,KAAK,EAAO,OAAO;gBACnB,UAAU,EAAE,kBAAkB;aAC/B;SACF;KACF,CAAC;IACF,IAAA,gBAAQ,EAAC,6BAA6B,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEjD,MAAM,UAAU,GAAyB,EAAE,CAAC;IAC5C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,IAAI,CACpC,IAAI,EACJ,MAAM,EACN,gBAAgB,EAChB,IAAI,CACU,CAAC;QACjB,IAAA,gBAAQ,EAAC,8BAA8B,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACtD,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function execute(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // src/nodes/SmartSuite/actions/table/createTableField.operation.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const utils_1 = require("../../helpers/utils");
7
+ const smartSuiteApi_1 = require("../../transport/smartSuiteApi");
8
+ const validation_1 = require("../../helpers/validation");
9
+ async function execute() {
10
+ (0, utils_1.debugLog)('[Table] createTableField.execute called', this.getNode().parameters, 2);
11
+ const items = this.getInputData();
12
+ const returnData = [];
13
+ for (let i = 0; i < items.length; i++) {
14
+ const tableId = await validation_1.getTableId.call(this, i);
15
+ const fieldName = this.getNodeParameter('fieldName', i);
16
+ const fieldType = this.getNodeParameter('fieldType', i);
17
+ const helpText = this.getNodeParameter('helpText', i);
18
+ // Generate a valid slug from the field name
19
+ const slug = fieldName
20
+ .toLowerCase()
21
+ .replace(/[^a-z0-9]+/g, '_')
22
+ .replace(/^_+|_+$/g, '');
23
+ // Build params for text fields
24
+ const params = fieldType === 'textfield'
25
+ ? { max_length: 255, help_text: helpText, help_text_display_format: 'tooltip' }
26
+ : {};
27
+ const body = {
28
+ field: {
29
+ name: fieldName,
30
+ label: fieldName,
31
+ field_type: fieldType,
32
+ slug,
33
+ params,
34
+ },
35
+ field_position: { position: 1 },
36
+ auto_fill_structure_layout: true,
37
+ };
38
+ (0, utils_1.debugLog)('[Table] createTableField.payload', body, 2);
39
+ try {
40
+ await smartSuiteApi_1.apiRequest.call(this, 'POST', `/applications/${tableId}/add_field/`, body);
41
+ returnData.push({ json: { success: true } });
42
+ }
43
+ catch (err) {
44
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), err.message, { itemIndex: i });
45
+ }
46
+ }
47
+ return returnData;
48
+ }
49
+ //# sourceMappingURL=createTableField.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTableField.operation.js","sourceRoot":"","sources":["../../../../../src/nodes/SmartSuite/actions/table/createTableField.operation.ts"],"names":[],"mappings":";AAAA,mEAAmE;;AAQnE,0BAqDC;AA1DD,+CAAkD;AAClD,+CAA+C;AAC/C,iEAA2D;AAC3D,yDAAsD;AAE/C,KAAK,UAAU,OAAO;IAG3B,IAAA,gBAAQ,EAAC,yCAAyC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAClF,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAE/C,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAClE,MAAM,SAAS,GAAG,IAAI,CAAC,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-0,0 +1,2 @@
1
+ import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function execute(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // src/nodes/SmartSuite/actions/table/getTable.operation.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const utils_1 = require("../../helpers/utils");
7
+ const smartSuiteApi_1 = require("../../transport/smartSuiteApi");
8
+ const validation_1 = require("../../helpers/validation");
9
+ async function execute() {
10
+ (0, utils_1.debugLog)('[Table] getTable.execute called', this.getNode().parameters, 2);
11
+ const returnData = [];
12
+ const tableId = await validation_1.getTableId.call(this, 0);
13
+ try {
14
+ const response = await smartSuiteApi_1.apiRequest.call(this, 'GET', `/applications/${tableId}/`);
15
+ (0, utils_1.debugLog)('[Table] getTable.response', response, 2);
16
+ returnData.push({ json: response });
17
+ }
18
+ catch (err) {
19
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), err.message);
20
+ }
21
+ return returnData;
22
+ }
23
+ //# sourceMappingURL=getTable.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTable.operation.js","sourceRoot":"","sources":["../../../../../src/nodes/SmartSuite/actions/table/getTable.operation.ts"],"names":[],"mappings":";AAAA,2DAA2D;;AAQ3D,0BAsBC;AA3BD,+CAAkD;AAClD,+CAA+C;AAC/C,iEAA2D;AAC3D,yDAAsD;AAE/C,KAAK,UAAU,OAAO;IAG3B,IAAA,gBAAQ,EAAC,iCAAiC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1E,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,MAAM,OAAO,GAAG,MAAM,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAE/C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,IAAI,CACpC,IAAI,EACJ,KAAK,EACL,iBAAiB,OAAO,GAAG,CACb,CAAC;QACjB,IAAA,gBAAQ,EAAC,2BAA2B,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QAEnD,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function execute(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ // src/nodes/SmartSuite/actions/table/listTable.operation.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const utils_1 = require("../../helpers/utils");
7
+ const smartSuiteApi_1 = require("../../transport/smartSuiteApi");
8
+ const validation_1 = require("../../helpers/validation");
9
+ async function execute() {
10
+ (0, utils_1.debugLog)('[Table] listTable.execute called', this.getNode().parameters, 2);
11
+ const items = this.getInputData();
12
+ const returnAll = this.getNodeParameter('returnAll', 0);
13
+ const limit = returnAll
14
+ ? undefined
15
+ : this.getNodeParameter('limit', 0);
16
+ const returnData = [];
17
+ for (let i = 0; i < items.length; i++) {
18
+ const solutionId = await validation_1.getSolutionId.call(this, i);
19
+ const qs = { solution: solutionId };
20
+ if (!returnAll) {
21
+ qs.limit = limit;
22
+ }
23
+ let tablesArray;
24
+ if (returnAll) {
25
+ tablesArray = await smartSuiteApi_1.paginatedRequest.call(this, 'GET', '/applications/', {}, qs);
26
+ }
27
+ else {
28
+ const resp = await smartSuiteApi_1.apiRequest.call(this, 'GET', '/applications/', {}, qs);
29
+ tablesArray = Array.isArray(resp.results)
30
+ ? resp.results
31
+ : Array.isArray(resp)
32
+ ? resp
33
+ : [];
34
+ }
35
+ if (!tablesArray.length) {
36
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No tables found for Solution: ${solutionId}`, { itemIndex: i });
37
+ }
38
+ returnData.push(...this.helpers.returnJsonArray(tablesArray));
39
+ }
40
+ return returnData;
41
+ }
42
+ //# sourceMappingURL=listTable.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTable.operation.js","sourceRoot":"","sources":["../../../../../src/nodes/SmartSuite/actions/table/listTable.operation.ts"],"names":[],"mappings":";AAAA,4DAA4D;;AAQ5D,0BAuDC;AA5DD,+CAAkD;AAClD,+CAA+C;AAC/C,iEAA6E;AAC7E,yDAAyD;AAElD,KAAK,UAAU,OAAO;IAG3B,IAAA,gBAAQ,EAAC,kCAAkC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAY,CAAC;IACnE,MAAM,KAAK,GAAO,SAAS;QACzB,CAAC,CAAC,SAAS;QACX,CAAC,CAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAY,CAAC;IAElD,MAAM,UAAU,GAAyB,EAAE,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,MAAM,0BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAErD,MAAM,EAAE,GAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;QACjD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,CAAC;QAED,IAAI,WAA0B,CAAC;QAC/B,IAAI,SAAS,EAAE,CAAC;YACd,WAAW,GAAG,MAAM,gCAAgB,CAAC,IAAI,CACvC,IAAI,EACJ,KAAK,EACL,gBAAgB,EAChB,EAAE,EACF,EAAE,CACH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,GAAG,MAAM,0BAAU,CAAC,IAAI,CAChC,IAAI,EACJ,KAAK,EACL,gBAAgB,EAChB,EAAE,EACF,EAAE,CACH,CAAC;YACF,WAAW,GAAG,KAAK,CAAC,OAAO,CAAE,IAAY,CAAC,OAAO,CAAC;gBAChD,CAAC,CAAE,IAAY,CAAC,OAAO;gBACvB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;oBACrB,CAAC,CAAE,IAAsB;oBACzB,CAAC,CAAC,EAAE,CAAC;QACT,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,iCAAkB,CAC1B,IAAI,CAAC,OAAO,EAAE,EACd,iCAAiC,UAAU,EAAE,EAC7C,EAAE,SAAS,EAAE,CAAC,EAAE,CACjB,CAAC;QACJ,CAAC;QAED,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A lookup table of valid comparison operators for each SmartSuite field type,
3
+ * sourced directly from your "Field Type–Operators Across" spreadsheet.
4
+ */
5
+ export declare const filterOptionsByFieldType: Record<string, string[]>;
6
+ /**
7
+ * Returns the list of valid filter comparison operators
8
+ * for a given SmartSuite field type.
9
+ * If the type is unknown, returns an empty array.
10
+ */
11
+ export declare function getFilterOptionsForFieldType(fieldType: string): string[];