@phxgg/kick.js 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/BaseResponse.d.ts +0 -1
  2. package/dist/BaseResponse.js +0 -1
  3. package/dist/Errors.d.ts +0 -1
  4. package/dist/Errors.js +0 -1
  5. package/dist/EventManager.d.ts +0 -1
  6. package/dist/EventManager.js +0 -1
  7. package/dist/KickClient.d.ts +2 -1
  8. package/dist/KickClient.js +3 -1
  9. package/dist/OAuth.d.ts +0 -1
  10. package/dist/OAuth.js +0 -1
  11. package/dist/Scope.d.ts +0 -1
  12. package/dist/Scope.js +0 -1
  13. package/dist/Serializable.d.ts +0 -1
  14. package/dist/Serializable.js +0 -1
  15. package/dist/Version.d.ts +0 -1
  16. package/dist/Version.js +0 -1
  17. package/dist/index.d.ts +3 -1
  18. package/dist/index.js +2 -1
  19. package/dist/resources/Category.d.ts +0 -1
  20. package/dist/resources/Category.js +0 -1
  21. package/dist/resources/Channel.d.ts +0 -1
  22. package/dist/resources/Channel.js +0 -1
  23. package/dist/resources/ChannelReward.d.ts +0 -1
  24. package/dist/resources/ChannelReward.js +0 -1
  25. package/dist/resources/ChannelRewardRedemption.d.ts +0 -1
  26. package/dist/resources/ChannelRewardRedemption.js +0 -1
  27. package/dist/resources/EventSubscription.d.ts +0 -1
  28. package/dist/resources/EventSubscription.js +0 -1
  29. package/dist/resources/Leaderboard.d.ts +0 -1
  30. package/dist/resources/Leaderboard.js +0 -1
  31. package/dist/resources/Livestream.d.ts +0 -1
  32. package/dist/resources/Livestream.js +0 -1
  33. package/dist/resources/LivestreamV2.d.ts +48 -0
  34. package/dist/resources/LivestreamV2.js +43 -0
  35. package/dist/resources/Message.d.ts +0 -1
  36. package/dist/resources/Message.js +0 -1
  37. package/dist/resources/User.d.ts +0 -1
  38. package/dist/resources/User.js +0 -1
  39. package/dist/services/CategoriesService.d.ts +0 -1
  40. package/dist/services/CategoriesService.js +0 -1
  41. package/dist/services/CategoriesServiceV2.d.ts +0 -1
  42. package/dist/services/CategoriesServiceV2.js +0 -1
  43. package/dist/services/ChannelRewardsService.d.ts +0 -1
  44. package/dist/services/ChannelRewardsService.js +0 -1
  45. package/dist/services/ChannelsService.d.ts +0 -1
  46. package/dist/services/ChannelsService.js +0 -1
  47. package/dist/services/ChatService.d.ts +0 -1
  48. package/dist/services/ChatService.js +0 -1
  49. package/dist/services/EventsService.d.ts +0 -1
  50. package/dist/services/EventsService.js +0 -1
  51. package/dist/services/KICKsService.d.ts +0 -1
  52. package/dist/services/KICKsService.js +0 -1
  53. package/dist/services/LivestreamsService.d.ts +3 -1
  54. package/dist/services/LivestreamsService.js +3 -1
  55. package/dist/services/LivestreamsServiceV2.d.ts +32 -0
  56. package/dist/services/LivestreamsServiceV2.js +78 -0
  57. package/dist/services/ModerationService.d.ts +0 -1
  58. package/dist/services/ModerationService.js +0 -1
  59. package/dist/services/PublicKeyService.d.ts +0 -1
  60. package/dist/services/PublicKeyService.js +0 -1
  61. package/dist/services/UsersService.d.ts +0 -1
  62. package/dist/services/UsersService.js +0 -1
  63. package/dist/utils.d.ts +0 -1
  64. package/dist/utils.js +0 -1
  65. package/dist/webhooks/WebhookEvents.d.ts +0 -1
  66. package/dist/webhooks/WebhookEvents.js +0 -1
  67. package/dist/webhooks/dispatch.d.ts +0 -1
  68. package/dist/webhooks/dispatch.js +0 -1
  69. package/dist/webhooks/v1/Properties.d.ts +0 -1
  70. package/dist/webhooks/v1/Properties.js +0 -1
  71. package/dist/webhooks/v1/payloads/ChannelFollowed.d.ts +0 -1
  72. package/dist/webhooks/v1/payloads/ChannelFollowed.js +0 -1
  73. package/dist/webhooks/v1/payloads/ChannelRewardRedemptionUpdated.d.ts +0 -1
  74. package/dist/webhooks/v1/payloads/ChannelRewardRedemptionUpdated.js +0 -1
  75. package/dist/webhooks/v1/payloads/ChannelSubscriptionGifts.d.ts +0 -1
  76. package/dist/webhooks/v1/payloads/ChannelSubscriptionGifts.js +0 -1
  77. package/dist/webhooks/v1/payloads/ChannelSubscriptionNew.d.ts +0 -1
  78. package/dist/webhooks/v1/payloads/ChannelSubscriptionNew.js +0 -1
  79. package/dist/webhooks/v1/payloads/ChannelSubscriptionRenewal.d.ts +0 -1
  80. package/dist/webhooks/v1/payloads/ChannelSubscriptionRenewal.js +0 -1
  81. package/dist/webhooks/v1/payloads/ChatMessageSent.d.ts +0 -1
  82. package/dist/webhooks/v1/payloads/ChatMessageSent.js +0 -1
  83. package/dist/webhooks/v1/payloads/KicksGifted.d.ts +0 -1
  84. package/dist/webhooks/v1/payloads/KicksGifted.js +0 -1
  85. package/dist/webhooks/v1/payloads/LivestreamMetadataUpdated.d.ts +0 -1
  86. package/dist/webhooks/v1/payloads/LivestreamMetadataUpdated.js +0 -1
  87. package/dist/webhooks/v1/payloads/LivestreamStatusUpdated.d.ts +0 -1
  88. package/dist/webhooks/v1/payloads/LivestreamStatusUpdated.js +0 -1
  89. package/dist/webhooks/v1/payloads/ModerationBanned.d.ts +0 -1
  90. package/dist/webhooks/v1/payloads/ModerationBanned.js +0 -1
  91. package/dist/webhooks/v1/payloads/index.d.ts +0 -1
  92. package/dist/webhooks/v1/payloads/index.js +0 -1
  93. package/dist/webhooks/verify.d.ts +0 -1
  94. package/dist/webhooks/verify.js +0 -1
  95. package/package.json +1 -1
  96. package/dist/BaseResponse.d.ts.map +0 -1
  97. package/dist/BaseResponse.js.map +0 -1
  98. package/dist/Errors.d.ts.map +0 -1
  99. package/dist/Errors.js.map +0 -1
  100. package/dist/EventManager.d.ts.map +0 -1
  101. package/dist/EventManager.js.map +0 -1
  102. package/dist/KickClient.d.ts.map +0 -1
  103. package/dist/KickClient.js.map +0 -1
  104. package/dist/OAuth.d.ts.map +0 -1
  105. package/dist/OAuth.js.map +0 -1
  106. package/dist/Scope.d.ts.map +0 -1
  107. package/dist/Scope.js.map +0 -1
  108. package/dist/Serializable.d.ts.map +0 -1
  109. package/dist/Serializable.js.map +0 -1
  110. package/dist/Version.d.ts.map +0 -1
  111. package/dist/Version.js.map +0 -1
  112. package/dist/index.d.ts.map +0 -1
  113. package/dist/index.js.map +0 -1
  114. package/dist/resources/Category.d.ts.map +0 -1
  115. package/dist/resources/Category.js.map +0 -1
  116. package/dist/resources/Channel.d.ts.map +0 -1
  117. package/dist/resources/Channel.js.map +0 -1
  118. package/dist/resources/ChannelReward.d.ts.map +0 -1
  119. package/dist/resources/ChannelReward.js.map +0 -1
  120. package/dist/resources/ChannelRewardRedemption.d.ts.map +0 -1
  121. package/dist/resources/ChannelRewardRedemption.js.map +0 -1
  122. package/dist/resources/EventSubscription.d.ts.map +0 -1
  123. package/dist/resources/EventSubscription.js.map +0 -1
  124. package/dist/resources/Leaderboard.d.ts.map +0 -1
  125. package/dist/resources/Leaderboard.js.map +0 -1
  126. package/dist/resources/Livestream.d.ts.map +0 -1
  127. package/dist/resources/Livestream.js.map +0 -1
  128. package/dist/resources/Message.d.ts.map +0 -1
  129. package/dist/resources/Message.js.map +0 -1
  130. package/dist/resources/User.d.ts.map +0 -1
  131. package/dist/resources/User.js.map +0 -1
  132. package/dist/services/CategoriesService.d.ts.map +0 -1
  133. package/dist/services/CategoriesService.js.map +0 -1
  134. package/dist/services/CategoriesServiceV2.d.ts.map +0 -1
  135. package/dist/services/CategoriesServiceV2.js.map +0 -1
  136. package/dist/services/ChannelRewardsService.d.ts.map +0 -1
  137. package/dist/services/ChannelRewardsService.js.map +0 -1
  138. package/dist/services/ChannelsService.d.ts.map +0 -1
  139. package/dist/services/ChannelsService.js.map +0 -1
  140. package/dist/services/ChatService.d.ts.map +0 -1
  141. package/dist/services/ChatService.js.map +0 -1
  142. package/dist/services/EventsService.d.ts.map +0 -1
  143. package/dist/services/EventsService.js.map +0 -1
  144. package/dist/services/KICKsService.d.ts.map +0 -1
  145. package/dist/services/KICKsService.js.map +0 -1
  146. package/dist/services/LivestreamsService.d.ts.map +0 -1
  147. package/dist/services/LivestreamsService.js.map +0 -1
  148. package/dist/services/ModerationService.d.ts.map +0 -1
  149. package/dist/services/ModerationService.js.map +0 -1
  150. package/dist/services/PublicKeyService.d.ts.map +0 -1
  151. package/dist/services/PublicKeyService.js.map +0 -1
  152. package/dist/services/UsersService.d.ts.map +0 -1
  153. package/dist/services/UsersService.js.map +0 -1
  154. package/dist/utils.d.ts.map +0 -1
  155. package/dist/utils.js.map +0 -1
  156. package/dist/webhooks/WebhookEvents.d.ts.map +0 -1
  157. package/dist/webhooks/WebhookEvents.js.map +0 -1
  158. package/dist/webhooks/dispatch.d.ts.map +0 -1
  159. package/dist/webhooks/dispatch.js.map +0 -1
  160. package/dist/webhooks/v1/Properties.d.ts.map +0 -1
  161. package/dist/webhooks/v1/Properties.js.map +0 -1
  162. package/dist/webhooks/v1/payloads/ChannelFollowed.d.ts.map +0 -1
  163. package/dist/webhooks/v1/payloads/ChannelFollowed.js.map +0 -1
  164. package/dist/webhooks/v1/payloads/ChannelRewardRedemptionUpdated.d.ts.map +0 -1
  165. package/dist/webhooks/v1/payloads/ChannelRewardRedemptionUpdated.js.map +0 -1
  166. package/dist/webhooks/v1/payloads/ChannelSubscriptionGifts.d.ts.map +0 -1
  167. package/dist/webhooks/v1/payloads/ChannelSubscriptionGifts.js.map +0 -1
  168. package/dist/webhooks/v1/payloads/ChannelSubscriptionNew.d.ts.map +0 -1
  169. package/dist/webhooks/v1/payloads/ChannelSubscriptionNew.js.map +0 -1
  170. package/dist/webhooks/v1/payloads/ChannelSubscriptionRenewal.d.ts.map +0 -1
  171. package/dist/webhooks/v1/payloads/ChannelSubscriptionRenewal.js.map +0 -1
  172. package/dist/webhooks/v1/payloads/ChatMessageSent.d.ts.map +0 -1
  173. package/dist/webhooks/v1/payloads/ChatMessageSent.js.map +0 -1
  174. package/dist/webhooks/v1/payloads/KicksGifted.d.ts.map +0 -1
  175. package/dist/webhooks/v1/payloads/KicksGifted.js.map +0 -1
  176. package/dist/webhooks/v1/payloads/LivestreamMetadataUpdated.d.ts.map +0 -1
  177. package/dist/webhooks/v1/payloads/LivestreamMetadataUpdated.js.map +0 -1
  178. package/dist/webhooks/v1/payloads/LivestreamStatusUpdated.d.ts.map +0 -1
  179. package/dist/webhooks/v1/payloads/LivestreamStatusUpdated.js.map +0 -1
  180. package/dist/webhooks/v1/payloads/ModerationBanned.d.ts.map +0 -1
  181. package/dist/webhooks/v1/payloads/ModerationBanned.js.map +0 -1
  182. package/dist/webhooks/v1/payloads/index.d.ts.map +0 -1
  183. package/dist/webhooks/v1/payloads/index.js.map +0 -1
  184. package/dist/webhooks/verify.d.ts.map +0 -1
  185. package/dist/webhooks/verify.js.map +0 -1
