@saooti/octopus-sdk 31.0.43 → 31.0.46

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 (47) hide show
  1. package/README.md +3 -0
  2. package/package.json +2 -2
  3. package/src/api/classicCrud.ts +29 -0
  4. package/src/components/display/categories/CategoryList.vue +2 -2
  5. package/src/components/display/comments/CommentInput.vue +3 -3
  6. package/src/components/display/comments/CommentList.vue +3 -2
  7. package/src/components/display/comments/CommentParentInfo.vue +1 -1
  8. package/src/components/display/emission/EmissionChooser.vue +2 -1
  9. package/src/components/display/emission/EmissionInlineList.vue +5 -3
  10. package/src/components/display/emission/EmissionItem.vue +3 -2
  11. package/src/components/display/emission/EmissionList.vue +3 -2
  12. package/src/components/display/emission/EmissionPlayerItem.vue +2 -2
  13. package/src/components/display/filter/RubriqueFilter.vue +1 -1
  14. package/src/components/display/live/LiveHorizontalList.vue +3 -3
  15. package/src/components/display/live/LiveItem.vue +3 -8
  16. package/src/components/display/live/LiveList.vue +7 -11
  17. package/src/components/display/organisation/OrganisationChooser.vue +3 -3
  18. package/src/components/display/organisation/OrganisationChooserLight.vue +1 -1
  19. package/src/components/display/participant/ParticipantItem.vue +3 -2
  20. package/src/components/display/participant/ParticipantList.vue +2 -2
  21. package/src/components/display/playlist/PlaylistList.vue +1 -1
  22. package/src/components/display/playlist/PodcastList.vue +1 -3
  23. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +4 -6
  24. package/src/components/display/podcasts/PodcastInlineListClassic.vue +3 -3
  25. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +1 -1
  26. package/src/components/display/podcasts/PodcastList.vue +1 -1
  27. package/src/components/display/podcasts/PodcastSwiperList.vue +2 -2
  28. package/src/components/display/sharing/QrCode.vue +1 -3
  29. package/src/components/display/sharing/ShareButtonsIntern.vue +1 -1
  30. package/src/components/display/sharing/ShareDistribution.vue +3 -2
  31. package/src/components/display/sharing/SharePlayer.vue +1 -1
  32. package/src/components/display/sharing/SharePlayerTypes.vue +3 -2
  33. package/src/components/misc/Footer.vue +1 -1
  34. package/src/components/mixins/init.ts +1 -1
  35. package/src/components/mixins/organisationFilter.ts +5 -4
  36. package/src/components/mixins/player/playerComment.ts +2 -1
  37. package/src/components/mixins/player/playerLive.ts +9 -15
  38. package/src/components/mixins/player/playerLogic.ts +2 -5
  39. package/src/components/pages/Emission.vue +1 -1
  40. package/src/components/pages/Participant.vue +1 -1
  41. package/src/components/pages/Playlist.vue +1 -1
  42. package/src/components/pages/Podcast.vue +4 -4
  43. package/src/components/pages/Rubrique.vue +2 -1
  44. package/src/store/class/general/fetchParam.ts +3 -33
  45. package/src/store/class/general/interfacePageable.ts +16 -0
  46. package/src/api/comments.ts +0 -12
  47. package/src/api/studio.ts +0 -13
package/README.md CHANGED
@@ -634,3 +634,6 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
634
634
  * 31.0.41 #11220
635
635
  * 31.0.42 #11222
636
636
  * 31.0.43 #10963
637
+ * 31.0.44 Début CRUD API
638
+ * 31.0.45 Live
639
+ * 31.0.46 Pb css
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "31.0.43",
3
+ "version": "31.0.46",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "main": "./dist/octopus.common.js",
16
16
  "dependencies": {
17
- "@saooti/octopus-api": "^0.31.5",
17
+ "@saooti/octopus-api": "^0.31.7",
18
18
  "@vue/cli": "^5.0.4",
19
19
  "@vue/compat": "^3.2.31",
20
20
  "axios": "^0.24.0",
@@ -0,0 +1,29 @@
1
+ import { StoreState } from "@/store/typeAppStore";
2
+ import axios from "axios";
3
+ enum ModuleApi {
4
+ DEFAULT = 0,
5
+ MEDIA = 1,
6
+ COMMENT = 2,
7
+ KEYCLOAK = 3,
8
+ FRONTOFFICE = 4,
9
+ FTP = 5,
10
+ PLAYER = 6,
11
+ RSS=7,
12
+ STORAGE = 8,
13
+ STUDIO = 9,
14
+ }
15
+ /* eslint-disable */
16
+ export default {
17
+ async postData<Type>(state: StoreState,moduleName: ModuleApi,wsPath:string, elementToCreate: unknown): Promise<Type>{
18
+ console.log(state,moduleName,wsPath);
19
+ const response = await axios.post('/mock', elementToCreate, {
20
+ headers: {'Content-Type': 'application/json; charset=utf-8' },
21
+ });
22
+ return response.data;
23
+ },
24
+ async deleteData(state: StoreState,moduleName: ModuleApi,wsPath:string): Promise<void>{
25
+ console.log(state,moduleName,wsPath);
26
+ await axios.delete('/mock');
27
+ },
28
+ };
29
+ /* eslint-enable */
@@ -162,9 +162,9 @@ export default defineComponent({
162
162
  }
163
163
  },
164
164
  async fetchCategories(organisationId: string): Promise<void> {
165
- const data = await octopusApi.fetchCategories({
165
+ const data = await octopusApi.fetchDataWithParams<Array<Category>>(0, `iab/list/${organisationId}`,{
166
166
  lang: this.$i18n.locale,
167
- }, organisationId);
167
+ });
168
168
  this.$store.commit('categoriesOrgaSet', data);
169
169
  },
170
170
  },
@@ -90,7 +90,7 @@
90
90
 
