( event: TaskNotesRuntimeLifecycleEventName, rawEvent: string, payload: unknown )
| 2848 | } |
| 2849 | |
| 2850 | private normalizeLifecycleEvent( |
| 2851 | event: TaskNotesRuntimeLifecycleEventName, |
| 2852 | rawEvent: string, |
| 2853 | payload: unknown |
| 2854 | ): TaskNotesRuntimeLifecyclePayload { |
| 2855 | const record = isRecord(payload) ? payload : {}; |
| 2856 | const extension = isRecord(record.extension) |
| 2857 | ? (record.extension as unknown as TaskNotesRuntimeLifecyclePayload["extension"]) |
| 2858 | : undefined; |
| 2859 | return { |
| 2860 | event, |
| 2861 | timestamp: |
| 2862 | typeof record.timestamp === "string" ? record.timestamp : new Date().toISOString(), |
| 2863 | data: record.data ?? payload, |
| 2864 | settings: event === "settings.changed" ? this.getSettingsSnapshot() : undefined, |
| 2865 | extension, |
| 2866 | filePath: typeof record.filePath === "string" ? record.filePath : undefined, |
| 2867 | force: typeof record.force === "boolean" ? record.force : undefined, |
| 2868 | rawEvent, |
| 2869 | }; |
| 2870 | } |
| 2871 | |
| 2872 | private buildEventPayloadBase( |
| 2873 | payload: Partial<Omit<TaskNotesApiEventPayload, "event" | "timestamp">> & { |
no test coverage detected