een-api-toolkit 0.0.18 → 0.1.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/CHANGELOG.md +8 -5
- package/README.md +29 -41
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +339 -821
- package/dist/index.js +295 -340
- package/dist/index.js.map +1 -1
- package/docs/AI-CONTEXT.md +151 -237
- package/examples/vue-bridges/.env.example +13 -0
- package/examples/vue-bridges/e2e/app.spec.ts +73 -0
- package/examples/vue-bridges/e2e/auth.spec.ts +206 -0
- package/examples/{vue-basic → vue-bridges}/index.html +1 -1
- package/examples/vue-bridges/package-lock.json +1583 -0
- package/examples/vue-bridges/package.json +28 -0
- package/examples/vue-bridges/playwright.config.ts +46 -0
- package/examples/vue-bridges/src/App.vue +108 -0
- package/examples/vue-bridges/src/router/index.ts +68 -0
- package/examples/vue-bridges/src/views/BridgeDetail.vue +279 -0
- package/examples/vue-bridges/src/views/Bridges.vue +297 -0
- package/examples/vue-bridges/src/views/Callback.vue +76 -0
- package/examples/vue-bridges/src/views/Home.vue +150 -0
- package/examples/vue-bridges/src/views/Login.vue +33 -0
- package/examples/vue-bridges/src/views/Logout.vue +66 -0
- package/examples/vue-bridges/src/vite-env.d.ts +12 -0
- package/examples/vue-cameras/e2e/app.spec.ts +2 -2
- package/examples/vue-cameras/e2e/auth.spec.ts +206 -0
- package/examples/vue-cameras/src/App.vue +4 -4
- package/examples/vue-cameras/src/views/CameraDetail.vue +57 -9
- package/examples/vue-cameras/src/views/Cameras.vue +69 -18
- package/examples/vue-cameras/src/views/Home.vue +36 -11
- package/examples/{vue-basic → vue-users}/README.md +4 -4
- package/examples/{vue-basic → vue-users}/e2e/app.spec.ts +3 -3
- package/examples/{vue-basic → vue-users}/e2e/auth.spec.ts +2 -2
- package/examples/vue-users/index.html +13 -0
- package/examples/{vue-basic → vue-users}/package-lock.json +3 -3
- package/examples/{vue-basic → vue-users}/package.json +1 -1
- package/examples/{vue-basic → vue-users}/src/App.vue +1 -1
- package/examples/vue-users/src/main.ts +23 -0
- package/examples/{vue-basic → vue-users}/src/views/Home.vue +27 -12
- package/examples/{vue-basic → vue-users}/src/views/Users.vue +51 -10
- package/examples/vue-users/tsconfig.json +21 -0
- package/examples/vue-users/tsconfig.node.json +10 -0
- package/examples/vue-users/vite.config.ts +12 -0
- package/package.json +1 -1
- /package/examples/{vue-basic → vue-bridges}/src/main.ts +0 -0
- /package/examples/{vue-basic → vue-bridges}/tsconfig.json +0 -0
- /package/examples/{vue-basic → vue-bridges}/tsconfig.node.json +0 -0
- /package/examples/{vue-basic → vue-bridges}/vite.config.ts +0 -0
- /package/examples/{vue-basic → vue-users}/.env.example +0 -0
- /package/examples/{vue-basic → vue-users}/playwright.config.ts +0 -0
- /package/examples/{vue-basic → vue-users}/src/router/index.ts +0 -0
- /package/examples/{vue-basic → vue-users}/src/views/Callback.vue +0 -0
- /package/examples/{vue-basic → vue-users}/src/views/Login.vue +0 -0
- /package/examples/{vue-basic → vue-users}/src/views/Logout.vue +0 -0
- /package/examples/{vue-basic → vue-users}/src/vite-env.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
1
|
import { defineStore as Y } from "pinia";
|
|
2
|
-
import { ref as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
proxyUrl: e.proxyUrl ??
|
|
8
|
-
clientId: e.clientId ??
|
|
9
|
-
redirectUri: e.redirectUri ??
|
|
10
|
-
debug: e.debug ??
|
|
2
|
+
import { ref as _, computed as S } from "vue";
|
|
3
|
+
const g = {};
|
|
4
|
+
let U = {};
|
|
5
|
+
function _e(e = {}) {
|
|
6
|
+
U = {
|
|
7
|
+
proxyUrl: e.proxyUrl ?? g?.VITE_PROXY_URL,
|
|
8
|
+
clientId: e.clientId ?? g?.VITE_EEN_CLIENT_ID,
|
|
9
|
+
redirectUri: e.redirectUri ?? g?.VITE_REDIRECT_URI,
|
|
10
|
+
debug: e.debug ?? g?.VITE_DEBUG === "true"
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function fe() {
|
|
14
|
+
return U;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function $() {
|
|
17
|
+
return U.proxyUrl ?? g?.VITE_PROXY_URL;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
19
|
+
function Z() {
|
|
20
|
+
return U.clientId ?? g?.VITE_EEN_CLIENT_ID;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
function j() {
|
|
23
|
+
return U.redirectUri ?? g?.VITE_REDIRECT_URI ?? "http://127.0.0.1:3333";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function f(e) {
|
|
26
26
|
return { data: e, error: null };
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function o(e, n, t, r) {
|
|
29
29
|
return { data: null, error: { code: e, message: n, status: t, details: r } };
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const ee = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, te = () => {
|
|
32
32
|
try {
|
|
33
|
-
return
|
|
33
|
+
return ee?.VITE_DEBUG === "true";
|
|
34
34
|
} catch {
|
|
35
35
|
return !1;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
function c(...e) {
|
|
39
|
-
|
|
39
|
+
te() && console.log("[een-api-toolkit]", ...e);
|
|
40
40
|
}
|
|
41
|
-
let
|
|
42
|
-
function
|
|
43
|
-
return
|
|
41
|
+
let y = null;
|
|
42
|
+
function ne() {
|
|
43
|
+
return y || (y = Promise.resolve().then(() => ue).then((e) => e.refreshToken)), y;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
const e =
|
|
47
|
-
let
|
|
48
|
-
const
|
|
49
|
-
function
|
|
50
|
-
e.value = s, n.value = Date.now() +
|
|
45
|
+
const h = Y("een-auth", () => {
|
|
46
|
+
const e = _(null), n = _(null), t = _(null), r = _(null), a = _(null), i = _(443), u = _(null), d = _(null), v = _(!1);
|
|
47
|
+
let E = null;
|
|
48
|
+
const R = _(!1), I = _(null), F = S(() => !!e.value), w = S(() => a.value ? i.value === 443 ? `https://${a.value}` : `https://${a.value}:${i.value}` : null), A = S(() => n.value ? Date.now() >= n.value : !0), P = S(() => n.value ? Math.max(0, n.value - Date.now()) : 0);
|
|
49
|
+
function C(s, l) {
|
|
50
|
+
e.value = s, n.value = Date.now() + l * 1e3, T(), k(), c("Token set, expires in", l, "seconds");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
t.value = s,
|
|
52
|
+
function N(s) {
|
|
53
|
+
t.value = s, T();
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
r.value = s,
|
|
55
|
+
function q(s) {
|
|
56
|
+
r.value = s, T();
|
|
57
57
|
}
|
|
58
58
|
function B(s) {
|
|
59
59
|
if (typeof s == "string")
|
|
60
60
|
try {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
} catch (
|
|
64
|
-
c("Failed to parse URL, using as hostname:",
|
|
61
|
+
const l = new URL(s.startsWith("http") ? s : `https://${s}`);
|
|
62
|
+
a.value = l.hostname, i.value = l.port ? parseInt(l.port, 10) : 443;
|
|
63
|
+
} catch (l) {
|
|
64
|
+
c("Failed to parse URL, using as hostname:", l instanceof Error ? l.message : String(l)), a.value = s, i.value = 443;
|
|
65
65
|
}
|
|
66
66
|
else
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
a.value = s.hostname, i.value = s.port ?? 443;
|
|
68
|
+
T(), c("Base URL set:", w.value);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
70
|
+
function H(s) {
|
|
71
|
+
u.value = s, T();
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
if (
|
|
73
|
+
function k() {
|
|
74
|
+
if (d.value && (clearTimeout(d.value), d.value = null), !n.value || !e.value)
|
|
75
75
|
return;
|
|
76
|
-
const s = Date.now(),
|
|
77
|
-
c("Auto-refresh scheduled in", Math.round(
|
|
78
|
-
await
|
|
79
|
-
},
|
|
76
|
+
const s = Date.now(), p = n.value - s, G = 300 * 1e3, K = p / 2, J = Math.min(G, K), X = Math.max(p - J, 60 * 1e3), O = Math.max(X, 5e3);
|
|
77
|
+
c("Auto-refresh scheduled in", Math.round(O / 1e3), "seconds"), d.value = setTimeout(async () => {
|
|
78
|
+
await z();
|
|
79
|
+
}, O);
|
|
80
80
|
}
|
|
81
|
-
async function
|
|
82
|
-
return
|
|
81
|
+
async function z() {
|
|
82
|
+
return E ? (c("Refresh already in progress, waiting for existing refresh"), E) : (v.value = !0, c("Performing auto-refresh"), E = (async () => {
|
|
83
83
|
try {
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
const l = await (await ne())();
|
|
85
|
+
l.error ? (R.value = !0, I.value = l.error.message, c("Auto-refresh failed:", l.error.message)) : (R.value = !1, I.value = null, c("Auto-refresh successful"));
|
|
86
86
|
} catch (s) {
|
|
87
|
-
|
|
87
|
+
R.value = !0, I.value = s instanceof Error ? s.message : String(s), c("Auto-refresh error:", s);
|
|
88
88
|
} finally {
|
|
89
|
-
|
|
89
|
+
v.value = !1, E = null;
|
|
90
90
|
}
|
|
91
|
-
})(),
|
|
91
|
+
})(), E);
|
|
92
92
|
}
|
|
93
93
|
function M() {
|
|
94
|
-
|
|
94
|
+
R.value = !1, I.value = null;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
96
|
+
function m() {
|
|
97
|
+
d.value && (clearTimeout(d.value), d.value = null), e.value = null, n.value = null, t.value = null, r.value = null, a.value = null, i.value = 443, u.value = null, R.value = !1, I.value = null, W(), c("Logged out");
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
99
|
+
function Q() {
|
|
100
|
+
V(), e.value && !A.value ? (k(), c("Initialized from storage")) : e.value && A.value && (c("Stored token expired, clearing"), m());
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function T() {
|
|
103
103
|
try {
|
|
104
|
-
e.value && localStorage.setItem("een_token", e.value), n.value && localStorage.setItem("een_tokenExpiration", String(n.value)), t.value && localStorage.setItem("een_refreshTokenMarker", t.value), r.value && localStorage.setItem("een_sessionId", r.value),
|
|
104
|
+
e.value && localStorage.setItem("een_token", e.value), n.value && localStorage.setItem("een_tokenExpiration", String(n.value)), t.value && localStorage.setItem("een_refreshTokenMarker", t.value), r.value && localStorage.setItem("een_sessionId", r.value), a.value && localStorage.setItem("een_hostname", a.value), i.value !== 443 && localStorage.setItem("een_port", String(i.value)), u.value && localStorage.setItem("een_userProfile", JSON.stringify(u.value));
|
|
105
105
|
} catch (s) {
|
|
106
106
|
c("Failed to save to localStorage:", s instanceof Error ? s.message : String(s));
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function V() {
|
|
110
110
|
try {
|
|
111
111
|
e.value = localStorage.getItem("een_token");
|
|
112
112
|
const s = localStorage.getItem("een_tokenExpiration");
|
|
113
|
-
n.value = s ? parseInt(s, 10) : null, t.value = localStorage.getItem("een_refreshTokenMarker"), r.value = localStorage.getItem("een_sessionId"),
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
113
|
+
n.value = s ? parseInt(s, 10) : null, t.value = localStorage.getItem("een_refreshTokenMarker"), r.value = localStorage.getItem("een_sessionId"), a.value = localStorage.getItem("een_hostname");
|
|
114
|
+
const l = localStorage.getItem("een_port");
|
|
115
|
+
i.value = l ? parseInt(l, 10) : 443;
|
|
116
|
+
const p = localStorage.getItem("een_userProfile");
|
|
117
|
+
u.value = p ? JSON.parse(p) : null;
|
|
118
118
|
} catch (s) {
|
|
119
119
|
c("Failed to load from localStorage:", s instanceof Error ? s.message : String(s));
|
|
120
120
|
}
|
|
@@ -132,31 +132,31 @@ const E = Y("een-auth", () => {
|
|
|
132
132
|
tokenExpiration: n,
|
|
133
133
|
refreshTokenMarker: t,
|
|
134
134
|
sessionId: r,
|
|
135
|
-
hostname:
|
|
136
|
-
port:
|
|
137
|
-
userProfile:
|
|
138
|
-
isRefreshing:
|
|
139
|
-
refreshFailed:
|
|
140
|
-
refreshFailedMessage:
|
|
135
|
+
hostname: a,
|
|
136
|
+
port: i,
|
|
137
|
+
userProfile: u,
|
|
138
|
+
isRefreshing: v,
|
|
139
|
+
refreshFailed: R,
|
|
140
|
+
refreshFailedMessage: I,
|
|
141
141
|
// Computed
|
|
142
|
-
isAuthenticated:
|
|
143
|
-
baseUrl:
|
|
144
|
-
isTokenExpired:
|
|
145
|
-
tokenExpiresIn:
|
|
142
|
+
isAuthenticated: F,
|
|
143
|
+
baseUrl: w,
|
|
144
|
+
isTokenExpired: A,
|
|
145
|
+
tokenExpiresIn: P,
|
|
146
146
|
// Actions
|
|
147
|
-
setToken:
|
|
148
|
-
setRefreshTokenMarker:
|
|
149
|
-
setSessionId:
|
|
147
|
+
setToken: C,
|
|
148
|
+
setRefreshTokenMarker: N,
|
|
149
|
+
setSessionId: q,
|
|
150
150
|
setBaseUrl: B,
|
|
151
|
-
setUserProfile:
|
|
152
|
-
setupAutoRefresh:
|
|
151
|
+
setUserProfile: H,
|
|
152
|
+
setupAutoRefresh: k,
|
|
153
153
|
clearRefreshFailed: M,
|
|
154
|
-
logout:
|
|
155
|
-
initialize:
|
|
154
|
+
logout: m,
|
|
155
|
+
initialize: Q
|
|
156
156
|
};
|
|
157
|
-
}),
|
|
158
|
-
function
|
|
159
|
-
const e =
|
|
157
|
+
}), re = "https://auth.eagleeyenetworks.com/oauth2/authorize";
|
|
158
|
+
function oe() {
|
|
159
|
+
const e = Z();
|
|
160
160
|
if (!e)
|
|
161
161
|
throw new Error("Client ID not configured. Call initEenToolkit() or set VITE_EEN_CLIENT_ID");
|
|
162
162
|
const n = crypto.randomUUID();
|
|
@@ -168,18 +168,18 @@ function ae() {
|
|
|
168
168
|
client_id: e,
|
|
169
169
|
response_type: "code",
|
|
170
170
|
scope: "vms.all",
|
|
171
|
-
redirect_uri:
|
|
171
|
+
redirect_uri: j(),
|
|
172
172
|
state: n
|
|
173
173
|
});
|
|
174
|
-
return c("Generated auth URL with state:", n), `${
|
|
174
|
+
return c("Generated auth URL with state:", n), `${re}?${t.toString()}`;
|
|
175
175
|
}
|
|
176
|
-
async function
|
|
177
|
-
const n =
|
|
176
|
+
async function x(e) {
|
|
177
|
+
const n = $();
|
|
178
178
|
if (!n)
|
|
179
|
-
return
|
|
179
|
+
return o("AUTH_FAILED", "Proxy URL not configured. Call initEenToolkit() or set VITE_PROXY_URL");
|
|
180
180
|
const t = new URLSearchParams({
|
|
181
181
|
code: e,
|
|
182
|
-
redirect_uri:
|
|
182
|
+
redirect_uri: j()
|
|
183
183
|
});
|
|
184
184
|
try {
|
|
185
185
|
const r = await fetch(`${n}/proxy/getAccessToken?${t.toString()}`, {
|
|
@@ -190,20 +190,20 @@ async function b(e) {
|
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
if (!r.ok) {
|
|
193
|
-
const
|
|
194
|
-
return
|
|
193
|
+
const i = await r.text().catch(() => "Unknown error");
|
|
194
|
+
return o("AUTH_FAILED", `Token exchange failed: ${i}`, r.status);
|
|
195
195
|
}
|
|
196
|
-
const
|
|
197
|
-
return c("Token received, expires in:",
|
|
196
|
+
const a = await r.json();
|
|
197
|
+
return c("Token received, expires in:", a.expiresIn), f(a);
|
|
198
198
|
} catch (r) {
|
|
199
|
-
return
|
|
199
|
+
return o("NETWORK_ERROR", `Failed to exchange code: ${String(r)}`);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
async function ie() {
|
|
203
|
-
const e =
|
|
203
|
+
const e = $();
|
|
204
204
|
if (!e)
|
|
205
|
-
return
|
|
206
|
-
const n =
|
|
205
|
+
return o("AUTH_FAILED", "Proxy URL not configured");
|
|
206
|
+
const n = h();
|
|
207
207
|
try {
|
|
208
208
|
const t = {
|
|
209
209
|
Accept: "application/json"
|
|
@@ -215,20 +215,20 @@ async function ie() {
|
|
|
215
215
|
headers: t
|
|
216
216
|
});
|
|
217
217
|
if (!r.ok) {
|
|
218
|
-
const
|
|
219
|
-
return
|
|
218
|
+
const i = await r.text().catch(() => "Unknown error");
|
|
219
|
+
return o("AUTH_FAILED", `Token refresh failed: ${i}`, r.status);
|
|
220
220
|
}
|
|
221
|
-
const
|
|
222
|
-
return n.setToken(
|
|
221
|
+
const a = await r.json();
|
|
222
|
+
return n.setToken(a.accessToken, a.expiresIn), c("Token refreshed, expires in:", a.expiresIn), f(a);
|
|
223
223
|
} catch (t) {
|
|
224
|
-
return
|
|
224
|
+
return o("NETWORK_ERROR", `Failed to refresh token: ${String(t)}`);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
async function
|
|
228
|
-
const e =
|
|
227
|
+
async function ae() {
|
|
228
|
+
const e = $();
|
|
229
229
|
if (!e)
|
|
230
|
-
return
|
|
231
|
-
const n =
|
|
230
|
+
return o("AUTH_FAILED", "Proxy URL not configured");
|
|
231
|
+
const n = h();
|
|
232
232
|
try {
|
|
233
233
|
const t = {
|
|
234
234
|
Accept: "application/json"
|
|
@@ -240,32 +240,32 @@ async function se() {
|
|
|
240
240
|
headers: t
|
|
241
241
|
});
|
|
242
242
|
if (n.logout(), !r.ok) {
|
|
243
|
-
const
|
|
244
|
-
return
|
|
243
|
+
const a = await r.text().catch(() => "Unknown error");
|
|
244
|
+
return o("AUTH_FAILED", `Token revocation failed: ${a}`, r.status);
|
|
245
245
|
}
|
|
246
|
-
return c("Token revoked"),
|
|
246
|
+
return c("Token revoked"), f(void 0);
|
|
247
247
|
} catch (t) {
|
|
248
|
-
return n.logout(),
|
|
248
|
+
return n.logout(), o("NETWORK_ERROR", `Failed to revoke token: ${String(t)}`);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
async function
|
|
251
|
+
async function se(e, n) {
|
|
252
252
|
let t = null;
|
|
253
253
|
try {
|
|
254
254
|
t = sessionStorage.getItem("een_oauth_state"), sessionStorage.removeItem("een_oauth_state");
|
|
255
255
|
} catch {
|
|
256
256
|
}
|
|
257
257
|
if (!t)
|
|
258
|
-
return
|
|
259
|
-
if (!
|
|
260
|
-
return
|
|
258
|
+
return o("AUTH_FAILED", "No OAuth state found. Please restart the login process.");
|
|
259
|
+
if (!ce(n, t))
|
|
260
|
+
return o("AUTH_FAILED", "Invalid OAuth state. Possible CSRF attack.");
|
|
261
261
|
c("State validated, exchanging code for token");
|
|
262
|
-
const r = await
|
|
262
|
+
const r = await x(e);
|
|
263
263
|
if (r.error)
|
|
264
264
|
return r;
|
|
265
|
-
const
|
|
266
|
-
return
|
|
265
|
+
const a = h(), i = r.data;
|
|
266
|
+
return a.setToken(i.accessToken, i.expiresIn), a.setRefreshTokenMarker("present"), a.setSessionId(i.sessionId), a.setBaseUrl(i.httpsBaseUrl), c("Auth callback complete, user:", i.userEmail), f(i);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function ce(e, n) {
|
|
269
269
|
if (e.length !== n.length)
|
|
270
270
|
return !1;
|
|
271
271
|
let t = 0;
|
|
@@ -273,20 +273,20 @@ function ue(e, n) {
|
|
|
273
273
|
t |= e.charCodeAt(r) ^ n.charCodeAt(r);
|
|
274
274
|
return t === 0;
|
|
275
275
|
}
|
|
276
|
-
const
|
|
276
|
+
const ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
277
277
|
__proto__: null,
|
|
278
|
-
getAccessToken:
|
|
279
|
-
getAuthUrl:
|
|
280
|
-
handleAuthCallback:
|
|
278
|
+
getAccessToken: x,
|
|
279
|
+
getAuthUrl: oe,
|
|
280
|
+
handleAuthCallback: se,
|
|
281
281
|
refreshToken: ie,
|
|
282
|
-
revokeToken:
|
|
282
|
+
revokeToken: ae
|
|
283
283
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
284
|
-
async function
|
|
285
|
-
const e =
|
|
284
|
+
async function he() {
|
|
285
|
+
const e = h();
|
|
286
286
|
if (!e.isAuthenticated)
|
|
287
|
-
return
|
|
287
|
+
return o("AUTH_REQUIRED", "Authentication required");
|
|
288
288
|
if (!e.baseUrl)
|
|
289
|
-
return
|
|
289
|
+
return o("AUTH_REQUIRED", "Base URL not configured");
|
|
290
290
|
const n = `${e.baseUrl}/api/v3.0/users/self`;
|
|
291
291
|
c("Fetching current user:", n);
|
|
292
292
|
try {
|
|
@@ -298,68 +298,68 @@ async function de() {
|
|
|
298
298
|
}
|
|
299
299
|
});
|
|
300
300
|
if (!t.ok)
|
|
301
|
-
return
|
|
301
|
+
return D(t);
|
|
302
302
|
const r = await t.json();
|
|
303
|
-
return c("Current user fetched:", r.email), e.setUserProfile(r),
|
|
303
|
+
return c("Current user fetched:", r.email), e.setUserProfile(r), f(r);
|
|
304
304
|
} catch (t) {
|
|
305
|
-
return
|
|
305
|
+
return o("NETWORK_ERROR", `Failed to fetch current user: ${String(t)}`);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
async function
|
|
309
|
-
const n =
|
|
308
|
+
async function ge(e) {
|
|
309
|
+
const n = h();
|
|
310
310
|
if (!n.isAuthenticated)
|
|
311
|
-
return
|
|
311
|
+
return o("AUTH_REQUIRED", "Authentication required");
|
|
312
312
|
if (!n.baseUrl)
|
|
313
|
-
return
|
|
313
|
+
return o("AUTH_REQUIRED", "Base URL not configured");
|
|
314
314
|
const t = new URLSearchParams();
|
|
315
315
|
e?.pageSize && t.append("pageSize", String(e.pageSize)), e?.pageToken && t.append("pageToken", e.pageToken), e?.include && e.include.length > 0 && t.append("include", e.include.join(","));
|
|
316
|
-
const r = t.toString(),
|
|
317
|
-
c("Fetching users:",
|
|
316
|
+
const r = t.toString(), a = `${n.baseUrl}/api/v3.0/users${r ? `?${r}` : ""}`;
|
|
317
|
+
c("Fetching users:", a);
|
|
318
318
|
try {
|
|
319
|
-
const
|
|
319
|
+
const i = await fetch(a, {
|
|
320
320
|
method: "GET",
|
|
321
321
|
headers: {
|
|
322
322
|
Accept: "application/json",
|
|
323
323
|
Authorization: `Bearer ${n.token}`
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
|
-
if (!
|
|
327
|
-
return
|
|
328
|
-
const
|
|
329
|
-
return c("Users fetched:",
|
|
330
|
-
} catch (
|
|
331
|
-
return
|
|
326
|
+
if (!i.ok)
|
|
327
|
+
return D(i);
|
|
328
|
+
const u = await i.json();
|
|
329
|
+
return c("Users fetched:", u.results?.length ?? 0, "users"), f(u);
|
|
330
|
+
} catch (i) {
|
|
331
|
+
return o("NETWORK_ERROR", `Failed to fetch users: ${String(i)}`);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
async function
|
|
335
|
-
const t =
|
|
334
|
+
async function Re(e, n) {
|
|
335
|
+
const t = h();
|
|
336
336
|
if (!t.isAuthenticated)
|
|
337
|
-
return
|
|
337
|
+
return o("AUTH_REQUIRED", "Authentication required");
|
|
338
338
|
if (!t.baseUrl)
|
|
339
|
-
return
|
|
339
|
+
return o("AUTH_REQUIRED", "Base URL not configured");
|
|
340
340
|
if (!e)
|
|
341
|
-
return
|
|
341
|
+
return o("VALIDATION_ERROR", "User ID is required");
|
|
342
342
|
const r = new URLSearchParams();
|
|
343
343
|
n?.include && n.include.length > 0 && r.append("include", n.include.join(","));
|
|
344
|
-
const
|
|
345
|
-
c("Fetching user:",
|
|
344
|
+
const a = r.toString(), i = `${t.baseUrl}/api/v3.0/users/${encodeURIComponent(e)}${a ? `?${a}` : ""}`;
|
|
345
|
+
c("Fetching user:", i);
|
|
346
346
|
try {
|
|
347
|
-
const
|
|
347
|
+
const u = await fetch(i, {
|
|
348
348
|
method: "GET",
|
|
349
349
|
headers: {
|
|
350
350
|
Accept: "application/json",
|
|
351
351
|
Authorization: `Bearer ${t.token}`
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
|
-
if (!
|
|
355
|
-
return
|
|
356
|
-
const
|
|
357
|
-
return c("User fetched:",
|
|
358
|
-
} catch (
|
|
359
|
-
return
|
|
354
|
+
if (!u.ok)
|
|
355
|
+
return D(u);
|
|
356
|
+
const d = await u.json();
|
|
357
|
+
return c("User fetched:", d.email), f(d);
|
|
358
|
+
} catch (u) {
|
|
359
|
+
return o("NETWORK_ERROR", `Failed to fetch user: ${String(u)}`);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
async function
|
|
362
|
+
async function D(e) {
|
|
363
363
|
const n = e.status;
|
|
364
364
|
let t;
|
|
365
365
|
try {
|
|
@@ -370,137 +370,72 @@ async function L(e) {
|
|
|
370
370
|
}
|
|
371
371
|
switch (n) {
|
|
372
372
|
case 401:
|
|
373
|
-
return
|
|
373
|
+
return o("AUTH_REQUIRED", `Authentication failed: ${t}`, n);
|
|
374
374
|
case 403:
|
|
375
|
-
return
|
|
375
|
+
return o("FORBIDDEN", `Access denied: ${t}`, n);
|
|
376
376
|
case 404:
|
|
377
|
-
return
|
|
377
|
+
return o("NOT_FOUND", `Not found: ${t}`, n);
|
|
378
378
|
case 429:
|
|
379
|
-
return
|
|
379
|
+
return o("RATE_LIMITED", `Rate limited: ${t}`, n);
|
|
380
380
|
default:
|
|
381
|
-
return
|
|
381
|
+
return o("API_ERROR", `API error: ${t}`, n);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
const n =
|
|
386
|
-
t.value = !0, r.value = null;
|
|
387
|
-
const i = await de();
|
|
388
|
-
return i.error ? (r.value = i.error, n.value = null) : n.value = i.data, t.value = !1, i;
|
|
389
|
-
}, a = o;
|
|
390
|
-
return e?.immediate !== !1 && x(o), {
|
|
391
|
-
user: n,
|
|
392
|
-
loading: t,
|
|
393
|
-
error: r,
|
|
394
|
-
fetch: o,
|
|
395
|
-
refresh: a
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
function Ee(e, n) {
|
|
399
|
-
const t = u([]), r = u(!1), o = u(null), a = u(void 0), i = u(void 0), f = u(void 0), I = p(() => !!a.value), g = p(() => !!i.value), _ = u(e ?? {}), d = async (R) => {
|
|
400
|
-
r.value = !0, o.value = null;
|
|
401
|
-
const y = { ..._.value, ...R }, v = await fe(y);
|
|
402
|
-
return v.error ? (o.value = v.error, t.value = [], a.value = void 0, i.value = void 0, f.value = void 0) : (t.value = v.data.results, a.value = v.data.nextPageToken, i.value = v.data.prevPageToken, f.value = v.data.totalSize), r.value = !1, v;
|
|
403
|
-
}, m = () => d(), k = async () => {
|
|
404
|
-
if (a.value)
|
|
405
|
-
return d({ ..._.value, pageToken: a.value });
|
|
406
|
-
}, U = async () => {
|
|
407
|
-
if (i.value)
|
|
408
|
-
return d({ ..._.value, pageToken: i.value });
|
|
409
|
-
}, A = (R) => {
|
|
410
|
-
_.value = R;
|
|
411
|
-
};
|
|
412
|
-
return n?.immediate !== !1 && x(d), {
|
|
413
|
-
users: t,
|
|
414
|
-
loading: r,
|
|
415
|
-
error: o,
|
|
416
|
-
nextPageToken: a,
|
|
417
|
-
prevPageToken: i,
|
|
418
|
-
totalSize: f,
|
|
419
|
-
hasNextPage: I,
|
|
420
|
-
hasPrevPage: g,
|
|
421
|
-
params: _,
|
|
422
|
-
fetch: d,
|
|
423
|
-
refresh: m,
|
|
424
|
-
fetchNextPage: k,
|
|
425
|
-
fetchPrevPage: U,
|
|
426
|
-
setParams: A
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
function Ue(e, n) {
|
|
430
|
-
const t = u(null), r = u(!1), o = u(null), a = () => typeof e == "function" ? e() : e, i = async (I) => {
|
|
431
|
-
const g = a();
|
|
432
|
-
if (!g)
|
|
433
|
-
return o.value = { code: "VALIDATION_ERROR", message: "User ID is required" }, { data: null, error: o.value };
|
|
434
|
-
r.value = !0, o.value = null;
|
|
435
|
-
const _ = {
|
|
436
|
-
include: n?.include,
|
|
437
|
-
...I
|
|
438
|
-
}, d = await _e(g, _);
|
|
439
|
-
return d.error ? (o.value = d.error, t.value = null) : t.value = d.data, r.value = !1, d;
|
|
440
|
-
}, f = () => i();
|
|
441
|
-
return n?.immediate !== !1 && a() && x(i), {
|
|
442
|
-
user: t,
|
|
443
|
-
loading: r,
|
|
444
|
-
error: o,
|
|
445
|
-
fetch: i,
|
|
446
|
-
refresh: f
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
async function he(e) {
|
|
450
|
-
const n = E();
|
|
384
|
+
async function Ie(e) {
|
|
385
|
+
const n = h();
|
|
451
386
|
if (!n.isAuthenticated)
|
|
452
|
-
return
|
|
387
|
+
return o("AUTH_REQUIRED", "Authentication required");
|
|
453
388
|
if (!n.baseUrl)
|
|
454
|
-
return
|
|
389
|
+
return o("AUTH_REQUIRED", "Base URL not configured");
|
|
455
390
|
const t = new URLSearchParams();
|
|
456
391
|
e?.pageSize && t.append("pageSize", String(e.pageSize)), e?.pageToken && t.append("pageToken", e.pageToken), e?.include && e.include.length > 0 && t.append("include", e.include.join(",")), e?.sort && e.sort.length > 0 && t.append("sort", e.sort.join(",")), e?.locationId__in && e.locationId__in.length > 0 && t.append("locationId__in", e.locationId__in.join(",")), e?.bridgeId__in && e.bridgeId__in.length > 0 && t.append("bridgeId__in", e.bridgeId__in.join(",")), e?.multiCameraId && t.append("multiCameraId", e.multiCameraId), e?.multiCameraId__ne && t.append("multiCameraId__ne", e.multiCameraId__ne), e?.multiCameraId__in && e.multiCameraId__in.length > 0 && t.append("multiCameraId__in", e.multiCameraId__in.join(",")), e?.tags__contains && e.tags__contains.length > 0 && t.append("tags__contains", e.tags__contains.join(",")), e?.tags__any && e.tags__any.length > 0 && t.append("tags__any", e.tags__any.join(",")), e?.packages__contains && e.packages__contains.length > 0 && t.append("packages__contains", e.packages__contains.join(",")), e?.name && t.append("name", e.name), e?.name__contains && t.append("name__contains", e.name__contains), e?.name__in && e.name__in.length > 0 && t.append("name__in", e.name__in.join(",")), e?.id__in && e.id__in.length > 0 && t.append("id__in", e.id__in.join(",")), e?.id__notIn && e.id__notIn.length > 0 && t.append("id__notIn", e.id__notIn.join(",")), e?.id__contains && t.append("id__contains", e.id__contains), e?.layoutId && t.append("layoutId", e.layoutId), typeof e?.shared == "boolean" && t.append("shareDetails.shared", String(e.shared)), e?.sharedCameraAccount && t.append("shareDetails.accountId", e.sharedCameraAccount), typeof e?.firstResponder == "boolean" && t.append("shareDetails.firstResponder", String(e.firstResponder)), typeof e?.directToCloud == "boolean" && t.append("deviceInfo.directToCloud", String(e.directToCloud)), e?.speakerId__in && e.speakerId__in.length > 0 && t.append("speakerId__in", e.speakerId__in.join(",")), e?.q && t.append("q", e.q), typeof e?.qRelevance__gte == "number" && t.append("qRelevance__gte", String(e.qRelevance__gte)), e?.enabledAnalytics__contains && e.enabledAnalytics__contains.length > 0 && t.append("enabledAnalytics__contains", e.enabledAnalytics__contains.join(",")), e?.status__in && e.status__in.length > 0 && t.append("status__in", e.status__in.join(",")), e?.status__ne && t.append("status__ne", e.status__ne);
|
|
457
|
-
const r = t.toString(),
|
|
458
|
-
c("Fetching cameras:",
|
|
392
|
+
const r = t.toString(), a = `${n.baseUrl}/api/v3.0/cameras${r ? `?${r}` : ""}`;
|
|
393
|
+
c("Fetching cameras:", a);
|
|
459
394
|
try {
|
|
460
|
-
const
|
|
395
|
+
const i = await fetch(a, {
|
|
461
396
|
method: "GET",
|
|
462
397
|
headers: {
|
|
463
398
|
Accept: "application/json",
|
|
464
399
|
Authorization: `Bearer ${n.token}`
|
|
465
400
|
}
|
|
466
401
|
});
|
|
467
|
-
if (!
|
|
468
|
-
return
|
|
469
|
-
const
|
|
470
|
-
return c("Cameras fetched:",
|
|
471
|
-
} catch (
|
|
472
|
-
return
|
|
402
|
+
if (!i.ok)
|
|
403
|
+
return L(i);
|
|
404
|
+
const u = await i.json();
|
|
405
|
+
return c("Cameras fetched:", u.results?.length ?? 0, "cameras"), f(u);
|
|
406
|
+
} catch (i) {
|
|
407
|
+
return o("NETWORK_ERROR", `Failed to fetch cameras: ${String(i)}`);
|
|
473
408
|
}
|
|
474
409
|
}
|
|
475
|
-
async function
|
|
476
|
-
const t =
|
|
410
|
+
async function Ee(e, n) {
|
|
411
|
+
const t = h();
|
|
477
412
|
if (!t.isAuthenticated)
|
|
478
|
-
return
|
|
413
|
+
return o("AUTH_REQUIRED", "Authentication required");
|
|
479
414
|
if (!t.baseUrl)
|
|
480
|
-
return
|
|
415
|
+
return o("AUTH_REQUIRED", "Base URL not configured");
|
|
481
416
|
if (!e)
|
|
482
|
-
return
|
|
417
|
+
return o("VALIDATION_ERROR", "Camera ID is required");
|
|
483
418
|
const r = new URLSearchParams();
|
|
484
419
|
n?.include && n.include.length > 0 && r.append("include", n.include.join(","));
|
|
485
|
-
const
|
|
486
|
-
c("Fetching camera:",
|
|
420
|
+
const a = r.toString(), i = `${t.baseUrl}/api/v3.0/cameras/${encodeURIComponent(e)}${a ? `?${a}` : ""}`;
|
|
421
|
+
c("Fetching camera:", i);
|
|
487
422
|
try {
|
|
488
|
-
const
|
|
423
|
+
const u = await fetch(i, {
|
|
489
424
|
method: "GET",
|
|
490
425
|
headers: {
|
|
491
426
|
Accept: "application/json",
|
|
492
427
|
Authorization: `Bearer ${t.token}`
|
|
493
428
|
}
|
|
494
429
|
});
|
|
495
|
-
if (!
|
|
496
|
-
return
|
|
497
|
-
const
|
|
498
|
-
return c("Camera fetched:",
|
|
499
|
-
} catch (
|
|
500
|
-
return
|
|
430
|
+
if (!u.ok)
|
|
431
|
+
return L(u);
|
|
432
|
+
const d = await u.json();
|
|
433
|
+
return c("Camera fetched:", d.name), f(d);
|
|
434
|
+
} catch (u) {
|
|
435
|
+
return o("NETWORK_ERROR", `Failed to fetch camera: ${String(u)}`);
|
|
501
436
|
}
|
|
502
437
|
}
|
|
503
|
-
async function
|
|
438
|
+
async function L(e) {
|
|
504
439
|
const n = e.status;
|
|
505
440
|
let t;
|
|
506
441
|
try {
|
|
@@ -511,93 +446,113 @@ async function q(e) {
|
|
|
511
446
|
}
|
|
512
447
|
switch (n) {
|
|
513
448
|
case 401:
|
|
514
|
-
return
|
|
449
|
+
return o("AUTH_REQUIRED", `Authentication failed: ${t}`, n);
|
|
515
450
|
case 403:
|
|
516
|
-
return
|
|
451
|
+
return o("FORBIDDEN", `Access denied: ${t}`, n);
|
|
517
452
|
case 404:
|
|
518
|
-
return
|
|
453
|
+
return o("NOT_FOUND", `Not found: ${t}`, n);
|
|
519
454
|
case 429:
|
|
520
|
-
return
|
|
455
|
+
return o("RATE_LIMITED", `Rate limited: ${t}`, n);
|
|
521
456
|
default:
|
|
522
|
-
return
|
|
457
|
+
return o("API_ERROR", `API error: ${t}`, n);
|
|
523
458
|
}
|
|
524
459
|
}
|
|
525
|
-
function
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
refresh: m,
|
|
551
|
-
fetchNextPage: k,
|
|
552
|
-
fetchPrevPage: U,
|
|
553
|
-
setParams: A
|
|
554
|
-
};
|
|
460
|
+
async function Te(e) {
|
|
461
|
+
const n = h();
|
|
462
|
+
if (!n.isAuthenticated)
|
|
463
|
+
return o("AUTH_REQUIRED", "Authentication required");
|
|
464
|
+
if (!n.baseUrl)
|
|
465
|
+
return o("AUTH_REQUIRED", "Base URL not configured");
|
|
466
|
+
const t = new URLSearchParams();
|
|
467
|
+
e?.pageSize && t.append("pageSize", String(e.pageSize)), e?.pageToken && t.append("pageToken", e.pageToken), e?.include && e.include.length > 0 && t.append("include", e.include.join(",")), e?.sort && e.sort.length > 0 && t.append("sort", e.sort.join(",")), e?.locationId__in && e.locationId__in.length > 0 && t.append("locationId__in", e.locationId__in.join(",")), e?.tags__contains && e.tags__contains.length > 0 && t.append("tags__contains", e.tags__contains.join(",")), e?.tags__any && e.tags__any.length > 0 && t.append("tags__any", e.tags__any.join(",")), e?.name && t.append("name", e.name), e?.name__contains && t.append("name__contains", e.name__contains), e?.name__in && e.name__in.length > 0 && t.append("name__in", e.name__in.join(",")), e?.id__in && e.id__in.length > 0 && t.append("id__in", e.id__in.join(",")), e?.id__notIn && e.id__notIn.length > 0 && t.append("id__notIn", e.id__notIn.join(",")), e?.q && t.append("q", e.q), typeof e?.qRelevance__gte == "number" && t.append("qRelevance__gte", String(e.qRelevance__gte)), e?.status__in && e.status__in.length > 0 && t.append("status__in", e.status__in.join(",")), e?.status__ne && t.append("status__ne", e.status__ne);
|
|
468
|
+
const r = t.toString(), a = `${n.baseUrl}/api/v3.0/bridges${r ? `?${r}` : ""}`;
|
|
469
|
+
c("Fetching bridges:", a);
|
|
470
|
+
try {
|
|
471
|
+
const i = await fetch(a, {
|
|
472
|
+
method: "GET",
|
|
473
|
+
headers: {
|
|
474
|
+
Accept: "application/json",
|
|
475
|
+
Authorization: `Bearer ${n.token}`
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
if (!i.ok)
|
|
479
|
+
return b(i);
|
|
480
|
+
const u = await i.json();
|
|
481
|
+
return c("Bridges fetched:", u.results?.length ?? 0, "bridges"), f(u);
|
|
482
|
+
} catch (i) {
|
|
483
|
+
return o("NETWORK_ERROR", `Failed to fetch bridges: ${String(i)}`);
|
|
484
|
+
}
|
|
555
485
|
}
|
|
556
|
-
function
|
|
557
|
-
const t =
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
486
|
+
async function pe(e, n) {
|
|
487
|
+
const t = h();
|
|
488
|
+
if (!t.isAuthenticated)
|
|
489
|
+
return o("AUTH_REQUIRED", "Authentication required");
|
|
490
|
+
if (!t.baseUrl)
|
|
491
|
+
return o("AUTH_REQUIRED", "Base URL not configured");
|
|
492
|
+
if (!e)
|
|
493
|
+
return o("VALIDATION_ERROR", "Bridge ID is required");
|
|
494
|
+
const r = new URLSearchParams();
|
|
495
|
+
n?.include && n.include.length > 0 && r.append("include", n.include.join(","));
|
|
496
|
+
const a = r.toString(), i = `${t.baseUrl}/api/v3.0/bridges/${encodeURIComponent(e)}${a ? `?${a}` : ""}`;
|
|
497
|
+
c("Fetching bridge:", i);
|
|
498
|
+
try {
|
|
499
|
+
const u = await fetch(i, {
|
|
500
|
+
method: "GET",
|
|
501
|
+
headers: {
|
|
502
|
+
Accept: "application/json",
|
|
503
|
+
Authorization: `Bearer ${t.token}`
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
if (!u.ok)
|
|
507
|
+
return b(u);
|
|
508
|
+
const d = await u.json();
|
|
509
|
+
return c("Bridge fetched:", d.name), f(d);
|
|
510
|
+
} catch (u) {
|
|
511
|
+
return o("NETWORK_ERROR", `Failed to fetch bridge: ${String(u)}`);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
async function b(e) {
|
|
515
|
+
const n = e.status;
|
|
516
|
+
let t;
|
|
517
|
+
try {
|
|
518
|
+
const r = await e.json();
|
|
519
|
+
t = r.message ?? r.error ?? e.statusText;
|
|
520
|
+
} catch (r) {
|
|
521
|
+
c("Failed to parse error response JSON:", r), t = e.statusText || "Unknown error";
|
|
522
|
+
}
|
|
523
|
+
switch (n) {
|
|
524
|
+
case 401:
|
|
525
|
+
return o("AUTH_REQUIRED", `Authentication failed: ${t}`, n);
|
|
526
|
+
case 403:
|
|
527
|
+
return o("FORBIDDEN", `Access denied: ${t}`, n);
|
|
528
|
+
case 404:
|
|
529
|
+
return o("NOT_FOUND", `Not found: ${t}`, n);
|
|
530
|
+
case 429:
|
|
531
|
+
return o("RATE_LIMITED", `Rate limited: ${t}`, n);
|
|
532
|
+
default:
|
|
533
|
+
return o("API_ERROR", `API error: ${t}`, n);
|
|
534
|
+
}
|
|
577
535
|
}
|
|
578
536
|
export {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
537
|
+
o as failure,
|
|
538
|
+
x as getAccessToken,
|
|
539
|
+
oe as getAuthUrl,
|
|
540
|
+
pe as getBridge,
|
|
541
|
+
Te as getBridges,
|
|
542
|
+
Ee as getCamera,
|
|
543
|
+
Ie as getCameras,
|
|
544
|
+
Z as getClientId,
|
|
545
|
+
fe as getConfig,
|
|
546
|
+
he as getCurrentUser,
|
|
547
|
+
$ as getProxyUrl,
|
|
548
|
+
j as getRedirectUri,
|
|
549
|
+
Re as getUser,
|
|
550
|
+
ge as getUsers,
|
|
551
|
+
se as handleAuthCallback,
|
|
552
|
+
_e as initEenToolkit,
|
|
593
553
|
ie as refreshToken,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
ke as useCamera,
|
|
598
|
-
Se as useCameras,
|
|
599
|
-
pe as useCurrentUser,
|
|
600
|
-
Ue as useUser,
|
|
601
|
-
Ee as useUsers
|
|
554
|
+
ae as revokeToken,
|
|
555
|
+
f as success,
|
|
556
|
+
h as useAuthStore
|
|
602
557
|
};
|
|
603
558
|
//# sourceMappingURL=index.js.map
|