@@ -7,4 +7,3 @@ export type BaseResponseWithPagination<T> = BaseResponse<T> & {
7
7
  next_cursor: string;
8
8
  };
9
9
  };
10
- //# sourceMappingURL=BaseResponse.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=BaseResponse.js.map
package/dist/Errors.d.ts CHANGED
@@ -22,4 +22,3 @@ export declare class NoTokenSetError extends Error {
22
22
  export declare class MissingScopeError extends Error {
23
23
  constructor(message?: string);
24
24
  }
25
- //# sourceMappingURL=Errors.d.ts.map
package/dist/Errors.js CHANGED
@@ -46,4 +46,3 @@ export class MissingScopeError extends Error {
46
46
  this.name = 'MissingScopeError';
47
47
  }
48
48
  }
49
- //# sourceMappingURL=Errors.js.map
@@ -12,4 +12,3 @@ declare class EventManager {
12
12
  }
13
13
  export declare const eventManager: EventManager;
14
14
  export {};
15
- //# sourceMappingURL=EventManager.d.ts.map
@@ -32,4 +32,3 @@ class EventManager {
32
32
  }
33
33
  }
34
34
  export const eventManager = EventManager.getInstance();
35
- //# sourceMappingURL=EventManager.js.map
@@ -8,6 +8,7 @@ import { ChatService } from './services/ChatService.js';
8
8
  import { EventsService } from './services/EventsService.js';
