Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

9 changes: 8 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"extends": "airbnb-base",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"rules": {
"indent": ["error", 4],
"comma-dangle": ["error", "never"]
"comma-dangle": ["error", "never"],
"import/extensions": ["error", "ignorePackages", {
"js": "always"
}]
}
}
6 changes: 3 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
strategy:
max-parallel: 1
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
- run: npm ci
- run: npm test
env:
Expand All @@ -24,10 +24,10 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ testAPI/
# Build/Prod
lib/
.cache
dist/
dist/
.env
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Sam Pastoriza
Copyright (c) 2026 Sam Pastoriza

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
60 changes: 60 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ declare namespace FredAPI {
getTagsForRelease(releaseId: number, params?: object): Promise<RelatedTagsInfo>;
getRelatedTagsForRelease(releaseId: number, tagNames: string, params?: object): Promise<RelatedTagsInfo>;
getTableTreesForRelease(releaseId: number, params?: object): Promise<TableTreesInfo>;
getObservationsForRelease(releaseId: number, params?: V2ObservationsParams): Promise<V2ObservationsResponse>;
getAllObservationsForRelease(releaseId: number, params?: V2AllObservationsParams): Promise<V2AllObservationsResponse>;
}

class Series {
Expand Down Expand Up @@ -185,6 +187,64 @@ declare namespace FredAPI {
date: string;
}

/**
* -----------------------------------------------------
* V2 API Typings
* -----------------------------------------------------
*/

interface V2ObservationsParams {
format?: 'json' | 'csv';
limit?: number;
next_cursor?: string;
}

interface V2AllObservationsParams {
limit?: number;
maxObservations?: number;
}

interface V2ObservationsResponse {
has_more: boolean;
next_cursor: string;
release: V2ReleaseInfo;
series: V2SeriesWithObservations[];
}

interface V2AllObservationsResponse {
release: V2ReleaseInfo;
series: V2SeriesWithObservations[];
total_observations: number;
}

interface V2ReleaseInfo {
release_id: number;
name: string;
url: string;
sources: V2SourceInfo[];
}

interface V2SourceInfo {
name: string;
url: string;
}

interface V2SeriesWithObservations {
series_id: string;
title: string;
frequency: string;
units: string;
seasonal_adjustment: string;
last_updated: string;
copyright_id: string;
observations: V2Observation[];
}

interface V2Observation {
date: string;
value: string;
}

/**
* -----------------------------------------------------
* Series Typings
Expand Down
Loading