n8n-nodes-the-mastodon 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +19 -0
- package/README.md +216 -0
- package/dist/__tests__/Mastodon.test.d.ts +1 -0
- package/dist/__tests__/Mastodon.test.js +29 -0
- package/dist/__tests__/Mastodon.test.js.map +1 -0
- package/dist/__tests__/account.test.d.ts +1 -0
- package/dist/__tests__/account.test.js +52 -0
- package/dist/__tests__/account.test.js.map +1 -0
- package/dist/__tests__/bookmarks.test.d.ts +1 -0
- package/dist/__tests__/bookmarks.test.js +48 -0
- package/dist/__tests__/bookmarks.test.js.map +1 -0
- package/dist/__tests__/lists.test.d.ts +1 -0
- package/dist/__tests__/lists.test.js +98 -0
- package/dist/__tests__/lists.test.js.map +1 -0
- package/dist/__tests__/status.test.d.ts +1 -0
- package/dist/__tests__/status.test.js +142 -0
- package/dist/__tests__/status.test.js.map +1 -0
- package/dist/__tests__/timeline.test.d.ts +1 -0
- package/dist/__tests__/timeline.test.js +152 -0
- package/dist/__tests__/timeline.test.js.map +1 -0
- package/dist/credentials/Mastodon.svg +4 -0
- package/dist/credentials/MastodonOAuth2Api.credentials.d.ts +17 -0
- package/dist/credentials/MastodonOAuth2Api.credentials.js +209 -0
- package/dist/credentials/MastodonOAuth2Api.credentials.js.map +1 -0
- package/dist/nodes/Mastodon/Mastodon.node.d.ts +6 -0
- package/dist/nodes/Mastodon/Mastodon.node.js +300 -0
- package/dist/nodes/Mastodon/Mastodon.node.js.map +1 -0
- package/dist/nodes/Mastodon/Mastodon.svg +4 -0
- package/dist/nodes/Mastodon/Mastodon_Methods.d.ts +21 -0
- package/dist/nodes/Mastodon/Mastodon_Methods.js +616 -0
- package/dist/nodes/Mastodon/Mastodon_Methods.js.map +1 -0
- package/dist/nodes/Mastodon/Mastodon_Properties.d.ts +33 -0
- package/dist/nodes/Mastodon/Mastodon_Properties.js +124 -0
- package/dist/nodes/Mastodon/Mastodon_Properties.js.map +1 -0
- package/dist/nodes/Mastodon/account/AccountInterfaces.d.ts +39 -0
- package/dist/nodes/Mastodon/account/AccountInterfaces.js +3 -0
- package/dist/nodes/Mastodon/account/AccountInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/account/AccountMethods.d.ts +27 -0
- package/dist/nodes/Mastodon/account/AccountMethods.js +185 -0
- package/dist/nodes/Mastodon/account/AccountMethods.js.map +1 -0
- package/dist/nodes/Mastodon/account/AccountProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/account/AccountProperties.js +189 -0
- package/dist/nodes/Mastodon/account/AccountProperties.js.map +1 -0
- package/dist/nodes/Mastodon/account/RoleInterface.d.ts +10 -0
- package/dist/nodes/Mastodon/account/RoleInterface.js +3 -0
- package/dist/nodes/Mastodon/account/RoleInterface.js.map +1 -0
- package/dist/nodes/Mastodon/account/index.d.ts +30 -0
- package/dist/nodes/Mastodon/account/index.js +70 -0
- package/dist/nodes/Mastodon/account/index.js.map +1 -0
- package/dist/nodes/Mastodon/admin/AdminInterfaces.d.ts +93 -0
- package/dist/nodes/Mastodon/admin/AdminInterfaces.js +3 -0
- package/dist/nodes/Mastodon/admin/AdminInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/admin/canonical-email-blocks/CanonicalEmailBlockMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/admin/canonical-email-blocks/CanonicalEmailBlockMethods.js +27 -0
- package/dist/nodes/Mastodon/admin/canonical-email-blocks/CanonicalEmailBlockMethods.js.map +1 -0
- package/dist/nodes/Mastodon/admin/canonical-email-blocks/CanonicalEmailBlockProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/admin/canonical-email-blocks/CanonicalEmailBlockProperties.js +91 -0
- package/dist/nodes/Mastodon/admin/canonical-email-blocks/CanonicalEmailBlockProperties.js.map +1 -0
- package/dist/nodes/Mastodon/admin/cohorts/CohortMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/admin/cohorts/CohortMethods.js +16 -0
- package/dist/nodes/Mastodon/admin/cohorts/CohortMethods.js.map +1 -0
- package/dist/nodes/Mastodon/admin/cohorts/CohortProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/admin/cohorts/CohortProperties.js +67 -0
- package/dist/nodes/Mastodon/admin/cohorts/CohortProperties.js.map +1 -0
- package/dist/nodes/Mastodon/admin/dimensions/DimensionMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/admin/dimensions/DimensionMethods.js +13 -0
- package/dist/nodes/Mastodon/admin/dimensions/DimensionMethods.js.map +1 -0
- package/dist/nodes/Mastodon/admin/dimensions/DimensionProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/admin/dimensions/DimensionProperties.js +48 -0
- package/dist/nodes/Mastodon/admin/dimensions/DimensionProperties.js.map +1 -0
- package/dist/nodes/Mastodon/admin/ips/IpMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/admin/ips/IpMethods.js +23 -0
- package/dist/nodes/Mastodon/admin/ips/IpMethods.js.map +1 -0
- package/dist/nodes/Mastodon/admin/ips/IpProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/admin/ips/IpProperties.js +43 -0
- package/dist/nodes/Mastodon/admin/ips/IpProperties.js.map +1 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementInterfaces.d.ts +9 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementInterfaces.js +3 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementMethods.js +8 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementMethods.js.map +1 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementProperties.js +25 -0
- package/dist/nodes/Mastodon/announcements/AnnouncementProperties.js.map +1 -0
- package/dist/nodes/Mastodon/announcements/index.d.ts +6 -0
- package/dist/nodes/Mastodon/announcements/index.js +46 -0
- package/dist/nodes/Mastodon/announcements/index.js.map +1 -0
- package/dist/nodes/Mastodon/apps/AppsMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/apps/AppsMethods.js +22 -0
- package/dist/nodes/Mastodon/apps/AppsMethods.js.map +1 -0
- package/dist/nodes/Mastodon/apps/AppsProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/apps/AppsProperties.js +63 -0
- package/dist/nodes/Mastodon/apps/AppsProperties.js.map +1 -0
- package/dist/nodes/Mastodon/apps/index.d.ts +7 -0
- package/dist/nodes/Mastodon/apps/index.js +47 -0
- package/dist/nodes/Mastodon/apps/index.js.map +1 -0
- package/dist/nodes/Mastodon/authentication/AuthenticationMethods.d.ts +21 -0
- package/dist/nodes/Mastodon/authentication/AuthenticationMethods.js +89 -0
- package/dist/nodes/Mastodon/authentication/AuthenticationMethods.js.map +1 -0
- package/dist/nodes/Mastodon/authentication/AuthenticationProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/authentication/AuthenticationProperties.js +103 -0
- package/dist/nodes/Mastodon/authentication/AuthenticationProperties.js.map +1 -0
- package/dist/nodes/Mastodon/authentication/index.d.ts +4 -0
- package/dist/nodes/Mastodon/authentication/index.js +11 -0
- package/dist/nodes/Mastodon/authentication/index.js.map +1 -0
- package/dist/nodes/Mastodon/blocks/BlocksMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/blocks/BlocksMethods.js +14 -0
- package/dist/nodes/Mastodon/blocks/BlocksMethods.js.map +1 -0
- package/dist/nodes/Mastodon/blocks/BlocksProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/blocks/BlocksProperties.js +27 -0
- package/dist/nodes/Mastodon/blocks/BlocksProperties.js.map +1 -0
- package/dist/nodes/Mastodon/blocks/index.d.ts +7 -0
- package/dist/nodes/Mastodon/blocks/index.js +47 -0
- package/dist/nodes/Mastodon/blocks/index.js.map +1 -0
- package/dist/nodes/Mastodon/bookmarks/BookmarksMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/bookmarks/BookmarksMethods.js +38 -0
- package/dist/nodes/Mastodon/bookmarks/BookmarksMethods.js.map +1 -0
- package/dist/nodes/Mastodon/bookmarks/BookmarksProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/bookmarks/BookmarksProperties.js +61 -0
- package/dist/nodes/Mastodon/bookmarks/BookmarksProperties.js.map +1 -0
- package/dist/nodes/Mastodon/bookmarks/index.d.ts +8 -0
- package/dist/nodes/Mastodon/bookmarks/index.js +48 -0
- package/dist/nodes/Mastodon/bookmarks/index.js.map +1 -0
- package/dist/nodes/Mastodon/conversations/ConversationInterfaces.d.ts +6 -0
- package/dist/nodes/Mastodon/conversations/ConversationInterfaces.js +3 -0
- package/dist/nodes/Mastodon/conversations/ConversationInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/conversations/ConversationMethods.d.ts +5 -0
- package/dist/nodes/Mastodon/conversations/ConversationMethods.js +32 -0
- package/dist/nodes/Mastodon/conversations/ConversationMethods.js.map +1 -0
- package/dist/nodes/Mastodon/conversations/ConversationProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/conversations/ConversationProperties.js +97 -0
- package/dist/nodes/Mastodon/conversations/ConversationProperties.js.map +1 -0
- package/dist/nodes/Mastodon/conversations/index.d.ts +8 -0
- package/dist/nodes/Mastodon/conversations/index.js +48 -0
- package/dist/nodes/Mastodon/conversations/index.js.map +1 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisInterfaces.d.ts +7 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisInterfaces.js +3 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisMethods.js +8 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisMethods.js.map +1 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisProperties.js +25 -0
- package/dist/nodes/Mastodon/customEmojis/CustomEmojisProperties.js.map +1 -0
- package/dist/nodes/Mastodon/customEmojis/index.d.ts +6 -0
- package/dist/nodes/Mastodon/customEmojis/index.js +46 -0
- package/dist/nodes/Mastodon/customEmojis/index.js.map +1 -0
- package/dist/nodes/Mastodon/directory/DirectoryInterfaces.d.ts +9 -0
- package/dist/nodes/Mastodon/directory/DirectoryInterfaces.js +3 -0
- package/dist/nodes/Mastodon/directory/DirectoryInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/directory/DirectoryMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/directory/DirectoryMethods.js +22 -0
- package/dist/nodes/Mastodon/directory/DirectoryMethods.js.map +1 -0
- package/dist/nodes/Mastodon/directory/DirectoryProperties.d.ts +10 -0
- package/dist/nodes/Mastodon/directory/DirectoryProperties.js +81 -0
- package/dist/nodes/Mastodon/directory/DirectoryProperties.js.map +1 -0
- package/dist/nodes/Mastodon/directory/index.d.ts +6 -0
- package/dist/nodes/Mastodon/directory/index.js +46 -0
- package/dist/nodes/Mastodon/directory/index.js.map +1 -0
- package/dist/nodes/Mastodon/domainBlocks/DomainBlocksMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/domainBlocks/DomainBlocksMethods.js +14 -0
- package/dist/nodes/Mastodon/domainBlocks/DomainBlocksMethods.js.map +1 -0
- package/dist/nodes/Mastodon/domainBlocks/DomainBlocksProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/domainBlocks/DomainBlocksProperties.js +27 -0
- package/dist/nodes/Mastodon/domainBlocks/DomainBlocksProperties.js.map +1 -0
- package/dist/nodes/Mastodon/domainBlocks/index.d.ts +7 -0
- package/dist/nodes/Mastodon/domainBlocks/index.js +47 -0
- package/dist/nodes/Mastodon/domainBlocks/index.js.map +1 -0
- package/dist/nodes/Mastodon/domains/allowed/AllowedDomainMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/domains/allowed/AllowedDomainMethods.js +27 -0
- package/dist/nodes/Mastodon/domains/allowed/AllowedDomainMethods.js.map +1 -0
- package/dist/nodes/Mastodon/domains/allowed/AllowedDomainProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/domains/allowed/AllowedDomainProperties.js +91 -0
- package/dist/nodes/Mastodon/domains/allowed/AllowedDomainProperties.js.map +1 -0
- package/dist/nodes/Mastodon/domains/blocked/BlockedDomainMethods.d.ts +5 -0
- package/dist/nodes/Mastodon/domains/blocked/BlockedDomainMethods.js +52 -0
- package/dist/nodes/Mastodon/domains/blocked/BlockedDomainMethods.js.map +1 -0
- package/dist/nodes/Mastodon/domains/blocked/BlockedDomainProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/domains/blocked/BlockedDomainProperties.js +182 -0
- package/dist/nodes/Mastodon/domains/blocked/BlockedDomainProperties.js.map +1 -0
- package/dist/nodes/Mastodon/domains/email-blocked/EmailBlockedDomainMethods.d.ts +5 -0
- package/dist/nodes/Mastodon/domains/email-blocked/EmailBlockedDomainMethods.js +32 -0
- package/dist/nodes/Mastodon/domains/email-blocked/EmailBlockedDomainMethods.js.map +1 -0
- package/dist/nodes/Mastodon/domains/email-blocked/EmailBlockedDomainProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/domains/email-blocked/EmailBlockedDomainProperties.js +111 -0
- package/dist/nodes/Mastodon/domains/email-blocked/EmailBlockedDomainProperties.js.map +1 -0
- package/dist/nodes/Mastodon/domains/index.d.ts +13 -0
- package/dist/nodes/Mastodon/domains/index.js +59 -0
- package/dist/nodes/Mastodon/domains/index.js.map +1 -0
- package/dist/nodes/Mastodon/emails/EmailsMethods.d.ts +2 -0
- package/dist/nodes/Mastodon/emails/EmailsMethods.js +8 -0
- package/dist/nodes/Mastodon/emails/EmailsMethods.js.map +1 -0
- package/dist/nodes/Mastodon/emails/EmailsProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/emails/EmailsProperties.js +21 -0
- package/dist/nodes/Mastodon/emails/EmailsProperties.js.map +1 -0
- package/dist/nodes/Mastodon/endorsements/EndorsementMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/endorsements/EndorsementMethods.js +8 -0
- package/dist/nodes/Mastodon/endorsements/EndorsementMethods.js.map +1 -0
- package/dist/nodes/Mastodon/endorsements/EndorsementProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/endorsements/EndorsementProperties.js +27 -0
- package/dist/nodes/Mastodon/endorsements/EndorsementProperties.js.map +1 -0
- package/dist/nodes/Mastodon/endorsements/index.d.ts +6 -0
- package/dist/nodes/Mastodon/endorsements/index.js +46 -0
- package/dist/nodes/Mastodon/endorsements/index.js.map +1 -0
- package/dist/nodes/Mastodon/favourites/FavouritesMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/favourites/FavouritesMethods.js +14 -0
- package/dist/nodes/Mastodon/favourites/FavouritesMethods.js.map +1 -0
- package/dist/nodes/Mastodon/favourites/FavouritesProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/favourites/FavouritesProperties.js +27 -0
- package/dist/nodes/Mastodon/favourites/FavouritesProperties.js.map +1 -0
- package/dist/nodes/Mastodon/favourites/index.d.ts +7 -0
- package/dist/nodes/Mastodon/favourites/index.js +47 -0
- package/dist/nodes/Mastodon/favourites/index.js.map +1 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagInterfaces.d.ts +7 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagInterfaces.js +3 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagMethods.d.ts +5 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagMethods.js +18 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagMethods.js.map +1 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagProperties.js +68 -0
- package/dist/nodes/Mastodon/featuredTags/FeaturedTagProperties.js.map +1 -0
- package/dist/nodes/Mastodon/featuredTags/index.d.ts +8 -0
- package/dist/nodes/Mastodon/featuredTags/index.js +48 -0
- package/dist/nodes/Mastodon/featuredTags/index.js.map +1 -0
- package/dist/nodes/Mastodon/filters/FiltersMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/filters/FiltersMethods.js +32 -0
- package/dist/nodes/Mastodon/filters/FiltersMethods.js.map +1 -0
- package/dist/nodes/Mastodon/filters/FiltersProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/filters/FiltersProperties.js +190 -0
- package/dist/nodes/Mastodon/filters/FiltersProperties.js.map +1 -0
- package/dist/nodes/Mastodon/filters/index.d.ts +8 -0
- package/dist/nodes/Mastodon/filters/index.js +48 -0
- package/dist/nodes/Mastodon/filters/index.js.map +1 -0
- package/dist/nodes/Mastodon/followRequests/FollowRequestMethods.d.ts +6 -0
- package/dist/nodes/Mastodon/followRequests/FollowRequestMethods.js +18 -0
- package/dist/nodes/Mastodon/followRequests/FollowRequestMethods.js.map +1 -0
- package/dist/nodes/Mastodon/followRequests/FollowRequestProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/followRequests/FollowRequestProperties.js +54 -0
- package/dist/nodes/Mastodon/followRequests/FollowRequestProperties.js.map +1 -0
- package/dist/nodes/Mastodon/followRequests/index.d.ts +8 -0
- package/dist/nodes/Mastodon/followRequests/index.js +48 -0
- package/dist/nodes/Mastodon/followRequests/index.js.map +1 -0
- package/dist/nodes/Mastodon/followedTags/FollowedTagsMethods.d.ts +2 -0
- package/dist/nodes/Mastodon/followedTags/FollowedTagsMethods.js +19 -0
- package/dist/nodes/Mastodon/followedTags/FollowedTagsMethods.js.map +1 -0
- package/dist/nodes/Mastodon/followedTags/FollowedTagsProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/followedTags/FollowedTagsProperties.js +64 -0
- package/dist/nodes/Mastodon/followedTags/FollowedTagsProperties.js.map +1 -0
- package/dist/nodes/Mastodon/followedTags/index.d.ts +6 -0
- package/dist/nodes/Mastodon/followedTags/index.js +46 -0
- package/dist/nodes/Mastodon/followedTags/index.js.map +1 -0
- package/dist/nodes/Mastodon/instance/InstanceInterfaces.d.ts +59 -0
- package/dist/nodes/Mastodon/instance/InstanceInterfaces.js +3 -0
- package/dist/nodes/Mastodon/instance/InstanceInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/instance/InstanceMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/instance/InstanceMethods.js +8 -0
- package/dist/nodes/Mastodon/instance/InstanceMethods.js.map +1 -0
- package/dist/nodes/Mastodon/instance/InstanceProperties.d.ts +2 -0
- package/dist/nodes/Mastodon/instance/InstanceProperties.js +26 -0
- package/dist/nodes/Mastodon/instance/InstanceProperties.js.map +1 -0
- package/dist/nodes/Mastodon/instance/index.d.ts +6 -0
- package/dist/nodes/Mastodon/instance/index.js +45 -0
- package/dist/nodes/Mastodon/instance/index.js.map +1 -0
- package/dist/nodes/Mastodon/lists/ListInterfaces.d.ts +6 -0
- package/dist/nodes/Mastodon/lists/ListInterfaces.js +3 -0
- package/dist/nodes/Mastodon/lists/ListInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/lists/ListMethods.d.ts +10 -0
- package/dist/nodes/Mastodon/lists/ListMethods.js +84 -0
- package/dist/nodes/Mastodon/lists/ListMethods.js.map +1 -0
- package/dist/nodes/Mastodon/lists/ListProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/lists/ListProperties.js +208 -0
- package/dist/nodes/Mastodon/lists/ListProperties.js.map +1 -0
- package/dist/nodes/Mastodon/lists/index.d.ts +13 -0
- package/dist/nodes/Mastodon/lists/index.js +53 -0
- package/dist/nodes/Mastodon/lists/index.js.map +1 -0
- package/dist/nodes/Mastodon/markers/MarkerInterfaces.d.ts +16 -0
- package/dist/nodes/Mastodon/markers/MarkerInterfaces.js +3 -0
- package/dist/nodes/Mastodon/markers/MarkerInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/markers/MarkerMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/markers/MarkerMethods.js +25 -0
- package/dist/nodes/Mastodon/markers/MarkerMethods.js.map +1 -0
- package/dist/nodes/Mastodon/markers/MarkersInterfaces.d.ts +18 -0
- package/dist/nodes/Mastodon/markers/MarkersInterfaces.js +3 -0
- package/dist/nodes/Mastodon/markers/MarkersInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/markers/MarkersProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/markers/MarkersProperties.js +86 -0
- package/dist/nodes/Mastodon/markers/MarkersProperties.js.map +1 -0
- package/dist/nodes/Mastodon/markers/index.d.ts +7 -0
- package/dist/nodes/Mastodon/markers/index.js +47 -0
- package/dist/nodes/Mastodon/markers/index.js.map +1 -0
- package/dist/nodes/Mastodon/measures/MeasureMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/measures/MeasureMethods.js +13 -0
- package/dist/nodes/Mastodon/measures/MeasureMethods.js.map +1 -0
- package/dist/nodes/Mastodon/measures/MeasureProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/measures/MeasureProperties.js +48 -0
- package/dist/nodes/Mastodon/measures/MeasureProperties.js.map +1 -0
- package/dist/nodes/Mastodon/measures/index.d.ts +7 -0
- package/dist/nodes/Mastodon/measures/index.js +47 -0
- package/dist/nodes/Mastodon/measures/index.js.map +1 -0
- package/dist/nodes/Mastodon/media/MediaMethods.d.ts +13 -0
- package/dist/nodes/Mastodon/media/MediaMethods.js +45 -0
- package/dist/nodes/Mastodon/media/MediaMethods.js.map +1 -0
- package/dist/nodes/Mastodon/media/MediaProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/media/MediaProperties.js +122 -0
- package/dist/nodes/Mastodon/media/MediaProperties.js.map +1 -0
- package/dist/nodes/Mastodon/media/index.d.ts +7 -0
- package/dist/nodes/Mastodon/media/index.js +47 -0
- package/dist/nodes/Mastodon/media/index.js.map +1 -0
- package/dist/nodes/Mastodon/mutes/MutesMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/mutes/MutesMethods.js +22 -0
- package/dist/nodes/Mastodon/mutes/MutesMethods.js.map +1 -0
- package/dist/nodes/Mastodon/mutes/MutesProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/mutes/MutesProperties.js +75 -0
- package/dist/nodes/Mastodon/mutes/MutesProperties.js.map +1 -0
- package/dist/nodes/Mastodon/mutes/index.d.ts +6 -0
- package/dist/nodes/Mastodon/mutes/index.js +14 -0
- package/dist/nodes/Mastodon/mutes/index.js.map +1 -0
- package/dist/nodes/Mastodon/n8n.png +0 -0
- package/dist/nodes/Mastodon/n8n.svg +10 -0
- package/dist/nodes/Mastodon/notifications/NotificationInterfaces.d.ts +19 -0
- package/dist/nodes/Mastodon/notifications/NotificationInterfaces.js +3 -0
- package/dist/nodes/Mastodon/notifications/NotificationInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/notifications/NotificationMethods.d.ts +5 -0
- package/dist/nodes/Mastodon/notifications/NotificationMethods.js +38 -0
- package/dist/nodes/Mastodon/notifications/NotificationMethods.js.map +1 -0
- package/dist/nodes/Mastodon/notifications/NotificationProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/notifications/NotificationProperties.js +179 -0
- package/dist/nodes/Mastodon/notifications/NotificationProperties.js.map +1 -0
- package/dist/nodes/Mastodon/notifications/index.d.ts +8 -0
- package/dist/nodes/Mastodon/notifications/index.js +48 -0
- package/dist/nodes/Mastodon/notifications/index.js.map +1 -0
- package/dist/nodes/Mastodon/oembed/OEmbedMethods.d.ts +2 -0
- package/dist/nodes/Mastodon/oembed/OEmbedMethods.js +9 -0
- package/dist/nodes/Mastodon/oembed/OEmbedMethods.js.map +1 -0
- package/dist/nodes/Mastodon/oembed/OEmbedProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/oembed/OEmbedProperties.js +42 -0
- package/dist/nodes/Mastodon/oembed/OEmbedProperties.js.map +1 -0
- package/dist/nodes/Mastodon/oembed/index.d.ts +6 -0
- package/dist/nodes/Mastodon/oembed/index.js +46 -0
- package/dist/nodes/Mastodon/oembed/index.js.map +1 -0
- package/dist/nodes/Mastodon/polls/PollMethods.d.ts +19 -0
- package/dist/nodes/Mastodon/polls/PollMethods.js +15 -0
- package/dist/nodes/Mastodon/polls/PollMethods.js.map +1 -0
- package/dist/nodes/Mastodon/polls/PollProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/polls/PollProperties.js +62 -0
- package/dist/nodes/Mastodon/polls/PollProperties.js.map +1 -0
- package/dist/nodes/Mastodon/polls/index.d.ts +7 -0
- package/dist/nodes/Mastodon/polls/index.js +47 -0
- package/dist/nodes/Mastodon/polls/index.js.map +1 -0
- package/dist/nodes/Mastodon/preferences/PreferenceMethods.d.ts +2 -0
- package/dist/nodes/Mastodon/preferences/PreferenceMethods.js +8 -0
- package/dist/nodes/Mastodon/preferences/PreferenceMethods.js.map +1 -0
- package/dist/nodes/Mastodon/preferences/PreferenceProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/preferences/PreferenceProperties.js +27 -0
- package/dist/nodes/Mastodon/preferences/PreferenceProperties.js.map +1 -0
- package/dist/nodes/Mastodon/preferences/index.d.ts +6 -0
- package/dist/nodes/Mastodon/preferences/index.js +46 -0
- package/dist/nodes/Mastodon/preferences/index.js.map +1 -0
- package/dist/nodes/Mastodon/profile/ProfileMethods.d.ts +12 -0
- package/dist/nodes/Mastodon/profile/ProfileMethods.js +12 -0
- package/dist/nodes/Mastodon/profile/ProfileMethods.js.map +1 -0
- package/dist/nodes/Mastodon/profile/ProfileProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/profile/ProfileProperties.js +33 -0
- package/dist/nodes/Mastodon/profile/ProfileProperties.js.map +1 -0
- package/dist/nodes/Mastodon/profile/index.d.ts +7 -0
- package/dist/nodes/Mastodon/profile/index.js +47 -0
- package/dist/nodes/Mastodon/profile/index.js.map +1 -0
- package/dist/nodes/Mastodon/proofs/ProofMethods.d.ts +2 -0
- package/dist/nodes/Mastodon/proofs/ProofMethods.js +8 -0
- package/dist/nodes/Mastodon/proofs/ProofMethods.js.map +1 -0
- package/dist/nodes/Mastodon/proofs/ProofProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/proofs/ProofProperties.js +27 -0
- package/dist/nodes/Mastodon/proofs/ProofProperties.js.map +1 -0
- package/dist/nodes/Mastodon/proofs/index.d.ts +6 -0
- package/dist/nodes/Mastodon/proofs/index.js +46 -0
- package/dist/nodes/Mastodon/proofs/index.js.map +1 -0
- package/dist/nodes/Mastodon/push/PushInterfaces.d.ts +27 -0
- package/dist/nodes/Mastodon/push/PushInterfaces.js +3 -0
- package/dist/nodes/Mastodon/push/PushInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/push/PushMethods.d.ts +6 -0
- package/dist/nodes/Mastodon/push/PushMethods.js +44 -0
- package/dist/nodes/Mastodon/push/PushMethods.js.map +1 -0
- package/dist/nodes/Mastodon/push/PushProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/push/PushProperties.js +216 -0
- package/dist/nodes/Mastodon/push/PushProperties.js.map +1 -0
- package/dist/nodes/Mastodon/push/index.d.ts +9 -0
- package/dist/nodes/Mastodon/push/index.js +49 -0
- package/dist/nodes/Mastodon/push/index.js.map +1 -0
- package/dist/nodes/Mastodon/relationship/RelationshipInterfaces.d.ts +15 -0
- package/dist/nodes/Mastodon/relationship/RelationshipInterfaces.js +3 -0
- package/dist/nodes/Mastodon/relationship/RelationshipInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/reports/ReportMethods.d.ts +4 -0
- package/dist/nodes/Mastodon/reports/ReportMethods.js +47 -0
- package/dist/nodes/Mastodon/reports/ReportMethods.js.map +1 -0
- package/dist/nodes/Mastodon/reports/ReportProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/reports/ReportProperties.js +161 -0
- package/dist/nodes/Mastodon/reports/ReportProperties.js.map +1 -0
- package/dist/nodes/Mastodon/reports/index.d.ts +8 -0
- package/dist/nodes/Mastodon/reports/index.js +48 -0
- package/dist/nodes/Mastodon/reports/index.js.map +1 -0
- package/dist/nodes/Mastodon/retention/RetentionMethods.d.ts +2 -0
- package/dist/nodes/Mastodon/retention/RetentionMethods.js +8 -0
- package/dist/nodes/Mastodon/retention/RetentionMethods.js.map +1 -0
- package/dist/nodes/Mastodon/retention/RetentionProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/retention/RetentionProperties.js +27 -0
- package/dist/nodes/Mastodon/retention/RetentionProperties.js.map +1 -0
- package/dist/nodes/Mastodon/retention/index.d.ts +6 -0
- package/dist/nodes/Mastodon/retention/index.js +46 -0
- package/dist/nodes/Mastodon/retention/index.js.map +1 -0
- package/dist/nodes/Mastodon/scheduledStatuses/ScheduledStatusMethods.d.ts +21 -0
- package/dist/nodes/Mastodon/scheduledStatuses/ScheduledStatusMethods.js +38 -0
- package/dist/nodes/Mastodon/scheduledStatuses/ScheduledStatusMethods.js.map +1 -0
- package/dist/nodes/Mastodon/scheduledStatuses/ScheduledStatusProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/scheduledStatuses/ScheduledStatusProperties.js +122 -0
- package/dist/nodes/Mastodon/scheduledStatuses/ScheduledStatusProperties.js.map +1 -0
- package/dist/nodes/Mastodon/scheduledStatuses/index.d.ts +9 -0
- package/dist/nodes/Mastodon/scheduledStatuses/index.js +49 -0
- package/dist/nodes/Mastodon/scheduledStatuses/index.js.map +1 -0
- package/dist/nodes/Mastodon/search/SearchInterfaces.d.ts +23 -0
- package/dist/nodes/Mastodon/search/SearchInterfaces.js +3 -0
- package/dist/nodes/Mastodon/search/SearchInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/search/SearchMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/search/SearchMethods.js +37 -0
- package/dist/nodes/Mastodon/search/SearchMethods.js.map +1 -0
- package/dist/nodes/Mastodon/search/SearchProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/search/SearchProperties.js +125 -0
- package/dist/nodes/Mastodon/search/SearchProperties.js.map +1 -0
- package/dist/nodes/Mastodon/search/index.d.ts +6 -0
- package/dist/nodes/Mastodon/search/index.js +46 -0
- package/dist/nodes/Mastodon/search/index.js.map +1 -0
- package/dist/nodes/Mastodon/status/StatusInterface.d.ts +8 -0
- package/dist/nodes/Mastodon/status/StatusInterface.js +3 -0
- package/dist/nodes/Mastodon/status/StatusInterface.js.map +1 -0
- package/dist/nodes/Mastodon/status/StatusMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/status/StatusMethods.js +155 -0
- package/dist/nodes/Mastodon/status/StatusMethods.js.map +1 -0
- package/dist/nodes/Mastodon/status/StatusMethodsTypes.d.ts +39 -0
- package/dist/nodes/Mastodon/status/StatusMethodsTypes.js +3 -0
- package/dist/nodes/Mastodon/status/StatusMethodsTypes.js.map +1 -0
- package/dist/nodes/Mastodon/status/StatusProperties.d.ts +12 -0
- package/dist/nodes/Mastodon/status/StatusProperties.js +281 -0
- package/dist/nodes/Mastodon/status/StatusProperties.js.map +1 -0
- package/dist/nodes/Mastodon/status/index.d.ts +17 -0
- package/dist/nodes/Mastodon/status/index.js +68 -0
- package/dist/nodes/Mastodon/status/index.js.map +1 -0
- package/dist/nodes/Mastodon/streaming/StreamingInterfaces.d.ts +10 -0
- package/dist/nodes/Mastodon/streaming/StreamingInterfaces.js +3 -0
- package/dist/nodes/Mastodon/streaming/StreamingInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/streaming/StreamingMethods.d.ts +5 -0
- package/dist/nodes/Mastodon/streaming/StreamingMethods.js +27 -0
- package/dist/nodes/Mastodon/streaming/StreamingMethods.js.map +1 -0
- package/dist/nodes/Mastodon/streaming/StreamingProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/streaming/StreamingProperties.js +76 -0
- package/dist/nodes/Mastodon/streaming/StreamingProperties.js.map +1 -0
- package/dist/nodes/Mastodon/streaming/index.d.ts +8 -0
- package/dist/nodes/Mastodon/streaming/index.js +48 -0
- package/dist/nodes/Mastodon/streaming/index.js.map +1 -0
- package/dist/nodes/Mastodon/suggestions/SuggestionMethods.d.ts +3 -0
- package/dist/nodes/Mastodon/suggestions/SuggestionMethods.js +18 -0
- package/dist/nodes/Mastodon/suggestions/SuggestionMethods.js.map +1 -0
- package/dist/nodes/Mastodon/suggestions/SuggestionProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/suggestions/SuggestionProperties.js +74 -0
- package/dist/nodes/Mastodon/suggestions/SuggestionProperties.js.map +1 -0
- package/dist/nodes/Mastodon/suggestions/index.d.ts +7 -0
- package/dist/nodes/Mastodon/suggestions/index.js +47 -0
- package/dist/nodes/Mastodon/suggestions/index.js.map +1 -0
- package/dist/nodes/Mastodon/tags/TagMethods.d.ts +14 -0
- package/dist/nodes/Mastodon/tags/TagMethods.js +19 -0
- package/dist/nodes/Mastodon/tags/TagMethods.js.map +1 -0
- package/dist/nodes/Mastodon/tags/TagProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/tags/TagProperties.js +54 -0
- package/dist/nodes/Mastodon/tags/TagProperties.js.map +1 -0
- package/dist/nodes/Mastodon/tags/index.d.ts +8 -0
- package/dist/nodes/Mastodon/tags/index.js +48 -0
- package/dist/nodes/Mastodon/tags/index.js.map +1 -0
- package/dist/nodes/Mastodon/timeline/TimelineInterfaces.d.ts +14 -0
- package/dist/nodes/Mastodon/timeline/TimelineInterfaces.js +3 -0
- package/dist/nodes/Mastodon/timeline/TimelineInterfaces.js.map +1 -0
- package/dist/nodes/Mastodon/timeline/TimelineMethods.d.ts +7 -0
- package/dist/nodes/Mastodon/timeline/TimelineMethods.js +124 -0
- package/dist/nodes/Mastodon/timeline/TimelineMethods.js.map +1 -0
- package/dist/nodes/Mastodon/timeline/TimelineProperties.d.ts +3 -0
- package/dist/nodes/Mastodon/timeline/TimelineProperties.js +218 -0
- package/dist/nodes/Mastodon/timeline/TimelineProperties.js.map +1 -0
- package/dist/nodes/Mastodon/timeline/index.d.ts +10 -0
- package/dist/nodes/Mastodon/timeline/index.js +50 -0
- package/dist/nodes/Mastodon/timeline/index.js.map +1 -0
- package/dist/package.json +72 -0
- package/dist/src/utils/pkceWrapper.d.ts +5 -0
- package/dist/src/utils/pkceWrapper.js +47 -0
- package/dist/src/utils/pkceWrapper.js.map +1 -0
- package/index.js +8 -0
- package/package.json +72 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2022 n8n
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# n8n Community Node: Mastodon
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/n8n-nodes-the-mastodon)
|
|
4
|
+
[](https://www.npmjs.com/package/n8n-nodes-the-mastodon)
|
|
5
|
+
[](LICENSE.md)
|
|
6
|
+
|
|
7
|
+
A community-maintained n8n node pack for interacting with the Mastodon API. This package provides full CRUD operations across Mastodon resources, including statuses, accounts, timelines, media, polls, bookmarks, lists, and more—all seamlessly integrated into your n8n workflows.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Table of Contents
|
|
12
|
+
|
|
13
|
+
- [Features](#features)
|
|
14
|
+
- [Prerequisites](#prerequisites)
|
|
15
|
+
- [Installation](#installation)
|
|
16
|
+
- [Configuration & Credentials](#configuration--credentials)
|
|
17
|
+
- [Usage Examples](#usage-examples)
|
|
18
|
+
- [Post a Status](#post-a-status)
|
|
19
|
+
- [Fetch Public Timeline](#fetch-public-timeline)
|
|
20
|
+
- [Manage Lists](#manage-lists)
|
|
21
|
+
- [Available Resources & Operations](#available-resources--operations)
|
|
22
|
+
- [Testing](#testing)
|
|
23
|
+
- [Development & Contributing](#development--contributing)
|
|
24
|
+
- [License](#license)
|
|
25
|
+
- [References](#references)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Statuses**: Create, delete, edit, search, favourite, boost (reblog), bookmark, and manage scheduled statuses.
|
|
32
|
+
- **Accounts**: Follow, unfollow, block, mute, view profile, and manage relationships.
|
|
33
|
+
- **Timelines**: Retrieve public, home, hashtag, list, and link timelines with advanced query options.
|
|
34
|
+
- **Media**: Upload and manage media attachments.
|
|
35
|
+
- **Polls**: Fetch poll data and cast votes.
|
|
36
|
+
- **Bookmarks**: Add and remove bookmarks from statuses.
|
|
37
|
+
- **Lists**: Create, update, delete lists and manage list membership.
|
|
38
|
+
- **Notifications**: Fetch and dismiss notifications.
|
|
39
|
+
- **Administration**: Admin-level endpoints for reports, retention metrics, cohorts, and more.
|
|
40
|
+
- **Customizable**: Leverage query parameters and additional fields for fine-grained control.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Prerequisites
|
|
45
|
+
|
|
46
|
+
- [Node.js](https://nodejs.org/) v14 or higher
|
|
47
|
+
- [npm](https://www.npmjs.com/) v6 or higher
|
|
48
|
+
- An [n8n](https://n8n.io/) instance (self-hosted)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# From your n8n project root:
|
|
56
|
+
npm install n8n-nodes-the-mastodon
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The node will automatically be detected by n8n after installation. Restart your n8n instance if it is running.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Configuration & Credentials
|
|
64
|
+
|
|
65
|
+
Before using the Mastodon node, you must configure OAuth2 credentials for your target Mastodon instance:
|
|
66
|
+
|
|
67
|
+
1. In your Mastodon instance, navigate to **Settings > Development** and create a new application.
|
|
68
|
+
- Name: e.g., `n8n`
|
|
69
|
+
- Redirect URI: `http://localhost:5678/rest/oauth2-credential/callback`
|
|
70
|
+
- Scopes: Select `read`, `write`, and `push` as needed.
|
|
71
|
+
- Note down **Client ID** and **Client Secret**.
|
|
72
|
+
|
|
73
|
+
2. In your n8n UI:
|
|
74
|
+
- Go to **Credentials** > **New** > **Mastodon OAuth2 API**.
|
|
75
|
+
- Fill in:
|
|
76
|
+
- **Instance URL**: `https://mastodon.social` (or your custom instance)
|
|
77
|
+
- **Client ID**: from step 1
|
|
78
|
+
- **Client Secret**: from step 1
|
|
79
|
+
- **Scope**: `read write push`
|
|
80
|
+
- Save and **Connect**. Authorize when prompted.
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Usage Examples
|
|
87
|
+
|
|
88
|
+
### Post a Status
|
|
89
|
+
|
|
90
|
+
1. Add a Mastodon node.
|
|
91
|
+
2. Resource: **Status**, Operation: **Create**.
|
|
92
|
+
3. Set **Status** text, and optionally add attachments or additional parameters.
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
- name: Post Status
|
|
96
|
+
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
|
|
97
|
+
parameters:
|
|
98
|
+
resource: status
|
|
99
|
+
operation: create
|
|
100
|
+
status: "Hello from n8n and Mastodon!"
|
|
101
|
+
additionalFields:
|
|
102
|
+
visibility: "public"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Fetch Public Timeline
|
|
106
|
+
|
|
107
|
+
- Resource: **Timeline**, Operation: **Public**.
|
|
108
|
+
- Use **Additional Fields** to filter `local`, `remote`, `only_media`, or paging parameters.
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
- name: Get Public Timeline
|
|
112
|
+
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
|
|
113
|
+
parameters:
|
|
114
|
+
resource: timeline
|
|
115
|
+
operation: public
|
|
116
|
+
additionalFields:
|
|
117
|
+
limit: 20
|
|
118
|
+
local: true
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Manage Lists
|
|
122
|
+
|
|
123
|
+
- **Create List**:
|
|
124
|
+
- Resource: **Lists**, Operation: **createList**; set `title` and optional `replies_policy`.
|
|
125
|
+
- **Add Account**:
|
|
126
|
+
- Resource: **Lists**, Operation: **addAccountsToList**; set `listId` and `accountIds`.
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
- name: Create and Update List
|
|
130
|
+
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
|
|
131
|
+
parameters:
|
|
132
|
+
resource: lists
|
|
133
|
+
operation: createList
|
|
134
|
+
title: "My Favorite Authors"
|
|
135
|
+
- name: Add Accounts
|
|
136
|
+
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
|
|
137
|
+
parameters:
|
|
138
|
+
resource: lists
|
|
139
|
+
operation: addAccountsToList
|
|
140
|
+
listId: "12345"
|
|
141
|
+
accountIds:
|
|
142
|
+
- "42"
|
|
143
|
+
- "99"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Available Resources & Operations
|
|
149
|
+
|
|
150
|
+
| Resource | Operations |
|
|
151
|
+
|-----------------|-------------------------------------------|
|
|
152
|
+
| Status | create, delete, edit, search, favourite, unfavourite, boost, unboost, bookmark, removeBookmark, view, viewEditHistory, viewSource |
|
|
153
|
+
| Account | follow, unfollow, block, mute, unmute, verifyCredentials, viewProfile, getFollowers, getFollowing, searchAccounts |
|
|
154
|
+
| Timeline | public, hashtag, home, list, link |
|
|
155
|
+
| Bookmarks | getBookmarks, addBookmark, removeBookmark |
|
|
156
|
+
| Favourites | favourite, unfavourite |
|
|
157
|
+
| Lists | getLists, getList, createList, updateList, deleteList, getAccountsInList, addAccountsToList, removeAccountsFromList |
|
|
158
|
+
| Media | upload, update, delete, get (and more) |
|
|
159
|
+
| Polls | getPoll, votePoll |
|
|
160
|
+
| Notifications | getAll, dismiss |
|
|
161
|
+
| Reports | listReports, create, resolveReport |
|
|
162
|
+
| Retention | viewStatistics |
|
|
163
|
+
| Markers | get, save |
|
|
164
|
+
| ... | (see full properties in code) |
|
|
165
|
+
|
|
166
|
+
For a full list of fields and parameter descriptions, refer to the code under `nodes/Mastodon/*`.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Testing
|
|
171
|
+
|
|
172
|
+
Automated tests are provided using [Jest](https://jestjs.io/).
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Install dev dependencies
|
|
176
|
+
npm install
|
|
177
|
+
|
|
178
|
+
# Run tests
|
|
179
|
+
npm test
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Test files are located in the `__tests__` directory, covering each resource and operation.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Development & Contributing
|
|
187
|
+
|
|
188
|
+
Contributions are welcome! Please abide by our [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
189
|
+
|
|
190
|
+
1. Fork the repository & clone locally.
|
|
191
|
+
2. Create a feature branch: `git checkout -b feature-name`.
|
|
192
|
+
3. Install dependencies: `npm install`.
|
|
193
|
+
4. Build & lint: `npm run build && npm run lint`.
|
|
194
|
+
5. Run tests: `npm test`.
|
|
195
|
+
6. Commit & push your changes, then open a Pull Request.
|
|
196
|
+
|
|
197
|
+
**Code style**: ESLint and Prettier are configured. Run:
|
|
198
|
+
```bash
|
|
199
|
+
npm run lint
|
|
200
|
+
npm run format
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
This project is licensed under the MIT License. See [LICENSE.md](LICENSE.md) for details.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## References
|
|
212
|
+
|
|
213
|
+
- Mastodon API Docs: https://docs.joinmastodon.org/api/
|
|
214
|
+
- n8n Community Nodes Docs: https://docs.n8n.io/integrations/community-nodes/
|
|
215
|
+
- OAuth2 Setup Guide: https://docs.joinmastodon.org/client/token/
|
|
216
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Mastodon_node_1 = require("../nodes/Mastodon/Mastodon.node");
|
|
4
|
+
describe('Mastodon Node - Core', () => {
|
|
5
|
+
let mastodonNode;
|
|
6
|
+
beforeAll(() => {
|
|
7
|
+
mastodonNode = new Mastodon_node_1.Mastodon();
|
|
8
|
+
});
|
|
9
|
+
test('should have correct node metadata', () => {
|
|
10
|
+
expect(mastodonNode.description.name).toBe('mastodon');
|
|
11
|
+
expect(mastodonNode.description.displayName).toBe('Mastodon');
|
|
12
|
+
expect(mastodonNode.description.group).toEqual(['transform']);
|
|
13
|
+
expect(mastodonNode.description.version).toBe(1);
|
|
14
|
+
});
|
|
15
|
+
test('should define required OAuth2 credentials', () => {
|
|
16
|
+
const creds = mastodonNode.description.credentials;
|
|
17
|
+
expect(creds).toBeDefined();
|
|
18
|
+
expect(creds === null || creds === void 0 ? void 0 : creds[0].name).toBe('mastodonOAuth2Api');
|
|
19
|
+
expect(creds === null || creds === void 0 ? void 0 : creds[0].required).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
test('should include URL property as required string', () => {
|
|
22
|
+
const props = mastodonNode.description.properties;
|
|
23
|
+
const urlProp = props.find((p) => p.name === 'url');
|
|
24
|
+
expect(urlProp).toBeDefined();
|
|
25
|
+
expect(urlProp === null || urlProp === void 0 ? void 0 : urlProp.type).toBe('string');
|
|
26
|
+
expect(urlProp === null || urlProp === void 0 ? void 0 : urlProp.required).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=Mastodon.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mastodon.test.js","sourceRoot":"","sources":["../../__tests__/Mastodon.test.ts"],"names":[],"mappings":";;AAAA,mEAA2D;AAG3D,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,IAAI,YAAuB,CAAC;IAE5B,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,GAAG,IAAI,wBAAQ,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9D,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAC9D,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACrD,MAAM,KAAK,GAAG,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC;QACnD,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5B,MAAM,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAClD,MAAM,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,gDAAgD,EAAE,GAAG,EAAE;QAC1D,MAAM,KAAK,GAAG,YAAY,CAAC,WAAW,CAAC,UAA+B,CAAC;QACvE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;QACpD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Mastodon_node_1 = require("../nodes/Mastodon/Mastodon.node");
|
|
4
|
+
describe('Mastodon Node - Account', () => {
|
|
5
|
+
let node;
|
|
6
|
+
let ctx;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
node = new Mastodon_node_1.Mastodon();
|
|
9
|
+
ctx = {
|
|
10
|
+
getNodeParameter: jest.fn(),
|
|
11
|
+
getInputData: jest.fn().mockReturnValue([{ json: {} }]),
|
|
12
|
+
helpers: { requestOAuth2: jest.fn() },
|
|
13
|
+
getCredentials: jest.fn().mockResolvedValue({ baseUrl: 'https://mastodon.social', oauth2: { accessToken: 'test-token' } }),
|
|
14
|
+
continueOnFail: () => false,
|
|
15
|
+
getNode: () => ({ id: '1', type: 'mastodon', name: 'Mastodon', typeVersion: 1, position: [0, 0], parameters: {} }),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
it('should follow an account', async () => {
|
|
19
|
+
var _a;
|
|
20
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
21
|
+
if (param === 'resource')
|
|
22
|
+
return 'account';
|
|
23
|
+
if (param === 'operation')
|
|
24
|
+
return 'follow';
|
|
25
|
+
if (param === 'accountId')
|
|
26
|
+
return '42';
|
|
27
|
+
return undefined;
|
|
28
|
+
});
|
|
29
|
+
const mockResponse = { id: '42', following: true };
|
|
30
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(mockResponse);
|
|
31
|
+
const result = await node.execute.call(ctx);
|
|
32
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/accounts/42/follow') }));
|
|
33
|
+
expect((_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[0].json).toEqual(mockResponse);
|
|
34
|
+
});
|
|
35
|
+
it('should throw if accountId is missing for unfollow', async () => {
|
|
36
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
37
|
+
if (param === 'resource')
|
|
38
|
+
return 'account';
|
|
39
|
+
if (param === 'operation')
|
|
40
|
+
return 'unfollow';
|
|
41
|
+
return undefined;
|
|
42
|
+
});
|
|
43
|
+
try {
|
|
44
|
+
await node.execute.call(ctx);
|
|
45
|
+
expect(true).toBe(false);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
expect(error).toBeInstanceOf(Error);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=account.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.test.js","sourceRoot":"","sources":["../../__tests__/account.test.ts"],"names":[],"mappings":";;AAAA,mEAA2D;AAG3D,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,IAAc,CAAC;IACnB,IAAI,GAA+B,CAAC;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,GAAG,IAAI,wBAAQ,EAAE,CAAC;QACtB,GAAG,GAAG;YACJ,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;YAC3B,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YACvD,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE,EAAS;YAC5C,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,CAAC;YAC1H,cAAc,EAAE,GAAG,EAAE,CAAC,KAAK;YAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAU,CAAA;SACzH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;;QACvC,GAAG,CAAC,gBAA8B,CAAC,kBAAkB,CAAC,CAAC,KAAK,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YAClD,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Mastodon_node_1 = require("../nodes/Mastodon/Mastodon.node");
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
describe('Mastodon Node - Bookmarks', () => {
|
|
6
|
+
let node;
|
|
7
|
+
let ctx;
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
node = new Mastodon_node_1.Mastodon();
|
|
10
|
+
ctx = {
|
|
11
|
+
getNodeParameter: jest.fn(),
|
|
12
|
+
getInputData: jest.fn().mockReturnValue([{ json: {} }]),
|
|
13
|
+
helpers: { requestOAuth2: jest.fn() },
|
|
14
|
+
getCredentials: jest.fn().mockResolvedValue({ baseUrl: 'https://mastodon.social', oauth2: { accessToken: 'test-token' } }),
|
|
15
|
+
continueOnFail: () => false,
|
|
16
|
+
getNode: () => ({ id: '1', type: 'mastodon', name: 'Mastodon', typeVersion: 1, position: [0, 0], parameters: {} }),
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
it('should add a bookmark', async () => {
|
|
20
|
+
ctx.getNodeParameter.mockImplementation((param) => param === 'resource' ? 'bookmarks' : param === 'operation' ? 'addBookmark' : param === 'statusId' ? '123' : undefined);
|
|
21
|
+
ctx.helpers.requestOAuth2.mockResolvedValue({ id: '123', bookmarked: true });
|
|
22
|
+
const result = await node.execute.call(ctx);
|
|
23
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/statuses/123/bookmark') }));
|
|
24
|
+
});
|
|
25
|
+
it('should remove a bookmark', async () => {
|
|
26
|
+
ctx.getNodeParameter.mockImplementation((param) => param === 'resource' ? 'bookmarks' : param === 'operation' ? 'removeBookmark' : param === 'statusId' ? '123' : undefined);
|
|
27
|
+
ctx.helpers.requestOAuth2.mockResolvedValue({ id: '123', bookmarked: false });
|
|
28
|
+
const result = await node.execute.call(ctx);
|
|
29
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/statuses/123/unbookmark') }));
|
|
30
|
+
});
|
|
31
|
+
it('should throw on missing statusId', async () => {
|
|
32
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
33
|
+
if (param === 'resource')
|
|
34
|
+
return 'bookmarks';
|
|
35
|
+
if (param === 'operation')
|
|
36
|
+
return 'addBookmark';
|
|
37
|
+
return undefined;
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
await node.execute.call(ctx);
|
|
41
|
+
expect(true).toBe(false);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
expect(error).toBeInstanceOf(n8n_workflow_1.NodeOperationError);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=bookmarks.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookmarks.test.js","sourceRoot":"","sources":["../../__tests__/bookmarks.test.ts"],"names":[],"mappings":";;AAAA,mEAA2D;AAC3D,+CAAqE;AAErE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,IAAc,CAAC;IACnB,IAAI,GAA+B,CAAC;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,GAAG,IAAI,wBAAQ,EAAE,CAAC;QACtB,GAAG,GAAG;YACJ,gBA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aAAa,CAAC;YAChD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,CAAC;QAGH,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAwB,CAAC,CAAC;YAElD,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,iCAAkB,CAAC,CAAC;QACnD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Mastodon_node_1 = require("../nodes/Mastodon/Mastodon.node");
|
|
4
|
+
describe('Mastodon Node - Lists', () => {
|
|
5
|
+
let node;
|
|
6
|
+
let ctx;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
node = new Mastodon_node_1.Mastodon();
|
|
9
|
+
ctx = {
|
|
10
|
+
getNodeParameter: jest.fn(),
|
|
11
|
+
getInputData: jest.fn().mockReturnValue([{ json: {} }]),
|
|
12
|
+
helpers: {
|
|
13
|
+
requestOAuth2: jest.fn(),
|
|
14
|
+
requestOAuth1: jest.fn(),
|
|
15
|
+
requestWithAuthentication: jest.fn(),
|
|
16
|
+
httpRequest: jest.fn(),
|
|
17
|
+
httpRequestWithAuthentication: jest.fn(),
|
|
18
|
+
requestWithAuthenticationPaginated: jest.fn(),
|
|
19
|
+
request: jest.fn(),
|
|
20
|
+
prepareBinaryData: jest.fn(),
|
|
21
|
+
setBinaryDataBuffer: jest.fn(),
|
|
22
|
+
getBinaryDataBuffer: jest.fn(),
|
|
23
|
+
createDeferredPromise: jest.fn(),
|
|
24
|
+
returnJsonArray: jest.fn(),
|
|
25
|
+
copyBinaryFile: jest.fn(),
|
|
26
|
+
binaryToBuffer: jest.fn(),
|
|
27
|
+
binaryToString: jest.fn(),
|
|
28
|
+
getBinaryPath: jest.fn(),
|
|
29
|
+
getBinaryStream: jest.fn(),
|
|
30
|
+
getBinaryMetadata: jest.fn(),
|
|
31
|
+
checkProcessedAndRecord: jest.fn(),
|
|
32
|
+
checkProcessedItemsAndRecord: jest.fn(),
|
|
33
|
+
removeProcessed: jest.fn(),
|
|
34
|
+
clearAllProcessedItems: jest.fn(),
|
|
35
|
+
getProcessedDataCount: jest.fn(),
|
|
36
|
+
createReadStream: jest.fn(),
|
|
37
|
+
getStoragePath: jest.fn(),
|
|
38
|
+
writeContentToFile: jest.fn(),
|
|
39
|
+
getSSHClient: jest.fn(),
|
|
40
|
+
normalizeItems: jest.fn(),
|
|
41
|
+
constructExecutionMetaData: jest.fn(),
|
|
42
|
+
assertBinaryData: jest.fn(),
|
|
43
|
+
detectBinaryEncoding: jest.fn(),
|
|
44
|
+
copyInputItems: jest.fn(),
|
|
45
|
+
},
|
|
46
|
+
getCredentials: jest.fn().mockResolvedValue({ baseUrl: 'https://mastodon.social', oauth2: { accessToken: 'test-token' } }),
|
|
47
|
+
continueOnFail: () => false,
|
|
48
|
+
getNode: () => ({ id: '1', type: 'mastodon', name: 'Mastodon', typeVersion: 1, position: [0, 0], parameters: {} }),
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
it('should get all lists', async () => {
|
|
52
|
+
var _a;
|
|
53
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
54
|
+
if (param === 'resource')
|
|
55
|
+
return 'lists';
|
|
56
|
+
if (param === 'operation')
|
|
57
|
+
return 'getLists';
|
|
58
|
+
return undefined;
|
|
59
|
+
});
|
|
60
|
+
const mockResponse = { id: '1', title: 'My List' };
|
|
61
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(mockResponse);
|
|
62
|
+
const result = await node.execute.call(ctx);
|
|
63
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'GET', uri: expect.stringContaining('/api/v1/lists') }));
|
|
64
|
+
expect((_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[0].json).toEqual(mockResponse);
|
|
65
|
+
});
|
|
66
|
+
it('should create and delete a list', async () => {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
69
|
+
if (param === 'resource')
|
|
70
|
+
return 'lists';
|
|
71
|
+
if (param === 'operation')
|
|
72
|
+
return 'createList';
|
|
73
|
+
if (param === 'title')
|
|
74
|
+
return 'New';
|
|
75
|
+
return undefined;
|
|
76
|
+
});
|
|
77
|
+
const createMockResponse = { id: '2', title: 'New' };
|
|
78
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(createMockResponse);
|
|
79
|
+
let result = await node.execute.call(ctx);
|
|
80
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/lists') }));
|
|
81
|
+
expect((_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[0].json).toEqual(createMockResponse);
|
|
82
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
83
|
+
if (param === 'resource')
|
|
84
|
+
return 'lists';
|
|
85
|
+
if (param === 'operation')
|
|
86
|
+
return 'deleteList';
|
|
87
|
+
if (param === 'listId')
|
|
88
|
+
return '2';
|
|
89
|
+
return undefined;
|
|
90
|
+
});
|
|
91
|
+
const deleteMockResponse = {};
|
|
92
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(deleteMockResponse);
|
|
93
|
+
result = await node.execute.call(ctx);
|
|
94
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'DELETE', uri: expect.stringContaining('/api/v1/lists/2') }));
|
|
95
|
+
expect((_b = result === null || result === void 0 ? void 0 : result[0]) === null || _b === void 0 ? void 0 : _b[0].json).toEqual(deleteMockResponse);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=lists.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.test.js","sourceRoot":"","sources":["../../__tests__/lists.test.ts"],"names":[],"mappings":";;AAAA,mEAA2D;AAG3D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,IAAI,IAAc,CAAC;IACnB,IAAI,GAA+B,CAAC;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,GAAG,IAAI,wBAAQ,EAAE,CAAC;QACtB,GAAG,GAAG;YACJ,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;YAC3B,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YACvD,OAAO,EAAE;gBACP,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;gBACxB,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;gBACxB,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE;gBACpC,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;gBACtB,6BAA6B,EAAE,IAAI,CAAC,EAAE,EAAE;gBACxC,kCAAkC,EAAE,IAAI,CAAC,EAAE,EAAE;gBAC7C,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;gBAClB,iBAAiB,EAAE,IAAI,CAAC,EAAE,EAAE;gBAC5B,mBAAmB,EAAE,IAAI,CAAC,EAAE,EAAE;gBAC9B,mBAAmB,EAAE,IAAI,CAAC,EAAE,EAAE;gBAC9B,qBAAqB,EAAE,IAAI,CAAC,EAAE,EAAE;gBAChC,eAAe,EAAE,IAAI,CAAC,EAAE,EAAE;gBAC1B,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;gBACzB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;gB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oB,CACrD,mBAAmB,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,CAAC,CACpH,CAAC;QACF,MAAM,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,0CAAG,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Mastodon_node_1 = require("../nodes/Mastodon/Mastodon.node");
|
|
4
|
+
describe('Mastodon Node - Status', () => {
|
|
5
|
+
let node;
|
|
6
|
+
let ctx;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
node = new Mastodon_node_1.Mastodon();
|
|
9
|
+
ctx = {
|
|
10
|
+
getNodeParameter: jest.fn(),
|
|
11
|
+
getInputData: jest.fn(),
|
|
12
|
+
helpers: { requestOAuth2: jest.fn() },
|
|
13
|
+
getCredentials: jest.fn().mockResolvedValue({ baseUrl: 'https://mastodon.social', oauth2: { accessToken: 'test-token' } }),
|
|
14
|
+
continueOnFail: () => false,
|
|
15
|
+
getNode: () => ({ id: '1', type: 'mastodon', name: 'Mastodon', typeVersion: 1, position: [0, 0], parameters: {} }),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
it('should create a status', async () => {
|
|
19
|
+
var _a;
|
|
20
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
21
|
+
if (param === 'resource')
|
|
22
|
+
return 'status';
|
|
23
|
+
if (param === 'operation')
|
|
24
|
+
return 'create';
|
|
25
|
+
if (param === 'status')
|
|
26
|
+
return 'Hello';
|
|
27
|
+
if (param === 'additionalFields')
|
|
28
|
+
return {};
|
|
29
|
+
return undefined;
|
|
30
|
+
});
|
|
31
|
+
ctx.getInputData.mockReturnValue([{ json: {} }]);
|
|
32
|
+
const mockResponse = [{ id: '1', content: 'Hello' }];
|
|
33
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(mockResponse);
|
|
34
|
+
const result = await node.execute.call(ctx);
|
|
35
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalled();
|
|
36
|
+
expect((_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[0].json).toEqual(mockResponse[0]);
|
|
37
|
+
});
|
|
38
|
+
it('should throw for invalid status id on bookmark', async () => {
|
|
39
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
40
|
+
if (param === 'resource')
|
|
41
|
+
return 'status';
|
|
42
|
+
if (param === 'operation')
|
|
43
|
+
return 'bookmark';
|
|
44
|
+
if (param === 'statusId')
|
|
45
|
+
return '';
|
|
46
|
+
return undefined;
|
|
47
|
+
});
|
|
48
|
+
ctx.getInputData.mockReturnValue([{ json: {} }]);
|
|
49
|
+
try {
|
|
50
|
+
await node.execute.call(ctx);
|
|
51
|
+
expect(true).toBe(false);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
expect(error).toBeInstanceOf(Error);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
it('should delete a status', async () => {
|
|
58
|
+
var _a;
|
|
59
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
60
|
+
if (param === 'resource')
|
|
61
|
+
return 'status';
|
|
62
|
+
if (param === 'operation')
|
|
63
|
+
return 'delete';
|
|
64
|
+
if (param === 'statusId')
|
|
65
|
+
return '123';
|
|
66
|
+
return undefined;
|
|
67
|
+
});
|
|
68
|
+
ctx.getInputData.mockReturnValue([{ json: {} }]);
|
|
69
|
+
const mockResponse = [{ id: '123', deleted: true }];
|
|
70
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(mockResponse);
|
|
71
|
+
const result = await node.execute.call(ctx);
|
|
72
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalled();
|
|
73
|
+
expect((_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[0].json).toEqual(mockResponse[0]);
|
|
74
|
+
});
|
|
75
|
+
it('should favourite and unfavourite a status', async () => {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
78
|
+
if (param === 'resource')
|
|
79
|
+
return 'status';
|
|
80
|
+
if (param === 'operation')
|
|
81
|
+
return 'favourite';
|
|
82
|
+
if (param === 'statusId')
|
|
83
|
+
return '200';
|
|
84
|
+
return undefined;
|
|
85
|
+
});
|
|
86
|
+
ctx.getInputData.mockReturnValue([{ json: {} }]);
|
|
87
|
+
const favResponse = [{ id: '200', favourited: true }];
|
|
88
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(favResponse);
|
|
89
|
+
let result = await node.execute.call(ctx);
|
|
90
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/statuses/200/favourite') }));
|
|
91
|
+
expect((_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[0].json).toEqual(favResponse[0]);
|
|
92
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
93
|
+
if (param === 'resource')
|
|
94
|
+
return 'status';
|
|
95
|
+
if (param === 'operation')
|
|
96
|
+
return 'unfavourite';
|
|
97
|
+
if (param === 'statusId')
|
|
98
|
+
return '200';
|
|
99
|
+
return undefined;
|
|
100
|
+
});
|
|
101
|
+
ctx.getInputData.mockReturnValue([{ json: {} }]);
|
|
102
|
+
const unfavResponse = [{ id: '200', favourited: false }];
|
|
103
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(unfavResponse);
|
|
104
|
+
result = await node.execute.call(ctx);
|
|
105
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/statuses/200/unfavourite') }));
|
|
106
|
+
expect((_b = result === null || result === void 0 ? void 0 : result[0]) === null || _b === void 0 ? void 0 : _b[0].json).toEqual(unfavResponse[0]);
|
|
107
|
+
});
|
|
108
|
+
it('should boost and unboost a status', async () => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
111
|
+
if (param === 'resource')
|
|
112
|
+
return 'status';
|
|
113
|
+
if (param === 'operation')
|
|
114
|
+
return 'boost';
|
|
115
|
+
if (param === 'statusId')
|
|
116
|
+
return '300';
|
|
117
|
+
return undefined;
|
|
118
|
+
});
|
|
119
|
+
ctx.getInputData.mockReturnValue([{ json: {} }]);
|
|
120
|
+
const boostResponse = { id: '300', reblogged: true };
|
|
121
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(boostResponse);
|
|
122
|
+
let result = await node.execute.call(ctx);
|
|
123
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/statuses/300/reblog') }));
|
|
124
|
+
expect((_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[0].json).toEqual(boostResponse);
|
|
125
|
+
ctx.getNodeParameter.mockImplementation((param) => {
|
|
126
|
+
if (param === 'resource')
|
|
127
|
+
return 'status';
|
|
128
|
+
if (param === 'operation')
|
|
129
|
+
return 'unboost';
|
|
130
|
+
if (param === 'statusId')
|
|
131
|
+
return '300';
|
|
132
|
+
return undefined;
|
|
133
|
+
});
|
|
134
|
+
ctx.getInputData.mockReturnValue([{ json: {} }]);
|
|
135
|
+
const unboostResponse = { id: '300', reblogged: false };
|
|
136
|
+
ctx.helpers.requestOAuth2.mockResolvedValue(unboostResponse);
|
|
137
|
+
result = await node.execute.call(ctx);
|
|
138
|
+
expect(ctx.helpers.requestOAuth2).toHaveBeenCalledWith('mastodonOAuth2Api', expect.objectContaining({ method: 'POST', uri: expect.stringContaining('/api/v1/statuses/300/unreblog') }));
|
|
139
|
+
expect((_b = result === null || result === void 0 ? void 0 : result[0]) === null || _b === void 0 ? void 0 : _b[0].json).toEqual(unboostResponse);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
//# sourceMappingURL=status.test.js.map
|