9
9
  import { KICKsService } from './services/KICKsService.js';
10
10
  import { LivestreamsService } from './services/LivestreamsService.js';
11
+ import { LivestreamsServiceV2 } from './services/LivestreamsServiceV2.js';
11
12
  import { ModerationService } from './services/ModerationService.js';
12
13
  import { UsersService } from './services/UsersService.js';
13
14
  import { WebhookEventNames, WebhookEventPayloadMap } from './webhooks/WebhookEvents.js';
@@ -32,6 +33,7 @@ export declare class KickClient {
32
33
  chat: ChatService;
33
34
  moderation: ModerationService;
34
35
  livestreams: LivestreamsService;
36
+ livestreamsV2: LivestreamsServiceV2;
35
37
  events: EventsService;
36
38
  kicks: KICKsService;
37
39
  constructor(options: KickClientOptions);
@@ -43,4 +45,3 @@ export declare class KickClient {
43
45
  removeAllListeners(): void;
44
46
  requiresScope(scope: Scope): void;
45
47
  }
46
- //# sourceMappingURL=KickClient.d.ts.map
@@ -10,6 +10,7 @@ import { ChatService } from './services/ChatService.js';
10
10
  import { EventsService } from './services/EventsService.js';
11
11
  import { KICKsService } from './services/KICKsService.js';
12
12
  import { LivestreamsService } from './services/LivestreamsService.js';
13
+ import { LivestreamsServiceV2 } from './services/LivestreamsServiceV2.js';
13
14
  import { ModerationService } from './services/ModerationService.js';
14
15
  import { UsersService } from './services/UsersService.js';
15
16
  export const KICK_BASE_URL = 'https://api.kick.com/public';
@@ -28,6 +29,7 @@ export class KickClient {
28
29
  chat;
29
30
  moderation;
30
31
  livestreams;
32
+ livestreamsV2;
31
33
  events;
32
34
  kicks;
33
35
  constructor(options) {
@@ -40,6 +42,7 @@ export class KickClient {
40
42
  this.chat = new ChatService(this);
41
43
  this.moderation = new ModerationService(this);
42
44
  this.livestreams = new LivestreamsService(this);
45
+ this.livestreamsV2 = new LivestreamsServiceV2(this);
43
46
  this.events = new EventsService(this);
44
47
  this.kicks = new KICKsService(this);
45
48
  }
@@ -85,4 +88,3 @@ export class KickClient {
85
88
  }
86
89
  }
87
90
  }
88
- //# sourceMappingURL=KickClient.js.map
package/dist/OAuth.d.ts CHANGED
@@ -74,4 +74,3 @@ export declare class OAuth {
74
74
  */
75
75
  introspect(): Promise<TokenIntrospect>;
76
76
  }
77
- //# sourceMappingURL=OAuth.d.ts.map
package/dist/OAuth.js CHANGED
@@ -159,4 +159,3 @@ export class OAuth {
159
159
  return token;
160
160
  }
161
161
  }
