@invezgo/sdk 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +68 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/generated/resources.d.ts +145 -16
- package/dist/generated/resources.d.ts.map +1 -1
- package/dist/generated/types.d.ts +547 -107
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +279 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +274 -4
- package/dist/index.mjs.map +1 -1
- package/dist/realtime.d.ts +137 -0
- package/dist/realtime.d.ts.map +1 -0
- package/dist/webhook.d.ts +90 -0
- package/dist/webhook.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { InvezgoError } from './errors';
|
|
2
|
+
export declare const DEFAULT_REALTIME_URL = "wss://api.invezgo.com/ws";
|
|
3
|
+
/** One running-trade row. */
|
|
4
|
+
export interface RealtimeTrade {
|
|
5
|
+
/** Exchange trade id (string: exceeds the JS safe integer range). */
|
|
6
|
+
id: string;
|
|
7
|
+
/** `HHMMSS` (WIB). */
|
|
8
|
+
time: string;
|
|
9
|
+
code: string;
|
|
10
|
+
price: number;
|
|
11
|
+
lot: number;
|
|
12
|
+
/** Rupiah: `price * lot * 100`. */
|
|
13
|
+
value: number;
|
|
14
|
+
change: number;
|
|
15
|
+
side: 'buy' | 'sell';
|
|
16
|
+
}
|
|
17
|
+
export interface ConnectedMessage {
|
|
18
|
+
type: 'connected';
|
|
19
|
+
}
|
|
20
|
+
export interface PongMessage {
|
|
21
|
+
type: 'pong';
|
|
22
|
+
}
|
|
23
|
+
export interface SubscribedMessage {
|
|
24
|
+
type: 'subscribed';
|
|
25
|
+
channel: 'trades' | 'orderbook';
|
|
26
|
+
/** `"*"` when subscribed to every stock. */
|
|
27
|
+
codes: string[] | '*';
|
|
28
|
+
min_lot?: number;
|
|
29
|
+
min_value?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ErrorMessage {
|
|
32
|
+
type: 'error';
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
export interface LaggedMessage {
|
|
36
|
+
type: 'lagged';
|
|
37
|
+
missed: number;
|
|
38
|
+
}
|
|
39
|
+
export interface TradesMessage {
|
|
40
|
+
type: 'trades';
|
|
41
|
+
/** Server send time, Unix milliseconds. */
|
|
42
|
+
ts: number;
|
|
43
|
+
data: RealtimeTrade[];
|
|
44
|
+
}
|
|
45
|
+
export interface OrderbookMessage {
|
|
46
|
+
type: 'orderbook';
|
|
47
|
+
code: string;
|
|
48
|
+
side: 'bid' | 'offer';
|
|
49
|
+
/** Every price level of this side (shape not documented). */
|
|
50
|
+
levels: unknown[];
|
|
51
|
+
seq: number | null;
|
|
52
|
+
}
|
|
53
|
+
/** Any server message; unknown `type`s are delivered as-is. */
|
|
54
|
+
export type RealtimeMessage = ConnectedMessage | PongMessage | SubscribedMessage | ErrorMessage | LaggedMessage | TradesMessage | OrderbookMessage | {
|
|
55
|
+
type: string;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
};
|
|
58
|
+
/** Event name → listener payload. */
|
|
59
|
+
export interface RealtimeEvents {
|
|
60
|
+
connected: ConnectedMessage;
|
|
61
|
+
subscribed: SubscribedMessage;
|
|
62
|
+
trades: TradesMessage;
|
|
63
|
+
orderbook: OrderbookMessage;
|
|
64
|
+
pong: PongMessage;
|
|
65
|
+
lagged: LaggedMessage;
|
|
66
|
+
/** Every server message, including unknown types. */
|
|
67
|
+
message: RealtimeMessage;
|
|
68
|
+
/** Handshake/connection failures and server `error` messages (as `ValidationError`). */
|
|
69
|
+
error: InvezgoError;
|
|
70
|
+
close: {
|
|
71
|
+
code: number;
|
|
72
|
+
reason: string;
|
|
73
|
+
};
|
|
74
|
+
/** A reconnect is scheduled in `delay` seconds; backfill via REST after the next `connected`. */
|
|
75
|
+
reconnect: {
|
|
76
|
+
attempt: number;
|
|
77
|
+
delay: number;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** Minimal WebSocket shape used by the client (WHATWG `WebSocket` or the `ws` package). */
|
|
81
|
+
export interface WebSocketLike {
|
|
82
|
+
readyState: number;
|
|
83
|
+
send(data: string): void;
|
|
84
|
+
close(code?: number, reason?: string): void;
|
|
85
|
+
onopen: ((ev: any) => void) | null;
|
|
86
|
+
onmessage: ((ev: {
|
|
87
|
+
data: unknown;
|
|
88
|
+
}) => void) | null;
|
|
89
|
+
onerror: ((ev: any) => void) | null;
|
|
90
|
+
onclose: ((ev: {
|
|
91
|
+
code: number;
|
|
92
|
+
reason: string;
|
|
93
|
+
}) => void) | null;
|
|
94
|
+
}
|
|
95
|
+
export type WebSocketConstructor = new (url: string, options: {
|
|
96
|
+
headers: Record<string, string>;
|
|
97
|
+
}) => WebSocketLike;
|
|
98
|
+
export interface RealtimeOptions {
|
|
99
|
+
/** API key of an account with an active Elite plan. */
|
|
100
|
+
apiKey: string;
|
|
101
|
+
/** Default `wss://api.invezgo.com/ws`. */
|
|
102
|
+
url?: string;
|
|
103
|
+
/** Reconnect with backoff (1, 2, 4 … 30 s) after a drop. Default `true`. */
|
|
104
|
+
reconnect?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* WebSocket implementation accepting `new WebSocket(url, { headers })`, e.g. `require('ws')`.
|
|
107
|
+
* Defaults to the global `WebSocket` on Node >= 22.
|
|
108
|
+
*/
|
|
109
|
+
WebSocket?: WebSocketConstructor;
|
|
110
|
+
}
|
|
111
|
+
export interface TradesFilter {
|
|
112
|
+
/** Only trades with `lot >= minLot` (`0` clears). */
|
|
113
|
+
minLot?: number;
|
|
114
|
+
/** Only trades with `value >= minValue` Rupiah (`0` clears). */
|
|
115
|
+
minValue?: number;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Real-time running trade and order book stream (`wss://api.invezgo.com/ws`, Elite plan).
|
|
119
|
+
* Connects on construction; subscriptions are queued until `connected` and replayed after every reconnect.
|
|
120
|
+
*/
|
|
121
|
+
export declare class InvezgoRealtime {
|
|
122
|
+
#private;
|
|
123
|
+
constructor(options: RealtimeOptions);
|
|
124
|
+
on<K extends keyof RealtimeEvents>(event: K, fn: (payload: RealtimeEvents[K]) => void): this;
|
|
125
|
+
off<K extends keyof RealtimeEvents>(event: K, fn: (payload: RealtimeEvents[K]) => void): this;
|
|
126
|
+
/** Running trades for `codes`, or every stock when `codes` is omitted. */
|
|
127
|
+
subscribeTrades(codes?: string[], filter?: TradesFilter): void;
|
|
128
|
+
/** Order book for `codes` (1 to 20 codes per connection). */
|
|
129
|
+
subscribeOrderbook(codes: string[]): void;
|
|
130
|
+
/** Stop `codes` on `channel`, or the whole channel (and trade filters) when `codes` is omitted. */
|
|
131
|
+
unsubscribe(channel: 'trades' | 'orderbook', codes?: string[]): void;
|
|
132
|
+
/** Server answers with a `pong` event. */
|
|
133
|
+
ping(): void;
|
|
134
|
+
/** Close for good (no reconnect). */
|
|
135
|
+
close(): void;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=realtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../src/realtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAKb,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D,6BAA6B;AAC7B,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,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
|
+
export type WebhookVerificationReason = 'timestamp' | 'signature' | 'payload';
|
|
3
|
+
/** Thrown by {@link verifyWebhook} / {@link parseWebhook}. Not an HTTP API error. */
|
|
4
|
+
export declare class WebhookVerificationError extends Error {
|
|
5
|
+
readonly reason: WebhookVerificationReason;
|
|
6
|
+
constructor(reason: WebhookVerificationReason, message: string, cause?: unknown);
|
|
7
|
+
}
|
|
8
|
+
/** `data` of every `update.*` event. */
|
|
9
|
+
export interface WebhookUpdateData {
|
|
10
|
+
/** `YYYY-MM-DD` (`YYYY-MM-DD HH:mm:ss` WIB for `update.news`). */
|
|
11
|
+
date: string;
|
|
12
|
+
/** API endpoints whose data changed. */
|
|
13
|
+
path: string[];
|
|
14
|
+
code?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface WebhookAlertStock {
|
|
18
|
+
code: string;
|
|
19
|
+
price: number;
|
|
20
|
+
}
|
|
21
|
+
/** `data` of `alert.triggered`. */
|
|
22
|
+
export interface WebhookAlertTriggeredData {
|
|
23
|
+
alert_id: string;
|
|
24
|
+
alert_name: string;
|
|
25
|
+
stocks_in: WebhookAlertStock[];
|
|
26
|
+
stocks_out: WebhookAlertStock[];
|
|
27
|
+
}
|
|
28
|
+
/** `data` of `alert.disabled`. */
|
|
29
|
+
export interface WebhookAlertDisabledData {
|
|
30
|
+
alert_id: string;
|
|
31
|
+
alert_name: string;
|
|
32
|
+
reason: string;
|
|
33
|
+
}
|
|
34
|
+
/** `data` of `test.ping`. */
|
|
35
|
+
export interface WebhookTestPingData {
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
/** `data` of `quota.low` / `quota.exhausted`. */
|
|
39
|
+
export interface WebhookQuotaData {
|
|
40
|
+
plan: string;
|
|
41
|
+
limit: number;
|
|
42
|
+
used: number;
|
|
43
|
+
remaining: number;
|
|
44
|
+
/** Unix seconds. */
|
|
45
|
+
reset_at: number | null;
|
|
46
|
+
}
|
|
47
|
+
type UpdateType = 'summary' | 'notation' | 'news' | 'disclosure' | 'financial' | 'five' | 'one' | 'classification' | 'ksei' | 'hsc' | 'shareholder' | 'insider' | 'uma' | 'suspend' | 'calendar';
|
|
48
|
+
/** Documented event name (`{domain}.{type}`) → `data` type. */
|
|
49
|
+
export type WebhookEventMap = {
|
|
50
|
+
[K in `update.${UpdateType}`]: WebhookUpdateData;
|
|
51
|
+
} & {
|
|
52
|
+
'alert.triggered': WebhookAlertTriggeredData;
|
|
53
|
+
'alert.disabled': WebhookAlertDisabledData;
|
|
54
|
+
'test.ping': WebhookTestPingData;
|
|
55
|
+
'quota.low': WebhookQuotaData;
|
|
56
|
+
'quota.exhausted': WebhookQuotaData;
|
|
57
|
+
};
|
|
58
|
+
/** A webhook delivery. `domain`/`type` are plain strings so new events never break decoding. */
|
|
59
|
+
export interface WebhookEvent<D = Record<string, unknown>> {
|
|
60
|
+
/** Delivery id (same as `X-Invezgo-Delivery`); stable across retries, use it to deduplicate. */
|
|
61
|
+
id: string;
|
|
62
|
+
domain: string;
|
|
63
|
+
type: string;
|
|
64
|
+
/** Unix seconds. */
|
|
65
|
+
created_at: number;
|
|
66
|
+
data: D;
|
|
67
|
+
/** `"{domain}.{type}"`, e.g. `update.summary`. */
|
|
68
|
+
event: string;
|
|
69
|
+
}
|
|
70
|
+
/** Narrow an event to a documented event name so `data` gets its typed shape. */
|
|
71
|
+
export declare function isWebhookEvent<K extends keyof WebhookEventMap>(event: WebhookEvent<unknown>, name: K): event is WebhookEvent<WebhookEventMap[K]>;
|
|
72
|
+
/** Request headers: a `Headers` instance, Node's `req.headers`, or `{ signature, timestamp }`. */
|
|
73
|
+
export type WebhookHeaders = Headers | Record<string, string | string[] | undefined>;
|
|
74
|
+
export interface VerifyWebhookOptions {
|
|
75
|
+
/** Maximum age/skew of `X-Invezgo-Timestamp` in seconds. Default `300`. */
|
|
76
|
+
tolerance?: number;
|
|
77
|
+
/** Current Unix time in seconds (for tests). Default `Date.now() / 1000`. */
|
|
78
|
+
now?: number;
|
|
79
|
+
}
|
|
80
|
+
/** Decode a webhook body without verifying it (tests or already-verified bodies). */
|
|
81
|
+
export declare function parseWebhook<D = Record<string, unknown>>(rawBody: string | Uint8Array): WebhookEvent<D>;
|
|
82
|
+
/**
|
|
83
|
+
* Verify the `X-Invezgo-Signature` of a webhook delivery and decode it.
|
|
84
|
+
*
|
|
85
|
+
* `rawBody` must be the exact bytes/string received, before any JSON parsing.
|
|
86
|
+
* Throws {@link WebhookVerificationError} with `reason` `timestamp`, `signature` or `payload`.
|
|
87
|
+
*/
|
|
88
|
+
export declare function verifyWebhook<D = Record<string, unknown>>(rawBody: string | Uint8Array, headers: WebhookHeaders, secret: string, options?: VerifyWebhookOptions): Promise<WebhookEvent<D>>;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=webhook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../src/webhook.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;AAE9E,qFAAqF;AACrF,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;gBAE/B,MAAM,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAKhF;AAED,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,mCAAmC;AACnC,MAAM,WAAW,yBAAyB;IACxC,QAAQ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C;IACf,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,CAAC,CAAC;IACR,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,eAAe,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAEhJ;AAED,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;AAErF,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAaD,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAYvG;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,OAAO,EAAE,MAAM,GAAG,UAAU,EAC5B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAqB1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invezgo/sdk",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Official Invezgo API SDK for JavaScript & TypeScript: fully typed access to Indonesia Stock Exchange (IDX/BEI) data with built-in LRU caching and API key rotation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"generate": "python ../codegen/generate.py ts",
|
|
26
26
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && rollup -c rollup.config.mjs && tsc --emitDeclarationOnly --outDir dist",
|
|
27
27
|
"typecheck": "tsc --noEmit && tsc --noEmit -p examples",
|
|
28
|
-
"test": "npm run build && node --test test/client.test.mjs",
|
|
28
|
+
"test": "npm run build && node --test test/client.test.mjs test/webhook.test.mjs test/realtime.test.mjs",
|
|
29
29
|
"prepublishOnly": "npm run typecheck && npm test"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|