@saooti/octopus-sdk 37.0.24 → 37.0.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "37.0.24",
3
+ "version": "37.0.26",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -24,21 +24,24 @@ export default defineComponent({
24
24
  sort: this.sortCriteria,
25
25
  };
26
26
  },
27
- computed:{
28
- optionsArray(){
29
- let options = [
30
- { title: this.$t('Sort score'), value: 'SCORE' },
27
+ computed: {
28
+ optionsArray() {
29
+ let options = [
30
+ { title: this.$t("Sort score"), value: "SCORE" },
31
31
  {
32
- title: this.$t('Sort last'),
33
- value: this.isEmission ? 'LAST_PODCAST_DESC' : 'DATE',
32
+ title: this.$t("Sort last"),
33
+ value: this.isEmission ? "LAST_PODCAST_DESC" : "DATE",
34
34
  },
35
- { title: this.$t('Sort name'), value: 'NAME' },
35
+ { title: this.$t("Sort name"), value: "NAME" },
36
36
  ];
37
- if(!this.isEmission){
38
- options.splice(2,0, { title: this.$t('Chronological'), value: 'DATE_ASC' });
37
+ if (!this.isEmission) {
38
+ options.splice(2, 0, {
39
+ title: this.$t("Chronological"),
40
+ value: "DATE_ASC",
41
+ });
39
42
  }
40
43
  return options;
41
- }
44
+ },
42
45
  },
43
46
  watch: {
44
47
  sort(): void {
@@ -6,10 +6,8 @@
6
6
  v-if="!justSizeChosen"
7
7
  class="d-flex justify-content-between align-items-center flex-grow-1 w-100"
8
8
  >
9
- <div class="text-secondary">
10
- <template
11
- v-if="textCount && (windowWidth > 1300 || windowWidth <= 960)"
12
- >
9
+ <div class="text-secondary me-3">
10
+ <template v-if="textCount">
13
11
  {{ textCount }}
14
12
  </template>
15
13
  </div>
@@ -191,7 +191,7 @@ export default defineComponent({
191
191
  if (!this.podcast || 1970 === dayjs(this.podcast.pubDate).year()) {
192
192
  return "";
193
193
  }
194
- if(this.isLiveReadyToRecord){
194
+ if (this.isLiveReadyToRecord) {
195
195
  return dayjs(this.podcast.pubDate).format("D MMMM YYYY - HH:mm");
196
196
  }
197
197
  return dayjs(this.podcast.pubDate).format("D MMMM YYYY");
@@ -264,9 +264,9 @@ export default defineComponent({
264
264
  },
265
265
  methods: {
266
266
  removeDeleted(): void {
267
- if(this.isLiveReadyToRecord){
267
+ if (this.isLiveReadyToRecord) {
268
268
  this.$router.push("/main/pub/lives");
269
- }else if (window.history.length > 1) {
269
+ } else if (window.history.length > 1) {
270
270
  this.$router.go(-1);
271
271
  } else {
272
272
  this.$router.push("/");
@@ -25,11 +25,11 @@
25
25
  <script lang="ts">
26
26
  import ClassicCheckbox from "../../form/ClassicCheckbox.vue";
27
27
  import { state } from "../../../stores/ParamSdkStore";
28
- import octopusApi from "@saooti/octopus-api";
29
28
  import SnackBar from "../../misc/SnackBar.vue";
30
29
  import QrcodeVue from "qrcode.vue";
30
+ import { useSaveFetchStore } from "@/stores/SaveFetchStore";
31
31
  import { useAuthStore } from "@/stores/AuthStore";
32
- import { mapState } from "pinia";
32
+ import { mapState, mapActions } from "pinia";
33
33
  import { defineComponent } from "vue";
34
34
  export default defineComponent({
35
35
  name: "QrCode",
@@ -62,6 +62,7 @@ export default defineComponent({
62
62
  this.initColor();
63
63
  },
64
64
  methods: {
65
+ ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
65
66
  download(): void {
66
67
  const link = document.createElement("a");
67
68
  link.download = "qrcode.png";
@@ -83,21 +84,13 @@ export default defineComponent({
83
84
  return;
84
85
  }
85
86
  if (!state.generalParameters.authenticated) return;
86
- let data;
87
- if (
88
- "" !== this.authOrganisation.id &&
89
- this.authOrganisation.attributes &&
90
- Object.keys(this.authOrganisation.attributes).length > 1
91
- ) {
92
- data = this.authOrganisation.attributes;
93
- } else {
94
- data = await octopusApi.fetchData<{ [key: string]: string }>(
95
- 0,
96
- "organisation/attributes/" + state.generalParameters.organisationId,
97
- );
98
- }
99
- if (Object.prototype.hasOwnProperty.call(data, "COLOR")) {
100
- this.otherColor = data.COLOR as string;
87
+ const orgaId =
88
+ "" !== this.authOrganisation.id
89
+ ? this.authOrganisation.id
90
+ : state.generalParameters.organisationId;
91
+ const attributes = await this.getOrgaAttributes(orgaId ?? "");
92
+ if (Object.prototype.hasOwnProperty.call(attributes, "COLOR")) {
93
+ this.otherColor = attributes.COLOR as string;
101
94
  }
102
95
  },
103
96
  },
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="module-box">
2
+ <div v-if="!isLoading && (authenticated || !noSharing)" class="module-box">
3
3
  <div class="d-flex align-items-center mb-3">
4
4
  <h2 class="big-h2 mb-0">
5
5
  {{ $t("Share") }}
@@ -21,6 +21,7 @@
21
21
  />
22
22
  </div>
23
23
  <ShareButtonsIntern
24
+ :no-sharing="noSharing"
24
25
  :podcast="podcast"
25
26
  :emission="emission"
26
27
  :playlist="playlist"
@@ -31,6 +32,8 @@
31
32
  </template>
32
33
 
33
34
  <script lang="ts">
35
+ import { useSaveFetchStore } from "@/stores/SaveFetchStore";
36
+ import { mapActions } from "pinia";
34
37
  import { Emission } from "@/stores/class/general/emission";
35
38
  import { Podcast } from "@/stores/class/general/podcast";
36
39
  import { state } from "../../../stores/ParamSdkStore";
@@ -52,10 +55,27 @@ export default defineComponent({
52
55
  participantId: { default: undefined, type: Number },
53
56
  organisationId: { default: undefined, type: String },
54
57
  },
58
+ data() {
59
+ return {
60
+ noSharing: true as boolean,
61
+ isLoading: true as boolean,
62
+ };
63
+ },
55
64
  computed: {
56
65
  authenticated(): boolean {
57
66
  return state.generalParameters.authenticated as boolean;
58
67
  },
59
68
  },
69
+ async created() {
70
+ if (!this.organisationId) {
71
+ return;
72
+ }
73
+ const attributes = await this.getOrgaAttributes(this.organisationId);
74
+ this.noSharing = "true" === attributes.noSharing;
75
+ this.isLoading = false;
76
+ },
77
+ methods: {
78
+ ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
79
+ },
60
80
  });
61
81
  </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="d-flex align-items-center justify-content-between">
3
- <div v-if="!isGarStudent" class="d-flex flex-column me-2">
3
+ <div v-if="!isGarStudent && !noSharing" class="d-flex flex-column me-2">
4
4
  <div class="h4 mb-2">
5
5
  {{ $t("Social networks") }}
6
6
  </div>
@@ -135,6 +135,7 @@ export default defineComponent({
135
135
  mixins: [displayMethods],
136
136
 
137
137
  props: {
138
+ noSharing: { default: false, type: Boolean },
138
139
  podcast: { default: undefined, type: Object as () => Podcast },
139
140
  emission: { default: undefined, type: Object as () => Emission },
140
141
  playlist: { default: undefined, type: Object as () => Playlist },
@@ -208,17 +209,17 @@ export default defineComponent({
208
209
  if (this.participantId) {
209
210
  return api + "participant/" + this.participantId + ".rss";
210
211
  }
211
- if (this.organisationId) {
212
- return api + "productor/" + this.organisationId + ".rss";
213
- }
214
212
  if (this.playlist) {
215
213
  return api + "playlist/" + this.playlist.playlistId + ".rss";
216
214
  }
215
+ if (this.organisationId) {
216
+ return api + "productor/" + this.organisationId + ".rss";
217
+ }
217
218
  return "";
218
219
  },
219
220
  },
220
221
  async created() {
221
- if (this.organisationId || this.participantId) {
222
+ if (undefined !== this.participantId) {
222
223
  this.displayRss = await octopusApi.fetchDataPublic<boolean>(
223
224
  0,
224
225
  `rss/participants/allowed/${this.organisationId}`,
@@ -90,12 +90,12 @@
90
90
  <script lang="ts">
91
91
  import { orgaComputed } from "../../mixins/orgaComputed";
92
92
  import { state } from "../../../stores/ParamSdkStore";
93
- import octopusApi from "@saooti/octopus-api";
94
93
  import { Podcast } from "@/stores/class/general/podcast";
95
94
  import { Emission } from "@/stores/class/general/emission";
96
95
  import { Playlist } from "@/stores/class/general/playlist";
97
96
  import { useAuthStore } from "@/stores/AuthStore";
98
- import { mapState } from "pinia";
97
+ import { useSaveFetchStore } from "@/stores/SaveFetchStore";
98
+ import { mapState, mapActions } from "pinia";
99
99
  import { defineComponent, defineAsyncComponent } from "vue";
100
100
  const ShareModalPlayer = defineAsyncComponent(
101
101
  () => import("../../misc/modal/ShareModalPlayer.vue"),
@@ -217,8 +217,11 @@ export default defineComponent({
217
217
  );
218
218
  },
219
219
  iFrameSrc(): string {
220
- if("video" === this.iFrameModel){
221
- return "//www.ultimedia.com/deliver/generic/iframe/mdtk/01009833/zone/1/showtitle/1/src/" + this.podcast?.video?.videoId
220
+ if ("video" === this.iFrameModel) {
221
+ return (
222
+ "http://www.ultimedia.com/deliver/generic/iframe/mdtk/01009833/zone/1/showtitle/1/src/" +
223
+ this.podcast?.video?.videoId
224
+ );
222
225
  }
223
226
  let url = [""];
224
227
  let iFrameNumber =
@@ -246,22 +249,26 @@ export default defineComponent({
246
249
  },
247
250
  iFrameHeight(): string {
248
251
  switch (this.iFrameModel) {
249
- case 'video': return 'auto';
250
- case 'large':
251
- if (this.podcast) return '140px';
252
- return '350px';
253
- case 'largeMore':
254
- return '210px';
255
- case 'emissionLarge':
256
- case 'largeSuggestion':
257
- return '350px';
258
- case 'emission':return '520px';
252
+ case "video":
253
+ return "auto";
254
+ case "large":
255
+ if (this.podcast) return "140px";
256
+ return "350px";
257
+ case "largeMore":
258
+ return "210px";
259
+ case "emissionLarge":
260
+ case "largeSuggestion":
261
+ return "350px";
262
+ case "emission":
263
+ return "520px";
259
264
  default:
260
265
  return "530px";
261
266
  }
262
267
  },
263
268
  iFrame(): string {
264
- const specialDigiteka = this.podcast?.video?.videoId ? 'allowfullscreen="true" allow="autoplay" referrerpolicy="no-referrer-when-downgrade"' : '';
269
+ const specialDigiteka = this.podcast?.video?.videoId
270
+ ? 'allowfullscreen="true" allow="autoplay" referrerpolicy="no-referrer-when-downgrade"'
271
+ : "";
265
272
  return `<iframe src="${this.iFrameSrc}" width="100%" height="${this.iFrameHeight}" scrolling="no" frameborder="0" ${specialDigiteka}></iframe>`;
266
273
  },
267
274
  isPodcastNotVisible(): boolean {
@@ -290,13 +297,18 @@ export default defineComponent({
290
297
  },
291
298
  },
292
299
  async created() {
293
- await this.fetchOrgaAttributes();
300
+ const orgaId =
301
+ "" !== this.authOrganisation.id
302
+ ? this.authOrganisation.id
303
+ : state.generalParameters.organisationId;
304
+ this.orgaAttributes = await this.getOrgaAttributes(orgaId ?? "");
294
305
  this.initColor();
295
306
  if (this.isLiveReadyToRecord) {
296
307
  this.iFrameModel = "large";
297
308
  }
298
309
  },
299
310
  methods: {
311
+ ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
300
312
  getIframeNumber(): string {
301
313
  return this.displayChoiceAllEpisodes && "all" === this.episodeNumbers
302
314
  ? "/0"
@@ -360,19 +372,6 @@ export default defineComponent({
360
372
  }
361
373
  return url;
362
374
  },
363
- async fetchOrgaAttributes(): Promise<void> {
364
- if (
365
- "" !== this.authOrganisation.id &&
366
- this.authOrganisation.attributes &&
367
- Object.keys(this.authOrganisation.attributes).length > 1
368
- ) {
369
- this.orgaAttributes = this.authOrganisation.attributes;
370
- } else {
371
- this.orgaAttributes = await octopusApi.fetchData<{
372
- [key: string]: string;
373
- }>(0, "organisation/attributes/" + this.myOrganisationId);
374
- }
375
- },
376
375
  initColor(): void {
377
376
  if (!this.orgaAttributes) {
378
377
  return;
@@ -34,9 +34,9 @@
34
34
  <script lang="ts">
35
35
  import { orgaComputed } from "../../mixins/orgaComputed";
36
36
  import { state } from "../../../stores/ParamSdkStore";
37
- import octopusApi from "@saooti/octopus-api";
37
+ import { useSaveFetchStore } from "@/stores/SaveFetchStore";
38
38
  import { useAuthStore } from "@/stores/AuthStore";
39
- import { mapState } from "pinia";
39
+ import { mapState, mapActions } from "pinia";
40
40
  import { defineComponent, defineAsyncComponent } from "vue";
41
41
  import { Canal } from "@/stores/class/radio/canal";
42
42
  const ShareModalPlayer = defineAsyncComponent(
@@ -81,23 +81,15 @@ export default defineComponent({
81
81
  },
82
82
  },
83
83
  async created() {
84
- await this.fetchOrgaAttributes();
84
+ const orgaId =
85
+ "" !== this.authOrganisation.id
86
+ ? this.authOrganisation.id
87
+ : state.generalParameters.organisationId;
88
+ this.orgaAttributes = await this.getOrgaAttributes(orgaId ?? "");
85
89
  this.initColor();
86
90
  },
87
91
  methods: {
88
- async fetchOrgaAttributes(): Promise<void> {
89
- if (
90
- "" !== this.authOrganisation.id &&
91
- this.authOrganisation.attributes &&
92
- Object.keys(this.authOrganisation.attributes).length > 1
93
- ) {
94
- this.orgaAttributes = this.authOrganisation.attributes;
95
- } else {
96
- this.orgaAttributes = await octopusApi.fetchData<{
97
- [key: string]: string;
98
- }>(0, "organisation/attributes/" + this.myOrganisationId);
99
- }
100
- },
92
+ ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
101
93
  initColor(): void {
102
94
  if (!this.orgaAttributes) {
103
95
  return;
@@ -46,19 +46,41 @@ export default defineComponent({
46
46
  };
47
47
  },
48
48
  computed: {
49
- isVideoPodcast(): boolean{
50
- return undefined!==this.podcast && undefined!==this.podcast.video?.videoId;
49
+ isVideoPodcast(): boolean {
50
+ return (
51
+ undefined !== this.podcast && undefined !== this.podcast.video?.videoId
52
+ );
51
53
  },
52
54
  optionsSelect() {
53
55
  return [
54
- {name: this.$t('Video Version'), value: 'video', condition: this.isVideoPodcast},
55
- {name: this.$t('Default version'), value: 'default', condition: true},
56
- {name: this.$t('Large version'), value: 'large', condition: true},
57
- {name: this.$t('Full Large version'), value: 'largeMore', condition: this.podcast && this.podcast.podcastId},
58
- {name: this.$t('Emission version'), value: 'emission', condition: this.podcast && this.podcast.podcastId},
59
- {name: this.$t('Large emission version'), value: 'emissionLarge', condition: this.podcast && this.podcast.podcastId},
60
- {name: this.$t('Large suggestion version'), value: 'largeSuggestion', condition: this.podcast && this.podcast.podcastId}
61
- ]
56
+ {
57
+ name: this.$t("Video Version"),
58
+ value: "video",
59
+ condition: this.isVideoPodcast,
60
+ },
61
+ { name: this.$t("Default version"), value: "default", condition: true },
62
+ { name: this.$t("Large version"), value: "large", condition: true },
63
+ {
64
+ name: this.$t("Full Large version"),
65
+ value: "largeMore",
66
+ condition: this.podcast && this.podcast.podcastId,
67
+ },
68
+ {
69
+ name: this.$t("Emission version"),
70
+ value: "emission",
71
+ condition: this.podcast && this.podcast.podcastId,
72
+ },
73
+ {
74
+ name: this.$t("Large emission version"),
75
+ value: "emissionLarge",
76
+ condition: this.podcast && this.podcast.podcastId,
77
+ },
78
+ {
79
+ name: this.$t("Large suggestion version"),
80
+ value: "largeSuggestion",
81
+ condition: this.podcast && this.podcast.podcastId,
82
+ },
83
+ ];
62
84
  },
63
85
  customPlayersDisplay(): Array<CustomPlayer> {
64
86
  return this.customPlayers.filter((player: CustomPlayer) => {
@@ -75,8 +97,8 @@ export default defineComponent({
75
97
  },
76
98
  },
77
99
  async created() {
78
- if(this.isVideoPodcast){
79
- this.$emit("update:iFrameModel","video");
100
+ if (this.isVideoPodcast) {
101
+ this.$emit("update:iFrameModel", "video");
80
102
  }
81
103
  await this.initCustomPlayers();
82
104
  },
@@ -108,7 +130,7 @@ export default defineComponent({
108
130
  }
109
131
  this.customPlayers = this.customPlayers.concat(playersContent);
110
132
  if (
111
- 'video'!==this.iFrameModel &&
133
+ "video" !== this.iFrameModel &&
112
134
  trySelect &&
113
135
  this.customPlayers[0] &&
114
136
  this.customPlayers[0].selected
@@ -82,7 +82,7 @@ export default defineComponent({
82
82
  return this.range ? dayString + " - " + dayString : dayString;
83
83
  },
84
84
  now(): Date {
85
- if(this.dateLimit){
85
+ if (this.dateLimit) {
86
86
  return this.dateLimit;
87
87
  }
88
88
  return dayjs().toDate();
@@ -93,9 +93,9 @@ import { Participant } from "@/stores/class/general/participant";
93
93
  import { Podcast } from "@/stores/class/general/podcast";
94
94
  import { state } from "../../../stores/ParamSdkStore";
95
95
  import { defineComponent } from "vue";
96
+ import { useSaveFetchStore } from "@/stores/SaveFetchStore";
96
97
  import { useAuthStore } from "@/stores/AuthStore";
97
- import { mapState } from "pinia";
98
- import octopusApi from "@saooti/octopus-api";
98
+ import { mapState, mapActions } from "pinia";
99
99
  import { Emission } from "@/stores/class/general/emission";
100
100
  import { Playlist } from "@/stores/class/general/playlist";
101
101
  export default defineComponent({
@@ -290,6 +290,7 @@ export default defineComponent({
290
290
  this.initData();
291
291
  },
292
292
  methods: {
293
+ ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
293
294
  closePopup(): void {
294
295
  this.$emit("close");
295
296
  },
@@ -309,19 +310,11 @@ export default defineComponent({
309
310
  );
310
311
  },
311
312
  async initData(): Promise<void> {
312
- let attributes;
313
- if (
314
- "" !== this.authOrganisation.id &&
315
- this.authOrganisation.attributes &&
316
- Object.keys(this.authOrganisation.attributes).length > 1
317
- ) {
318
- attributes = this.authOrganisation.attributes;
319
- } else {
320
- attributes = await octopusApi.fetchData<{ [key: string]: string }>(
321
- 0,
322
- "organisation/attributes/" + state.generalParameters.organisationId,
323
- );
324
- }
313
+ const orgaId =
314
+ "" !== this.authOrganisation.id
315
+ ? this.authOrganisation.id
316
+ : state.generalParameters.organisationId;
317
+ const attributes = await this.getOrgaAttributes(orgaId ?? "");
325
318
  if (Object.prototype.hasOwnProperty.call(attributes, "podcastmakerUrl")) {
326
319
  this.shareUrl =
327
320
  attributes.podcastmakerUrl +
@@ -83,7 +83,7 @@ export default defineComponent({
83
83
  this.handleResize(0);
84
84
  },
85
85
  methods: {
86
- displayEverythingAfterIndex(indexAsked: number){
86
+ displayEverythingAfterIndex(indexAsked: number) {
87
87
  for (let index = 0; index < this.playerRadioHistory.length; index++) {
88
88
  const el = (this.$refs["history" + index] as Array<HTMLElement>)[0];
89
89
  if (!el) continue;
@@ -41,6 +41,7 @@
41
41
  <ShareButtons
42
42
  v-if="pageParameters.isShareButtons"
43
43
  :emission="emission"
44
+ :organisation-id="emission.orga.id"
44
45
  />
45
46
  <SubscribeButtons
46
47
  v-if="pageParameters.isShareButtons && countLink >= 1"
@@ -36,6 +36,7 @@
36
36
  <ShareButtons
37
37
  v-if="pageParameters.isShareButtons"
38
38
  :playlist="playlist"
39
+ :organisation-id="playlist.organisation.id"
39
40
  />
40
41
  <PodcastList :playlist="playlist" />
41
42
  </div>
@@ -24,7 +24,11 @@
24
24
  :organisation-id="myOrganisationId"
25
25
  :is-education="isEducation"
26
26
  />
27
- <ShareButtons v-if="pageParameters.isShareButtons" :podcast="podcast" />
27
+ <ShareButtons
28
+ v-if="pageParameters.isShareButtons"
29
+ :podcast="podcast"
30
+ :organisation-id="podcast.organisation.id"
31
+ />
28
32
  <SubscribeButtons
29
33
  v-if="pageParameters.isShareButtons && countLink >= 1"
30
34
  :emission="podcast.emission"
@@ -25,7 +25,7 @@
25
25
  :canal="radio"
26
26
  :organisation-id="myOrganisationId"
27
27
  />
28
- <ShareButtons />
28
+ <ShareButtons :organisation-id="radio.organisationId" />
29
29
  </div>
30
30
  </template>
31
31
  <ClassicLoading
@@ -0,0 +1,27 @@
1
+
2
+ import { defineStore } from 'pinia';
3
+ import octopusApi from '@saooti/octopus-api';
4
+ import { useAuthStore } from '@/stores/AuthStore';
5
+
6
+ interface SaveFetchState{
7
+ orgaPublicAttributes: {[key:string]: {[key: string]:string|number|boolean|undefined}},
8
+ }
9
+ export const useSaveFetchStore = defineStore('SaveFetchStore', {
10
+ state: (): SaveFetchState => ({
11
+ orgaPublicAttributes:{}
12
+ }),
13
+ actions:{
14
+ async getOrgaAttributes(orgaId: string): Promise<{ [key: string]: string | number | boolean | undefined; }>{
15
+ if(this.orgaPublicAttributes[orgaId]){
16
+ return this.orgaPublicAttributes[orgaId];
17
+ }
18
+ const authStore = useAuthStore();
19
+ if(orgaId === authStore.authOrganisation.id && authStore.authOrganisation.attributes && Object.keys(authStore.authOrganisation.attributes).length > 1){
20
+ this.orgaPublicAttributes[orgaId] = authStore.authOrganisation.attributes;
21
+ }else{
22
+ this.orgaPublicAttributes[orgaId] = await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+orgaId);
23
+ }
24
+ return this.orgaPublicAttributes[orgaId];
25
+ }
26
+ }
27
+ })