otomato-sdk 2.0.305 → 2.0.306
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.
|
@@ -6,7 +6,7 @@ export const TRIGGERS = {
|
|
|
6
6
|
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/X.webp",
|
|
7
7
|
"X_POST_TRIGGER": {
|
|
8
8
|
"name": "X Post Trigger",
|
|
9
|
-
"dynamicName": "async (env, { otomatoSDK }) => {\n const { getDynamicNameWrapperHTML } = otomatoSDK;\n return getDynamicNameWrapperHTML(\n 'When',\n env.parameters.username
|
|
9
|
+
"dynamicName": "async (env, { otomatoSDK }) => {\n const { getDynamicNameWrapperHTML } = otomatoSDK;\n return getDynamicNameWrapperHTML(\n 'When',\n env.parameters.username\n ? `<span style=\"color: #1560F5;\">@${env.parameters.username}</span>`\n : '',\n 'tweets or retweets'\n );\n }",
|
|
10
10
|
"description": "Track an account activity via their posts (twitter)",
|
|
11
11
|
"type": 5,
|
|
12
12
|
"output": {
|
|
@@ -6285,7 +6285,7 @@ export const TRIGGERS = {
|
|
|
6285
6285
|
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/X.webp",
|
|
6286
6286
|
"X_POST_TRIGGER": {
|
|
6287
6287
|
"name": "X Post Trigger",
|
|
6288
|
-
"dynamicName": "async (env, { otomatoSDK }) => {\n const { getDynamicNameWrapperHTML } = otomatoSDK;\n return getDynamicNameWrapperHTML(\n 'When',\n env.parameters.username
|
|
6288
|
+
"dynamicName": "async (env, { otomatoSDK }) => {\n const { getDynamicNameWrapperHTML } = otomatoSDK;\n return getDynamicNameWrapperHTML(\n 'When',\n env.parameters.username\n ? `<span style=\"color: #1560F5;\">@${env.parameters.username}</span>`\n : '',\n 'tweets or retweets'\n );\n }",
|
|
6289
6289
|
"description": "Track an account activity via their posts (twitter)",
|
|
6290
6290
|
"type": 5,
|
|
6291
6291
|
"output": {
|
|
@@ -7604,7 +7604,7 @@ export const ACTIONS = {
|
|
|
7604
7604
|
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/if.png",
|
|
7605
7605
|
"IF": {
|
|
7606
7606
|
"name": "Condition",
|
|
7607
|
-
"dynamicName": "async (env) => {\n /**\n * Renders a conditional logic structure into readable HTML\n * @param params - The condition parameters with logic, groups, and checks\n * @returns HTML string representation of the condition\n */\n function renderConditionDescription(params) {\n const { logic, groups } = params;\n if (!groups || groups.length === 0) {\n return 'If';\n }\n const groupDescriptions = groups.map((group) => renderGroup(group));\n const logicWord = logic === 'or' ? 'OR' : 'AND';\n if (groupDescriptions.length === 1) {\n return `<div class=\"flex items-center space-x-1\">\n <span>If ${groupDescriptions[0]}</span>\n </div>`;\n }\n return `<div class=\"flex items-center space-x-1\">\n <span>If (${groupDescriptions.join(` <span class=\"px-1 font-bold\">${logicWord}</span> `)})</span>\n </div>`;\n }\n \n /**\n * Renders a single group of checks\n * @param group - Group with logic and checks\n * @returns HTML string for the group\n */\n function renderGroup(group) {\n const { logic, checks } = group;\n if (!checks || checks.length === 0) {\n return '';\n }\n const checkDescriptions = checks.map((check) => renderCheck(check));\n const logicWord = logic === 'or' ? 'OR' : 'AND';\n if (checkDescriptions.length === 1) {\n return checkDescriptions[0];\n }\n return `(${checkDescriptions.join(`<span class=\"px-1 font-bold\">${logicWord}</span>`)})`;\n }\n \n /**\n * Renders a single check comparison\n * @param check - Check with value1, condition, and value2\n * @returns HTML string for the check\n */\n function renderCheck(check) {\n const { value1, condition, value2 } = check;\n const formattedValue1 = formatValue(value1);\n const formattedValue2 = formatValue(value2);\n const operator = OperatorToSymbol[condition] || condition;\n return `${formattedValue1} ${operator} ${formattedValue2}`;\n }\n \n /**\n * Formats a value, converting nodeMap references to HTML links\n * @param value - The value to format (can be nodeMap reference or literal)\n * @returns Formatted HTML string\n */\n function formatValue(value) {\n if (typeof value === 'string' && value.includes('{{nodeMap.')) {\n const nodeMapMatch = value.match(/\\{\\{nodeMap\\.(\\d+)\\.output\\.(\\w+)\\}\\}/);\n if (nodeMapMatch) {\n const nodeRef = nodeMapMatch[1];\n const outputProperty = nodeMapMatch[2];\n return `<a href=\"#\" title=\"Node ${nodeRef} output\">${nodeRef}.${outputProperty}</a>`;\n }\n }\n if (typeof value === 'string') {\n return `\"${value}\"`;\n }\n return String(value);\n }\n \n // Operator symbol mapping (should match backend EOperator/OperatorToSymbol)\n const OperatorToSymbol = {\n eq: '==',\n neq: '!=',\n gt: '>',\n gte: '>=',\n lt: '<',\n lte: '<=',\n contains: 'contains',\n not_contains: 'not contains',\n starts_with: 'starts with',\n ends_with: 'ends with',\n in: 'in',\n not_in: 'not in'\n };\n \n return renderConditionDescription(env.parameters);\n }",
|
|
7607
|
+
"dynamicName": "async (env) => {\n /**\n * Renders a conditional logic structure into readable HTML\n * @param params - The condition parameters with logic, groups, and checks\n * @returns HTML string representation of the condition\n */\n function renderConditionDescription(params) {\n const { logic, groups } = params;\n if (!groups || groups.length === 0) {\n return 'If';\n }\n const groupDescriptions = groups.map((group) => renderGroup(group));\n const logicWord = logic === 'or' ? 'OR' : 'AND';\n if (groupDescriptions.length === 1) {\n return `<div class=\"flex items-center space-x-1\">\n <span>If ${groupDescriptions[0]}</span>\n </div>`;\n }\n return `<div class=\"flex items-center space-x-1\">\n <span>If (${groupDescriptions.join(` <span class=\"px-1 font-bold\">${logicWord}</span> `)})</span>\n </div>`;\n }\n \n /**\n * Renders a single group of checks\n * @param group - Group with logic and checks\n * @returns HTML string for the group\n */\n function renderGroup(group) {\n const { logic, checks } = group;\n if (!checks || checks.length === 0) {\n return '';\n }\n const checkDescriptions = checks.map((check) => renderCheck(check));\n const logicWord = logic === 'or' ? 'OR' : 'AND';\n if (checkDescriptions.length === 1) {\n return checkDescriptions[0];\n }\n return `(${checkDescriptions.join(`<span class=\"px-1 font-bold\">${logicWord}</span>`)})`;\n }\n \n /**\n * Renders a single check comparison\n * @param check - Check with value1, condition, and value2\n * @returns HTML string for the check\n */\n function renderCheck(check) {\n const { value1, condition, value2 } = check;\n const formattedValue1 = formatValue(value1);\n const formattedValue2 = formatValue(value2);\n const operator = OperatorToSymbol[condition] || condition;\n return `${formattedValue1} ${operator} ${formattedValue2}`;\n }\n \n /**\n * Formats a value, converting nodeMap references to HTML links\n * @param value - The value to format (can be nodeMap reference or literal)\n * @returns Formatted HTML string\n */\n /**\n * Formats a value, converting nodeMap references to HTML links and coloring booleans.\n * @param value - The value to format (can be nodeMap reference, boolean, or literal)\n * @returns Formatted HTML string\n */\n function formatValue(value) {\n if (typeof value === 'string' && value.includes('{{nodeMap.')) {\n const nodeMapMatch = value.match(/\\{\\{nodeMap\\.(\\d+)\\.output\\.(\\w+)\\}\\}/);\n if (nodeMapMatch) {\n const nodeRef = nodeMapMatch[1];\n const outputProperty = nodeMapMatch[2];\n return `<a href=\"#\" title=\"Node ${nodeRef} output\">${nodeRef}.${outputProperty}</a>`;\n }\n }\n // Handle boolean string values \"True\" and \"False\" (case-insensitive)\n if (typeof value === 'string') {\n if (value.toLowerCase() === 'true') {\n return `<span style=\"color: #1560F5;\">\"True\"</span>`;\n }\n if (value.toLowerCase() === 'false') {\n return `<span style=\"color: #FF3D00;\">\"False\"</span>`;\n }\n return `\"${value}\"`;\n }\n // Handle boolean values true and false\n if (typeof value === 'boolean') {\n if (value === true) {\n return `<span style=\"color: #1560F5;\">True</span>`;\n }\n if (value === false) {\n return `<span style=\"color: #FF3D00;\">False</span>`;\n }\n }\n return String(value);\n }\n \n // Operator symbol mapping (should match backend EOperator/OperatorToSymbol)\n const OperatorToSymbol = {\n eq: '==',\n neq: '!=',\n gt: '>',\n gte: '>=',\n lt: '<',\n lte: '<=',\n contains: 'contains',\n not_contains: 'not contains',\n starts_with: 'starts with',\n ends_with: 'ends with',\n in: 'in',\n not_in: 'not in'\n };\n \n return renderConditionDescription(env.parameters);\n }",
|
|
7608
7608
|
"type": 5,
|
|
7609
7609
|
"description": "Checks for a condition before proceeding",
|
|
7610
7610
|
"parameters": [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.306";
|
|
2
2
|
export declare function compareVersions(v1: string, v2: string): number;
|