@iankibetsh/shframework 4.2.1 → 4.2.4

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/library.js CHANGED
@@ -186,7 +186,16 @@ function showToast(message, toastType, config){
186
186
  toastType = 'success';
187
187
  }
188
188
  if (config) {
189
- Object.keys(config).map(key => mixinConfig[key] = config[key]);
189
+ Object.keys(config).map(key =>{
190
+ let newKey = key;
191
+ if(key === 'duration'){
192
+ newKey = 'timer';
193
+ }
194
+ if(key === 'timeout'){
195
+ newKey = 'timer';
196
+ }
197
+ mixinConfig[newKey] = config[key];
198
+ });
190
199
  }
191
200
  console.log(mixinConfig);
192
201
  const Toast = Swal__default["default"].mixin(mixinConfig);
@@ -395,26 +404,34 @@ const axios = Axios__default["default"].create({
395
404
  baseURL: apiUrl
396
405
  });
397
406
  window.shAxionInstance = axios;
398
- function doGet (endPoint, data) {
407
+ function doGet (endPoint, data,extraConfig) {
399
408
  updateSession();
400
- return axios.get(endPoint, {
401
- params: data,
402
- crossOrigin: true,
409
+ const config = {
403
410
  headers: {
404
411
  Authorization: 'Bearer ' + ShStorage.getItem('access_token')
405
- // 'X-CSRF-TOKEN': 'INVALID'
406
412
  }
413
+ };
414
+ if (extraConfig) {
415
+ Object.assign(config, extraConfig);
416
+ }
417
+ return axios.get(endPoint, {
418
+ params: data,
419
+ crossOrigin: true
407
420
  })
408
421
  }
409
- function doPost (endPoint, data) {
422
+ function doPost (endPoint, data, extraConfig) {
410
423
  updateSession();
424
+ const config = {
425
+ headers: {
426
+ Authorization: 'Bearer ' + ShStorage.getItem('access_token')
427
+ }
428
+ };
429
+ if (extraConfig) {
430
+ Object.assign(config, extraConfig);
431
+ }
411
432
  return axios.post(endPoint,
412
433
  data,
413
- {
414
- headers: {
415
- Authorization: 'Bearer ' + ShStorage.getItem('access_token')
416
- }
417
- }
434
+ config
418
435
  )
419
436
  }
420
437
  function graphQlQuery(query) {
package/dist/library.mjs CHANGED
@@ -174,7 +174,16 @@ function showToast(message, toastType, config){
174
174
  toastType = 'success';
175
175
  }
176
176
  if (config) {
177
- Object.keys(config).map(key => mixinConfig[key] = config[key]);
177
+ Object.keys(config).map(key =>{
178
+ let newKey = key;
179
+ if(key === 'duration'){
180
+ newKey = 'timer';
181
+ }
182
+ if(key === 'timeout'){
183
+ newKey = 'timer';
184
+ }
185
+ mixinConfig[newKey] = config[key];
186
+ });
178
187
  }
179
188
  console.log(mixinConfig);
180
189
  const Toast = Swal.mixin(mixinConfig);
@@ -383,26 +392,34 @@ const axios = Axios.create({
383
392
  baseURL: apiUrl
384
393
  });
385
394
  window.shAxionInstance = axios;
386
- function doGet (endPoint, data) {
395
+ function doGet (endPoint, data,extraConfig) {
387
396
  updateSession();
388
- return axios.get(endPoint, {
389
- params: data,
390
- crossOrigin: true,
397
+ const config = {
391
398
  headers: {
392
399
  Authorization: 'Bearer ' + ShStorage.getItem('access_token')
393
- // 'X-CSRF-TOKEN': 'INVALID'
394
400
  }
401
+ };
402
+ if (extraConfig) {
403
+ Object.assign(config, extraConfig);
404
+ }
405
+ return axios.get(endPoint, {
406
+ params: data,
407
+ crossOrigin: true
395
408
  })
396
409
  }
397
- function doPost (endPoint, data) {
410
+ function doPost (endPoint, data, extraConfig) {
398
411
  updateSession();
412
+ const config = {
413
+ headers: {
414
+ Authorization: 'Bearer ' + ShStorage.getItem('access_token')
415
+ }
416
+ };
417
+ if (extraConfig) {
418
+ Object.assign(config, extraConfig);
419
+ }
399
420
  return axios.post(endPoint,
400
421
  data,
401
- {
402
- headers: {
403
- Authorization: 'Bearer ' + ShStorage.getItem('access_token')
404
- }
405
- }
422
+ config
406
423
  )
407
424
  }
408
425
  function graphQlQuery(query) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "4.2.1",
3
+ "version": "4.2.4",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",