@wave-av/sdk 2.0.3 → 2.0.5
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 +9 -50
- package/dist/audience.d.ts +105 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/billing-types.d.ts +39 -0
- package/dist/billing-types.d.ts.map +1 -0
- package/dist/billing-types.js +18 -0
- package/dist/billing-types.mjs +0 -0
- package/dist/billing.d.ts +69 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +139 -0
- package/dist/billing.mjs +9 -0
- package/dist/camera-control.d.ts +55 -0
- package/dist/camera-control.d.ts.map +1 -0
- package/dist/captions-types.d.ts +119 -0
- package/dist/captions-types.d.ts.map +1 -0
- package/dist/captions.d.ts +218 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/chapters-types.d.ts +87 -0
- package/dist/chapters-types.d.ts.map +1 -0
- package/dist/chapters.d.ts +207 -0
- package/dist/chapters.d.ts.map +1 -0
- package/dist/chunk-I3V47I4W.mjs +114 -0
- package/dist/client-types.d.ts +59 -0
- package/dist/client-types.d.ts.map +1 -0
- package/dist/client.d.ts +119 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/clips-types.d.ts +31 -0
- package/dist/clips-types.d.ts.map +1 -0
- package/dist/clips.d.ts +230 -0
- package/dist/clips.d.ts.map +1 -0
- package/dist/cloud-switcher.d.ts +66 -0
- package/dist/cloud-switcher.d.ts.map +1 -0
- package/dist/collab-types.d.ts +205 -0
- package/dist/collab-types.d.ts.map +1 -0
- package/dist/collab.d.ts +227 -0
- package/dist/collab.d.ts.map +1 -0
- package/dist/connect.d.ts +89 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/creator.d.ts +110 -0
- package/dist/creator.d.ts.map +1 -0
- package/dist/desktop.d.ts +96 -0
- package/dist/desktop.d.ts.map +1 -0
- package/dist/distribution.d.ts +93 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/drm.d.ts +88 -0
- package/dist/drm.d.ts.map +1 -0
- package/dist/edge.d.ts +113 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/editor-types.d.ts +237 -0
- package/dist/editor-types.d.ts.map +1 -0
- package/dist/editor.d.ts +207 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/fleet.d.ts +208 -0
- package/dist/fleet.d.ts.map +1 -0
- package/dist/ghost.d.ts +214 -0
- package/dist/ghost.d.ts.map +1 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.mjs +49 -43
- package/dist/marketplace.d.ts +91 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/mesh.d.ts +238 -0
- package/dist/mesh.d.ts.map +1 -0
- package/dist/notifications.d.ts +83 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/phone-types.d.ts +111 -0
- package/dist/phone-types.d.ts.map +1 -0
- package/dist/phone.d.ts +235 -0
- package/dist/phone.d.ts.map +1 -0
- package/dist/pipeline-types.d.ts +188 -0
- package/dist/pipeline-types.d.ts.map +1 -0
- package/dist/pipeline.d.ts +224 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/podcast.d.ts +114 -0
- package/dist/podcast.d.ts.map +1 -0
- package/dist/prism.d.ts +133 -0
- package/dist/prism.d.ts.map +1 -0
- package/dist/prompter.d.ts +185 -0
- package/dist/prompter.d.ts.map +1 -0
- package/dist/pulse.d.ts +157 -0
- package/dist/pulse.d.ts.map +1 -0
- package/dist/qr.d.ts +83 -0
- package/dist/qr.d.ts.map +1 -0
- package/dist/replay.d.ts +53 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/scene-types.d.ts +191 -0
- package/dist/scene-types.d.ts.map +1 -0
- package/dist/scene.d.ts +214 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/search-types.d.ts +211 -0
- package/dist/search-types.d.ts.map +1 -0
- package/dist/search.d.ts +251 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/sentiment-types.d.ts +108 -0
- package/dist/sentiment-types.d.ts.map +1 -0
- package/dist/sentiment.d.ts +247 -0
- package/dist/sentiment.d.ts.map +1 -0
- package/dist/signage.d.ts +102 -0
- package/dist/signage.d.ts.map +1 -0
- package/dist/slides.d.ts +69 -0
- package/dist/slides.d.ts.map +1 -0
- package/dist/studio-ai-types.d.ts +199 -0
- package/dist/studio-ai-types.d.ts.map +1 -0
- package/dist/studio-ai.d.ts +219 -0
- package/dist/studio-ai.d.ts.map +1 -0
- package/dist/studio-types.d.ts +268 -0
- package/dist/studio-types.d.ts.map +1 -0
- package/dist/studio.d.ts +235 -0
- package/dist/studio.d.ts.map +1 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/transcribe-types.d.ts +154 -0
- package/dist/transcribe-types.d.ts.map +1 -0
- package/dist/transcribe.d.ts +219 -0
- package/dist/transcribe.d.ts.map +1 -0
- package/dist/usb.d.ts +65 -0
- package/dist/usb.d.ts.map +1 -0
- package/dist/vault.d.ts +122 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/voice-types.d.ts +107 -0
- package/dist/voice-types.d.ts.map +1 -0
- package/dist/voice.d.ts +178 -0
- package/dist/voice.d.ts.map +1 -0
- package/dist/zoom.d.ts +92 -0
- package/dist/zoom.d.ts.map +1 -0
- package/package.json +86 -86
package/CHANGELOG.md
CHANGED
|
@@ -1,58 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 2.0.3 (2026-04-02)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
- Fixed bugs URL pointing to private repository
|
|
6
|
+
- Fixed repository directory field
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## 2.0.2 (2026-04-02)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- Fixed zod peer dependency from exact `3.25.76` to `^3.22.0`
|
|
11
|
+
- Fixed repository URL pointing to public `wave-av/sdk`
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- **CloudSwitcherAPI** — Cloud video switcher control (instances, inputs, outputs, transitions, program/preview bus)
|
|
15
|
-
- **ReplayAPI** — Replay engine management (sessions, points of interest, clip export to social)
|
|
16
|
-
- **CameraControlAPI** — Multi-manufacturer camera control (PTZ, focus, iris, presets, discovery)
|
|
17
|
-
- **GraphicsAPI** — Lower-thirds, overlays, and animated graphics layer management
|
|
18
|
-
- **SportsDataAPI** — Live sports data integration (scoreboards, clocks, stats, player cards)
|
|
19
|
-
- **AutomationAPI** — Rule-based production automation (triggers, actions, schedules, rundowns)
|
|
20
|
-
- **StorefrontAPI** — Creator commerce (products, purchases, entitlement checks, storefronts)
|
|
21
|
-
|
|
22
|
-
### Changed
|
|
23
|
-
|
|
24
|
-
- Client HTTP methods replaced `client.request()` with dedicated `client.get()`, `client.post()`, and `client.delete()` for clearer intent and improved TypeScript inference. Migration:
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
// Before (v1.x)
|
|
28
|
-
const stream = await client.request<Stream>('/v1/streams/abc', {
|
|
29
|
-
method: 'GET',
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// After (v2.0)
|
|
33
|
-
const stream = await client.get<Stream>('/v1/streams/abc');
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
- `Wave` convenience class expanded from 12 to 34 API module properties
|
|
37
|
-
- `PipelineAPI`, `StudioAPI`, `FleetAPI`, `GhostAPI`, `MeshAPI`, `EdgeAPI`, `PulseAPI`, and `ClipsAPI` promoted from beta to stable
|
|
38
|
-
|
|
39
|
-
## [1.0.0] - 2025-10-15
|
|
40
|
-
|
|
41
|
-
### Added
|
|
13
|
+
## 2.0.1 (2026-04-01)
|
|
42
14
|
|
|
43
15
|
- Initial public release
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
- **FleetAPI** — Desktop Node fleet management (register, health, commands, metrics)
|
|
47
|
-
- **GhostAPI** — AI automatic directing (autonomous/assisted modes, suggestions, overrides)
|
|
48
|
-
- **MeshAPI** — Multi-region failover (regions, peers, policies, replication, topology)
|
|
49
|
-
- **EdgeAPI** — CDN and edge workers (deploy, routing, cache purge, latency map)
|
|
50
|
-
- **PulseAPI** — Analytics and BI (stream, viewer, quality, engagement, revenue metrics; dashboards; reports)
|
|
51
|
-
- **ClipsAPI** — Clip creation from live or VOD sources (export, highlights, AI detection)
|
|
52
|
-
- Base `WaveClient` with API key authentication, configurable retry logic (default 3 attempts), rate limit handling, and optional OpenTelemetry integration
|
|
53
|
-
- `Wave` convenience class bundling all 12 API modules under a single import
|
|
54
|
-
- TypeScript strict mode throughout; ESM and CJS dual output via `tsup`
|
|
55
|
-
|
|
56
|
-
[Unreleased]: https://github.com/wave-av/wave-surfer-connect/compare/sdk-v2.0.0...HEAD
|
|
57
|
-
[2.0.0]: https://github.com/wave-av/wave-surfer-connect/compare/sdk-v1.0.0...sdk-v2.0.0
|
|
58
|
-
[1.0.0]: https://github.com/wave-av/wave-surfer-connect/releases/tag/sdk-v1.0.0
|
|
16
|
+
- 34 API modules with full TypeScript types
|
|
17
|
+
- 41 subpath exports for tree-shaking
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Audience API
|
|
3
|
+
*
|
|
4
|
+
* Interactive audience engagement: polls, Q&A, reactions, and engagement metrics.
|
|
5
|
+
*/
|
|
6
|
+
import type { WaveClient } from "./client";
|
|
7
|
+
export type PollStatus = "draft" | "active" | "closed";
|
|
8
|
+
export interface Poll {
|
|
9
|
+
id: string;
|
|
10
|
+
stream_id: string;
|
|
11
|
+
question: string;
|
|
12
|
+
options: PollOption[];
|
|
13
|
+
status: PollStatus;
|
|
14
|
+
total_votes: number;
|
|
15
|
+
allow_multiple: boolean;
|
|
16
|
+
show_results: boolean;
|
|
17
|
+
duration_seconds?: number;
|
|
18
|
+
created_at: string;
|
|
19
|
+
updated_at: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PollOption {
|
|
22
|
+
id: string;
|
|
23
|
+
text: string;
|
|
24
|
+
vote_count: number;
|
|
25
|
+
percentage: number;
|
|
26
|
+
}
|
|
27
|
+
export interface QASession {
|
|
28
|
+
id: string;
|
|
29
|
+
stream_id: string;
|
|
30
|
+
status: "active" | "paused" | "closed";
|
|
31
|
+
questions: Question[];
|
|
32
|
+
allow_anonymous: boolean;
|
|
33
|
+
moderated: boolean;
|
|
34
|
+
created_at: string;
|
|
35
|
+
}
|
|
36
|
+
export interface Question {
|
|
37
|
+
id: string;
|
|
38
|
+
session_id: string;
|
|
39
|
+
text: string;
|
|
40
|
+
author: string;
|
|
41
|
+
upvotes: number;
|
|
42
|
+
answered: boolean;
|
|
43
|
+
answer?: string;
|
|
44
|
+
pinned: boolean;
|
|
45
|
+
created_at: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ReactionBurst {
|
|
48
|
+
stream_id: string;
|
|
49
|
+
type: "like" | "love" | "fire" | "clap" | "laugh" | "wow";
|
|
50
|
+
count: number;
|
|
51
|
+
timestamp: string;
|
|
52
|
+
}
|
|
53
|
+
export interface EngagementMetrics {
|
|
54
|
+
stream_id: string;
|
|
55
|
+
active_participants: number;
|
|
56
|
+
chat_rate_per_minute: number;
|
|
57
|
+
reaction_rate: number;
|
|
58
|
+
poll_participation_rate: number;
|
|
59
|
+
qa_questions: number;
|
|
60
|
+
peak_engagement_at: string;
|
|
61
|
+
}
|
|
62
|
+
export interface CreatePollRequest {
|
|
63
|
+
stream_id: string;
|
|
64
|
+
question: string;
|
|
65
|
+
options: string[];
|
|
66
|
+
allow_multiple?: boolean;
|
|
67
|
+
show_results?: boolean;
|
|
68
|
+
duration_seconds?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface CreateQARequest {
|
|
71
|
+
stream_id: string;
|
|
72
|
+
allow_anonymous?: boolean;
|
|
73
|
+
moderated?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Interactive audience engagement: live polls, Q&A sessions, and reactions.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const poll = await wave.audience.createPoll({ stream_id: id, question: "Best feature?", options: ["A", "B", "C"] });
|
|
81
|
+
* const metrics = await wave.audience.getEngagementMetrics(streamId);
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare class AudienceAPI {
|
|
85
|
+
private readonly client;
|
|
86
|
+
private readonly basePath;
|
|
87
|
+
constructor(client: WaveClient);
|
|
88
|
+
createPoll(request: CreatePollRequest): Promise<Poll>;
|
|
89
|
+
getPoll(pollId: string): Promise<Poll>;
|
|
90
|
+
closePoll(pollId: string): Promise<Poll>;
|
|
91
|
+
getPollResults(pollId: string): Promise<Poll>;
|
|
92
|
+
vote(pollId: string, optionIds: string[]): Promise<void>;
|
|
93
|
+
createQA(request: CreateQARequest): Promise<QASession>;
|
|
94
|
+
getQA(sessionId: string): Promise<QASession>;
|
|
95
|
+
closeQA(sessionId: string): Promise<QASession>;
|
|
96
|
+
submitQuestion(sessionId: string, text: string): Promise<Question>;
|
|
97
|
+
answerQuestion(sessionId: string, questionId: string, answer: string): Promise<Question>;
|
|
98
|
+
upvoteQuestion(sessionId: string, questionId: string): Promise<Question>;
|
|
99
|
+
pinQuestion(sessionId: string, questionId: string): Promise<Question>;
|
|
100
|
+
sendReaction(streamId: string, type: ReactionBurst["type"]): Promise<void>;
|
|
101
|
+
getReactionMetrics(streamId: string): Promise<ReactionBurst[]>;
|
|
102
|
+
getEngagementMetrics(streamId: string): Promise<EngagementMetrics>;
|
|
103
|
+
}
|
|
104
|
+
export declare function createAudienceAPI(client: WaveClient): AudienceAPI;
|
|
105
|
+
//# sourceMappingURL=audience.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UA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,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAGxD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC;IAGtD,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAG5C,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAG9C,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAGlE,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAMxF,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKxE,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKrE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAG1E,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAG9D,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAGzE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,CAEjE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Billing Types
|
|
3
|
+
*
|
|
4
|
+
* Types for usage tracking, meter reporting, and subscription management.
|
|
5
|
+
*/
|
|
6
|
+
export type MeterType = 'stream_minutes' | 'storage_gb' | 'ai_tokens' | 'transcription_minutes' | 'voice_minutes' | 'compute_minutes';
|
|
7
|
+
export type SubscriptionTier = 'starter' | 'launch' | 'scale' | 'volume';
|
|
8
|
+
export interface UsageEvent {
|
|
9
|
+
meterType: MeterType;
|
|
10
|
+
value: number;
|
|
11
|
+
idempotencyKey?: string;
|
|
12
|
+
timestamp?: Date;
|
|
13
|
+
dimensions?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export interface UsageSummary {
|
|
16
|
+
meterType: MeterType;
|
|
17
|
+
currentUsage: number;
|
|
18
|
+
limit: number;
|
|
19
|
+
percentUsed: number;
|
|
20
|
+
estimatedOverageCost: number;
|
|
21
|
+
periodStart: string;
|
|
22
|
+
periodEnd: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SubscriptionStatus {
|
|
25
|
+
tier: SubscriptionTier;
|
|
26
|
+
status: 'active' | 'trialing' | 'past_due' | 'canceled';
|
|
27
|
+
currentPeriodEnd: string;
|
|
28
|
+
trialEnd: string | null;
|
|
29
|
+
cancelAtPeriodEnd: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface UsageThresholdCallback {
|
|
32
|
+
meterType: MeterType;
|
|
33
|
+
threshold: number;
|
|
34
|
+
callback: (usage: UsageSummary) => void;
|
|
35
|
+
}
|
|
36
|
+
export interface BillingAPIConfig {
|
|
37
|
+
pollIntervalMs?: number;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=billing-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-types.d.ts","sourceRoot":"","sources":["../src/billing-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,YAAY,GACZ,WAAW,GACX,uBAAuB,GACvB,eAAe,GACf,iBAAiB,CAAC;AAEtB,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IACxD,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/billing-types.ts
|
|
17
|
+
var billing_types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(billing_types_exports);
|
|
File without changes
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Billing API
|
|
3
|
+
*
|
|
4
|
+
* Usage tracking, meter reporting, and subscription management.
|
|
5
|
+
* Reports usage events to WAVE billing meters and monitors quota thresholds.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createClient } from '@wave-av/sdk';
|
|
10
|
+
*
|
|
11
|
+
* const wave = createClient({ apiKey: 'wave_...' });
|
|
12
|
+
* const billing = new BillingAPI(wave);
|
|
13
|
+
*
|
|
14
|
+
* // Report usage
|
|
15
|
+
* await billing.reportUsage({ meterType: 'stream_minutes', value: 15 });
|
|
16
|
+
*
|
|
17
|
+
* // Get usage summary
|
|
18
|
+
* const usage = await billing.getUsageSummary('stream_minutes');
|
|
19
|
+
*
|
|
20
|
+
* // Monitor thresholds
|
|
21
|
+
* billing.onUsageThreshold('stream_minutes', 80, (usage) => {
|
|
22
|
+
* console.log(`${usage.percentUsed}% of stream minutes used`);
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
import type { WaveClient } from './client';
|
|
27
|
+
import type { MeterType, UsageEvent, UsageSummary, SubscriptionStatus, UsageThresholdCallback, BillingAPIConfig } from './billing-types';
|
|
28
|
+
export type { MeterType, UsageEvent, UsageSummary, SubscriptionStatus, UsageThresholdCallback, BillingAPIConfig, };
|
|
29
|
+
export declare class BillingAPI {
|
|
30
|
+
private client;
|
|
31
|
+
private thresholds;
|
|
32
|
+
private pollInterval;
|
|
33
|
+
private config;
|
|
34
|
+
constructor(client: WaveClient, config?: BillingAPIConfig);
|
|
35
|
+
/**
|
|
36
|
+
* Report a usage event to a billing meter.
|
|
37
|
+
* Events are aggregated by Stripe Billing Meters.
|
|
38
|
+
*/
|
|
39
|
+
reportUsage(event: UsageEvent): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Report multiple usage events in a single request.
|
|
42
|
+
*/
|
|
43
|
+
reportUsageBatch(events: UsageEvent[]): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Get current usage summary for a meter in the current billing period.
|
|
46
|
+
*/
|
|
47
|
+
getUsageSummary(meterType: MeterType): Promise<UsageSummary>;
|
|
48
|
+
/**
|
|
49
|
+
* Get usage summaries for all 6 billing meters.
|
|
50
|
+
*/
|
|
51
|
+
getAllUsageSummaries(): Promise<UsageSummary[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Get current subscription status.
|
|
54
|
+
*/
|
|
55
|
+
getSubscriptionStatus(): Promise<SubscriptionStatus>;
|
|
56
|
+
/**
|
|
57
|
+
* Register a callback when usage crosses a threshold percentage.
|
|
58
|
+
* Starts polling usage data if not already polling.
|
|
59
|
+
*/
|
|
60
|
+
onUsageThreshold(meterType: MeterType, thresholdPercent: number, callback: (usage: UsageSummary) => void): () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Stop all polling and clean up.
|
|
63
|
+
*/
|
|
64
|
+
destroy(): void;
|
|
65
|
+
private startPolling;
|
|
66
|
+
private stopPolling;
|
|
67
|
+
}
|
|
68
|
+
export declare function createBillingAPI(client: WaveClient, config?: BillingAPIConfig): BillingAPI;
|
|
69
|
+
//# sourceMappingURL=billing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../src/billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/billing.ts
|
|
21
|
+
var billing_exports = {};
|
|
22
|
+
__export(billing_exports, {
|
|
23
|
+
BillingAPI: () => BillingAPI,
|
|
24
|
+
createBillingAPI: () => createBillingAPI
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(billing_exports);
|
|
27
|
+
var BillingAPI = class {
|
|
28
|
+
client;
|
|
29
|
+
thresholds = [];
|
|
30
|
+
pollInterval = null;
|
|
31
|
+
config;
|
|
32
|
+
constructor(client, config) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
this.config = {
|
|
35
|
+
pollIntervalMs: config?.pollIntervalMs ?? 6e4
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Report a usage event to a billing meter.
|
|
40
|
+
* Events are aggregated by Stripe Billing Meters.
|
|
41
|
+
*/
|
|
42
|
+
async reportUsage(event) {
|
|
43
|
+
await this.client.request("POST", "/billing/usage/track", {
|
|
44
|
+
meter_type: event.meterType,
|
|
45
|
+
value: event.value,
|
|
46
|
+
idempotency_key: event.idempotencyKey,
|
|
47
|
+
timestamp: event.timestamp?.toISOString(),
|
|
48
|
+
dimensions: event.dimensions
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Report multiple usage events in a single request.
|
|
53
|
+
*/
|
|
54
|
+
async reportUsageBatch(events) {
|
|
55
|
+
await this.client.request("POST", "/billing/usage/track/batch", {
|
|
56
|
+
events: events.map((e) => ({
|
|
57
|
+
meter_type: e.meterType,
|
|
58
|
+
value: e.value,
|
|
59
|
+
idempotency_key: e.idempotencyKey,
|
|
60
|
+
timestamp: e.timestamp?.toISOString(),
|
|
61
|
+
dimensions: e.dimensions
|
|
62
|
+
}))
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get current usage summary for a meter in the current billing period.
|
|
67
|
+
*/
|
|
68
|
+
async getUsageSummary(meterType) {
|
|
69
|
+
return this.client.request("GET", `/billing/usage/meters?meter=${meterType}`);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get usage summaries for all 6 billing meters.
|
|
73
|
+
*/
|
|
74
|
+
async getAllUsageSummaries() {
|
|
75
|
+
return this.client.request("GET", "/billing/usage/meters");
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get current subscription status.
|
|
79
|
+
*/
|
|
80
|
+
async getSubscriptionStatus() {
|
|
81
|
+
return this.client.request("GET", "/billing/status");
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Register a callback when usage crosses a threshold percentage.
|
|
85
|
+
* Starts polling usage data if not already polling.
|
|
86
|
+
*/
|
|
87
|
+
onUsageThreshold(meterType, thresholdPercent, callback) {
|
|
88
|
+
const entry = {
|
|
89
|
+
meterType,
|
|
90
|
+
threshold: thresholdPercent,
|
|
91
|
+
callback
|
|
92
|
+
};
|
|
93
|
+
this.thresholds.push(entry);
|
|
94
|
+
if (!this.pollInterval) {
|
|
95
|
+
this.startPolling();
|
|
96
|
+
}
|
|
97
|
+
return () => {
|
|
98
|
+
const idx = this.thresholds.indexOf(entry);
|
|
99
|
+
if (idx >= 0) this.thresholds.splice(idx, 1);
|
|
100
|
+
if (this.thresholds.length === 0) this.stopPolling();
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Stop all polling and clean up.
|
|
105
|
+
*/
|
|
106
|
+
destroy() {
|
|
107
|
+
this.stopPolling();
|
|
108
|
+
this.thresholds = [];
|
|
109
|
+
}
|
|
110
|
+
startPolling() {
|
|
111
|
+
this.pollInterval = setInterval(async () => {
|
|
112
|
+
try {
|
|
113
|
+
const summaries = await this.getAllUsageSummaries();
|
|
114
|
+
for (const summary of summaries) {
|
|
115
|
+
for (const threshold of this.thresholds) {
|
|
116
|
+
if (threshold.meterType === summary.meterType && summary.percentUsed >= threshold.threshold) {
|
|
117
|
+
threshold.callback(summary);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
} catch {
|
|
122
|
+
}
|
|
123
|
+
}, this.config.pollIntervalMs);
|
|
124
|
+
}
|
|
125
|
+
stopPolling() {
|
|
126
|
+
if (this.pollInterval) {
|
|
127
|
+
clearInterval(this.pollInterval);
|
|
128
|
+
this.pollInterval = null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
function createBillingAPI(client, config) {
|
|
133
|
+
return new BillingAPI(client, config);
|
|
134
|
+
}
|
|
135
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
136
|
+
0 && (module.exports = {
|
|
137
|
+
BillingAPI,
|
|
138
|
+
createBillingAPI
|
|
139
|
+
});
|
package/dist/billing.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE Camera Control SDK
|
|
3
|
+
*
|
|
4
|
+
* Discover and control cameras from any manufacturer.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import type { WaveClient } from './client';
|
|
9
|
+
export interface ManagedCamera {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly manufacturer: 'blackmagic' | 'sony' | 'canon' | 'ptzoptics' | 'other';
|
|
13
|
+
readonly model: string | null;
|
|
14
|
+
readonly ipAddress: string;
|
|
15
|
+
readonly status: 'online' | 'offline' | 'error';
|
|
16
|
+
readonly controlProtocol: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CameraPreset {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly slot: number;
|
|
22
|
+
}
|
|
23
|
+
export interface CameraControlParams {
|
|
24
|
+
readonly iris?: number;
|
|
25
|
+
readonly focus?: number;
|
|
26
|
+
readonly zoom?: number;
|
|
27
|
+
readonly whiteBalance?: {
|
|
28
|
+
temperature: number;
|
|
29
|
+
tint: number;
|
|
30
|
+
};
|
|
31
|
+
readonly gain?: number;
|
|
32
|
+
readonly shutter?: number;
|
|
33
|
+
readonly panTilt?: {
|
|
34
|
+
pan: number;
|
|
35
|
+
tilt: number;
|
|
36
|
+
speed: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export declare class CameraControlAPI {
|
|
40
|
+
private readonly client;
|
|
41
|
+
private readonly basePath;
|
|
42
|
+
constructor(client: WaveClient);
|
|
43
|
+
discover(): Promise<ManagedCamera[]>;
|
|
44
|
+
list(): Promise<ManagedCamera[]>;
|
|
45
|
+
get(cameraId: string): Promise<ManagedCamera>;
|
|
46
|
+
control(cameraId: string, params: CameraControlParams): Promise<void>;
|
|
47
|
+
autofocus(cameraId: string): Promise<void>;
|
|
48
|
+
savePreset(cameraId: string, name: string, slot: number): Promise<CameraPreset>;
|
|
49
|
+
recallPreset(cameraId: string, presetId: string): Promise<void>;
|
|
50
|
+
listPresets(cameraId: string): Promise<CameraPreset[]>;
|
|
51
|
+
startRecording(cameraId: string): Promise<void>;
|
|
52
|
+
stopRecording(cameraId: string): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
export declare function createCameraControlAPI(client: WaveClient): CameraControlAPI;
|
|
55
|
+
//# sourceMappingURL=camera-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-control.d.ts","sourceRoot":"","sources":["../src/camera-control.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,QAAQ,CAAC,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
export type CaptionStatus = 'pending' | 'processing' | 'ready' | 'failed';
|
|
2
|
+
export type CaptionFormat = 'srt' | 'vtt' | 'sbv' | 'ass' | 'ttml' | 'dfxp' | 'json';
|
|
3
|
+
export interface CaptionTrack extends Timestamps {
|
|
4
|
+
id: string;
|
|
5
|
+
organization_id: string;
|
|
6
|
+
media_id: string;
|
|
7
|
+
media_type: 'video' | 'audio' | 'stream';
|
|
8
|
+
language: string;
|
|
9
|
+
label: string;
|
|
10
|
+
status: CaptionStatus;
|
|
11
|
+
is_default: boolean;
|
|
12
|
+
is_auto_generated: boolean;
|
|
13
|
+
word_count?: number;
|
|
14
|
+
duration?: number;
|
|
15
|
+
accuracy_score?: number;
|
|
16
|
+
url?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
metadata?: Metadata;
|
|
19
|
+
}
|
|
20
|
+
export interface CaptionCue {
|
|
21
|
+
id: string;
|
|
22
|
+
start_time: number;
|
|
23
|
+
end_time: number;
|
|
24
|
+
text: string;
|
|
25
|
+
speaker?: string;
|
|
26
|
+
confidence?: number;
|
|
27
|
+
words?: CaptionWord[];
|
|
28
|
+
style?: CaptionStyle;
|
|
29
|
+
}
|
|
30
|
+
export interface CaptionWord {
|
|
31
|
+
word: string;
|
|
32
|
+
start_time: number;
|
|
33
|
+
end_time: number;
|
|
34
|
+
confidence?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface CaptionStyle {
|
|
37
|
+
align?: 'left' | 'center' | 'right';
|
|
38
|
+
vertical?: 'top' | 'middle' | 'bottom';
|
|
39
|
+
line?: number;
|
|
40
|
+
position?: number;
|
|
41
|
+
size?: number;
|
|
42
|
+
color?: string;
|
|
43
|
+
background_color?: string;
|
|
44
|
+
font_family?: string;
|
|
45
|
+
font_weight?: 'normal' | 'bold';
|
|
46
|
+
font_style?: 'normal' | 'italic';
|
|
47
|
+
}
|
|
48
|
+
export interface GenerateCaptionsRequest {
|
|
49
|
+
media_id: string;
|
|
50
|
+
media_type: 'video' | 'audio' | 'stream';
|
|
51
|
+
language?: string;
|
|
52
|
+
label?: string;
|
|
53
|
+
/** Model to use for transcription */
|
|
54
|
+
model?: 'standard' | 'enhanced' | 'whisper';
|
|
55
|
+
/** Enable speaker diarization */
|
|
56
|
+
speaker_diarization?: boolean;
|
|
57
|
+
/** Number of expected speakers */
|
|
58
|
+
speaker_count?: number;
|
|
59
|
+
/** Filter profanity */
|
|
60
|
+
profanity_filter?: boolean;
|
|
61
|
+
/** Custom vocabulary */
|
|
62
|
+
vocabulary?: string[];
|
|
63
|
+
/** Enable word-level timing */
|
|
64
|
+
word_timestamps?: boolean;
|
|
65
|
+
/** Webhook URL for completion */
|
|
66
|
+
webhook_url?: string;
|
|
67
|
+
metadata?: Metadata;
|
|
68
|
+
}
|
|
69
|
+
export interface UploadCaptionsRequest {
|
|
70
|
+
media_id: string;
|
|
71
|
+
media_type: 'video' | 'audio' | 'stream';
|
|
72
|
+
language: string;
|
|
73
|
+
label: string;
|
|
74
|
+
format: CaptionFormat;
|
|
75
|
+
/** Caption file content */
|
|
76
|
+
content: string;
|
|
77
|
+
is_default?: boolean;
|
|
78
|
+
metadata?: Metadata;
|
|
79
|
+
}
|
|
80
|
+
export interface UpdateCaptionsRequest {
|
|
81
|
+
label?: string;
|
|
82
|
+
is_default?: boolean;
|
|
83
|
+
metadata?: Metadata;
|
|
84
|
+
}
|
|
85
|
+
export interface TranslateCaptionsRequest {
|
|
86
|
+
target_language: string;
|
|
87
|
+
target_label?: string;
|
|
88
|
+
/** Use professional translation */
|
|
89
|
+
professional?: boolean;
|
|
90
|
+
/** Preserve speaker labels */
|
|
91
|
+
preserve_speakers?: boolean;
|
|
92
|
+
webhook_url?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface BurnInCaptionsRequest {
|
|
95
|
+
caption_track_id: string;
|
|
96
|
+
style?: CaptionStyle;
|
|
97
|
+
/** Output format */
|
|
98
|
+
format?: 'mp4' | 'webm' | 'mov';
|
|
99
|
+
/** Output quality */
|
|
100
|
+
quality?: 'low' | 'medium' | 'high' | 'source';
|
|
101
|
+
webhook_url?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface BurnInJob extends Timestamps {
|
|
104
|
+
id: string;
|
|
105
|
+
media_id: string;
|
|
106
|
+
caption_track_id: string;
|
|
107
|
+
status: 'pending' | 'processing' | 'ready' | 'failed';
|
|
108
|
+
progress: number;
|
|
109
|
+
output_url?: string;
|
|
110
|
+
error?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface ListCaptionsParams extends PaginationParams {
|
|
113
|
+
media_id?: string;
|
|
114
|
+
media_type?: 'video' | 'audio' | 'stream';
|
|
115
|
+
language?: string;
|
|
116
|
+
status?: CaptionStatus;
|
|
117
|
+
is_auto_generated?: boolean;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=captions-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captions-types.d.ts","sourceRoot":"","sources":["../src/captions-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,YAAY,GACZ,OAAO,GACP,QAAQ,CAAC;AACb,MAAM,MAAM,aAAa,GACrB,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,CAAC;AACX,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM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