162
- //# sourceMappingURL=OAuth.js.map
package/dist/Scope.d.ts CHANGED
@@ -11,4 +11,3 @@ export declare enum Scope {
11
11
  MODERATION_CHAT_MESSAGE_MANAGE = "moderation:chat_message:manage",
12
12
  KICKS_READ = "kicks:read"
13
13
  }
14
- //# sourceMappingURL=Scope.d.ts.map
package/dist/Scope.js CHANGED
@@ -12,4 +12,3 @@ export var Scope;
12
12
  Scope["MODERATION_CHAT_MESSAGE_MANAGE"] = "moderation:chat_message:manage";
13
13
  Scope["KICKS_READ"] = "kicks:read";
14
14
  })(Scope || (Scope = {}));
15
- //# sourceMappingURL=Scope.js.map
@@ -12,4 +12,3 @@ export declare abstract class Serializable {
12
12
  declare function serializeInstance<T extends object>(instance: T, opts?: SerializeOptions): any;
13
13
  export declare const serialize: typeof serializeInstance;
14
14
  export {};
15
- //# sourceMappingURL=Serializable.d.ts.map
@@ -108,4 +108,3 @@ function serializeInstance(instance, opts = {}) {
108
108
  }
109
109
  // Optional helper export if you need to serialize non-Serializable instances manually
110
110
  export const serialize = serializeInstance;
111
- //# sourceMappingURL=Serializable.js.map
package/dist/Version.d.ts CHANGED
@@ -2,4 +2,3 @@ export declare enum Version {
2
2
  V1 = "v1",
3
3
  V2 = "v2"
4
4
  }
5
- //# sourceMappingURL=Version.d.ts.map
package/dist/Version.js CHANGED
@@ -3,4 +3,3 @@ export var Version;
3
3
  Version["V1"] = "v1";
4
4
  Version["V2"] = "v2";
5
5
  })(Version || (Version = {}));
6
- //# sourceMappingURL=Version.js.map
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export { ChatService, ChatMessageType } from './services/ChatService.js';
18
18
  export { EventsService, EventSubscriptionMethod } from './services/EventsService.js';
19
19
  export { KICKsService } from './services/KICKsService.js';
20
20
  export { LivestreamsService } from './services/LivestreamsService.js';
21
+ export { LivestreamsServiceV2 } from './services/LivestreamsServiceV2.js';
21
22
  export { ModerationService } from './services/ModerationService.js';
22
23
  export { PublicKeyService, getKickPublicKey } from './services/PublicKeyService.js';
23
24
  export type { PublicKeyDto, PublicKeyResponse } from './services/PublicKeyService.js';
@@ -36,6 +37,8 @@ export { Leaderboard } from './resources/Leaderboard.js';
36
37
  export type { LeaderboardDto } from './resources/Leaderboard.js';
37
38
  export { Livestream } from './resources/Livestream.js';
38
39
  export type { LivestreamDto, LivestreamStatsDto } from './resources/Livestream.js';
40
+ export { LivestreamV2 } from './resources/LivestreamV2.js';
41
+ export type { LivestreamV2Dto, LivestreamV2StatsDto } from './resources/LivestreamV2.js';
39
42
  export { Message } from './resources/Message.js';
40
43
  export type { MessageDto } from './resources/Message.js';
41
44
  export { User } from './resources/User.js';
@@ -46,4 +49,3 @@ export { dispatchWebhookEvent } from './webhooks/dispatch.js';
46
49
  export { WebhookEvents } from './webhooks/WebhookEvents.js';
47
50
  export type { WebhookEventNames, WebhookEventPayloadMap } from './webhooks/WebhookEvents.js';
48
51
  export type { ChannelFollowedEventPayload, ChannelRewardRedemptionUpdatedEventPayload, ChannelSubscriptionGiftsEventPayload, ChannelSubscriptionNewEventPayload, ChannelSubscriptionRenewalEventPayload, ChatMessageSentEventPayload, KicksGiftedEventPayload, LivestreamMetadataUpdatedEventPayload, LivestreamStatusUpdatedEventPayload, ModerationBannedEventPayload, } from './webhooks/v1/payloads/index.js';
49
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ export { ChatService, ChatMessageType } from './services/ChatService.js';
22
22
  export { EventsService, EventSubscriptionMethod } from './services/EventsService.js';
23
23
  export { KICKsService } from './services/KICKsService.js';
24
24
  export { LivestreamsService } from './services/LivestreamsService.js';
25
+ export { LivestreamsServiceV2 } from './services/LivestreamsServiceV2.js';
25
26
  export { ModerationService } from './services/ModerationService.js';
26
27
  export { PublicKeyService, getKickPublicKey } from './services/PublicKeyService.js';
27
28
  export { UsersService } from './services/UsersService.js';
@@ -32,10 +33,10 @@ export { ChannelReward } from './resources/ChannelReward.js';
32
33
  export { EventSubscription } from './resources/EventSubscription.js';
33
34
  export { Leaderboard } from './resources/Leaderboard.js';
34
35
  export { Livestream } from './resources/Livestream.js';
36
+ export { LivestreamV2 } from './resources/LivestreamV2.js';
35
37
  export { Message } from './resources/Message.js';
36
38
  export { User } from './resources/User.js';
37
39
  // Webhooks: framework-agnostic primitives
38
40
  export { verifyKickSignature } from './webhooks/verify.js';
39
41
  export { dispatchWebhookEvent } from './webhooks/dispatch.js';
40
42
  export { WebhookEvents } from './webhooks/WebhookEvents.js';
41
- //# sourceMappingURL=index.js.map
@@ -17,4 +17,3 @@ export declare class Category extends Serializable {
17
17
  get thumbnail(): URL;
18
18
  get viewerCount(): number | undefined;
19
19
  }
20
- //# sourceMappingURL=Category.d.ts.map
@@ -23,4 +23,3 @@ export class Category extends Serializable {
23
23
  return this.dto.viewer_count;
24
24
  }
25
25
  }
26
- //# sourceMappingURL=Category.js.map
@@ -45,4 +45,3 @@ export declare class Channel extends Serializable {
45
45
  get streamTitle(): string;
46
46
  send(content: string, type?: ChatMessageType): Promise<Message>;
47
47
  }
48
- //# sourceMappingURL=Channel.d.ts.map
@@ -48,4 +48,3 @@ export class Channel extends Serializable {
48
48
  });
49
49
  }
50
50
  }
51
- //# sourceMappingURL=Channel.js.map
@@ -25,4 +25,3 @@ export declare class ChannelReward extends Serializable {
25
25
  get shouldRedemptionsSkipRequestQueue(): boolean;
26
26
  get title(): string;
27
27
  }
28
- //# sourceMappingURL=ChannelReward.d.ts.map
@@ -35,4 +35,3 @@ export class ChannelReward extends Serializable {
35
35
  return this.dto.title;
36
36
  }
37
37
  }
38
- //# sourceMappingURL=ChannelReward.js.map
@@ -56,4 +56,3 @@ export declare class ChannelRewardRedemption extends Serializable {
56
56
  };
57
57
  }
58
58
  export {};
59
- //# sourceMappingURL=ChannelRewardRedemption.d.ts.map
@@ -35,4 +35,3 @@ export class ChannelRewardRedemption extends Serializable {
35
35
  };
36
36
  }
37
37
  }
38
- //# sourceMappingURL=ChannelRewardRedemption.js.map
@@ -23,4 +23,3 @@ export declare class EventSubscription extends Serializable {
23
23
  get updatedAt(): Date;
24
24
  get version(): number;
25
25
  }
26
- //# sourceMappingURL=EventSubscription.d.ts.map
@@ -32,4 +32,3 @@ export class EventSubscription extends Serializable {
32
32
  return this.dto.version;
33
33
  }
34
34
  }
35
- //# sourceMappingURL=EventSubscription.js.map
@@ -19,4 +19,3 @@ export declare class Leaderboard extends Serializable {
19
19
  get month(): LeaderboardEntry[];
20
20
  get week(): LeaderboardEntry[];
21
21
  }
22
- //# sourceMappingURL=Leaderboard.d.ts.map
@@ -17,4 +17,3 @@ export class Leaderboard extends Serializable {
17
17
  return this.dto.week;
18
18
  }
19
19
  }
20
- //# sourceMappingURL=Leaderboard.js.map
@@ -35,4 +35,3 @@ export declare class Livestream extends Serializable {
35
35
  get thumbnail(): URL;
36
36
  get viewerCount(): number;
37
37
  }
38
- //# sourceMappingURL=Livestream.d.ts.map
@@ -45,4 +45,3 @@ export class Livestream extends Serializable {
45
45
  return this.dto.viewer_count;
46
46
  }
47
47
  }
48
- //# sourceMappingURL=Livestream.js.map
@@ -0,0 +1,48 @@
1
+ import type { KickClient } from '../KickClient.js';
2
+ import { Serializable } from '../Serializable.js';
3
+ type LivestreamUserDto = {
4
+ id: number;
5
+ profile_picture: string;
6
+ username: string;
7
+ };
8
+ type LivestreamCategoryDto = {
9
+ id: number;
10
+ name: string;
11
+ thumbnail: string;
12
+ };
13
+ type LivestreamChannelDto = {
14
+ slug: string;
15
+ };
16
+ export type LivestreamV2Dto = {
17
+ broadcaster_user: LivestreamUserDto;
18
+ category: LivestreamCategoryDto;
19
+ channel: LivestreamChannelDto;
20
+ has_mature_content: boolean;
21
+ id: string;
22
+ language_code: string;
23
+ started_at: string;
24
+ tags: string[];
25
+ thumbnail: string;
26
+ title: string;
27
+ viewer_count: number;
28
+ };
29
+ export type LivestreamV2StatsDto = {
30
+ total_count: number;
31
+ };
32
+ export declare class LivestreamV2 extends Serializable {
33
+ private dto;
34
+ protected readonly client: KickClient;
35
+ constructor(client: KickClient, dto: LivestreamV2Dto);
36
+ get broadcasterUser(): LivestreamUserDto;
37
+ get category(): LivestreamCategoryDto;
38
+ get channel(): LivestreamChannelDto;
39
+ get hasMatureContent(): boolean;
40
+ get id(): string;
41
+ get languageCode(): string;
42
+ get startedAt(): Date;
43
+ get tags(): string[];
44
+ get thumbnail(): URL;
45
+ get title(): string;
46
+ get viewerCount(): number;
47
+ }
48
+ export {};
@@ -0,0 +1,43 @@
1
+ import { Serializable } from '../Serializable.js';
2
+ export class LivestreamV2 extends Serializable {
3
+ dto;
4
+ client;
5
+ constructor(client, dto) {
6
+ super();
7
+ this.dto = dto;
8
+ this.client = client;
9
+ }
10
+ get broadcasterUser() {
11
+ return this.dto.broadcaster_user;
12
+ }
13
+ get category() {
14
+ return this.dto.category;
15
+ }
16
+ get channel() {
17
+ return this.dto.channel;
18
+ }
19
+ get hasMatureContent() {
20
+ return this.dto.has_mature_content;
21
+ }
22
+ get id() {
23
+ return this.dto.id;
24
+ }
25
+ get languageCode() {
26
+ return this.dto.language_code;
27
+ }
28
+ get startedAt() {
29
+ return new Date(this.dto.started_at);
30
+ }
31
+ get tags() {
32
+ return this.dto.tags;
33
+ }
34
+ get thumbnail() {
35
+ return new URL(this.dto.thumbnail);
36
+ }
37
+ get title() {
38
+ return this.dto.title;
39
+ }
40
+ get viewerCount() {
41
+ return this.dto.viewer_count;
42
+ }
43
+ }
@@ -11,4 +11,3 @@ export declare class Message extends Serializable {
11
11
  get isSent(): boolean;
12
12
  get messageId(): string;
13
13
  }
14
- //# sourceMappingURL=Message.d.ts.map
@@ -14,4 +14,3 @@ export class Message extends Serializable {
14
14
  return this.dto.message_id;
15
15
  }
16
16
  }
17
- //# sourceMappingURL=Message.js.map
@@ -15,4 +15,3 @@ export declare class User extends Serializable {
15
15
  get profilePicture(): URL;
16
16
  get userId(): number;
17
17
  }
18
- //# sourceMappingURL=User.d.ts.map
@@ -20,4 +20,3 @@ export class User extends Serializable {
20
20
  return this.dto.user_id;
21
21
  }
22
22
  }
23
- //# sourceMappingURL=User.js.map
@@ -36,4 +36,3 @@ export declare class CategoriesService {
36
36
  */
37
37
  fetch(id: number): Promise<Category>;
38
38
  }
39
- //# sourceMappingURL=CategoriesService.d.ts.map
@@ -70,4 +70,3 @@ export class CategoriesService {
70
70
  return category;
71
71
  }
72
72
  }
73
- //# sourceMappingURL=CategoriesService.js.map
@@ -36,4 +36,3 @@ export declare class CategoriesServiceV2 {
36
36
  */
37
37
  fetch(id: number): Promise<Omit<Category, "viewerCount">>;
38
38
  }
39
- //# sourceMappingURL=CategoriesServiceV2.d.ts.map
@@ -86,4 +86,3 @@ export class CategoriesServiceV2 {
86
86
  return result[0];
87
87
  }
88
88
  }
89
- //# sourceMappingURL=CategoriesServiceV2.js.map
@@ -125,4 +125,3 @@ export declare class ChannelRewardsService {
125
125
  */
126
126
  rejectRedemptions({ ids }: RejectRedemptionsParams): Promise<ChannelRewardRejectRedemptionDto[]>;
127
127
  }
128
- //# sourceMappingURL=ChannelRewardsService.d.ts.map
@@ -293,4 +293,3 @@ export class ChannelRewardsService {
293
293
  return json.data;
294
294
  }
295
295
  }
296
- //# sourceMappingURL=ChannelRewardsService.js.map
@@ -61,4 +61,3 @@ export declare class ChannelsService {
61
61
  */
62
62
  update(params: UpdateChannelParams): Promise<void>;
63
63
  }
64
- //# sourceMappingURL=ChannelsService.d.ts.map
@@ -123,4 +123,3 @@ export class ChannelsService {
123
123
  }
124
124
  }
125
125
  }
126
- //# sourceMappingURL=ChannelsService.js.map
@@ -46,4 +46,3 @@ export declare class ChatService {
46
46
  */
47
47
  delete(messageId: string): Promise<void>;
48
48
  }
49
- //# sourceMappingURL=ChatService.d.ts.map
@@ -87,4 +87,3 @@ export class ChatService {
87
87
  }
88
88
  }
89
89
  }
90
- //# sourceMappingURL=ChatService.js.map
@@ -93,4 +93,3 @@ export declare class EventsService {
93
93
  */
94
94
  unsubscribe(id: string): Promise<void>;
95
95
  }
96
- //# sourceMappingURL=EventsService.d.ts.map
@@ -142,4 +142,3 @@ export class EventsService {
142
142
  return this.unsubscribeMultiple([id]);
143
143
  }
144
144
  }
145
- //# sourceMappingURL=EventsService.js.map
@@ -23,4 +23,3 @@ export declare class KICKsService {
23
23
  */
24
24
  fetchLeaderboard(params: FetchLeaderboardParams): Promise<Leaderboard>;
25
25
  }
26
- //# sourceMappingURL=KICKsService.d.ts.map
@@ -46,4 +46,3 @@ export class KICKsService {
46
46
  return leaderboard;
47
47
  }
48
48
  }
