@saooti/octopus-sdk 41.10.0 → 41.10.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 41.10.2 (04/05/2026)
4
+
5
+ **Misc**
6
+
7
+ - Suppression de RadioFrance des plateformes audio, afin d'utiliser la
8
+ nouvelle fonctionnalité d'identification des plateformes audio
9
+
10
+ ## 41.10.1 (04/05/2026)
11
+
12
+ **Fixes**
13
+
14
+ - **14469** - Correction récupération incorrecte de la configuration de
15
+ traduction de l'organisation
16
+
3
17
  ## 41.10.0 (04/05/2026)
4
18
 
5
19
  **Features**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "41.10.0",
3
+ "version": "41.10.2",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -10,7 +10,6 @@ import ApplePodcastIcon from "../../icons/ApplePodcastIcon.vue";
10
10
  import CastboxIcon from "../../icons/CastboxIcon.vue";
11
11
  import PodcastRepublicIcon from "../../icons/PodcastRepublicIcon.vue";
12
12
  import PodbeanIcon from "../../icons/PodbeanIcon.vue";
13
- import RadioFranceIcon from "../../icons/RadioFranceIcon.vue";
14
13
  import YoutubeIcon from "vue-material-design-icons/Youtube.vue";
15
14
  import SpotifyIcon from "vue-material-design-icons/Spotify.vue";
16
15
  import { Annotations } from "@/stores/class/general";
@@ -34,8 +33,7 @@ export enum SharePlatformName {
34
33
  YOUTUBE = "youtube",
35
34
  CASTBOX = "castbox",
36
35
  PODBEAN = "podbean",
37
- PODCAST_REPUBLIC = "podcastrepublic",
38
- RADIO_FRANCE = "radiofrance"
36
+ PODCAST_REPUBLIC = "podcastrepublic"
39
37
  }
40
38
 
41
39
  export interface SharePlatform {
@@ -126,11 +124,6 @@ export const PREDEFINED_PLATFORMS: Array<SharePlatform> = [{
126
124
  icon: markRaw(PodcastRepublicIcon),
127
125
  title: "Podcast Republic",
128
126
  color: "#5c85dd",
129
- }, {
130
- name: SharePlatformName.RADIO_FRANCE,
131
- icon: markRaw(RadioFranceIcon),
132
- title: "Radio France",
133
- color: "#a90041",
134
127
  }];
135
128
 
136
129
  export const useSharePlatforms = () => {
@@ -3,6 +3,8 @@ import { transcriptionApi, TranslationState, type PodcastTranslationData } from
3
3
  import { CreateTranslation, defaultTranslationConfig, TranslationConfiguration } from "../../stores/class/transcript/transcriptParams";
4
4
  import { podcastApi } from "../../api/podcastApi";
5
5
  import { Emission } from "../../stores/class/general/emission";
6
+ import { OrganisationAttributes } from "@/stores/class/general/organisation";
7
+ import { organisationApi } from "../../api/organisationApi";
6
8
 
7
9
  const DEFAULT_LANGUAGE = 'en';
8
10
 
@@ -67,21 +69,20 @@ export const useTranslation = () => {
67
69
  * @param emission *(optional)* If set, will also check in emission settings
68
70
  * @returns Whether the language is available or not
69
71
  */
70
- function getTranslationConfig(language: string, emission: Emission): CreateTranslation {
71
- const orgAttributes = emission.orga.attributes;
72
- const emissionTranslation = parseOrDefault(emission?.annotations?.['translation-config'] as string|undefined, true);
73
- const orgTranslation = parseOrDefault(orgAttributes?.['translation-config']);
72
+ function getTranslationConfig(language: string, emission: Emission, orgaAttributes: OrganisationAttributes): CreateTranslation {
73
+ const emissionTranslation = parseOrDefault(emission.annotations?.['translation-config'] as string|undefined, true);
74
+ const orgTranslation = parseOrDefault(orgaAttributes?.['translation-config']);
74
75
 
75
76
  return getConfigurationFor(language, emissionTranslation, orgTranslation);
76
77
  }
77
78
 
78
- function getLanguageAvailability(language: string, emission: Emission, translationData: PodcastTranslationData): Availability {
79
+ function getLanguageAvailability(language: string, emission: Emission, orgaAttributes: OrganisationAttributes, translationData: PodcastTranslationData): Availability {
79
80
 
80
81
  // 1. If language of podcast == language of browser, use that language
81
82
  if (language === translationData.nativeLanguage) {
82
83
  return Availability.Available;
83
84
  } else {
84
- const langConfig = getTranslationConfig(language, emission);
85
+ const langConfig = getTranslationConfig(language, emission, orgaAttributes);
85
86
 
86
87
  // 2. If the language of the browser is available, use it
87
88
  if (langConfig === CreateTranslation.ALWAYS) {
@@ -136,12 +137,13 @@ export const useTranslation = () => {
136
137
 
137
138
  const podcast = await podcastApi.get(translationData.podcastId);
138
139
  const emission = podcast.emission;
140
+ const orgaAttributes = await organisationApi.getAttributes(podcast.organisation.id);
139
141
 
140
142
  let bestReady: string|null = null;
141
143
  let bestAvailable: string|null = null;
142
144
 
143
145
  for (const language of languages) {
144
- const avaibility = getLanguageAvailability(language, emission, translationData);
146
+ const avaibility = getLanguageAvailability(language, emission, orgaAttributes, translationData);
145
147
  if (avaibility === Availability.Available && bestReady === null) {
146
148
  bestReady = language;
147
149
  break;
@@ -19,19 +19,26 @@ vi.mock('@/api/podcastApi', () => ({
19
19
  },
20
20
  }));
21
21
 
22
+ vi.mock('@/api/organisationApi', () => ({
23
+ organisationApi: {
24
+ getAttributes: vi.fn()
25
+ }
26
+ }));
27
+
22
28
  vi.mock('@/helper/language', () => ({
23
29
  getLanguage: vi.fn().mockReturnValue('fr'),
24
30
  }));
25
31
 
26
32
  import { transcriptionApi, type PodcastTranslationData } from '@/api/transcriptionApi';
27
33
  import { podcastApi } from '@/api/podcastApi';
34
+ import { organisationApi } from '@/api/organisationApi';
28
35
  import { getLanguage } from '@/helper/language';
29
36
 
30
37
  function makeTranslationData(overrides: Partial<PodcastTranslationData> = {}): PodcastTranslationData {
31
38
  return { podcastId: 1, nativeLanguage: 'fr', translations: [], ...overrides };
32
39
  }
33
40
 
34
- function makeEmission(orgConfig?: object): Emission {
41
+ function makeEmission(): Emission {
35
42
  return {
36
43
  emissionId: 0,
37
44
  name: '',
@@ -40,7 +47,6 @@ function makeEmission(orgConfig?: object): Emission {
40
47
  id: 'test-org',
41
48
  imageUrl: '',
42
49
  name: 'Test Org',
43
- attributes: orgConfig ? { 'translation-config': JSON.stringify(orgConfig) } : undefined,
44
50
  },
45
51
  beneficiaries: [],
46
52
  rubriqueIds: [],
@@ -50,7 +56,17 @@ function makeEmission(orgConfig?: object): Emission {
50
56
  }
51
57
 
52
58
  function setOrgTranslationConfig(config: object) {
53
- vi.mocked(podcastApi.get).mockResolvedValue({ emission: makeEmission(config) } as never);
59
+ vi.mocked(podcastApi.get).mockResolvedValue({
60
+ emission: makeEmission(),
61
+ organisation: { id: 1 }
62
+ } as never);
63
+ setOrgAttributes(config);
64
+ }
65
+
66
+ function setOrgAttributes(orgConfig: object) {
67
+ vi.mocked(organisationApi.getAttributes).mockResolvedValue({
68
+ 'translation-config': JSON.stringify(orgConfig)
69
+ });
54
70
  }
55
71
 
56
72
  describe('useTranslation', () => {
@@ -97,6 +113,10 @@ describe('useTranslation', () => {
97
113
  });
98
114
 
99
115
  const translationData = { nativeLanguage: 'it', podcastId: 0, translations: [] };
116
+ setOrgTranslationConfig({
117
+ createTranslation: { en: CreateTranslation.ALWAYS },
118
+ otherLanguage: CreateTranslation.NEVER,
119
+ });
100
120
 
101
121
  const result = await composable.getMostRelevantLanguage(translationData)
102
122
  expect(result.ready).toBe('it');
@@ -111,6 +131,10 @@ describe('useTranslation', () => {
111
131
  });
112
132
 
113
133
  const translationData = { nativeLanguage: 'fr', podcastId: 0, translations: [] };
134
+ setOrgTranslationConfig({
135
+ createTranslation: { en: CreateTranslation.ALWAYS },
136
+ otherLanguage: CreateTranslation.NEVER,
137
+ });
114
138
 
115
139
  const result = await composable.getMostRelevantLanguage(translationData)
116
140
  expect(result.ready).toBe('fr');
@@ -1,166 +0,0 @@
1
- <template>
2
- <span
3
- :aria-hidden="!title"
4
- class="material-design-icon"
5
- :title="title"
6
- >
7
- <svg
8
- :width="size"
9
- :height="size"
10
- viewBox="0 0 58 58"
11
- fill="none"
12
- xmlns="http://www.w3.org/2000/svg"
13
- >
14
- <path
15
- fill-rule="evenodd"
16
- clip-rule="evenodd"
17
- d="M37.0892 33.8774C37.0892 35.7523 36.5961 37.5174 35.7265 39.0643H50.1862C50.5743 37.3938 50.7809 35.6586 50.7809 33.8774C50.7809 23.6473 44.0269 14.9123 34.5121 11.4499V0.596397H21.9553V23.3202C23.0498 22.9984 24.2131 22.8248 25.419 22.8248C31.8644 22.8248 37.0892 27.7733 37.0892 33.8774Z"
18
- :fill="'url(#' + uid + 'p0)'"
19
- />
20
- <path
21
- fill-rule="evenodd"
22
- clip-rule="evenodd"
23
- d="M29.5724 44.3362C28.2958 44.7861 26.9145 45.0321 25.4717 45.0321C18.9987 45.0321 13.7507 40.0835 13.7507 33.9785C13.7507 32.2762 14.1593 30.664 14.8881 29.2236H0.500687C0.173332 30.7608 0 32.3507 0 33.9785C0 47.2455 11.404 58 25.4717 58C26.8678 58 28.2374 57.8924 29.5724 57.6889V44.3362Z"
24
- :fill="'url(#' + uid + 'p1)'"
25
- />
26
- <path
27
- fill-rule="evenodd"
28
- clip-rule="evenodd"
29
- d="M37.1502 33.909C37.1502 35.7895 36.6555 37.5598 35.7831 39.1113H50.2891C50.6784 37.4358 50.8857 35.6954 50.8857 33.909C50.8857 23.6484 44.1101 14.8873 34.5649 11.4146V0.528656H21.9678V23.3202C23.0658 22.9975 24.2329 22.8234 25.4426 22.8234C31.9087 22.8234 37.1502 27.7867 37.1502 33.909Z"
30
- :fill="'url(#' + uid + 'p2)'"
31
- />
32
- <path
33
- fill-rule="evenodd"
34
- clip-rule="evenodd"
35
- d="M29.5386 44.2967C28.2634 44.7479 26.8837 44.9945 25.4426 44.9945C18.977 44.9945 13.735 40.0316 13.735 33.9089C13.735 32.2017 14.1431 30.5848 14.8711 29.1403H0.500114C0.173133 30.682 0 32.2764 0 33.9089C0 47.2143 11.3909 58 25.4426 58C26.8371 58 28.2051 57.8921 29.5386 57.688V44.2967Z"
36
- :fill="'url(#' + uid + 'p3)'"
37
- />
38
- <path
39
- fill-rule="evenodd"
40
- clip-rule="evenodd"
41
- d="M60.6053 19.1855C60.6053 16.4375 60.6053 14.0587 60.5519 11.7338H68.0196C68.1254 12.3676 68.2313 15.0632 68.2313 16.5431C69.4495 13.4249 72.3623 11.1523 77.0225 11.0995V18.3403C71.5145 18.1814 68.2313 19.6613 68.2313 27.1663V39.1113H60.6053V19.1855Z"
42
- fill="url(#paint4_linear_75_103)"
43
- />
44
- <path
45
- fill-rule="evenodd"
46
- clip-rule="evenodd"
47
- d="M115.556 33.6677C120.746 33.6677 121.381 29.3333 121.381 25.4223C121.381 20.7186 120.693 17.1774 115.714 17.1774C111.743 17.1774 109.73 20.2956 109.73 25.4751C109.73 30.8136 111.796 33.6677 115.556 33.6677ZM128.637 0.528656V31.6059C128.637 34.0902 128.637 36.627 128.69 39.1113H121.434C121.275 38.2657 121.116 36.8915 121.064 36.2572C119.739 38.4242 117.356 39.7456 113.278 39.7456C106.34 39.7456 101.945 34.1963 101.945 25.6341C101.945 17.2302 106.606 11.0995 114.39 11.0995C118.362 11.0995 120.481 12.5261 121.064 13.7418V0.528656H128.637Z"
48
- fill="url(#paint5_linear_75_103)"
49
- />
50
- <path
51
- fill-rule="evenodd"
52
- clip-rule="evenodd"
53
- d="M131.681 39.1113H139.308V11.7338H131.681V39.1113ZM131.681 7.2937H139.308V0.528656H131.681V7.2937Z"
54
- fill="url(#paint6_linear_75_103)"
55
- />
56
- <path
57
- fill-rule="evenodd"
58
- clip-rule="evenodd"
59
- d="M148.596 25.4223C148.596 30.7079 150.874 33.8257 154.528 33.8257C158.288 33.8257 160.353 30.7079 160.353 25.4751C160.353 19.7669 158.235 17.0718 154.422 17.0718C150.926 17.0718 148.596 19.6613 148.596 25.4223ZM168.032 25.3695C168.032 33.6677 163.054 39.7456 154.369 39.7456C145.895 39.7456 140.917 33.6677 140.917 25.528C140.917 17.0718 146.054 11.0995 154.739 11.0995C162.789 11.0995 168.032 16.8076 168.032 25.3695Z"
60
- fill="url(#paint7_linear_75_103)"
61
- />
62
- <path
63
- fill-rule="evenodd"
64
- clip-rule="evenodd"
65
- d="M170.69 39.1113V17.4415H168.46V11.7338H170.69V9.35504C170.69 3.70012 173.497 0 179.429 0C180.647 0 182.235 0.105641 182.924 0.31737V6.28966C182.5 6.23684 181.917 6.18358 181.335 6.18358C179.111 6.18358 178.263 6.97678 178.263 9.93651V11.7338H182.133V17.4415H178.263V39.1113H170.69Z"
66
- fill="url(#paint8_linear_75_103)"
67
- />
68
- <path
69
- fill-rule="evenodd"
70
- clip-rule="evenodd"
71
- d="M183.316 19.1855C183.316 16.4375 183.316 14.0587 183.263 11.7338H190.73C190.836 12.3676 190.942 15.0632 190.942 16.5431C192.16 13.4249 195.073 11.1523 199.733 11.0995V18.3403C194.226 18.1814 190.942 19.6613 190.942 27.1663V39.1113H183.316V19.1855Z"
72
- fill="url(#paint9_linear_75_103)"
73
- />
74
- <path
75
- fill-rule="evenodd"
76
- clip-rule="evenodd"
77
- d="M226.106 11.7338H233.468C233.627 12.4732 233.732 14.3761 233.785 15.2217C234.686 13.5305 236.91 11.0995 241.729 11.0995C247.237 11.0995 250.785 14.8519 250.785 21.7226V39.1113H243.213V22.5682C243.213 19.45 242.207 17.2302 238.817 17.2302C235.586 17.2302 233.785 19.0274 233.785 23.8896V39.1113H226.159V18.6573C226.159 16.3314 226.159 13.7946 226.106 11.7338Z"
78
- fill="url(#paint10_linear_75_103)"
79
- />
80
- <path
81
- fill-rule="evenodd"
82
- clip-rule="evenodd"
83
- d="M277.529 30.2849C276.63 34.8306 273.398 39.7456 265.243 39.7456C256.717 39.7456 252.321 33.879 252.321 25.634C252.321 17.5471 257.246 11.0995 265.614 11.0995C274.829 11.0995 277.424 17.7589 277.529 20.8242H270.168C269.692 18.6044 268.421 17.0718 265.455 17.0718C261.96 17.0718 260 20.0843 260 25.3695C260 31.2361 262.118 33.879 265.402 33.879C268.05 33.879 269.427 32.3463 270.115 30.2849H277.529Z"
84
- fill="url(#paint11_linear_75_103)"
85
- />
86
- <path d="M296.374 22.4102C296.321 19.2387 295.05 16.5431 291.342 16.5431C287.742 16.5431 286.258 19.0275 285.941 22.4102H296.374ZM285.782 27.0606C285.782 30.4962 287.529 33.8257 291.29 33.8257C294.467 33.8257 295.368 32.5576 296.109 30.9192H303.682C302.729 34.2492 299.711 39.7456 291.131 39.7456C282.075 39.7456 278.156 33.0334 278.156 25.8453C278.156 17.2302 282.552 11.0995 291.396 11.0995C300.77 11.0995 304 17.9173 304 24.7356C304 25.6869 304 26.2683 303.894 27.0606H285.782Z" fill="url(#paint12_linear_75_103)" />
87
- <path
88
- fill-rule="evenodd"
89
- clip-rule="evenodd"
90
- d="M92.9792 27.378C92.9792 30.9716 92.397 34.3543 87.5775 34.3543C84.8235 34.3543 83.6053 32.6632 83.6053 30.7079C83.6053 28.0651 85.3003 26.6381 89.9076 26.6381H92.9792V27.378ZM100.393 32.0294V20.5601C100.393 14.0064 96.3687 11.1523 89.0603 11.0995C81.5344 11.0995 78.3368 14.2638 77.4998 18.4379L84.5059 19.873C84.8235 17.8645 85.5649 16.5431 88.7428 16.5431C92.2907 16.5431 92.9792 18.446 92.9792 20.4012V22.0396H89.0603C81.0105 22.0396 76.0322 24.9469 76.0322 31.1833C76.0322 35.4116 78.7862 39.7456 85.4061 39.7456C90.2781 39.7456 92.1319 37.9484 93.1379 36.4161C93.1379 37.1032 93.2967 38.5827 93.5089 39.1113H100.764C100.606 38.477 100.393 34.6717 100.393 32.0294Z"
91
- fill="url(#paint13_linear_75_103)"
92
- />
93
- <path
94
- fill-rule="evenodd"
95
- clip-rule="evenodd"
96
- d="M215.69 27.378C215.69 30.9716 215.108 34.3543 210.288 34.3543C207.534 34.3543 206.316 32.6632 206.316 30.7079C206.316 28.0651 208.01 26.6381 212.618 26.6381H215.69V27.378ZM223.104 32.0294V20.5601C223.104 14.0064 219.079 11.1523 211.771 11.0995C204.245 11.0995 201.047 14.2638 200.21 18.4379L207.217 19.873C207.534 17.8645 208.275 16.5431 211.453 16.5431C215.001 16.5431 215.69 18.446 215.69 20.4012V22.0396H211.771C203.721 22.0396 198.743 24.9469 198.743 31.1833C198.743 35.4116 201.497 39.7456 208.117 39.7456C212.989 39.7456 214.842 37.9484 215.849 36.4161C215.849 37.1032 216.007 38.5827 216.219 39.1113H223.475C223.316 38.477 223.104 34.6717 223.104 32.0294Z"
97
- fill="url(#paint14_linear_75_103)"
98
- />
99
- <defs>
100
- <linearGradient
101
- :id="uid + 'p0'"
102
- x1="37.483"
103
- y1="3.20798"
104
- x2="21.3118"
105
- y2="32.4338"
106
- gradientUnits="userSpaceOnUse"
107
- >
108
- <stop stop-color="#8D044F" />
109
- <stop offset="0.278736" stop-color="#AC47B6" />
110
- <stop offset="0.419307" stop-color="#986BAA" />
111
- <stop offset="0.677775" stop-color="#FF6C5B" />
112
- <stop offset="1" stop-color="#FD0323" />
113
- </linearGradient>
114
- <linearGradient
115
- :id="uid + 'p1'"
116
- x1="8.26123"
117
- y1="34.1806"
118
- x2="25.2003"
119
- y2="57.7245"
120
- gradientUnits="userSpaceOnUse"
121
- >
122
- <stop stop-color="#B800C4" />
123
- <stop offset="0.427705" stop-color="#E0008C" />
124
- <stop offset="1" stop-color="#FF0101" />
125
- </linearGradient>
126
- <linearGradient
127
- :id="uid + 'p2'"
128
- x1="37.5457"
129
- y1="3.14803"
130
- x2="21.3224"
131
- y2="32.4618"
132
- gradientUnits="userSpaceOnUse"
133
- >
134
- <stop stop-color="#8D044F" />
135
- <stop offset="0.278736" stop-color="#AC47B6" />
136
- <stop offset="0.419307" stop-color="#986BAA" />
137
- <stop offset="0.677775" stop-color="#FF6C5B" />
138
- <stop offset="1" stop-color="#FD0323" />
139
- </linearGradient>
140
- <linearGradient
141
- :id="uid + 'p3'"
142
- x1="8.25178"
143
- y1="34.035"
144
- x2="25.2587"
145
- y2="57.7687"
146
- gradientUnits="userSpaceOnUse"
147
- >
148
- <stop stop-color="#B800C4" />
149
- <stop offset="0.427705" stop-color="#E0008C" />
150
- <stop offset="1" stop-color="#FF0101" />
151
- </linearGradient>
152
- </defs>
153
- </svg>
154
- </span>
155
- </template>
156
-
157
- <script setup lang="ts">
158
- import { useId } from 'vue'
159
-
160
- const uid = useId()
161
-
162
- defineProps({
163
- size: { default: 24, type: Number },
164
- title: { default: undefined, type: String },
165
- })
166
- </script>