@playpilot/tpi 8.41.0 → 8.42.0

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.
@@ -1,147 +1,158 @@
1
- import type { InsertPosition } from './position'
2
-
3
- export type ConfigResponse = {
4
- /**
5
- * Used to exclude URL matching a regex pattern. If a url matches, nothing is executed beyond fetching the config.
6
- * The url should never be indexed.
7
- */
8
- exclude_urls_pattern?: string
9
-
10
- /**
11
- * Similar to `exclude_urls_pattern` but limited to participant injections. Other injections will continue to function.
12
- */
13
- exclude_participants_urls_pattern?: string
14
-
15
- /**
16
- * Used to inject custom styling for the links, modal, and popover. All styling is done via CSS variables. The passed
17
- * string should not contain a selector.
18
- * For example:
19
- * `--some-variable: some-value;`
20
- *
21
- * rather than:
22
- * `body { --some-variable: some-value; }`
23
- */
24
- custom_style?: string
25
-
26
- /**
27
- * The primary selector for the entire article from which text will be selected. Should contain as little content as
28
- * possible. Should match all pages. May contain multiple selectors like `.article, .listicle`.
29
- */
30
- html_selector?: string
31
-
32
- /**
33
- * Some pages contain elements that can't easily be excluded via the `html_selector`. These elements can instead be
34
- * excluded via this property. May contain multiple selectors like `.footer, .ad`.
35
- */
36
- exclude_elements_selector?: string
37
-
38
- /**
39
- * Disable all injections from showing on pages without editorial mode enabled
40
- */
41
- disable_public_injections?: boolean
42
-
43
- /**
44
- * Region to fall back on if other methods of getting the region fail. This should be equal to the region most relevant
45
- * to the partner. Should be lowercase.
46
- */
47
- fallback_region?: string
48
-
49
- /**
50
- * Disclaimer text that is shown above playlinks in title cards used to replace the default text
51
- */
52
- playlinks_disclaimer_text?: string
53
-
54
- /**
55
- * Some partners may want to display titles without affiliate links, which currently comes down to no playlinks.
56
- * This can also be set via the config on the script itself.
57
- */
58
- no_affiliate?: boolean
59
-
60
- /**
61
- * Whether or not we can insert retargeting pixels. Not all third parties allow this and it is disabled by default
62
- */
63
- allow_retargeting_pixels?: boolean
64
-
65
- /**
66
- * By default affiliate links (playlinks) will render as links even without consent, as a disclaimer is given. Set to true to require explicit consent, rendering as static text without consent.
67
- */
68
- require_affiliate_consent?: boolean
69
-
70
- /**
71
- * Scroll reveal posters that show on mobile are enabled by default. Use this option to disable them.
72
- */
73
- disable_scroll_reveal_posters?: boolean
74
-
75
- /**
76
- * Playlinks are merged by default, when this option is enabled playlinks will instead be shown categorized.
77
- */
78
- categorize_playlinks?: boolean
79
-
80
- /**
81
- * By default no user identifiable data is tracked. This can be changed using this option. User ids are stored in localStorage and sent along with any tracking request.
82
- */
83
- allow_user_id_tracking?: boolean
84
-
85
- /**
86
- * The sid for the current domain, used for tracking
87
- */
88
- domain_sid?: string
89
-
90
- /**
91
- * The sid for the organization the domain belongs to, used for tracking. Can be empty.
92
- */
93
- organization_sid?: string
94
-
95
- /**
96
- * The following options are all relevant for in text disclaimers, which renders as a disclaimer text within the article,
97
- * rather than only inside of title cards.
98
- * Change the text content using `in_text_disclaimer_text`.
99
- * Change where the element is inserted using `in_text_disclaimer_selector`, by default it will insert before the first text element.
100
- * Change the insert position using `in_text_disclaimer_insert_position`, by default it will insert before the given selector.
101
- */
102
- in_text_disclaimer_enabled?: boolean
103
- in_text_disclaimer_text?: string
104
- in_text_disclaimer_selector?: string
105
- in_text_disclaimer_insert_position?: InsertPosition
106
-
107
- /**
108
- * Open TPI links in explore rather than in modals in the article
109
- */
110
- open_tpi_links_in_explore?: boolean
111
-
112
- /**
113
- * Participants with a popularity score lower than this threshold will not be injected
114
- */
115
- participant_injection_popularity_threshold?: number
116
-
117
- /**
118
- * Whether or not to base the threshold on the article participants average popularity score.
119
- * When enabled, this turns `participant_injection_popularity_threshold` into a percentage.
120
- */
121
- participant_injection_popularity_threshold_use_article_average?: boolean
122
-
123
- /**
124
- * Include a limit of how many times a single titles/participants may appear in one article.
125
- */
126
- unique_injection_count_limit?: number
127
-
128
- /**
129
- * No more than this count of participant links will show on the entire article.
130
- */
131
- total_participant_injection_count_limit?: number
132
-
133
- /**
134
- * These options are all relevant for the Explore component, which can be inserted as a widget on any page or as a modal.
135
- * `explore_navigation_selector` is used to select the navigation element that should be copied and inserted _after_.
136
- * `explore_navigation_label` will end up being the label of the navigation item, defaults to `Streaming Guide`.
137
- * `explore_navigation_path` is the path that the navigation item will lead to, this will be set up by the third party.
138
- * `explore_navigation_insert_position` is used to determine if the navigation item should be inserted before or after the given selector.
139
- * `explore_insert_cta_in_tpi` is used to insert a call to action in modals which opens the explore page as a modal.
140
- */
141
- explore_navigation_selector?: string
142
- explore_navigation_label?: string
143
- explore_navigation_path?: string
144
- explore_navigation_insert_position?: InsertPosition
145
- explore_insert_cta_in_tpi?: boolean
146
- explore_custom_style?: string
147
- }
1
+ import type { LinkInjection } from './injection'
2
+ import type { InsertPosition } from './position'
3
+
4
+ export type ConfigResponse = {
5
+ /**
6
+ * Used to exclude URL matching a regex pattern. If a url matches, nothing is executed beyond fetching the config.
7
+ * The url should never be indexed.
8
+ */
9
+ exclude_urls_pattern?: string
10
+
11
+ /**
12
+ * Similar to `exclude_urls_pattern` but limited to participant injections. Other injections will continue to function.
13
+ */
14
+ exclude_participants_urls_pattern?: string
15
+
16
+ /**
17
+ * Used to inject custom styling for the links, modal, and popover. All styling is done via CSS variables. The passed
18
+ * string should not contain a selector.
19
+ * For example:
20
+ * `--some-variable: some-value;`
21
+ *
22
+ * rather than:
23
+ * `body { --some-variable: some-value; }`
24
+ */
25
+ custom_style?: string
26
+
27
+ /**
28
+ * The primary selector for the entire article from which text will be selected. Should contain as little content as
29
+ * possible. Should match all pages. May contain multiple selectors like `.article, .listicle`.
30
+ */
31
+ html_selector?: string
32
+
33
+ /**
34
+ * Some pages contain elements that can't easily be excluded via the `html_selector`. These elements can instead be
35
+ * excluded via this property. May contain multiple selectors like `.footer, .ad`.
36
+ */
37
+ exclude_elements_selector?: string
38
+
39
+ /**
40
+ * Disable all injections from showing on pages without editorial mode enabled
41
+ */
42
+ disable_public_injections?: boolean
43
+
44
+ /**
45
+ * Region to fall back on if other methods of getting the region fail. This should be equal to the region most relevant
46
+ * to the partner. Should be lowercase.
47
+ */
48
+ fallback_region?: string
49
+
50
+ /**
51
+ * Disclaimer text that is shown above playlinks in title cards used to replace the default text
52
+ */
53
+ playlinks_disclaimer_text?: string
54
+
55
+ /**
56
+ * Some partners may want to display titles without affiliate links, which currently comes down to no playlinks.
57
+ * This can also be set via the config on the script itself.
58
+ */
59
+ no_affiliate?: boolean
60
+
61
+ /**
62
+ * Whether or not we can insert retargeting pixels. Not all third parties allow this and it is disabled by default
63
+ */
64
+ allow_retargeting_pixels?: boolean
65
+
66
+ /**
67
+ * By default affiliate links (playlinks) will render as links even without consent, as a disclaimer is given. Set to true to require explicit consent, rendering as static text without consent.
68
+ */
69
+ require_affiliate_consent?: boolean
70
+
71
+ /**
72
+ * Scroll reveal posters that show on mobile are enabled by default. Use this option to disable them.
73
+ */
74
+ disable_scroll_reveal_posters?: boolean
75
+
76
+ /**
77
+ * Playlinks are merged by default, when this option is enabled playlinks will instead be shown categorized.
78
+ */
79
+ categorize_playlinks?: boolean
80
+
81
+ /**
82
+ * By default no user identifiable data is tracked. This can be changed using this option. User ids are stored in localStorage and sent along with any tracking request.
83
+ */
84
+ allow_user_id_tracking?: boolean
85
+
86
+ /**
87
+ * The sid for the current domain, used for tracking
88
+ */
89
+ domain_sid?: string
90
+
91
+ /**
92
+ * The sid for the organization the domain belongs to, used for tracking. Can be empty.
93
+ */
94
+ organization_sid?: string
95
+
96
+ /**
97
+ * The following options are all relevant for in text disclaimers, which renders as a disclaimer text within the article,
98
+ * rather than only inside of title cards.
99
+ * Change the text content using `in_text_disclaimer_text`.
100
+ * Change where the element is inserted using `in_text_disclaimer_selector`, by default it will insert before the first text element.
101
+ * Change the insert position using `in_text_disclaimer_insert_position`, by default it will insert before the given selector.
102
+ */
103
+ in_text_disclaimer_enabled?: boolean
104
+ in_text_disclaimer_text?: string
105
+ in_text_disclaimer_selector?: string
106
+ in_text_disclaimer_insert_position?: InsertPosition
107
+
108
+ /**
109
+ * Open TPI links in explore rather than in modals in the article
110
+ */
111
+ open_tpi_links_in_explore?: boolean
112
+
113
+ /**
114
+ * Participants with a popularity score lower than this threshold will not be injected
115
+ */
116
+ participant_injection_popularity_threshold?: number
117
+
118
+ /**
119
+ * Whether or not to base the threshold on the article participants average popularity score.
120
+ * When enabled, this turns `participant_injection_popularity_threshold` into a percentage.
121
+ */
122
+ participant_injection_popularity_threshold_use_article_average?: boolean
123
+
124
+ /**
125
+ * Include a limit of how many times a single titles/participants may appear in one article.
126
+ */
127
+ unique_injection_count_limit?: number
128
+
129
+ /**
130
+ * No more than this count of participant links will show on the entire article.
131
+ */
132
+ total_participant_injection_count_limit?: number
133
+
134
+ /**
135
+ * Exclude any injections that use one of the given anchors
136
+ */
137
+ exclude_injections_by_anchors?: LinkInjection['anchor'][]
138
+
139
+ /**
140
+ * Exclude any injections that use one of the given evidence
141
+ */
142
+ exclude_injections_by_evidence?: LinkInjection['evidence'][]
143
+
144
+ /**
145
+ * These options are all relevant for the Explore component, which can be inserted as a widget on any page or as a modal.
146
+ * `explore_navigation_selector` is used to select the navigation element that should be copied and inserted _after_.
147
+ * `explore_navigation_label` will end up being the label of the navigation item, defaults to `Streaming Guide`.
148
+ * `explore_navigation_path` is the path that the navigation item will lead to, this will be set up by the third party.
149
+ * `explore_navigation_insert_position` is used to determine if the navigation item should be inserted before or after the given selector.
150
+ * `explore_insert_cta_in_tpi` is used to insert a call to action in modals which opens the explore page as a modal.
151
+ */
152
+ explore_navigation_selector?: string
153
+ explore_navigation_label?: string
154
+ explore_navigation_path?: string
155
+ explore_navigation_insert_position?: InsertPosition
156
+ explore_insert_cta_in_tpi?: boolean
157
+ explore_custom_style?: string
158
+ }
@@ -1,59 +1,65 @@
1
- import type { ParticipantData } from './participant'
2
- import type { TitleData } from './title'
3
-
4
- export type LinkInjectionDataType = 'title' | 'participant'
5
-
6
- export type LinkInjection = {
7
- sid: string
8
- title: string
9
- sentence: string
10
- playpilot_url: string
11
- key: string
12
- title_details?: TitleData
13
- participant_details?: ParticipantData
14
- phrase_before?: string | null
15
- phrase_after?: string | null
16
- inactive?: boolean
17
- failed?: boolean
18
- failed_message?: string
19
- in_text?: boolean
20
- after_article?: boolean
21
- after_article_style?: 'modal_button' | 'playlinks' | null
22
- manual?: boolean
23
- removed?: boolean
24
- duplicate?: boolean
25
- matchingElement?: null | Element
26
- popularity?: number | null
27
- type: LinkInjectionDataType
28
- }
29
-
30
- export type LinkInjectionRanges = Record<string, { elementIndex: number, from: number, to: number }>
31
-
32
- export type LinkInjectionResponse = {
33
- injections_ready: boolean
34
- ai_enabled: boolean
35
- injections_enabled: boolean
36
- ai_running: boolean
37
- ai_injections: LinkInjection[] | null
38
- ai_progress_message: string
39
- ai_progress_percentage: number
40
- ai_last_run: string | null
41
- manual_injections: LinkInjection[] | null
42
- organization_sid?: string
43
- domain_sid?: string
44
- session_id?: string | null
45
- session_last_ping?: string | null
46
- content_modified_time?: string | null
47
- pixels?: string[]
48
- }
49
-
50
- export type LinkInjectionTypes = {
51
- aiInjections: LinkInjection[]
52
- manualInjections: LinkInjection[]
53
- }
54
-
55
- export type ArticleMetaData = {
56
- content_heading: string | null
57
- content_modified_time: string | null
58
- content_published_time: string | null
59
- }
1
+ import type { ParticipantData } from './participant'
2
+ import type { TitleData } from './title'
3
+
4
+ export type LinkInjectionDataType = 'title' | 'participant'
5
+
6
+ export type LinkInjection = {
7
+ sid: string
8
+ title: string
9
+ sentence: string
10
+ playpilot_url: string
11
+ key: string
12
+ title_details?: TitleData
13
+ participant_details?: ParticipantData
14
+ phrase_before?: string | null
15
+ phrase_after?: string | null
16
+ inactive?: boolean
17
+ failed?: boolean
18
+ failed_message?: string
19
+ in_text?: boolean
20
+ after_article?: boolean
21
+ after_article_style?: 'modal_button' | 'playlinks' | null
22
+ manual?: boolean
23
+ removed?: boolean
24
+ duplicate?: boolean
25
+ matchingElement?: null | Element
26
+ popularity?: number | null
27
+ anchor?: 'full' | 'attached' | 'bare' | null
28
+ evidence?: 'credited' | 'screen_work' | 'title_mention' | 'name_only' | null
29
+ type: LinkInjectionDataType
30
+ }
31
+
32
+ export type LinkInjectionRanges = Record<string, {
33
+ elementIndex: number
34
+ from: number
35
+ to: number
36
+ }>
37
+
38
+ export type LinkInjectionResponse = {
39
+ injections_ready: boolean
40
+ ai_enabled: boolean
41
+ injections_enabled: boolean
42
+ ai_running: boolean
43
+ ai_injections: LinkInjection[] | null
44
+ ai_progress_message: string
45
+ ai_progress_percentage: number
46
+ ai_last_run: string | null
47
+ manual_injections: LinkInjection[] | null
48
+ organization_sid?: string
49
+ domain_sid?: string
50
+ session_id?: string | null
51
+ session_last_ping?: string | null
52
+ content_modified_time?: string | null
53
+ pixels?: string[]
54
+ }
55
+
56
+ export type LinkInjectionTypes = {
57
+ aiInjections: LinkInjection[]
58
+ manualInjections: LinkInjection[]
59
+ }
60
+
61
+ export type ArticleMetaData = {
62
+ content_heading: string | null
63
+ content_modified_time: string | null
64
+ content_published_time: string | null
65
+ }