8000 Patch for global config option types (#182) · polygon-io/client-js@8df7988 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8df7988

Browse files
Patch for global config option types (#182)
* Fixes #181, adds optional global config attributes to options type for pagination and trace. * Changelog * 7.3.2
1 parent 507a889 commit 8df7988

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [7.3.2](https://github.com/polygon-io/client-js/compare/v7.3.1...v7.3.2) (2023-10-05)
2+
### Bug Fixes
3+
* Rearrange request config types so they inherit global options for pagination and trace
4+
15
## [7.3.1](https://github.com/polygon-io/client-js/compare/v7.3.0...v7.3.1) (2023-09-15)
26
### Bug Fixes
37
* Fix unintended change to top level response object that returned results array instead of results object

package-lock.json

Lines changed: 2 additions & 2 deletions
8000
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polygon.io/client-js",
3-
"version": "7.3.1",
3+
"version": "7.3.2",
44
"description": "Isomorphic Javascript client for Polygon.io Stocks, Forex, and Crypto APIs",
55
"main": "dist/main.js",
66
"types": "dist/main.d.ts",

src/rest/transport/request.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ export interface IRequestInit extends Omit<RequestInit, 'headers'> {
1717
headers?: IHeaders
1818
}
1919

20-
export type IRequestOptions = IRequestInit;
20+
export interface IGlobalOptions extends IRequestInit {
21+
trace?: boolean;
22+
pagination?: boolean;
23+
}
24+
25+
export type IRequestOptions = IGlobalOptions;
2126

2227
export interface IPolygonQueryWithCredentials extends IPolygonQuery {
2328
apiKey: string | boolean;
2429
}
2530

2631
export type IGet = (path: string, query: IPolygonQuery, options: IRequestOptions) => Promise<any>;
2732

28-
export interface IGlobalOptions extends IRequestOptions {
29-
trace?: boolean;
30-
pagination?: boolean;
31-
}
33+
3234

3335
export type ICurriedGet = (apiKey: string, apiBase: string, globalOptions?: IGlobalOptions) => IGet;
3436
export type IStructuredError = InstanceType<typeof StructuredError>;

0 commit comments

Comments
 (0)
0