From e29bd9ac2d7b33bf68c81cd0cb72c3d1d539030f Mon Sep 17 00:00:00 2001 From: Kiril Ivonchik Date: Tue, 30 Dec 2025 13:34:03 +0100 Subject: [PATCH] Create Post --- src/makecomapp.json | 20 +++++ .../create-post.communication.iml.json | 48 ++++++++++++ .../create-post.interface.iml.json | 73 +++++++++++++++++++ .../create-post.mappable-params.iml.json | 60 +++++++++++++++ .../create-post/create-post.samples.iml.json | 1 + .../create-post/create-post.scope.iml.json | 2 + .../create-post.static-params.iml.json | 1 + src/modules/groups.json | 1 + 8 files changed, 206 insertions(+) create mode 100644 src/modules/create-post/create-post.communication.iml.json create mode 100644 src/modules/create-post/create-post.interface.iml.json create mode 100644 src/modules/create-post/create-post.mappable-params.iml.json create mode 100644 src/modules/create-post/create-post.samples.iml.json create mode 100644 src/modules/create-post/create-post.scope.iml.json create mode 100644 src/modules/create-post/create-post.static-params.iml.json diff --git a/src/makecomapp.json b/src/makecomapp.json index 5ef4165..31d4a0c 100644 --- a/src/makecomapp.json +++ b/src/makecomapp.json @@ -51,6 +51,22 @@ "scope": "modules/comment-on-post/comment-on-post.scope.iml.json" } }, + "createPost": { + "label": "Create a Post", + "description": "Creates a new LinkedIn post.", + "moduleType": "action", + "actionCrud": null, + "connection": "connection1", + "altConnection": null, + "codeFiles": { + "communication": "modules/create-post/create-post.communication.iml.json", + "staticParams": "modules/create-post/create-post.static-params.iml.json", + "mappableParams": "modules/create-post/create-post.mappable-params.iml.json", + "interface": "modules/create-post/create-post.interface.iml.json", + "samples": "modules/create-post/create-post.samples.iml.json", + "scope": "modules/create-post/create-post.scope.iml.json" + } + }, "customWorkflow": { "label": "Execute a Custom Workflow", "description": "Execute a custom multi-step workflow using raw workflow definition.", @@ -478,6 +494,10 @@ "local": "commentOnPost", "remote": "commentOnPost" }, + { + "local": "createPost", + "remote": "createPost" + }, { "local": "customWorkflow", "remote": "customWorkflow" diff --git a/src/modules/create-post/create-post.communication.iml.json b/src/modules/create-post/create-post.communication.iml.json new file mode 100644 index 0000000..1e07c10 --- /dev/null +++ b/src/modules/create-post/create-post.communication.iml.json @@ -0,0 +1,48 @@ +[ + { + "url": "/workflows", + "method": "POST", + "body": { + "operationName": "createPost", + "data": { + "text": "{{parameters.postText}}", + "companyUrl": "{{if(parameters.companyUrl, parameters.companyUrl, undefined)}}", + "attachments": "{{if(length(parameters.attachments) > 0, parameters.attachments, undefined)}}" + } + }, + "response": { + "temp": { + "workflowId": "{{body.workflowId}}", + "operationName": "createPost" + } + } + }, + { + "url": "/workflows/{{temp.workflowId}}?operationName={{temp.operationName}}", + "method": "GET", + "repeat": { + "condition": "{{body.status !== 'completed'}}", + "delay": 5000, + "limit": 1800 + }, + "response": { + "temp": { + "status": "{{body.status}}", + "data": "{{body.data}}", + "errors": "{{body.errors}}" + } + } + }, + { + "response": { + "valid": "{{temp.status === 'completed'}}", + "error": { + "message": "Workflow timed out or did not complete." + }, + "output": { + "data": "{{temp.data}}", + "errors": "{{temp.errors}}" + } + } + } +] diff --git a/src/modules/create-post/create-post.interface.iml.json b/src/modules/create-post/create-post.interface.iml.json new file mode 100644 index 0000000..3b497d7 --- /dev/null +++ b/src/modules/create-post/create-post.interface.iml.json @@ -0,0 +1,73 @@ +[ + { + "name": "data", + "type": "collection", + "label": "Data", + "spec": [ + { + "name": "postUrl", + "type": "url", + "label": "Post URL" + } + ] + }, + { + "name": "errors", + "type": "array", + "label": "Errors", + "spec": [ + { + "name": "type", + "type": "select", + "label": "Error Type", + "options": [ + { + "label": "Text Too Long", + "value": "textTooLong" + }, + { + "label": "Company Not Found", + "value": "companyNotFound" + }, + { + "label": "No Posting Permission", + "value": "noPostingPermission" + }, + { + "label": "Unsupported Attachment Type", + "value": "unsupportedAttachmentType" + }, + { + "label": "Missing Document Name", + "value": "missingDocumentName" + }, + { + "label": "URL Not Accessible", + "value": "urlNotAccessible" + }, + { + "label": "File Too Large", + "value": "fileTooLarge" + }, + { + "label": "Unsupported MIME Type", + "value": "unsupportedMimeType" + }, + { + "label": "Too Many Attachments", + "value": "tooManyAttachments" + }, + { + "label": "Mixing Not Allowed", + "value": "mixingNotAllowed" + } + ] + }, + { + "name": "message", + "type": "text", + "label": "Error Message" + } + ] + } +] diff --git a/src/modules/create-post/create-post.mappable-params.iml.json b/src/modules/create-post/create-post.mappable-params.iml.json new file mode 100644 index 0000000..f191063 --- /dev/null +++ b/src/modules/create-post/create-post.mappable-params.iml.json @@ -0,0 +1,60 @@ +[ + { + "name": "postText", + "type": "text", + "label": "Post Text", + "required": true, + "help": "Post content, must be up to 3000 characters" + }, + { + "name": "companyUrl", + "type": "text", + "label": "Company URL", + "required": false, + "help": "LinkedIn company page URL. If specified, the post will be created on the company page (requires admin access)." + }, + { + "name": "attachments", + "type": "array", + "label": "Attachments", + "required": false, + "help": "Media attachments for the post (max 9 images, or 1 video, or 1 document). Cannot mix different attachment types.", + "spec": [ + { + "name": "url", + "type": "url", + "label": "File URL", + "required": true, + "help": "Publicly accessible URL of the media file" + }, + { + "name": "type", + "type": "select", + "label": "Type", + "required": true, + "help": "Type of media attachment", + "options": [ + { + "label": "Image", + "value": "image" + }, + { + "label": "Video", + "value": "video" + }, + { + "label": "Document", + "value": "document" + } + ] + }, + { + "name": "name", + "type": "text", + "label": "Document Name", + "required": false, + "help": "Display name for the document (required for documents)" + } + ] + } +] diff --git a/src/modules/create-post/create-post.samples.iml.json b/src/modules/create-post/create-post.samples.iml.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/modules/create-post/create-post.samples.iml.json @@ -0,0 +1 @@ +{} diff --git a/src/modules/create-post/create-post.scope.iml.json b/src/modules/create-post/create-post.scope.iml.json new file mode 100644 index 0000000..fb5c297 --- /dev/null +++ b/src/modules/create-post/create-post.scope.iml.json @@ -0,0 +1,2 @@ +// Code below is relevant only if an OAuth type connection is associated with the module. In other cases, it is ignored. +[] diff --git a/src/modules/create-post/create-post.static-params.iml.json b/src/modules/create-post/create-post.static-params.iml.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/src/modules/create-post/create-post.static-params.iml.json @@ -0,0 +1 @@ +[] diff --git a/src/modules/groups.json b/src/modules/groups.json index 2ba2afe..da6e86c 100644 --- a/src/modules/groups.json +++ b/src/modules/groups.json @@ -4,6 +4,7 @@ "modules": [ "checkConnectionStatus", "commentOnPost", + "createPost", "fetchCompany", "fetchPerson", "fetchPost",