jamespot-front-business 1.2.43 → 1.2.45

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/dist/cjs.js CHANGED
@@ -5,6 +5,25 @@ var redux = require('redux');
5
5
  var jamespot = require('jamespot-user-api');
6
6
  var uuid = require('uuid');
7
7
 
8
+ const getArticleRTHandlers = function (listener) {
9
+ const addArticleHandler = function (message) {
10
+ if (message.namespace === 'JAMESPOT' && message.function === 'article-create') {
11
+ listener(message.object);
12
+ }
13
+ };
14
+ return [
15
+ {
16
+ namespace: 'JAMESPOT',
17
+ function: 'article-create',
18
+ handler: addArticleHandler,
19
+ },
20
+ ];
21
+ };
22
+
23
+ const Article = {
24
+ getArticleRTHandlers,
25
+ };
26
+
8
27
  const isAbortError = (error) => {
9
28
  return !!error && typeof error === 'object' && 'aborted' in error && !!error.aborted;
10
29
  };
@@ -540,11 +559,12 @@ const initialState$o = {
540
559
  const fetchBookableAsset = toolkit.createAsyncThunk('BookableAsset/fetchBookableAsset', async (_, { extra }) => {
541
560
  const filterSpec = {
542
561
  type: 'bookableAsset',
543
- format: 'raw-list',
544
562
  limit: 50,
545
563
  public: true,
546
564
  };
547
- return await extra.jApi.article.list(filterSpec);
565
+ return await extra.jApi.article.list(filterSpec, {
566
+ format: 'raw-list',
567
+ });
548
568
  });
549
569
  const BookableAssetSlice = toolkit.createSlice({
550
570
  name: 'bookableAsset',
@@ -1407,7 +1427,7 @@ const saveExtraBot = toolkit.createAsyncThunk('extraBot/save', async ({ extraBot
1407
1427
  user = (await extra.jApi.extraBot.updateBot(res.uri)).result;
1408
1428
  }
1409
1429
  else {
1410
- res = (await extra.jApi.article.create({ ...data }, jamespot.Format.VIEW)).result[0];
1430
+ res = (await extra.jApi.article.create({ ...data }, { format: jamespot.Format.VIEW })).result[0];
1411
1431
  if (!res) {
1412
1432
  throw new Error('ExtraBot configuration creation failed');
1413
1433
  }
@@ -1709,10 +1729,13 @@ const fetchJLandMaps = toolkit.createAsyncThunk('/fetchMaps', async ({ jlandUrlB
1709
1729
  return await new Promise((resolve, reject) => {
1710
1730
  const config = {
1711
1731
  type: 'jlandmap',
1712
- format: 'raw-list',
1713
- formatExtend: ['licenses'],
1714
1732
  };
1715
- const mapsPromise = retrieveAllMaps ? jApi.jland.getAllMapsAsAdmin() : jApi.article.list(config);
1733
+ const mapsPromise = retrieveAllMaps
1734
+ ? jApi.jland.getAllMapsAsAdmin()
1735
+ : jApi.article.list(config, {
1736
+ format: 'raw-list',
1737
+ formatExtension: ['licenses'],
1738
+ });
1716
1739
  mapsPromise
1717
1740
  .then((mapsResp) => {
1718
1741
  const maps = mapsResp.result.data;
@@ -1948,13 +1971,18 @@ const createMap = toolkit.createAsyncThunk('mapCreate/create', async ({ map, jla
1948
1971
  const jApi = extra.jApi;
1949
1972
  return await new Promise((resolve, reject) => {
1950
1973
  jApi.article
1951
- .create(payload, 'raw-list')
1974
+ .create(payload, {
1975
+ format: 'raw-list',
1976
+ formatExtension: ['licenses'],
1977
+ })
1952
1978
  .then(async (response) => {
1953
1979
  if (response.error) {
1954
1980
  reject({ error: 1, errorMsg: response.errorMsg });
1955
1981
  return;
1956
1982
  }
1957
- const createdMap = response.result[0];
1983
+ const createdMap = response.result[0]
1984
+ ? { ...response.result[0], urlToJland: undefined }
1985
+ : undefined;
1958
1986
  if (map.assignLicense && createdMap !== undefined) {
1959
1987
  const hostname = await jApi.network.getHostname();
1960
1988
  createdMap.urlToJland = buildUrlToJland(createdMap, hostname, jlandUrlBase);
@@ -2107,11 +2135,12 @@ const fetchPads = toolkit.createAsyncThunk('magicPad/fetchPads', async (params,
2107
2135
  return (await extra.jApi.article.list({
2108
2136
  type: 'magicpad',
2109
2137
  limit: state.limit,
2110
- format: 'raw-view',
2111
2138
  page,
2112
2139
  query,
2113
2140
  orders,
2114
2141
  filters,
2142
+ }, {
2143
+ format: 'raw-view',
2115
2144
  })).result;
2116
2145
  }
2117
2146
  catch (error) {
@@ -2242,11 +2271,12 @@ const mediaLibrarySlice = toolkit.createSlice({
2242
2271
  const fetchMediaLibraryFolders = toolkit.createAsyncThunk('MediaLibrary/fetchMediaLibraryFolders', async (_, { extra, rejectWithValue, dispatch }) => {
2243
2272
  const args = {
2244
2273
  type: MediaLibraryAppConst.typeMediaLibraryFolder,
2245
- format: 'raw-little',
2246
2274
  limit: 10,
2247
2275
  };
2248
2276
  try {
2249
- return await extra.jApi.article.list(args);
2277
+ return await extra.jApi.article.list(args, {
2278
+ format: 'raw-list',
2279
+ });
2250
2280
  }
2251
2281
  catch (error) {
2252
2282
  dispatch(Toast.actions.error({ label: getErrorMessage(error) }));
@@ -2723,12 +2753,13 @@ const fetchChannels = toolkit.createAsyncThunk('/fetchChannels', async (page, {
2723
2753
  return await new Promise((resolve, reject) => {
2724
2754
  const config = {
2725
2755
  type: 'tvDisplayChannel',
2726
- format: 'raw-list',
2727
2756
  page: askedPage,
2728
2757
  orders: [{ name: 'id', sort: 'DESC' }],
2729
2758
  };
2730
2759
  jApi.article
2731
- .list(config)
2760
+ .list(config, {
2761
+ format: 'raw-list',
2762
+ })
2732
2763
  .then((channelsResp) => {
2733
2764
  resolve(channelsResp.result);
2734
2765
  })
@@ -6314,6 +6345,7 @@ exports.AppFormPrimaryListValues = AppFormPrimaryListValues;
6314
6345
  exports.AppFormUniqueList = AppFormUniqueList;
6315
6346
  exports.AppFormUniqueListCheck = AppFormUniqueListCheck;
6316
6347
  exports.Application = Application;
6348
+ exports.Article = Article;
6317
6349
  exports.AssetReservation = AssetReservation;
6318
6350
  exports.Bookmark = Bookmark;
6319
6351
  exports.Comment = Comment;