@ta-interaktiv/newsnet-api-flow-types v0.9.2
Newsnet API Flow Types
Flow typing for the stuff the Newsnet API produces.
API
Table of Contents
- Author
- CacheInformation
- CacheInformation
- DateString
- BasicCommunity
- Communities
- External_Services
- Paywall
- PaywallStatus
- Statistic
- Wemf
- Webseismo
- Gtm
- Article
- ArticleContent
- SiteConfig
- SiteContent
- Site
Author
- See: Article
Author object, being part of /api/articles/<legacy_id>
Type: {type: string, id: string, name: string, description: string?, url: string, picture: string?, twitter: string?, rss: string}
Properties
typestringidstringnamestringdescriptionstring?urlstringpicturestring?twitterstring?rssstring
CacheInformation
The available types of communities so far.
cache
I guess this should be a boolean, but it is returned as a string
Type: ("true" | "false")
refresh
Date Object, in the form 'DD.MM.YYYY hh:mm:ss'
Type: string
CacheInformation
Caching Information. Not exactly sure what that does, but it is part of a lot of configuration objects.
Type: {cache: ("true" | "false"), refresh: string}
Properties
cache("true"|"false")refreshstring
cache
I guess this should be a boolean, but it is returned as a string
Type: ("true" | "false")
refresh
Date Object, in the form 'DD.MM.YYYY hh:mm:ss'
Type: string
DateString
Date string, of the form "dd.MM.YYYY HH:mm:SS".
Type: string
BasicCommunity
Community object, used for providing social media information.
Type: {type: CommunityType, count: number, article_id: string, share_type_id: string, url: string?, description: string?, name: string?, title: string?, description: string?, facebook_id: string?, via: string?, allow_comments_weekdays: boolean?, allow_comments_weekends: boolean?, comment_count_text: string?}
Properties
typeCommunityTypecountnumberarticle_idstringshare_type_idstringurlstring?descriptionstring?namestring?titlestring?descriptionstring?facebook_idstring?viastring?allow_comments_weekdaysboolean?allow_comments_weekendsboolean?comment_count_textstring?
Communities
Community list, as provided by /api/articles/<legacy_id>/communities
Type: {communities: Array<Community>}
Properties
communitiesArray<Community>
External_Services
External services combines several meta data about an article.
Provided by /api/articles/<legacy_id>/external_services
Type: {configs: any, paywall: Paywall, ads: Ads, statistics: Array<Statistic>, communities: Array<Community>}
Properties
Paywall
Basic Paywall object
Part of /api/articles/<legacy_id> and
/api/articles/<legacy_id>/external_services
Type: any
PaywallStatus
Status of the paywall:
- 0 = paywall completely turned off, paywall scripts don't have to be loaded
- 1 = paywall is tracking visits, but is not enforcing limits (probably meaning that template sets don't have to be loaded?)
- 2 = paywall is enabled
Type: (0 | 1 | 2)
Statistic
- See: Article
Basic statistic object.
Part of /api/articles/<legacy_id> and
/api/articles/<legacy_id>/external_services.
Type: {provider: ("wemf" | "webseismo" | "gtm"), type: string}
Properties
provider("wemf"|"webseismo"|"gtm")typestring
Wemf
- See: Statistic
Additional properties for Statistic objects of type 'wemf'. Use with flow type intersections.
Type: {url: string, webapp_url: string, iphone_url: string, ipad_url: string, android_url: string, desktop_url: string}
Properties
urlstringwebapp_urlstringiphone_urlstringipad_urlstringandroid_urlstringdesktop_urlstring
Examples
let wemfInfo: Statistic & WemfWebseismo
- See: Statistic
Additional properties for Statistic object of type 'webseismo'. Use with flow type intersections.
Type: {url_desktop: string, url_webapp: string, url_smartphone: string, url_tablet: string, url: string}
Properties
Examples
let webseismoInfo: Statistic & WebseismoGtm
- See: Statistic
Additional properties for Statistic objects of type 'gtm'. Use with flow type intersections.
Type: {article_id: number, article_title: string, article_type: string, pagetype: string, premium: boolean, publish_date: number, category: string, subcategory: string}
Properties
article_idnumberarticle_titlestringarticle_typestringpagetypestringpremiumbooleanpublish_datenumbercategorystringsubcategorystring
Examples
let gtmInfo: Statistic & GtmArticle
The article type, as provided by the Newsnet API.
Provided by /api/articles/<legacy_id>
Type: {article: ArticleContent}
Properties
articleArticleContent
ArticleContent
- See: Article
The contents of an article. The API wraps these contents below an
article key.
Type: {id: string, legacy_id: number, title: string, title_short: string, picture_small_url: string, picture_medium_url: string, picture_big_url: string, lead: string, lead_short: string, lead_teaser: string, timestamp_updated_at: number, first_published_at: number, external_services: {statistics: Array<Statistic>, ads: any, paywall: Paywall}, authors: Array<Author>}
Properties
idstringlegacy_idnumbertitlestringtitle_shortstringpicture_small_urlstringpicture_medium_urlstringpicture_big_urlstringleadstringlead_shortstringlead_teaserstringtimestamp_updated_atnumberfirst_published_atnumberexternal_services{statistics: Array<Statistic>, ads: any, paywall: Paywall}authorsArray<Author>
SiteConfig
Site configuration that is also part of the External_Services object
Type: {name_short: string, name: string, title: string, language: string, feedback_url: string, ads_enabled: boolean, facebook_id: string, facebook_url: string, twitter_via: string, gtm_id: string, paywall_status: PaywallStatus}
Properties
name_shortstringnamestringtitlestringlanguagestringfeedback_urlstringads_enabledbooleanfacebook_idstringfacebook_urlstringtwitter_viastringgtm_idstringpaywall_statusPaywallStatus
name_short
'TA' or 'B'
Type: string
name
Full name of publication
Type: string
title
Name with tag line
Type: string
SiteContent
Common information about the site.
Type: any
Site
General information about the site.
Provided by /api/sites/default
Type: {site: any}
Properties
siteany
Contributing
Development
Building & Releasing
Changes should go into the changelog. The format is based on Keep a Changelog and this project adheres to Semantic Versioning. Update the changelog using the last commit messages since the last version tag using
yarn run changelogUpdate the Readme with the current API using
yarn run docs6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago