@saooti/octopus-sdk 41.11.0 → 41.11.1

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,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 41.11.1 (17/06/2026)
4
+
5
+ **Fixes**
6
+
7
+ - **14257** - Correction lecture radio depuis orga sécurisée
8
+ - **14587** - Correction détection de langue pour les sous-titres
9
+
3
10
  ## 41.11.0 (05/06/2026)
4
11
 
5
12
  **Features**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "41.11.0",
3
+ "version": "41.11.1",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -24,12 +24,17 @@ export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
24
24
  const apiStore = useApiStore();
25
25
  const authStore = useAuthStore();
26
26
 
27
- const needToAddToken = computed(() => {
28
- return authStore.authParam.accessToken && ("SECURED" === playerStore.playerLive?.organisation?.privacy || playerStore.playerRadio?.secured);
29
- });
27
+ function needToAddToken(url: string): boolean {
28
+ if (authStore.authParam.accessToken && ("SECURED" === playerStore.playerLive?.organisation?.privacy || playerStore.playerRadio?.secured)) {
29
+ const baseDomain = apiStore.frontendUrl.replace(/^https?:\/\//, '');
30
+ // Add token only if request is on same domain
31
+ return url.includes(baseDomain);
32
+ }
33
+ return false;
34
+ }
30
35
 
31
36
  function onPlay(): void {
32
- playerStore.playerChangeStatus(PlayerStatus.PAUSED ===playerStore.playerStatus);
37
+ playerStore.playerChangeStatus(PlayerStatus.PAUSED === playerStore.playerStatus);
33
38
  }
34
39
 
35
40
  function playRadio() {
@@ -77,7 +82,7 @@ export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
77
82
  !isAndroid
78
83
  ) {
79
84
  let url = playerStore.playerHlsUrl;
80
- if(needToAddToken.value) {
85
+ if(needToAddToken(url)) {
81
86
  if (url.includes('?')) {
82
87
  url += "&access_token="+authStore.authParam.accessToken;
83
88
  } else {
@@ -123,8 +128,8 @@ export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
123
128
  backBufferLength:10,
124
129
  maxBufferLength:60,
125
130
 
126
- xhrSetup: (xhr: XMLHttpRequest) => {
127
- if (needToAddToken.value) {
131
+ xhrSetup: (xhr: XMLHttpRequest, url: string) => {
132
+ if (needToAddToken(url)) {
128
133
  xhr.setRequestHeader("Authorization", "Bearer " +authStore.authParam.accessToken);
129
134
  }
130
135
  }
@@ -122,17 +122,15 @@ export const useTranslation = () => {
122
122
  // languages defined on browser, then default, and finally native language
123
123
  const languages: string[] = [];
124
124
  [userLanguage, ...navigator.languages, DEFAULT_LANGUAGE, translationData.nativeLanguage].forEach(l => {
125
+ // For each language, if it is a variant (for example fr-CH), use
126
+ // only the base language
127
+ if (l.includes('-')) {
128
+ l = l.split('-')[0];
129
+ }
130
+
125
131
  if (!languages.includes(l)) {
126
132
  languages.push(l);
127
133
  }
128
- // For each language, if it is a variant (for example fr-CH), also
129
- // add the base language
130
- if (l.includes('-')) {
131
- const base = l.split('-')[0];
132
- if (!languages.includes(base)) {
133
- languages.push(base);
134
- }
135
- }
136
134
  });
137
135
 
138
136
  const podcast = await podcastApi.get(translationData.podcastId);
package/tsconfig.json CHANGED
@@ -5,13 +5,15 @@
5
5
  // "strict": true,
6
6
  "jsx": "preserve",
7
7
  "importHelpers": true,
8
- "moduleResolution": "bundler",
8
+ "moduleResolution": "node",
9
9
  "experimentalDecorators": true,
10
10
  "skipLibCheck": true,
11
11
  "esModuleInterop": true,
12
12
  "allowSyntheticDefaultImports": true,
13
13
  "sourceMap": true,
14
+ "baseUrl": ".",
14
15
  "types": [
16
+ "webpack-env",
15
17
  "sockjs-client"
16
18
  ],
17
19
  "paths": {
@@ -19,7 +21,7 @@
19
21
  "./src/*"
20
22
  ],
21
23
  "@tests/*": [
22
- "./tests/*"
24
+ "tests/*"
23
25
  ]
24
26
  },
25
27
  "lib": [
@@ -32,7 +34,9 @@
32
34
  "include": [
33
35
  "src/**/*.ts",
34
36
  "src/**/*.tsx",
35
- "src/**/*.vue"
37
+ "src/**/*.vue",
38
+ "tests/**/*.ts",
39
+ "tests/**/*.tsx"
36
40
  ],
37
41
  "exclude": [
38
42
  "node_modules"
package/vitest.config.js CHANGED
@@ -12,8 +12,7 @@ export default defineConfig(env => mergeConfig(viteConfig(env), defineConfig({
12
12
  environment: 'happy-dom',
13
13
  //setupFiles: ['./tests/setup.ts'],
14
14
  typecheck: {
15
- enabled: true,
16
- tsconfig: './tsconfig.test.json'
15
+ enabled: true
17
16
  }
18
17
  }
19
18
  })));
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "types": ["sockjs-client", "vitest/globals"]
5
- },
6
- "include": [
7
- "src/**/*.ts",
8
- "src/**/*.tsx",
9
- "src/**/*.vue",
10
- "tests/**/*.ts",
11
- "tests/**/*.tsx"
12
- ]
13
- }