From c131e5c475a49066c954005dada5a79d6e5e5c94 Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Mon, 16 Sep 2024 14:10:49 +0100 Subject: [PATCH] fix(notices): historical() note, type improvement, onceOnly text --- src/lib/notices.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lib/notices.ts b/src/lib/notices.ts index 76694c5f..9167ad2e 100644 --- a/src/lib/notices.ts +++ b/src/lib/notices.ts @@ -9,7 +9,7 @@ type Notice = { suppress?: boolean; }; -const notices = { +const notices: Record = { yahooSurvey: { id: "yahooSurvey", text: @@ -17,7 +17,17 @@ const notices = { "if you haven't already; for more info see " + "https://github.com/gadicc/node-yahoo-finance2/issues/764#issuecomment-2056623851.", onceOnly: true, - } as Notice, + }, + ripHistorical: { + id: "ripHistorical", + text: + "[Deprecated] historical() relies on an API that Yahoo have removed. We'll " + + "map this request to chart() for convenience, but, please consider using " + + "chart() directly instead; for more info see " + + "https://github.com/gadicc/node-yahoo-finance2/issues/795.", + level: "warn", + onceOnly: true, + }, }; export function showNotice(id: keyof typeof notices) { @@ -29,8 +39,8 @@ export function showNotice(id: keyof typeof notices) { const text = n.text + - // (n.onceOnly ? " (only shown once)" : "") + - " You can supress this message in future with `yahooFinance.supressNotices(['" + + (n.onceOnly ? " This will only be shown once, but you" : "You") + + " can supress this message in future with `yahooFinance.supressNotices(['" + id + "'])`."; const level = n.level || "info";