@uniai-fe/uds-templates 0.6.23 → 0.6.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-templates",
3
- "version": "0.6.23",
3
+ "version": "0.6.24",
4
4
  "description": "UNIAI Design System; UI Templates Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -8,7 +8,7 @@ import type {
8
8
  } from "../types";
9
9
 
10
10
  export const CCTV_RTC_TOKEN_FALLBACK_MAX_AGE_MS = 5 * 60 * 1000;
11
- export const CCTV_RTC_TOKEN_GC_TIME_MS = 60 * 60 * 1000;
11
+ export const CCTV_RTC_TOKEN_GC_TIME_MS = CCTV_RTC_TOKEN_FALLBACK_MAX_AGE_MS;
12
12
 
13
13
  export const getClientCctvCompanyList = async ({
14
14
  url,
@@ -50,6 +50,8 @@ export const GROUP_PRESET: API_Res_CctvCompanyGroup[] = [
50
50
  },
51
51
  ];
52
52
 
53
+ const CCTV_RTC_TOKEN_DEFAULT_TTL_SECONDS = 5 * 60;
54
+
53
55
  export function getMatchedGroupList(
54
56
  data: API_Res_CctvCompanyGroup[] = [],
55
57
  { code, method }: { code: string; method: string },
@@ -235,7 +237,12 @@ export async function getServerCctvToken({
235
237
  !reqBody.cam_id ||
236
238
  !password
237
239
  ) {
238
- nextAPILog("POST", routeUrl, query_url, { reqBody });
240
+ nextAPILog("POST", routeUrl, query_url, {
241
+ hasUsername: Boolean(reqBody?.username),
242
+ hasCompanyId: Boolean(reqBody?.company_id),
243
+ hasCamId: Boolean(reqBody?.cam_id),
244
+ hasPassword: Boolean(password),
245
+ });
239
246
  return {
240
247
  res: alternateResponse,
241
248
  ...API_OPTION,
@@ -261,11 +268,14 @@ export async function getServerCctvToken({
261
268
  password,
262
269
  action: "read",
263
270
  path,
264
- ttl_seconds: tokenPreset?.ttl_seconds ?? 3600,
271
+ ttl_seconds: tokenPreset?.ttl_seconds ?? CCTV_RTC_TOKEN_DEFAULT_TTL_SECONDS,
265
272
  kid: tokenPreset?.kid ?? "streaming-auth-1",
266
273
  };
267
274
 
268
- nextAPILog("POST", routeUrl, query_url, { bodyData });
275
+ nextAPILog("POST", routeUrl, query_url, {
276
+ hasRequiredParams: true,
277
+ ttlSeconds: bodyData.ttl_seconds,
278
+ });
269
279
 
270
280
  try {
271
281
  const res = await fetchWithBody<string, API_Res_CctvRtcToken>({
@@ -327,7 +327,7 @@ export interface API_Req_CctvRtcToken {
327
327
  * @property {string} password 사용자 계정 비밀번호
328
328
  * @property {string} action "read"
329
329
  * @property {string} path cam_id 맵핑 (ex. cam3)
330
- * @property {number} ttl_seconds 시간? (default 3600)
330
+ * @property {number} ttl_seconds 시간? (default 300)
331
331
  * @property {string} kid "streaming-auth-1"
332
332
  */
333
333
  export interface API_Req_CctvRtcTokenOrigin {
@@ -354,7 +354,7 @@ export interface API_Req_CctvRtcTokenOrigin {
354
354
  */
355
355
  path: string;
356
356
  /**
357
- * default) 3600
357
+ * default) 300
358
358
  */
359
359
  ttl_seconds: number;
360
360
  /**