@saooti/octopus-sdk 34.0.16 → 35.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "34.0.16",
3
+ "version": "35.0.1",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -20,19 +20,19 @@
20
20
  "@vue/cli": "^5.0.8",
21
21
  "@vue/compat": "^3.2.45",
22
22
  "autoprefixer": "^10.4.13",
23
- "axios": "^1.2.2",
23
+ "axios": "^1.3.0",
24
+ "dayjs": "^1.11.7",
24
25
  "express": "^4.18.2",
25
- "hls.js": "^1.2.9",
26
+ "hls.js": "^1.3.2",
26
27
  "humanize-duration": "^3.27.2",
27
- "jest": "^29.3.1",
28
+ "jest": "^29.4.1",
28
29
  "jquery": "^3.6.3",
29
- "moment": "^2.29.4",
30
30
  "qrcode.vue": "^3.3.3",
31
- "sass": "^1.57.1",
32
- "sonarqube-scanner": "^2.9.1",
33
- "swiper": "^8.4.5",
31
+ "sass": "^1.58.0",
32
+ "sonarqube-scanner": "^3.0.0",
33
+ "swiper": "^8.4.7",
34
34
  "v-calendar": "^3.0.0-alpha.8",
35
- "vite": "^3.2.5",
35
+ "vite": "^4.0.4",
36
36
  "vue": "^3.2.45",
37
37
  "vue-i18n": "^9.2.2",
38
38
  "vue-multiselect": "^3.0.0-alpha.2",
@@ -44,14 +44,14 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/jquery": "^3.5.16",
47
- "@typescript-eslint/eslint-plugin": "^5.48.0",
48
- "@typescript-eslint/parser": "^5.48.0",
49
- "@vitejs/plugin-vue": "^3.2.0",
47
+ "@typescript-eslint/eslint-plugin": "^5.50.0",
48
+ "@typescript-eslint/parser": "^5.50.0",
49
+ "@vitejs/plugin-vue": "^4.0.0",
50
50
  "@vue/compiler-sfc": "^3.2.45",
51
51
  "@vue/eslint-config-typescript": "^11.0.2",
52
- "eslint": "^8.31.0",
53
- "eslint-plugin-vue": "^7.17.0",
54
- "typescript": "^4.9.4"
52
+ "eslint": "^8.33.0",
53
+ "eslint-plugin-vue": "^9.9.0",
54
+ "typescript": "^4.9.5"
55
55
  },
