@playpilot/tpi 8.29.11 → 8.31.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.
Files changed (32) hide show
  1. package/dist/editorial.mount.js +9 -9
  2. package/dist/link-injections.js +1 -1
  3. package/dist/mount.js +7 -7
  4. package/package.json +1 -1
  5. package/src/lib/api/externalPages.ts +1 -0
  6. package/src/lib/api/participants.ts +1 -1
  7. package/src/lib/api/providers.ts +1 -1
  8. package/src/lib/api/search.ts +9 -0
  9. package/src/lib/api/titles.ts +1 -1
  10. package/src/lib/injection.ts +479 -479
  11. package/src/lib/types/global.d.ts +1 -0
  12. package/src/routes/components/Editorial/Editor.svelte +0 -2
  13. package/src/routes/components/Editorial/EditorItem.svelte +2 -2
  14. package/src/routes/components/Editorial/ManualInjection.svelte +26 -19
  15. package/src/routes/components/Editorial/Search/ParticipantSearchItem.svelte +86 -0
  16. package/src/routes/components/Editorial/Search/TypeSearch.svelte +120 -0
  17. package/src/routes/components/Explore/Routes/ExploreModal.svelte +107 -107
  18. package/src/routes/components/Modals/TitlesReelModal.svelte +3 -3
  19. package/src/routes/components/Rails/TitlesRail.svelte +1 -1
  20. package/src/routes/components/Tabs.svelte +12 -23
  21. package/src/routes/components/YouTubeEmbed.svelte +61 -20
  22. package/src/routes/components/YouTubeEmbedBackground.svelte +1 -0
  23. package/src/routes/components/YouTubeEmbedOverlay.svelte +1 -1
  24. package/src/routes/elements/+page.svelte +12 -0
  25. package/src/tests/lib/api/externalPages.test.js +134 -1
  26. package/src/tests/routes/components/Editorial/EditorItem.test.js +1 -2
  27. package/src/tests/routes/components/Editorial/ManualInjection.test.js +43 -6
  28. package/src/tests/routes/components/Editorial/Search/{TitleSearch.test.js → TypeSearch.test.js} +21 -9
  29. package/src/tests/routes/components/YouTubeEmbed.test.js +109 -33
  30. package/src/tests/routes/components/YouTubeEmbedBackground.test.js +2 -3
  31. package/src/tests/routes/components/YouTubeEmbedOverlay.test.js +2 -3
  32. package/src/routes/components/Editorial/Search/TitleSearch.svelte +0 -96
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.29.11",
3
+ "version": "8.31.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -151,6 +151,7 @@ export async function saveLinkInjections(linkInjections: LinkInjection[]): Promi
151
151
  in_text: linkInjection.in_text ?? true,
152
152
  inactive: !!linkInjection.inactive,
153
153
  removed: !!linkInjection.removed,
154
+ type: linkInjection.type,
154
155
  }))
155
156
 
156
157
  const response = await fetchLinkInjections({
@@ -10,7 +10,7 @@ export async function fetchTitlesForParticipant(participant: ParticipantData, {
10
10
  const params = {
11
11
  language: getLanguage(),
12
12
  region: await getRegionBasedOnIp(),
13
- include_count: 'false',
13
+ include_count: false,
14
14
  participant_sid: participant.sid,
15
15
  page,
16
16
  }
@@ -12,7 +12,7 @@ export async function fetchProviders(): Promise<PlaylinkData[]> {
12
12
  const params = {
13
13
  region: await getRegionBasedOnIp(),
14
14
  page: 1,
15
- include_count: 'false',
15
+ include_count: false,
16
16
  }
17
17
 
18
18
  const response = await api<PlaylinkData[]>(`/providers/?api-token=${apiToken}&` + paramsToString(params))
@@ -1,4 +1,5 @@
1
1
  import { getApiToken } from '$lib/token'
2
+ import type { ParticipantData } from '$lib/types/participant'
2
3
  import type { TitleData } from '../types/title'
3
4
  import { api } from './api'
4
5
 
@@ -9,3 +10,11 @@ export async function searchTitles(query: string): Promise<TitleData[]> {
9
10
 
10
11
  return await api<TitleData[]>(`/search/titles/?api-token=${apiToken}&query=${query}`)
11
12
  }
13
+
14
+ export async function searchParticipants(query: string): Promise<ParticipantData[]> {
15
+ const apiToken = getApiToken()
16
+
17
+ if (!apiToken) throw new Error('No token was provided')
18
+
19
+ return await api<ParticipantData[]>(`/search/participants/?api-token=${apiToken}&query=${query}`)
20
+ }
@@ -14,7 +14,7 @@ export async function fetchTitles(params: Record<string, any> = {}): Promise<API
14
14
  params = {
15
15
  ...params,
16
16
  language: getLanguage(),
17
- include_count: 'false',
17
+ include_count: false,
18
18
  }
19
19
 
20
20
  if (params.region !== null) {