Skip to content

Commit 36b00b7

Browse files
feat: Add all 15 providers and observation limits for Google Sheets
- Added 5 missing providers: BEA, ONS, StatCan, RBA, BOJ (now 15 total) - Free users limited to 100 most recent observations (desc order) - Paid users get 1000 observations - Added upgrade message at bottom of data for free users when truncated
1 parent 957ec02 commit 36b00b7

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

src/Code.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,19 @@ interface SearchResult {
4343
const SOURCES = [
4444
{ id: 'FRED', name: 'FRED (Federal Reserve)' },
4545
{ id: 'BLS', name: 'BLS (Bureau of Labor Statistics)' },
46+
{ id: 'BEA', name: 'BEA (Bureau of Economic Analysis)' },
47+
{ id: 'CENSUS', name: 'US Census Bureau' },
48+
{ id: 'EIA', name: 'EIA (Energy Information)' },
49+
{ id: 'IMF', name: 'IMF (International Monetary Fund)' },
4650
{ id: 'OECD', name: 'OECD' },
47-
{ id: 'EUROSTAT', name: 'Eurostat' },
48-
{ id: 'IMF', name: 'IMF' },
4951
{ id: 'WORLDBANK', name: 'World Bank' },
5052
{ id: 'ECB', name: 'ECB (European Central Bank)' },
53+
{ id: 'EUROSTAT', name: 'Eurostat' },
5154
{ id: 'BOE', name: 'Bank of England' },
52-
{ id: 'CENSUS', name: 'US Census Bureau' },
53-
{ id: 'EIA', name: 'EIA (Energy Information)' },
55+
{ id: 'ONS', name: 'ONS (UK Office for National Statistics)' },
56+
{ id: 'STATCAN', name: 'StatCan (Statistics Canada)' },
57+
{ id: 'RBA', name: 'RBA (Reserve Bank of Australia)' },
58+
{ id: 'BOJ', name: 'BOJ (Bank of Japan)' },
5459
];
5560

5661
interface SidebarStatus {
@@ -107,7 +112,17 @@ function DSIQ(seriesId: string, frequency?: string | null, startDate?: any) {
107112
throw new Error(errorMessage);
108113
}
109114
const data = response?.data ?? [];
110-
return buildArrayResult(data);
115+
const result = buildArrayResult(data);
116+
117+
// Add upgrade message for free users if data is truncated at 100 observations
118+
const key = getApiKey();
119+
if (!key && data.length >= 100) {
120+
result.push(['', '']);
121+
result.push(['⚠️ Free tier limited to 100 most recent observations', '']);
122+
result.push(['Upgrade for full access: datasetiq.com/pricing', '']);
123+
}
124+
125+
return result;
111126
}
112127

113128
/**

0 commit comments

Comments
 (0)