propline 0.1.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/dist/index.js ADDED
@@ -0,0 +1,369 @@
1
+ // src/client.ts
2
+ import { createHmac, timingSafeEqual } from "crypto";
3
+ import { writeFile } from "fs/promises";
4
+ var PropLineError = class extends Error {
5
+ statusCode;
6
+ detail;
7
+ constructor(statusCode, detail) {
8
+ super(`[${statusCode}] ${detail}`);
9
+ this.name = "PropLineError";
10
+ this.statusCode = statusCode;
11
+ this.detail = detail;
12
+ Object.setPrototypeOf(this, new.target.prototype);
13
+ }
14
+ };
15
+ var AuthError = class extends PropLineError {
16
+ constructor(detail = "Invalid API key") {
17
+ super(401, detail);
18
+ this.name = "AuthError";
19
+ Object.setPrototypeOf(this, new.target.prototype);
20
+ }
21
+ };
22
+ var RateLimitError = class extends PropLineError {
23
+ constructor(detail = "Rate limit exceeded") {
24
+ super(429, detail);
25
+ this.name = "RateLimitError";
26
+ Object.setPrototypeOf(this, new.target.prototype);
27
+ }
28
+ };
29
+ var DEFAULT_BASE_URL = "https://api.prop-line.com/v1";
30
+ var DEFAULT_TIMEOUT_MS = 15e3;
31
+ var PropLine = class {
32
+ apiKey;
33
+ baseUrl;
34
+ timeoutMs;
35
+ _fetch;
36
+ constructor(apiKey, options = {}) {
37
+ if (!apiKey) {
38
+ throw new Error("PropLine: apiKey is required");
39
+ }
40
+ this.apiKey = apiKey;
41
+ this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
42
+ this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
43
+ this._fetch = options.fetch ?? globalThis.fetch;
44
+ if (!this._fetch) {
45
+ throw new Error(
46
+ "PropLine: global fetch is unavailable. Use Node 18+ or pass options.fetch."
47
+ );
48
+ }
49
+ }
50
+ // ------------------------------------------------------------------
51
+ // Internals
52
+ // ------------------------------------------------------------------
53
+ _buildUrl(path, params) {
54
+ const url = new URL(`${this.baseUrl}${path}`);
55
+ if (params) {
56
+ for (const [k, v] of Object.entries(params)) {
57
+ if (v !== void 0 && v !== null) {
58
+ url.searchParams.set(k, String(v));
59
+ }
60
+ }
61
+ }
62
+ return url.toString();
63
+ }
64
+ async _request(method, path, init = {}) {
65
+ const url = this._buildUrl(path, init.params);
66
+ const controller = new AbortController();
67
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
68
+ let resp;
69
+ try {
70
+ resp = await this._fetch(url, {
71
+ method,
72
+ headers: {
73
+ "X-API-Key": this.apiKey,
74
+ ...init.body !== void 0 ? { "Content-Type": "application/json" } : {}
75
+ },
76
+ body: init.body !== void 0 ? JSON.stringify(init.body) : void 0,
77
+ signal: controller.signal
78
+ });
79
+ } finally {
80
+ clearTimeout(timer);
81
+ }
82
+ if (resp.status === 401) {
83
+ throw new AuthError(await readDetail(resp, "Invalid API key"));
84
+ }
85
+ if (resp.status === 429) {
86
+ throw new RateLimitError(await readDetail(resp, "Rate limit exceeded"));
87
+ }
88
+ if (resp.status >= 400) {
89
+ throw new PropLineError(resp.status, await readDetail(resp, resp.statusText));
90
+ }
91
+ if (resp.status === 204) {
92
+ return void 0;
93
+ }
94
+ return await resp.json();
95
+ }
96
+ // ------------------------------------------------------------------
97
+ // Public API
98
+ // ------------------------------------------------------------------
99
+ /** List all available sports. */
100
+ getSports() {
101
+ return this._request("GET", "/sports");
102
+ }
103
+ /** List upcoming events for a sport. */
104
+ getEvents(sport) {
105
+ return this._request("GET", `/sports/${encodeURIComponent(sport)}/events`);
106
+ }
107
+ getOdds(sport, options = {}) {
108
+ const params = {};
109
+ if (options.markets?.length) {
110
+ params.markets = options.markets.join(",");
111
+ }
112
+ const sp = encodeURIComponent(sport);
113
+ if (options.eventId !== void 0) {
114
+ return this._request(
115
+ "GET",
116
+ `/sports/${sp}/events/${encodeURIComponent(String(options.eventId))}/odds`,
117
+ { params }
118
+ );
119
+ }
120
+ return this._request("GET", `/sports/${sp}/odds`, { params });
121
+ }
122
+ /** List the available market types for an event. */
123
+ getMarkets(sport, eventId) {
124
+ return this._request(
125
+ "GET",
126
+ `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/markets`
127
+ );
128
+ }
129
+ /**
130
+ * Get historical odds movement for an event.
131
+ *
132
+ * Pro tier: full snapshots. Free tier: redacted (snapshot counts only).
133
+ */
134
+ getOddsHistory(sport, eventId, options = {}) {
135
+ const params = {};
136
+ if (options.markets?.length) {
137
+ params.markets = options.markets.join(",");
138
+ }
139
+ return this._request(
140
+ "GET",
141
+ `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/odds/history`,
142
+ { params }
143
+ );
144
+ }
145
+ /** Get game scores and status (free tier). */
146
+ getScores(sport, options = {}) {
147
+ return this._request(
148
+ "GET",
149
+ `/sports/${encodeURIComponent(sport)}/scores`,
150
+ { params: { days_from: options.daysFrom ?? 3 } }
151
+ );
152
+ }
153
+ /**
154
+ * Get raw player/team box-score stats (book-agnostic, free tier).
155
+ *
156
+ * Returns actual stat values decoupled from any bookmaker's lines.
157
+ */
158
+ getStats(sport, eventId, options = {}) {
159
+ const params = {};
160
+ if (options.statType?.length) {
161
+ params.stat_type = options.statType.join(",");
162
+ }
163
+ return this._request(
164
+ "GET",
165
+ `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/stats`,
166
+ { params }
167
+ );
168
+ }
169
+ /**
170
+ * Get resolved prop outcomes with actual player stats.
171
+ *
172
+ * Pro tier: full data. Free tier: redacted (resolution + actual nulled).
173
+ */
174
+ getResults(sport, eventId, options = {}) {
175
+ const params = {};
176
+ if (options.markets?.length) {
177
+ params.markets = options.markets.join(",");
178
+ }
179
+ return this._request(
180
+ "GET",
181
+ `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/results`,
182
+ { params }
183
+ );
184
+ }
185
+ /**
186
+ * Recent resolved prop history for a player on a market.
187
+ *
188
+ * One entry per (event, bookmaker) pair. Pro: full. Free: redacted.
189
+ */
190
+ getPlayerHistory(sport, playerName, options) {
191
+ const params = {
192
+ market: options.market,
193
+ limit: options.limit ?? 20
194
+ };
195
+ if (options.bookmaker) {
196
+ params.bookmaker = options.bookmaker;
197
+ }
198
+ return this._request(
199
+ "GET",
200
+ `/sports/${encodeURIComponent(sport)}/players/${encodeURIComponent(playerName)}/history`,
201
+ { params }
202
+ );
203
+ }
204
+ async exportResolvedProps(options) {
205
+ const params = { sport: options.sport };
206
+ if (options.market) params.market = options.market;
207
+ if (options.bookmaker) params.bookmaker = options.bookmaker;
208
+ if (options.since) params.since = options.since;
209
+ if (options.until) params.until = options.until;
210
+ const url = this._buildUrl("/exports/resolved-props", params);
211
+ const controller = new AbortController();
212
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
213
+ let resp;
214
+ try {
215
+ resp = await this._fetch(url, {
216
+ method: "GET",
217
+ headers: { "X-API-Key": this.apiKey },
218
+ signal: controller.signal
219
+ });
220
+ } finally {
221
+ clearTimeout(timer);
222
+ }
223
+ if (resp.status === 401) {
224
+ throw new AuthError();
225
+ }
226
+ if (resp.status === 403) {
227
+ throw new PropLineError(403, await readDetail(resp, "Pro tier required"));
228
+ }
229
+ if (resp.status >= 400) {
230
+ throw new PropLineError(resp.status, await readDetail(resp, resp.statusText));
231
+ }
232
+ const buf = new Uint8Array(await resp.arrayBuffer());
233
+ if (options.outPath) {
234
+ await writeFile(options.outPath, buf);
235
+ return options.outPath;
236
+ }
237
+ return buf;
238
+ }
239
+ // ------------------------------------------------------------------
240
+ // Webhooks (Streaming tier)
241
+ // ------------------------------------------------------------------
242
+ /**
243
+ * Register a webhook subscription. Streaming tier only.
244
+ *
245
+ * The returned object includes the full signing `secret` — this is the
246
+ * ONLY time it's revealed. Store it securely.
247
+ */
248
+ createWebhook(options) {
249
+ return this._request("POST", "/webhooks", {
250
+ body: webhookBody(options)
251
+ });
252
+ }
253
+ /** List your webhook subscriptions. Secrets are masked. */
254
+ listWebhooks() {
255
+ return this._request("GET", "/webhooks");
256
+ }
257
+ /** Get a single webhook subscription. Secret is masked. */
258
+ getWebhook(webhookId) {
259
+ return this._request("GET", `/webhooks/${webhookId}`);
260
+ }
261
+ /** Update fields on a webhook. Only supplied fields are changed. */
262
+ updateWebhook(webhookId, options) {
263
+ return this._request("PATCH", `/webhooks/${webhookId}`, {
264
+ body: webhookBody(options)
265
+ });
266
+ }
267
+ /** Delete a webhook (cascades its delivery history). */
268
+ deleteWebhook(webhookId) {
269
+ return this._request("DELETE", `/webhooks/${webhookId}`);
270
+ }
271
+ /** Queue a sample `test` payload to the webhook's URL. */
272
+ testWebhook(webhookId) {
273
+ return this._request("POST", `/webhooks/${webhookId}/test`);
274
+ }
275
+ /** Last 50 (default) delivery attempts for a webhook. */
276
+ listWebhookDeliveries(webhookId, options = {}) {
277
+ return this._request(
278
+ "GET",
279
+ `/webhooks/${webhookId}/deliveries`,
280
+ { params: { limit: options.limit ?? 50 } }
281
+ );
282
+ }
283
+ /**
284
+ * Verify that an inbound webhook delivery was signed by PropLine.
285
+ *
286
+ * Compares HMAC-SHA256(secret, `${timestamp}.` + body) against the
287
+ * `X-PropLine-Signature` header in constant time.
288
+ *
289
+ * @example
290
+ * ```ts
291
+ * import { PropLine } from "propline";
292
+ *
293
+ * app.post("/hooks/propline", express.raw({ type: "*\/*" }), (req, res) => {
294
+ * const ok = PropLine.verifySignature({
295
+ * secret: process.env.WEBHOOK_SECRET!,
296
+ * timestamp: req.header("X-PropLine-Timestamp")!,
297
+ * body: req.body, // raw Buffer
298
+ * signature: req.header("X-PropLine-Signature")!,
299
+ * });
300
+ * if (!ok) return res.status(401).end();
301
+ * // ...
302
+ * });
303
+ * ```
304
+ */
305
+ static verifySignature(options) {
306
+ const { secret, timestamp, body, signature } = options;
307
+ const bodyBuf = typeof body === "string" ? Buffer.from(body, "utf8") : body instanceof Buffer ? body : Buffer.from(body);
308
+ const message = Buffer.concat([Buffer.from(`${timestamp}.`, "utf8"), bodyBuf]);
309
+ const expected = createHmac("sha256", secret).update(message).digest("hex");
310
+ if (expected.length !== signature.length) return false;
311
+ try {
312
+ return timingSafeEqual(Buffer.from(expected, "hex"), Buffer.from(signature, "hex"));
313
+ } catch {
314
+ return false;
315
+ }
316
+ }
317
+ };
318
+ function webhookBody(options) {
319
+ const body = {};
320
+ const map = [
321
+ ["url", "url"],
322
+ ["events", "events"],
323
+ ["filterSportKey", "filter_sport_key"],
324
+ ["filterEventId", "filter_event_id"],
325
+ ["filterMarketKey", "filter_market_key"],
326
+ ["filterPlayerName", "filter_player_name"],
327
+ ["minPriceChangePct", "min_price_change_pct"],
328
+ ["active", "active"]
329
+ ];
330
+ for (const [src, dst] of map) {
331
+ const v = options[src];
332
+ if (v !== void 0) body[dst] = v;
333
+ }
334
+ return body;
335
+ }
336
+ async function readDetail(resp, fallback) {
337
+ try {
338
+ const text = await resp.text();
339
+ if (!text) return fallback;
340
+ try {
341
+ const json = JSON.parse(text);
342
+ if (typeof json.detail === "string") return json.detail;
343
+ } catch {
344
+ }
345
+ return text || fallback;
346
+ } catch {
347
+ return fallback;
348
+ }
349
+ }
350
+
351
+ // src/index.ts
352
+ var Bookmakers = {
353
+ BOVADA: "bovada",
354
+ DRAFTKINGS: "draftkings",
355
+ FANDUEL: "fanduel",
356
+ PINNACLE: "pinnacle",
357
+ PRIZEPICKS: "prizepicks",
358
+ UNIBET: "unibet"
359
+ };
360
+ var VERSION = "0.1.0";
361
+ export {
362
+ AuthError,
363
+ Bookmakers,
364
+ PropLine,
365
+ PropLineError,
366
+ RateLimitError,
367
+ VERSION
368
+ };
369
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client.ts","../src/index.ts"],"sourcesContent":["import { createHmac, timingSafeEqual } from \"node:crypto\";\nimport { writeFile } from \"node:fs/promises\";\n\nimport type {\n Sport,\n Event as PropLineEvent,\n OddsResponse,\n MarketSummary,\n OddsHistoryResponse,\n ScoreEvent,\n StatsResponse,\n ResultsResponse,\n PlayerHistoryResponse,\n Webhook,\n WebhookDelivery,\n} from \"./types.js\";\n\n/** Base error for all PropLine API failures. */\nexport class PropLineError extends Error {\n readonly statusCode: number;\n readonly detail: string;\n\n constructor(statusCode: number, detail: string) {\n super(`[${statusCode}] ${detail}`);\n this.name = \"PropLineError\";\n this.statusCode = statusCode;\n this.detail = detail;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/** Thrown when the API key is missing or invalid (HTTP 401). */\nexport class AuthError extends PropLineError {\n constructor(detail = \"Invalid API key\") {\n super(401, detail);\n this.name = \"AuthError\";\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/** Thrown when the daily request limit is exceeded (HTTP 429). */\nexport class RateLimitError extends PropLineError {\n constructor(detail = \"Rate limit exceeded\") {\n super(429, detail);\n this.name = \"RateLimitError\";\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nexport interface PropLineOptions {\n /** API base URL. Default: `https://api.prop-line.com/v1`. */\n baseUrl?: string;\n /** Request timeout in milliseconds. Default: 15000. */\n timeoutMs?: number;\n /** Custom fetch implementation. Defaults to global `fetch` (Node 18+). */\n fetch?: typeof fetch;\n}\n\nexport interface GetOddsOptions {\n /** Specific event ID to get odds (with player props) for. Omit for bulk odds. */\n eventId?: number | string;\n /** Market keys to filter by. */\n markets?: string[];\n}\n\nexport interface GetOddsHistoryOptions {\n markets?: string[];\n}\n\nexport interface GetScoresOptions {\n /** Days back to include (default 3). */\n daysFrom?: number;\n}\n\nexport interface GetStatsOptions {\n /** Stat types to filter by (e.g. `[\"strikeouts\", \"hits\"]`). */\n statType?: string[];\n}\n\nexport interface GetResultsOptions {\n markets?: string[];\n}\n\nexport interface GetPlayerHistoryOptions {\n /** Market key (e.g. `\"pitcher_strikeouts\"`). Required. */\n market: string;\n /** Restrict to a single bookmaker (e.g. `\"draftkings\"`). */\n bookmaker?: string;\n /** Max entries (1-100). Default 20. */\n limit?: number;\n}\n\nexport interface ExportResolvedPropsOptions {\n /** Sport key (e.g. `\"baseball_mlb\"`). Required. */\n sport: string;\n /** Optional market filter. */\n market?: string;\n /** Optional bookmaker filter. */\n bookmaker?: string;\n /** ISO datetime lower bound on `resolved_at`. */\n since?: string;\n /** ISO datetime upper bound on `resolved_at`. */\n until?: string;\n /** If set, stream the CSV to this path and resolve to the path. Otherwise resolve to the CSV bytes. */\n outPath?: string;\n}\n\nexport interface CreateWebhookOptions {\n /** HTTPS endpoint to receive POSTed events. Required. */\n url: string;\n /** Event types to subscribe to. Default: all. */\n events?: Array<\"line_movement\" | \"resolution\">;\n filterSportKey?: string;\n filterEventId?: number;\n filterMarketKey?: string;\n filterPlayerName?: string;\n /** Minimum % change in American odds to fire a line_movement. Point-only shifts always pass. */\n minPriceChangePct?: number;\n}\n\nexport interface UpdateWebhookOptions {\n url?: string;\n events?: Array<\"line_movement\" | \"resolution\">;\n filterSportKey?: string;\n filterEventId?: number;\n filterMarketKey?: string;\n filterPlayerName?: string;\n minPriceChangePct?: number;\n active?: boolean;\n}\n\nexport interface ListWebhookDeliveriesOptions {\n /** Max deliveries to return. Default 50. */\n limit?: number;\n}\n\nexport interface VerifySignatureOptions {\n /** Webhook signing secret (returned once from `createWebhook`). */\n secret: string;\n /** Value of the `X-PropLine-Timestamp` header. */\n timestamp: string;\n /** Raw request body. */\n body: Uint8Array | Buffer | string;\n /** Value of the `X-PropLine-Signature` header. */\n signature: string;\n}\n\nconst DEFAULT_BASE_URL = \"https://api.prop-line.com/v1\";\nconst DEFAULT_TIMEOUT_MS = 15_000;\n\n/**\n * Client for the PropLine player props API.\n *\n * @example\n * ```ts\n * import { PropLine } from \"propline\";\n *\n * const client = new PropLine(\"your_api_key\");\n * const sports = await client.getSports();\n * ```\n */\nexport class PropLine {\n readonly apiKey: string;\n readonly baseUrl: string;\n readonly timeoutMs: number;\n private readonly _fetch: typeof fetch;\n\n constructor(apiKey: string, options: PropLineOptions = {}) {\n if (!apiKey) {\n throw new Error(\"PropLine: apiKey is required\");\n }\n this.apiKey = apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, \"\");\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this._fetch = options.fetch ?? globalThis.fetch;\n if (!this._fetch) {\n throw new Error(\n \"PropLine: global fetch is unavailable. Use Node 18+ or pass options.fetch.\"\n );\n }\n }\n\n // ------------------------------------------------------------------\n // Internals\n // ------------------------------------------------------------------\n\n private _buildUrl(path: string, params?: Record<string, string | number | undefined>): string {\n const url = new URL(`${this.baseUrl}${path}`);\n if (params) {\n for (const [k, v] of Object.entries(params)) {\n if (v !== undefined && v !== null) {\n url.searchParams.set(k, String(v));\n }\n }\n }\n return url.toString();\n }\n\n private async _request<T>(\n method: string,\n path: string,\n init: { params?: Record<string, string | number | undefined>; body?: unknown } = {}\n ): Promise<T> {\n const url = this._buildUrl(path, init.params);\n\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n\n let resp: Response;\n try {\n resp = await this._fetch(url, {\n method,\n headers: {\n \"X-API-Key\": this.apiKey,\n ...(init.body !== undefined ? { \"Content-Type\": \"application/json\" } : {}),\n },\n body: init.body !== undefined ? JSON.stringify(init.body) : undefined,\n signal: controller.signal,\n });\n } finally {\n clearTimeout(timer);\n }\n\n if (resp.status === 401) {\n throw new AuthError(await readDetail(resp, \"Invalid API key\"));\n }\n if (resp.status === 429) {\n throw new RateLimitError(await readDetail(resp, \"Rate limit exceeded\"));\n }\n if (resp.status >= 400) {\n throw new PropLineError(resp.status, await readDetail(resp, resp.statusText));\n }\n\n if (resp.status === 204) {\n return undefined as T;\n }\n return (await resp.json()) as T;\n }\n\n // ------------------------------------------------------------------\n // Public API\n // ------------------------------------------------------------------\n\n /** List all available sports. */\n getSports(): Promise<Sport[]> {\n return this._request<Sport[]>(\"GET\", \"/sports\");\n }\n\n /** List upcoming events for a sport. */\n getEvents(sport: string): Promise<PropLineEvent[]> {\n return this._request<PropLineEvent[]>(\"GET\", `/sports/${encodeURIComponent(sport)}/events`);\n }\n\n /**\n * Get current odds. With `eventId`, returns single-event odds (including\n * player props). Without, returns bulk odds for all upcoming events.\n *\n * Each response carries a `bookmakers` array — iterate it to compare\n * lines across Bovada, DraftKings, FanDuel, Pinnacle, Unibet, and\n * PrizePicks (coverage varies by sport).\n */\n getOdds(\n sport: string,\n options: GetOddsOptions & { eventId: number | string }\n ): Promise<OddsResponse>;\n getOdds(\n sport: string,\n options?: Omit<GetOddsOptions, \"eventId\"> & { eventId?: undefined }\n ): Promise<OddsResponse[]>;\n getOdds(\n sport: string,\n options: GetOddsOptions = {}\n ): Promise<OddsResponse | OddsResponse[]> {\n const params: Record<string, string | undefined> = {};\n if (options.markets?.length) {\n params.markets = options.markets.join(\",\");\n }\n const sp = encodeURIComponent(sport);\n if (options.eventId !== undefined) {\n return this._request<OddsResponse>(\n \"GET\",\n `/sports/${sp}/events/${encodeURIComponent(String(options.eventId))}/odds`,\n { params }\n );\n }\n return this._request<OddsResponse[]>(\"GET\", `/sports/${sp}/odds`, { params });\n }\n\n /** List the available market types for an event. */\n getMarkets(sport: string, eventId: number | string): Promise<MarketSummary[]> {\n return this._request<MarketSummary[]>(\n \"GET\",\n `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/markets`\n );\n }\n\n /**\n * Get historical odds movement for an event.\n *\n * Pro tier: full snapshots. Free tier: redacted (snapshot counts only).\n */\n getOddsHistory(\n sport: string,\n eventId: number | string,\n options: GetOddsHistoryOptions = {}\n ): Promise<OddsHistoryResponse> {\n const params: Record<string, string | undefined> = {};\n if (options.markets?.length) {\n params.markets = options.markets.join(\",\");\n }\n return this._request<OddsHistoryResponse>(\n \"GET\",\n `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/odds/history`,\n { params }\n );\n }\n\n /** Get game scores and status (free tier). */\n getScores(sport: string, options: GetScoresOptions = {}): Promise<ScoreEvent[]> {\n return this._request<ScoreEvent[]>(\n \"GET\",\n `/sports/${encodeURIComponent(sport)}/scores`,\n { params: { days_from: options.daysFrom ?? 3 } }\n );\n }\n\n /**\n * Get raw player/team box-score stats (book-agnostic, free tier).\n *\n * Returns actual stat values decoupled from any bookmaker's lines.\n */\n getStats(\n sport: string,\n eventId: number | string,\n options: GetStatsOptions = {}\n ): Promise<StatsResponse> {\n const params: Record<string, string | undefined> = {};\n if (options.statType?.length) {\n params.stat_type = options.statType.join(\",\");\n }\n return this._request<StatsResponse>(\n \"GET\",\n `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/stats`,\n { params }\n );\n }\n\n /**\n * Get resolved prop outcomes with actual player stats.\n *\n * Pro tier: full data. Free tier: redacted (resolution + actual nulled).\n */\n getResults(\n sport: string,\n eventId: number | string,\n options: GetResultsOptions = {}\n ): Promise<ResultsResponse> {\n const params: Record<string, string | undefined> = {};\n if (options.markets?.length) {\n params.markets = options.markets.join(\",\");\n }\n return this._request<ResultsResponse>(\n \"GET\",\n `/sports/${encodeURIComponent(sport)}/events/${encodeURIComponent(String(eventId))}/results`,\n { params }\n );\n }\n\n /**\n * Recent resolved prop history for a player on a market.\n *\n * One entry per (event, bookmaker) pair. Pro: full. Free: redacted.\n */\n getPlayerHistory(\n sport: string,\n playerName: string,\n options: GetPlayerHistoryOptions\n ): Promise<PlayerHistoryResponse> {\n const params: Record<string, string | number | undefined> = {\n market: options.market,\n limit: options.limit ?? 20,\n };\n if (options.bookmaker) {\n params.bookmaker = options.bookmaker;\n }\n return this._request<PlayerHistoryResponse>(\n \"GET\",\n `/sports/${encodeURIComponent(sport)}/players/${encodeURIComponent(playerName)}/history`,\n { params }\n );\n }\n\n /**\n * Bulk CSV export of resolved prop outcomes (Pro+ tier).\n *\n * If `outPath` is provided, streams the CSV to disk and resolves to the\n * path. Otherwise resolves to the full CSV bytes as a `Uint8Array`.\n *\n * @example\n * ```ts\n * await client.exportResolvedProps({\n * sport: \"baseball_mlb\",\n * market: \"pitcher_strikeouts\",\n * since: \"2026-04-01T00:00:00Z\",\n * outPath: \"./mlb-strikeouts.csv\",\n * });\n * ```\n */\n async exportResolvedProps(\n options: ExportResolvedPropsOptions & { outPath: string }\n ): Promise<string>;\n async exportResolvedProps(\n options: ExportResolvedPropsOptions & { outPath?: undefined }\n ): Promise<Uint8Array>;\n async exportResolvedProps(\n options: ExportResolvedPropsOptions\n ): Promise<string | Uint8Array> {\n const params: Record<string, string | undefined> = { sport: options.sport };\n if (options.market) params.market = options.market;\n if (options.bookmaker) params.bookmaker = options.bookmaker;\n if (options.since) params.since = options.since;\n if (options.until) params.until = options.until;\n\n const url = this._buildUrl(\"/exports/resolved-props\", params);\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n\n let resp: Response;\n try {\n resp = await this._fetch(url, {\n method: \"GET\",\n headers: { \"X-API-Key\": this.apiKey },\n signal: controller.signal,\n });\n } finally {\n clearTimeout(timer);\n }\n\n if (resp.status === 401) {\n throw new AuthError();\n }\n if (resp.status === 403) {\n throw new PropLineError(403, await readDetail(resp, \"Pro tier required\"));\n }\n if (resp.status >= 400) {\n throw new PropLineError(resp.status, await readDetail(resp, resp.statusText));\n }\n\n const buf = new Uint8Array(await resp.arrayBuffer());\n if (options.outPath) {\n await writeFile(options.outPath, buf);\n return options.outPath;\n }\n return buf;\n }\n\n // ------------------------------------------------------------------\n // Webhooks (Streaming tier)\n // ------------------------------------------------------------------\n\n /**\n * Register a webhook subscription. Streaming tier only.\n *\n * The returned object includes the full signing `secret` — this is the\n * ONLY time it's revealed. Store it securely.\n */\n createWebhook(options: CreateWebhookOptions): Promise<Webhook> {\n return this._request<Webhook>(\"POST\", \"/webhooks\", {\n body: webhookBody(options),\n });\n }\n\n /** List your webhook subscriptions. Secrets are masked. */\n listWebhooks(): Promise<Webhook[]> {\n return this._request<Webhook[]>(\"GET\", \"/webhooks\");\n }\n\n /** Get a single webhook subscription. Secret is masked. */\n getWebhook(webhookId: number): Promise<Webhook> {\n return this._request<Webhook>(\"GET\", `/webhooks/${webhookId}`);\n }\n\n /** Update fields on a webhook. Only supplied fields are changed. */\n updateWebhook(webhookId: number, options: UpdateWebhookOptions): Promise<Webhook> {\n return this._request<Webhook>(\"PATCH\", `/webhooks/${webhookId}`, {\n body: webhookBody(options),\n });\n }\n\n /** Delete a webhook (cascades its delivery history). */\n deleteWebhook(webhookId: number): Promise<{ ok: boolean } | unknown> {\n return this._request(\"DELETE\", `/webhooks/${webhookId}`);\n }\n\n /** Queue a sample `test` payload to the webhook's URL. */\n testWebhook(webhookId: number): Promise<unknown> {\n return this._request(\"POST\", `/webhooks/${webhookId}/test`);\n }\n\n /** Last 50 (default) delivery attempts for a webhook. */\n listWebhookDeliveries(\n webhookId: number,\n options: ListWebhookDeliveriesOptions = {}\n ): Promise<WebhookDelivery[]> {\n return this._request<WebhookDelivery[]>(\n \"GET\",\n `/webhooks/${webhookId}/deliveries`,\n { params: { limit: options.limit ?? 50 } }\n );\n }\n\n /**\n * Verify that an inbound webhook delivery was signed by PropLine.\n *\n * Compares HMAC-SHA256(secret, `${timestamp}.` + body) against the\n * `X-PropLine-Signature` header in constant time.\n *\n * @example\n * ```ts\n * import { PropLine } from \"propline\";\n *\n * app.post(\"/hooks/propline\", express.raw({ type: \"*\\/*\" }), (req, res) => {\n * const ok = PropLine.verifySignature({\n * secret: process.env.WEBHOOK_SECRET!,\n * timestamp: req.header(\"X-PropLine-Timestamp\")!,\n * body: req.body, // raw Buffer\n * signature: req.header(\"X-PropLine-Signature\")!,\n * });\n * if (!ok) return res.status(401).end();\n * // ...\n * });\n * ```\n */\n static verifySignature(options: VerifySignatureOptions): boolean {\n const { secret, timestamp, body, signature } = options;\n const bodyBuf =\n typeof body === \"string\"\n ? Buffer.from(body, \"utf8\")\n : body instanceof Buffer\n ? body\n : Buffer.from(body);\n const message = Buffer.concat([Buffer.from(`${timestamp}.`, \"utf8\"), bodyBuf]);\n const expected = createHmac(\"sha256\", secret).update(message).digest(\"hex\");\n if (expected.length !== signature.length) return false;\n try {\n return timingSafeEqual(Buffer.from(expected, \"hex\"), Buffer.from(signature, \"hex\"));\n } catch {\n return false;\n }\n }\n}\n\nfunction webhookBody(options: CreateWebhookOptions | UpdateWebhookOptions): Record<string, unknown> {\n const body: Record<string, unknown> = {};\n const map: Array<[keyof (CreateWebhookOptions & UpdateWebhookOptions), string]> = [\n [\"url\", \"url\"],\n [\"events\", \"events\"],\n [\"filterSportKey\", \"filter_sport_key\"],\n [\"filterEventId\", \"filter_event_id\"],\n [\"filterMarketKey\", \"filter_market_key\"],\n [\"filterPlayerName\", \"filter_player_name\"],\n [\"minPriceChangePct\", \"min_price_change_pct\"],\n [\"active\", \"active\"],\n ];\n for (const [src, dst] of map) {\n const v = (options as Record<string, unknown>)[src as string];\n if (v !== undefined) body[dst] = v;\n }\n return body;\n}\n\nasync function readDetail(resp: Response, fallback: string): Promise<string> {\n try {\n const text = await resp.text();\n if (!text) return fallback;\n try {\n const json = JSON.parse(text) as { detail?: unknown };\n if (typeof json.detail === \"string\") return json.detail;\n } catch {\n // not JSON\n }\n return text || fallback;\n } catch {\n return fallback;\n }\n}\n","/**\n * PropLine — Node/TypeScript SDK for the PropLine player props API.\n *\n * @example\n * ```ts\n * import { PropLine } from \"propline\";\n *\n * const client = new PropLine(\"your_api_key\");\n * const events = await client.getEvents(\"basketball_nba\");\n * const odds = await client.getOdds(\"basketball_nba\", {\n * eventId: events[0].id,\n * markets: [\"player_points\", \"player_rebounds\"],\n * });\n * ```\n */\n\nexport { PropLine } from \"./client.js\";\nexport {\n PropLineError,\n AuthError,\n RateLimitError,\n} from \"./client.js\";\nexport type {\n PropLineOptions,\n GetOddsOptions,\n GetOddsHistoryOptions,\n GetScoresOptions,\n GetStatsOptions,\n GetResultsOptions,\n GetPlayerHistoryOptions,\n ExportResolvedPropsOptions,\n CreateWebhookOptions,\n UpdateWebhookOptions,\n ListWebhookDeliveriesOptions,\n VerifySignatureOptions,\n} from \"./client.js\";\n\nexport type {\n Sport,\n Event,\n Outcome,\n ResolvedOutcome,\n Market,\n Bookmaker,\n OddsResponse,\n MarketSummary,\n OutcomeSnapshot,\n OddsHistoryOutcome,\n OddsHistoryMarket,\n OddsHistoryResponse,\n ScoreEvent,\n PlayerStat,\n StatsResponse,\n ResultsMarket,\n ResultsResponse,\n PlayerHistoryEntry,\n PlayerHistoryResponse,\n Webhook,\n WebhookDelivery,\n} from \"./types.js\";\n\n/** String constants for bookmaker keys in odds responses. */\nexport const Bookmakers = {\n BOVADA: \"bovada\",\n DRAFTKINGS: \"draftkings\",\n FANDUEL: \"fanduel\",\n PINNACLE: \"pinnacle\",\n PRIZEPICKS: \"prizepicks\",\n UNIBET: \"unibet\",\n} as const;\n\nexport type BookmakerKey = (typeof Bookmakers)[keyof typeof Bookmakers];\n\nexport const VERSION = \"0.1.0\";\n"],"mappings":";AAAA,SAAS,YAAY,uBAAuB;AAC5C,SAAS,iBAAiB;AAiBnB,IAAM,gBAAN,cAA4B,MAAM;AAAA,EAC9B;AAAA,EACA;AAAA,EAET,YAAY,YAAoB,QAAgB;AAC9C,UAAM,IAAI,UAAU,KAAK,MAAM,EAAE;AACjC,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,SAAS;AACd,WAAO,eAAe,MAAM,WAAW,SAAS;AAAA,EAClD;AACF;AAGO,IAAM,YAAN,cAAwB,cAAc;AAAA,EAC3C,YAAY,SAAS,mBAAmB;AACtC,UAAM,KAAK,MAAM;AACjB,SAAK,OAAO;AACZ,WAAO,eAAe,MAAM,WAAW,SAAS;AAAA,EAClD;AACF;AAGO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD,YAAY,SAAS,uBAAuB;AAC1C,UAAM,KAAK,MAAM;AACjB,SAAK,OAAO;AACZ,WAAO,eAAe,MAAM,WAAW,SAAS;AAAA,EAClD;AACF;AAoGA,IAAM,mBAAmB;AACzB,IAAM,qBAAqB;AAapB,IAAM,WAAN,MAAe;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACQ;AAAA,EAEjB,YAA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IAER;AACA,WAAO,QAAQ;AAAA,EACjB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;;;AC3gBO,IAAM,aAAa;AAAA,EACxB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AACV;AAIO,IAAM,UAAU;","names":[]}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "propline",
3
+ "version": "0.1.0",
4
+ "description": "Node.js / TypeScript SDK for the PropLine player props betting odds API",
5
+ "keywords": [
6
+ "sports",
7
+ "betting",
8
+ "odds",
9
+ "player-props",
10
+ "api",
11
+ "sportsbook",
12
+ "mlb",
13
+ "nba",
14
+ "nhl",
15
+ "nfl",
16
+ "soccer",
17
+ "ufc",
18
+ "boxing",
19
+ "bovada",
20
+ "draftkings",
21
+ "fanduel",
22
+ "pinnacle",
23
+ "prizepicks",
24
+ "unibet",
25
+ "dfs"
26
+ ],
27
+ "homepage": "https://prop-line.com",
28
+ "bugs": "https://github.com/proplineapi/propline-node/issues",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/proplineapi/propline-node.git"
32
+ },
33
+ "license": "MIT",
34
+ "author": "PropLine <support@prop-line.com>",
35
+ "type": "module",
36
+ "main": "./dist/index.cjs",
37
+ "module": "./dist/index.js",
38
+ "types": "./dist/index.d.ts",
39
+ "exports": {
40
+ ".": {
41
+ "types": "./dist/index.d.ts",
42
+ "import": "./dist/index.js",
43
+ "require": "./dist/index.cjs"
44
+ }
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "README.md",
49
+ "LICENSE"
50
+ ],
51
+ "engines": {
52
+ "node": ">=18"
53
+ },
54
+ "scripts": {
55
+ "build": "tsup",
56
+ "typecheck": "tsc --noEmit",
57
+ "prepublishOnly": "npm run build"
58
+ },
59
+ "devDependencies": {
60
+ "@types/node": "^20.19.39",
61
+ "tsup": "^8.3.0",
62
+ "typescript": "^5.6.0"
63
+ }
64
+ }