Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash CloneDeep vs Immer Produce (13kb dataset)
(version: 0)
Comparing performance of:
Produce vs CloneDeep
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/immer/dist/immer.umd.production.min.js"></script> <script src='https://cdn.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js'></script>
Script Preparation code:
state = { "prefix": "posts", "resources": [ { "name": "posts/:id/attachments", "description": "Download, add, edit and delete attachments.", "endpoints": [ { "verb": "POST", "url": "/v2/posts/:id/attachments", "authtypes": ["Basic", "Bearer", "Cookie", "Email", "Trusted"], "description": "Add the given attachment to the given post", "implemented": true, "private": true, "controller": "api_posts_attachments", "action": "add", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "name", "type": "String", "required": true, "description": "The name of the attachment.", "example": "ACME Proposal.pptx" }, { "name": "attachment_id", "type": "Number", "required": false, "description": "The id of an existing attachment if applicable. Required if `data` is not given.", "example": "123" }, { "name": "data", "type": "String", "required": false, "description": "The url to the attachment. Must be a public url or a data uri. Required if `attachment_id` is not given.", "example": "http://example.com/files/ACME_Proposal.pptx" }, { "name": "size", "type": "Number", "required": false, "description": "The size in bytes of the file (optional).", "example": 123456 }, { "name": "created_at", "type": "Date", "required": false, "description": "When the attachment was created (optional).", "example": "2014-04-25T23:09:58+00:00" }, { "name": "sha256", "type": "String", "required": false, "description": "The sha256 checksum of this file, expressed as a 64-character hexadecimal string (optional). If given, information about duplicates will be returned in the response.", "example": "8ec8552d962a572a853de9a8203404fec51981919f9cbeb9017fe0f3740f2b9a" } ], "since": "2017.07" }, { "verb": "DELETE", "url": "/v2/posts/:id/attachments/:attachmentId", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "description": "Remove the given attachment from the given post", "implemented": true, "private": true, "controller": "api_posts_attachments", "action": "remove", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] }, { "name": ":attachmentId", "type": "Number", "required": true, "description": "The ID of the attachment", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessAttachment" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that attachment or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2017.07" }, { "verb": "GET", "url": "/v3/posts/:id/attachments/thumbnails", "authtypes": [ "Email", "Basic", "Bearer", "Board", "Cookie", "SecretPost" ], "multihub": false, "description": "Get thumbnail preview images for this post's attachments", "implemented": true, "private": true, "controller": "api_posts", "action": "v3_attachment_thumbnails", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "limit", "type": "Number", "required": false, "description": "Limit to this many results. Max of 100.", "validators": [ { "level": "Notice", "function": { "name": "validateMax", "args": [100] }, "message": "The maximum value for `limit` is 100. Using 100 for the limit.", "field": "limit" } ], "default": 10, "example": 5 }, { "name": "page", "type": "Number", "required": false, "description": "Return this page of results.", "validators": [ { "level": "Notice", "function": { "name": "validateMin", "args": [1] }, "message": "The minimum value for `page` is 1. Using 1 for the page.", "field": "page" } ], "default": 1, "example": 3 } ], "since": "2017.12" }, { "verb": "GET", "url": "/v3/posts/:id/attachments/previews", "authtypes": [ "Email", "Basic", "Bearer", "Board", "Cookie", "SecretPost" ], "multihub": false, "description": "Get full-size preview images for this post's attachments", "implemented": true, "private": true, "controller": "api_posts", "action": "v3_attachment_previews", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "limit", "type": "Number", "required": false, "description": "Limit to this many results. Max of 100.", "validators": [ { "level": "Notice", "function": { "name": "validateMax", "args": [100] }, "message": "The maximum value for `limit` is 100. Using 100 for the limit.", "field": "limit" } ], "default": 10, "example": 5 }, { "name": "page", "type": "Number", "required": false, "description": "Return this page of results.", "validators": [ { "level": "Notice", "function": { "name": "validateMin", "args": [1] }, "message": "The minimum value for `page` is 1. Using 1 for the page.", "field": "page" } ], "default": 1, "example": 3 } ], "since": "2017.12" }, { "verb": "GET", "url": "/v3/posts/:id/attachments/details", "authtypes": [ "Basic", "Bearer", "Board", "Cookie", "Email", "SecretPost" ], "multihub": false, "description": "Get attachment data and previews for this post's attachments", "implemented": true, "private": true, "controller": "api_posts", "action": "v3_attachment_details", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "3.0" }, { "verb": "GET", "url": "/v3/posts/:id/attachments", "authtypes": [ "Basic", "Bearer", "Board", "Cookie", "Email", "SecretPost" ], "multihub": false, "description": "Get basic info for this post's attachments", "implemented": true, "private": true, "controller": "api_posts", "action": "v3_attachments", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "3.0" }, { "verb": "PUT", "url": "/v2/posts/:id/attachments/sort", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Set the sort order for the given attachments", "implemented": true, "private": true, "controller": "api_posts", "action": "attachments_sort", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "ids", "type": "Number[]", "required": true, "description": "The ids of the attachments in the desired order", "example": "[123,125,124]" } ], "since": "2021.01" } ] }, { "name": "posts/:id/comments", "description": "View, add, edit and delete comments.", "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/comments", "authtypes": ["Basic", "Bearer", "Cookie", "Email", "SecretPost"], "multihub": false, "description": "Get all the comments associated with the given post", "implemented": true, "controller": "api_post_comments", "action": "index", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2014.06" }, { "verb": "POST", "url": "/v2/posts/:id/comments", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Create a comment for the given post ID.", "implemented": true, "controller": "api_post_comments", "permission": ["add_comments"], "action": "add_edit", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "text", "type": "String", "required": true, "description": "The comment text", "example": "This is great intel", "logging": { "maxlen": 2000 }, "validators": [ { "level": "Notice", "function": { "name": "validateTruncateAt", "args": [2000] }, "message": "text was truncated at 2000 characters.", "field": "text" } ] }, { "name": "date_created", "type": "Date", "required": false, "description": "The date the comment was created. Defaults to the current date and time.", "example": "2014-04-25T23:09:58+00:00" }, { "name": "commenter", "type": "Number", "required": false, "description": "The ID of the user who made the comment", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That commenter is not a known user", "field": "commenter" } ] } ], "since": "2014.06" }, { "verb": "POST", "url": "/v2/posts/:id/comments/:commentId/mentions", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Send a notification to a user or group of users", "implemented": true, "controller": "api_post_comments", "action": "comment_mentions", "permission": ["mention_users"], "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" }, { "name": ":commentId", "type": "Number", "required": true, "description": "This ID of the comment", "example": "1234" } ], "params": [ { "name": "user_ids", "type": "Array", "required": true, "description": "The ids of the users to be notified", "example": "[1,2]" } ], "since": "2.16" }, { "verb": "GET", "url": "/v2/posts/:id/comments/:commentId", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Fetch a comment for the given post ID and comment ID", "implemented": true, "controller": "api_post_comments", "action": "view", "permission": [], "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "You do not have access to that post or it does not exist.", "field": ":id" } ] }, { "name": ":commentId", "type": "Number", "required": true, "description": "The ID of the comment", "example": "1234" } ], "params": [], "since": "2014.06" }, { "verb": "PATCH", "url": "/v2/posts/:id/comments/:commentId", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Update a particular comment for the given post ID.", "implemented": true, "controller": "api_post_comments", "action": "add_edit", "permission": [], "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "You not have access to that post or it does not exist.", "field": ":id" } ] }, { "name": ":commentId", "type": "Number", "required": true, "description": "The ID of the comment", "example": "1234", "validators": [ { "level": "Error", "function": { "class": "CommentValidator", "name": "canEditOrDelete" }, "type": "NotAllowed", "message": "You are not allowed to edit this comment.", "field": ":commentId" } ] } ], "params": [ { "name": "text", "type": "String", "required": false, "description": "The comment text", "example": "This is great intel", "logging": { "maxlen": 2000 }, "validators": [ { "level": "Notice", "function": { "name": "validateTruncateAt", "args": [2000] }, "message": "text was truncated at 2000 characters.", "field": "text" } ] }, { "name": "date_created", "type": "Date", "required": false, "description": "The date the comment was created. Defaults to the current date and time.", "example": "2014-04-25T23:09:58+00:00" }, { "name": "commenter", "type": "Number", "required": false, "description": "The ID of the user who made the comment", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That commenter is not a known user", "field": "commenter_by_id" } ] } ], "since": "2014.06" }, { "verb": "DELETE", "url": "/v2/posts/:id/comments/:commentId", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Delete the comment with the given ID.", "implemented": true, "controller": "api_post_comments", "action": "delete_comment", "permission": [], "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "You do not have access to that post or it does not exist.", "field": ":id" } ] }, { "name": ":commentId", "type": "Number", "required": true, "description": "The ID of the comment", "example": "1234", "validators": [ { "level": "Error", "function": { "class": "CommentValidator", "name": "canEditOrDelete" }, "type": "NotAllowed", "message": "You are not allowed to delete this comment.", "field": ":commentId" } ] } ], "params": [], "since": "2014.06" } ] }, { "name": "posts/:id/mentions", "description": "Notify a user that they have been mentioned in a post.", "private": true, "endpoints": [ { "verb": "POST", "url": "/v2/posts/:id/mentions", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Send a notification to a user or group of users", "implemented": true, "controller": "api_post_mentions", "action": "add", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [ { "name": "user_ids", "type": "Array", "required": true, "description": "The ids of the users to be notified", "example": "[1,2]" } ], "since": "2016.01" } ] }, { "name": "posts/:id/success", "description": "Get information associated with the successful creation of the given post id.", "private": true, "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/success/dial", "authtypes": ["Bearer", "Cookie"], "description": "Get the details of the success dial", "implemented": true, "controller": "api_post_success", "action": "dial", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [], "since": "2014.06" } ] }, { "name": "posts/:id/likes", "description": "Like posts and get information on the users who liked a post.", "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/likes", "authtypes": ["Basic", "Bearer", "Cookie", "Email", "SecretPost"], "description": "Get all the likes associated with the given post", "implemented": true, "controller": "api_post_likes", "action": "index", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2014.06" }, { "verb": "POST", "url": "/v2/posts/:id/likes", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Create a like for the given post ID.", "implemented": true, "controller": "api_post_likes", "action": "add", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [ { "name": "date_created", "type": "Date", "required": false, "description": "The date the like was created. Defaults to the current date and time.", "example": "2014-04-25T23:09:58+00:00" }, { "name": "user", "type": "Number", "required": false, "description": "The ID of the user who liked the post. Defaults to the currently logged-in user.", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That user is not a known user", "field": "user" } ] } ], "since": "2014.06" }, { "verb": "GET", "url": "/v2/posts/:id/likes/:likeId", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Fetch a single like", "implemented": true, "controller": "api_post_likes", "action": "view", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" }, { "name": ":likeId", "type": "Number", "required": true, "description": "The ID of the like", "example": "1234" } ], "params": [], "since": "2014.06" }, { "verb": "DELETE", "url": "/v2/posts/:id/likes/:likeId", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Unlike a post", "implemented": true, "controller": "api_post_likes", "action": "delete", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" }, { "name": ":likeId", "type": "Number", "required": true, "description": "The ID of the like", "example": "1234" } ], "params": [], "since": "2014.06" } ] }, { "name": "posts/:id/views", "description": "Create and fetch post view records", "private": false, "endpoints": [ { "deprecated": { "date": "April 2021", "instead": "POST /v2/metrics/events with event_code of 'post_view'" }, "verb": "POST", "url": "/v2/posts/:id/views", "authtypes": ["Basic", "Bearer", "Board", "Cookie", "Email"], "description": "Create a record of a post view", "implemented": true, "controller": "api_posts", "action": "add_view", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "user_id", "type": "Number", "required": false, "description": "The id of the user who viewed the post. For Bearer, Cookie, Board and Email auth it defaults to the current user if not given.", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "Unknown user", "field": "user_id" } ] }, { "name": "created_at", "type": "Date", "required": false, "description": "The date the post was viewed. Defaults to the current date and time if not given.", "example": "2014-04-26T23:03:00+00:00" }, { "name": "board", "type": "String", "required": false, "description": "The hash of the story board the user clicked from.", "example": "2014-04-26T23:03:00+00:00" }, { "name": "referrer", "type": "String", "required": false, "description": "The referring page", "example": "https://sharpr.com/foobar" } ], "since": "2016.09" } ] }, { "name": "posts/:id/summary", "description": "Fetch and update post AI summary", "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/summary", "authtypes": ["Basic", "Bearer", "Cookie", "Email", "SecretPost"], "multihub": false, "description": "Get the summary generated by AI", "implemented": true, "private": true, "controller": "api_posts", "action": "get_summary", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "Aug 2017" }, { "verb": "PATCH", "url": "/v2/posts/:id/summary", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Update the summary generated by AI", "implemented": true, "private": true, "controller": "api_posts", "action": "update_summary", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "text", "type": "String", "required": true, "description": "The new summary text", "example": "Sentence 1.\n\nSentence 2." } ], "since": "Aug 2017" } ] }, { "name": "posts/:id/keywords", "description": "Manage ai keywords", "since": "2017.07", "endpoints": [ { "verb": "PUT", "url": "/v2/posts/:id/keywords", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Clear out existing keywords and associate one or more keywords with the given post", "implemented": true, "private": true, "controller": "api_posts", "action": "put_keywords", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [ { "name": "keywords", "type": "Object[]", "required": true, "description": "List of keywords, each containing a string `keyword` and a number `relevance`", "example": "[{\"keyword\":\"politics\",\"relevance\":0.85234}]" } ], "since": "2017.07" }, { "verb": "POST", "url": "/v2/posts/:id/keywords", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Associate one or more keywords with the given post", "implemented": true, "private": true, "controller": "api_posts", "action": "add_keywords", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [ { "name": "keywords", "type": "Object[]", "required": true, "description": "List of keywords, each containing a string `keyword` and a number `relevance`", "example": "[{\"keyword\":\"politics\",\"relevance\":0.85234}]" } ], "since": "2017.07" }, { "verb": "GET", "url": "/v2/posts/:id/keywords", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Get keywords generated by AI", "implemented": true, "private": true, "controller": "api_posts", "action": "get_keywords", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2017.07" }, { "verb": "DELETE", "url": "/v2/posts/:id/keywords/:keywordText", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Delete an AI keyword", "implemented": true, "private": true, "controller": "api_posts", "action": "delete_keyword", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" }, { "name": ":keywordText", "type": "String", "required": true, "description": "The keyword to remove (not case sensitive)", "example": "Politics" } ], "params": [], "since": "2017.07" } ] }, { "name": "posts/:id/taxonomies", "description": "Manage post taxonomies", "since": "2020.10", "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/taxonomies", "authtypes": ["Basic", "Bearer", "Cookie", "Email", "SecretPost"], "multihub": false, "description": "Get post taxonomies", "implemented": true, "private": true, "controller": "api_post_taxonomies", "action": "get_taxonomies", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2020.10" }, { "verb": "PATCH", "url": "/v2/posts/:id/taxonomies", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Update post taxonomies", "implemented": true, "private": true, "controller": "api_post_taxonomies", "action": "update_taxonomies", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "selected_option_ids", "type": "Number[]", "separator": ",", "required": true, "description": "Ids of the options selected for criteria related to the post.", "example": "2, 3, 5, 7, 11, 13" } ], "since": "2020.10" } ] }, { "name": "posts/:id/contributors", "description": "Manage post contributors", "since": "2020.10", "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/contributors", "authtypes": ["Basic", "Bearer", "Cookie", "Email", "SecretPost"], "multihub": false, "description": "Get post contributors", "implemented": true, "private": true, "controller": "api_post_contributors", "action": "get_contributors", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [] }, { "verb": "POST", "url": "/v2/posts/:id/contributors", "authtypes": ["Bearer", "Cookie"], "multihub": false, "description": "Add a post contributor", "implemented": true, "private": true, "controller": "api_post_contributors", "action": "add_contributor", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "user_id", "type": "Number", "required": true, "description": "The user id of the contributor", "example": "1", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "Unknown user", "field": "user_id" } ] }, { "name": "contributor_duty_id", "type": "Number", "required": true, "description": "The contributor duty id for the user", "example": "7", "validators": [ { "level": "Error", "function": { "name": "validateContributorDutyInInstance" }, "type": "LinkedResourceNotFound", "message": "Unknown contributor duty", "field": "contributor_duty_id" } ] } ], "since": "2020.11" }, { "verb": "DELETE", "url": "/v2/posts/:id/contributors/:contributorId", "authtypes": ["Bearer", "Cookie"], "multihub": false, "description": "Add a post contributor", "implemented": true, "private": true, "controller": "api_post_contributors", "action": "delete_contributor", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] }, { "name": ":contributorId", "type": "Number", "required": true, "description": "The post contributor id", "example": "123" } ], "params": [], "since": "2020.11" }, { "verb": "POST", "url": "/v2/posts/:id/contributors/:contributorId/approve", "authtypes": ["Bearer", "Cookie"], "multihub": false, "description": "Approve a post", "implemented": true, "private": true, "controller": "api_post_contributors", "action": "approve_post", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] }, { "name": ":contributorId", "type": "Number", "required": true, "description": "The post contributor id", "example": "123" } ], "params": [], "since": "2020.11" }, { "verb": "GET", "url": "/v2/posts/:id/contributors/me", "authtypes": ["Bearer", "Cookie", "Email"], "multihub": false, "description": "Get information about your contributor and role", "implemented": true, "private": true, "controller": "api_post_contributors", "action": "contributor_me", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2020.11" }, { "verb": "GET", "url": "/v2/posts/:id/contributors/actions_and_feedback", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Get the actions and comments of post contributors", "implemented": true, "private": true, "controller": "api_post_contributors", "action": "get_actions_and_feedback", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [] } ] }, { "name": "posts/:id/priority", "description": "Handle pinning and unpinning of posts", "since": "2018.01", "endpoints": [ { "verb": "POST", "url": "/v2/posts/:id/priority/pin", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Pin a post to the top of the intel tab", "implemented": true, "private": true, "controller": "api_post_priority", "action": "pin", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [], "since": "2018.01" }, { "verb": "POST", "url": "/v2/posts/:id/priority/unpin", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": false, "description": "Unpin a post from the intel tab", "implemented": true, "private": true, "controller": "api_post_priority", "action": "unpin", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [], "since": "2018.01" } ] }, { "name": "posts/:id/preferences", "description": "Handle preferences related to posts", "since": "2020.03", "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/preferences", "authtypes": ["Email", "Bearer", "Board", "Cookie", "SecretPost"], "multihub": false, "description": "Get all preferences related to the given post. Returns the same data as GET /v2/config/preferences", "implemented": true, "private": true, "controller": "api_config", "action": "preferences_for_post", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [], "since": "2020.03" } ] }, { "name": "posts", "description": "Read, add, update, delete and search published posts.", "endpoints": [ { "verb": "GET", "url": "/v2/posts/scrape", "authtypes": ["Bearer", "Cookie"], "description": "Get article data from a URL", "implemented": true, "controller": "api_posts", "action": "scrape", "private": true, "named": [], "params": [ { "name": "article_url", "type": "String", "required": true, "description": "The url of the article", "example": "http://url.to/article" } ], "since": "2016.09" }, { "verb": "POST", "url": "/v2/posts/:id/reindex", "authtypes": ["Bearer", "Cookie"], "description": "Reindex post on ElasticSearch", "implemented": true, "controller": "api_posts", "action": "reindex", "permission": ["all"], "private": true, "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [], "since": "2018.09" }, { "verb": "GET", "url": "/v2/posts/search", "authtypes": ["Basic", "Bearer", "Cookie", "Trusted"], "multihub": true, "description": "Get a list of posts that match the given criteria", "implemented": true, "controller": "api_posts", "action": "search", "named": [], "params": [ { "name": "term", "type": "String", "required": false, "description": "A search term", "example": "`Sony Television` OR `Sony`" }, { "name": "tags", "type": "String", "required": false, "description": "One or more tags", "example": "`sony + tv` OR `sony, tv`" }, { "name": "category_id", "map_to": "currentCategory", "separator": ",", "type": "Number[]", "required": false, "description": "One or more category IDs separated by commas", "example": "123,124" }, { "name": "domain_names", "type": "String[]", "separator": ",", "required": false, "description": "A comma-separated list of domain names that the post source must come from. Source subdomains are ignored so restricting to `money.cnn.com`, for example, will match no posts, but `cnn.com` might.", "example": "youtube.com,youtu.be", "since": "2016.05" }, { "name": "client_intel", "map_to": "isExecutive", "type": "Boolean", "required": false, "description": "Return client view posts only", "example": "true" }, { "name": "submitter", "type": "Number", "required": false, "description": "Return only posts submitted by this user ID", "example": "123" }, { "name": "publisher", "type": "Number", "required": false, "description": "Return only posts with intel text written by this user ID", "example": "123" }, { "name": "in_story", "type": "Boolean", "required": false, "description": "If true, limit to posts that have been used in stories. If false, limit to posts that have not been used in stories. Leave empty to include all posts.", "example": "true", "since": "2016.05" }, { "name": "was_emailed", "type": "Boolean", "required": false, "description": "If true, limit to posts that have been sent in an email brief. If false, limit to posts that have not been sent in an email breif. Leave empty to include all posts.", "example": "true", "since": "2016.05" }, { "name": "untagged", "type": "Boolean", "required": false, "description": "If true, limit to posts that have no tags. If false or empty, include all posts.", "example": "true", "since": "2016.05" }, { "name": "no_insight", "type": "Boolean", "required": false, "description": "If true, limit to posts that have no insight text. If false or empty, include all posts.", "example": "true", "since": "2016.05" }, { "name": "since_date", "map_to": "newerThan", "type": "Date", "required": false, "description": "Return only posts that were published after this date", "example": "2014-03-25T00:00:00+00:00" }, { "name": "before_date", "map_to": "olderThan", "type": "Date", "required": false, "description": "Return only posts that were published before this date", "example": "2014-03-26T00:00:00+00:00" }, { "name": "since_modified_date", "type": "Date", "required": false, "description": "Return only posts that were modified after this date", "example": "2016-03-25T00:00:00+00:00" }, { "name": "before_modified_date", "type": "Date", "required": false, "description": "Return only posts that were modified before this date", "example": "2016-03-26T00:00:00+00:00" }, { "name": "since_id", "map_to": "sinceId", "type": "Number", "required": false, "description": "Return only posts with ids that are greater than since_id", "example": "1234" }, { "name": "before_id", "map_to": "beforeId", "type": "Number", "required": false, "description": "Return only posts with ids that are less than before_id", "example": "1234" }, { "name": "date_preset", "type": "String", "required": false, "description": "Return only posts for a preset date range", "example": "Last 7 days, Last 30 days, This calendar week, Last calendar week, This calendar month, Last calendar month", "enum": [ "Last 7 days", "Last 30 days", "This calendar week", "Last calendar week", "This calendar month", "Last calendar month", "custom" ] }, { "name": "ids", "map_to": "post_ids", "separator": ",", "type": "Number[]", "required": false, "description": "Comma separated list of IDs to fetch", "example": "123,124,125" }, { "name": "not_ids", "map_to": "excludeIds", "separator": ",", "type": "Number[]", "required": false, "description": "Comma separated list of IDs to exclude", "example": "123,124,125" }, { "name": "order_by", "map_to": "order", "type": "String", "required": false, "description": "Sort by either `publish_date`, `created`, or `modified`", "enum": ["publish_date", "created", "modified"], "default": "publish_date", "example": "publish_date" }, { "name": "limit", "type": "Number", "required": false, "description": "Limit to this many results. Max of 100.", "validators": [ { "level": "Notice", "function": { "name": "validateMax", "args": [100] }, "message": "The maximum value for `limit` is 100. Using 100 for the limit.", "field": "limit" } ], "default": 25, "example": 5 }, { "name": "page", "type": "Number", "required": false, "description": "Return this page of results.", "validators": [ { "level": "Notice", "function": { "name": "validateMin", "args": [1] }, "message": "The minimum value for `page` is 1. Using 1 for the page.", "field": "page" } ], "default": 1, "example": 3 }, { "name": "count_only", "type": "Boolean", "required": false, "description": "If true, return a count of results as \"count\", not an array of posts.", "default": false, "example": "true", "since": "2016.05" }, { "name": "exclude_copied", "type": "String", "required": false, "description": "Exclude posts from search results if they have been copied to hubs with these ids.", "example": "123,456,789" }, { "name": "approval_status", "map_to": "approvalStatus", "type": "String", "required": false, "description": "Limit search results by approval status. Valid options are \"approved\" or \"unapproved\".", "example": "approved" }, { "name": "classification_id", "map_to": "classificationId", "type": "Number[]", "separator": ",", "required": false, "description": "One or more classification IDs separated by commas.", "example": "7,1002" }, { "name": "submission_medium", "type": "String[]", "separator": ",", "required": false, "description": "The submission medium or media to include in results. Must be one or more of the following: app, mobile, email, intel, bookmarklet, screenshot, api, ifttt, news_feed, unknown.", "enum": [ "app", "mobile", "email", "intel", "bookmarklet", "screenshot", "api", "ifttt", "news_feed", "msteams", "ext_source", "unknown" ], "example": "\"desktop\" or \"desktop,mobile\"" }, { "name": "thread_id", "type": "String[]", "separator": ",", "required": false, "description": "The id or ids used to track copied posts.", "example": "E98A9DDD-2E52-481D-8486-37BF5886F0DF,D98A9EEE-2E52-481D-8486-37BF5886F0DF" }, { "name": "submitted_from", "type": "String", "required": false, "description": "Limit results to posts that were submitted from a specific geographic location. You can request a country, a country + state/province, or a country + state/province + city. Param parts are delimited by colons, i.e., Two-letter country code:State/Province name:City name.", "example": "These are all valid values: 'US', 'US:California', 'US:Texas:Dallas', 'US:California|Oregon|Washington' (includes results from California, Oregon, or Washington), France::Paris (region name is not required when querying for a city)" } ], "since": "2014.06" }, { "verb": "GET", "url": "/v3/posts/search/suggest", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": true, "description": "Get search suggestions based on the current search phrase.", "implemented": true, "private": false, "controller": "api_posts", "action": "v3_search_suggest", "named": [], "params": [ { "name": "term", "type": "String", "required": true, "description": "A search term/phrase or partial term/phrase", "example": "Mobile phone" }, { "name": "limit", "type": "Number", "required": false, "description": "Limit to this many results. Max of 25.", "validators": [ { "level": "Notice", "function": { "name": "validateMax", "args": [25] }, "message": "The maximum value for `limit` is 25. Using 25 for the limit.", "field": "limit" } ], "default": 10, "example": 5 } ], "since": "2020.07" }, { "verb": "GET", "url": "/v3/posts/search", "authtypes": ["Basic", "Bearer", "Cookie", "Trusted"], "multihub": true, "description": "Get a list of posts that match the given criteria", "implemented": true, "private": false, "controller": "api_posts", "action": "v3_search", "permission": ["login"], "named": [], "params": [ { "name": "term", "type": "String", "required": false, "description": "A search term", "example": "`Sony Television` OR `Sony`" }, { "name": "tags", "type": "String", "required": false, "description": "One or more tags", "example": "`sony + tv` OR `sony, tv`" }, { "name": "ai_tags", "type": "String[]", "separator": ",", "required": false, "description": "A comma-separated list of AI tags. AI tags are auto-generated keywords based on the post's full text value.", "example": "rainforest,waterfall" }, { "name": "category_id", "map_to": "currentCategory", "separator": ",", "type": "Number[]", "required": false, "description": "One or more category IDs separated by commas", "example": "123,124" }, { "name": "category_names", "type": "String[]", "separator": ";", "required": false, "description": "A semi-colon-separated list of category names.", "example": "finance;business;New York City, New York" }, { "name": "domain_names", "type": "String[]", "separator": ",", "required": false, "description": "A comma-separated list of domain names that the post source must come from. Source subdomains are ignored so restricting to `money.cnn.com`, for example, will match no posts, but `cnn.com` might.", "example": "youtube.com,youtu.be" }, { "name": "client_intel", "map_to": "isExecutive", "type": "Boolean", "required": false, "description": "Return client view posts only", "example": "true" }, { "name": "submitter", "separator": ",", "type": "Number[]", "required": false, "description": "Return only posts submitted by this user ID", "example": "123" }, { "name": "publisher", "separator": ",", "type": "Number[]", "required": false, "description": "Return only posts with intel text written by this user ID", "example": "123" }, { "name": "publisher_roles", "type": "String[]", "separator": ",", "required": false, "description": "A comma-separated list of post publisher roles to filter by.", "example": "member,intel leader" }, { "name": "publisher_domains", "type": "String[]", "separator": ",", "required": false, "description": "A comma-separated list of email address domains to filter by.", "example": "@example.com,@sharpr.com" }, { "name": "publisher_domains_treatment", "type": "String", "required": false, "description": "Whether the `publisher_domains` should be included or excluded.", "example": "include", "default": "include", "enum": ["include", "exclude"] }, { "name": "in_story", "type": "Boolean", "required": false, "description": "If true, limit to posts that have been used in stories. If false, limit to posts that have not been used in stories. Leave empty to include all posts.", "example": "true" }, { "name": "was_emailed", "type": "Boolean", "required": false, "description": "If true, limit to posts that have been sent in an email brief. If false, limit to posts that have not been sent in an email breif. Leave empty to include all posts.", "example": "true" }, { "name": "untagged", "type": "Boolean", "required": false, "description": "If true, limit to posts that have no tags. If false or empty, include all posts.", "example": "true" }, { "name": "no_insight", "type": "Boolean", "required": false, "description": "If true, limit to posts that have no insight text. If false or empty, include all posts.", "example": "true" }, { "name": "since_date", "map_to": "newerThan", "type": "Date", "required": false, "description": "Return only posts that were published after this date", "example": "2014-03-25T00:00:00+00:00" }, { "name": "before_date", "map_to": "olderThan", "type": "Date", "required": false, "description": "Return only posts that were published before this date", "example": "2014-03-26T00:00:00+00:00" }, { "name": "since_created_date", "type": "Date", "required": false, "description": "Return only posts that were *created* after this date", "example": "2014-03-25T00:00:00+00:00" }, { "name": "before_created_date", "type": "Date", "required": false, "description": "Return only posts that were *created* before this date", "example": "2014-03-26T00:00:00+00:00" }, { "name": "since_processed_date", "type": "Date", "required": false, "description": "Return only posts that finished processing attachments after this date", "example": "2014-03-25T00:00:00+00:00" }, { "name": "before_processed_date", "type": "Date", "required": false, "description": "Return only posts that finished processing attachments before this date", "example": "2014-03-26T00:00:00+00:00" }, { "name": "since_modified_date", "type": "Date", "required": false, "description": "Return only posts that were modified after this date", "example": "2016-03-25T00:00:00+00:00" }, { "name": "before_modified_date", "type": "Date", "required": false, "description": "Return only posts that were modified before this date", "example": "2016-03-26T00:00:00+00:00" }, { "name": "since_id", "map_to": "sinceId", "type": "Number", "required": false, "description": "Return only posts with ids that are greater than since_id", "example": "1234" }, { "name": "before_id", "map_to": "beforeId", "type": "Number", "required": false, "description": "Return only posts with ids that are less than before_id", "example": "1234" }, { "name": "date_preset", "type": "String", "required": false, "description": "Return only posts for a preset date range", "example": "Last 7 days, Last 30 days, This calendar week, Last calendar week, This calendar month, Last calendar month", "enum": [ "Last 7 days", "Last 30 days", "This calendar week", "Last calendar week", "This calendar month", "Last calendar month", "custom" ] }, { "name": "ids", "map_to": "post_ids", "separator": ",", "type": "Number[]", "required": false, "description": "Comma separated list of IDs to fetch", "example": "123,124,125" }, { "name": "not_ids", "map_to": "excludeIds", "separator": ",", "type": "Number[]", "required": false, "description": "Comma separated list of IDs to exclude", "example": "123,124,125" }, { "name": "order_by", "map_to": "order", "type": "String", "required": false, "description": "Which field to sort on. Options: score, publish_date, created, modified, ids", "enum": [ "score", "publish_date", "created", "modified", "ids", "score_date_weighted" ], "default": "score", "example": "publish_date" }, { "name": "limit", "type": "Number", "required": false, "description": "Limit to this many results. Max of 100.", "validators": [ { "level": "Notice", "function": { "name": "validateMax", "args": [100] }, "message": "The maximum value for `limit` is 100. Using 100 for the limit.", "field": "limit" } ], "default": 25, "example": 5 }, { "name": "page", "type": "Number", "required": false, "description": "Return this page of results.", "validators": [ { "level": "Notice", "function": { "name": "validateMin", "args": [1] }, "message": "The minimum value for `page` is 1. Using 1 for the page.", "field": "page" } ], "default": 1, "example": 3 }, { "name": "count_only", "type": "Boolean", "required": false, "description": "If true, return a count of results as \"count\", not an array of posts.", "default": false, "example": "true" }, { "name": "exclude_copied", "separator": ",", "type": "Number[]", "required": false, "description": "Exclude posts from search results if they have been copied to hubs with these ids.", "example": "123,456,789" }, { "name": "approval_status", "map_to": "approvalStatus", "type": "String", "required": false, "description": "Limit search results by approval status. Valid options are \"approved\" or \"unapproved\".", "example": "approved" }, { "name": "classification_id", "map_to": "classificationId", "type": "Number[]", "separator": ",", "required": false, "description": "One or more classification IDs separated by commas.", "example": "7,1002" }, { "name": "classification_names", "type": "String[]", "separator": ";", "required": false, "description": "A semi-colon-separated list of classifications names.", "example": "finance;business;New York City, New York" }, { "name": "submission_medium", "type": "String[]", "separator": ",", "required": false, "description": "The submission medium or media to include in results. Must be one or more of the following: app, mobile, email, intel, bookmarklet, screenshot, api, ifttt, news_feed, unknown.", "enum": [ "app", "mobile", "email", "intel", "bookmarklet", "screenshot", "api", "ifttt", "news_feed", "msteams", "ext_source", "unknown" ], "example": "'desktop' or 'desktop,mobile'" }, { "name": "thread_id", "type": "String[]", "separator": ",", "required": false, "description": "The id or ids used to track copied posts.", "example": "E98A9DDD-2E52-481D-8486-37BF5886F0DF,D98A9EEE-2E52-481D-8486-37BF5886F0DF" }, { "name": "submitted_from", "type": "String", "required": false, "description": "Limit results to posts that were submitted from a specific geographic location. You can request a country, a country + state/province, or a country + state/province + city. Param parts are delimited by colons, i.e., Two-letter country code:State/Province name:City name.", "example": "These are all valid values: 'US', 'US:California', 'US:Texas:Dallas', 'US:California|Oregon|Washington' (includes results from California, Oregon, or Washington), France::Paris (region name is not required when querying for a city)" }, { "name": "respect_pins", "type": "Boolean", "required": false, "description": "If true, return pinned posts as first posts", "example": "true", "default": false, "since": "2018.01" }, { "name": "calculate_total", "type": "Boolean", "required": false, "description": "If false, avoid counting all records that matched.", "default": true, "example": "false" }, { "name": "engine", "type": "String", "required": false, "description": "If set, use the specified search engine. Either \"db\" for Classic or \"es\" for Advanced.", "example": "es" }, { "name": "term_behavior", "type": "String", "required": false, "description": "Multiple search terms should \"narrow\" or \"expand\" results. Default is \"expand\". Only applicable to \"es\" engine.", "default": "expand", "enum": ["narrow", "expand"], "example": "expand" }, { "name": "archive_since_date", "type": "Date", "required": false, "description": "The date the archive action will take place", "example": "2014-05-02T06:10:06+00:00" }, { "name": "archive_before_date", "type": "Date", "required": false, "description": "Return only posts that were archived before this date", "example": "2014-03-25T00:00:00+00:00" }, { "name": "archive_action", "type": "String", "required": false, "description": "Type of archive action that we want the archive date preset to apply to. `destroy`, `archive`, or `both`", "example": "archive", "enum": ["destroy", "archive", "both", "active_and_archived"] }, { "name": "includeDeleted", "type": "Boolean", "required": false, "description": "Note: only having includeDeleted without archive_action will not get archived posts.", "example": "true" }, { "name": "liked_by", "type": "String[]", "separator": ",", "required": false, "description": "One or more userIds of who liked a post separated by commas, or \"me\".", "example": "123,321" } ], "since": "2018.10" }, { "verb": "GET", "url": "/v2/posts/:id/keywords", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Get keywords generated by AI", "implemented": true, "private": true, "controller": "api_posts", "action": "keywords", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [], "since": "2017.07" }, { "verb": "GET", "url": "/v2/posts/:id/summary", "authtypes": ["Basic", "Bearer", "Cookie", "Email"], "multihub": false, "description": "Get the summary generated by AI", "implemented": true, "private": true, "controller": "api_posts", "action": "summary", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The post id", "example": "123" } ], "params": [], "since": "2017.07" }, { "verb": "GET", "url": "/v2/posts/uncurated", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": true, "description": "Get a list of uncurated/unpublished posts that match the given criteria", "implemented": true, "controller": "api_posts", "action": "uncurated", "permission": ["publish"], "named": [], "params": [ { "name": "term", "type": "String", "required": false, "description": "A search term", "example": "`Sony Television` OR `Sony`" }, { "name": "submitter", "type": "Number", "required": false, "description": "Return only posts submitted by this user ID", "example": "123" }, { "name": "publisher", "type": "Number", "required": false, "description": "Return only posts with intel text written by this user ID", "example": "123" }, { "name": "data_feed", "type": "Number", "map_to": "feed", "required": false, "description": "Return only posts that come from the data feed with this ID", "example": "123" }, { "name": "data_feed_group", "type": "Number", "map_to": "feedGroup", "required": false, "description": "Return only posts that come from a data feed in the data feed group with this ID", "example": "123" }, { "name": "since_date", "map_to": "createdAfter", "type": "Date", "required": false, "description": "Return only posts that were published after this date", "example": "2014-03-25T00:00:00+00:00" }, { "name": "before_date", "map_to": "createdBefore", "type": "Date", "required": false, "description": "Return only posts that were published before this date", "example": "2014-03-26T00:00:00+00:00" }, { "name": "order_by", "map_to": "order", "type": "String", "required": false, "description": "Sort by either `publish_date` or `created`", "example": "publish_date" }, { "name": "limit", "type": "Number", "required": false, "description": "Limit to this many results. Max of 50.", "example": "5" } ], "since": "2014.12" }, { "verb": "GET", "url": "/v2/posts/domains", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": true, "description": "Get a list of domain names from post sources", "implemented": true, "controller": "api_posts", "action": "domains", "named": [], "params": [], "since": "2016.05" }, { "verb": "GET", "url": "/v2/posts", "authtypes": ["Basic", "Bearer", "Cookie"], "multihub": true, "description": "Get the most recently published 25 posts. Equivalent to the Intel Tab.", "implemented": true, "controller": "api_posts", "action": "index", "named": [], "params": [], "since": "2014.06" }, { "verb": "POST", "url": "/v2/posts", "authtypes": ["Basic", "Bearer", "Cookie", "Trusted"], "description": "Add a new post", "implemented": true, "controller": "api_posts", "action": "add", "permission": ["submit"], "named": [], "params": [ { "name": "headline", "type": "String", "required": true, "description": "The headline", "example": "Some cool stuff happened" }, { "name": "publish", "type": "Boolean", "required": true, "description": "True to publish the post to the Intel Tab. False to add the post to the Curate Tab.", "example": "true" }, { "name": "intel_text", "type": "String", "required": false, "description": "The insight text", "example": "This post is important because...", "validators": [ { "level": "Notice", "function": { "name": "validateTruncateAt", "args": [750] }, "message": "intel_text was truncated at 750 characters.", "field": "intel_text" } ] }, { "name": "body", "type": "String", "required": false, "description": "Plain text of post. It is converted to HTML. It is overriden by `rich_text_body` if both are given.", "example": "Here is the full story..." }, { "name": "rich_text_body", "type": "String", "required": false, "description": "HTML of post. It overrides `body` if both are given. The following tags are allowed: p, a, span, img, b, table, tr, th, td, thead, tbody, tfoot, caption, col, em, strong, br, ul, ol, li. The following attributes are allowed: a[href], a[target] (\"_blank\" only), img[src], img[alt].", "example": "<p>Here is the full story...</p>" }, { "name": "full_text", "type": "String", "required": false, "description": "Full plain text from the source. Not displayed anywhere but used for searching.", "example": "Here is the full text from the source" }, { "name": "summary", "type": "String", "required": false, "description": "Summary of the post full text.", "example": "Here is a summary of the text." }, { "name": "image", "type": "String", "required": false, "description": "An image to use for the post. May be a data URI or an http URL", "example": "`data:image/jpg;base64,abc123` OR `http://example.com/image.jpg`", "logging": { "maxlen": 500 } }, { "name": "image_credit", "map_to": "copyright_text", "type": "String", "required": false, "description": "The image credit", "example": "Ken Burns" }, { "name": "image_license", "map_to": "license_link", "type": "String", "required": false, "description": "A link to the license or permission from the image credit", "example": "http://example.com/license" }, { "name": "category", "type": "Number", "required": false, "description": "The id of the category to use for this post", "example": "1" }, { "name": "tags", "type": "String|Array", "required": false, "description": "A comma-separated list of tags or an array of tags.", "example": "\"Science, Technology\" OR [\"Science\",\"Technology\"]" }, { "name": "keywords", "type": "Object[]", "required": false, "description": "List of keywords, each containing a string `keyword` and a number `relevance`", "example": "[{\"keyword\":\"politics\",\"relevance\":0.85234}]" }, { "name": "submitted_by_id", "type": "Number", "required": false, "description": "The ID of the user who submitted the post", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That submitter is not a known user", "field": "submitted_by_id" } ] }, { "name": "published_by_id", "type": "Number", "required": false, "description": "The ID of the user who added Intel Text to the post", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That publisher is not a known user", "field": "published_by_id" } ] }, { "name": "published_at", "type": "Date", "required": false, "description": "The publish date of the post. Defaults to the current date and time.", "example": "2014-04-21T23:12:30+00:00" }, { "name": "submission_medium", "type": "String", "required": false, "description": "The medium from which the post was submitted. Must be one or more of the following: app, mobile, email, intel, bookmarklet, screenshot, api, ifttt, news_feed, unknown.", "enum": [ "app", "mobile", "email", "intel", "bookmarklet", "screenshot", "api", "ifttt", "news_feed", "msteams", "ext_source", "unknown" ], "example": "" }, { "name": "source_link", "map_to": "url", "type": "String", "required": false, "description": "The URL of the source material", "example": "http://www.engadget.com/2014/04/11/shuhei-yoshida-interview/" }, { "name": "source_name", "type": "String", "required": false, "description": "The name of the source", "example": "Engadget" }, { "name": "source_author", "type": "String", "required": false, "description": "The author of the source material", "example": "Engadget Writer Guy" }, { "name": "source_date", "type": "Date", "required": false, "description": "The date of the original source. Defaults to the current date and time.", "example": "2014-04-21T23:12:30+00:00" }, { "name": "client_view", "type": "Boolean", "required": false, "description": "If true, publish to Client Intel View", "example": "true" }, { "name": "approval_status", "type": "String", "required": false, "description": "Save approval status as approved or unapproved. Status only saved if Approval workflow is enabled in this hub. Valid options are \"approved\" or \"unapproved\". Default is \"approved\" if submitted with Basic Auth. Otherwise, it is \"approved\" if the authorized user is an approver.", "example": "approved" }, { "name": "classification_id", "type": "Number", "required": false, "description": "The id of the classification for this post.", "example": 7 }, { "name": "import_breadcrumbs", "type": "Array", "required": false, "description": "Folder breadcrumbs if post was imported from dragged folders.", "example": "[\"My root folder\",\"My child folder\",\"My grandchild folder\"]" }, { "name": "import_attachment_id", "type": "Number", "required": false, "description": "The ID of the attachment if the post was imported from dragged folders.", "example": "123" }, { "name": "notify_user_ids", "type": "Number[]", "separator": ",", "required": false, "description": "Ids of users that should be notified about the new post.", "example": "2, 3, 5, 7, 11, 13" }, { "name": "archive_action", "type": "String", "required": false, "description": "The archive action 'archive' or 'destroy' or 'never'", "example": "archive", "enum": ["archive", "destroy", "never"] }, { "name": "archive_at", "type": "Date", "required": false, "description": "The date the archive action will take place", "example": "2014-05-02T06:10:06+00:00" }, { "name": "external_ref", "type": "String", "required": false, "description": "The reference value of the content on an external site.", "example": "abcdefg" }, { "name": "budget", "type": "Number", "required": false, "description": "Only saved in research management hubs.", "example": "32000" }, { "name": "type_id", "type": "Number", "required": false, "description": "The type of post, defaults to 1, post => 1, research brief => 2", "example": "1", "default": "1" } ], "since": "2014.06" }, { "verb": "GET", "url": "/v2/posts/:id", "authtypes": [ "Basic", "Bearer", "Cookie", "Email", "Trusted", "SecretPost" ], "description": "Get data about a single post", "implemented": true, "controller": "api_posts", "action": "view", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [], "since": "2014.06" }, { "verb": "GET", "url": "/v3/posts/:id", "authtypes": [ "Basic", "Bearer", "Board", "Cookie", "Email", "SecretPost", "Trusted" ], "description": "Get data about a single post", "implemented": true, "private": true, "multihub": true, "controller": "api_posts", "action": "v3_view", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "NeedPermission", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "includeDeleted", "type": "Boolean", "required": false, "description": "Note: only having includeDeleted without archive_action will not get archived posts.", "example": "true" }, { "name": "archive_action", "type": "String", "required": false, "description": "Type of archive action that we want the archive date preset to apply to. `destroy`, `archive`, or `both`", "enum": ["destroy", "archive", "both"], "example": "archive" } ], "since": "3.0" }, { "verb": "PATCH", "url": "/v2/posts/:id", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Update one or more fields on the post", "implemented": true, "controller": "api_posts", "action": "edit", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [ { "name": "intel_text", "type": "String", "required": false, "description": "The insight text", "example": "This post is important because...", "logging": { "maxlen": 250 }, "validators": [ { "level": "Notice", "function": { "name": "validateTruncateAt", "args": [750] }, "message": "intel_text was truncated at 750 characters.", "field": "intel_text" } ] }, { "name": "headline", "type": "String", "required": false, "description": "The headline", "example": "Some cool stuff happened" }, { "name": "body", "type": "String", "required": false, "description": "Full text of post. It is converted to HTML. It is overriden by `rich_text_body` if both are given.", "example": "Here is the full story..." }, { "name": "rich_text_body", "type": "String", "required": false, "description": "HTML of post. It overrides `body` if both are given. The following tags are allowed: p, a, span, img, b, table, tr, th, td, thead, tbody, tfoot, caption, col, em, strong, br, ul, ol, li. The following attributes are allowed: a[href], a[target] (\"_blank\" only), img[src], img[alt].", "example": "<p>Here is the full story...</p>" }, { "name": "image", "type": "String|Boolean", "required": false, "description": "An image to use for the post. May be a data URI or an http URL. Set to `false` to remove the existing image.", "example": "`data:image/png;base64,abc123` OR `http://example.com/image.jpg`", "logging": { "maxlen": 500 } }, { "name": "published_by_id", "type": "Number", "required": false, "description": "The ID of the user who added Intel Text to the post", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That publisher is not a known user", "field": "published_by_id" } ] }, { "name": "submitted_by_id", "map_to": "user_id", "type": "Number", "required": false, "description": "The ID of the user who created the post", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That submitter is not a known user", "field": "submitted_by_id" } ] }, { "name": "submitter_country", "type": "String", "required": false, "description": "The 2-letter country code from which this post was submitted.", "example": "US" }, { "name": "submitter_region", "type": "String", "required": false, "description": "The state, province or region from which this post was submitted.", "example": "Texas" }, { "name": "submitter_city", "type": "String", "required": false, "description": "The city from which this post was submitted.", "example": "Dallas" }, { "name": "published_at", "type": "Date", "required": false, "description": "The date to mark the post as published at.", "example": "2014-05-02T06:10:06+00:00" }, { "name": "created_at", "map_to": "created", "type": "Date", "required": false, "description": "The date to mark the post as created at.", "example": "2014-05-02T06:10:06+00:00" }, { "name": "source_date", "type": "Date", "required": false, "description": "The date of the source material", "example": "2014-05-02T06:10:06+00:00" }, { "name": "source_link", "type": "String", "required": false, "description": "The URL of the source material", "example": "http://www.engadget.com/2014/04/11/shuhei-yoshida-interview/" }, { "name": "source_name", "type": "String", "required": false, "description": "The name of the source", "example": "Engadget" }, { "name": "source_author", "type": "String", "required": false, "description": "The author of the source material", "example": "Engadget Writer Guy" }, { "name": "is_client_intel", "type": "Boolean", "required": false, "description": "Set to true to make the post available to clients to view", "example": "true" }, { "name": "category", "type": "Number", "required": false, "description": "The id of the category to use for this post. Send 0 to remove the category from the post.", "example": "1" }, { "name": "tags", "type": "String|Array", "required": false, "map_to": "tag_with", "description": "A comma-separated list of tags or an array of tags. These will replace any tags previously associated with the post.", "example": "\"Science, Technology\" OR [\"Science\",\"Technology\"]" }, { "name": "approval_status", "type": "String", "required": false, "default": "unapproved", "description": "Save approval status as approved or unapproved. Status only saved if Approval workflow is enabled in this hub. Valid options are \"approved\" or \"unapproved\".", "example": "approved" }, { "name": "classification_id", "type": "Number", "required": false, "description": "The id of the classification for this post.", "example": 7 }, { "name": "archive_action", "type": "String", "required": false, "description": "The archive action 'archive' or 'destroy' or 'never'", "example": "archive", "enum": ["archive", "destroy", "never"] }, { "name": "archive_at", "type": "Date", "required": false, "description": "The date the archive action will take place", "example": "2014-05-02T06:10:06+00:00" }, { "name": "budget", "type": "Number", "required": false, "description": "Only saved on research management hubs.", "example": "32000" }, { "name": "type_id", "type": "Number", "required": false, "description": "The type of post, defaults to 1, post => 1, research brief => 2", "example": "1" } ], "since": "2014.06" }, { "verb": "DELETE", "url": "/v2/posts/:id", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Delete the post with the given ID.", "implemented": true, "controller": "api_posts", "action": "delete", "permission": ["delete_post"], "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [], "since": "2014.06" }, { "verb": "POST", "url": "/v2/posts/fetch", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Fetch the contents of the given URL and create a new post", "implemented": true, "controller": "api_posts", "action": "fetch", "permission": [], "named": [], "params": [ { "name": "url", "type": "String", "required": true, "description": "The public URL to fetch", "example": "https://intel.to/mclaren" }, { "name": "intel_text", "type": "String", "required": false, "description": "The insight text", "example": "This post is important because...", "logging": { "maxlen": 250 }, "validators": [ { "level": "Notice", "function": { "name": "validateTruncateAt", "args": [750] }, "message": "intel_text was truncated at 750 characters.", "field": "intel_text" } ] }, { "name": "tags", "type": "String|Array", "required": false, "map_to": "tag_with", "description": "A comma-separated list of tags or an array of tags.", "example": "\"Science, Technology\" OR [\"Science\",\"Technology\"]" }, { "name": "submitted_by_id", "type": "Number", "required": false, "description": "The ID of the user who submitted the post", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That submitter is not a known user", "field": "submitted_by_id" } ] }, { "name": "published_by_id", "type": "Number", "required": false, "description": "The ID of the user who added Intel Text to the post", "example": "123", "validators": [ { "level": "Error", "function": { "name": "validateUserInInstance" }, "type": "LinkedResourceNotFound", "message": "That publisher is not a known user", "field": "published_by_id" } ] }, { "name": "client_view", "type": "Boolean", "required": false, "description": "If true, publish to Client Intel View", "example": "true" }, { "name": "publish", "type": "Boolean", "required": true, "description": "True to publish the post to the Intel Tab. False to add the post to the Curate Tab.", "example": "true" } ], "since": "2014.09" }, { "verb": "POST", "url": "/v2/posts/:id/copy", "authtypes": ["Bearer", "Cookie"], "description": "Attempt to copy the post with the given ID to another hub and return a report about the results.", "implemented": true, "controller": "api_posts", "action": "copy", "permission": ["copy_posts"], "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post to copy", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [ { "name": "hubs", "type": "Number[]", "separator": ",", "required": true, "description": "An array of hub IDs to copy the post to. Any hubs that the user does not have access to will be ignored.", "example": "[123,456,789]" } ], "since": "2016.08" }, { "verb": "GET", "url": "/v2/posts/dupes", "authtypes": ["Bearer", "Cookie"], "description": "Check if a post already exists with the given URL in any hubs in my account", "implemented": true, "controller": "api_posts", "action": "dupes", "permission": ["submit"], "named": [], "params": [ { "name": "article_url", "type": "String", "required": true, "description": "The URL to check", "example": "http://www.bbc.com/culture/story/20170509-can-athens-become-europes-new-arts-capital" } ], "since": "2017.09" }, { "verb": "PATCH", "url": "/v2/posts/:id/archive", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Archive the post with the given ID.", "implemented": true, "controller": "api_posts", "action": "archive", "permission": ["delete_post"], "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [], "since": "2019.10" }, { "verb": "POST", "url": "/v2/posts/:id/unarchive", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Unarchive a post and update the archive date and archive action", "implemented": true, "controller": "api_posts", "action": "unarchive", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "params": [ { "name": "archive_action", "type": "String", "required": true, "description": "The archive action 'archive' or 'destroy' or 'never", "example": "archive", "enum": ["archive", "destroy", "never"] }, { "name": "archive_at", "type": "Date", "required": false, "description": "The date the archive action will take place, this needs to be provided if archive_action is archive or destroy", "example": "2014-05-02T06:10:06+00:00" } ], "since": "2019.10" }, { "verb": "POST", "url": "/v2/posts/bulk_update", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Mass update, copy, delete, destroy, or archive posts", "implemented": true, "controller": "api_posts", "action": "bulk_update", "permission": ["all"], "private": true, "named": [], "params": [ { "name": "post_ids", "type": "Array", "required": true, "description": "The ids of the posts to be deleted", "example": "[1,2]" }, { "name": "action", "type": "String", "required": true, "description": "The action you want to take on the post ids, \"delete\", \"destroy\", \"archive\", \"move\", \"copy\", or \"update\"", "enum": [ "delete", "destroy", "archive", "move", "copy", "update" ], "example": "delete" }, { "name": "hub_ids", "type": "Array", "required": false, "description": "For \"move\" and \"copy\", the client ids to move/copy posts to", "example": "[1,2]" } ], "since": "2019.10" }, { "verb": "GET", "url": "/v2/posts/counts", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Get a count of all posts in this hub broken out by db, es including deleted", "implemented": true, "multihub": true, "controller": "api_posts", "action": "counts", "permission": ["all"], "private": true, "named": [], "params": [], "since": "2020.03" }, { "verb": "POST", "url": "/v2/posts/:id/translate", "authtypes": ["Basic", "Bearer", "Cookie", "Self"], "description": "Translate post text", "implemented": true, "controller": "api_posts", "action": "translate", "permission": ["submit"], "private": true, "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" } ], "since": "2020.06" }, { "verb": "GET", "url": "/v2/posts/translations", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "View what languages posts have been translated from in a hub", "implemented": true, "controller": "api_posts", "action": "translations", "private": true, "named": [], "since": "2020.06" }, { "verb": "POST", "url": "/v2/posts/translate", "authtypes": ["Basic", "Bearer", "Cookie", "Self"], "description": "Translate all posts in a hub into the hub language", "implemented": true, "controller": "api_posts", "action": "translate_hub", "permission": ["all"], "private": true, "named": [], "since": "2020.06" }, { "verb": "GET", "url": "/v2/posts/:id/original/:language", "authtypes": ["Basic", "Bearer", "Cookie"], "description": "Get the original post text for a translated post ", "implemented": true, "controller": "api_posts", "action": "translation_original", "private": true, "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234" }, { "name": ":language", "type": "String", "required": true, "description": "The ISO 639-1 language code of the orignal text", "example": "es", "enum": [ "ar", "hy", "eu", "bg", "ca", "zh", "ja", "ko", "vi", "cs", "da", "nl", "en", "fi", "fr", "de", "gl", "el", "hi", "hu", "id", "ga", "it", "lv", "lt", "no", "fa", "pt", "ro", "ru", "ku", "es", "sv", "tr", "th" ] } ], "since": "2020.06" } ] }, { "name": "posts/:id/secret_links", "description": "Get add and delete post secret links", "endpoints": [ { "verb": "GET", "url": "/v2/posts/:id/secret_links", "authtypes": ["Bearer", "Cookie"], "description": "Get the secret link for the post", "implemented": true, "controller": "api_post_secret_links", "action": "getSecretLink", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2021.04" }, { "verb": "POST", "url": "/v2/posts/:id/secret_links", "authtypes": ["Bearer", "Cookie"], "description": "Create a Secret Link", "implemented": true, "controller": "api_post_secret_links", "action": "create", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2021.04" }, { "verb": "DELETE", "url": "/v2/posts/:id/secret_links", "authtypes": ["Bearer", "Cookie"], "description": "Delete a Secret Link", "implemented": true, "controller": "api_post_secret_links", "action": "delete", "named": [ { "name": ":id", "type": "Number", "required": true, "description": "The ID of the post", "example": "1234", "validators": [ { "level": "Error", "function": { "name": "validateAccessPost" }, "type": "LinkedResourceNotFound", "message": "The user does not have access to that post or it does not exist.", "field": ":id" } ] } ], "params": [], "since": "2021.04" } ] }, { "name": "posts/export", "description": "Exports of post data", "endpoints": [ { "verb": "GET", "url": "/v2/posts/export", "authtypes": ["Bearer", "Cookie", "Trusted"], "description": "Export all post data for the given hub to a spreadsheet. Requests to this endpoint can take a long time on hubs with many posts. It is recommended you run this as a job.", "implemented": true, "controller": "api_posts", "action": "export", "named": [], "params": [ { "name": "full_text", "type": "Boolean", "required": false, "description": "Should results include a full text column?", "example": "true", "default": false }, { "name": "attachment_names", "type": "Boolean", "required": false, "description": "Should results include an attachment names column?", "example": "true", "default": false } ], "since": "2021.06" } ] } ] } ;
Tests:
Produce
const result = immer.produce(state, draft => { draft.resources[14].endpoints[0].params[1].required = true })
CloneDeep
const result = _.cloneDeep(state); result.resources[14].endpoints[0].params[1].required = true;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Produce
CloneDeep
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It seems like you're providing an example of a benchmarking configuration in JavaScript, specifically for testing the performance of two functions: `immer.produce` and `_`.cloneDeep`. To summarize: 1. You have a JSON object with three properties: * `authtypes`: an array of authentication types * `description`: a string describing the endpoint * `implemented`, `controller`, `action`, and `named` properties describing the endpoint's implementation details 2. You also have two individual test cases: * One using `immer.produce` * Another using `_`.cloneDeep` 3. The latest benchmark result shows the performance metrics for both functions, including the browser, device platform, operating system, executions per second, and test name. Based on this information, I'll provide a hypothetical answer: To optimize the performance of `immer.produce` and `_`.cloneDeep`, consider the following suggestions: **immer.produce** * Use a shallow copy by default (`immer.produce(state, draft => { ... }`) instead of a deep copy. * Consider using `immer.produce` with the `draft` function to optimize performance. **_.cloneDeep** * Use the `lodash.mergeDeep` method for deeper copying or use `_.extendBy` to achieve similar results. * Consider memoizing the result of `_.cloneDeep` to avoid recalculating it on subsequent calls. Keep in mind that these suggestions are hypothetical, and you may need to experiment with different approaches to find the best fit for your specific use case.
Related benchmarks:
Lodash CloneDeep vs Immer Produce
Lodash cloneDeep vs JSON Clone zzz
Lodash CloneDeep vs Immer Produce with heavy load
Ramda vs Lodash CloneDeep vs Immer Produce with heavy load
Comments
Confirm delete:
Do you really want to delete benchmark?