@skinpricer/sdk 0.4.0 → 0.5.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/CHANGELOG.md +21 -0
- package/README.md +10 -0
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +228 -26
- package/dist/index.d.ts +228 -26
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -218,6 +218,12 @@ type IsoDateString = string;
|
|
|
218
218
|
type Cents = number;
|
|
219
219
|
/** Evidence for a source time: the payload's own timestamp, a `Last-Modified` header, or CDN cache age. */
|
|
220
220
|
type SourceTimeKind = "payload" | "last_modified" | "cdn_age" | "none";
|
|
221
|
+
/** `ask` is a market's lowest sell price, `bid` its highest buy order. */
|
|
222
|
+
type QuotePriceKind = "ask" | "bid";
|
|
223
|
+
/** What a seller receives when a bid fills: withdrawable cash, Steam Wallet funds, or credit at the venue's own rate. */
|
|
224
|
+
type ValueKind = "cash" | "wallet" | "bot_rate" | "unknown";
|
|
225
|
+
/** Whether a sell average and maximum come from the market's own listing statistics or from observed lowest asks. */
|
|
226
|
+
type SellBasis = "listing_statistic" | "lowest_ask";
|
|
221
227
|
interface MarketPricePoint {
|
|
222
228
|
market: string;
|
|
223
229
|
price: Cents;
|
|
@@ -247,6 +253,11 @@ interface MarketPricePoint {
|
|
|
247
253
|
isSourceStale?: boolean;
|
|
248
254
|
/** True for a placeholder ask left out of the aggregate's average, median and deviation. It is still a real listing. */
|
|
249
255
|
outlier?: boolean;
|
|
256
|
+
priceKind?: QuotePriceKind;
|
|
257
|
+
/** True only for an ask you can buy at now. Always false on a bid. */
|
|
258
|
+
purchasable?: boolean;
|
|
259
|
+
/** Bids only. */
|
|
260
|
+
valueKind?: ValueKind;
|
|
250
261
|
}
|
|
251
262
|
interface AggregatePriceData {
|
|
252
263
|
minPrice: Cents | null;
|
|
@@ -260,18 +271,29 @@ interface AggregatePriceData {
|
|
|
260
271
|
freshMarketCount?: number;
|
|
261
272
|
listingCount?: number;
|
|
262
273
|
updatedAt: IsoDateString;
|
|
274
|
+
priceKind?: "ask_statistic";
|
|
263
275
|
}
|
|
264
276
|
interface NbboBestPrice {
|
|
265
277
|
market: string;
|
|
266
278
|
price: Cents;
|
|
267
279
|
updatedAt: IsoDateString;
|
|
268
280
|
isStale: boolean;
|
|
281
|
+
priceKind?: QuotePriceKind;
|
|
282
|
+
/** True only for an ask you can buy at now. Always false on a bid. */
|
|
283
|
+
purchasable?: boolean;
|
|
269
284
|
}
|
|
270
285
|
interface BestPrice {
|
|
271
286
|
market: string;
|
|
272
287
|
price: Cents;
|
|
288
|
+
updatedAt: IsoDateString;
|
|
289
|
+
isStale: boolean;
|
|
290
|
+
/** @deprecated Use `updatedAt`. The API stops sending it on 2027-01-15. */
|
|
273
291
|
updated_at: IsoDateString;
|
|
292
|
+
/** @deprecated Use `isStale`. The API stops sending it on 2027-01-15. */
|
|
274
293
|
is_stale: boolean;
|
|
294
|
+
priceKind?: QuotePriceKind;
|
|
295
|
+
/** True only for an ask you can buy at now. Always false on a bid. */
|
|
296
|
+
purchasable?: boolean;
|
|
275
297
|
}
|
|
276
298
|
interface PaginationMeta {
|
|
277
299
|
perPage: number;
|
|
@@ -284,6 +306,8 @@ interface PaginationMeta {
|
|
|
284
306
|
nextPage: number | null;
|
|
285
307
|
}
|
|
286
308
|
|
|
309
|
+
/** History values are statistics over asks, bids or sales, never a single quote. */
|
|
310
|
+
type HistoryPriceKind = "ask_statistic" | "bid_statistic" | "sale_statistic";
|
|
287
311
|
type HistoryListingType = "SELL_OFFER" | "BUY_ORDER" | "SALE_HISTORY";
|
|
288
312
|
/** Accepted on input; the backend also normalizes `SELL`/`BUY`/`SALES`. */
|
|
289
313
|
type HistoryListingTypeInput = HistoryListingType | "SELL" | "BUY" | "SALES";
|
|
@@ -319,6 +343,7 @@ interface PriceHistoryResponse {
|
|
|
319
343
|
name: string;
|
|
320
344
|
history: PriceHistoryPoint[];
|
|
321
345
|
listingType: HistoryListingType;
|
|
346
|
+
priceKind?: HistoryPriceKind;
|
|
322
347
|
salesWindow: SalesHistoryWindow | null;
|
|
323
348
|
/** Actual returned bucket width, which may differ from the requested interval. */
|
|
324
349
|
effectiveInterval: "10m" | "1h" | "1d";
|
|
@@ -326,6 +351,10 @@ interface PriceHistoryResponse {
|
|
|
326
351
|
interface MarketSeries {
|
|
327
352
|
market: string;
|
|
328
353
|
history: PriceHistoryPoint[];
|
|
354
|
+
/** `SELL_OFFER` series only. */
|
|
355
|
+
sellBasis?: SellBasis;
|
|
356
|
+
/** `BUY_ORDER` series only. */
|
|
357
|
+
valueKind?: ValueKind;
|
|
329
358
|
}
|
|
330
359
|
/** `GET /v1/pricing/:marketHashName/history/markets` (camelCase). */
|
|
331
360
|
interface PriceHistoryByMarketResponse {
|
|
@@ -333,6 +362,7 @@ interface PriceHistoryByMarketResponse {
|
|
|
333
362
|
name: string;
|
|
334
363
|
series: MarketSeries[];
|
|
335
364
|
listingType: HistoryListingType;
|
|
365
|
+
priceKind?: HistoryPriceKind;
|
|
336
366
|
salesWindow: SalesHistoryWindow | null;
|
|
337
367
|
/** Actual returned bucket width, which may differ from the requested interval. */
|
|
338
368
|
effectiveInterval: "10m" | "1h" | "1d";
|
|
@@ -393,6 +423,9 @@ interface PricingListing {
|
|
|
393
423
|
stickers: unknown[];
|
|
394
424
|
isStatTrak: boolean;
|
|
395
425
|
fetchedAt: IsoDateString;
|
|
426
|
+
/** `listing` for a single listing, `ask` for a market's lowest-ask row. */
|
|
427
|
+
priceKind?: "ask" | "listing";
|
|
428
|
+
purchasable?: boolean;
|
|
396
429
|
}
|
|
397
430
|
interface PricingListingFloatCoverage {
|
|
398
431
|
coverage: "none" | "partial" | "complete";
|
|
@@ -443,6 +476,8 @@ interface AllItemsLatestPrice {
|
|
|
443
476
|
effectiveUsdCents: Cents;
|
|
444
477
|
fetchedAt: IsoDateString;
|
|
445
478
|
originalCurrency: string;
|
|
479
|
+
/** Present, and false, only when the ask cannot be bought now. */
|
|
480
|
+
purchasable?: false;
|
|
446
481
|
}
|
|
447
482
|
interface AllItemsPriceAggregates {
|
|
448
483
|
minPrice: Cents | null;
|
|
@@ -479,6 +514,8 @@ type LiquidityBadge = (typeof LIQUIDITY_BADGES)[number];
|
|
|
479
514
|
declare const LIQUIDITY_CONFIDENCE: readonly ["HIGH", "MEDIUM", "LOW", "CRITICAL"];
|
|
480
515
|
type LiquidityConfidence = (typeof LIQUIDITY_CONFIDENCE)[number];
|
|
481
516
|
type LiquidityCoverage = "full" | "partial" | "none";
|
|
517
|
+
/** What a market pays the seller: `cash` (withdrawable), `wallet` (Steam Wallet funds), `bot_rate` (credit at the venue's own rate) or `unknown`. */
|
|
518
|
+
type LiquidityPayout = "cash" | "wallet" | "bot_rate" | "unknown";
|
|
482
519
|
/** Lowercase label form of the badge; `UNTRADED` maps to `"unknown"`, no `"moderate"` tier. */
|
|
483
520
|
declare const LIQUIDITY_LABELS: readonly ["extremely_liquid", "very_liquid", "liquid", "illiquid", "very_illiquid", "extremely_illiquid", "unknown"];
|
|
484
521
|
type LiquidityLabel = (typeof LIQUIDITY_LABELS)[number];
|
|
@@ -513,6 +550,8 @@ interface LiquidityResponse {
|
|
|
513
550
|
medianTimeToSellHours: number | null;
|
|
514
551
|
p90TimeToSellHours: number | null;
|
|
515
552
|
bestMarketToList: string | null;
|
|
553
|
+
/** What `bestMarketToList` pays; null exactly when it is null. Steam Community Market pays Steam Wallet funds, which cannot be withdrawn. */
|
|
554
|
+
bestMarketToListPayout?: LiquidityPayout | null;
|
|
516
555
|
salesPerDay: number | null;
|
|
517
556
|
activeListings: number | null;
|
|
518
557
|
referenceAskUsdCents: Cents | null;
|
|
@@ -539,6 +578,8 @@ interface LiquiditySummaryResponse {
|
|
|
539
578
|
/** 0-100, higher sells faster; null when untraded. */
|
|
540
579
|
score: number | null;
|
|
541
580
|
bestMarketToList: string | null;
|
|
581
|
+
/** What `bestMarketToList` pays; null exactly when it is null. Steam Community Market pays Steam Wallet funds, which cannot be withdrawn. */
|
|
582
|
+
bestMarketToListPayout?: LiquidityPayout | null;
|
|
542
583
|
calculatedAt: IsoDateString;
|
|
543
584
|
}
|
|
544
585
|
/** Request body for `POST /v1/liquidity/batch` (1-100 names). */
|
|
@@ -553,15 +594,21 @@ interface LiquidityBatchResponse {
|
|
|
553
594
|
requested: number;
|
|
554
595
|
calculatedAt: IsoDateString;
|
|
555
596
|
}
|
|
556
|
-
/** Bulk-map entry.
|
|
597
|
+
/** Bulk-map entry. */
|
|
557
598
|
interface LiquidityBulkItem {
|
|
599
|
+
marketHashName: string;
|
|
600
|
+
/** @deprecated Use `marketHashName`. The API stops sending it on 2027-01-15. */
|
|
558
601
|
market_hash_name: string;
|
|
559
602
|
liquidity: LiquidityLabel;
|
|
603
|
+
estimatedSaleTime: string;
|
|
604
|
+
/** @deprecated Use `estimatedSaleTime`. The API stops sending it on 2027-01-15. */
|
|
560
605
|
estimated_sale_time: string;
|
|
561
606
|
liquidityBadge: LiquidityBadge;
|
|
562
607
|
confidence: LiquidityConfidence;
|
|
563
608
|
score: number | null;
|
|
564
609
|
bestMarketToList: string | null;
|
|
610
|
+
/** What `bestMarketToList` pays; null exactly when it is null. Steam Community Market pays Steam Wallet funds, which cannot be withdrawn. */
|
|
611
|
+
bestMarketToListPayout?: LiquidityPayout | null;
|
|
565
612
|
/** Reserved; always `{}` for now. */
|
|
566
613
|
variants: Record<string, never>;
|
|
567
614
|
}
|
|
@@ -579,7 +626,7 @@ interface LiquidityBulkManifest {
|
|
|
579
626
|
markets: string[];
|
|
580
627
|
itemCount: number;
|
|
581
628
|
}
|
|
582
|
-
/** `GET /v1/liquidity/items` — Enterprise: whole-catalog map keyed by
|
|
629
|
+
/** `GET /v1/liquidity/items` — Enterprise: whole-catalog map keyed by market hash name. */
|
|
583
630
|
interface LiquidityBulkResponse extends LiquidityBulkManifest {
|
|
584
631
|
items: Record<string, LiquidityBulkItem>;
|
|
585
632
|
}
|
|
@@ -629,10 +676,12 @@ declare class MarketsResource extends BaseResource {
|
|
|
629
676
|
health(options?: RequestOptions): Promise<MarketHealthResponse>;
|
|
630
677
|
}
|
|
631
678
|
|
|
679
|
+
/** How well the fees on one side of the trade are known. With `unknown`, an ask's `appliedFeeBps` is null and a bid assumes a default commission. */
|
|
680
|
+
type FeeStatus = "complete" | "partial" | "unknown";
|
|
632
681
|
interface NbboParams {
|
|
633
682
|
/** Canonical item id. Provide this or `marketHashName`. */
|
|
634
683
|
id?: string;
|
|
635
|
-
/** Market hash name.
|
|
684
|
+
/** Market hash name. */
|
|
636
685
|
marketHashName?: string;
|
|
637
686
|
markets?: KnownMarket[];
|
|
638
687
|
}
|
|
@@ -641,12 +690,19 @@ interface ExecutionAdjustedBestPrice {
|
|
|
641
690
|
market: string;
|
|
642
691
|
price: Cents;
|
|
643
692
|
rawPrice: Cents;
|
|
644
|
-
|
|
645
|
-
|
|
693
|
+
/** Null on an ask when `feeStatus` is `unknown`. */
|
|
694
|
+
appliedFeeBps: number | null;
|
|
695
|
+
/** Null rather than zero when the market is not in the fee model. */
|
|
696
|
+
withdrawalFlatUsdCents?: Cents | null;
|
|
697
|
+
feeStatus?: FeeStatus;
|
|
698
|
+
feeModelVersion?: string;
|
|
646
699
|
executability: number;
|
|
647
700
|
updatedAt: IsoDateString;
|
|
648
701
|
isStale: boolean;
|
|
649
702
|
reasons: string[];
|
|
703
|
+
priceKind?: QuotePriceKind;
|
|
704
|
+
/** True only for an ask you can buy at now. Always false on a bid. */
|
|
705
|
+
purchasable?: boolean;
|
|
650
706
|
}
|
|
651
707
|
/** Execution-adjusted NBBO block: fee-aware best bid/ask re-ranked by executability. */
|
|
652
708
|
interface ExecutionAdjustedNbbo {
|
|
@@ -688,6 +744,10 @@ interface NbboDepthQuote {
|
|
|
688
744
|
ordersCount: number;
|
|
689
745
|
updatedAt: IsoDateString;
|
|
690
746
|
isStale: boolean;
|
|
747
|
+
priceKind?: QuotePriceKind;
|
|
748
|
+
/** True only for an ask level you can buy at now. Always false on a bid. */
|
|
749
|
+
purchasable?: boolean;
|
|
750
|
+
valueKind?: ValueKind;
|
|
691
751
|
}
|
|
692
752
|
interface NbboDepthLevel {
|
|
693
753
|
rank: number;
|
|
@@ -859,42 +919,78 @@ interface AggregationsParams {
|
|
|
859
919
|
marketHashNames?: string[];
|
|
860
920
|
markets?: KnownMarket[];
|
|
861
921
|
}
|
|
862
|
-
/** Per-market minimum sell price
|
|
922
|
+
/** Per-market minimum sell price. */
|
|
863
923
|
interface MarketMinPrice {
|
|
864
|
-
|
|
924
|
+
marketName: string;
|
|
865
925
|
offers: number;
|
|
866
926
|
price: Cents;
|
|
927
|
+
updatedAt: IsoDateString;
|
|
928
|
+
isStale?: boolean;
|
|
929
|
+
ingestedAt?: IsoDateString;
|
|
930
|
+
ingestLatencyMs?: number;
|
|
931
|
+
priceKind?: "ask";
|
|
932
|
+
/** True only when you can buy at this price now. */
|
|
933
|
+
purchasable?: boolean;
|
|
934
|
+
/** @deprecated Use `marketName`. The API stops sending it on 2027-01-15. */
|
|
935
|
+
market_name: string;
|
|
936
|
+
/** @deprecated Use `updatedAt`. The API stops sending it on 2027-01-15. */
|
|
867
937
|
updated_at: IsoDateString;
|
|
938
|
+
/** @deprecated Use `isStale`. The API stops sending it on 2027-01-15. */
|
|
868
939
|
is_stale?: boolean;
|
|
940
|
+
/** @deprecated Use `ingestedAt`. The API stops sending it on 2027-01-15. */
|
|
869
941
|
ingested_at?: IsoDateString;
|
|
942
|
+
/** @deprecated Use `ingestLatencyMs`. The API stops sending it on 2027-01-15. */
|
|
870
943
|
ingest_latency_ms?: number;
|
|
871
944
|
}
|
|
872
945
|
interface ItemMinPrices {
|
|
946
|
+
canonicalItemId: string;
|
|
947
|
+
marketHashName: string;
|
|
948
|
+
prices: MarketMinPrice[];
|
|
949
|
+
/** @deprecated Use `canonicalItemId`. The API stops sending it on 2027-01-15. */
|
|
873
950
|
canonical_item_id: string;
|
|
951
|
+
/** @deprecated Use `marketHashName`. The API stops sending it on 2027-01-15. */
|
|
874
952
|
market_hash_name: string;
|
|
875
|
-
prices: MarketMinPrice[];
|
|
876
953
|
}
|
|
877
|
-
/** `GET /v1/aggregations/min-prices
|
|
954
|
+
/** `GET /v1/aggregations/min-prices`. */
|
|
878
955
|
interface MinPricesResponse {
|
|
879
956
|
items: ItemMinPrices[];
|
|
880
957
|
}
|
|
881
|
-
/** Per-market maximum buy order
|
|
958
|
+
/** Per-market maximum buy order. */
|
|
882
959
|
interface MarketMaxOrder {
|
|
883
|
-
|
|
960
|
+
marketName: string;
|
|
884
961
|
offers: number;
|
|
885
962
|
price: Cents;
|
|
963
|
+
updatedAt: IsoDateString;
|
|
964
|
+
isStale: boolean;
|
|
965
|
+
totalQuantity?: number;
|
|
966
|
+
ingestedAt?: IsoDateString;
|
|
967
|
+
ingestLatencyMs?: number;
|
|
968
|
+
valueKind?: ValueKind;
|
|
969
|
+
priceKind?: "bid";
|
|
970
|
+
purchasable?: false;
|
|
971
|
+
/** @deprecated Use `marketName`. The API stops sending it on 2027-01-15. */
|
|
972
|
+
market_name: string;
|
|
973
|
+
/** @deprecated Use `updatedAt`. The API stops sending it on 2027-01-15. */
|
|
886
974
|
updated_at: IsoDateString;
|
|
975
|
+
/** @deprecated Use `isStale`. The API stops sending it on 2027-01-15. */
|
|
887
976
|
is_stale: boolean;
|
|
977
|
+
/** @deprecated Use `totalQuantity`. The API stops sending it on 2027-01-15. */
|
|
888
978
|
total_quantity?: number;
|
|
979
|
+
/** @deprecated Use `ingestedAt`. The API stops sending it on 2027-01-15. */
|
|
889
980
|
ingested_at?: IsoDateString;
|
|
981
|
+
/** @deprecated Use `ingestLatencyMs`. The API stops sending it on 2027-01-15. */
|
|
890
982
|
ingest_latency_ms?: number;
|
|
891
983
|
}
|
|
892
984
|
interface ItemMaxOrders {
|
|
985
|
+
canonicalItemId: string;
|
|
986
|
+
marketHashName: string;
|
|
987
|
+
orders: MarketMaxOrder[];
|
|
988
|
+
/** @deprecated Use `canonicalItemId`. The API stops sending it on 2027-01-15. */
|
|
893
989
|
canonical_item_id: string;
|
|
990
|
+
/** @deprecated Use `marketHashName`. The API stops sending it on 2027-01-15. */
|
|
894
991
|
market_hash_name: string;
|
|
895
|
-
orders: MarketMaxOrder[];
|
|
896
992
|
}
|
|
897
|
-
/** `GET /v1/aggregations/max-orders
|
|
993
|
+
/** `GET /v1/aggregations/max-orders`. */
|
|
898
994
|
interface MaxOrdersResponse {
|
|
899
995
|
items: ItemMaxOrders[];
|
|
900
996
|
}
|
|
@@ -931,7 +1027,7 @@ interface ArbitrageParams {
|
|
|
931
1027
|
minNotional?: number;
|
|
932
1028
|
sort?: ArbitrageSort;
|
|
933
1029
|
markets?: KnownMarket[];
|
|
934
|
-
/** Maximum candidate items to consider (50–
|
|
1030
|
+
/** Maximum candidate items to consider (50–1000, default 500). */
|
|
935
1031
|
candidateLimit?: number;
|
|
936
1032
|
}
|
|
937
1033
|
interface ArbitrageQuote {
|
|
@@ -943,6 +1039,9 @@ interface ArbitrageQuote {
|
|
|
943
1039
|
priceLevelQuantity: number | null;
|
|
944
1040
|
updatedAt: IsoDateString;
|
|
945
1041
|
isStale: boolean;
|
|
1042
|
+
priceKind?: QuotePriceKind;
|
|
1043
|
+
/** True only for an ask you can buy at now. Always false on a bid. */
|
|
1044
|
+
purchasable?: boolean;
|
|
946
1045
|
}
|
|
947
1046
|
interface ArbitrageFreshness {
|
|
948
1047
|
buyAgeMs: number;
|
|
@@ -1167,32 +1266,78 @@ interface MarketAnalyticsParams {
|
|
|
1167
1266
|
/** Historical analytics window in hours (1–168, default 24). */
|
|
1168
1267
|
windowHours?: number;
|
|
1169
1268
|
}
|
|
1170
|
-
/** Per-market analytics row
|
|
1269
|
+
/** Per-market analytics row. */
|
|
1171
1270
|
interface MarketAnalyticsPoint {
|
|
1172
1271
|
market: string;
|
|
1272
|
+
currentAsk: Cents | null;
|
|
1273
|
+
currentBid: Cents | null;
|
|
1274
|
+
spreadBps: number | null;
|
|
1275
|
+
askIsStale: boolean | null;
|
|
1276
|
+
bidIsStale: boolean | null;
|
|
1277
|
+
currentListingCount: number | null;
|
|
1278
|
+
currentBuyOrderCount: number | null;
|
|
1279
|
+
currentBidQuantity: number | null;
|
|
1280
|
+
sellAvgPrice: Cents | null;
|
|
1281
|
+
sellMinPrice: Cents | null;
|
|
1282
|
+
sellMaxPrice: Cents | null;
|
|
1283
|
+
sellAvgListingCount: number | null;
|
|
1284
|
+
buyAvgPrice: Cents | null;
|
|
1285
|
+
buyMaxPrice: Cents | null;
|
|
1286
|
+
buyAvgOrderCount: number | null;
|
|
1287
|
+
buyAvgTotalQuantity: number | null;
|
|
1288
|
+
/** True only when you can buy at `currentAsk` now. */
|
|
1289
|
+
askPurchasable?: boolean | null;
|
|
1290
|
+
/** Basis of `sellAvgPrice` and `sellMaxPrice`. */
|
|
1291
|
+
sellBasis?: SellBasis;
|
|
1292
|
+
/** Settlement kind of this market's bids: `currentBid`, `buyAvgPrice` and `buyMaxPrice`. */
|
|
1293
|
+
valueKind?: ValueKind;
|
|
1294
|
+
/** @deprecated Use `currentAsk`. The API stops sending it on 2027-01-15. */
|
|
1173
1295
|
current_ask: Cents | null;
|
|
1296
|
+
/** @deprecated Use `currentBid`. The API stops sending it on 2027-01-15. */
|
|
1174
1297
|
current_bid: Cents | null;
|
|
1298
|
+
/** @deprecated Use `spreadBps`. The API stops sending it on 2027-01-15. */
|
|
1175
1299
|
spread_bps: number | null;
|
|
1300
|
+
/** @deprecated Use `askIsStale`. The API stops sending it on 2027-01-15. */
|
|
1176
1301
|
ask_is_stale: boolean | null;
|
|
1302
|
+
/** @deprecated Use `bidIsStale`. The API stops sending it on 2027-01-15. */
|
|
1177
1303
|
bid_is_stale: boolean | null;
|
|
1304
|
+
/** @deprecated Use `currentListingCount`. The API stops sending it on 2027-01-15. */
|
|
1178
1305
|
current_listing_count: number | null;
|
|
1306
|
+
/** @deprecated Use `currentBuyOrderCount`. The API stops sending it on 2027-01-15. */
|
|
1179
1307
|
current_buy_order_count: number | null;
|
|
1308
|
+
/** @deprecated Use `currentBidQuantity`. The API stops sending it on 2027-01-15. */
|
|
1180
1309
|
current_bid_quantity: number | null;
|
|
1310
|
+
/** @deprecated Use `sellAvgPrice`. The API stops sending it on 2027-01-15. */
|
|
1181
1311
|
sell_avg_price: Cents | null;
|
|
1312
|
+
/** @deprecated Use `sellMinPrice`. The API stops sending it on 2027-01-15. */
|
|
1182
1313
|
sell_min_price: Cents | null;
|
|
1314
|
+
/** @deprecated Use `sellMaxPrice`. The API stops sending it on 2027-01-15. */
|
|
1183
1315
|
sell_max_price: Cents | null;
|
|
1316
|
+
/** @deprecated Use `sellAvgListingCount`. The API stops sending it on 2027-01-15. */
|
|
1184
1317
|
sell_avg_listing_count: number | null;
|
|
1318
|
+
/** @deprecated Use `buyAvgPrice`. The API stops sending it on 2027-01-15. */
|
|
1185
1319
|
buy_avg_price: Cents | null;
|
|
1320
|
+
/** @deprecated Use `buyMaxPrice`. The API stops sending it on 2027-01-15. */
|
|
1186
1321
|
buy_max_price: Cents | null;
|
|
1322
|
+
/** @deprecated Use `buyAvgOrderCount`. The API stops sending it on 2027-01-15. */
|
|
1187
1323
|
buy_avg_order_count: number | null;
|
|
1324
|
+
/** @deprecated Use `buyAvgTotalQuantity`. The API stops sending it on 2027-01-15. */
|
|
1188
1325
|
buy_avg_total_quantity: number | null;
|
|
1189
1326
|
}
|
|
1190
|
-
/** `GET /v1/market-analytics/:marketHashName
|
|
1327
|
+
/** `GET /v1/market-analytics/:marketHashName`. */
|
|
1191
1328
|
interface MarketAnalyticsResponse {
|
|
1329
|
+
canonicalItemId: string;
|
|
1330
|
+
marketHashName: string;
|
|
1331
|
+
windowHours: number;
|
|
1332
|
+
markets: MarketAnalyticsPoint[];
|
|
1333
|
+
calculatedAt: IsoDateString;
|
|
1334
|
+
/** @deprecated Use `canonicalItemId`. The API stops sending it on 2027-01-15. */
|
|
1192
1335
|
canonical_item_id: string;
|
|
1336
|
+
/** @deprecated Use `marketHashName`. The API stops sending it on 2027-01-15. */
|
|
1193
1337
|
market_hash_name: string;
|
|
1338
|
+
/** @deprecated Use `windowHours`. The API stops sending it on 2027-01-15. */
|
|
1194
1339
|
window_hours: number;
|
|
1195
|
-
|
|
1340
|
+
/** @deprecated Use `calculatedAt`. The API stops sending it on 2027-01-15. */
|
|
1196
1341
|
calculated_at: IsoDateString;
|
|
1197
1342
|
}
|
|
1198
1343
|
|
|
@@ -1225,6 +1370,8 @@ interface LatestPriceAskPoint extends LatestPricePoint {
|
|
|
1225
1370
|
quoteSize: number;
|
|
1226
1371
|
/** True for a placeholder ask far above the corroborated cheaper asks. It is still a real listing. */
|
|
1227
1372
|
outlier?: boolean;
|
|
1373
|
+
/** Present, and false, only when the ask cannot be bought now. */
|
|
1374
|
+
purchasable?: false;
|
|
1228
1375
|
}
|
|
1229
1376
|
interface LatestPriceBidPoint extends LatestPricePoint {
|
|
1230
1377
|
/** Null when unknown, which is not zero. */
|
|
@@ -1239,6 +1386,7 @@ interface LatestPriceBidPoint extends LatestPricePoint {
|
|
|
1239
1386
|
sourceAgeSeconds?: number;
|
|
1240
1387
|
/** Whether the source's data was older than 30 minutes when the snapshot was built. */
|
|
1241
1388
|
isSourceStale?: boolean;
|
|
1389
|
+
valueKind?: ValueKind;
|
|
1242
1390
|
}
|
|
1243
1391
|
interface LatestPriceItem {
|
|
1244
1392
|
/** Market hash name. */
|
|
@@ -1275,23 +1423,53 @@ declare class PricesResource extends BaseResource {
|
|
|
1275
1423
|
interface RecommendationParams {
|
|
1276
1424
|
markets?: KnownMarket[];
|
|
1277
1425
|
}
|
|
1278
|
-
/** `GET /v1/recommendations/:marketHashName
|
|
1426
|
+
/** `GET /v1/recommendations/:marketHashName`. */
|
|
1279
1427
|
interface RecommendationResponse {
|
|
1428
|
+
canonicalItemId: string;
|
|
1429
|
+
marketHashName: string;
|
|
1430
|
+
suggestedPrice: Cents | null;
|
|
1431
|
+
/** `suggestedPrice` is a model estimate, not a quote from any market. */
|
|
1432
|
+
suggestedPriceKind?: "estimate";
|
|
1433
|
+
strategy: string;
|
|
1434
|
+
confidence: number;
|
|
1435
|
+
liquidityScore: number;
|
|
1436
|
+
unstableReasons: string[];
|
|
1437
|
+
bestAsk: BestPrice | null;
|
|
1438
|
+
bestBid: BestPrice | null;
|
|
1439
|
+
spreadBps: number | null;
|
|
1440
|
+
marketCount: number;
|
|
1441
|
+
freshMarketCount: number;
|
|
1442
|
+
listingCount: number;
|
|
1443
|
+
buyOrderCount: number;
|
|
1444
|
+
totalBidQuantity: number;
|
|
1445
|
+
calculatedAt: IsoDateString;
|
|
1446
|
+
/** @deprecated Use `canonicalItemId`. The API stops sending it on 2027-01-15. */
|
|
1280
1447
|
canonical_item_id: string;
|
|
1448
|
+
/** @deprecated Use `marketHashName`. The API stops sending it on 2027-01-15. */
|
|
1281
1449
|
market_hash_name: string;
|
|
1450
|
+
/** @deprecated Use `suggestedPrice`. The API stops sending it on 2027-01-15. */
|
|
1282
1451
|
suggested_price: Cents | null;
|
|
1283
|
-
|
|
1284
|
-
confidence: number;
|
|
1452
|
+
/** @deprecated Use `liquidityScore`. The API stops sending it on 2027-01-15. */
|
|
1285
1453
|
liquidity_score: number;
|
|
1454
|
+
/** @deprecated Use `unstableReasons`. The API stops sending it on 2027-01-15. */
|
|
1286
1455
|
unstable_reasons: string[];
|
|
1456
|
+
/** @deprecated Use `bestAsk`. The API stops sending it on 2027-01-15. */
|
|
1287
1457
|
best_ask: BestPrice | null;
|
|
1458
|
+
/** @deprecated Use `bestBid`. The API stops sending it on 2027-01-15. */
|
|
1288
1459
|
best_bid: BestPrice | null;
|
|
1460
|
+
/** @deprecated Use `spreadBps`. The API stops sending it on 2027-01-15. */
|
|
1289
1461
|
spread_bps: number | null;
|
|
1462
|
+
/** @deprecated Use `marketCount`. The API stops sending it on 2027-01-15. */
|
|
1290
1463
|
market_count: number;
|
|
1464
|
+
/** @deprecated Use `freshMarketCount`. The API stops sending it on 2027-01-15. */
|
|
1291
1465
|
fresh_market_count: number;
|
|
1466
|
+
/** @deprecated Use `listingCount`. The API stops sending it on 2027-01-15. */
|
|
1292
1467
|
listing_count: number;
|
|
1468
|
+
/** @deprecated Use `buyOrderCount`. The API stops sending it on 2027-01-15. */
|
|
1293
1469
|
buy_order_count: number;
|
|
1470
|
+
/** @deprecated Use `totalBidQuantity`. The API stops sending it on 2027-01-15. */
|
|
1294
1471
|
total_bid_quantity: number;
|
|
1472
|
+
/** @deprecated Use `calculatedAt`. The API stops sending it on 2027-01-15. */
|
|
1295
1473
|
calculated_at: IsoDateString;
|
|
1296
1474
|
}
|
|
1297
1475
|
|
|
@@ -1304,29 +1482,53 @@ declare class RecommendationsResource extends BaseResource {
|
|
|
1304
1482
|
type MarketHealthStatus = "healthy" | "degraded" | "stale";
|
|
1305
1483
|
interface MarketFreshness {
|
|
1306
1484
|
market: string;
|
|
1485
|
+
delaySeconds: number;
|
|
1486
|
+
lastUpdate: IsoDateString;
|
|
1487
|
+
status: MarketHealthStatus;
|
|
1488
|
+
/** @deprecated Use `delaySeconds`. The API stops sending it on 2027-01-15. */
|
|
1307
1489
|
delay_seconds: number;
|
|
1490
|
+
/** @deprecated Use `lastUpdate`. The API stops sending it on 2027-01-15. */
|
|
1308
1491
|
last_update: IsoDateString;
|
|
1309
|
-
status: MarketHealthStatus;
|
|
1310
1492
|
}
|
|
1311
|
-
/** `GET /v1/status/freshness
|
|
1493
|
+
/** `GET /v1/status/freshness`. */
|
|
1312
1494
|
interface FreshnessResponse {
|
|
1313
1495
|
markets: MarketFreshness[];
|
|
1496
|
+
overallStatus: MarketHealthStatus;
|
|
1497
|
+
checkedAt: IsoDateString;
|
|
1498
|
+
/** @deprecated Use `overallStatus`. The API stops sending it on 2027-01-15. */
|
|
1314
1499
|
overall_status: MarketHealthStatus;
|
|
1500
|
+
/** @deprecated Use `checkedAt`. The API stops sending it on 2027-01-15. */
|
|
1315
1501
|
checked_at: IsoDateString;
|
|
1316
1502
|
}
|
|
1317
1503
|
interface MarketLatency {
|
|
1318
1504
|
market: string;
|
|
1505
|
+
avgLatencyMs: number;
|
|
1506
|
+
p95LatencyMs: number;
|
|
1507
|
+
p99LatencyMs: number;
|
|
1508
|
+
fetchCount: number;
|
|
1509
|
+
errorRate: number;
|
|
1510
|
+
sloBreachRate: number;
|
|
1511
|
+
/** @deprecated Use `avgLatencyMs`. The API stops sending it on 2027-01-15. */
|
|
1319
1512
|
avg_latency_ms: number;
|
|
1513
|
+
/** @deprecated Use `p95LatencyMs`. The API stops sending it on 2027-01-15. */
|
|
1320
1514
|
p95_latency_ms: number;
|
|
1515
|
+
/** @deprecated Use `p99LatencyMs`. The API stops sending it on 2027-01-15. */
|
|
1321
1516
|
p99_latency_ms: number;
|
|
1517
|
+
/** @deprecated Use `fetchCount`. The API stops sending it on 2027-01-15. */
|
|
1322
1518
|
fetch_count: number;
|
|
1519
|
+
/** @deprecated Use `errorRate`. The API stops sending it on 2027-01-15. */
|
|
1323
1520
|
error_rate: number;
|
|
1521
|
+
/** @deprecated Use `sloBreachRate`. The API stops sending it on 2027-01-15. */
|
|
1324
1522
|
slo_breach_rate: number;
|
|
1325
1523
|
}
|
|
1326
|
-
/** `GET /v1/status/market-latency
|
|
1524
|
+
/** `GET /v1/status/market-latency`. */
|
|
1327
1525
|
interface MarketLatencyResponse {
|
|
1328
1526
|
markets: MarketLatency[];
|
|
1527
|
+
windowHours: number;
|
|
1528
|
+
measuredAt: IsoDateString;
|
|
1529
|
+
/** @deprecated Use `windowHours`. The API stops sending it on 2027-01-15. */
|
|
1329
1530
|
window_hours: number;
|
|
1531
|
+
/** @deprecated Use `measuredAt`. The API stops sending it on 2027-01-15. */
|
|
1330
1532
|
measured_at: IsoDateString;
|
|
1331
1533
|
}
|
|
1332
1534
|
|
|
@@ -1364,7 +1566,7 @@ declare class SkinpricerClient {
|
|
|
1364
1566
|
declare class APIError extends SkinpricerError {
|
|
1365
1567
|
}
|
|
1366
1568
|
interface ValidationErrorOptions extends SkinpricerErrorOptions {
|
|
1367
|
-
/**
|
|
1569
|
+
/** One entry per rejected field or parameter, from the error body's `details` (or a NestJS `message` array). */
|
|
1368
1570
|
messages?: string[];
|
|
1369
1571
|
}
|
|
1370
1572
|
/** 400 Bad Request — request validation failed. */
|
|
@@ -1440,6 +1642,6 @@ declare function chunk<T>(items: readonly T[], size: number): T[][];
|
|
|
1440
1642
|
/** Runs `fn` over `items` with at most `limit` concurrent executions, keeping order. */
|
|
1441
1643
|
declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
1442
1644
|
|
|
1443
|
-
declare const VERSION = "0.
|
|
1645
|
+
declare const VERSION = "0.5.0";
|
|
1444
1646
|
|
|
1445
|
-
export { APIError, ATTRIBUTE_MARKETS, type AggregatePriceData, type AggregationsBatchParams, type AggregationsParams, AggregationsResource, type AllItemsItem, type AllItemsLatestPrice, type AllItemsPriceAggregates, type AllItemsResponse, type ArbitrageFreshness, type ArbitrageOpportunitiesResponse, type ArbitrageOpportunity, type ArbitrageParams, type ArbitrageQuote, ArbitrageResource, type ArbitrageSort, type AttributeBucketDimensions, type AttributeGranularity, type AttributeHistoryBucket, type AttributeHistoryItem, type AttributeHistoryParams, type AttributeHistoryPoint, type AttributeHistoryResponse, type AttributeLatestParams, type AttributeLatestResponse, type AttributeMarket, type AttributePriceBucket, type AttributePriceItem, AttributePricesResource, type AttributeRangeDimension, type AttributeType, type AuthScheme, AuthenticationError, BaseResource, type BestPrice, type Buff163AttributeHistoryResponse, type Buff163AttributeLatestResponse, type Buff163HistoryParams, type Buff163LatestParams, Buff163Resource, type Cents, type ClientConfig, type ClientHooks, ConfigurationError, type CurrentPriceParams, type CurrentPriceResponse, DEFAULT_BASE_URL, DEFAULT_PUBLIC_BASE_URL, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, type ErrorResponseInput, type ExecutionAdjustedBestPrice, type ExecutionAdjustedNbbo, FeatureNotAvailableError, type FormatUsdOptions, type FreshnessResponse, type Game, GameClient, type HistoryListingType, type HistoryListingTypeInput, HistoryResource, type IsoDateString, type ItemMaxOrders, type ItemMinPrices, type ItemPriceListResponse, type ItemSearchParams, ItemsResource, KNOWN_MARKETS, type KnownMarket, LIQUIDITY_BADGES, LIQUIDITY_CONFIDENCE, LIQUIDITY_LABELS, type LatestPriceAskPoint, type LatestPriceBidPoint, type LatestPriceItem, type LatestPricePoint, type LatestPricesParams, type LatestPricesResponse, type LiquidityBadge, type LiquidityBatchBody, type LiquidityBatchResponse, type LiquidityBulkItem, type LiquidityBulkManifest, type LiquidityBulkParams, type LiquidityBulkResponse, type LiquidityConfidence, type LiquidityCoverage, type LiquidityLabel, type LiquidityMarketForGame, type LiquidityMarketMetric, type LiquidityParams, LiquidityResource, type LiquidityResponse, type LiquiditySummaryResponse, type MarketAnalyticsParams, type MarketAnalyticsPoint, MarketAnalyticsResource, type MarketAnalyticsResponse, type MarketFreshness, type MarketHealthResponse, type MarketHealthRow, type MarketHealthStatus, type MarketLatency, type MarketLatencyResponse, type MarketMaxOrder, type MarketMinPrice, type MarketPricePoint, type MarketRegistryStatus, type MarketSeries, MarketsResource, type MaxOrdersResponse, type MinPricesResponse, type NbboBestPrice, type NbboDepthLevel, type NbboDepthParams, type NbboDepthQuote, type NbboDepthResponse, type NbboParams, NbboResource, type NbboResponse, NetworkError, NotFoundError, type PaginationMeta, ParseError, PermissionError, type PriceHistoryByMarketResponse, type PriceHistoryInterval, type PriceHistoryParams, type PriceHistoryPoint, type PriceHistoryResponse, PricesResource, type PricingListing, type PricingListingFloatCoverage, type PricingListingFloatSummary, type PricingListingObservedFloatSource, type PricingListingsParams, type PricingListingsResponse, PricingResource, RESPONSE_META, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo, type RateLimitWindow, type RecommendationParams, type RecommendationResponse, RecommendationsResource, type RequestHookContext, type RequestOptions, type ResolvedConfig, type ResponseHookContext, type ResponseMeta, type RetryConfig, type RetryHookContext, SUPPORTED_LIQUIDITY_MARKETS, SUPPORTED_RUST_LIQUIDITY_MARKETS, type SalesHistoryWindow, type SchemaChangesParams, type SchemaChangesResponse, type SchemaCollection, type SchemaContainer, type SchemaItem, type SchemaItemResponse, type SchemaRarity, type SchemaRegistries, SchemaResource, type SchemaSnapshotParams, type SchemaSnapshotResponse, type SchemaVariant, ServerError, SkinpricerClient, SkinpricerError, type SkinpricerErrorOptions, type SourceTimeKind, StatusResource, type SupportedLiquidityMarket, type SupportedRustLiquidityMarket, TimeoutError, VERSION, ValidationError, type ValidationErrorOptions, type WithMeta, centsToUsd, chunk, errorFromResponse, formatUsd, getMeta, mapWithConcurrency, parseIsoDate, resolveConfig };
|
|
1647
|
+
export { APIError, ATTRIBUTE_MARKETS, type AggregatePriceData, type AggregationsBatchParams, type AggregationsParams, AggregationsResource, type AllItemsItem, type AllItemsLatestPrice, type AllItemsPriceAggregates, type AllItemsResponse, type ArbitrageFreshness, type ArbitrageOpportunitiesResponse, type ArbitrageOpportunity, type ArbitrageParams, type ArbitrageQuote, ArbitrageResource, type ArbitrageSort, type AttributeBucketDimensions, type AttributeGranularity, type AttributeHistoryBucket, type AttributeHistoryItem, type AttributeHistoryParams, type AttributeHistoryPoint, type AttributeHistoryResponse, type AttributeLatestParams, type AttributeLatestResponse, type AttributeMarket, type AttributePriceBucket, type AttributePriceItem, AttributePricesResource, type AttributeRangeDimension, type AttributeType, type AuthScheme, AuthenticationError, BaseResource, type BestPrice, type Buff163AttributeHistoryResponse, type Buff163AttributeLatestResponse, type Buff163HistoryParams, type Buff163LatestParams, Buff163Resource, type Cents, type ClientConfig, type ClientHooks, ConfigurationError, type CurrentPriceParams, type CurrentPriceResponse, DEFAULT_BASE_URL, DEFAULT_PUBLIC_BASE_URL, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, type ErrorResponseInput, type ExecutionAdjustedBestPrice, type ExecutionAdjustedNbbo, FeatureNotAvailableError, type FeeStatus, type FormatUsdOptions, type FreshnessResponse, type Game, GameClient, type HistoryListingType, type HistoryListingTypeInput, type HistoryPriceKind, HistoryResource, type IsoDateString, type ItemMaxOrders, type ItemMinPrices, type ItemPriceListResponse, type ItemSearchParams, ItemsResource, KNOWN_MARKETS, type KnownMarket, LIQUIDITY_BADGES, LIQUIDITY_CONFIDENCE, LIQUIDITY_LABELS, type LatestPriceAskPoint, type LatestPriceBidPoint, type LatestPriceItem, type LatestPricePoint, type LatestPricesParams, type LatestPricesResponse, type LiquidityBadge, type LiquidityBatchBody, type LiquidityBatchResponse, type LiquidityBulkItem, type LiquidityBulkManifest, type LiquidityBulkParams, type LiquidityBulkResponse, type LiquidityConfidence, type LiquidityCoverage, type LiquidityLabel, type LiquidityMarketForGame, type LiquidityMarketMetric, type LiquidityParams, type LiquidityPayout, LiquidityResource, type LiquidityResponse, type LiquiditySummaryResponse, type MarketAnalyticsParams, type MarketAnalyticsPoint, MarketAnalyticsResource, type MarketAnalyticsResponse, type MarketFreshness, type MarketHealthResponse, type MarketHealthRow, type MarketHealthStatus, type MarketLatency, type MarketLatencyResponse, type MarketMaxOrder, type MarketMinPrice, type MarketPricePoint, type MarketRegistryStatus, type MarketSeries, MarketsResource, type MaxOrdersResponse, type MinPricesResponse, type NbboBestPrice, type NbboDepthLevel, type NbboDepthParams, type NbboDepthQuote, type NbboDepthResponse, type NbboParams, NbboResource, type NbboResponse, NetworkError, NotFoundError, type PaginationMeta, ParseError, PermissionError, type PriceHistoryByMarketResponse, type PriceHistoryInterval, type PriceHistoryParams, type PriceHistoryPoint, type PriceHistoryResponse, PricesResource, type PricingListing, type PricingListingFloatCoverage, type PricingListingFloatSummary, type PricingListingObservedFloatSource, type PricingListingsParams, type PricingListingsResponse, PricingResource, type QuotePriceKind, RESPONSE_META, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo, type RateLimitWindow, type RecommendationParams, type RecommendationResponse, RecommendationsResource, type RequestHookContext, type RequestOptions, type ResolvedConfig, type ResponseHookContext, type ResponseMeta, type RetryConfig, type RetryHookContext, SUPPORTED_LIQUIDITY_MARKETS, SUPPORTED_RUST_LIQUIDITY_MARKETS, type SalesHistoryWindow, type SchemaChangesParams, type SchemaChangesResponse, type SchemaCollection, type SchemaContainer, type SchemaItem, type SchemaItemResponse, type SchemaRarity, type SchemaRegistries, SchemaResource, type SchemaSnapshotParams, type SchemaSnapshotResponse, type SchemaVariant, type SellBasis, ServerError, SkinpricerClient, SkinpricerError, type SkinpricerErrorOptions, type SourceTimeKind, StatusResource, type SupportedLiquidityMarket, type SupportedRustLiquidityMarket, TimeoutError, VERSION, ValidationError, type ValidationErrorOptions, type ValueKind, type WithMeta, centsToUsd, chunk, errorFromResponse, formatUsd, getMeta, mapWithConcurrency, parseIsoDate, resolveConfig };
|
package/dist/index.js
CHANGED
|
@@ -272,7 +272,7 @@ var NbboResource = class extends BaseResource {
|
|
|
272
272
|
path: "/nbbo",
|
|
273
273
|
query: {
|
|
274
274
|
id: params.id,
|
|
275
|
-
|
|
275
|
+
marketHashName: params.marketHashName,
|
|
276
276
|
markets: params.markets
|
|
277
277
|
}
|
|
278
278
|
},
|
|
@@ -287,7 +287,7 @@ var NbboResource = class extends BaseResource {
|
|
|
287
287
|
path: "/nbbo/depth",
|
|
288
288
|
query: {
|
|
289
289
|
id: params.id,
|
|
290
|
-
|
|
290
|
+
marketHashName: params.marketHashName,
|
|
291
291
|
markets: params.markets,
|
|
292
292
|
depth: params.depth
|
|
293
293
|
}
|
|
@@ -393,7 +393,7 @@ var GameClient = class {
|
|
|
393
393
|
};
|
|
394
394
|
|
|
395
395
|
// src/version.ts
|
|
396
|
-
var VERSION = "0.
|
|
396
|
+
var VERSION = "0.5.0";
|
|
397
397
|
|
|
398
398
|
// src/config.ts
|
|
399
399
|
var DEFAULT_BASE_URL = "https://pricing.skinpricer.com/v1";
|
|
@@ -564,6 +564,16 @@ function extractErrorFields(body, status) {
|
|
|
564
564
|
const message = typeof err.message === "string" ? err.message : defaultMessage(status);
|
|
565
565
|
const result = { message };
|
|
566
566
|
if (typeof err.code === "string") result.code = err.code;
|
|
567
|
+
if (Array.isArray(err.details)) {
|
|
568
|
+
const messages = err.details.filter(
|
|
569
|
+
(entry) => typeof entry === "string"
|
|
570
|
+
);
|
|
571
|
+
if (messages.length > 0) {
|
|
572
|
+
result.message = `${message}: ${messages.join(", ")}`;
|
|
573
|
+
result.messages = messages;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (typeof body.requestId === "string") result.requestId = body.requestId;
|
|
567
577
|
return result;
|
|
568
578
|
}
|
|
569
579
|
const rawMessage = body.message;
|
|
@@ -593,11 +603,14 @@ function looksLikeFeatureError(message) {
|
|
|
593
603
|
}
|
|
594
604
|
function errorFromResponse(input) {
|
|
595
605
|
const { status, body, meta } = input;
|
|
596
|
-
const { code, message, messages } = extractErrorFields(
|
|
606
|
+
const { code, message, messages, requestId } = extractErrorFields(
|
|
607
|
+
body,
|
|
608
|
+
status
|
|
609
|
+
);
|
|
597
610
|
const base = {
|
|
598
611
|
status,
|
|
599
612
|
code,
|
|
600
|
-
requestId: meta.requestId,
|
|
613
|
+
requestId: meta.requestId ?? requestId ?? null,
|
|
601
614
|
responseBody: body,
|
|
602
615
|
rateLimit: meta.rateLimit
|
|
603
616
|
};
|