@localzet/data-connector 1.0.0 → 1.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/dist/api/mixIdApi.js
CHANGED
|
@@ -2,7 +2,7 @@ const MIX_ID_API_BASE = typeof window !== 'undefined' && window.__MIX_ID_API_BAS
|
|
|
2
2
|
? window.__MIX_ID_API_BASE
|
|
3
3
|
: (typeof import.meta !== 'undefined' && import.meta.env?.VITE_MIX_ID_API_BASE)
|
|
4
4
|
? import.meta.env.VITE_MIX_ID_API_BASE
|
|
5
|
-
: '
|
|
5
|
+
: 'https://data-center.zorin.cloud/api';
|
|
6
6
|
class MixIdApi {
|
|
7
7
|
constructor() {
|
|
8
8
|
Object.defineProperty(this, "config", {
|
package/dist/api/websocket.js
CHANGED
|
@@ -73,8 +73,8 @@ class WebSocketClient {
|
|
|
73
73
|
this.isConnecting = true;
|
|
74
74
|
try {
|
|
75
75
|
const apiBase = config.apiBase || (typeof import.meta !== 'undefined' && import.meta.env?.VITE_MIX_ID_API_BASE)
|
|
76
|
-
? (import.meta.env?.VITE_MIX_ID_API_BASE || '
|
|
77
|
-
: '
|
|
76
|
+
? (import.meta.env?.VITE_MIX_ID_API_BASE || 'https://data-center.zorin.cloud/api')
|
|
77
|
+
: 'https://data-center.zorin.cloud/api';
|
|
78
78
|
const wsUrl = apiBase.replace(/^http/, 'ws').replace(/\/api$/, '') + '/ws';
|
|
79
79
|
const ws = new WebSocket(`${wsUrl}?token=${config.accessToken}`);
|
|
80
80
|
ws.onopen = () => {
|
|
@@ -39,8 +39,8 @@ export default function MixIdConnection({ onConnected, onDisconnected, showSyncS
|
|
|
39
39
|
// Get config from props or environment
|
|
40
40
|
const finalApiBase = apiBase ||
|
|
41
41
|
(typeof import.meta !== 'undefined' && import.meta.env?.VITE_MIX_ID_API_BASE)
|
|
42
|
-
? (import.meta.env?.VITE_MIX_ID_API_BASE || '
|
|
43
|
-
: '
|
|
42
|
+
? (import.meta.env?.VITE_MIX_ID_API_BASE || 'https://data-center.zorin.cloud/api')
|
|
43
|
+
: 'https://data-center.zorin.cloud/api';
|
|
44
44
|
const finalClientId = clientId ||
|
|
45
45
|
(typeof import.meta !== 'undefined' && import.meta.env?.VITE_MIX_ID_CLIENT_ID)
|
|
46
46
|
? (import.meta.env?.VITE_MIX_ID_CLIENT_ID || '')
|
|
@@ -64,7 +64,7 @@ export default function MixIdConnection({ onConnected, onDisconnected, showSyncS
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
mixIdApi.setConfig({
|
|
67
|
-
apiBase: finalApiBase || '
|
|
67
|
+
apiBase: finalApiBase || 'https://data-center.zorin.cloud/api',
|
|
68
68
|
clientId: finalClientId,
|
|
69
69
|
clientSecret: finalClientSecret
|
|
70
70
|
});
|
|
@@ -30,8 +30,8 @@ export function useNotifications() {
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
const apiBase = config.apiBase || (typeof import.meta !== 'undefined' && import.meta.env?.VITE_MIX_ID_API_BASE)
|
|
33
|
-
? (import.meta.env?.VITE_MIX_ID_API_BASE || '
|
|
34
|
-
: '
|
|
33
|
+
? (import.meta.env?.VITE_MIX_ID_API_BASE || 'https://data-center.zorin.cloud/api')
|
|
34
|
+
: 'https://data-center.zorin.cloud/api';
|
|
35
35
|
const response = await fetch(`${apiBase}/notifications`, {
|
|
36
36
|
headers: {
|
|
37
37
|
Authorization: `Bearer ${config.accessToken}`,
|
|
@@ -64,8 +64,8 @@ export function useNotifications() {
|
|
|
64
64
|
}
|
|
65
65
|
// Also send via HTTP as fallback
|
|
66
66
|
const apiBase = config.apiBase || (typeof import.meta !== 'undefined' && import.meta.env?.VITE_MIX_ID_API_BASE)
|
|
67
|
-
? (import.meta.env?.VITE_MIX_ID_API_BASE || '
|
|
68
|
-
: '
|
|
67
|
+
? (import.meta.env?.VITE_MIX_ID_API_BASE || 'https://data-center.zorin.cloud/api')
|
|
68
|
+
: 'https://data-center.zorin.cloud/api';
|
|
69
69
|
await fetch(`${apiBase}/notifications/${notificationId}/read`, {
|
|
70
70
|
method: 'PUT',
|
|
71
71
|
headers: {
|
|
@@ -88,8 +88,8 @@ export function useNotifications() {
|
|
|
88
88
|
saveNotifications(updated);
|
|
89
89
|
// Send via HTTP
|
|
90
90
|
const apiBase = config.apiBase || (typeof import.meta !== 'undefined' && import.meta.env?.VITE_MIX_ID_API_BASE)
|
|
91
|
-
? (import.meta.env?.VITE_MIX_ID_API_BASE || '
|
|
92
|
-
: '
|
|
91
|
+
? (import.meta.env?.VITE_MIX_ID_API_BASE || 'https://data-center.zorin.cloud/api')
|
|
92
|
+
: 'https://data-center.zorin.cloud/api';
|
|
93
93
|
await fetch(`${apiBase}/notifications/read-all`, {
|
|
94
94
|
method: 'PUT',
|
|
95
95
|
headers: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localzet/data-connector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "MIX ID connector library for React/Electron applications with real-time sync, notifications, and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|