Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/makecomapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -478,6 +494,10 @@
"local": "commentOnPost",
"remote": "commentOnPost"
},
{
"local": "createPost",
"remote": "createPost"
},
{
"local": "customWorkflow",
"remote": "customWorkflow"
Expand Down
48 changes: 48 additions & 0 deletions src/modules/create-post/create-post.communication.iml.json
Original file line number Diff line number Diff line change
@@ -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}}"
}
}
}
]
73 changes: 73 additions & 0 deletions src/modules/create-post/create-post.interface.iml.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
60 changes: 60 additions & 0 deletions src/modules/create-post/create-post.mappable-params.iml.json
Original file line number Diff line number Diff line change
@@ -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)"
}
]
}
]
1 change: 1 addition & 0 deletions src/modules/create-post/create-post.samples.iml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 2 additions & 0 deletions src/modules/create-post/create-post.scope.iml.json
Original file line number Diff line number Diff line change
@@ -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.
[]
1 change: 1 addition & 0 deletions src/modules/create-post/create-post.static-params.iml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions src/modules/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"modules": [
"checkConnectionStatus",
"commentOnPost",
"createPost",
"fetchCompany",
"fetchPerson",
"fetchPost",
Expand Down