49
- //# sourceMappingURL=KICKsService.js.map
@@ -16,6 +16,9 @@ export declare const fetchLivestreamsSchema: z.ZodObject<{
16
16
  export type FetchLivestreamsParams = z.infer<typeof fetchLivestreamsSchema>;
17
17
  export type FetchLivestreamsResponse = BaseResponse<LivestreamDto[]>;
18
18
  export type FetchLivestreamStatsResponse = BaseResponse<LivestreamStatsDto>;
19
+ /**
20
+ * @deprecated Use `LivestreamsServiceV2` instead.
21
+ */
19
22
  export declare class LivestreamsService {
20
23
  private readonly LIVESTREAMS_URL;
21
24
  protected readonly client: KickClient;
@@ -36,4 +39,3 @@ export declare class LivestreamsService {
36
39
  total_count: number;
37
40
  }>;
38
41
  }
39
- //# sourceMappingURL=LivestreamsService.d.ts.map
@@ -14,6 +14,9 @@ export const fetchLivestreamsSchema = z.object({
14
14
  limit: z.number().int().min(1).max(100).optional(),
15
15
  sort: z.enum(Sort).optional(),
16
16
  });
17
+ /**
18
+ * @deprecated Use `LivestreamsServiceV2` instead.
19
+ */
17
20
  export class LivestreamsService {
18
21
  LIVESTREAMS_URL = constructEndpoint(Version.V1, 'livestreams');
19
22
  client;
@@ -89,4 +92,3 @@ export class LivestreamsService {
89
92
  return json.data;
90
93
  }
91
94
  }
92
- //# sourceMappingURL=LivestreamsService.js.map
@@ -0,0 +1,32 @@
1
+ import z from 'zod';
2
+ import { BaseResponse } from '../BaseResponse.js';
3
+ import type { KickClient } from '../KickClient.js';
4
+ import { LivestreamV2, type LivestreamV2Dto, type LivestreamV2StatsDto } from '../index.js';
5
+ export declare const fetchLivestreamsV2Schema: z.ZodObject<{
6
+ categoryId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
7
+ language_code: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ limit: z.ZodOptional<z.ZodNumber>;
9
+ cursor: z.ZodOptional<z.ZodString>;
10
+ }, z.z.core.$strip>;
11
+ export type FetchLivestreamsV2Params = z.infer<typeof fetchLivestreamsV2Schema>;
12
+ export type FetchLivestreamsV2Response = BaseResponse<LivestreamV2Dto[]>;
13
+ export type FetchLivestreamStatsResponse = BaseResponse<LivestreamV2StatsDto>;
14
+ export declare class LivestreamsServiceV2 {
15
+ private readonly LIVESTREAMS_URL;
16
+ protected readonly client: KickClient;
17
+ constructor(client: KickClient);
18
+ /**
19
+ * Fetches livestreams from the Kick API.
20
+ *
21
+ * @param params Parameters for fetching livestreams.
22
+ * @param params.category_id (Optional) Category ID to filter by.
23
+ * @param params.language_code (Optional) Array of language codes to filter by.
24
+ * @param params.limit (Optional) Maximum number of results to return. Min: 1, Max: 1000.
25
+ * @param params.cursor (Optional) Cursor for pagination.
26
+ * @returns An array of `LivestreamV2` instances.
27
+ */
28
+ fetch(params: FetchLivestreamsV2Params): Promise<LivestreamV2[]>;
29
+ fetchStats(): Promise<{
30
+ total_count: number;
31
+ }>;
32
+ }
@@ -0,0 +1,78 @@
1
+ import z from 'zod';
2
+ import { LivestreamV2 } from '../index.js';
3
+ import { constructEndpoint, handleError, parseJSON } from '../utils.js';
4
+ import { Version } from '../Version.js';
5
+ export const fetchLivestreamsV2Schema = z.object({
6
+ categoryId: z.array(z.number().int().positive()).optional(),
7
+ language_code: z.array(z.string()).optional(),
8
+ limit: z.number().int().min(1).max(1000).optional(),
9
+ cursor: z.string().optional(),
10
+ });
11
+ export class LivestreamsServiceV2 {
12
+ LIVESTREAMS_URL = constructEndpoint(Version.V2, 'livestreams');
13
+ client;
14
+ constructor(client) {
15
+ this.client = client;
16
+ }
17
+ /**
18
+ * Fetches livestreams from the Kick API.
19
+ *
20
+ * @param params Parameters for fetching livestreams.
21
+ * @param params.category_id (Optional) Category ID to filter by.
22
+ * @param params.language_code (Optional) Array of language codes to filter by.
23
+ * @param params.limit (Optional) Maximum number of results to return. Min: 1, Max: 1000.
24
+ * @param params.cursor (Optional) Cursor for pagination.
25
+ * @returns An array of `LivestreamV2` instances.
26
+ */
27
+ async fetch(params) {
28
+ const schema = fetchLivestreamsV2Schema.safeParse(params);
29
+ if (!schema.success) {
30
+ const errorMessages = schema.error.issues.map((issue) => ({
31
+ key: issue.path.join('.'),
32
+ message: issue.message,
33
+ }));
34
+ throw new Error(`Invalid parameters: ${JSON.stringify(errorMessages)}`);
35
+ }
36
+ const { categoryId, language_code, limit, cursor } = schema.data;
37
+ if (limit && (limit < 1 || limit > 1000)) {
38
+ throw new Error('The limit must be between 1 and 1000.');
39
+ }
40
+ const endpoint = new URL(this.LIVESTREAMS_URL);
41
+ if (categoryId && categoryId.length > 0) {
42
+ categoryId.forEach((id) => endpoint.searchParams.append('category_id', String(id)));
43
+ }
44
+ if (language_code && language_code.length > 0) {
45
+ language_code.forEach((code) => endpoint.searchParams.append('language_code', code));
46
+ }
47
+ if (limit) {
48
+ endpoint.searchParams.append('limit', String(limit));
49
+ }
50
+ if (cursor) {
51
+ endpoint.searchParams.append('cursor', cursor);
52
+ }
53
+ const response = await fetch(endpoint, {
54
+ headers: {
55
+ Authorization: `Bearer ${this.client.token?.access_token}`,
56
+ },
57
+ });
58
+ if (!response.ok) {
59
+ handleError(response);
60
+ }
61
+ const json = await parseJSON(response);
62
+ const livestreams = json.data.map((livestream) => new LivestreamV2(this.client, livestream));
63
+ return livestreams;
64
+ }
65
+ async fetchStats() {
66
+ const endpoint = new URL(this.LIVESTREAMS_URL.replace(`/${Version.V2}/`, `/${Version.V1}/`) + '/stats');
67
+ const response = await fetch(endpoint, {
68
+ headers: {
69
+ Authorization: `Bearer ${this.client.token?.access_token}`,
70
+ },
71
+ });
72
+ if (!response.ok) {
73
+ handleError(response);
74
+ }
75
+ const json = await parseJSON(response);
76
+ return json.data;
77
+ }
78
+ }
@@ -62,4 +62,3 @@ export declare class ModerationService {
62
62
  */
63
63
  removeBan(params: RemoveBanParams): Promise<void>;
64
64
  }
65
- //# sourceMappingURL=ModerationService.d.ts.map
@@ -129,4 +129,3 @@ export class ModerationService {
129
129
  }
130
130
  }
131
131
  }
132
- //# sourceMappingURL=ModerationService.js.map
@@ -19,4 +19,3 @@ export declare class PublicKeyService {
19
19
  refresh(): Promise<string>;
20
20
  }
21
21
  export declare function getKickPublicKey(): Promise<string>;
22
- //# sourceMappingURL=PublicKeyService.d.ts.map
@@ -55,4 +55,3 @@ export class PublicKeyService {
55
55
  export async function getKickPublicKey() {
56
56
  return PublicKeyService.getInstance().getPublicKey();
57
57
  }
58
- //# sourceMappingURL=PublicKeyService.js.map