@toktikhq/sdk-js 0.2.0 → 0.3.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/README.md +10 -5
- package/dist/index.d.ts +107 -72
- package/dist/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/dist/resources.js +7 -7
- package/dist/resources.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ try {
|
|
|
108
108
|
|
|
109
109
|
| Namespace | Scope | Endpoints |
|
|
110
110
|
|---|---|---|
|
|
111
|
-
| `client.live` | `live:read`, `live:stream` |
|
|
111
|
+
| `client.live` | `live:read`, `live:stream` | creator performance, stream token, `stream()` |
|
|
112
112
|
| `client.rankings` | `rank:read` | `official({ board })`, `movers({ board })`, `history({ board })`, `regions()`, `games({ region })` |
|
|
113
113
|
| `client.creators` | `creator:read` | list, get, changes, analysis, following, followers |
|
|
114
114
|
| `client.content` | `content:read` | creator videos (no params), video, video comments |
|
|
@@ -120,8 +120,13 @@ try {
|
|
|
120
120
|
Option names mirror the server schemas exactly. Those routes declare `additionalProperties: false`,
|
|
121
121
|
so an invented parameter is a hard `400` — not an ignored extra.
|
|
122
122
|
|
|
123
|
-
The pre-D3.1
|
|
124
|
-
|
|
123
|
+
The pre-D3.1 method `listCreatorPerformance` still works and is marked deprecated; it forwards to
|
|
124
|
+
`client.live.creatorPerformance`.
|
|
125
|
+
|
|
126
|
+
**0.3.0 (breaking):** `live.listSessions`, `live.getSession` and the deprecated `listLiveSessions` /
|
|
127
|
+
`getLiveSession` were removed — `GET /v1/live/sessions` is no longer part of the API. `exports.create` now
|
|
128
|
+
takes the full export request: `rankings` (`board` + `region`), `gifters` (`rangeDays`, optional `region` /
|
|
129
|
+
`segment`), `creator_roster`, `creator_gifters` (`creatorUniqueId`, optional `window`); `live_sessions` is gone.
|
|
125
130
|
|
|
126
131
|
## Publishing
|
|
127
132
|
|
|
@@ -132,8 +137,8 @@ ESM entry point and type-checks a clean consumer whose only dependency is this S
|
|
|
132
137
|
Releases are tag-driven through `.github/workflows/sdk-release.yml`:
|
|
133
138
|
|
|
134
139
|
```bash
|
|
135
|
-
git tag sdk-js-v0.
|
|
136
|
-
git push origin sdk-js-v0.
|
|
140
|
+
git tag sdk-js-v0.3.0
|
|
141
|
+
git push origin sdk-js-v0.3.0
|
|
137
142
|
```
|
|
138
143
|
|
|
139
144
|
The npm package must have a Trusted Publisher configured for this repository and that workflow. The
|
package/dist/index.d.ts
CHANGED
|
@@ -20,41 +20,6 @@ interface ProvenanceEnvelope<TData> {
|
|
|
20
20
|
provenance: Provenance;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
interface LiveSessionGiftRollup {
|
|
24
|
-
giftId: string;
|
|
25
|
-
giftName: string | null;
|
|
26
|
-
giftType: number | null;
|
|
27
|
-
giftCount: number;
|
|
28
|
-
diamondTotal: number;
|
|
29
|
-
senderCount: number;
|
|
30
|
-
}
|
|
31
|
-
interface LiveSessionGifterRollup {
|
|
32
|
-
gifterUserId: string;
|
|
33
|
-
gifterUniqueId: string | null;
|
|
34
|
-
gifterNickname: string | null;
|
|
35
|
-
giftCount: number;
|
|
36
|
-
diamondTotal: number;
|
|
37
|
-
}
|
|
38
|
-
interface LiveSessionSummary {
|
|
39
|
-
id: string;
|
|
40
|
-
roomKey: string;
|
|
41
|
-
roomId: string;
|
|
42
|
-
creatorUniqueId: string | null;
|
|
43
|
-
/** Observed avatar for `creatorUniqueId`, joined best-effort from `creator_profiles` (null = never profiled). */
|
|
44
|
-
creatorAvatarUrl: string | null;
|
|
45
|
-
startedAt: string;
|
|
46
|
-
endedAt: string | null;
|
|
47
|
-
durationSeconds: number;
|
|
48
|
-
peakViewerCount: number;
|
|
49
|
-
eventCount: number;
|
|
50
|
-
chatCount: number;
|
|
51
|
-
giftCount: number;
|
|
52
|
-
totalGiftDiamonds: number;
|
|
53
|
-
}
|
|
54
|
-
interface LiveSessionRecord extends LiveSessionSummary {
|
|
55
|
-
giftRollups: LiveSessionGiftRollup[];
|
|
56
|
-
gifterRollups: LiveSessionGifterRollup[];
|
|
57
|
-
}
|
|
58
23
|
interface LiveCreatorPerformanceRecord {
|
|
59
24
|
sessionId: string;
|
|
60
25
|
sessionStartedAt: string;
|
|
@@ -68,21 +33,13 @@ interface LiveCreatorPerformanceRecord {
|
|
|
68
33
|
totalGiftDiamonds: number;
|
|
69
34
|
distinctGifterCount: number;
|
|
70
35
|
}
|
|
71
|
-
interface LiveSessionListResponse {
|
|
72
|
-
items: LiveSessionSummary[];
|
|
73
|
-
nextCursor: string | null;
|
|
74
|
-
/**
|
|
75
|
-
* P1.7 — the caller's plan-tier history read window in days (`null` = unlimited). Sessions that
|
|
76
|
-
* started before `now - historyWindowDays` are withheld; a higher tier reads further back.
|
|
77
|
-
*/
|
|
78
|
-
historyWindowDays: number | null;
|
|
79
|
-
/** True when sessions older than the window exist and were withheld by it (not by paging). */
|
|
80
|
-
historyTruncated: boolean;
|
|
81
|
-
}
|
|
82
36
|
interface LiveCreatorPerformanceListResponse {
|
|
83
37
|
items: LiveCreatorPerformanceRecord[];
|
|
84
38
|
nextCursor: string | null;
|
|
85
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* P1.7 — the caller's plan-tier history read window in days (`null` = unlimited). Rows that started before
|
|
41
|
+
* `now - historyWindowDays` are withheld (a query-time filter, never a prune); a higher tier reads further back.
|
|
42
|
+
*/
|
|
86
43
|
historyWindowDays: number | null;
|
|
87
44
|
/** True when performance rows older than the window exist and were withheld by it. */
|
|
88
45
|
historyTruncated: boolean;
|
|
@@ -383,7 +340,8 @@ interface GifterSummary {
|
|
|
383
340
|
* a gradient. Never an invented image.
|
|
384
341
|
*/
|
|
385
342
|
avatarUrl: string | null;
|
|
386
|
-
/**
|
|
343
|
+
/** Coins ("Xu") observed from this gifter within the requested window (per-poll deltas summed, exact
|
|
344
|
+
* to the hour). The field keeps its historical name. */
|
|
387
345
|
observedDiamonds: number;
|
|
388
346
|
/**
|
|
389
347
|
* PD5 (#10) — `observedDiamonds` estimated in USD at the configured `DIAMOND_USD_RATE` (creator-
|
|
@@ -391,7 +349,7 @@ interface GifterSummary {
|
|
|
391
349
|
* the amount is not estimable.
|
|
392
350
|
*/
|
|
393
351
|
estimatedValueUsd: number | null;
|
|
394
|
-
/** Distinct
|
|
352
|
+
/** Distinct live sessions (rooms) this gifter gave coins in within the window. */
|
|
395
353
|
sessionCount: number;
|
|
396
354
|
/** Distinct creators this gifter was observed funding in the window. */
|
|
397
355
|
creatorCount: number;
|
|
@@ -476,13 +434,63 @@ interface CreatorGifterTotals {
|
|
|
476
434
|
/** `observedDiamonds` × `DIAMOND_USD_RATE`; null when not estimable. */
|
|
477
435
|
estimatedValueUsd: number | null;
|
|
478
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* EX.3 — what the caller's plan sees of a creator's gifters (`whaleIntelAccess` in `@v2/billing`, at the
|
|
439
|
+
* workspace's LIVE-module tier): Free the top 3 (the same three the public Lookup preview shows), Starter the
|
|
440
|
+
* top 10, Pro+ every gifter; the whole-window totals from Starter up. Enforced server-side — a capped plan is
|
|
441
|
+
* never sent the rows beyond its cap nor a withheld total (the window board does not even compute it).
|
|
442
|
+
*/
|
|
443
|
+
interface CreatorGiftersAccess {
|
|
444
|
+
/** Max gifters this plan sees for a creator; null = every gifter. */
|
|
445
|
+
topN: number | null;
|
|
446
|
+
/** True when the creator has more gifters than this plan's cap (they are not sent). */
|
|
447
|
+
moreWithheld: boolean;
|
|
448
|
+
/** The tier that unlocks every gifter; null when this plan already sees all of them. */
|
|
449
|
+
unlockTier: string | null;
|
|
450
|
+
/** True when this plan does not see the whole-window totals (`totals` is then null). */
|
|
451
|
+
totalsWithheld: boolean;
|
|
452
|
+
/** The tier that unlocks the totals; null when this plan sees them. */
|
|
453
|
+
totalsUnlockTier: string | null;
|
|
454
|
+
}
|
|
479
455
|
interface CreatorGiftersResponse {
|
|
480
456
|
creatorUniqueId: string;
|
|
481
457
|
gifters: CreatorGifter[];
|
|
482
|
-
|
|
458
|
+
/** Over every gifter of the creator in the window; null when withheld by plan (see `access`). */
|
|
459
|
+
totals: CreatorGifterTotals | null;
|
|
483
460
|
filter: {
|
|
484
461
|
window: GifterWindow;
|
|
485
462
|
};
|
|
463
|
+
/** EX.3 — the plan's view of this board (cap + totals). */
|
|
464
|
+
access?: CreatorGiftersAccess;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* R2.8 — the LIVE session a creator's live board is for (`GET /v1/creators/:handle/gifters/live`).
|
|
468
|
+
* `isLive: false` = the creator is offline and this is their most recent session, kept whole for ~2 h
|
|
469
|
+
* after its last observation. The observed times bound what we saw — not the stream's own start/end.
|
|
470
|
+
*/
|
|
471
|
+
interface CreatorLiveSession {
|
|
472
|
+
roomId: string;
|
|
473
|
+
isLive: boolean;
|
|
474
|
+
/** First time a gifter of this session was observed; null while no gift has been seen. */
|
|
475
|
+
firstObservedAt: string | null;
|
|
476
|
+
/** Latest change observed (a gift, or a present gifter's periodic refresh); null while no gift has been seen. */
|
|
477
|
+
lastObservedAt: string | null;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* R2.8 — one creator's live-session board, ranked like TikTok's in-room "Top viewers" list: each row's
|
|
481
|
+
* `observedDiamonds` is the gifter's cumulative coins in THIS session (TikTok's own running total;
|
|
482
|
+
* `sessionCount` is always 1). Gifters who already left stay listed; viewers who never gifted are not.
|
|
483
|
+
* `session: null` = no live or recent session is tracked (the creator is offline, or live in a room we do
|
|
484
|
+
* not poll).
|
|
485
|
+
*/
|
|
486
|
+
interface CreatorLiveGiftersResponse {
|
|
487
|
+
creatorUniqueId: string;
|
|
488
|
+
session: CreatorLiveSession | null;
|
|
489
|
+
gifters: CreatorGifter[];
|
|
490
|
+
/** Over every gifter of the session, not just the returned page; null when withheld by plan (see `access`). */
|
|
491
|
+
totals: CreatorGifterTotals | null;
|
|
492
|
+
/** EX.3 — the plan's view of this board (cap + totals). */
|
|
493
|
+
access?: CreatorGiftersAccess;
|
|
486
494
|
}
|
|
487
495
|
|
|
488
496
|
/** One retained observation of a creator's metrics over time. */
|
|
@@ -883,7 +891,7 @@ interface RealtimeErrorFrame {
|
|
|
883
891
|
retryable: boolean;
|
|
884
892
|
}
|
|
885
893
|
|
|
886
|
-
type ExportDataset = "
|
|
894
|
+
type ExportDataset = "rankings" | "gifters" | "creator_roster" | "creator_gifters";
|
|
887
895
|
/**
|
|
888
896
|
* The file formats the export writer can actually produce — the single runtime source of truth for
|
|
889
897
|
* "does the system support this format at all". `SUPPORTED_FORMATS` in the exports service derives
|
|
@@ -897,7 +905,8 @@ type ExportFormat = (typeof EXPORT_FORMATS)[number];
|
|
|
897
905
|
type ExportJobStatus = "pending" | "ready" | "failed";
|
|
898
906
|
interface ExportJob {
|
|
899
907
|
id: string;
|
|
900
|
-
|
|
908
|
+
/** A job created before EX.4 (2026-09-24) may still read `live_sessions` — a legacy value on responses only. */
|
|
909
|
+
dataset: ExportDataset | "live_sessions";
|
|
901
910
|
format: ExportFormat;
|
|
902
911
|
status: ExportJobStatus;
|
|
903
912
|
rowCount: number;
|
|
@@ -908,6 +917,38 @@ interface ExportJob {
|
|
|
908
917
|
createdAt: string;
|
|
909
918
|
completedAt: string | null;
|
|
910
919
|
}
|
|
920
|
+
interface CreateExportRequest {
|
|
921
|
+
dataset: ExportDataset;
|
|
922
|
+
format: ExportFormat;
|
|
923
|
+
/** Observation window in days (bounded by the retention cap). Applies to `gifters` (bucketed to 24h/7d/30d). */
|
|
924
|
+
rangeDays?: number;
|
|
925
|
+
/** Required for `dataset:"rankings"` — the board key (e.g. `daily`, `popular_live`). Ignored otherwise. */
|
|
926
|
+
board?: string;
|
|
927
|
+
/** Required for `dataset:"rankings"` — the region bucket (e.g. `VN`, `US+`). EX.2 — optional for `dataset:"gifters"`:
|
|
928
|
+
* the whale board's region filter (the board on screen). Ignored otherwise. */
|
|
929
|
+
region?: string;
|
|
930
|
+
/**
|
|
931
|
+
* Optional for `dataset:"rankings"` — the `game_key` for a per-game gaming board (`board:"gaming_game"`).
|
|
932
|
+
* Ignored for every other board. Without it, `gaming_game` has no snapshot to read and exports empty,
|
|
933
|
+
* which is why a per-game gaming board must pass it.
|
|
934
|
+
*/
|
|
935
|
+
game?: string;
|
|
936
|
+
/**
|
|
937
|
+
* Optional for `dataset:"rankings"` — `"current"` (default) reads the live board, `"history"` the prior
|
|
938
|
+
* published period. Ignored for every other dataset. Lets a rankings export match the period on screen
|
|
939
|
+
* instead of silently exporting the current period.
|
|
940
|
+
*/
|
|
941
|
+
period?: "current" | "history";
|
|
942
|
+
/** EX.2 — optional for `dataset:"gifters"`: export only this segment of the board (the on-screen chip). */
|
|
943
|
+
segment?: GifterSegment;
|
|
944
|
+
/** Required for `dataset:"creator_gifters"` — the creator's handle (with or without `@`). Ignored otherwise. */
|
|
945
|
+
creatorUniqueId?: string;
|
|
946
|
+
/**
|
|
947
|
+
* For `dataset:"creator_gifters"` — the Whale intel board to export: a rolling window (`24h`/`7d`/`30d`,
|
|
948
|
+
* default `7d`) or the creator's current / last `live` session. Ignored otherwise.
|
|
949
|
+
*/
|
|
950
|
+
window?: "24h" | "7d" | "30d" | "live";
|
|
951
|
+
}
|
|
911
952
|
interface ExportJobListResponse {
|
|
912
953
|
items: ExportJob[];
|
|
913
954
|
}
|
|
@@ -1376,12 +1417,6 @@ declare class HttpTransport {
|
|
|
1376
1417
|
* name is a hard 400 — not a silently ignored extra. Do not add a field here without reading the
|
|
1377
1418
|
* matching schema first.
|
|
1378
1419
|
*/
|
|
1379
|
-
/** `/v1/live/sessions` — `paginationProperties`: `cursor` (ISO date-time keyset) + `limit`. */
|
|
1380
|
-
interface LiveSessionsOptions {
|
|
1381
|
-
creatorUniqueId?: string;
|
|
1382
|
-
cursor?: string;
|
|
1383
|
-
limit?: number;
|
|
1384
|
-
}
|
|
1385
1420
|
interface CursorPageOptions {
|
|
1386
1421
|
cursor?: string;
|
|
1387
1422
|
limit?: number;
|
|
@@ -1441,12 +1476,12 @@ interface GifterListOptions extends GifterWindowOptions {
|
|
|
1441
1476
|
interface CommentOptions extends CursorPageOptions {
|
|
1442
1477
|
parentCommentId?: string;
|
|
1443
1478
|
}
|
|
1444
|
-
/**
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1479
|
+
/**
|
|
1480
|
+
* `POST /v1/exports` body — the contract's own `CreateExportRequest`: `dataset` (`rankings` needs `board` +
|
|
1481
|
+
* `region`; `gifters` takes `rangeDays` + optional `region`/`segment`; `creator_roster`; `creator_gifters` needs
|
|
1482
|
+
* `creatorUniqueId` + optional `window`) and `format` (`csv`, or `xlsx` on Scale+).
|
|
1483
|
+
*/
|
|
1484
|
+
type ExportCreateInput = CreateExportRequest;
|
|
1450
1485
|
/** Mirrors `DeveloperUsageResponse` in `apps/platform-api/src/services/usage/usage-service.ts`. */
|
|
1451
1486
|
interface DeveloperUsage {
|
|
1452
1487
|
period: string;
|
|
@@ -1469,12 +1504,11 @@ interface UsageOptions {
|
|
|
1469
1504
|
period?: string;
|
|
1470
1505
|
limit?: number;
|
|
1471
1506
|
}
|
|
1472
|
-
/** `live:read` + `live:stream` —
|
|
1507
|
+
/** `live:read` + `live:stream` — per-creator LIVE performance and the realtime handshake token. (0.3.0 removed
|
|
1508
|
+
* `listSessions` / `getSession`: `GET /v1/live/sessions` is no longer part of the API.) */
|
|
1473
1509
|
declare class LiveResource {
|
|
1474
1510
|
private readonly http;
|
|
1475
1511
|
constructor(http: HttpTransport);
|
|
1476
|
-
listSessions(options?: LiveSessionsOptions): Promise<ProvenanceEnvelope<LiveSessionListResponse>>;
|
|
1477
|
-
getSession(id: string): Promise<ProvenanceEnvelope<LiveSessionRecord>>;
|
|
1478
1512
|
creatorPerformance(creatorUniqueId: string, options?: CursorPageOptions): Promise<ProvenanceEnvelope<LiveCreatorPerformanceListResponse>>;
|
|
1479
1513
|
/**
|
|
1480
1514
|
* Mint a short-lived realtime handshake token (D2.3). `client.live.stream()` calls this for you —
|
|
@@ -1593,6 +1627,11 @@ declare class GiftersResource {
|
|
|
1593
1627
|
list(options?: GifterListOptions): Promise<ProvenanceEnvelope<GifterListResponse>>;
|
|
1594
1628
|
get(gifterKey: string, options?: GifterWindowOptions): Promise<ProvenanceEnvelope<GifterProfileResponse>>;
|
|
1595
1629
|
forCreator(handle: string, options?: GifterWindowOptions): Promise<ProvenanceEnvelope<CreatorGiftersResponse>>;
|
|
1630
|
+
/** The creator's current LIVE session board (TikTok's in-room ranking): each gifter's cumulative coins in
|
|
1631
|
+
* the session; `session` is `null` when no live or recent session is tracked. */
|
|
1632
|
+
forCreatorLive(handle: string, options?: {
|
|
1633
|
+
limit?: number;
|
|
1634
|
+
}): Promise<ProvenanceEnvelope<CreatorLiveGiftersResponse>>;
|
|
1596
1635
|
}
|
|
1597
1636
|
/** `trend:read` */
|
|
1598
1637
|
declare class TrendsResource {
|
|
@@ -1742,13 +1781,9 @@ declare class TokTikClient {
|
|
|
1742
1781
|
readonly exports: ExportsResource;
|
|
1743
1782
|
readonly account: AccountResource;
|
|
1744
1783
|
constructor(options: TokTikClientOptions);
|
|
1745
|
-
/** @deprecated Use `client.live.listSessions()`. */
|
|
1746
|
-
listLiveSessions(options?: LiveSessionsOptions): Promise<ProvenanceEnvelope<LiveSessionListResponse>>;
|
|
1747
|
-
/** @deprecated Use `client.live.getSession()`. */
|
|
1748
|
-
getLiveSession(id: string): Promise<ProvenanceEnvelope<LiveSessionRecord>>;
|
|
1749
1784
|
/** @deprecated Use `client.live.creatorPerformance()`. */
|
|
1750
1785
|
listCreatorPerformance(creatorUniqueId: string, options?: CursorPageOptions): Promise<ProvenanceEnvelope<LiveCreatorPerformanceListResponse>>;
|
|
1751
1786
|
}
|
|
1752
1787
|
|
|
1753
1788
|
export { AccountResource, ContentResource, CreatorsResource, ExportsResource, GiftersResource, HttpTransport, LiveResource, RankingsResource, RealtimeStream, TokTikApiError, TokTikClient, TrendsResource, buildQuery, normalizeCreatorId };
|
|
1754
|
-
export type { CommentOptions, CreatorChangesOptions, CreatorListOptions, CursorPageOptions, DeveloperUsage, ExportCreateInput, GamingGamesOptions, GifterListOptions, GifterWindowOptions, LivePlaybackResponse,
|
|
1789
|
+
export type { CommentOptions, CreatorChangesOptions, CreatorListOptions, CursorPageOptions, DeveloperUsage, ExportCreateInput, GamingGamesOptions, GifterListOptions, GifterWindowOptions, LivePlaybackResponse, OfficialRankingOptions, RankMoversOptions, RankingHistoryOptions, RealtimeHandlers, RealtimeSocket, RealtimeSocketFactory, RealtimeStreamOptions, TokTikClientOptions, TokTikFetch, TokTikResponse, TrendOptions, UsageOptions };
|
package/dist/index.js
CHANGED
|
@@ -50,14 +50,6 @@ export class TokTikClient {
|
|
|
50
50
|
this.account = new AccountResource(this.http);
|
|
51
51
|
}
|
|
52
52
|
// --- Pre-D3.1 surface, kept so existing callers keep compiling. Prefer the namespaces above. ---
|
|
53
|
-
/** @deprecated Use `client.live.listSessions()`. */
|
|
54
|
-
listLiveSessions(options = {}) {
|
|
55
|
-
return this.live.listSessions(options);
|
|
56
|
-
}
|
|
57
|
-
/** @deprecated Use `client.live.getSession()`. */
|
|
58
|
-
getLiveSession(id) {
|
|
59
|
-
return this.live.getSession(id);
|
|
60
|
-
}
|
|
61
53
|
/** @deprecated Use `client.live.creatorPerformance()`. */
|
|
62
54
|
listCreatorPerformance(creatorUniqueId, options = {}) {
|
|
63
55
|
return this.live.creatorPerformance(creatorUniqueId, options);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAA4B,MAAM,WAAW,CAAC;AACpE,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,gBAA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,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,kGAAkG;IAElG,0DAA0D;IAC1D,sBAAsB,CACpB,eAAuB,EACvB,UAA6B,EAAE;QAE/B,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF"}
|
package/dist/resources.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
/** `live:read` + `live:stream` —
|
|
1
|
+
/** `live:read` + `live:stream` — per-creator LIVE performance and the realtime handshake token. (0.3.0 removed
|
|
2
|
+
* `listSessions` / `getSession`: `GET /v1/live/sessions` is no longer part of the API.) */
|
|
2
3
|
export class LiveResource {
|
|
3
4
|
http;
|
|
4
5
|
constructor(http) {
|
|
5
6
|
this.http = http;
|
|
6
7
|
}
|
|
7
|
-
listSessions(options = {}) {
|
|
8
|
-
return this.http.get("/v1/live/sessions", { ...options });
|
|
9
|
-
}
|
|
10
|
-
getSession(id) {
|
|
11
|
-
return this.http.get(`/v1/live/sessions/${encodeURIComponent(id)}`);
|
|
12
|
-
}
|
|
13
8
|
creatorPerformance(creatorUniqueId, options = {}) {
|
|
14
9
|
return this.http.get(`/v1/live/creators/${encodeURIComponent(creatorUniqueId)}/performance`, { ...options });
|
|
15
10
|
}
|
|
@@ -155,6 +150,11 @@ export class GiftersResource {
|
|
|
155
150
|
forCreator(handle, options = {}) {
|
|
156
151
|
return this.http.get(`/v1/creators/${encodeURIComponent(handle)}/gifters`, { ...options });
|
|
157
152
|
}
|
|
153
|
+
/** The creator's current LIVE session board (TikTok's in-room ranking): each gifter's cumulative coins in
|
|
154
|
+
* the session; `session` is `null` when no live or recent session is tracked. */
|
|
155
|
+
forCreatorLive(handle, options = {}) {
|
|
156
|
+
return this.http.get(`/v1/creators/${encodeURIComponent(handle)}/gifters/live`, { ...options });
|
|
157
|
+
}
|
|
158
158
|
}
|
|
159
159
|
/** `trend:read` */
|
|
160
160
|
export class TrendsResource {
|
package/dist/resources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AA4HA;2FAC2F;AAC3F,MAAM,OAAO,YAAY;IACM;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,kBAAkB,CAAC,eAAuB,EAAE,UAA6B,EAAE;QACzE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,qBAAqB,kBAAkB,CAAC,eAAe,CAAC,cAAc,EACtE,EAAE,GAAG,OAAO,EAAE,CACf,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,uBAAuB,CACxB,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,eAAuB;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAuB,qBAAqB,kBAAkB,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAClH,CAAC;CACF;AAqBD;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,C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IACrE,CAAC;CACF;AAED,sCAAsC;AACtC,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,iCAAiC;IACjC,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAwB,aAAa,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,KAAwB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAY,aAAa,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAY,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,EAAU;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,kBAAkB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;IAC7E,CAAC;CACF;AAED,mEAAmE;AACnE,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,YAAY,CAAC,UAA+B,EAAE;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,kBAAkB,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,UAAwB,EAAE;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAiB,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toktikhq/sdk-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Typed JavaScript client for the TokTik Developer API (REST + realtime LIVE events)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tiktok",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public",
|
|
31
|
-
"provenance":
|
|
31
|
+
"provenance": false
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "npm run build --workspace @v2/contracts && node ./scripts/build.mjs",
|