action-lens 1.0.27 → 1.0.29
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/index.js +9 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ var app = (0, import_app.initializeApp)(firebaseConfig);
|
|
|
46
46
|
var db = (0, import_firestore.getFirestore)(app);
|
|
47
47
|
|
|
48
48
|
// src/player.ts
|
|
49
|
+
var import_packer = require("@rrweb/packer");
|
|
49
50
|
var ActionLensPlayer = class {
|
|
50
51
|
replayer = null;
|
|
51
52
|
overlayContainer = null;
|
|
@@ -109,6 +110,7 @@ var ActionLensPlayer = class {
|
|
|
109
110
|
}
|
|
110
111
|
targetDiv.classList.add("replayer-container");
|
|
111
112
|
this.replayer = new import_rrweb.Replayer(events, {
|
|
113
|
+
unpackFn: import_packer.unpack,
|
|
112
114
|
root: targetDiv,
|
|
113
115
|
UNSAFE_replayCanvas: false,
|
|
114
116
|
props: {
|
|
@@ -328,6 +330,7 @@ var ActionLensPlayer = class {
|
|
|
328
330
|
var import_uuid = require("uuid");
|
|
329
331
|
var import_rrweb2 = require("rrweb");
|
|
330
332
|
var import_firestore3 = require("firebase/firestore");
|
|
333
|
+
var import_packer2 = require("@rrweb/packer");
|
|
331
334
|
var ActionLensRc = class {
|
|
332
335
|
sessionId = (0, import_uuid.v4)();
|
|
333
336
|
stopFnForStore = null;
|
|
@@ -384,7 +387,7 @@ var ActionLensRc = class {
|
|
|
384
387
|
);
|
|
385
388
|
throw new Error("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u304C\u5B58\u5728\u3057\u307E\u305B\u3093");
|
|
386
389
|
}
|
|
387
|
-
if (!this.projectData
|
|
390
|
+
if (!this.projectData?.isActivate) {
|
|
388
391
|
console.warn(
|
|
389
392
|
"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306F\u975E\u30A2\u30AF\u30C6\u30A3\u30D6\u3067\u3059\u3002\u9332\u753B\u3092\u958B\u59CB\u3067\u304D\u307E\u305B\u3093\u3002"
|
|
390
393
|
);
|
|
@@ -408,15 +411,15 @@ var ActionLensRc = class {
|
|
|
408
411
|
{
|
|
409
412
|
...userMeta || {},
|
|
410
413
|
metaData,
|
|
411
|
-
id:
|
|
414
|
+
id: this.userId,
|
|
412
415
|
originalUserId: _userId,
|
|
413
416
|
type: "customer",
|
|
414
|
-
organizationId: projectData
|
|
417
|
+
organizationId: projectData?.organizationId || "",
|
|
415
418
|
projectIds: [projectId],
|
|
416
419
|
createAt: /* @__PURE__ */ new Date(),
|
|
417
420
|
updateAt: /* @__PURE__ */ new Date(),
|
|
418
|
-
createdBy:
|
|
419
|
-
updatedBy:
|
|
421
|
+
createdBy: this.userId,
|
|
422
|
+
updatedBy: this.userId,
|
|
420
423
|
hidden: false,
|
|
421
424
|
hiddenBy: ""
|
|
422
425
|
},
|
|
@@ -526,19 +529,7 @@ var ActionLensRc = class {
|
|
|
526
529
|
console.error("Firestore\u304C\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u305B\u3093");
|
|
527
530
|
return;
|
|
528
531
|
}
|
|
529
|
-
const consoleEvent = {
|
|
530
|
-
type: "custom-event",
|
|
531
|
-
data: {
|
|
532
|
-
type: "console",
|
|
533
|
-
method,
|
|
534
|
-
args: args.map(
|
|
535
|
-
(arg) => typeof arg === "object" ? JSON.stringify(arg) : arg
|
|
536
|
-
)
|
|
537
|
-
},
|
|
538
|
-
timestamp: Date.now()
|
|
539
|
-
};
|
|
540
532
|
import_rrweb2.record.addCustomEvent("console", { method: "log", args });
|
|
541
|
-
_updateActionRecordSession();
|
|
542
533
|
};
|
|
543
534
|
});
|
|
544
535
|
} catch (error) {
|
|
@@ -665,6 +656,7 @@ var ActionLensRc = class {
|
|
|
665
656
|
});
|
|
666
657
|
const _updateActionRecordSession = () => this.updateActionRecordSession();
|
|
667
658
|
this.stopFnForStore = (0, import_rrweb2.record)({
|
|
659
|
+
packFn: import_packer2.pack,
|
|
668
660
|
collectFonts: true,
|
|
669
661
|
inlineImages: false,
|
|
670
662
|
sampling: {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/player.ts","../src/utils/index.ts","../src/record.ts","../src/utils/date.ts"],"sourcesContent":["export * from \"./player\";\nexport * from \"./record\";\nimport \"./style.css\";\nexport * from \"./utils/date\";\n","import {\n doc,\n collection,\n setDoc,\n addDoc,\n where,\n query,\n getDocs,\n orderBy,\n Firestore,\n getDoc,\n} from \"firebase/firestore\";\nimport {\n ActionRecord,\n ActionRecordSession,\n Project,\n User,\n} from \"@ism-tech/actionlens-type\";\nimport { Replayer } from \"rrweb\";\nimport { db } from \"./utils\"; // dbのインポートパスを適宜変更してください\n\nexport class ActionLensPlayer {\n replayer: Replayer | null = null;\n overlayContainer: HTMLElement | null = null;\n playerStatus: \"playing\" | \"paused\" | \"stopped\" = \"stopped\";\n targetDivId: string;\n db: Firestore;\n prefix: string;\n userId: string | null = null;\n projectId: string | null = null;\n currentTime: number = 0; // 現在の再生時間\n totalTime: number = 0; // 再生中の時間を保持するための変数\n user: User | null = null; // ユーザーデータを保持するための変数\n private setIntervalId: NodeJS.Timeout | null = null; // setTimeoutのIDを保持するための変数\n\n constructor(\n userId: string,\n targetDivId: string,\n\n _db: Firestore = db,\n prefix: string = \"\"\n ) {\n // 初期化処理が必要であればここに記述\n this.userId = userId;\n this.targetDivId = targetDivId;\n this.db = _db;\n this.prefix = prefix;\n this.initialize(userId);\n }\n\n async initialize(userId: string) {\n const user = await getDoc(doc(this.db, `${this.prefix}user`, userId));\n if (!user.exists()) {\n throw new Error(`User with ID ${userId} does not exist.`);\n }\n const userData = user.data() as User;\n this.user = userData; // ユーザーデータを保持\n this.projectId = userData.projectIds?.[0] || null; // プロジェクトIDを取得\n if (!this.projectId) {\n throw new Error(`Project ID for user ${userId} does not exist.`);\n }\n }\n\n async replayRrwebSession(sessionId: string): Promise<void> {\n try {\n // 1. Firestoreからデータを取得\n\n const q = query(\n collection(this.db, `${this.prefix}ActionRecord`),\n where(\"sessionId\", \"==\", sessionId),\n orderBy(\"timeStamp\", \"asc\")\n );\n\n const querySnapshot = await getDocs(q);\n const events = querySnapshot.docs.map((doc) => {\n const data = doc.data() as ActionRecord;\n return JSON.parse(data.rrwebRecord);\n });\n console.log(\"events\", events);\n if (events.length === 0) {\n console.warn(\n `セッションID ${sessionId} のデータが見つかりませんでした。`\n );\n return;\n }\n\n const targetDiv = document.getElementById(this.targetDivId);\n if (!targetDiv) {\n throw new Error(\n `ID ${this.targetDivId} のdiv要素が見つかりませんでした。`\n );\n }\n\n // クラスを追加\n targetDiv.classList.add(\"replayer-container\");\n\n // 3. Replayerを初期化\n this.replayer = new Replayer(events, {\n root: targetDiv,\n UNSAFE_replayCanvas: false,\n props: {\n autoPlay: true,\n speed: 1,\n mouseTail: true,\n },\n className: \"_replayer-canvas\",\n } as any);\n\n // 4. カスタムイベントのリスナーを追加\n this.replayer.on(\"custom-event\", (event: any) => {\n console.log(\"Custom event:\", event);\n this.handleCustomEvent(event);\n });\n this.replayer.on(\"finish\", () => {\n console.log(\"Replay finished\");\n this.replayer?.pause(0);\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n this.endTimeoutTimeline();\n });\n const { totalTime } = this.replayer.getMetaData();\n this.totalTime = totalTime;\n\n // iframeのスタイルを調整\n const iframes = targetDiv.querySelectorAll(\"iframe\");\n iframes.forEach((iframe) => {\n (iframe as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (iframe as HTMLElement).style.position = \"absolute\";\n (iframe as HTMLElement).style.left = \"50%\";\n (iframe as HTMLElement).style.top = \"50%\";\n });\n // replayer-mouse-tailにposition: absolute; を追加\n const mouseTailElements = document.querySelectorAll(\n \".replayer-mouse-tail\"\n );\n mouseTailElements.forEach((element) => {\n (element as HTMLElement).style.position = \"absolute\";\n (element as HTMLElement).style.left = \"50%\";\n (element as HTMLElement).style.top = \"50%\";\n (element as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (element as HTMLElement).style.zIndex = \"1000\"; // z-indexを追加\n });\n\n // 5. 再生開始\n\n this.replayer.play();\n this.playerStatus = \"playing\";\n console.log(`セッションID ${sessionId} の再生を開始しました。`);\n this.setTimeoutTimeline();\n } catch (error) {\n console.error(\"再生エラー:\", error);\n throw error;\n }\n }\n\n // カスタムイベントを処理\n private handleCustomEvent(event: any) {\n if (!event.data || !event.data.type) return;\n\n const { timestamp } = event;\n const timeString = new Date(timestamp).toISOString();\n\n switch (event.data.type) {\n case \"console\":\n const { method, args } = event.data;\n this.displayEvent(\n `[${timeString}] Console ${method}: ${args.join(\", \")}`,\n \"console\"\n );\n\n break;\n case \"navigation\":\n const { url } = event.data;\n this.displayEvent(`[${timeString}] Navigation to ${url}`, \"navigation\");\n break;\n case \"performance\":\n const { name, entryType, duration } = event.data;\n this.displayEvent(\n `[${timeString}] Performance ${entryType}: ${name} (${duration}ms)`,\n \"performance\"\n );\n break;\n default:\n console.warn(\"不明なカスタムイベント:\", event.data.type);\n }\n }\n\n // イベントをオーバーレイに表示\n private displayEvent(message: string, eventType: string) {\n if (!this.overlayContainer) return;\n\n const eventDiv = document.createElement(\"div\");\n eventDiv.style.padding = \"5px\";\n eventDiv.style.borderBottom = \"1px solid rgba(255, 255, 255, 0.2)\";\n\n // イベントタイプに応じた色\n const colors: { [key: string]: string } = {\n console: \"#00cc00\",\n navigation: \"#3399ff\",\n performance: \"#ff9900\",\n };\n eventDiv.style.color = colors[eventType] || \"white\";\n\n eventDiv.innerText = message;\n this.overlayContainer.appendChild(eventDiv);\n\n // 最新のイベントが表示されるようスクロール\n this.overlayContainer.scrollTop = this.overlayContainer.scrollHeight;\n\n // 5秒後にフェードアウト\n setTimeout(() => {\n eventDiv.style.transition = \"opacity 1s\";\n eventDiv.style.opacity = \"0\";\n setTimeout(() => eventDiv.remove(), 1000);\n }, 5000);\n }\n setReplayTime(time: number) {\n if (this.replayer) {\n this.replayer.pause(time);\n this.currentTime = time;\n this.playerStatus = \"stopped\";\n }\n }\n\n setTimeoutTimeline() {\n this.setIntervalId = setInterval(() => {\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }, 10);\n }\n endTimeoutTimeline() {\n if (this.setIntervalId) {\n clearTimeout(this.setIntervalId);\n this.setIntervalId = null;\n }\n }\n\n // 再生を停止\n stopReplay() {\n this.endTimeoutTimeline();\n if (this.replayer) {\n this.replayer.pause();\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n restartReplay() {\n this.setTimeoutTimeline();\n if (this.replayer) {\n const offset = this.replayer.getCurrentTime();\n console.log(\"offset\", offset);\n this.replayer.play(offset);\n this.playerStatus = \"playing\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n getCurrentTime() {\n if (this.replayer) {\n return this.replayer.getCurrentTime();\n }\n return 0;\n }\n\n resetReplayer() {\n this.endTimeoutTimeline();\n this.playerStatus = \"stopped\";\n this.currentTime = 0;\n\n if (this.replayer) {\n this.replayer.pause();\n this.replayer.destroy();\n this.replayer = null;\n }\n if (this.overlayContainer) {\n this.overlayContainer.remove();\n this.overlayContainer = null;\n }\n }\n async fetchProjectList() {\n try {\n if (!this.userId) {\n console.warn(\"User ID is not initialized.\");\n return [];\n }\n if (!this.user) {\n this.user = (\n await getDoc(doc(this.db, `${this.prefix}user`, this.userId))\n ).data() as User;\n if (!this.user) {\n console.warn(`User with ID ${this.userId} does not exist.`);\n\n return [];\n }\n }\n const projectIds = this.user.projectIds || [];\n if (projectIds.length === 0) {\n console.warn(\"No project IDs found for the user.\");\n return [];\n }\n const promise = projectIds.flatMap(async (projectId) => {\n const projectDoc = await getDoc(\n doc(this.db, `${this.prefix}project`, projectId)\n );\n if (!projectDoc.exists()) {\n console.warn(`Project with ID ${projectId} does not exist.`);\n return null;\n }\n return projectDoc.data() as Project;\n });\n const projectPromises: (Project | null)[] = await Promise.all(promise);\n return projectPromises.filter((project) => project !== null);\n } catch (e) {\n console.error(\"プロジェクトリストの取得エラー:\", e);\n throw e;\n }\n }\n async fetchSessionList(projectId: string) {\n try {\n const q = query(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n where(\"projectId\", \"==\", projectId),\n orderBy(\"startTime\", \"desc\")\n );\n const usersStore: { [userId: string]: User } = {};\n\n const querySnapshot = await getDocs(q);\n const promise = querySnapshot.docs.map(async (_doc) => {\n const data = _doc.data() as ActionRecordSession;\n if (!usersStore[data.userId]) {\n usersStore[data.userId] = (\n await getDoc(doc(this.db, `${this.prefix}user`, data.userId))\n ).data() as User;\n }\n\n return { ...data, userData: usersStore[data.userId] };\n });\n const sessions: (ActionRecordSession & { userData: User })[] =\n await Promise.all(promise);\n console.log(sessions);\n\n return sessions;\n } catch (error) {\n console.error(\"セッションリストの取得エラー:\", error);\n throw error;\n }\n }\n}\n","import { initializeApp } from \"firebase/app\";\nimport { getFirestore } from \"firebase/firestore\";\n\nconst firebaseConfig = {\n apiKey: \"AIzaSyCxreoOZivnjFIh2mJ6WXjS3ieQ11wsDW8\",\n authDomain: \"actionlens-b14ae.firebaseapp.com\",\n projectId: \"actionlens-b14ae\",\n storageBucket: \"actionlens-b14ae.firebasestorage.app\",\n messagingSenderId: \"36086339210\",\n appId: \"1:36086339210:web:36e16e8778aadd8c58ff73\",\n};\n\n// Initialize Firebase\nconst app = initializeApp(firebaseConfig);\n\nexport const db = getFirestore(app);\n","import { v4 as uuidv4 } from \"uuid\";\nimport { record, Replayer } from \"rrweb\";\nimport { Firestore, doc, setDoc, collection, getDoc } from \"firebase/firestore\";\nimport { ActionRecord, Project, User } from \"@ism-tech/actionlens-type\";\nimport { db } from \"./utils/index\";\n\nexport class ActionLensRc {\n sessionId: string = uuidv4();\n stopFnForStore: any = null;\n userId: string | null = null;\n db: Firestore | null = null;\n prefix: string = \"\";\n userData: User | null = null;\n projectId: string | null = null;\n projectData: Project | null = null;\n organizationId: string | null = null;\n originalUserId: string | null = null; // 元のユーザーID(外部システムのIDなど)\n constructor(\n _userId: string | null,\n projectId: string | null,\n userMeta: { name: string; email: string } | null,\n metaData: Record<string, any> = {},\n _db: Firestore | null = null,\n prefix: string = \"\"\n ) {\n try {\n this.originalUserId = _userId; // 元のユーザーIDを保存\n console.log(\"ActionLensRc開始\");\n if (!projectId) {\n console.error(\"projectIdがNULLです\");\n throw new Error(\"projectIdがNULLです\");\n }\n if (!_userId) {\n console.error(\"userIdがNULLです\");\n throw new Error(\"userIdがNULLです\");\n }\n\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n getDoc(doc(collection(this.db, `${prefix}project`), projectId))\n .then(async (_doc) => {\n this.projectData = _doc.data() as Project;\n const projectData = this.projectData;\n this.organizationId = projectData?.organizationId || null;\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n if (!this.projectData) {\n await setDoc(\n doc(collection(this.db, `${prefix}project`), projectId),\n {\n id: projectId,\n name: projectId,\n organizationId: \"\",\n isActivate: false, // デフォルトでアクティブに設定\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: _userId,\n updatedBy: _userId,\n } as Project,\n { merge: true }\n );\n throw new Error(\"プロジェクトが存在しません\");\n }\n if (!this.projectData.isActivate) {\n console.warn(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n throw new Error(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n }\n this.userId = projectData.organizationId + \"-\" + _userId;\n getDoc(doc(collection(this.db, `${prefix}user`), this.userId))\n .then(async (_doc) => {\n if (!this.db) {\n console.error(\"Firestoreが初期化されていません\");\n throw new Error(\"Firestoreが初期化されていません\");\n }\n\n const userData = _doc.data() as User;\n if (!userData.id || !_doc.exists()) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n ...(userMeta || {}),\n metaData,\n id: projectData.organizationId + \"-\" + _userId,\n originalUserId: _userId,\n type: \"customer\",\n organizationId: projectData.organizationId,\n projectIds: [projectId],\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: _userId,\n updatedBy: _userId,\n hidden: false,\n hiddenBy: \"\",\n } as User,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error creating document: \", error);\n\n throw new Error(\"ユーザーの作成に失敗しました\");\n });\n this.userData = _doc.data() as User;\n } else {\n this.userData = _doc.data() as User;\n\n if (!this.userData?.projectIds?.includes(projectId)) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n projectIds: [\n ...(this.userData?.projectIds || []),\n projectId,\n ],\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\n \"ユーザーのプロジェクトIDの更新に失敗しました\"\n );\n });\n }\n\n if (\n this.userData?.organizationId !== projectData.organizationId\n ) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n organizationId: projectData.organizationId\n ? projectData.organizationId\n : this.userData?.organizationId,\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\"ユーザーの組織IDの更新に失敗しました\");\n });\n }\n }\n\n this.prefix = prefix;\n this.projectId = projectId;\n\n this.startRrwebRecordingForStore();\n // this.startConsoleRecording();\n // this.startTimelineRecording();\n })\n .catch((error) => {\n console.error(\"ユーザーデータの取得エラー:\", error);\n throw new Error(\"ユーザーデータの取得に失敗しました\");\n });\n })\n .catch((error) => {\n console.error(\"プロジェクトデータの取得エラー:\", error);\n throw new Error(\"プロジェクトデータの取得に失敗しました\");\n });\n } catch (error) {\n console.error(\"初期化エラー:\", error);\n throw error;\n }\n }\n\n // コンソールログをキャプチャ\n startConsoleRecording() {\n try {\n const originalConsole = { ...console };\n const consoleMethods = [\n \"log\",\n \"info\",\n \"warn\",\n \"error\",\n \"debug\",\n \"trace\",\n \"assert\",\n \"clear\",\n \"context\",\n \"count\",\n \"countReset\",\n \"createTask\",\n \"debug\",\n \"dir\",\n \"dirxml\",\n \"error\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n\n \"memory\",\n \"profile\",\n \"profileEnd\",\n \"table\",\n \"time\",\n \"timeEnd\",\n \"timeLog\",\n \"timeStamp\",\n ] as const;\n\n const db = this.db;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n consoleMethods.forEach((method) => {\n // 型安全なオーバーライド\n (console as any)[method] = (...args: any[]) => {\n // 元のメソッドを呼び出し\n (originalConsole as any)[method](...args);\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n const consoleEvent = {\n type: \"custom-event\",\n data: {\n type: \"console\",\n method,\n\n args: args.map((arg) =>\n typeof arg === \"object\" ? JSON.stringify(arg) : arg\n ),\n },\n timestamp: Date.now(),\n };\n\n record.addCustomEvent(\"console\", { method: \"log\", args });\n\n _updateActionRecordSession();\n };\n });\n } catch (error) {\n console.error(\"コンソール録画エラー:\", error);\n throw error;\n }\n }\n\n // タイムライン(ナビゲーションとパフォーマンス)をキャプチャ\n startTimelineRecording() {\n try {\n const userId = this.userId || \"unknown\";\n const sessionId = this.sessionId;\n const db = this.db;\n const prefix = this.prefix;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n // ナビゲーション履歴(popstateイベント)\n window.addEventListener(\"popstate\", (event) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n const navigationEvent = {\n type: \"custom\",\n data: {\n type: \"navigation\",\n url: window.location.href,\n state: event.state,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n type: \"navigation\",\n originalUserId: this.originalUserId ?? \"\",\n sessionId,\n rrwebRecord: JSON.stringify(navigationEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving navigation event: \", error);\n });\n _updateActionRecordSession();\n });\n\n // パフォーマンスエントリ\n if (window.performance) {\n const observer = new PerformanceObserver((list) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n for (const entry of list.getEntries()) {\n const performanceEvent = {\n type: \"custom\",\n data: {\n type: \"performance\",\n name: entry.name,\n entryType: entry.entryType,\n startTime: entry.startTime,\n duration: entry.duration,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId: this.originalUserId ?? \"\",\n type: \"performance\",\n sessionId,\n rrwebRecord: JSON.stringify(performanceEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving performance event: \", error);\n });\n }\n });\n\n observer.observe({ entryTypes: [\"resource\", \"navigation\", \"paint\"] });\n }\n } catch (error) {\n console.error(\"タイムライン録画エラー:\", error);\n throw error;\n }\n }\n\n startRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) return;\n const _sessionId = this.sessionId;\n const userId = this.userId || \"unknown\";\n const originalUserId = this.originalUserId || \"\";\n const db = this.db;\n const prefix = this.prefix;\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n // rrwebの録画を開始\n // このセッションの開始時間を記録\n const ActionRecordSessionRef = doc(\n collection(db, `${prefix}ActionRecordSession`),\n _sessionId\n );\n setDoc(ActionRecordSessionRef, {\n id: _sessionId,\n\n startTime: new Date(),\n endTime: null,\n userId,\n projectId: this.projectId || null,\n organizationId: this.projectData?.organizationId || null,\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: userId,\n updatedBy: userId,\n });\n // rrwebの録画を開始 済み\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n this.stopFnForStore = record({\n collectFonts: true,\n inlineImages: false,\n sampling: {\n canvas: 500,\n mousemove: 500,\n mousemoveCallback: 500,\n },\n emit(event) {\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId,\n type: \"rrweb\",\n sessionId: _sessionId,\n rrwebRecord: JSON.stringify(event),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving rrweb event: \", error);\n });\n _updateActionRecordSession();\n },\n recordCanvas: false,\n });\n } catch (error) {\n console.error(\"rrweb録画エラー:\", error);\n throw error;\n }\n }\n\n stopRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) {\n this.stopFnForStore();\n this.stopFnForStore = null;\n }\n } catch (error) {\n console.error(\"rrweb録画停止エラー:\", error);\n throw error;\n }\n }\n updateActionRecordSession() {\n try {\n if (!this.db || !this.sessionId || !this.userId) {\n console.error(\n \"Firestoreが初期化されていません、またはsessionId、userIdが設定されていません\"\n );\n return;\n }\n const ActionRecordSessionRef = doc(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n this.sessionId\n );\n setDoc(\n ActionRecordSessionRef,\n {\n endTime: new Date(),\n updateAt: new Date(),\n updatedBy: this.userId,\n },\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating ActionRecordSession: \", error);\n });\n } catch (error) {\n console.error(\"ActionRecordSession更新エラー:\", error);\n throw error;\n }\n }\n}\n","import { Timestamp } from \"firebase/firestore\";\n// import { copy } from \"copy-anything\";\n/** Timestampの時はDateへの変更 */\nexport function convertTimestampToDate(\n timestamp: Timestamp | Date | null\n): Date | null {\n if (!timestamp) return null;\n /** string の場合(本来は来ないはずなのに) */\n if (typeof timestamp === \"string\") {\n const _string = new Date(timestamp);\n // console.log('convertTimestampToDate-string:', _string)\n if (isNaN(_string.getTime())) {\n return null;\n }\n return _string;\n }\n if (\"_seconds\" in timestamp && timestamp?._seconds) {\n return new Date(Number(timestamp._seconds) * 1000);\n }\n /** timestampの場合 */\n if (timestamp instanceof Timestamp) {\n const _timestamp = timestamp.toDate();\n // console.log('convertTimestampToDate-timestamp:', _timestamp)\n return _timestamp;\n }\n /** Dateの場合 */\n if (timestamp instanceof Date) {\n const _date = timestamp;\n // console.log('convertTimestampToDate-date:', _date)\n return _date;\n }\n // console.log('convertTimestampToDate-type:', typeof timestamp)\n // console.log('convertTimestampToDate-else:', timestamp)\n return timestamp;\n}\n\n/**\n * 時間を文字に変換\n * @param payload Date | Timestamp | string | null\n * @param format YYYY/MM/DD hh:mm:ss\n */\nexport const dateFormat = (\n payload:\n | Date\n | Timestamp\n | string\n | number\n | null\n | undefined\n | {\n _seconds: number;\n _nanoseconds: number;\n },\n format: string = \"YYYY/MM/DD\"\n) => {\n let date = payload;\n if (!date) return \"\";\n if (typeof date === \"string\") {\n if (date.length === 8 && /^\\d{8}$/.test(date)) {\n // 'YYYYMMDD'形式の対応\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(4, 6)) - 1; // 月は0始まり\n const strDate = Number(date.slice(6, 8));\n date = new Date(strYear, strMonth, strDate);\n } else if (!/^(\\d{4}).([0-1]\\d).([0-3]\\d).*$/.test(date)) {\n return \"error\";\n } else {\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(5, 7)) - 1;\n const strDate = Number(date.slice(8, 10));\n date = new Date(strYear, strMonth, strDate);\n }\n }\n if (typeof date === \"number\") {\n date = new Date(date);\n }\n if (isTimestamp(date)) {\n date = date.toDate();\n }\n if (date.hasOwnProperty(\"_seconds\") && date.hasOwnProperty(\"_nanoseconds\")) {\n date = new Date(\n // @ts-ignore\n date._seconds * 1000 + Math.floor(date._nanoseconds / 1000000)\n );\n }\n\n date = new Date(date as Date);\n\n format = format.replace(/YYYY/g, date.getFullYear().toString());\n format = format.replace(/MM/g, (\"0\" + (date.getMonth() + 1)).slice(-2));\n format = format.replace(/DD/g, (\"0\" + date.getDate()).slice(-2));\n format = format.replace(/hh/g, (\"0\" + date.getHours()).slice(-2));\n format = format.replace(/mm/g, (\"0\" + date.getMinutes()).slice(-2));\n format = format.replace(/ss/g, (\"0\" + date.getSeconds()).slice(-2));\n format = format.replace(/SSS/g, (\"00\" + date.getMilliseconds()).slice(-3));\n format = format.replace(\n /aaa/g,\n [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"][date.getDay()]\n );\n // if (format.includes('-')) {\n // console.log('「-」includes warning')\n // }\n\n return format;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isTimestamp = (payload: any): payload is Timestamp => {\n return payload.toDate !== undefined;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,oBAWO;AAOP,mBAAyB;;;AClBzB,iBAA8B;AAC9B,uBAA6B;AAE7B,IAAM,iBAAiB;AAAA,EACrB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,OAAO;AACT;AAGA,IAAM,UAAM,0BAAc,cAAc;AAEjC,IAAM,SAAK,+BAAa,GAAG;;;ADM3B,IAAM,mBAAN,MAAuB;AAAA,EAC5B,WAA4B;AAAA,EAC5B,mBAAuC;AAAA,EACvC,eAAiD;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAwB;AAAA,EACxB,YAA2B;AAAA,EAC3B,cAAsB;AAAA;AAAA,EACtB,YAAoB;AAAA;AAAA,EACpB,OAAoB;AAAA;AAAA,EACZ,gBAAuC;AAAA;AAAA,EAE/C,YACE,QACA,aAE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AO,IAAI,KAAK,SAAS,UAAU,OAAO;AAAA,IAC5C;AAAA,EACF;AACA,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,IAAI,KAAK,IAAI;AAAA,EACtB;AACA,MAAI,YAAY,IAAI,GAAG;AACrB,WAAO,KAAK,OAAO;AAAA,EACrB;AACA,MAAI,KAAK,eAAe,UAAU,KAAK,KAAK,eAAe,cAAc,GAAG;AAC1E,WAAO,IAAI;AAAA;AAAA,MAET,KAAK,WAAW,MAAO,KAAK,MAAM,KAAK,eAAe,GAAO;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO,IAAI,KAAK,IAAY;AAE5B,WAAS,OAAO,QAAQ,SAAS,KAAK,YAAY,EAAE,SAAS,CAAC;AAC9D,WAAS,OAAO,QAAQ,QAAQ,OAAO,KAAK,SAAS,IAAI,IAAI,MAAM,EAAE,CAAC;AACtE,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,QAAQ,GAAG,MAAM,EAAE,CAAC;AAC/D,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,SAAS,GAAG,MAAM,EAAE,CAAC;AAChE,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,WAAW,GAAG,MAAM,EAAE,CAAC;AAClE,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,WAAW,GAAG,MAAM,EAAE,CAAC;AAClE,WAAS,OAAO,QAAQ,SAAS,OAAO,KAAK,gBAAgB,GAAG,MAAM,EAAE,CAAC;AACzE,WAAS,OAAO;AAAA,IACd;AAAA,IACA,CAAC,UAAK,UAAK,UAAK,UAAK,UAAK,UAAK,QAAG,EAAE,KAAK,OAAO,CAAC;AAAA,EACnD;AAKA,SAAO;AACT;AAGA,IAAM,cAAc,CAAC,YAAuC;AAC1D,SAAO,QAAQ,WAAW;AAC5B;","names":["import_firestore","doc","import_rrweb","import_firestore","uuidv4","_doc","db","record","import_firestore"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/player.ts","../src/utils/index.ts","../src/record.ts","../src/utils/date.ts"],"sourcesContent":["export * from \"./player\";\nexport * from \"./record\";\nimport \"./style.css\";\nexport * from \"./utils/date\";\n","import {\n doc,\n collection,\n setDoc,\n addDoc,\n where,\n query,\n getDocs,\n orderBy,\n Firestore,\n getDoc,\n} from \"firebase/firestore\";\nimport {\n ActionRecord,\n ActionRecordSession,\n Project,\n User,\n} from \"@ism-tech/actionlens-type\";\nimport { Replayer } from \"rrweb\";\nimport { db } from \"./utils\"; // dbのインポートパスを適宜変更してください\n\nimport { unpack } from \"@rrweb/packer\";\nexport class ActionLensPlayer {\n replayer: Replayer | null = null;\n overlayContainer: HTMLElement | null = null;\n playerStatus: \"playing\" | \"paused\" | \"stopped\" = \"stopped\";\n targetDivId: string;\n db: Firestore;\n prefix: string;\n userId: string | null = null;\n projectId: string | null = null;\n currentTime: number = 0; // 現在の再生時間\n totalTime: number = 0; // 再生中の時間を保持するための変数\n user: User | null = null; // ユーザーデータを保持するための変数\n private setIntervalId: NodeJS.Timeout | null = null; // setTimeoutのIDを保持するための変数\n\n constructor(\n userId: string,\n targetDivId: string,\n\n _db: Firestore = db,\n prefix: string = \"\"\n ) {\n // 初期化処理が必要であればここに記述\n this.userId = userId;\n this.targetDivId = targetDivId;\n this.db = _db;\n this.prefix = prefix;\n this.initialize(userId);\n }\n\n async initialize(userId: string) {\n const user = await getDoc(doc(this.db, `${this.prefix}user`, userId));\n if (!user.exists()) {\n throw new Error(`User with ID ${userId} does not exist.`);\n }\n const userData = user.data() as User;\n this.user = userData; // ユーザーデータを保持\n this.projectId = userData.projectIds?.[0] || null; // プロジェクトIDを取得\n if (!this.projectId) {\n throw new Error(`Project ID for user ${userId} does not exist.`);\n }\n }\n\n async replayRrwebSession(sessionId: string): Promise<void> {\n try {\n // 1. Firestoreからデータを取得\n\n const q = query(\n collection(this.db, `${this.prefix}ActionRecord`),\n where(\"sessionId\", \"==\", sessionId),\n orderBy(\"timeStamp\", \"asc\")\n );\n\n const querySnapshot = await getDocs(q);\n const events = querySnapshot.docs.map((doc) => {\n const data = doc.data() as ActionRecord;\n return JSON.parse(data.rrwebRecord);\n });\n console.log(\"events\", events);\n if (events.length === 0) {\n console.warn(\n `セッションID ${sessionId} のデータが見つかりませんでした。`\n );\n return;\n }\n\n const targetDiv = document.getElementById(this.targetDivId);\n if (!targetDiv) {\n throw new Error(\n `ID ${this.targetDivId} のdiv要素が見つかりませんでした。`\n );\n }\n\n // クラスを追加\n targetDiv.classList.add(\"replayer-container\");\n\n // 3. Replayerを初期化\n this.replayer = new Replayer(events, {\n unpackFn: unpack,\n root: targetDiv,\n UNSAFE_replayCanvas: false,\n props: {\n autoPlay: true,\n speed: 1,\n mouseTail: true,\n },\n className: \"_replayer-canvas\",\n } as any);\n\n // 4. カスタムイベントのリスナーを追加\n this.replayer.on(\"custom-event\", (event: any) => {\n console.log(\"Custom event:\", event);\n this.handleCustomEvent(event);\n });\n this.replayer.on(\"finish\", () => {\n console.log(\"Replay finished\");\n this.replayer?.pause(0);\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n this.endTimeoutTimeline();\n });\n const { totalTime } = this.replayer.getMetaData();\n this.totalTime = totalTime;\n\n // iframeのスタイルを調整\n const iframes = targetDiv.querySelectorAll(\"iframe\");\n iframes.forEach((iframe) => {\n (iframe as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (iframe as HTMLElement).style.position = \"absolute\";\n (iframe as HTMLElement).style.left = \"50%\";\n (iframe as HTMLElement).style.top = \"50%\";\n });\n // replayer-mouse-tailにposition: absolute; を追加\n const mouseTailElements = document.querySelectorAll(\n \".replayer-mouse-tail\"\n );\n mouseTailElements.forEach((element) => {\n (element as HTMLElement).style.position = \"absolute\";\n (element as HTMLElement).style.left = \"50%\";\n (element as HTMLElement).style.top = \"50%\";\n (element as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (element as HTMLElement).style.zIndex = \"1000\"; // z-indexを追加\n });\n\n // 5. 再生開始\n\n this.replayer.play();\n this.playerStatus = \"playing\";\n console.log(`セッションID ${sessionId} の再生を開始しました。`);\n this.setTimeoutTimeline();\n } catch (error) {\n console.error(\"再生エラー:\", error);\n throw error;\n }\n }\n\n // カスタムイベントを処理\n private handleCustomEvent(event: any) {\n if (!event.data || !event.data.type) return;\n\n const { timestamp } = event;\n const timeString = new Date(timestamp).toISOString();\n\n switch (event.data.type) {\n case \"console\":\n const { method, args } = event.data;\n this.displayEvent(\n `[${timeString}] Console ${method}: ${args.join(\", \")}`,\n \"console\"\n );\n\n break;\n case \"navigation\":\n const { url } = event.data;\n this.displayEvent(`[${timeString}] Navigation to ${url}`, \"navigation\");\n break;\n case \"performance\":\n const { name, entryType, duration } = event.data;\n this.displayEvent(\n `[${timeString}] Performance ${entryType}: ${name} (${duration}ms)`,\n \"performance\"\n );\n break;\n default:\n console.warn(\"不明なカスタムイベント:\", event.data.type);\n }\n }\n\n // イベントをオーバーレイに表示\n private displayEvent(message: string, eventType: string) {\n if (!this.overlayContainer) return;\n\n const eventDiv = document.createElement(\"div\");\n eventDiv.style.padding = \"5px\";\n eventDiv.style.borderBottom = \"1px solid rgba(255, 255, 255, 0.2)\";\n\n // イベントタイプに応じた色\n const colors: { [key: string]: string } = {\n console: \"#00cc00\",\n navigation: \"#3399ff\",\n performance: \"#ff9900\",\n };\n eventDiv.style.color = colors[eventType] || \"white\";\n\n eventDiv.innerText = message;\n this.overlayContainer.appendChild(eventDiv);\n\n // 最新のイベントが表示されるようスクロール\n this.overlayContainer.scrollTop = this.overlayContainer.scrollHeight;\n\n // 5秒後にフェードアウト\n setTimeout(() => {\n eventDiv.style.transition = \"opacity 1s\";\n eventDiv.style.opacity = \"0\";\n setTimeout(() => eventDiv.remove(), 1000);\n }, 5000);\n }\n setReplayTime(time: number) {\n if (this.replayer) {\n this.replayer.pause(time);\n this.currentTime = time;\n this.playerStatus = \"stopped\";\n }\n }\n\n setTimeoutTimeline() {\n this.setIntervalId = setInterval(() => {\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }, 10);\n }\n endTimeoutTimeline() {\n if (this.setIntervalId) {\n clearTimeout(this.setIntervalId);\n this.setIntervalId = null;\n }\n }\n\n // 再生を停止\n stopReplay() {\n this.endTimeoutTimeline();\n if (this.replayer) {\n this.replayer.pause();\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n restartReplay() {\n this.setTimeoutTimeline();\n if (this.replayer) {\n const offset = this.replayer.getCurrentTime();\n console.log(\"offset\", offset);\n this.replayer.play(offset);\n this.playerStatus = \"playing\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n getCurrentTime() {\n if (this.replayer) {\n return this.replayer.getCurrentTime();\n }\n return 0;\n }\n\n resetReplayer() {\n this.endTimeoutTimeline();\n this.playerStatus = \"stopped\";\n this.currentTime = 0;\n\n if (this.replayer) {\n this.replayer.pause();\n this.replayer.destroy();\n this.replayer = null;\n }\n if (this.overlayContainer) {\n this.overlayContainer.remove();\n this.overlayContainer = null;\n }\n }\n async fetchProjectList() {\n try {\n if (!this.userId) {\n console.warn(\"User ID is not initialized.\");\n return [];\n }\n if (!this.user) {\n this.user = (\n await getDoc(doc(this.db, `${this.prefix}user`, this.userId))\n ).data() as User;\n if (!this.user) {\n console.warn(`User with ID ${this.userId} does not exist.`);\n\n return [];\n }\n }\n const projectIds = this.user.projectIds || [];\n if (projectIds.length === 0) {\n console.warn(\"No project IDs found for the user.\");\n return [];\n }\n const promise = projectIds.flatMap(async (projectId) => {\n const projectDoc = await getDoc(\n doc(this.db, `${this.prefix}project`, projectId)\n );\n if (!projectDoc.exists()) {\n console.warn(`Project with ID ${projectId} does not exist.`);\n return null;\n }\n return projectDoc.data() as Project;\n });\n const projectPromises: (Project | null)[] = await Promise.all(promise);\n return projectPromises.filter((project) => project !== null);\n } catch (e) {\n console.error(\"プロジェクトリストの取得エラー:\", e);\n throw e;\n }\n }\n async fetchSessionList(projectId: string) {\n try {\n const q = query(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n where(\"projectId\", \"==\", projectId),\n orderBy(\"startTime\", \"desc\")\n );\n const usersStore: { [userId: string]: User } = {};\n\n const querySnapshot = await getDocs(q);\n const promise = querySnapshot.docs.map(async (_doc) => {\n const data = _doc.data() as ActionRecordSession;\n if (!usersStore[data.userId]) {\n usersStore[data.userId] = (\n await getDoc(doc(this.db, `${this.prefix}user`, data.userId))\n ).data() as User;\n }\n\n return { ...data, userData: usersStore[data.userId] };\n });\n const sessions: (ActionRecordSession & { userData: User })[] =\n await Promise.all(promise);\n console.log(sessions);\n\n return sessions;\n } catch (error) {\n console.error(\"セッションリストの取得エラー:\", error);\n throw error;\n }\n }\n}\n","import { initializeApp } from \"firebase/app\";\nimport { getFirestore } from \"firebase/firestore\";\n\nconst firebaseConfig = {\n apiKey: \"AIzaSyCxreoOZivnjFIh2mJ6WXjS3ieQ11wsDW8\",\n authDomain: \"actionlens-b14ae.firebaseapp.com\",\n projectId: \"actionlens-b14ae\",\n storageBucket: \"actionlens-b14ae.firebasestorage.app\",\n messagingSenderId: \"36086339210\",\n appId: \"1:36086339210:web:36e16e8778aadd8c58ff73\",\n};\n\n// Initialize Firebase\nconst app = initializeApp(firebaseConfig);\n\nexport const db = getFirestore(app);\n","import { v4 as uuidv4 } from \"uuid\";\nimport { record, Replayer } from \"rrweb\";\nimport { Firestore, doc, setDoc, collection, getDoc } from \"firebase/firestore\";\nimport { ActionRecord, Project, User } from \"@ism-tech/actionlens-type\";\nimport { db } from \"./utils/index\";\nimport { pack } from \"@rrweb/packer\";\nexport class ActionLensRc {\n sessionId: string = uuidv4();\n stopFnForStore: any = null;\n userId: string | null = null;\n db: Firestore | null = null;\n prefix: string = \"\";\n userData: User | null = null;\n projectId: string | null = null;\n projectData: Project | null = null;\n organizationId: string | null = null;\n originalUserId: string | null = null; // 元のユーザーID(外部システムのIDなど)\n constructor(\n _userId: string | null,\n projectId: string | null,\n userMeta: { name: string; email: string } | null,\n metaData: Record<string, any> = {},\n _db: Firestore | null = null,\n prefix: string = \"\"\n ) {\n try {\n this.originalUserId = _userId; // 元のユーザーIDを保存\n console.log(\"ActionLensRc開始\");\n if (!projectId) {\n console.error(\"projectIdがNULLです\");\n throw new Error(\"projectIdがNULLです\");\n }\n if (!_userId) {\n console.error(\"userIdがNULLです\");\n throw new Error(\"userIdがNULLです\");\n }\n\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n getDoc(doc(collection(this.db, `${prefix}project`), projectId))\n .then(async (_doc) => {\n this.projectData = _doc.data() as Project;\n const projectData = this.projectData;\n this.organizationId = projectData?.organizationId || null;\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n if (!this.projectData) {\n await setDoc(\n doc(collection(this.db, `${prefix}project`), projectId),\n {\n id: projectId,\n name: projectId,\n organizationId: \"\",\n isActivate: false, // デフォルトでアクティブに設定\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: _userId,\n updatedBy: _userId,\n } as Project,\n { merge: true }\n );\n throw new Error(\"プロジェクトが存在しません\");\n }\n if (!this.projectData?.isActivate) {\n console.warn(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n throw new Error(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n }\n this.userId = projectData.organizationId + \"-\" + _userId;\n getDoc(doc(collection(this.db, `${prefix}user`), this.userId))\n .then(async (_doc) => {\n if (!this.db) {\n console.error(\"Firestoreが初期化されていません\");\n throw new Error(\"Firestoreが初期化されていません\");\n }\n\n const userData = _doc.data() as User;\n if (!userData.id || !_doc.exists()) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n ...(userMeta || {}),\n metaData,\n id: this.userId,\n originalUserId: _userId,\n type: \"customer\",\n organizationId: projectData?.organizationId || \"\",\n projectIds: [projectId],\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: this.userId,\n updatedBy: this.userId,\n hidden: false,\n hiddenBy: \"\",\n } as User,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error creating document: \", error);\n\n throw new Error(\"ユーザーの作成に失敗しました\");\n });\n this.userData = _doc.data() as User;\n } else {\n this.userData = _doc.data() as User;\n\n if (!this.userData?.projectIds?.includes(projectId)) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n projectIds: [\n ...(this.userData?.projectIds || []),\n projectId,\n ],\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\n \"ユーザーのプロジェクトIDの更新に失敗しました\"\n );\n });\n }\n\n if (\n this.userData?.organizationId !== projectData.organizationId\n ) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n organizationId: projectData.organizationId\n ? projectData.organizationId\n : this.userData?.organizationId,\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\"ユーザーの組織IDの更新に失敗しました\");\n });\n }\n }\n\n this.prefix = prefix;\n this.projectId = projectId;\n\n this.startRrwebRecordingForStore();\n // this.startConsoleRecording();\n // this.startTimelineRecording();\n })\n .catch((error) => {\n console.error(\"ユーザーデータの取得エラー:\", error);\n throw new Error(\"ユーザーデータの取得に失敗しました\");\n });\n })\n .catch((error) => {\n console.error(\"プロジェクトデータの取得エラー:\", error);\n throw new Error(\"プロジェクトデータの取得に失敗しました\");\n });\n } catch (error) {\n console.error(\"初期化エラー:\", error);\n throw error;\n }\n }\n\n // コンソールログをキャプチャ\n startConsoleRecording() {\n try {\n const originalConsole = { ...console };\n const consoleMethods = [\n \"log\",\n \"info\",\n \"warn\",\n \"error\",\n \"debug\",\n \"trace\",\n \"assert\",\n \"clear\",\n \"context\",\n \"count\",\n \"countReset\",\n \"createTask\",\n \"debug\",\n \"dir\",\n \"dirxml\",\n \"error\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n\n \"memory\",\n \"profile\",\n \"profileEnd\",\n \"table\",\n \"time\",\n \"timeEnd\",\n \"timeLog\",\n \"timeStamp\",\n ] as const;\n\n const db = this.db;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n consoleMethods.forEach((method) => {\n // 型安全なオーバーライド\n (console as any)[method] = (...args: any[]) => {\n // 元のメソッドを呼び出し\n (originalConsole as any)[method](...args);\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n record.addCustomEvent(\"console\", { method: \"log\", args });\n };\n });\n } catch (error) {\n console.error(\"コンソール録画エラー:\", error);\n throw error;\n }\n }\n\n // タイムライン(ナビゲーションとパフォーマンス)をキャプチャ\n startTimelineRecording() {\n try {\n const userId = this.userId || \"unknown\";\n const sessionId = this.sessionId;\n const db = this.db;\n const prefix = this.prefix;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n // ナビゲーション履歴(popstateイベント)\n window.addEventListener(\"popstate\", (event) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n const navigationEvent = {\n type: \"custom\",\n data: {\n type: \"navigation\",\n url: window.location.href,\n state: event.state,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n type: \"navigation\",\n originalUserId: this.originalUserId ?? \"\",\n sessionId,\n rrwebRecord: JSON.stringify(navigationEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving navigation event: \", error);\n });\n _updateActionRecordSession();\n });\n\n // パフォーマンスエントリ\n if (window.performance) {\n const observer = new PerformanceObserver((list) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n for (const entry of list.getEntries()) {\n const performanceEvent = {\n type: \"custom\",\n data: {\n type: \"performance\",\n name: entry.name,\n entryType: entry.entryType,\n startTime: entry.startTime,\n duration: entry.duration,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId: this.originalUserId ?? \"\",\n type: \"performance\",\n sessionId,\n rrwebRecord: JSON.stringify(performanceEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving performance event: \", error);\n });\n }\n });\n\n observer.observe({ entryTypes: [\"resource\", \"navigation\", \"paint\"] });\n }\n } catch (error) {\n console.error(\"タイムライン録画エラー:\", error);\n throw error;\n }\n }\n\n startRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) return;\n const _sessionId = this.sessionId;\n const userId = this.userId || \"unknown\";\n const originalUserId = this.originalUserId || \"\";\n const db = this.db;\n const prefix = this.prefix;\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n // rrwebの録画を開始\n // このセッションの開始時間を記録\n const ActionRecordSessionRef = doc(\n collection(db, `${prefix}ActionRecordSession`),\n _sessionId\n );\n setDoc(ActionRecordSessionRef, {\n id: _sessionId,\n startTime: new Date(),\n endTime: null,\n userId,\n projectId: this.projectId || null,\n organizationId: this.projectData?.organizationId || null,\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: userId,\n updatedBy: userId,\n });\n // rrwebの録画を開始 済み\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n this.stopFnForStore = record({\n packFn: pack,\n collectFonts: true,\n inlineImages: false,\n sampling: {\n canvas: 500,\n mousemove: 500,\n mousemoveCallback: 500,\n },\n emit(event) {\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId,\n type: \"rrweb\",\n sessionId: _sessionId,\n rrwebRecord: JSON.stringify(event),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving rrweb event: \", error);\n });\n _updateActionRecordSession();\n },\n recordCanvas: false,\n });\n } catch (error) {\n console.error(\"rrweb録画エラー:\", error);\n throw error;\n }\n }\n\n stopRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) {\n this.stopFnForStore();\n this.stopFnForStore = null;\n }\n } catch (error) {\n console.error(\"rrweb録画停止エラー:\", error);\n throw error;\n }\n }\n updateActionRecordSession() {\n try {\n if (!this.db || !this.sessionId || !this.userId) {\n console.error(\n \"Firestoreが初期化されていません、またはsessionId、userIdが設定されていません\"\n );\n return;\n }\n const ActionRecordSessionRef = doc(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n this.sessionId\n );\n setDoc(\n ActionRecordSessionRef,\n {\n endTime: new Date(),\n updateAt: new Date(),\n updatedBy: this.userId,\n },\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating ActionRecordSession: \", error);\n });\n } catch (error) {\n console.error(\"ActionRecordSession更新エラー:\", error);\n throw error;\n }\n }\n}\n","import { Timestamp } from \"firebase/firestore\";\n// import { copy } from \"copy-anything\";\n/** Timestampの時はDateへの変更 */\nexport function convertTimestampToDate(\n timestamp: Timestamp | Date | null\n): Date | null {\n if (!timestamp) return null;\n /** string の場合(本来は来ないはずなのに) */\n if (typeof timestamp === \"string\") {\n const _string = new Date(timestamp);\n // console.log('convertTimestampToDate-string:', _string)\n if (isNaN(_string.getTime())) {\n return null;\n }\n return _string;\n }\n if (\"_seconds\" in timestamp && timestamp?._seconds) {\n return new Date(Number(timestamp._seconds) * 1000);\n }\n /** timestampの場合 */\n if (timestamp instanceof Timestamp) {\n const _timestamp = timestamp.toDate();\n // console.log('convertTimestampToDate-timestamp:', _timestamp)\n return _timestamp;\n }\n /** Dateの場合 */\n if (timestamp instanceof Date) {\n const _date = timestamp;\n // console.log('convertTimestampToDate-date:', _date)\n return _date;\n }\n // console.log('convertTimestampToDate-type:', typeof timestamp)\n // console.log('convertTimestampToDate-else:', timestamp)\n return timestamp;\n}\n\n/**\n * 時間を文字に変換\n * @param payload Date | Timestamp | string | null\n * @param format YYYY/MM/DD hh:mm:ss\n */\nexport const dateFormat = (\n payload:\n | Date\n | Timestamp\n | string\n | number\n | null\n | undefined\n | {\n _seconds: number;\n _nanoseconds: number;\n },\n format: string = \"YYYY/MM/DD\"\n) => {\n let date = payload;\n if (!date) return \"\";\n if (typeof date === \"string\") {\n if (date.length === 8 && /^\\d{8}$/.test(date)) {\n // 'YYYYMMDD'形式の対応\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(4, 6)) - 1; // 月は0始まり\n const strDate = Number(date.slice(6, 8));\n date = new Date(strYear, strMonth, strDate);\n } else if (!/^(\\d{4}).([0-1]\\d).([0-3]\\d).*$/.test(date)) {\n return \"error\";\n } else {\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(5, 7)) - 1;\n const strDate = Number(date.slice(8, 10));\n date = new Date(strYear, strMonth, strDate);\n }\n }\n if (typeof date === \"number\") {\n date = new Date(date);\n }\n if (isTimestamp(date)) {\n date = date.toDate();\n }\n if (date.hasOwnProperty(\"_seconds\") && date.hasOwnProperty(\"_nanoseconds\")) {\n date = new Date(\n // @ts-ignore\n date._seconds * 1000 + Math.floor(date._nanoseconds / 1000000)\n );\n }\n\n date = new Date(date as Date);\n\n format = format.replace(/YYYY/g, date.getFullYear().toString());\n format = format.replace(/MM/g, (\"0\" + (date.getMonth() + 1)).slice(-2));\n format = format.replace(/DD/g, (\"0\" + date.getDate()).slice(-2));\n format = format.replace(/hh/g, (\"0\" + date.getHours()).slice(-2));\n format = format.replace(/mm/g, (\"0\" + date.getMinutes()).slice(-2));\n format = format.replace(/ss/g, (\"0\" + date.getSeconds()).slice(-2));\n format = format.replace(/SSS/g, (\"00\" + date.getMilliseconds()).slice(-3));\n format = format.replace(\n /aaa/g,\n [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"][date.getDay()]\n );\n // if (format.includes('-')) {\n // console.log('「-」includes warning')\n // }\n\n return format;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isTimestamp = (payload: any): payload is Timestamp => {\n return payload.toDate !== undefined;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,oBAWO;AAOP,mBAAyB;;;AClBzB,iBAA8B;AAC9B,uBAA6B;AAE7B,IAAM,iBAAiB;AAAA,EACrB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,OAAO;AACT;AAGA,IAAM,UAAM,0BAAc,cAAc;AAEjC,IAAM,SAAK,+BAAa,GAAG;;;ADMlC,oBAAuB;AAChB,IAAM,mBAAN,MAAuB;AAAA,EAC5B,WAA4B;AAAA,EAC5B,mBAAuC;AAAA,EACvC,eAAiD;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAwB;AAAA,EACxB,YAA2B;AAAA,EAC3B,cAAsB;AAAA;AAAA,EACtB,YAAoB;AAAA;AAAA,EACpB,OAAoB;AAAA;AAAA,EACZ,gBAAuC;AAAA;AAAA,EAE/C,YACE,QACA,aAEA,MAAiB,IACjB,SAAiB,IACjB;AAEA,SAAK,SAAS;AACd,SAAK,cAAc;AACnB,SAAK,KAAK;AACV,SAAK,SAAS;AACd,SAAK,WAAW,MAAM;AAAA,EACxB;AAAA,EAEA,MAAM,WAAW,QAAgB;AAC/B,UAAM,OAAO,UAAM,8BAAO,uBAAI,KAAK,IAAI,GAAG,KAAK,MAAM,QAAQ,MAAM,CAAC;AACpE,QAAI,CAAC,KAAK,OAAO,GAAG;AAClB,YAAM,I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AAK,SAAS,IAAI,IAAI,MAAM,EAAE,CAAC;AACtE,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,QAAQ,GAAG,MAAM,EAAE,CAAC;AAC/D,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,SAAS,GAAG,MAAM,EAAE,CAAC;AAChE,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,WAAW,GAAG,MAAM,EAAE,CAAC;AAClE,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,WAAW,GAAG,MAAM,EAAE,CAAC;AAClE,WAAS,OAAO,QAAQ,SAAS,OAAO,KAAK,gBAAgB,GAAG,MAAM,EAAE,CAAC;AACzE,WAAS,OAAO;AAAA,IACd;AAAA,IACA,CAAC,UAAK,UAAK,UAAK,UAAK,UAAK,UAAK,QAAG,EAAE,KAAK,OAAO,CAAC;AAAA,EACnD;AAKA,SAAO;AACT;AAGA,IAAM,cAAc,CAAC,YAAuC;AAC1D,SAAO,QAAQ,WAAW;AAC5B;","names":["import_firestore","doc","import_rrweb","import_firestore","import_packer","uuidv4","_doc","db","record","import_firestore"]}
|
package/dist/index.mjs
CHANGED
|
@@ -25,6 +25,7 @@ var app = initializeApp(firebaseConfig);
|
|
|
25
25
|
var db = getFirestore(app);
|
|
26
26
|
|
|
27
27
|
// src/player.ts
|
|
28
|
+
import { unpack } from "@rrweb/packer";
|
|
28
29
|
var ActionLensPlayer = class {
|
|
29
30
|
replayer = null;
|
|
30
31
|
overlayContainer = null;
|
|
@@ -88,6 +89,7 @@ var ActionLensPlayer = class {
|
|
|
88
89
|
}
|
|
89
90
|
targetDiv.classList.add("replayer-container");
|
|
90
91
|
this.replayer = new Replayer(events, {
|
|
92
|
+
unpackFn: unpack,
|
|
91
93
|
root: targetDiv,
|
|
92
94
|
UNSAFE_replayCanvas: false,
|
|
93
95
|
props: {
|
|
@@ -307,6 +309,7 @@ var ActionLensPlayer = class {
|
|
|
307
309
|
import { v4 as uuidv4 } from "uuid";
|
|
308
310
|
import { record } from "rrweb";
|
|
309
311
|
import { doc as doc2, setDoc as setDoc2, collection as collection2, getDoc as getDoc2 } from "firebase/firestore";
|
|
312
|
+
import { pack } from "@rrweb/packer";
|
|
310
313
|
var ActionLensRc = class {
|
|
311
314
|
sessionId = uuidv4();
|
|
312
315
|
stopFnForStore = null;
|
|
@@ -363,7 +366,7 @@ var ActionLensRc = class {
|
|
|
363
366
|
);
|
|
364
367
|
throw new Error("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u304C\u5B58\u5728\u3057\u307E\u305B\u3093");
|
|
365
368
|
}
|
|
366
|
-
if (!this.projectData
|
|
369
|
+
if (!this.projectData?.isActivate) {
|
|
367
370
|
console.warn(
|
|
368
371
|
"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306F\u975E\u30A2\u30AF\u30C6\u30A3\u30D6\u3067\u3059\u3002\u9332\u753B\u3092\u958B\u59CB\u3067\u304D\u307E\u305B\u3093\u3002"
|
|
369
372
|
);
|
|
@@ -387,15 +390,15 @@ var ActionLensRc = class {
|
|
|
387
390
|
{
|
|
388
391
|
...userMeta || {},
|
|
389
392
|
metaData,
|
|
390
|
-
id:
|
|
393
|
+
id: this.userId,
|
|
391
394
|
originalUserId: _userId,
|
|
392
395
|
type: "customer",
|
|
393
|
-
organizationId: projectData
|
|
396
|
+
organizationId: projectData?.organizationId || "",
|
|
394
397
|
projectIds: [projectId],
|
|
395
398
|
createAt: /* @__PURE__ */ new Date(),
|
|
396
399
|
updateAt: /* @__PURE__ */ new Date(),
|
|
397
|
-
createdBy:
|
|
398
|
-
updatedBy:
|
|
400
|
+
createdBy: this.userId,
|
|
401
|
+
updatedBy: this.userId,
|
|
399
402
|
hidden: false,
|
|
400
403
|
hiddenBy: ""
|
|
401
404
|
},
|
|
@@ -505,19 +508,7 @@ var ActionLensRc = class {
|
|
|
505
508
|
console.error("Firestore\u304C\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u305B\u3093");
|
|
506
509
|
return;
|
|
507
510
|
}
|
|
508
|
-
const consoleEvent = {
|
|
509
|
-
type: "custom-event",
|
|
510
|
-
data: {
|
|
511
|
-
type: "console",
|
|
512
|
-
method,
|
|
513
|
-
args: args.map(
|
|
514
|
-
(arg) => typeof arg === "object" ? JSON.stringify(arg) : arg
|
|
515
|
-
)
|
|
516
|
-
},
|
|
517
|
-
timestamp: Date.now()
|
|
518
|
-
};
|
|
519
511
|
record.addCustomEvent("console", { method: "log", args });
|
|
520
|
-
_updateActionRecordSession();
|
|
521
512
|
};
|
|
522
513
|
});
|
|
523
514
|
} catch (error) {
|
|
@@ -644,6 +635,7 @@ var ActionLensRc = class {
|
|
|
644
635
|
});
|
|
645
636
|
const _updateActionRecordSession = () => this.updateActionRecordSession();
|
|
646
637
|
this.stopFnForStore = record({
|
|
638
|
+
packFn: pack,
|
|
647
639
|
collectFonts: true,
|
|
648
640
|
inlineImages: false,
|
|
649
641
|
sampling: {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player.ts","../src/utils/index.ts","../src/record.ts","../src/utils/date.ts"],"sourcesContent":["import {\n doc,\n collection,\n setDoc,\n addDoc,\n where,\n query,\n getDocs,\n orderBy,\n Firestore,\n getDoc,\n} from \"firebase/firestore\";\nimport {\n ActionRecord,\n ActionRecordSession,\n Project,\n User,\n} from \"@ism-tech/actionlens-type\";\nimport { Replayer } from \"rrweb\";\nimport { db } from \"./utils\"; // dbのインポートパスを適宜変更してください\n\nexport class ActionLensPlayer {\n replayer: Replayer | null = null;\n overlayContainer: HTMLElement | null = null;\n playerStatus: \"playing\" | \"paused\" | \"stopped\" = \"stopped\";\n targetDivId: string;\n db: Firestore;\n prefix: string;\n userId: string | null = null;\n projectId: string | null = null;\n currentTime: number = 0; // 現在の再生時間\n totalTime: number = 0; // 再生中の時間を保持するための変数\n user: User | null = null; // ユーザーデータを保持するための変数\n private setIntervalId: NodeJS.Timeout | null = null; // setTimeoutのIDを保持するための変数\n\n constructor(\n userId: string,\n targetDivId: string,\n\n _db: Firestore = db,\n prefix: string = \"\"\n ) {\n // 初期化処理が必要であればここに記述\n this.userId = userId;\n this.targetDivId = targetDivId;\n this.db = _db;\n this.prefix = prefix;\n this.initialize(userId);\n }\n\n async initialize(userId: string) {\n const user = await getDoc(doc(this.db, `${this.prefix}user`, userId));\n if (!user.exists()) {\n throw new Error(`User with ID ${userId} does not exist.`);\n }\n const userData = user.data() as User;\n this.user = userData; // ユーザーデータを保持\n this.projectId = userData.projectIds?.[0] || null; // プロジェクトIDを取得\n if (!this.projectId) {\n throw new Error(`Project ID for user ${userId} does not exist.`);\n }\n }\n\n async replayRrwebSession(sessionId: string): Promise<void> {\n try {\n // 1. Firestoreからデータを取得\n\n const q = query(\n collection(this.db, `${this.prefix}ActionRecord`),\n where(\"sessionId\", \"==\", sessionId),\n orderBy(\"timeStamp\", \"asc\")\n );\n\n const querySnapshot = await getDocs(q);\n const events = querySnapshot.docs.map((doc) => {\n const data = doc.data() as ActionRecord;\n return JSON.parse(data.rrwebRecord);\n });\n console.log(\"events\", events);\n if (events.length === 0) {\n console.warn(\n `セッションID ${sessionId} のデータが見つかりませんでした。`\n );\n return;\n }\n\n const targetDiv = document.getElementById(this.targetDivId);\n if (!targetDiv) {\n throw new Error(\n `ID ${this.targetDivId} のdiv要素が見つかりませんでした。`\n );\n }\n\n // クラスを追加\n targetDiv.classList.add(\"replayer-container\");\n\n // 3. Replayerを初期化\n this.replayer = new Replayer(events, {\n root: targetDiv,\n UNSAFE_replayCanvas: false,\n props: {\n autoPlay: true,\n speed: 1,\n mouseTail: true,\n },\n className: \"_replayer-canvas\",\n } as any);\n\n // 4. カスタムイベントのリスナーを追加\n this.replayer.on(\"custom-event\", (event: any) => {\n console.log(\"Custom event:\", event);\n this.handleCustomEvent(event);\n });\n this.replayer.on(\"finish\", () => {\n console.log(\"Replay finished\");\n this.replayer?.pause(0);\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n this.endTimeoutTimeline();\n });\n const { totalTime } = this.replayer.getMetaData();\n this.totalTime = totalTime;\n\n // iframeのスタイルを調整\n const iframes = targetDiv.querySelectorAll(\"iframe\");\n iframes.forEach((iframe) => {\n (iframe as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (iframe as HTMLElement).style.position = \"absolute\";\n (iframe as HTMLElement).style.left = \"50%\";\n (iframe as HTMLElement).style.top = \"50%\";\n });\n // replayer-mouse-tailにposition: absolute; を追加\n const mouseTailElements = document.querySelectorAll(\n \".replayer-mouse-tail\"\n );\n mouseTailElements.forEach((element) => {\n (element as HTMLElement).style.position = \"absolute\";\n (element as HTMLElement).style.left = \"50%\";\n (element as HTMLElement).style.top = \"50%\";\n (element as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (element as HTMLElement).style.zIndex = \"1000\"; // z-indexを追加\n });\n\n // 5. 再生開始\n\n this.replayer.play();\n this.playerStatus = \"playing\";\n console.log(`セッションID ${sessionId} の再生を開始しました。`);\n this.setTimeoutTimeline();\n } catch (error) {\n console.error(\"再生エラー:\", error);\n throw error;\n }\n }\n\n // カスタムイベントを処理\n private handleCustomEvent(event: any) {\n if (!event.data || !event.data.type) return;\n\n const { timestamp } = event;\n const timeString = new Date(timestamp).toISOString();\n\n switch (event.data.type) {\n case \"console\":\n const { method, args } = event.data;\n this.displayEvent(\n `[${timeString}] Console ${method}: ${args.join(\", \")}`,\n \"console\"\n );\n\n break;\n case \"navigation\":\n const { url } = event.data;\n this.displayEvent(`[${timeString}] Navigation to ${url}`, \"navigation\");\n break;\n case \"performance\":\n const { name, entryType, duration } = event.data;\n this.displayEvent(\n `[${timeString}] Performance ${entryType}: ${name} (${duration}ms)`,\n \"performance\"\n );\n break;\n default:\n console.warn(\"不明なカスタムイベント:\", event.data.type);\n }\n }\n\n // イベントをオーバーレイに表示\n private displayEvent(message: string, eventType: string) {\n if (!this.overlayContainer) return;\n\n const eventDiv = document.createElement(\"div\");\n eventDiv.style.padding = \"5px\";\n eventDiv.style.borderBottom = \"1px solid rgba(255, 255, 255, 0.2)\";\n\n // イベントタイプに応じた色\n const colors: { [key: string]: string } = {\n console: \"#00cc00\",\n navigation: \"#3399ff\",\n performance: \"#ff9900\",\n };\n eventDiv.style.color = colors[eventType] || \"white\";\n\n eventDiv.innerText = message;\n this.overlayContainer.appendChild(eventDiv);\n\n // 最新のイベントが表示されるようスクロール\n this.overlayContainer.scrollTop = this.overlayContainer.scrollHeight;\n\n // 5秒後にフェードアウト\n setTimeout(() => {\n eventDiv.style.transition = \"opacity 1s\";\n eventDiv.style.opacity = \"0\";\n setTimeout(() => eventDiv.remove(), 1000);\n }, 5000);\n }\n setReplayTime(time: number) {\n if (this.replayer) {\n this.replayer.pause(time);\n this.currentTime = time;\n this.playerStatus = \"stopped\";\n }\n }\n\n setTimeoutTimeline() {\n this.setIntervalId = setInterval(() => {\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }, 10);\n }\n endTimeoutTimeline() {\n if (this.setIntervalId) {\n clearTimeout(this.setIntervalId);\n this.setIntervalId = null;\n }\n }\n\n // 再生を停止\n stopReplay() {\n this.endTimeoutTimeline();\n if (this.replayer) {\n this.replayer.pause();\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n restartReplay() {\n this.setTimeoutTimeline();\n if (this.replayer) {\n const offset = this.replayer.getCurrentTime();\n console.log(\"offset\", offset);\n this.replayer.play(offset);\n this.playerStatus = \"playing\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n getCurrentTime() {\n if (this.replayer) {\n return this.replayer.getCurrentTime();\n }\n return 0;\n }\n\n resetReplayer() {\n this.endTimeoutTimeline();\n this.playerStatus = \"stopped\";\n this.currentTime = 0;\n\n if (this.replayer) {\n this.replayer.pause();\n this.replayer.destroy();\n this.replayer = null;\n }\n if (this.overlayContainer) {\n this.overlayContainer.remove();\n this.overlayContainer = null;\n }\n }\n async fetchProjectList() {\n try {\n if (!this.userId) {\n console.warn(\"User ID is not initialized.\");\n return [];\n }\n if (!this.user) {\n this.user = (\n await getDoc(doc(this.db, `${this.prefix}user`, this.userId))\n ).data() as User;\n if (!this.user) {\n console.warn(`User with ID ${this.userId} does not exist.`);\n\n return [];\n }\n }\n const projectIds = this.user.projectIds || [];\n if (projectIds.length === 0) {\n console.warn(\"No project IDs found for the user.\");\n return [];\n }\n const promise = projectIds.flatMap(async (projectId) => {\n const projectDoc = await getDoc(\n doc(this.db, `${this.prefix}project`, projectId)\n );\n if (!projectDoc.exists()) {\n console.warn(`Project with ID ${projectId} does not exist.`);\n return null;\n }\n return projectDoc.data() as Project;\n });\n const projectPromises: (Project | null)[] = await Promise.all(promise);\n return projectPromises.filter((project) => project !== null);\n } catch (e) {\n console.error(\"プロジェクトリストの取得エラー:\", e);\n throw e;\n }\n }\n async fetchSessionList(projectId: string) {\n try {\n const q = query(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n where(\"projectId\", \"==\", projectId),\n orderBy(\"startTime\", \"desc\")\n );\n const usersStore: { [userId: string]: User } = {};\n\n const querySnapshot = await getDocs(q);\n const promise = querySnapshot.docs.map(async (_doc) => {\n const data = _doc.data() as ActionRecordSession;\n if (!usersStore[data.userId]) {\n usersStore[data.userId] = (\n await getDoc(doc(this.db, `${this.prefix}user`, data.userId))\n ).data() as User;\n }\n\n return { ...data, userData: usersStore[data.userId] };\n });\n const sessions: (ActionRecordSession & { userData: User })[] =\n await Promise.all(promise);\n console.log(sessions);\n\n return sessions;\n } catch (error) {\n console.error(\"セッションリストの取得エラー:\", error);\n throw error;\n }\n }\n}\n","import { initializeApp } from \"firebase/app\";\nimport { getFirestore } from \"firebase/firestore\";\n\nconst firebaseConfig = {\n apiKey: \"AIzaSyCxreoOZivnjFIh2mJ6WXjS3ieQ11wsDW8\",\n authDomain: \"actionlens-b14ae.firebaseapp.com\",\n projectId: \"actionlens-b14ae\",\n storageBucket: \"actionlens-b14ae.firebasestorage.app\",\n messagingSenderId: \"36086339210\",\n appId: \"1:36086339210:web:36e16e8778aadd8c58ff73\",\n};\n\n// Initialize Firebase\nconst app = initializeApp(firebaseConfig);\n\nexport const db = getFirestore(app);\n","import { v4 as uuidv4 } from \"uuid\";\nimport { record, Replayer } from \"rrweb\";\nimport { Firestore, doc, setDoc, collection, getDoc } from \"firebase/firestore\";\nimport { ActionRecord, Project, User } from \"@ism-tech/actionlens-type\";\nimport { db } from \"./utils/index\";\n\nexport class ActionLensRc {\n sessionId: string = uuidv4();\n stopFnForStore: any = null;\n userId: string | null = null;\n db: Firestore | null = null;\n prefix: string = \"\";\n userData: User | null = null;\n projectId: string | null = null;\n projectData: Project | null = null;\n organizationId: string | null = null;\n originalUserId: string | null = null; // 元のユーザーID(外部システムのIDなど)\n constructor(\n _userId: string | null,\n projectId: string | null,\n userMeta: { name: string; email: string } | null,\n metaData: Record<string, any> = {},\n _db: Firestore | null = null,\n prefix: string = \"\"\n ) {\n try {\n this.originalUserId = _userId; // 元のユーザーIDを保存\n console.log(\"ActionLensRc開始\");\n if (!projectId) {\n console.error(\"projectIdがNULLです\");\n throw new Error(\"projectIdがNULLです\");\n }\n if (!_userId) {\n console.error(\"userIdがNULLです\");\n throw new Error(\"userIdがNULLです\");\n }\n\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n getDoc(doc(collection(this.db, `${prefix}project`), projectId))\n .then(async (_doc) => {\n this.projectData = _doc.data() as Project;\n const projectData = this.projectData;\n this.organizationId = projectData?.organizationId || null;\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n if (!this.projectData) {\n await setDoc(\n doc(collection(this.db, `${prefix}project`), projectId),\n {\n id: projectId,\n name: projectId,\n organizationId: \"\",\n isActivate: false, // デフォルトでアクティブに設定\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: _userId,\n updatedBy: _userId,\n } as Project,\n { merge: true }\n );\n throw new Error(\"プロジェクトが存在しません\");\n }\n if (!this.projectData.isActivate) {\n console.warn(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n throw new Error(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n }\n this.userId = projectData.organizationId + \"-\" + _userId;\n getDoc(doc(collection(this.db, `${prefix}user`), this.userId))\n .then(async (_doc) => {\n if (!this.db) {\n console.error(\"Firestoreが初期化されていません\");\n throw new Error(\"Firestoreが初期化されていません\");\n }\n\n const userData = _doc.data() as User;\n if (!userData.id || !_doc.exists()) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n ...(userMeta || {}),\n metaData,\n id: projectData.organizationId + \"-\" + _userId,\n originalUserId: _userId,\n type: \"customer\",\n organizationId: projectData.organizationId,\n projectIds: [projectId],\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: _userId,\n updatedBy: _userId,\n hidden: false,\n hiddenBy: \"\",\n } as User,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error creating document: \", error);\n\n throw new Error(\"ユーザーの作成に失敗しました\");\n });\n this.userData = _doc.data() as User;\n } else {\n this.userData = _doc.data() as User;\n\n if (!this.userData?.projectIds?.includes(projectId)) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n projectIds: [\n ...(this.userData?.projectIds || []),\n projectId,\n ],\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\n \"ユーザーのプロジェクトIDの更新に失敗しました\"\n );\n });\n }\n\n if (\n this.userData?.organizationId !== projectData.organizationId\n ) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n organizationId: projectData.organizationId\n ? projectData.organizationId\n : this.userData?.organizationId,\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\"ユーザーの組織IDの更新に失敗しました\");\n });\n }\n }\n\n this.prefix = prefix;\n this.projectId = projectId;\n\n this.startRrwebRecordingForStore();\n // this.startConsoleRecording();\n // this.startTimelineRecording();\n })\n .catch((error) => {\n console.error(\"ユーザーデータの取得エラー:\", error);\n throw new Error(\"ユーザーデータの取得に失敗しました\");\n });\n })\n .catch((error) => {\n console.error(\"プロジェクトデータの取得エラー:\", error);\n throw new Error(\"プロジェクトデータの取得に失敗しました\");\n });\n } catch (error) {\n console.error(\"初期化エラー:\", error);\n throw error;\n }\n }\n\n // コンソールログをキャプチャ\n startConsoleRecording() {\n try {\n const originalConsole = { ...console };\n const consoleMethods = [\n \"log\",\n \"info\",\n \"warn\",\n \"error\",\n \"debug\",\n \"trace\",\n \"assert\",\n \"clear\",\n \"context\",\n \"count\",\n \"countReset\",\n \"createTask\",\n \"debug\",\n \"dir\",\n \"dirxml\",\n \"error\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n\n \"memory\",\n \"profile\",\n \"profileEnd\",\n \"table\",\n \"time\",\n \"timeEnd\",\n \"timeLog\",\n \"timeStamp\",\n ] as const;\n\n const db = this.db;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n consoleMethods.forEach((method) => {\n // 型安全なオーバーライド\n (console as any)[method] = (...args: any[]) => {\n // 元のメソッドを呼び出し\n (originalConsole as any)[method](...args);\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n const consoleEvent = {\n type: \"custom-event\",\n data: {\n type: \"console\",\n method,\n\n args: args.map((arg) =>\n typeof arg === \"object\" ? JSON.stringify(arg) : arg\n ),\n },\n timestamp: Date.now(),\n };\n\n record.addCustomEvent(\"console\", { method: \"log\", args });\n\n _updateActionRecordSession();\n };\n });\n } catch (error) {\n console.error(\"コンソール録画エラー:\", error);\n throw error;\n }\n }\n\n // タイムライン(ナビゲーションとパフォーマンス)をキャプチャ\n startTimelineRecording() {\n try {\n const userId = this.userId || \"unknown\";\n const sessionId = this.sessionId;\n const db = this.db;\n const prefix = this.prefix;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n // ナビゲーション履歴(popstateイベント)\n window.addEventListener(\"popstate\", (event) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n const navigationEvent = {\n type: \"custom\",\n data: {\n type: \"navigation\",\n url: window.location.href,\n state: event.state,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n type: \"navigation\",\n originalUserId: this.originalUserId ?? \"\",\n sessionId,\n rrwebRecord: JSON.stringify(navigationEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving navigation event: \", error);\n });\n _updateActionRecordSession();\n });\n\n // パフォーマンスエントリ\n if (window.performance) {\n const observer = new PerformanceObserver((list) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n for (const entry of list.getEntries()) {\n const performanceEvent = {\n type: \"custom\",\n data: {\n type: \"performance\",\n name: entry.name,\n entryType: entry.entryType,\n startTime: entry.startTime,\n duration: entry.duration,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId: this.originalUserId ?? \"\",\n type: \"performance\",\n sessionId,\n rrwebRecord: JSON.stringify(performanceEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving performance event: \", error);\n });\n }\n });\n\n observer.observe({ entryTypes: [\"resource\", \"navigation\", \"paint\"] });\n }\n } catch (error) {\n console.error(\"タイムライン録画エラー:\", error);\n throw error;\n }\n }\n\n startRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) return;\n const _sessionId = this.sessionId;\n const userId = this.userId || \"unknown\";\n const originalUserId = this.originalUserId || \"\";\n const db = this.db;\n const prefix = this.prefix;\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n // rrwebの録画を開始\n // このセッションの開始時間を記録\n const ActionRecordSessionRef = doc(\n collection(db, `${prefix}ActionRecordSession`),\n _sessionId\n );\n setDoc(ActionRecordSessionRef, {\n id: _sessionId,\n\n startTime: new Date(),\n endTime: null,\n userId,\n projectId: this.projectId || null,\n organizationId: this.projectData?.organizationId || null,\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: userId,\n updatedBy: userId,\n });\n // rrwebの録画を開始 済み\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n this.stopFnForStore = record({\n collectFonts: true,\n inlineImages: false,\n sampling: {\n canvas: 500,\n mousemove: 500,\n mousemoveCallback: 500,\n },\n emit(event) {\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId,\n type: \"rrweb\",\n sessionId: _sessionId,\n rrwebRecord: JSON.stringify(event),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving rrweb event: \", error);\n });\n _updateActionRecordSession();\n },\n recordCanvas: false,\n });\n } catch (error) {\n console.error(\"rrweb録画エラー:\", error);\n throw error;\n }\n }\n\n stopRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) {\n this.stopFnForStore();\n this.stopFnForStore = null;\n }\n } catch (error) {\n console.error(\"rrweb録画停止エラー:\", error);\n throw error;\n }\n }\n updateActionRecordSession() {\n try {\n if (!this.db || !this.sessionId || !this.userId) {\n console.error(\n \"Firestoreが初期化されていません、またはsessionId、userIdが設定されていません\"\n );\n return;\n }\n const ActionRecordSessionRef = doc(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n this.sessionId\n );\n setDoc(\n ActionRecordSessionRef,\n {\n endTime: new Date(),\n updateAt: new Date(),\n updatedBy: this.userId,\n },\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating ActionRecordSession: \", error);\n });\n } catch (error) {\n console.error(\"ActionRecordSession更新エラー:\", error);\n throw error;\n }\n }\n}\n","import { Timestamp } from \"firebase/firestore\";\n// import { copy } from \"copy-anything\";\n/** Timestampの時はDateへの変更 */\nexport function convertTimestampToDate(\n timestamp: Timestamp | Date | null\n): Date | null {\n if (!timestamp) return null;\n /** string の場合(本来は来ないはずなのに) */\n if (typeof timestamp === \"string\") {\n const _string = new Date(timestamp);\n // console.log('convertTimestampToDate-string:', _string)\n if (isNaN(_string.getTime())) {\n return null;\n }\n return _string;\n }\n if (\"_seconds\" in timestamp && timestamp?._seconds) {\n return new Date(Number(timestamp._seconds) * 1000);\n }\n /** timestampの場合 */\n if (timestamp instanceof Timestamp) {\n const _timestamp = timestamp.toDate();\n // console.log('convertTimestampToDate-timestamp:', _timestamp)\n return _timestamp;\n }\n /** Dateの場合 */\n if (timestamp instanceof Date) {\n const _date = timestamp;\n // console.log('convertTimestampToDate-date:', _date)\n return _date;\n }\n // console.log('convertTimestampToDate-type:', typeof timestamp)\n // console.log('convertTimestampToDate-else:', timestamp)\n return timestamp;\n}\n\n/**\n * 時間を文字に変換\n * @param payload Date | Timestamp | string | null\n * @param format YYYY/MM/DD hh:mm:ss\n */\nexport const dateFormat = (\n payload:\n | Date\n | Timestamp\n | string\n | number\n | null\n | undefined\n | {\n _seconds: number;\n _nanoseconds: number;\n },\n format: string = \"YYYY/MM/DD\"\n) => {\n let date = payload;\n if (!date) return \"\";\n if (typeof date === \"string\") {\n if (date.length === 8 && /^\\d{8}$/.test(date)) {\n // 'YYYYMMDD'形式の対応\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(4, 6)) - 1; // 月は0始まり\n const strDate = Number(date.slice(6, 8));\n date = new Date(strYear, strMonth, strDate);\n } else if (!/^(\\d{4}).([0-1]\\d).([0-3]\\d).*$/.test(date)) {\n return \"error\";\n } else {\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(5, 7)) - 1;\n const strDate = Number(date.slice(8, 10));\n date = new Date(strYear, strMonth, strDate);\n }\n }\n if (typeof date === \"number\") {\n date = new Date(date);\n }\n if (isTimestamp(date)) {\n date = date.toDate();\n }\n if (date.hasOwnProperty(\"_seconds\") && date.hasOwnProperty(\"_nanoseconds\")) {\n date = new Date(\n // @ts-ignore\n date._seconds * 1000 + Math.floor(date._nanoseconds / 1000000)\n );\n }\n\n date = new Date(date as Date);\n\n format = format.replace(/YYYY/g, date.getFullYear().toString());\n format = format.replace(/MM/g, (\"0\" + (date.getMonth() + 1)).slice(-2));\n format = format.replace(/DD/g, (\"0\" + date.getDate()).slice(-2));\n format = format.replace(/hh/g, (\"0\" + date.getHours()).slice(-2));\n format = format.replace(/mm/g, (\"0\" + date.getMinutes()).slice(-2));\n format = format.replace(/ss/g, (\"0\" + date.getSeconds()).slice(-2));\n format = format.replace(/SSS/g, (\"00\" + date.getMilliseconds()).slice(-3));\n format = format.replace(\n /aaa/g,\n [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"][date.getDay()]\n );\n // if (format.includes('-')) {\n // console.log('「-」includes warning')\n // }\n\n return format;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isTimestamp = (payload: any): payload is Timestamp => {\n return payload.toDate !== undefined;\n};\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAOP,SAAS,gBAAgB;;;AClBzB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAE7B,IAAM,iBAAiB;AAAA,EACrB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;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,WAAS,OAAO,QAAQ,QAAQ,MAAM,KAAK,WAAW,GAAG,MAAM,EAAE,CAAC;AAClE,WAAS,OAAO,QAAQ,SAAS,OAAO,KAAK,gBAAgB,GAAG,MAAM,EAAE,CAAC;AACzE,WAAS,OAAO;AAAA,IACd;AAAA,IACA,CAAC,UAAK,UAAK,UAAK,UAAK,UAAK,UAAK,QAAG,EAAE,KAAK,OAAO,CAAC;AAAA,EACnD;AAKA,SAAO;AACT;AAGA,IAAM,cAAc,CAAC,YAAuC;AAC1D,SAAO,QAAQ,WAAW;AAC5B;","names":["doc","doc","setDoc","collection","getDoc","getDoc","doc","collection","setDoc","_doc","db","record"]}
|
|
1
|
+
{"version":3,"sources":["../src/player.ts","../src/utils/index.ts","../src/record.ts","../src/utils/date.ts"],"sourcesContent":["import {\n doc,\n collection,\n setDoc,\n addDoc,\n where,\n query,\n getDocs,\n orderBy,\n Firestore,\n getDoc,\n} from \"firebase/firestore\";\nimport {\n ActionRecord,\n ActionRecordSession,\n Project,\n User,\n} from \"@ism-tech/actionlens-type\";\nimport { Replayer } from \"rrweb\";\nimport { db } from \"./utils\"; // dbのインポートパスを適宜変更してください\n\nimport { unpack } from \"@rrweb/packer\";\nexport class ActionLensPlayer {\n replayer: Replayer | null = null;\n overlayContainer: HTMLElement | null = null;\n playerStatus: \"playing\" | \"paused\" | \"stopped\" = \"stopped\";\n targetDivId: string;\n db: Firestore;\n prefix: string;\n userId: string | null = null;\n projectId: string | null = null;\n currentTime: number = 0; // 現在の再生時間\n totalTime: number = 0; // 再生中の時間を保持するための変数\n user: User | null = null; // ユーザーデータを保持するための変数\n private setIntervalId: NodeJS.Timeout | null = null; // setTimeoutのIDを保持するための変数\n\n constructor(\n userId: string,\n targetDivId: string,\n\n _db: Firestore = db,\n prefix: string = \"\"\n ) {\n // 初期化処理が必要であればここに記述\n this.userId = userId;\n this.targetDivId = targetDivId;\n this.db = _db;\n this.prefix = prefix;\n this.initialize(userId);\n }\n\n async initialize(userId: string) {\n const user = await getDoc(doc(this.db, `${this.prefix}user`, userId));\n if (!user.exists()) {\n throw new Error(`User with ID ${userId} does not exist.`);\n }\n const userData = user.data() as User;\n this.user = userData; // ユーザーデータを保持\n this.projectId = userData.projectIds?.[0] || null; // プロジェクトIDを取得\n if (!this.projectId) {\n throw new Error(`Project ID for user ${userId} does not exist.`);\n }\n }\n\n async replayRrwebSession(sessionId: string): Promise<void> {\n try {\n // 1. Firestoreからデータを取得\n\n const q = query(\n collection(this.db, `${this.prefix}ActionRecord`),\n where(\"sessionId\", \"==\", sessionId),\n orderBy(\"timeStamp\", \"asc\")\n );\n\n const querySnapshot = await getDocs(q);\n const events = querySnapshot.docs.map((doc) => {\n const data = doc.data() as ActionRecord;\n return JSON.parse(data.rrwebRecord);\n });\n console.log(\"events\", events);\n if (events.length === 0) {\n console.warn(\n `セッションID ${sessionId} のデータが見つかりませんでした。`\n );\n return;\n }\n\n const targetDiv = document.getElementById(this.targetDivId);\n if (!targetDiv) {\n throw new Error(\n `ID ${this.targetDivId} のdiv要素が見つかりませんでした。`\n );\n }\n\n // クラスを追加\n targetDiv.classList.add(\"replayer-container\");\n\n // 3. Replayerを初期化\n this.replayer = new Replayer(events, {\n unpackFn: unpack,\n root: targetDiv,\n UNSAFE_replayCanvas: false,\n props: {\n autoPlay: true,\n speed: 1,\n mouseTail: true,\n },\n className: \"_replayer-canvas\",\n } as any);\n\n // 4. カスタムイベントのリスナーを追加\n this.replayer.on(\"custom-event\", (event: any) => {\n console.log(\"Custom event:\", event);\n this.handleCustomEvent(event);\n });\n this.replayer.on(\"finish\", () => {\n console.log(\"Replay finished\");\n this.replayer?.pause(0);\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n this.endTimeoutTimeline();\n });\n const { totalTime } = this.replayer.getMetaData();\n this.totalTime = totalTime;\n\n // iframeのスタイルを調整\n const iframes = targetDiv.querySelectorAll(\"iframe\");\n iframes.forEach((iframe) => {\n (iframe as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (iframe as HTMLElement).style.position = \"absolute\";\n (iframe as HTMLElement).style.left = \"50%\";\n (iframe as HTMLElement).style.top = \"50%\";\n });\n // replayer-mouse-tailにposition: absolute; を追加\n const mouseTailElements = document.querySelectorAll(\n \".replayer-mouse-tail\"\n );\n mouseTailElements.forEach((element) => {\n (element as HTMLElement).style.position = \"absolute\";\n (element as HTMLElement).style.left = \"50%\";\n (element as HTMLElement).style.top = \"50%\";\n (element as HTMLElement).style.transform = \"translate(-50%, -50%)\";\n (element as HTMLElement).style.zIndex = \"1000\"; // z-indexを追加\n });\n\n // 5. 再生開始\n\n this.replayer.play();\n this.playerStatus = \"playing\";\n console.log(`セッションID ${sessionId} の再生を開始しました。`);\n this.setTimeoutTimeline();\n } catch (error) {\n console.error(\"再生エラー:\", error);\n throw error;\n }\n }\n\n // カスタムイベントを処理\n private handleCustomEvent(event: any) {\n if (!event.data || !event.data.type) return;\n\n const { timestamp } = event;\n const timeString = new Date(timestamp).toISOString();\n\n switch (event.data.type) {\n case \"console\":\n const { method, args } = event.data;\n this.displayEvent(\n `[${timeString}] Console ${method}: ${args.join(\", \")}`,\n \"console\"\n );\n\n break;\n case \"navigation\":\n const { url } = event.data;\n this.displayEvent(`[${timeString}] Navigation to ${url}`, \"navigation\");\n break;\n case \"performance\":\n const { name, entryType, duration } = event.data;\n this.displayEvent(\n `[${timeString}] Performance ${entryType}: ${name} (${duration}ms)`,\n \"performance\"\n );\n break;\n default:\n console.warn(\"不明なカスタムイベント:\", event.data.type);\n }\n }\n\n // イベントをオーバーレイに表示\n private displayEvent(message: string, eventType: string) {\n if (!this.overlayContainer) return;\n\n const eventDiv = document.createElement(\"div\");\n eventDiv.style.padding = \"5px\";\n eventDiv.style.borderBottom = \"1px solid rgba(255, 255, 255, 0.2)\";\n\n // イベントタイプに応じた色\n const colors: { [key: string]: string } = {\n console: \"#00cc00\",\n navigation: \"#3399ff\",\n performance: \"#ff9900\",\n };\n eventDiv.style.color = colors[eventType] || \"white\";\n\n eventDiv.innerText = message;\n this.overlayContainer.appendChild(eventDiv);\n\n // 最新のイベントが表示されるようスクロール\n this.overlayContainer.scrollTop = this.overlayContainer.scrollHeight;\n\n // 5秒後にフェードアウト\n setTimeout(() => {\n eventDiv.style.transition = \"opacity 1s\";\n eventDiv.style.opacity = \"0\";\n setTimeout(() => eventDiv.remove(), 1000);\n }, 5000);\n }\n setReplayTime(time: number) {\n if (this.replayer) {\n this.replayer.pause(time);\n this.currentTime = time;\n this.playerStatus = \"stopped\";\n }\n }\n\n setTimeoutTimeline() {\n this.setIntervalId = setInterval(() => {\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }, 10);\n }\n endTimeoutTimeline() {\n if (this.setIntervalId) {\n clearTimeout(this.setIntervalId);\n this.setIntervalId = null;\n }\n }\n\n // 再生を停止\n stopReplay() {\n this.endTimeoutTimeline();\n if (this.replayer) {\n this.replayer.pause();\n this.playerStatus = \"stopped\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n restartReplay() {\n this.setTimeoutTimeline();\n if (this.replayer) {\n const offset = this.replayer.getCurrentTime();\n console.log(\"offset\", offset);\n this.replayer.play(offset);\n this.playerStatus = \"playing\";\n this.currentTime = this.replayer?.getCurrentTime() || 0;\n }\n }\n getCurrentTime() {\n if (this.replayer) {\n return this.replayer.getCurrentTime();\n }\n return 0;\n }\n\n resetReplayer() {\n this.endTimeoutTimeline();\n this.playerStatus = \"stopped\";\n this.currentTime = 0;\n\n if (this.replayer) {\n this.replayer.pause();\n this.replayer.destroy();\n this.replayer = null;\n }\n if (this.overlayContainer) {\n this.overlayContainer.remove();\n this.overlayContainer = null;\n }\n }\n async fetchProjectList() {\n try {\n if (!this.userId) {\n console.warn(\"User ID is not initialized.\");\n return [];\n }\n if (!this.user) {\n this.user = (\n await getDoc(doc(this.db, `${this.prefix}user`, this.userId))\n ).data() as User;\n if (!this.user) {\n console.warn(`User with ID ${this.userId} does not exist.`);\n\n return [];\n }\n }\n const projectIds = this.user.projectIds || [];\n if (projectIds.length === 0) {\n console.warn(\"No project IDs found for the user.\");\n return [];\n }\n const promise = projectIds.flatMap(async (projectId) => {\n const projectDoc = await getDoc(\n doc(this.db, `${this.prefix}project`, projectId)\n );\n if (!projectDoc.exists()) {\n console.warn(`Project with ID ${projectId} does not exist.`);\n return null;\n }\n return projectDoc.data() as Project;\n });\n const projectPromises: (Project | null)[] = await Promise.all(promise);\n return projectPromises.filter((project) => project !== null);\n } catch (e) {\n console.error(\"プロジェクトリストの取得エラー:\", e);\n throw e;\n }\n }\n async fetchSessionList(projectId: string) {\n try {\n const q = query(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n where(\"projectId\", \"==\", projectId),\n orderBy(\"startTime\", \"desc\")\n );\n const usersStore: { [userId: string]: User } = {};\n\n const querySnapshot = await getDocs(q);\n const promise = querySnapshot.docs.map(async (_doc) => {\n const data = _doc.data() as ActionRecordSession;\n if (!usersStore[data.userId]) {\n usersStore[data.userId] = (\n await getDoc(doc(this.db, `${this.prefix}user`, data.userId))\n ).data() as User;\n }\n\n return { ...data, userData: usersStore[data.userId] };\n });\n const sessions: (ActionRecordSession & { userData: User })[] =\n await Promise.all(promise);\n console.log(sessions);\n\n return sessions;\n } catch (error) {\n console.error(\"セッションリストの取得エラー:\", error);\n throw error;\n }\n }\n}\n","import { initializeApp } from \"firebase/app\";\nimport { getFirestore } from \"firebase/firestore\";\n\nconst firebaseConfig = {\n apiKey: \"AIzaSyCxreoOZivnjFIh2mJ6WXjS3ieQ11wsDW8\",\n authDomain: \"actionlens-b14ae.firebaseapp.com\",\n projectId: \"actionlens-b14ae\",\n storageBucket: \"actionlens-b14ae.firebasestorage.app\",\n messagingSenderId: \"36086339210\",\n appId: \"1:36086339210:web:36e16e8778aadd8c58ff73\",\n};\n\n// Initialize Firebase\nconst app = initializeApp(firebaseConfig);\n\nexport const db = getFirestore(app);\n","import { v4 as uuidv4 } from \"uuid\";\nimport { record, Replayer } from \"rrweb\";\nimport { Firestore, doc, setDoc, collection, getDoc } from \"firebase/firestore\";\nimport { ActionRecord, Project, User } from \"@ism-tech/actionlens-type\";\nimport { db } from \"./utils/index\";\nimport { pack } from \"@rrweb/packer\";\nexport class ActionLensRc {\n sessionId: string = uuidv4();\n stopFnForStore: any = null;\n userId: string | null = null;\n db: Firestore | null = null;\n prefix: string = \"\";\n userData: User | null = null;\n projectId: string | null = null;\n projectData: Project | null = null;\n organizationId: string | null = null;\n originalUserId: string | null = null; // 元のユーザーID(外部システムのIDなど)\n constructor(\n _userId: string | null,\n projectId: string | null,\n userMeta: { name: string; email: string } | null,\n metaData: Record<string, any> = {},\n _db: Firestore | null = null,\n prefix: string = \"\"\n ) {\n try {\n this.originalUserId = _userId; // 元のユーザーIDを保存\n console.log(\"ActionLensRc開始\");\n if (!projectId) {\n console.error(\"projectIdがNULLです\");\n throw new Error(\"projectIdがNULLです\");\n }\n if (!_userId) {\n console.error(\"userIdがNULLです\");\n throw new Error(\"userIdがNULLです\");\n }\n\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n getDoc(doc(collection(this.db, `${prefix}project`), projectId))\n .then(async (_doc) => {\n this.projectData = _doc.data() as Project;\n const projectData = this.projectData;\n this.organizationId = projectData?.organizationId || null;\n if (!_db) {\n this.db = db;\n } else {\n this.db = _db;\n }\n if (!this.projectData) {\n await setDoc(\n doc(collection(this.db, `${prefix}project`), projectId),\n {\n id: projectId,\n name: projectId,\n organizationId: \"\",\n isActivate: false, // デフォルトでアクティブに設定\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: _userId,\n updatedBy: _userId,\n } as Project,\n { merge: true }\n );\n throw new Error(\"プロジェクトが存在しません\");\n }\n if (!this.projectData?.isActivate) {\n console.warn(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n throw new Error(\n \"プロジェクトは非アクティブです。録画を開始できません。\"\n );\n }\n this.userId = projectData.organizationId + \"-\" + _userId;\n getDoc(doc(collection(this.db, `${prefix}user`), this.userId))\n .then(async (_doc) => {\n if (!this.db) {\n console.error(\"Firestoreが初期化されていません\");\n throw new Error(\"Firestoreが初期化されていません\");\n }\n\n const userData = _doc.data() as User;\n if (!userData.id || !_doc.exists()) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n ...(userMeta || {}),\n metaData,\n id: this.userId,\n originalUserId: _userId,\n type: \"customer\",\n organizationId: projectData?.organizationId || \"\",\n projectIds: [projectId],\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: this.userId,\n updatedBy: this.userId,\n hidden: false,\n hiddenBy: \"\",\n } as User,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error creating document: \", error);\n\n throw new Error(\"ユーザーの作成に失敗しました\");\n });\n this.userData = _doc.data() as User;\n } else {\n this.userData = _doc.data() as User;\n\n if (!this.userData?.projectIds?.includes(projectId)) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n projectIds: [\n ...(this.userData?.projectIds || []),\n projectId,\n ],\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\n \"ユーザーのプロジェクトIDの更新に失敗しました\"\n );\n });\n }\n\n if (\n this.userData?.organizationId !== projectData.organizationId\n ) {\n await setDoc(\n doc(\n collection(this.db, `${prefix}user`),\n projectData.organizationId + \"-\" + _userId\n ),\n {\n organizationId: projectData.organizationId\n ? projectData.organizationId\n : this.userData?.organizationId,\n updateAt: new Date(),\n updatedBy: this.userId,\n } as Partial<User>,\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating document: \", error);\n throw new Error(\"ユーザーの組織IDの更新に失敗しました\");\n });\n }\n }\n\n this.prefix = prefix;\n this.projectId = projectId;\n\n this.startRrwebRecordingForStore();\n // this.startConsoleRecording();\n // this.startTimelineRecording();\n })\n .catch((error) => {\n console.error(\"ユーザーデータの取得エラー:\", error);\n throw new Error(\"ユーザーデータの取得に失敗しました\");\n });\n })\n .catch((error) => {\n console.error(\"プロジェクトデータの取得エラー:\", error);\n throw new Error(\"プロジェクトデータの取得に失敗しました\");\n });\n } catch (error) {\n console.error(\"初期化エラー:\", error);\n throw error;\n }\n }\n\n // コンソールログをキャプチャ\n startConsoleRecording() {\n try {\n const originalConsole = { ...console };\n const consoleMethods = [\n \"log\",\n \"info\",\n \"warn\",\n \"error\",\n \"debug\",\n \"trace\",\n \"assert\",\n \"clear\",\n \"context\",\n \"count\",\n \"countReset\",\n \"createTask\",\n \"debug\",\n \"dir\",\n \"dirxml\",\n \"error\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n\n \"memory\",\n \"profile\",\n \"profileEnd\",\n \"table\",\n \"time\",\n \"timeEnd\",\n \"timeLog\",\n \"timeStamp\",\n ] as const;\n\n const db = this.db;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n consoleMethods.forEach((method) => {\n // 型安全なオーバーライド\n (console as any)[method] = (...args: any[]) => {\n // 元のメソッドを呼び出し\n (originalConsole as any)[method](...args);\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n record.addCustomEvent(\"console\", { method: \"log\", args });\n };\n });\n } catch (error) {\n console.error(\"コンソール録画エラー:\", error);\n throw error;\n }\n }\n\n // タイムライン(ナビゲーションとパフォーマンス)をキャプチャ\n startTimelineRecording() {\n try {\n const userId = this.userId || \"unknown\";\n const sessionId = this.sessionId;\n const db = this.db;\n const prefix = this.prefix;\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n // ナビゲーション履歴(popstateイベント)\n window.addEventListener(\"popstate\", (event) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n const navigationEvent = {\n type: \"custom\",\n data: {\n type: \"navigation\",\n url: window.location.href,\n state: event.state,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n type: \"navigation\",\n originalUserId: this.originalUserId ?? \"\",\n sessionId,\n rrwebRecord: JSON.stringify(navigationEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving navigation event: \", error);\n });\n _updateActionRecordSession();\n });\n\n // パフォーマンスエントリ\n if (window.performance) {\n const observer = new PerformanceObserver((list) => {\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n\n for (const entry of list.getEntries()) {\n const performanceEvent = {\n type: \"custom\",\n data: {\n type: \"performance\",\n name: entry.name,\n entryType: entry.entryType,\n startTime: entry.startTime,\n duration: entry.duration,\n },\n timestamp: Date.now(),\n };\n\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId: this.originalUserId ?? \"\",\n type: \"performance\",\n sessionId,\n rrwebRecord: JSON.stringify(performanceEvent),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving performance event: \", error);\n });\n }\n });\n\n observer.observe({ entryTypes: [\"resource\", \"navigation\", \"paint\"] });\n }\n } catch (error) {\n console.error(\"タイムライン録画エラー:\", error);\n throw error;\n }\n }\n\n startRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) return;\n const _sessionId = this.sessionId;\n const userId = this.userId || \"unknown\";\n const originalUserId = this.originalUserId || \"\";\n const db = this.db;\n const prefix = this.prefix;\n if (!db) {\n console.error(\"Firestoreが初期化されていません\");\n return;\n }\n // rrwebの録画を開始\n // このセッションの開始時間を記録\n const ActionRecordSessionRef = doc(\n collection(db, `${prefix}ActionRecordSession`),\n _sessionId\n );\n setDoc(ActionRecordSessionRef, {\n id: _sessionId,\n startTime: new Date(),\n endTime: null,\n userId,\n projectId: this.projectId || null,\n organizationId: this.projectData?.organizationId || null,\n createAt: new Date(),\n updateAt: new Date(),\n createdBy: userId,\n updatedBy: userId,\n });\n // rrwebの録画を開始 済み\n const _updateActionRecordSession = () => this.updateActionRecordSession();\n this.stopFnForStore = record({\n packFn: pack,\n collectFonts: true,\n inlineImages: false,\n sampling: {\n canvas: 500,\n mousemove: 500,\n mousemoveCallback: 500,\n },\n emit(event) {\n const newDocRef = doc(collection(db, `${prefix}ActionRecord`));\n const record: ActionRecord = {\n id: newDocRef.id,\n timeStamp: new Date(),\n userId,\n originalUserId,\n type: \"rrweb\",\n sessionId: _sessionId,\n rrwebRecord: JSON.stringify(event),\n createAt: new Date(),\n updateAt: new Date(),\n hidden: false,\n createdBy: userId,\n updatedBy: userId,\n hiddenBy: \"\",\n };\n\n setDoc(newDocRef, record).catch((error) => {\n console.error(\"Error saving rrweb event: \", error);\n });\n _updateActionRecordSession();\n },\n recordCanvas: false,\n });\n } catch (error) {\n console.error(\"rrweb録画エラー:\", error);\n throw error;\n }\n }\n\n stopRrwebRecordingForStore() {\n try {\n if (this.stopFnForStore) {\n this.stopFnForStore();\n this.stopFnForStore = null;\n }\n } catch (error) {\n console.error(\"rrweb録画停止エラー:\", error);\n throw error;\n }\n }\n updateActionRecordSession() {\n try {\n if (!this.db || !this.sessionId || !this.userId) {\n console.error(\n \"Firestoreが初期化されていません、またはsessionId、userIdが設定されていません\"\n );\n return;\n }\n const ActionRecordSessionRef = doc(\n collection(this.db, `${this.prefix}ActionRecordSession`),\n this.sessionId\n );\n setDoc(\n ActionRecordSessionRef,\n {\n endTime: new Date(),\n updateAt: new Date(),\n updatedBy: this.userId,\n },\n { merge: true }\n ).catch((error) => {\n console.error(\"Error updating ActionRecordSession: \", error);\n });\n } catch (error) {\n console.error(\"ActionRecordSession更新エラー:\", error);\n throw error;\n }\n }\n}\n","import { Timestamp } from \"firebase/firestore\";\n// import { copy } from \"copy-anything\";\n/** Timestampの時はDateへの変更 */\nexport function convertTimestampToDate(\n timestamp: Timestamp | Date | null\n): Date | null {\n if (!timestamp) return null;\n /** string の場合(本来は来ないはずなのに) */\n if (typeof timestamp === \"string\") {\n const _string = new Date(timestamp);\n // console.log('convertTimestampToDate-string:', _string)\n if (isNaN(_string.getTime())) {\n return null;\n }\n return _string;\n }\n if (\"_seconds\" in timestamp && timestamp?._seconds) {\n return new Date(Number(timestamp._seconds) * 1000);\n }\n /** timestampの場合 */\n if (timestamp instanceof Timestamp) {\n const _timestamp = timestamp.toDate();\n // console.log('convertTimestampToDate-timestamp:', _timestamp)\n return _timestamp;\n }\n /** Dateの場合 */\n if (timestamp instanceof Date) {\n const _date = timestamp;\n // console.log('convertTimestampToDate-date:', _date)\n return _date;\n }\n // console.log('convertTimestampToDate-type:', typeof timestamp)\n // console.log('convertTimestampToDate-else:', timestamp)\n return timestamp;\n}\n\n/**\n * 時間を文字に変換\n * @param payload Date | Timestamp | string | null\n * @param format YYYY/MM/DD hh:mm:ss\n */\nexport const dateFormat = (\n payload:\n | Date\n | Timestamp\n | string\n | number\n | null\n | undefined\n | {\n _seconds: number;\n _nanoseconds: number;\n },\n format: string = \"YYYY/MM/DD\"\n) => {\n let date = payload;\n if (!date) return \"\";\n if (typeof date === \"string\") {\n if (date.length === 8 && /^\\d{8}$/.test(date)) {\n // 'YYYYMMDD'形式の対応\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(4, 6)) - 1; // 月は0始まり\n const strDate = Number(date.slice(6, 8));\n date = new Date(strYear, strMonth, strDate);\n } else if (!/^(\\d{4}).([0-1]\\d).([0-3]\\d).*$/.test(date)) {\n return \"error\";\n } else {\n const strYear = Number(date.slice(0, 4));\n const strMonth = Number(date.slice(5, 7)) - 1;\n const strDate = Number(date.slice(8, 10));\n date = new Date(strYear, strMonth, strDate);\n }\n }\n if (typeof date === \"number\") {\n date = new Date(date);\n }\n if (isTimestamp(date)) {\n date = date.toDate();\n }\n if (date.hasOwnProperty(\"_seconds\") && date.hasOwnProperty(\"_nanoseconds\")) {\n date = new Date(\n // @ts-ignore\n date._seconds * 1000 + Math.floor(date._nanoseconds / 1000000)\n );\n }\n\n date = new Date(date as Date);\n\n format = format.replace(/YYYY/g, date.getFullYear().toString());\n format = format.replace(/MM/g, (\"0\" + (date.getMonth() + 1)).slice(-2));\n format = format.replace(/DD/g, (\"0\" + date.getDate()).slice(-2));\n format = format.replace(/hh/g, (\"0\" + date.getHours()).slice(-2));\n format = format.replace(/mm/g, (\"0\" + date.getMinutes()).slice(-2));\n format = format.replace(/ss/g, (\"0\" + date.getSeconds()).slice(-2));\n format = format.replace(/SSS/g, (\"00\" + date.getMilliseconds()).slice(-3));\n format = format.replace(\n /aaa/g,\n [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"][date.getDay()]\n );\n // if (format.includes('-')) {\n // console.log('「-」includes warning')\n // }\n\n return format;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isTimestamp = (payload: any): payload is Timestamp => {\n return payload.toDate !== undefined;\n};\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAOP,SAAS,gBAAgB;;;AClBzB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAE7B,IAAM,iBAAiB;AAAA,EACrB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,OAAO;AACT;AAGA,IAAM,MAAM,cAAc,cAAc;AAEjC,IAAM,KAAK,aAAa,GAAG;;;ADMlC,SAAS,cAAc;AAChB,IAAM,mBAAN,MAAuB;AAAA,EAC5B,WAA4B;AAAA,EAC5B,mBAAuC;AAAA,EACvC,eAAiD;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAwB;AAAA,EACxB,YAA2B;AAAA,EAC3B,cAAs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author": "Tadaki Matsushita <t.matsushita0718@gmail.com>",
|
|
3
3
|
"dependencies": {
|
|
4
|
+
"@rrweb/packer": "^2.0.0-alpha.18",
|
|
4
5
|
"copy-anything": "^4.0.5",
|
|
5
6
|
"firebase": "^11.7.1",
|
|
6
7
|
"rrweb": "^2.0.0-alpha.4",
|
|
@@ -37,5 +38,5 @@
|
|
|
37
38
|
},
|
|
38
39
|
"type": "commonjs",
|
|
39
40
|
"types": "./dist/index.d.ts",
|
|
40
|
-
"version": "1.0.
|
|
41
|
+
"version": "1.0.29"
|
|
41
42
|
}
|