@gudhub/core 1.2.4-beta.63 → 1.2.4-beta.64

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.
@@ -4,7 +4,6 @@ import { AppHttpWorkerService, AppIndexedDBWorkerService, AppThroughWebWorkerSer
4
4
  import { IndexedDBChunkService } from "./IndexedDB/IndexedDBChunkService.js";
5
5
  import { appsConf } from "./IndexedDB/appDataConf.js";
6
6
  import { chunksConf } from "./IndexedDB/chunkDataConf.js";
7
- import { isInIframe, isIOS } from "./env-utils.js";
8
7
  import { AppHttpService } from "./httpService/AppHttpService.js";
9
8
  import { ChunkHttpService } from "./httpService/ChunkHttpService.js";
10
9
 
@@ -46,14 +45,6 @@ if (
46
45
  AppDataService = AppHttpService;
47
46
  }
48
47
 
49
- // iOS policies disallows to use IndexedDB for third party domains that embeds domain in iframe
50
- if (
51
- IS_BROWSER &&
52
- isIOS() &&
53
- isInIframe()
54
- ) {
55
- AppDataService = AppHttpService;
56
- }
57
48
 
58
49
  if (
59
50
  useWorkerToProcessRequestsData &&
@@ -83,14 +74,6 @@ if (
83
74
  chunkDataServiceConf = chunksConf;
84
75
  }
85
76
 
86
- // iOS policies disallows to use IndexedDB for third party domains that embeds domain in iframe
87
- if (
88
- IS_BROWSER &&
89
- isIOS() &&
90
- isInIframe()
91
- ) {
92
- ChunkDataService = ChunkHttpService;
93
- }
94
77
 
95
78
  if (
96
79
  !IS_BROWSER
@@ -210,15 +210,6 @@ async getFiles(app_id, filesId = []) {
210
210
  alt,
211
211
  title
212
212
  );
213
-
214
- // /*------------------------- UPDATE FILE FROM STRING ----------------------*/
215
- // this.updateFileFromString = function(data, id, name, ext, format) {
216
- // return fileApi.updateFileFromString(data, id, name, ext, format).then(function(response) {
217
- // fileStorage.updateFileInStorage(response.data.file_id, response.data.app_id, response.data);
218
- // return response;
219
- // });
220
- // };
221
-
222
213
  this.updateFileInStorage(file_id, file.app_id, file);
223
214
  return file;
224
215
  }
@@ -54,6 +54,8 @@ export function WebsocketHandler(gudhub, message) {
54
54
  break;
55
55
  case '/ws/emit-to-user':
56
56
  console.log('/ws/emit-to-user - ', message);
57
+ const emitToUserData = JSON.parse(message.response);
58
+ gudhub.pipeService.emit(emitToUserData.service_id, { user_id: message.user_id }, emitToUserData);
57
59
  break;
58
60
  case '/ws/broadcast-to-app-subscribers':
59
61
  console.log('/ws/broadcast-to-app-subscribers - ', message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/core",
3
- "version": "1.2.4-beta.63",
3
+ "version": "1.2.4-beta.64",
4
4
  "scripts": {
5
5
  "test": "NODE_ENV=test mocha $(find ./GUDHUB -print | grep -i test.js)",
6
6
  "prepublishOnly": "chmod +x ./build.sh; ./build.sh",
@@ -47,7 +47,6 @@
47
47
  "date-fns": "^2.16.1",
48
48
  "fuse.js": "^6.4.6",
49
49
  "jsonpath": "^1.0.2",
50
- "magic-string": "^0.30.17",
51
50
  "qs": "^6.9.4",
52
51
  "regenerator-runtime": "^0.13.9",
53
52
  "ws": "^7.3.1"
@@ -3,13 +3,8 @@ import { resolve } from 'path'
3
3
  import { babel } from '@rollup/plugin-babel';
4
4
 
5
5
 
6
- let isMinified = true;
7
-
8
-
9
6
  export default defineConfig({
10
7
  build: {
11
- minify: true,
12
- sourcemap: 'inline',
13
8
  rollupOptions: {
14
9
  output: {
15
10
  // Enables inline worker support using a data URI
@@ -30,38 +25,18 @@ export default defineConfig({
30
25
  emptyOutDir: false,
31
26
  },
32
27
  plugins: [
33
- // {
34
- // name: 'worker-loader',
35
- // transform(code, id) {
36
- // if (id.endsWith('PARCEL_APP_REQUEST_WORKER_FILENAME.js')) {
37
- // return {
38
- // code: `export default new URL('${id}?worker', import.meta.url)`,
39
- // // map: null // Optional: if you want source maps for the worker
40
- // map: { mappings: '' } // Optional: if you want source maps for the worker
41
- // }
42
- // }
43
- // return code
44
- // }
45
- // },
46
- {
47
- name: 'worker-loader',
48
- transform(code, id) {
49
- if (id.endsWith('PARCEL_APP_REQUEST_WORKER_FILENAME.js')) {
50
- const transformedCode = `export default new URL('${id}?worker', import.meta.url);`
51
-
52
- const s = new MagicString(code);
53
- s.overwrite(0, code.length, transformedCode);
54
-
55
- return {
56
- code: s.toString(),
57
- map: s.generateMap({ hires: true }) // hires = high resolution mapping
58
- };
59
- }
60
-
61
- // No transformation, just return null
62
- return null
28
+ {
29
+ name: 'worker-loader',
30
+ transform(code, id) {
31
+ if (id.endsWith('PARCEL_APP_REQUEST_WORKER_FILENAME.js')) {
32
+ return {
33
+ code: `export default new URL('${id}?worker', import.meta.url)`,
34
+ map: null // Optional: if you want source maps for the worker
63
35
  }
64
- },
36
+ }
37
+ return code
38
+ }
39
+ },
65
40
  babel({
66
41
  presets: [
67
42
  [
@@ -3,19 +3,8 @@ import { resolve } from 'path'
3
3
  import { babel } from '@rollup/plugin-babel';
4
4
 
5
5
 
6
- import MagicString from 'magic-string'
7
-
8
- // export default {
9
- // name: 'worker-loader',
10
-
11
- // }
12
-
13
-
14
-
15
6
  export default defineConfig({
16
7
  build: {
17
- minify: true,
18
- sourcemap: 'inline',
19
8
  rollupOptions: {
20
9
  output: {
21
10
  // Enables inline worker support using a data URI
@@ -36,39 +25,18 @@ export default defineConfig({
36
25
  emptyOutDir: false,
37
26
  },
38
27
  plugins: [
39
- // {
40
- // name: 'worker-loader',
41
- // transform(code, id) {
42
- // if (id.endsWith('PARCEL_APP_REQUEST_WORKER_FILENAME.js')) {
43
- // return {
44
- // code: `export default new URL('${id}?worker', import.meta.url)`,
45
- // map: null // Optional: if you want source maps for the worker
46
- // // map: { mappings: '' } // Optional: if you want source maps for the worker
47
- // }
48
- // }
49
- // return code
50
- // }
51
- // },
52
28
  {
53
29
  name: 'worker-loader',
54
30
  transform(code, id) {
55
31
  if (id.endsWith('PARCEL_APP_REQUEST_WORKER_FILENAME.js')) {
56
- const transformedCode = `export default new URL('${id}?worker', import.meta.url);`
57
-
58
- const s = new MagicString(code);
59
- s.overwrite(0, code.length, transformedCode);
60
-
61
32
  return {
62
- code: s.toString(),
63
- map: s.generateMap({ hires: true }) // hires = high resolution mapping
64
- };
33
+ code: `export default new URL('${id}?worker', import.meta.url)`,
34
+ map: null // Optional: if you want source maps for the worker
35
+ }
65
36
  }
66
-
67
- // No transformation, just return null
68
- return null
37
+ return code
69
38
  }
70
39
  },
71
-
72
40
  babel({
73
41
  presets: [
74
42
  [
@@ -1,16 +0,0 @@
1
- export let isInIframe = () => {
2
- try {
3
- return window.self !== window.top;
4
- } catch (e) {
5
- return true; // Access denied = definitely in iframe
6
- }
7
- }
8
-
9
- export let isIOS = () => {
10
- try {
11
- return /iPad|iPhone|iPod/.test(navigator.userAgent) ||
12
- (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
13
- } catch (error) {
14
- return false;
15
- }
16
- }