91
91
  <script lang="ts">
92
92
  import octopusApi from '@saooti/octopus-api';
93
- import commentApi from '@/api/comments';
93
+ import crudApi from '@/api/classicCrud';
94
94
  import { cookies } from '../../mixins/functions';
95
95
  import { state } from '../../../store/paramStore';
96
96
  import { Podcast } from '@/store/class/general/podcast';
@@ -290,9 +290,9 @@ export default defineComponent({
290
290
  let data;
291
291
  if (this.isCertified) {
292
292
  comment.status = 'Valid';
293
- data = await commentApi.postComment(this.$store.state, comment);
293
+ data = await crudApi.postData<CommentPodcast>(this.$store.state,2, 'registeredComment/' + comment.userId, {...comment, ...{userId: undefined}});
294
294
  } else {
295
- data = await octopusApi.postComment(comment);
295
+ data = await octopusApi.postDataPublic<CommentPodcast>(2,'unregisteredComment',comment);
296
296
  }
297
297
  this.$emit('newComment', data);
298
298
  this.newComment = '';
@@ -41,6 +41,7 @@ import moment from 'moment';
41
41
  import { Podcast } from '@/store/class/general/podcast';
42
42
  import { Conference } from '@/store/class/conference/conference';
43
43
  import { CommentPodcast } from '@/store/class/general/comment';
44
+ import { InterfacePageable } from '@/store/class/general/interfacePageable';
44
45
  import { defineComponent, defineAsyncComponent } from 'vue';
45
46
  import { FetchParam } from '@/store/class/general/fetchParam';
46
47
  /* eslint-disable */
@@ -126,7 +127,7 @@ export default defineComponent({
126
127
  let data;
127
128
  try {
128
129
  if (this.comId) {
129
- data = await octopusApi.fetchCommentAnswers(this.comId, {first: this.first,size: this.size});
130
+ data = await octopusApi.postDataPublic<InterfacePageable<CommentPodcast>>(2, this.comId.toString(), {first: this.first,size: this.size});
130
131
  }else{
131
132
  const param: FetchParam = {
132
133
  first: this.first,
@@ -135,7 +136,7 @@ export default defineComponent({
135
136
  status:this.editRight && this.status?[this.status]: this.editRight? ['Valid','Pending', 'Invalid']:['Valid'],
136
137
  organisationId: undefined === this.podcastId? this.organisation: undefined,
137
138
  };
138
- data = this.isFlat ? await octopusApi.fetchComments(param) : await octopusApi.fetchRootComments(param);
139
+ data = await octopusApi.postDataPublic<InterfacePageable<CommentPodcast>>(2, this.isFlat ?'':'getRootCom',param);
139
140
  }
140
141
  if(reset){
141
142
  this.comments.length = 0;
@@ -38,7 +38,7 @@ export default defineComponent({
38
38
  },
39
39
  async created() {
40
40
  if(this.comId){
41
- this.comment = await octopusApi.fetchComment(this.comId);
41
+ this.comment = await octopusApi.fetchData<CommentPodcast>(2, `comment/${this.comId}`);
42
42
  }
43
43
  this.loading = false;
44
44
  },
@@ -178,7 +178,8 @@ export default defineComponent({
178
178
  organisationId: this.organisationId,
179
179
  };
180
180
  }
181
- const response = await octopusApi.fetchEmissions(standardParam);
181
+
182
+ const response = await octopusApi.fetchDataWithParams<{count: number;result:Array<Emission>;sort: string;}>(0, 'emission/search',standardParam, true);
182
183
  if (this.defaultanswer) {
183
184
  const emissionDefault = getDefaultEmission(this.defaultanswer);
184
185
  if(emissionDefault){
@@ -72,6 +72,7 @@ import { Emission } from '@/store/class/general/emission';
72
72
  import { Rubrique } from '@/store/class/rubrique/rubrique';
73
73
  import { defineComponent } from 'vue'
74
74
  import { AxiosError } from 'axios';
75
+ import { Rubriquage } from '@/store/class/rubrique/rubriquage';
75
76
  export default defineComponent({
76
77
  name: 'EmissionInlineList',
77
78
 
@@ -157,14 +158,15 @@ export default defineComponent({
157
158
  methods: {
158
159
  async fetchNext(): Promise<void> {
159
160
  try {
160
- const data = await octopusApi.fetchEmissions({
161
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Emission>;sort: string;}>(0, 'emission/search',{
161
162
  first: this.first,
162
163
  size: this.size + 1,
163
164
  organisationId: this.organisationId,
164
165
  rubriqueId: this.rubriqueId ? [this.rubriqueId] : [],
165
166
  rubriquageId: this.rubriquageId ? [this.rubriquageId] : [],
166
167
  sort: 'LAST_PODCAST_DESC',
167
- });
168
+ }, true);
169
+
168
170
  this.loading = false;
169
171
  this.loaded = true;
170
172
  this.totalCount = data.count;
@@ -225,7 +227,7 @@ export default defineComponent({
225
227
  img.src = url;
226
228
  },
227
229
  async fetchRubriques(): Promise<void> {
228
- const data = await octopusApi.fetchTopic(this.displayRubriquage);
230
+ const data = await octopusApi.fetchData<Rubriquage>(0, 'rubriquage/'+this.displayRubriquage);
229
231
  this.rubriques = data.rubriques;
230
232
  },
231
233
  rubriquesId(emission: Emission): string|undefined {
@@ -63,6 +63,7 @@ import { state } from '../../../store/paramStore';
63
63
  import octopusApi from '@saooti/octopus-api';
64
64
  import { displayMethods } from '../../mixins/functions';
65
65
  import { defineComponent } from 'vue'
66
+ import { Podcast } from '@/store/class/general/podcast';
66
67
  export default defineComponent({
67
68
  name: 'EmissionItem',
68
69
 
@@ -114,11 +115,11 @@ export default defineComponent({
114
115
  },
115
116
  methods: {
116
117
  async hasPodcast(): Promise<void> {
117
- const data = await octopusApi.fetchPodcasts({
118
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',{
118
119
  emissionId: this.emission.emissionId,
119
120
  first: 0,
120
121
  size: 0,
121
- });
122
+ }, true);
122
123
  if (0 === data.count) {
123
124
  this.activeEmission = false;
124
125
  }
@@ -59,6 +59,7 @@ import { defineComponent, defineAsyncComponent } from 'vue';
59
59
  import { FetchParam } from '@/store/class/general/fetchParam';
60
60
  import { AxiosError } from 'axios';
61
61
  import { emptyEmissionData } from '@/store/typeAppStore';
62
+ import { Rubriquage } from '@/store/class/rubrique/rubriquage';
62
63
  const EmissionItem = defineAsyncComponent(() => import('./EmissionItem.vue'));
63
64
  const EmissionPlayerItem = defineAsyncComponent(() => import('./EmissionPlayerItem.vue'));
64
65
  export default defineComponent({
@@ -183,7 +184,7 @@ export default defineComponent({
183
184
  includeHidden:this.includeHidden,
184
185
  };
185
186
  try {
186
- const data = await octopusApi.fetchEmissions(param);
187
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Emission>;sort: string;}>(0, 'emission/search',param, true);
187
188
  this.afterFetching(reset, data);
188
189
  } catch (error) {
189
190
  this.handle403((error as AxiosError));
@@ -210,7 +211,7 @@ export default defineComponent({
210
211
  this.loading = false;
211
212
  },
212
213
  async fetchRubriques(): Promise<void> {
213
- const data = await octopusApi.fetchTopic(this.displayRubriquage);
214
+ const data = await octopusApi.fetchData<Rubriquage>(0, 'rubriquage/'+this.displayRubriquage);
214
215
  this.rubriques = data.rubriques;
215
216
  },
216
217
  mainRubriquage(emission: Emission): string {
@@ -207,10 +207,10 @@ export default defineComponent({
207
207
  methods: {
208
208
  async loadPodcasts(): Promise<void> {
209
209
  const nb = this.nbPodcasts ? this.nbPodcasts : 2;
210
- const data = await octopusApi.fetchPodcasts({
210
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',{
211
211
  emissionId: this.emission.emissionId,
212
212
  size: nb,
213
- });
213
+ }, true);
214
214
  if (0 === data.count) {
215
215
  this.activeEmission = false;
216
216
  }
@@ -209,7 +209,7 @@ export default defineComponent({
209
209
  this.arrayFilter.length = 0;
210
210
  }
211
211
  if (!this.organisation) return;
212
- const data = await octopusApi.fetchTopics(this.organisation, undefined);
212
+ const data = await octopusApi.fetchDataWithParams<Array<Rubriquage>>(0, 'rubriquage/find/'+this.organisation,{}, true);
213
213
  this.rubriquageData = data.filter((element: Rubriquage)=>{
214
214
  return element.rubriques.length;
215
215
  });
@@ -99,13 +99,13 @@ export default defineComponent({
99
99
  if (reset) {
100
100
  this.notEmpty = false;
101
101
  }
102
- const param = {
102
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',{
103
103
  first: this.dfirst,
104
104
  size: this.dsize,
105
105
  emissionId: this.emissionId,
106
106
  sort: 'DATE',
107
- };
108
- const data = await octopusApi.fetchLives(param);
107
+ includeStatus:'READY_TO_RECORD'
108
+ }, true);
109
109
  this.afterFetching(reset, data);
110
110
  },
111
111
  afterFetching(reset: boolean, data: {count: number, result: Array<Podcast>, sort: string}): void {
@@ -126,7 +126,7 @@
126
126
  import { state } from '../../../store/paramStore';
127
127
  import octopusApi from '@saooti/octopus-api';
128
128
  import PodcastImage from '../podcasts/PodcastImage.vue';
129
- import studioApi from '@/api/studio';
129
+ import crudApi from '@/api/classicCrud';
130
130
  import moment from 'moment';
131
131
  // @ts-ignore
132
132
  import humanizeDuration from 'humanize-duration';
@@ -233,16 +233,11 @@ export default defineComponent({
233
233
  async fetchPodcastData(): Promise<void> {
234
234
  if (!this.fetchConference || !this.fetchConference.podcastId) return;
235
235
  try {
236
- this.live = await octopusApi.fetchPodcast(
237
- this.fetchConference.podcastId.toString()
238
- );
236
+ this.live = await octopusApi.fetchData<Podcast>(0, 'podcast/'+this.fetchConference.podcastId);
239
237
  } catch {
240
238
  this.$emit('deleteItem', this.index);
241
239
  if(this.fetchConference.conferenceId){
242
- studioApi.deleteConference(
243
- this.$store.state,
244
- this.fetchConference.conferenceId.toString()
245
- );
240
+ await crudApi.deleteData(this.$store.state, 9 ,'conference/'+this.fetchConference.conferenceId);
246
241
  }
247
242
  }
248
243
  },
@@ -110,9 +110,7 @@ export default defineComponent({
110
110
  watch: {
111
111
  async organisationId(): Promise<void> {
112
112
  if(!this.organisationId){return;}
113
- const isLive = await octopusApi.liveEnabledOrganisation(
114
- this.organisationId
115
- );
113
+ const isLive = await octopusApi.fetchData<boolean>(0, 'organisation/liveEnabled/'+this.organisationId);
116
114
  if (isLive) {
117
115
  if(!this.loading){
118
116
  this.fetchContent();
@@ -140,9 +138,7 @@ export default defineComponent({
140
138
  if(!this.filterOrgaUsed){
141
139
  return;
142
140
  }
143
- const isLive = await octopusApi.liveEnabledOrganisation(
144
- this.filterOrgaUsed
145
- );
141
+ const isLive = await octopusApi.fetchData<boolean>(0, 'organisation/liveEnabled/'+this.filterOrgaUsed);
146
142
  if (isLive) {
147
143
  this.fetchContent();
148
144
  } else {
@@ -173,11 +169,11 @@ export default defineComponent({
173
169
  ("DEBRIEFING"===this.livesArray[i].status ||"ERROR"===this.livesArray[i].status ||"PUBLISHING"===this.livesArray[i].status)) {
174
170
  continue;
175
171
  }
176
- const dataLives = await octopusApi.listConferences(
177
- this.filterOrgaUsed,
178
- true,
179
- this.livesArray[i].status
180
- );
172
+ const dataLives = await octopusApi.fetchDataWithParams<Array<Conference>>(9, 'conference/list',{
173
+ organisationId: this.filterOrgaUsed,
174
+ withPodcastId: true,
175
+ status: this.livesArray[i].status,
176
+ });
181
177
  if("PLANNED"!==this.livesArray[i].status && "PENDING"!==this.livesArray[i].status){
182
178
  this.livesArray[i].lives = dataLives.filter((p: Conference | null) => {
183
179
  return null !== p;
@@ -189,7 +189,7 @@ export default defineComponent({
189
189
  this.authenticated &&
190
190
  undefined === this.$store.state.organisation.imageUrl
191
191
  ) {
192
- const data = await octopusApi.fetchOrganisation(this.myOrganisationId ?this.myOrganisationId:"");
192
+ const data = await octopusApi.fetchData<Organisation>(0,`organisation/${this.myOrganisationId ?this.myOrganisationId:""}`);
193
193
  this.myImage = data.imageUrl;
194
194
  }
195
195
  if (this.value) {
@@ -209,7 +209,7 @@ export default defineComponent({
209
209
  },
210
210
  async onSearchOrganisation(query?: string): Promise<void> {
211
211
  this.isLoading = true;
212
- const response = await octopusApi.fetchOrganisations({
212
+ const response = await octopusApi.fetchDataWithParams<{count: number;result: Array<Organisation>;sort: string;}>(0, 'organisation/search',{
213
213
  query: query,
214
214
  first: 0,
215
215
  size: ELEMENTS_COUNT,
@@ -249,7 +249,7 @@ export default defineComponent({
249
249
  this.onSearchOrganisation();
250
250
  }
251
251
  if(!this.value){return;}
252
- const data = await octopusApi.fetchOrganisation(this.value);
252
+ const data = await octopusApi.fetchData<Organisation>(0,`organisation/${this.value}`);
253
253
  this.organisation = data;
254
254
  this.init = true;
255
255
  },
@@ -73,7 +73,7 @@ export default defineComponent({
73
73
  },
74
74
  async fetchOrganisation(): Promise<void> {
75
75
  if(!this.value){return;}
76
- const data = await octopusApi.fetchOrganisation(this.value);
76
+ const data = await octopusApi.fetchData<Organisation>(0,`organisation/${this.value}`);
77
77
  this.organisation = data;
78
78
  this.actual = data.id;
79
79
  this.init = true;
@@ -58,6 +58,7 @@ import { state } from '../../../store/paramStore';
58
58
  import { displayMethods } from '../../mixins/functions';
59
59
  import { orgaComputed } from '../../mixins/orgaComputed';
60
60
  import { defineComponent } from 'vue'
61
+ import { Podcast } from '@/store/class/general/podcast';
61
62
  export default defineComponent({
62
63
  name: 'ParticpantItem',
63
64
  mixins: [displayMethods, orgaComputed],
@@ -107,11 +108,11 @@ export default defineComponent({
107
108
  },
108
109
  methods: {
109
110
  async hasPodcast(): Promise<void> {
110
- const data = await octopusApi.fetchPodcasts({
111
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',{
111
112
  participantId: this.participant.participantId,
112
113
  first: 0,
113
114
  size: 0,
114
- });
115
+ }, true);
115
116
  if (0 === data.count) {
116
117
  this.activeParticipant = false;
117
118
  }
@@ -108,12 +108,12 @@ export default defineComponent({
108
108
  async fetchContent(reset: boolean): Promise<void> {
109
109
  this.loading = true;
110
110
  try {
111
- const data = await octopusApi.fetchParticipants({
111
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Participant>;sort: string;}>(0, 'participant/search',{
112
112
  first: this.dfirst,
113
113
  size: this.dsize,
114
114
  query: this.query,
115
115
  organisationId: this.organisation,
116
- });
116
+ }, true);
117
117
  if (reset) {
118
118
  this.participants.length = 0;
119
119
  }
@@ -118,7 +118,7 @@ export default defineComponent({
118
118
  sort: this.sort,
119
119
  };
120
120
  try {
121
- const data = await octopusApi.fetchPlaylists(param);
121
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Playlist>;sort: string;}>(0, 'playlist/search',param, true);
122
122
  this.afterFetching(reset, data);
123
123
  } catch (error) {
124
124
  this.handle403((error as AxiosError));
@@ -126,9 +126,7 @@ export default defineComponent({
126
126
  this.podcasts.length = 0;
127
127
  this.loading = true;
128
128
  try {
129
- const content = await octopusApi.fetchPlaylistContent(
130
- this.playlist.playlistId.toString()
131
- );
129
+ const content = await octopusApi.fetchData<Array<Podcast>>(0, 'playlist/'+this.playlist.playlistId+'/content');
132
130
  for (let index = 0, len = content.length; index < len; index++) {
133
131
  content[index].order = this.playlist.podcasts[content[index].podcastId];
134
132
  }
@@ -69,8 +69,8 @@ import ClassicLoading from '../../form/ClassicLoading.vue';
69
69
  const PHONE_WIDTH = 960;
70
70
  import { state } from '../../../store/paramStore';
71
71
  import { Podcast } from '@/store/class/general/podcast';
72
+ import { Playlist } from '@/store/class/general/playlist';
72
73
  import { defineComponent } from 'vue'
73
- import { Playlist } from '@saooti/octopus-api/class/playlist';
74
74
  export default defineComponent({
75
75
  name: 'PodcastPlaylistInlineList',
76
76
 
@@ -148,11 +148,9 @@ export default defineComponent({
148
148
  async fetchContent(): Promise<void> {
149
149
  this.allPodcasts.length = 0;
150
150
  this.loading = true;
151
- this.playlist = await octopusApi.fetchPlaylist(this.playlistId ? this.playlistId.toString(): "");
152
- this.allPodcasts = await octopusApi.fetchPlaylistContent(
153
- this.playlist.playlistId.toString()
154
- );
155
- if (!((state.generalParameters.authenticated && state.generalParameters.organisationId === this.playlist.organisation.id) ||
151
+ this.playlist = await octopusApi.fetchData<Playlist>(0, 'playlist/'+this.playlistId);
152
+ this.allPodcasts = await octopusApi.fetchData<Array<Podcast>>(0, 'playlist/'+this.playlistId+'/content');
153
+ if (!((state.generalParameters.authenticated && state.generalParameters.organisationId === this.playlist?.organisation?.id) ||
156
154
  state.generalParameters.isAdmin)) {
157
155
  this.allPodcasts = this.allPodcasts.filter((p: Podcast|null) => {
158
156
  return (
@@ -155,8 +155,8 @@ export default defineComponent({
155
155
  },
156
156
  methods: {
157
157
  async fetchNext(): Promise<void> {
158
- const data = await octopusApi.fetchPodcasts({
159
- first: this.first,
158
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',{
159
+ first: this.first,
160
160
  size: this.size + 1,
161
161
  organisationId: this.organisation,
162
162
  emissionId: this.emissionId,
@@ -166,7 +166,7 @@ export default defineComponent({
166
166
  noRubriquageId: this.noRubriquageId.length ? this.noRubriquageId : undefined,
167
167
  sort: this.popularSort ? 'POPULARITY' : 'DATE',
168
168
  query: this.query,
169
- });
169
+ }, true);
170
170
  this.loading = false;
171
171
  this.loaded = true;
172
172
  this.totalCount = data.count;
@@ -56,7 +56,7 @@
56
56
  <slot name="list-inline" />
57
57
  <router-link
58
58
  v-if="!isButtonNextTitle"
59
- class="btn btn-link align-self-center width-fit-content m-4"
59
+ class="btn btn-primary align-self-center width-fit-content m-4"
60
60
  :to="refTo"
61
61
  @click="handleSeeMoreButton"
62
62
  >
@@ -164,7 +164,7 @@ export default defineComponent({
164
164
  param.publisherId = this.$store.state.profile.userId;
165
165
  }
166
166
  try {
167
- const data = await octopusApi.fetchPodcasts(param);
167
+ const data =await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',param, true);
168
168
  this.afterFetching(reset, data);
169
169
  } catch (error) {
170
170
  this.handle403((error as AxiosError));
@@ -139,7 +139,7 @@ export default defineComponent({
139
139
  this.numberItem = Math.floor(width / sixteen);
140
140
  },
141
141
  async fetchNext(): Promise<void> {
142
- const data = await octopusApi.fetchPodcasts({
142
+ const data = await octopusApi.fetchDataWithParams<{count: number;result:Array<Podcast>;sort: string;}>(0, 'podcast/search',{
143
143
  first: 0,
144
144
  size: 10,
145
145
  organisationId: this.organisation,
@@ -150,7 +150,7 @@ export default defineComponent({
150
150
  noRubriquageId: this.noRubriquageId.length ? this.noRubriquageId : undefined,
151
151
  sort: this.popularSort ? 'POPULARITY' : 'DATE',
152
152
  query: this.query,
153
- });
153
+ }, true);
154
154
  this.allPodcasts = this.allPodcasts.concat(
155
155
  data.result.filter((pod: Podcast|null) => null !== pod)
156
156
  );
@@ -85,9 +85,7 @@ export default defineComponent({
85
85
  if(this.$store.state.organisation && this.$store.state.organisation.attributes && Object.keys(this.$store.state.organisation.attributes).length > 1){
86
86
  data = this.$store.state.organisation.attributes;
87
87
  }else{
88
- data= await octopusApi.fetchOrganisationAttributes(
89
- state.generalParameters.organisationId ? state.generalParameters.organisationId : ""
90
- );
88
+ data= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+state.generalParameters.organisationId);
91
89
  }
92
90
  if (Object.prototype.hasOwnProperty.call(data,'COLOR')) {
93
91
  this.otherColor = data.COLOR;
@@ -187,7 +187,7 @@ export default defineComponent({
187
187
  },
188
188
  async created(){
189
189
  if(this.organisationId){
190
- this.displayRss = await octopusApi.fetchDataPublic<boolean>(`rss/participants/allowed/${this.organisationId}`);
190
+ this.displayRss = await octopusApi.fetchDataPublic<boolean>(0,`rss/participants/allowed/${this.organisationId}`);
191
191
  }else{
192
192
  this.displayRss = true;
193
193
  }
@@ -124,6 +124,7 @@
124
124
  </template>
125
125
 
126
126
  <script lang="ts">
127
+ import { state } from '../../../store/paramStore';
127
128
  import octopusApi from '@saooti/octopus-api';
128
129
  import Snackbar from '../../misc/Snackbar.vue';
129
130
  import { displayMethods } from '../../mixins/functions';
@@ -156,11 +157,11 @@ export default defineComponent({
156
157
 
157
158
  methods: {
158
159
  async getEmissionDetails(): Promise<void> {
159
- this.emission = await octopusApi.fetchEmission(this.emissionId);
160
+ this.emission = await octopusApi.fetchData<Emission>(0,'emission/'+this.emissionId);
160
161
  },
161
162
  getRSS(): void {
162
163
  if (!this.$props.emissionId || this.$props.emissionId <= 0) return;
163
- this.rss = octopusApi.fetchRSS(this.emissionId) + '.rss';
164
+ this.rss = `${state.octopusApi.url}rss/emission/${this.emissionId}.rss`;
164
165
  },
165
166
  afterCopy(): void{
166
167
  (this.$refs.snackbar as InstanceType<typeof SnackbarVue>).open(this.$t('Link in clipboard'));
@@ -271,7 +271,7 @@ export default defineComponent({
271
271
  if(this.$store.state.organisation && this.$store.state.organisation.attributes && Object.keys(this.$store.state.organisation.attributes).length > 1){
272
272
  data = this.$store.state.organisation.attributes;
273
273
  }else{
274
- data= await octopusApi.fetchOrganisationAttributes(this.myOrganisationId||'');
274
+ data= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+this.myOrganisationId);
275
275
  }
276
276
  this.color = Object.prototype.hasOwnProperty.call(data,'COLOR') ? data.COLOR : '#40a372';
277
277
  this.theme = Object.prototype.hasOwnProperty.call(data,'THEME') ? data.THEME : '#000000';
@@ -40,6 +40,7 @@ import { CustomPlayer } from '@/store/class/general/customPlayer';
40
40
  import { defineComponent } from 'vue';
41
41
  import { Emission } from '@/store/class/general/emission';
42
42
  import { Playlist } from '@/store/class/general/playlist';
43
+ import { InterfacePageable } from '@/store/class/general/interfacePageable';
43
44
  export default defineComponent({
44
45
  props: {
45
46
  podcast: { default: undefined, type: Object as ()=> Podcast},
@@ -77,12 +78,12 @@ export default defineComponent({
77
78
  },
78
79
  methods: {
79
80
  async fetchCustomPlayers(type:string, trySelect: boolean): Promise<boolean>{
80
- let players = await octopusApi.fetchCustomPlayer('customPlayer/type/'+ this.organisationId+'/'+type);
81
+ let players = await octopusApi.fetchDataPublic<InterfacePageable<CustomPlayer>>(6,'customPlayer/type/'+ this.organisationId+'/'+type);
81
82
  let playersContent = players.content;
82
83
  const totalCount = players.totalElements;
83
84
  let index = 1;
84
85
  while (totalCount > playersContent.length) {
85
- players = await octopusApi.fetchCustomPlayer('customPlayer/type/'+ this.organisationId+'/'+type+'?start='+index);
86
+ players = await octopusApi.fetchDataPublic<InterfacePageable<CustomPlayer>>(6,'customPlayer/type/'+ this.organisationId+'/'+type+'?start='+index);
86
87
  playersContent = playersContent.concat(players.content);
87
88
  ++index;
88
89
  }
@@ -169,7 +169,7 @@ export default defineComponent({
169
169
  this.setCookie('octopus-language', this.language);
170
170
  loadLocaleMessages(this.$i18n, this.language, this.$store.state.general.isEducation);
171
171
  moment.locale(this.$i18n.locale);
172
- octopusApi.fetchCategories({ lang: this.$i18n.locale }).then((data: Array<Category>) => {
172
+ octopusApi.fetchDataWithParams<Array<Category>>(0, `iab/list${state.octopusApi.organisationId? '/'+state.octopusApi.organisationId : ''}`, { lang: this.$i18n.locale }).then((data: Array<Category>) => {
173
173
  this.$store.commit('categoriesSet', data);
174
174
  if(this.$store.state.filter.iab){
175
175
  const category = this.$store.state.categories.filter((c: Category) => {
@@ -9,7 +9,7 @@ export const initSDK = defineComponent({
9
9
  methods: {
10
10
  async initSdk() {
11
11
  if (0 === (state.generalParameters.allCategories as Array<Category>).length) {
12
- octopusApi.fetchCategories({ lang: this.$i18n.locale }).then((data: Array<Category>) => {
12
+ octopusApi.fetchDataWithParams<Array<Category>>(0, `iab/list${state.octopusApi.organisationId? '/'+state.octopusApi.organisationId : ''}`, { lang: this.$i18n.locale }).then((data: Array<Category>) => {
13
13
  this.$store.commit('categoriesSet', data);
14
14
  });
15
15
  }else{
@@ -4,17 +4,18 @@ import { Rubriquage } from "@/store/class/rubrique/rubriquage";
4
4
  import octopusApi from '@saooti/octopus-api';
5
5
  import { defineComponent } from 'vue'
6
6
  import { AxiosError } from 'axios';
7
+ import { Organisation } from '@/store/class/general/organisation';
7
8
  export const orgaFilter = defineComponent({
8
9
  mixins: [handle403],
9
10
  methods: {
10
11
  async selectOrganisation(organisationId: string): Promise<void> {
11
12
  try {
12
- const response = await octopusApi.fetchOrganisation(organisationId);
13
- const data = await octopusApi.fetchTopics(organisationId, {
13
+ const response = await octopusApi.fetchData<Organisation>(0,`organisation/${organisationId}`);
14
+ const data = await octopusApi.fetchDataWithParams<Array<Rubriquage>>(0, 'rubriquage/find/'+organisationId,{
14
15
  sort:'HOMEPAGEORDER',
15
16
  homePageOrder: true
16
- });
17
- const isLive = await octopusApi.liveEnabledOrganisation(organisationId);
17
+ }, true);
18
+ const isLive = await octopusApi.fetchData<boolean>(0, 'organisation/liveEnabled/'+organisationId);
18
19
  this.$store.commit('filterOrga', {
19
20
  orgaId: organisationId,
20
21
  imgUrl: response.imageUrl,
@@ -6,6 +6,7 @@ import { CommentPodcast } from '@/store/class/general/comment';
6
6
  import { StoreState } from '@/store/typeAppStore';
7
7
  import { defineComponent } from 'vue';
8
8
  import { FetchParam } from '@/store/class/general/fetchParam';
9
+ import { InterfacePageable } from '@/store/class/general/interfacePageable';
9
10
  export const playerComment = defineComponent({
10
11
  data() {
11
12
  return {
@@ -85,7 +86,7 @@ export const playerComment = defineComponent({
85
86
  if (!this.editRight(organisation? organisation : '')) {
86
87
  param.status = ['Valid'];
87
88
  }
88
- const data = await octopusApi.fetchRootComments(param);
89
+ const data = await octopusApi.postDataPublic<InterfacePageable<CommentPodcast>>(2, 'getRootCom',param);
89
90
  first += size;
90
91
  count = data.totalElements;
91
92
  this.comments = this.comments.concat(data.content).filter((c: CommentPodcast) => {
@@ -56,27 +56,24 @@ export const playerLive = defineComponent({
56
56
  reject('Hls is not supported ! ');
57
57
  }
58
58
  let hls = new Hls();
59
- if(this.$store.state.authentication.isAuthenticated && this.$store.state.oAuthParam.accessToken){
59
+ /* if(this.$store.state.authentication.isAuthenticated && this.$store.state.oAuthParam.accessToken){
60
60
  hls = new Hls({xhrSetup:
61
61
  (xhr: XMLHttpRequest) => {
62
62
  xhr.setRequestHeader("Authorization", "Bearer " + this.$store.state.oAuthParam.accessToken);
63
63
  }
64
64
  }
65
65
  );
66
- }
66
+ } */
67
67
  hls.on(Hls.Events.MANIFEST_PARSED, async () => {
68
68
  if(!this.live){ return; }
69
69
  let downloadId = null;
70
70
  try {
71
- downloadId = await octopusApi.requestLiveDownloadId(
72
- this.live.livePodcastId
73
- );
74
- await octopusApi.markPlayingLive(
75
- this.live.livePodcastId,
76
- downloadId,
77
- 'octopus',
78
- this.$store.state.authentication.organisationId
79
- );
71
+ downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.live.livePodcastId, undefined);
72
+ await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' + this.live.livePodcastId+".m3u8",{
73
+ 'downloadId': null!==downloadId ? downloadId : undefined,
74
+ 'origin':'octopus',
75
+ 'distributorId':this.$store.state.authentication.organisationId
76
+ });
80
77
  this.setDownloadId(downloadId);
81
78
  } catch (error) {
82
79
  console.log('ERROR downloadId');
@@ -101,10 +98,7 @@ export const playerLive = defineComponent({
101
98
  async endListeningProgress(): Promise<void> {
102
99
  if (!this.downloadId) return;
103
100
  try {
104
- await octopusApi.updatePlayerTime(
105
- this.downloadId,
106
- Math.round(this.listenTime)
107
- );
101
+ await octopusApi.putDataPublic(0, 'podcast/listen/' + this.downloadId + '?seconds=' + Math.round(this.listenTime), undefined);
108
102
  } catch{
109
103
  //Do nothing
110
104
  }
@@ -51,7 +51,7 @@ export const playerLogic = defineComponent({
51
51
  this.audioUrlToPlay = this.audioUrl;
52
52
  }
53
53
  if(!this.podcast){return;}
54
- const response = await octopusApi.fetchPodcastDownloadUrl("podcast/download/register/"+ this.audioUrl);
54
+ const response = await octopusApi.fetchDataPublic<{location:string, downloadId: number}>(0,"podcast/download/register/"+ this.audioUrl);
55
55
  this.setDownloadId(response.downloadId.toString());
56
56
  this.audioUrlToPlay = response.location;
57
57
  },
@@ -74,10 +74,7 @@ export const playerLogic = defineComponent({
74
74
  return;
75
75
  }
76
76
  this.lastSend = newVal;
77
- await octopusApi.updatePlayerTime(
78
- this.downloadId,
79
- Math.round(newVal)
80
- );
77
+ await octopusApi.putDataPublic(0, 'podcast/listen/' + this.downloadId + '?seconds=' + Math.round(newVal), undefined);
81
78
  },
82
79
  playerSeekTime(){
83
80
  if(!this.playerSeekTime){return;}
@@ -214,7 +214,7 @@ export default defineComponent({
214
214
  this.loaded = false;
215
215
  this.error = false;
216
216
  try {
217
- const data: Emission = await octopusApi.fetchEmission(this.emissionId);
217
+ const data: Emission = await octopusApi.fetchData<Emission>(0,'emission/'+this.emissionId);
218
218
  this.emission = data;
219
219
  if("PUBLIC"!==this.emission.orga.privacy && this.filterOrga!==this.emission.orga.id){
220
220
  this.initError();
@@ -157,7 +157,7 @@ export default defineComponent({
157
157
  async getParticipantDetails(): Promise<void> {
158
158
  this.loaded = false;
159
159
  try {
160
- const data = await octopusApi.fetchParticipant(this.participantId ? this.participantId.toString(): "");
160
+ const data = await octopusApi.fetchData<Participant>(0, 'participant/'+this.participantId);
161
161
  if(data && data.orga && "PUBLIC"!==data.orga.privacy && this.filterOrga!==data.orga.id){
162
162
  this.initError();
163
163
  return;
@@ -130,7 +130,7 @@ export default defineComponent({
130
130
  try {
131
131
  this.loaded = false;
132
132
  this.error = false;
133
- const data: Playlist = await octopusApi.fetchPlaylist(this.playlistId ? this.playlistId.toString(): "");
133
+ const data: Playlist = await octopusApi.fetchData<Playlist>(0, 'playlist/'+this.playlistId);
134
134
  this.playlist = data;
135
135
  if("PUBLIC"!==this.playlist.organisation?.privacy && this.filterOrga!==this.playlist.organisation?.id){
136
136
  this.initError();
@@ -93,7 +93,7 @@ import PodcastInlineList from '../display/podcasts/PodcastInlineList.vue';
93
93
  import PodcastModuleBox from '../display/podcasts/PodcastModuleBox.vue';
94
94
  import ClassicLoading from '../form/ClassicLoading.vue';
95
95
  import octopusApi from '@saooti/octopus-api';
96
- import studioApi from '@/api/studio';
96
+ import crudApi from '@/api/classicCrud';
97
97
  import { state } from '../../store/paramStore';
98
98
  import moment from 'moment';
99
99
  import { Podcast } from '@/store/class/general/podcast';
@@ -269,10 +269,10 @@ export default defineComponent({
269
269
  async initConference(){
270
270
  if (!this.podcast || !this.isLiveReadyToRecord) return;
271
271
  if (this.isOctopusAndAnimator && undefined!==this.podcast.conferenceId) {
272
- const data = await studioApi.getConference(this.$store.state,this.podcast.conferenceId.toString());
272
+ const data = await crudApi.fetchData<Conference>(this.$store.state,9,'conference/'+this.podcast.conferenceId);
273
273
  this.fetchConference = data ? data : {conferenceId:-1, title:''};
274
274
  } else if(undefined!==this.podcast.conferenceId){
275
- const data = await octopusApi.getRealConferenceStatus(this.podcast.conferenceId.toString());
275
+ const data = await octopusApi.fetchData<string>(9, 'conference/realstatus/'+this.podcast.conferenceId);
276
276
  this.fetchConference = {
277
277
  status: data,
278
278
  conferenceId: this.podcast.conferenceId,
@@ -323,7 +323,7 @@ export default defineComponent({
323
323
  this.loaded = false;
324
324
  this.error = false;
325
325
  try {
326
- const data : Podcast = await octopusApi.fetchPodcast(this.podcastId.toString());
326
+ const data : Podcast = await octopusApi.fetchData<Podcast>(0, 'podcast/'+this.podcastId);
327
327
  if("PUBLIC"!==data.organisation.privacy && this.filterOrga!==data.organisation.id){
328
328
  this.initError();
329
329
  return;
@@ -13,6 +13,7 @@
13
13
  import octopusApi from '@saooti/octopus-api';
14
14
  import PodcastList from '../display/podcasts/PodcastList.vue';
15
15
  import { defineComponent } from 'vue'
16
+ import { Rubrique } from '@/store/class/rubrique/rubrique';
16
17
  export default defineComponent({
17
18
  name:"Rubrique",
18
19
  components: {
@@ -32,7 +33,7 @@ export default defineComponent({
32
33
  rubriqueId: {
33
34
  immediate: true,
34
35
  async handler() {
35
- const data = await octopusApi.fetchRubric(this.rubriqueId);
36
+ const data = await octopusApi.fetchData<Rubrique>(0, 'rubrique/'+this.rubriqueId);
36
37
  this.title = data.name;
37
38
  },
38
39
  },
@@ -1,33 +1,3 @@
1
- export interface FetchParam{
2
- first?: number,
3
- size?: number,
4
- organisationId?: string,
5
- emissionId?: number,
6
- podcastId?:number,
7
- iabId?: number,
8
- participantId?: number,
9
- query?: string,
10
- monetisable?: string,
11
- sort?: string,
12
- before?: string,
13
- after?: string,
14
- noRubriquageId?: Array<number>,
15
- rubriqueId?:Array<number>,
16
- rubriquageId?: Array<number>|number,
17
- status?:Array<string>,
18
- distributedBy?: string,
19
- includeHidden?:boolean,
20
- validity?:boolean,
21
- publisherId?: string,
22
- lang?:string,
23
- start?:string,
24
- end?:string,
25
- interval?: string,
26
- tzId?: string,
27
- role?: string,
28
- includeNotValid?: boolean,
29
- type?: string,
30
- listening?: string,
31
- top?: number,
32
- homePageOrder?:boolean,
33
- }
1
+ export interface FetchParam {
2
+ [key: string]: string | number | undefined | Array<number>| Array<string>| boolean;
3
+ }
@@ -0,0 +1,16 @@
1
+ import { Pageable } from "./pageable";
2
+ import { SortPageable } from "./sortPageable";
3
+
4
+ export interface InterfacePageable<T>{
5
+ content: Array<T>;
6
+ empty: boolean;
7
+ first: boolean;
8
+ last: boolean;
9
+ number: number;
10
+ numberOfElements: number;
11
+ pageable: Pageable;
12
+ size: number;
13
+ sort: SortPageable;
14
+ totalElements: number;
15
+ totalPages: number;
16
+ }
@@ -1,12 +0,0 @@
1
- import { CommentPodcast } from "@/store/class/general/comment";
2
- import { StoreState } from "@/store/typeAppStore";
3
-
4
- import octopusApi from '@saooti/octopus-api';
5
- /* eslint-disable */
6
- export default {
7
- postComment(store: StoreState, parameters: CommentPodcast): void {
8
- console.log(store);
9
- octopusApi.postComment(parameters);
10
- },
11
- };
12
- /* eslint-enable */
package/src/api/studio.ts DELETED
@@ -1,13 +0,0 @@
1
- import { StoreState } from "@/store/typeAppStore";
2
- /* eslint-disable */
3
- export default{
4
- deleteConference(store?: StoreState,fetchConference?: string): any{
5
- console.log(store, fetchConference);
6
- return;
7
- },
8
- getConference(store?: StoreState,fetchConference?: string): any{
9
- console.log(store, fetchConference);
10
- return {};
11
- },
12
- };
13
- /* eslint-enable */