56
56
  "eslintConfig": {
57
57
  "root": true,
@@ -50,7 +50,7 @@
50
50
  import selenium from '../../mixins/selenium';
51
51
  import displayMethods from '../../mixins/displayMethods';
52
52
  import { CommentPodcast } from '@/store/class/general/comment';
53
- import moment from 'moment';
53
+ import dayjs from 'dayjs';
54
54
  import Popover from '../../misc/Popover.vue';
55
55
  import { defineComponent } from 'vue';
56
56
  export default defineComponent({
@@ -78,7 +78,7 @@ export default defineComponent({
78
78
  return 'Valid'=== this.comment.status;
79
79
  },
80
80
  date(): string {
81
- return this.comment.date ? moment(this.comment.date).format('D MMMM YYYY HH[h]mm') : '';
81
+ return this.comment.date ? dayjs(this.comment.date).format('D MMMM YYYY HH[h]mm') : '';
82
82
  },
83
83
  readMore(): string {
84
84
  return this.summary ? this.$t('Read more') : this.$t('Read less');
@@ -37,7 +37,7 @@
37
37
  import ClassicLoading from '../../form/ClassicLoading.vue';
38
38
  import { state } from '../../../store/paramStore';
39
39
  import octopusApi from '@saooti/octopus-api';
40
- import moment from 'moment';
40
+ import dayjs from 'dayjs';
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';
@@ -184,7 +184,7 @@ export default defineComponent({
184
184
  let indexNewComment = 0;
185
185
  for (let i = 0, len = this.comments.length; i < len; i++) {
186
186
  if (
187
- moment(this.comments[i].date).isBefore(moment(comment.date))
187
+ dayjs(this.comments[i].date).isBefore(dayjs(comment.date))
188
188
  ) {
189
189
  indexNewComment = i;
190
190
  break;
@@ -28,7 +28,7 @@
28
28
  "
29
29
  :name="transitionName"
30
30
  class="element-list-inline"
31
- tag="ul"
31
+ tag="div"
32
32
  :class="[
33
33
  alignLeft ? 'justify-content-start' : '',
34
34
  overflowScroll ? 'overflowScroll' : '',
@@ -38,7 +38,7 @@
38
38
  </template>
39
39
 
40
40
  <script lang="ts">
41
- import moment from 'moment';
41
+ import dayjs from 'dayjs';
42
42
  import ClassicCheckbox from '../../form/ClassicCheckbox.vue';
43
43
  import ClassicDatePicker from '../../form/ClassicDatePicker.vue';
44
44
  import { defineComponent } from 'vue';
@@ -59,17 +59,17 @@ export default defineComponent({
59
59
  return {
60
60
  isFrom: false as boolean,
61
61
  isTo: false as boolean,
62
- fromDate: moment().subtract(10, 'days').toDate(),
63
- toDate: moment().toDate(),
62
+ fromDate: dayjs().subtract(10, 'days').toDate(),
63
+ toDate: dayjs().toDate(),
64
64
  };
65
65
  },
66
66
 
67
67
  watch: {
68
68
  isFrom(): void {
69
- this.$emit('updateFromDate', this.isFrom ? moment(this.fromDate).toISOString(true) : undefined);
69
+ this.$emit('updateFromDate', this.isFrom ? dayjs(this.fromDate).toISOString() : undefined);
70
70
  },
71
71
  isTo(): void {
72
- this.$emit('updateToDate', this.isTo ? moment(this.toDate).toISOString(true) : undefined);
72
+ this.$emit('updateToDate', this.isTo ? dayjs(this.toDate).toISOString() : undefined);
73
73
  },
74
74
  },
75
75
 
@@ -86,33 +86,33 @@ export default defineComponent({
86
86
  methods: {
87
87
  updateFromDate(): void {
88
88
  if (
89
- moment(this.fromDate)
89
+ dayjs(this.fromDate)
90
90
  .startOf('minute')
91
91
  .toISOString() ===
92
- moment()
92
+ dayjs()
93
93
  .subtract(10, 'days')
94
94
  .startOf('minute')
95
95
  .toISOString()
96
96
  )
97
97
  return;
98
98
  if (this.isFrom) {
99
- this.$emit('updateFromDate', moment(this.fromDate).toISOString(true));
99
+ this.$emit('updateFromDate', dayjs(this.fromDate).toISOString());
100
100
  } else {
101
101
  this.isFrom = true;
102
102
  }
103
103
  },
104
104
  updateToDate(): void {
105
105
  if (
106
- moment(this.toDate)
106
+ dayjs(this.toDate)
107
107
  .startOf('minute')
108
108
  .toISOString() ===
109
- moment()
109
+ dayjs()
110
110
  .startOf('minute')
111
111
  .toISOString()
112
112
  )
113
113
  return;
114
114
  if (this.isTo) {
115
- this.$emit('updateToDate', moment(this.toDate).toISOString(true));
115
+ this.$emit('updateToDate', dayjs(this.toDate).toISOString());
116
116
  } else {
117
117
  this.isTo = true;
118
118
  }
@@ -127,7 +127,7 @@ import { state } from '../../../store/paramStore';
127
127
  import octopusApi from '@saooti/octopus-api';
128
128
  import PodcastImage from '../podcasts/PodcastImage.vue';
129
129
  import crudApi from '@/api/classicCrud';
130
- import moment from 'moment';
130
+ import dayjs from 'dayjs';
131
131
  // @ts-ignore
132
132
  import humanizeDuration from 'humanize-duration';
133
133
  import displayMethods from '../../mixins/displayMethods';
@@ -164,13 +164,10 @@ export default defineComponent({
164
164
  return (state.generalParameters.podcastmaker as boolean);
165
165
  },
166
166
  hours(): string {
167
- return !this.live?'': moment(this.live.pubDate).format('HH[H]mm');
167
+ return !this.live?'': dayjs(this.live.pubDate).format('HH[H]mm');
168
168
  },
169
169
  date(): string {
170
- return !this.live? '': moment(this.live.pubDate).format('D/MM/YYYY');
171
- },
172
- displayDate(): string {
173
- return !this.live? '':moment(this.live.pubDate).format('X');
170
+ return !this.live? '': dayjs(this.live.pubDate).format('D/MM/YYYY');
174
171
  },
175
172
  description(): string {
176
173
  return this.live?.description??'';
@@ -39,7 +39,7 @@ import ClassicLoading from '../../form/ClassicLoading.vue';
39
39
  import LiveItem from './LiveItem.vue';
40
40
  import { handle403 } from '../../mixins/handle403';
41
41
  import octopusApi from '@saooti/octopus-api';
42
- import moment from 'moment';
42
+ import dayjs from 'dayjs';
43
43
  import { state } from '../../../store/paramStore';
44
44
  import { Conference } from '@/store/class/conference/conference';
45
45
  import { defineComponent } from 'vue'
@@ -91,7 +91,7 @@ export default defineComponent({
91
91
  if (this.livesArray[1].lives.length > 0)
92
92
  return this.$t('A live can start any moment');
93
93
  if (this.livesArray[2].lives.length > 0)
94
- return this.$t('Next live date', {date: moment(this.livesArray[2].lives[0].date).format('LLLL'),});
94
+ return this.$t('Next live date', {date: dayjs(this.livesArray[2].lives[0].date).format('LLLL'),});
95
95
  return '';
96
96
  },
97
97
  myOrganisationId(): string|undefined {
@@ -157,7 +157,7 @@ export default defineComponent({
157
157
  }else if("PENDING"===this.livesArray[i].status){
158
158
  this.dataLivesToBe = dataLives;
159
159
  for (let index = 0, len = dataLives.length; index < len; index++) {
160
- if (moment(dataLives[index].date).isBefore(moment())) {
160
+ if (dayjs(dataLives[index].date).isBefore(dayjs())) {
161
161
  this.livesArray[i].lives.push(dataLives[index]);
162
162
  indexPast = index + 1;
163
163
  } else {break;}
@@ -27,7 +27,7 @@
27
27
  <transition-group
28
28
  :name="transitionName"
29
29
  class="element-list-inline"
30
- tag="ul"
30
+ tag="div"
31
31
  :class="[
32
32
  alignLeft ? 'justify-content-start' : '',
33
33
  overflowScroll ? 'overflowScroll' : '',
@@ -27,7 +27,7 @@
27
27
  v-show="!loading"
28
28
  :name="transitionName"
29
29
  class="element-list-inline"
30
- tag="ul"
30
+ tag="div"
31
31
  :class="[
32
32
  alignLeft ? 'justify-content-start' : '',
33
33
  overflowScroll ? 'overflowScroll' : '',
@@ -53,7 +53,7 @@
53
53
  import PodcastItemInfo from './PodcastItemInfo.vue';
54
54
  import PodcastImage from './PodcastImage.vue';
55
55
  import { state } from '../../../store/paramStore';
56
- import moment from 'moment';
56
+ import dayjs from 'dayjs';
57
57
  import { Podcast } from '@/store/class/general/podcast';
58
58
  import { defineComponent } from 'vue'
59
59
  export default defineComponent({
@@ -88,7 +88,7 @@ export default defineComponent({
88
88
  return (state.podcastPage.podcastItemDescription as boolean);
89
89
  },
90
90
  displayDate(): string {
91
- return moment(this.podcast.pubDate).format('X');
91
+ return dayjs(this.podcast.pubDate).format();
92
92
  },
93
93
  description(): string {
94
94
  return this.podcast.description ?? '';
@@ -52,7 +52,7 @@
52
52
  import AnimatorsItem from './AnimatorsItem.vue';
53
53
  import { state } from '../../../store/paramStore';
54
54
  import { orgaComputed } from '../../mixins/orgaComputed';
55
- import moment from 'moment';
55
+ import dayjs from 'dayjs';
56
56
  // @ts-ignore
57
57
  import humanizeDuration from 'humanize-duration';
58
58
  import PodcastPlayBar from './PodcastPlayBar.vue';
@@ -83,7 +83,7 @@ export default defineComponent({
83
83
  return (state.generalParameters.podcastmaker as boolean);
84
84
  },
85
85
  date(): string {
86
- return moment(this.pubDate).format('D MMMM YYYY, HH[h]mm');
86
+ return dayjs(this.pubDate).format('D MMMM YYYY, HH[h]mm');
87
87
  },
88
88
  editRight(): boolean {
89
89
  return (true===this.authenticated && this.myOrganisationId === this.podcastOrganisationId) ||
@@ -135,7 +135,7 @@ import PodcastImage from './PodcastImage.vue';
135
135
  import ParticipantDescription from './ParticipantDescription.vue';
136
136
  import TagList from './TagList.vue';
137
137
  import { state } from '../../../store/paramStore';
138
- import moment from 'moment';
138
+ import dayjs from 'dayjs';
139
139
  // @ts-ignore
140
140
  import humanizeDuration from 'humanize-duration';
141
141
  import displayMethods from '../../mixins/displayMethods';
@@ -179,8 +179,8 @@ export default defineComponent({
179
179
  return (state.generalParameters.podcastmaker as boolean);
180
180
  },
181
181
  date(): string {
182
- if (this.podcast && 1970 !== moment(this.podcast.pubDate).year()){
183
- return moment(this.podcast.pubDate).format('D MMMM YYYY, HH[h]mm');
182
+ if (this.podcast && 1970 !== dayjs(this.podcast.pubDate).year()){
183
+ return dayjs(this.podcast.pubDate).format('D MMMM YYYY, HH[h]mm');
184
184
  }
185
185
  return '';
186
186
  },
@@ -28,7 +28,7 @@
28
28
  </template>
29
29
 
30
30
  <script lang="ts">
31
- import moment from 'moment';
31
+ import dayjs from 'dayjs';
32
32
  import { DatePicker } from 'v-calendar';
33
33
  import { defineComponent } from 'vue';
34
34
  export default defineComponent({
@@ -57,7 +57,7 @@ export default defineComponent({
57
57
  },
58
58
  computed: {
59
59
  now(): Date {
60
- return moment().toDate();
60
+ return dayjs().toDate();
61
61
  },
62
62
  }
63
63
  })
@@ -91,7 +91,7 @@
91
91
  import ClassicModal from '../modal/ClassicModal.vue';
92
92
  import ClassicCheckbox from '../../form/ClassicCheckbox.vue';
93
93
  import Snackbar from '../../misc/Snackbar.vue';
94
- import moment from 'moment';
94
+ import dayjs from 'dayjs';
95
95
  // @ts-ignore
96
96
  import VSwatches from 'vue3-swatches';
97
97
  // @ts-ignore
@@ -136,8 +136,8 @@ export default defineComponent({
136
136
 
137
137
  computed: {
138
138
  date(): string {
139
- if(!this.podcast || 1970 === moment(this.podcast.pubDate).year()){return '';}
140
- return moment(this.podcast.pubDate).format('D MMMM YYYY, HH[h]mm');
139
+ if(!this.podcast || 1970 === dayjs(this.podcast.pubDate).year()){return '';}
140
+ return dayjs(this.podcast.pubDate).format('D MMMM YYYY, HH[h]mm');
141
141
  },
142
142
  duration(): string {
143
143
  if (!this.podcast || this.podcast.duration <= 1) return '';
@@ -99,7 +99,7 @@ import ClassicLoading from '../form/ClassicLoading.vue';
99
99
  import octopusApi from '@saooti/octopus-api';
100
100
  import crudApi from '@/api/classicCrud';
101
101
  import { state } from '../../store/paramStore';
102
- import moment from 'moment';
102
+ import dayjs from 'dayjs';
103
103
  import { Podcast } from '@/store/class/general/podcast';
104
104
  import { Conference } from '@/store/class/conference/conference';
105
105
  import { handle403 } from '../mixins/handle403';
@@ -227,7 +227,7 @@ export default defineComponent({
227
227
  return this.isLiveReadyToRecord ?this.$t('Live episode'): this.$t('Episode');
228
228
  },
229
229
  timeRemaining(): string {
230
- return !this.podcast ? "":moment(this.podcast.pubDate).diff(moment(), 'seconds').toString();
230
+ return !this.podcast ? "":dayjs(this.podcast.pubDate).diff(dayjs(), 'seconds').toString();
231
231
  },
232
232
  },
233
233
  watch: {
package/src/i18n.ts CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  import { nextTick } from 'vue'
3
3
  import { createI18n } from 'vue-i18n';
4
- import moment from 'moment';
5
- import 'moment/dist/locale/de.js';
6
- import 'moment/dist/locale/es.js';
7
- import 'moment/dist/locale/fr.js';
8
- import 'moment/dist/locale/it.js';
9
- import 'moment/dist/locale/sl.js';
4
+ import dayjs from 'dayjs';
5
+ import 'dayjs/locale/de';
6
+ import 'dayjs/locale/es';
7
+ import 'dayjs/locale/fr';
8
+ import 'dayjs/locale/it';
9
+ import 'dayjs/locale/sl';
10
10
 
11
11
  export function setupI18n(options: { locale: string }, isEducation: boolean) {
12
12
  const i18n = createI18n(options)
@@ -16,7 +16,7 @@ export function setupI18n(options: { locale: string }, isEducation: boolean) {
16
16
 
17
17
  export function setI18nLanguage(i18n: any, locale: string) {
18
18
  i18n.locale = locale;
19
- moment.locale(locale);
19
+ dayjs.locale(locale);
20
20
  const html= document.querySelector('html');
21
21
  if(html){
22
22
  html.setAttribute('lang', locale);