@ta-interaktiv/newsnet-api-flow-types
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -6,2 +6,4 @@ // @flow | ||
*/ | ||
import type { CacheInformation } from '../external_services/cache' | ||
export type CommunityType = 'dark' | 'facebook' | 'twitter' | 'whatsapp' | 'share' | 'comment' | ||
@@ -17,8 +19,6 @@ | ||
*/ | ||
export type Community = { | ||
export type BasicCommunity = { | ||
type: CommunityType, | ||
count: number, | ||
article_id: string, | ||
refresh: DateString, | ||
cache: string | boolean, | ||
share_type_id: string, | ||
@@ -35,2 +35,4 @@ url?: string, | ||
comment_count_text?: string, | ||
} | ||
} | ||
export type Community = BasicCommunity & CacheInformation |
@@ -6,2 +6,5 @@ // @flow | ||
import type { Paywall } from './paywall' | ||
import type { SiteConfig } from '../../../sites/default' | ||
import type { CacheInformation } from './cache' | ||
import type { Ads } from './ads' | ||
@@ -14,7 +17,7 @@ /** | ||
export type External_Services = { | ||
configs: *, | ||
configs: SiteConfig & CacheInformation, | ||
paywall: Paywall, | ||
ads: *, | ||
ads: Ads, | ||
statistics: Array<Statistic>, | ||
communities: Array<Community> | ||
} |
// @flow | ||
import type { CacheInformation } from './cache' | ||
export type BasicPaywall = { | ||
doc_type: string, | ||
main_channel: string, | ||
sub_channel: string, | ||
cms_id: number | ||
} | ||
/** | ||
@@ -9,7 +17,12 @@ * Basic Paywall object | ||
*/ | ||
export type Paywall = { | ||
doc_type: string, | ||
main_channel: string, | ||
sub_channel: string, | ||
cms_id: number | ||
} | ||
export type Paywall = BasicPaywall & CacheInformation | ||
/** | ||
* 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 | ||
*/ | ||
export type PaywallStatus = 0 | 1 | 2 |
@@ -1,26 +0,19 @@ | ||
//@flow | ||
import type {Statistic} from '../../articles/article/external_services/statistic'; | ||
// @flow | ||
import type { Statistic } from '../../articles/article/external_services/statistic' | ||
import type { CacheInformation } from '../../articles/article/external_services/cache' | ||
import type { PaywallStatus } from '../../articles/article/external_services/paywall' | ||
/** | ||
* General information about the site. | ||
* | ||
* Provided by `/api/sites/default` | ||
* Site configuration that is also part of the External_Services object | ||
*/ | ||
export type Site = { | ||
site: SiteContent | ||
} | ||
/** | ||
* Common information about the site. | ||
* | ||
* @todo Fill out all properties, currently not complete | ||
* | ||
*/ | ||
export type SiteContent = { | ||
id: string, | ||
export type SiteConfig = { | ||
/** 'TA' or 'B' */ | ||
name_short: string, | ||
/** Full name of publication */ | ||
name: string, | ||
/** Name with tag line */ | ||
title: string, | ||
language: string, | ||
feedback_url: string, | ||
ads_enabled: boolean, | ||
facebook_id: string, | ||
@@ -30,3 +23,13 @@ facebook_url: string, | ||
gtm_id: string, | ||
paywall_status: number, | ||
paywall_status: PaywallStatus, | ||
} | ||
export type DefaultSiteConfigs = { | ||
id: string, | ||
weather_title: string, | ||
weather_url: string, | ||
meteonews_id: number, | ||
log_enabled: boolean, | ||
dfp_site_identifier: string, | ||
use_ssl: boolean, | ||
statistics: Array<Statistic>, | ||
@@ -38,1 +41,18 @@ external_services: { | ||
/** | ||
* Common information about the site. | ||
* | ||
* @todo Fill out all properties, currently not complete | ||
* | ||
*/ | ||
export type SiteContent = SiteConfig & DefaultSiteConfigs | ||
/** | ||
* General information about the site. | ||
* | ||
* Provided by `/api/sites/default` | ||
*/ | ||
export type Site = { | ||
site: SiteContent & CacheInformation | ||
} | ||
@@ -6,2 +6,14 @@ # Change Log | ||
<a name="0.7.0"></a> | ||
# [0.7.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/newsnet-api-flow-types@0.6.0...@ta-interaktiv/newsnet-api-flow-types@0.7.0) (2018-03-05) | ||
### Features | ||
* add and export PaywallStatus ([792e0ff](https://gitlab.com/ta-interaktiv/packages/commit/792e0ff)) | ||
* add CacheInformation type and flesh out External_Services ([a5d454f](https://gitlab.com/ta-interaktiv/packages/commit/a5d454f)) | ||
<a name="0.6.0"></a> | ||
@@ -8,0 +20,0 @@ # 0.6.0 (2018-02-28) |
@@ -6,5 +6,7 @@ // @flow | ||
export type { Statistic, Gtm, Webseismo, Wemf } from './api/articles/article/external_services/statistic' | ||
export type { Paywall } from './api/articles/article/external_services/paywall' | ||
export type { Paywall, PaywallStatus } from './api/articles/article/external_services/paywall' | ||
export type {Community} from './api/articles/article/communities/community' | ||
export type {Communities} from './api/articles/article/communities/index' | ||
export type {Site, SiteContent} from './api/sites/default' | ||
export type {Site, SiteContent, SiteConfig} from './api/sites/default' | ||
export { CacheInformation } from './api/articles/article/external_services/cache' | ||
{ | ||
"name": "@ta-interaktiv/newsnet-api-flow-types", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Flow type definitions for stuff the Newsnet API returns.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
126
README.md
@@ -14,8 +14,12 @@ # Newsnet API Flow Types | ||
- [Author](#author) | ||
- [CommunityType](#communitytype) | ||
- [CacheInformation](#cacheinformation) | ||
- [CacheInformation](#cacheinformation-1) | ||
- [DateString](#datestring) | ||
- [Community](#community) | ||
- [BasicCommunity](#basiccommunity) | ||
- [Communities](#communities) | ||
- [cache](#cache) | ||
- [refresh](#refresh) | ||
- [External_Services](#external_services) | ||
- [Paywall](#paywall) | ||
- [PaywallStatus](#paywallstatus) | ||
- [Statistic](#statistic) | ||
@@ -27,4 +31,8 @@ - [Wemf](#wemf) | ||
- [ArticleContent](#articlecontent) | ||
- [SiteConfig](#siteconfig) | ||
- [name_short](#name_short) | ||
- [name](#name) | ||
- [title](#title) | ||
- [SiteContent](#sitecontent) | ||
- [Site](#site) | ||
- [SiteContent](#sitecontent) | ||
@@ -50,8 +58,18 @@ ### Author | ||
### CommunityType | ||
### CacheInformation | ||
The available types of communities so far. | ||
Type: (`"dark"` \| `"facebook"` \| `"twitter"` \| `"whatsapp"` \| `"share"` \| `"comment"`) | ||
### 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](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)} | ||
**Properties** | ||
- `cache` **(`"true"` \| `"false"`)** | ||
- `refresh` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
### DateString | ||
@@ -63,15 +81,13 @@ | ||
### Community | ||
### BasicCommunity | ||
Community object, used for providing social media information. | ||
Type: {type: [CommunityType](#communitytype), count: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), article_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), refresh: [DateString](#datestring), cache: ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)), share_type_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), url: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, description: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, name: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, title: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, description: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, facebook_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, via: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, allow_comments_weekdays: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, allow_comments_weekends: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, comment_count_text: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?} | ||
Type: {type: CommunityType, count: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), article_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), share_type_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), url: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, description: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, name: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, title: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, description: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, facebook_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, via: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, allow_comments_weekdays: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, allow_comments_weekends: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, comment_count_text: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?} | ||
**Properties** | ||
- `type` **[CommunityType](#communitytype)** | ||
- `type` **CommunityType** | ||
- `count` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | ||
- `article_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `refresh` **[DateString](#datestring)** | ||
- `cache` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** | ||
- `share_type_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
@@ -93,8 +109,16 @@ - `url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** | ||
Type: {communities: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Community](#community)>} | ||
Type: {communities: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<Community>} | ||
**Properties** | ||
- `communities` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Community](#community)>** | ||
- `communities` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<Community>** | ||
### cache | ||
I guess this should be a boolean, but it is returned as a string | ||
### refresh | ||
Date Object, in the form 'DD.MM.YYYY hh:mm:ss' | ||
### External_Services | ||
@@ -106,3 +130,3 @@ | ||
Type: {configs: any, paywall: [Paywall](#paywall), ads: any, statistics: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>, communities: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Community](#community)>} | ||
Type: {configs: any, paywall: [Paywall](#paywall), ads: Ads, statistics: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>, communities: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<Community>} | ||
@@ -113,5 +137,5 @@ **Properties** | ||
- `paywall` **[Paywall](#paywall)** | ||
- `ads` **any** | ||
- `ads` **Ads** | ||
- `statistics` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>** | ||
- `communities` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Community](#community)>** | ||
- `communities` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<Community>** | ||
@@ -125,11 +149,16 @@ ### Paywall | ||
Type: {doc_type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), main_channel: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), sub_channel: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), cms_id: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)} | ||
Type: any | ||
**Properties** | ||
### PaywallStatus | ||
- `doc_type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `main_channel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `sub_channel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `cms_id` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | ||
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 | ||
@@ -265,23 +294,10 @@ | ||
### Site | ||
### SiteConfig | ||
General information about the site. | ||
Site configuration that is also part of the External_Services object | ||
Provided by `/api/sites/default` | ||
Type: {name_short: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), name: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), title: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), language: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), feedback_url: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), ads_enabled: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean), facebook_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), facebook_url: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), twitter_via: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), gtm_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), paywall_status: [PaywallStatus](#paywallstatus)} | ||
Type: {site: [SiteContent](#sitecontent)} | ||
**Properties** | ||
- `site` **[SiteContent](#sitecontent)** | ||
### SiteContent | ||
Common information about the site. | ||
Type: {id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), name_short: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), name: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), title: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), language: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), feedback_url: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), facebook_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), facebook_url: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), twitter_via: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), gtm_id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), paywall_status: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), statistics: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>, external_services: {statistics: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>}} | ||
**Properties** | ||
- `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `name_short` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
@@ -292,2 +308,3 @@ - `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `feedback_url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `ads_enabled` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | ||
- `facebook_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
@@ -297,7 +314,34 @@ - `facebook_url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `gtm_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `paywall_status` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | ||
- `statistics` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>** | ||
- `external_services` **{statistics: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>}** | ||
- `external_services.statistics` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Statistic](#statistic)>** | ||
- `paywall_status` **[PaywallStatus](#paywallstatus)** | ||
### name_short | ||
'TA' or 'B' | ||
### name | ||
Full name of publication | ||
### title | ||
Name with tag line | ||
### SiteContent | ||
Common information about the site. | ||
Type: any | ||
### Site | ||
General information about the site. | ||
Provided by `/api/sites/default` | ||
Type: {site: any} | ||
**Properties** | ||
- `site` **any** | ||
## Contributing | ||
@@ -304,0 +348,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40059
18
273
357