@stream-io/video-client 0.0.1-alpha.7

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 (157) hide show
  1. package/LICENSE +219 -0
  2. package/README.md +14 -0
  3. package/dist/index.d.ts +23 -0
  4. package/dist/index.js +14663 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/src/Batcher.d.ts +12 -0
  7. package/dist/src/CallDropScheduler.d.ts +44 -0
  8. package/dist/src/StreamSfuClient.d.ts +25 -0
  9. package/dist/src/StreamVideoClient.d.ts +145 -0
  10. package/dist/src/__tests__/StreamVideoClient.test.d.ts +1 -0
  11. package/dist/src/config/defaultConfigs.d.ts +2 -0
  12. package/dist/src/config/types.d.ts +29 -0
  13. package/dist/src/coordinator/StreamCoordinatorClient.d.ts +19 -0
  14. package/dist/src/coordinator/connection/base64.d.ts +2 -0
  15. package/dist/src/coordinator/connection/client.d.ts +174 -0
  16. package/dist/src/coordinator/connection/connection.d.ts +139 -0
  17. package/dist/src/coordinator/connection/connection_fallback.d.ts +38 -0
  18. package/dist/src/coordinator/connection/errors.d.ts +16 -0
  19. package/dist/src/coordinator/connection/events.d.ts +7 -0
  20. package/dist/src/coordinator/connection/insights.d.ts +58 -0
  21. package/dist/src/coordinator/connection/signing.d.ts +30 -0
  22. package/dist/src/coordinator/connection/token_manager.d.ts +39 -0
  23. package/dist/src/coordinator/connection/types.d.ts +96 -0
  24. package/dist/src/coordinator/connection/utils.d.ts +25 -0
  25. package/dist/src/devices.d.ts +79 -0
  26. package/dist/src/events/call.d.ts +26 -0
  27. package/dist/src/events/internal.d.ts +8 -0
  28. package/dist/src/events/participant.d.ts +21 -0
  29. package/dist/src/events/speaker.d.ts +10 -0
  30. package/dist/src/gen/coordinator/index.d.ts +1664 -0
  31. package/dist/src/gen/google/protobuf/descriptor.d.ts +1650 -0
  32. package/dist/src/gen/google/protobuf/duration.d.ts +113 -0
  33. package/dist/src/gen/google/protobuf/struct.d.ts +184 -0
  34. package/dist/src/gen/google/protobuf/timestamp.d.ts +158 -0
  35. package/dist/src/gen/video/coordinator/broadcast_v1/broadcast.d.ts +66 -0
  36. package/dist/src/gen/video/coordinator/call_v1/call.d.ts +254 -0
  37. package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.d.ts +351 -0
  38. package/dist/src/gen/video/coordinator/client_v1_rpc/client_rpc.d.ts +1488 -0
  39. package/dist/src/gen/video/coordinator/client_v1_rpc/envelopes.d.ts +143 -0
  40. package/dist/src/gen/video/coordinator/client_v1_rpc/websocket.d.ts +292 -0
  41. package/dist/src/gen/video/coordinator/edge_v1/edge.d.ts +183 -0
  42. package/dist/src/gen/video/coordinator/event_v1/event.d.ts +411 -0
  43. package/dist/src/gen/video/coordinator/geofence_v1/geofence.d.ts +63 -0
  44. package/dist/src/gen/video/coordinator/member_v1/member.d.ts +59 -0
  45. package/dist/src/gen/video/coordinator/participant_v1/participant.d.ts +103 -0
  46. package/dist/src/gen/video/coordinator/push_v1/push.d.ts +240 -0
  47. package/dist/src/gen/video/coordinator/stat_v1/stat.d.ts +308 -0
  48. package/dist/src/gen/video/coordinator/user_v1/user.d.ts +112 -0
  49. package/dist/src/gen/video/coordinator/utils_v1/utils.d.ts +47 -0
  50. package/dist/src/gen/video/sfu/event/events.d.ts +736 -0
  51. package/dist/src/gen/video/sfu/models/models.d.ts +460 -0
  52. package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +89 -0
  53. package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +320 -0
  54. package/dist/src/helpers/browsers.d.ts +8 -0
  55. package/dist/src/helpers/sound-detector.d.ts +34 -0
  56. package/dist/src/rpc/createClient.d.ts +10 -0
  57. package/dist/src/rpc/index.d.ts +2 -0
  58. package/dist/src/rpc/latency.d.ts +9 -0
  59. package/dist/src/rtc/Call.d.ts +180 -0
  60. package/dist/src/rtc/CallMetadata.d.ts +9 -0
  61. package/dist/src/rtc/Dispatcher.d.ts +9 -0
  62. package/dist/src/rtc/IceTrickleBuffer.d.ts +11 -0
  63. package/dist/src/rtc/callEventHandlers.d.ts +5 -0
  64. package/dist/src/rtc/codecs.d.ts +2 -0
  65. package/dist/src/rtc/helpers/iceCandidate.d.ts +2 -0
  66. package/dist/src/rtc/helpers/tracks.d.ts +3 -0
  67. package/dist/src/rtc/publisher.d.ts +53 -0
  68. package/dist/src/rtc/signal.d.ts +5 -0
  69. package/dist/src/rtc/subscriber.d.ts +7 -0
  70. package/dist/src/rtc/types.d.ts +84 -0
  71. package/dist/src/rtc/videoLayers.d.ts +17 -0
  72. package/dist/src/stats/coordinator-stats-reporter.d.ts +10 -0
  73. package/dist/src/stats/state-store-stats-reporter.d.ts +57 -0
  74. package/dist/src/stats/types.d.ts +42 -0
  75. package/dist/src/store/index.d.ts +2 -0
  76. package/dist/src/store/rxUtils.d.ts +18 -0
  77. package/dist/src/store/stateStore.d.ts +182 -0
  78. package/generate-openapi.sh +32 -0
  79. package/index.ts +30 -0
  80. package/openapitools.json +7 -0
  81. package/package.json +54 -0
  82. package/rollup.config.mjs +48 -0
  83. package/src/Batcher.ts +43 -0
  84. package/src/CallDropScheduler.ts +192 -0
  85. package/src/StreamSfuClient.ts +185 -0
  86. package/src/StreamVideoClient.ts +487 -0
  87. package/src/__tests__/StreamVideoClient.test.ts +83 -0
  88. package/src/config/defaultConfigs.ts +15 -0
  89. package/src/config/types.ts +30 -0
  90. package/src/coordinator/StreamCoordinatorClient.ts +111 -0
  91. package/src/coordinator/connection/base64.ts +80 -0
  92. package/src/coordinator/connection/client.ts +815 -0
  93. package/src/coordinator/connection/connection.ts +750 -0
  94. package/src/coordinator/connection/connection_fallback.ts +239 -0
  95. package/src/coordinator/connection/errors.ts +70 -0
  96. package/src/coordinator/connection/events.ts +10 -0
  97. package/src/coordinator/connection/insights.ts +88 -0
  98. package/src/coordinator/connection/signing.ts +104 -0
  99. package/src/coordinator/connection/token_manager.ts +160 -0
  100. package/src/coordinator/connection/types.ts +120 -0
  101. package/src/coordinator/connection/utils.ts +148 -0
  102. package/src/devices.ts +266 -0
  103. package/src/events/call.ts +166 -0
  104. package/src/events/internal.ts +47 -0
  105. package/src/events/participant.ts +97 -0
  106. package/src/events/speaker.ts +62 -0
  107. package/src/gen/coordinator/index.ts +1653 -0
  108. package/src/gen/google/protobuf/descriptor.ts +3466 -0
  109. package/src/gen/google/protobuf/duration.ts +232 -0
  110. package/src/gen/google/protobuf/struct.ts +481 -0
  111. package/src/gen/google/protobuf/timestamp.ts +291 -0
  112. package/src/gen/video/coordinator/broadcast_v1/broadcast.ts +154 -0
  113. package/src/gen/video/coordinator/call_v1/call.ts +651 -0
  114. package/src/gen/video/coordinator/client_v1_rpc/client_rpc.client.ts +463 -0
  115. package/src/gen/video/coordinator/client_v1_rpc/client_rpc.ts +3819 -0
  116. package/src/gen/video/coordinator/client_v1_rpc/envelopes.ts +424 -0
  117. package/src/gen/video/coordinator/client_v1_rpc/websocket.ts +719 -0
  118. package/src/gen/video/coordinator/edge_v1/edge.ts +532 -0
  119. package/src/gen/video/coordinator/event_v1/event.ts +1171 -0
  120. package/src/gen/video/coordinator/geofence_v1/geofence.ts +128 -0
  121. package/src/gen/video/coordinator/member_v1/member.ts +138 -0
  122. package/src/gen/video/coordinator/participant_v1/participant.ts +261 -0
  123. package/src/gen/video/coordinator/push_v1/push.ts +651 -0
  124. package/src/gen/video/coordinator/stat_v1/stat.ts +656 -0
  125. package/src/gen/video/coordinator/user_v1/user.ts +277 -0
  126. package/src/gen/video/coordinator/utils_v1/utils.ts +98 -0
  127. package/src/gen/video/sfu/event/events.ts +1962 -0
  128. package/src/gen/video/sfu/models/models.ts +1062 -0
  129. package/src/gen/video/sfu/signal_rpc/signal.client.ts +108 -0
  130. package/src/gen/video/sfu/signal_rpc/signal.ts +906 -0
  131. package/src/helpers/browsers.ts +13 -0
  132. package/src/helpers/sound-detector.ts +85 -0
  133. package/src/rpc/createClient.ts +50 -0
  134. package/src/rpc/index.ts +2 -0
  135. package/src/rpc/latency.ts +43 -0
  136. package/src/rtc/Call.ts +585 -0
  137. package/src/rtc/CallMetadata.ts +24 -0
  138. package/src/rtc/Dispatcher.ts +46 -0
  139. package/src/rtc/IceTrickleBuffer.ts +21 -0
  140. package/src/rtc/callEventHandlers.ts +37 -0
  141. package/src/rtc/codecs.ts +61 -0
  142. package/src/rtc/helpers/iceCandidate.ts +16 -0
  143. package/src/rtc/helpers/tracks.ts +18 -0
  144. package/src/rtc/publisher.ts +305 -0
  145. package/src/rtc/signal.ts +34 -0
  146. package/src/rtc/subscriber.ts +85 -0
  147. package/src/rtc/types.ts +105 -0
  148. package/src/rtc/videoLayers.ts +103 -0
  149. package/src/stats/coordinator-stats-reporter.ts +167 -0
  150. package/src/stats/state-store-stats-reporter.ts +364 -0
  151. package/src/stats/types.ts +46 -0
  152. package/src/store/index.ts +2 -0
  153. package/src/store/rxUtils.ts +42 -0
  154. package/src/store/stateStore.ts +341 -0
  155. package/tsconfig.json +25 -0
  156. package/typedoc.json +11 -0
  157. package/vite.config.ts +11 -0
@@ -0,0 +1,113 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import type { JsonValue } from "@protobuf-ts/runtime";
7
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
8
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
9
+ import { MessageType } from "@protobuf-ts/runtime";
10
+ /**
11
+ * A Duration represents a signed, fixed-length span of time represented
12
+ * as a count of seconds and fractions of seconds at nanosecond
13
+ * resolution. It is independent of any calendar and concepts like "day"
14
+ * or "month". It is related to Timestamp in that the difference between
15
+ * two Timestamp values is a Duration and it can be added or subtracted
16
+ * from a Timestamp. Range is approximately +-10,000 years.
17
+ *
18
+ * # Examples
19
+ *
20
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
21
+ *
22
+ * Timestamp start = ...;
23
+ * Timestamp end = ...;
24
+ * Duration duration = ...;
25
+ *
26
+ * duration.seconds = end.seconds - start.seconds;
27
+ * duration.nanos = end.nanos - start.nanos;
28
+ *
29
+ * if (duration.seconds < 0 && duration.nanos > 0) {
30
+ * duration.seconds += 1;
31
+ * duration.nanos -= 1000000000;
32
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
33
+ * duration.seconds -= 1;
34
+ * duration.nanos += 1000000000;
35
+ * }
36
+ *
37
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
38
+ *
39
+ * Timestamp start = ...;
40
+ * Duration duration = ...;
41
+ * Timestamp end = ...;
42
+ *
43
+ * end.seconds = start.seconds + duration.seconds;
44
+ * end.nanos = start.nanos + duration.nanos;
45
+ *
46
+ * if (end.nanos < 0) {
47
+ * end.seconds -= 1;
48
+ * end.nanos += 1000000000;
49
+ * } else if (end.nanos >= 1000000000) {
50
+ * end.seconds += 1;
51
+ * end.nanos -= 1000000000;
52
+ * }
53
+ *
54
+ * Example 3: Compute Duration from datetime.timedelta in Python.
55
+ *
56
+ * td = datetime.timedelta(days=3, minutes=10)
57
+ * duration = Duration()
58
+ * duration.FromTimedelta(td)
59
+ *
60
+ * # JSON Mapping
61
+ *
62
+ * In JSON format, the Duration type is encoded as a string rather than an
63
+ * object, where the string ends in the suffix "s" (indicating seconds) and
64
+ * is preceded by the number of seconds, with nanoseconds expressed as
65
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
66
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
67
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
68
+ * microsecond should be expressed in JSON format as "3.000001s".
69
+ *
70
+ *
71
+ *
72
+ * @generated from protobuf message google.protobuf.Duration
73
+ */
74
+ export interface Duration {
75
+ /**
76
+ * Signed seconds of the span of time. Must be from -315,576,000,000
77
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
78
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
79
+ *
80
+ * @generated from protobuf field: int64 seconds = 1;
81
+ */
82
+ seconds: string;
83
+ /**
84
+ * Signed fractions of a second at nanosecond resolution of the span
85
+ * of time. Durations less than one second are represented with a 0
86
+ * `seconds` field and a positive or negative `nanos` field. For durations
87
+ * of one second or more, a non-zero value for the `nanos` field must be
88
+ * of the same sign as the `seconds` field. Must be from -999,999,999
89
+ * to +999,999,999 inclusive.
90
+ *
91
+ * @generated from protobuf field: int32 nanos = 2;
92
+ */
93
+ nanos: number;
94
+ }
95
+ declare class Duration$Type extends MessageType<Duration> {
96
+ constructor();
97
+ /**
98
+ * Encode `Duration` to JSON string like "3.000001s".
99
+ */
100
+ internalJsonWrite(message: Duration, options: JsonWriteOptions): JsonValue;
101
+ /**
102
+ * Decode `Duration` from JSON string like "3.000001s"
103
+ */
104
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Duration): Duration;
105
+ create(value?: PartialMessage<Duration>): Duration;
106
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration;
107
+ internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
108
+ }
109
+ /**
110
+ * @generated MessageType for protobuf message google.protobuf.Duration
111
+ */
112
+ export declare const Duration: Duration$Type;
113
+ export {};
@@ -0,0 +1,184 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import type { JsonValue } from "@protobuf-ts/runtime";
7
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
8
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
9
+ import { MessageType } from "@protobuf-ts/runtime";
10
+ /**
11
+ * `Struct` represents a structured data value, consisting of fields
12
+ * which map to dynamically typed values. In some languages, `Struct`
13
+ * might be supported by a native representation. For example, in
14
+ * scripting languages like JS a struct is represented as an
15
+ * object. The details of that representation are described together
16
+ * with the proto support for the language.
17
+ *
18
+ * The JSON representation for `Struct` is JSON object.
19
+ *
20
+ * @generated from protobuf message google.protobuf.Struct
21
+ */
22
+ export interface Struct {
23
+ /**
24
+ * Unordered map of dynamically typed values.
25
+ *
26
+ * @generated from protobuf field: map<string, google.protobuf.Value> fields = 1;
27
+ */
28
+ fields: {
29
+ [key: string]: Value;
30
+ };
31
+ }
32
+ /**
33
+ * `Value` represents a dynamically typed value which can be either
34
+ * null, a number, a string, a boolean, a recursive struct value, or a
35
+ * list of values. A producer of value is expected to set one of these
36
+ * variants. Absence of any variant indicates an error.
37
+ *
38
+ * The JSON representation for `Value` is JSON value.
39
+ *
40
+ * @generated from protobuf message google.protobuf.Value
41
+ */
42
+ export interface Value {
43
+ /**
44
+ * @generated from protobuf oneof: kind
45
+ */
46
+ kind: {
47
+ oneofKind: "nullValue";
48
+ /**
49
+ * Represents a null value.
50
+ *
51
+ * @generated from protobuf field: google.protobuf.NullValue null_value = 1;
52
+ */
53
+ nullValue: NullValue;
54
+ } | {
55
+ oneofKind: "numberValue";
56
+ /**
57
+ * Represents a double value.
58
+ *
59
+ * @generated from protobuf field: double number_value = 2;
60
+ */
61
+ numberValue: number;
62
+ } | {
63
+ oneofKind: "stringValue";
64
+ /**
65
+ * Represents a string value.
66
+ *
67
+ * @generated from protobuf field: string string_value = 3;
68
+ */
69
+ stringValue: string;
70
+ } | {
71
+ oneofKind: "boolValue";
72
+ /**
73
+ * Represents a boolean value.
74
+ *
75
+ * @generated from protobuf field: bool bool_value = 4;
76
+ */
77
+ boolValue: boolean;
78
+ } | {
79
+ oneofKind: "structValue";
80
+ /**
81
+ * Represents a structured value.
82
+ *
83
+ * @generated from protobuf field: google.protobuf.Struct struct_value = 5;
84
+ */
85
+ structValue: Struct;
86
+ } | {
87
+ oneofKind: "listValue";
88
+ /**
89
+ * Represents a repeated `Value`.
90
+ *
91
+ * @generated from protobuf field: google.protobuf.ListValue list_value = 6;
92
+ */
93
+ listValue: ListValue;
94
+ } | {
95
+ oneofKind: undefined;
96
+ };
97
+ }
98
+ /**
99
+ * `ListValue` is a wrapper around a repeated field of values.
100
+ *
101
+ * The JSON representation for `ListValue` is JSON array.
102
+ *
103
+ * @generated from protobuf message google.protobuf.ListValue
104
+ */
105
+ export interface ListValue {
106
+ /**
107
+ * Repeated field of dynamically typed values.
108
+ *
109
+ * @generated from protobuf field: repeated google.protobuf.Value values = 1;
110
+ */
111
+ values: Value[];
112
+ }
113
+ /**
114
+ * `NullValue` is a singleton enumeration to represent the null value for the
115
+ * `Value` type union.
116
+ *
117
+ * The JSON representation for `NullValue` is JSON `null`.
118
+ *
119
+ * @generated from protobuf enum google.protobuf.NullValue
120
+ */
121
+ export declare enum NullValue {
122
+ /**
123
+ * Null value.
124
+ *
125
+ * @generated from protobuf enum value: NULL_VALUE = 0;
126
+ */
127
+ NULL_VALUE = 0
128
+ }
129
+ declare class Struct$Type extends MessageType<Struct> {
130
+ constructor();
131
+ /**
132
+ * Encode `Struct` to JSON object.
133
+ */
134
+ internalJsonWrite(message: Struct, options: JsonWriteOptions): JsonValue;
135
+ /**
136
+ * Decode `Struct` from JSON object.
137
+ */
138
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Struct): Struct;
139
+ create(value?: PartialMessage<Struct>): Struct;
140
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Struct): Struct;
141
+ private binaryReadMap1;
142
+ internalBinaryWrite(message: Struct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
143
+ }
144
+ /**
145
+ * @generated MessageType for protobuf message google.protobuf.Struct
146
+ */
147
+ export declare const Struct: Struct$Type;
148
+ declare class Value$Type extends MessageType<Value> {
149
+ constructor();
150
+ /**
151
+ * Encode `Value` to JSON value.
152
+ */
153
+ internalJsonWrite(message: Value, options: JsonWriteOptions): JsonValue;
154
+ /**
155
+ * Decode `Value` from JSON value.
156
+ */
157
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Value): Value;
158
+ create(value?: PartialMessage<Value>): Value;
159
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value;
160
+ internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
161
+ }
162
+ /**
163
+ * @generated MessageType for protobuf message google.protobuf.Value
164
+ */
165
+ export declare const Value: Value$Type;
166
+ declare class ListValue$Type extends MessageType<ListValue> {
167
+ constructor();
168
+ /**
169
+ * Encode `ListValue` to JSON array.
170
+ */
171
+ internalJsonWrite(message: ListValue, options: JsonWriteOptions): JsonValue;
172
+ /**
173
+ * Decode `ListValue` from JSON array.
174
+ */
175
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: ListValue): ListValue;
176
+ create(value?: PartialMessage<ListValue>): ListValue;
177
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListValue): ListValue;
178
+ internalBinaryWrite(message: ListValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
179
+ }
180
+ /**
181
+ * @generated MessageType for protobuf message google.protobuf.ListValue
182
+ */
183
+ export declare const ListValue: ListValue$Type;
184
+ export {};
@@ -0,0 +1,158 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import type { JsonValue } from "@protobuf-ts/runtime";
7
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
8
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
9
+ import { MessageType } from "@protobuf-ts/runtime";
10
+ /**
11
+ * A Timestamp represents a point in time independent of any time zone or local
12
+ * calendar, encoded as a count of seconds and fractions of seconds at
13
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
14
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
15
+ * Gregorian calendar backwards to year one.
16
+ *
17
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
18
+ * second table is needed for interpretation, using a [24-hour linear
19
+ * smear](https://developers.google.com/time/smear).
20
+ *
21
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
22
+ * restricting to that range, we ensure that we can convert to and from [RFC
23
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
24
+ *
25
+ * # Examples
26
+ *
27
+ * Example 1: Compute Timestamp from POSIX `time()`.
28
+ *
29
+ * Timestamp timestamp;
30
+ * timestamp.set_seconds(time(NULL));
31
+ * timestamp.set_nanos(0);
32
+ *
33
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
34
+ *
35
+ * struct timeval tv;
36
+ * gettimeofday(&tv, NULL);
37
+ *
38
+ * Timestamp timestamp;
39
+ * timestamp.set_seconds(tv.tv_sec);
40
+ * timestamp.set_nanos(tv.tv_usec * 1000);
41
+ *
42
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
43
+ *
44
+ * FILETIME ft;
45
+ * GetSystemTimeAsFileTime(&ft);
46
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
47
+ *
48
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
49
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
50
+ * Timestamp timestamp;
51
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
52
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
53
+ *
54
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
55
+ *
56
+ * long millis = System.currentTimeMillis();
57
+ *
58
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
59
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
60
+ *
61
+ *
62
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
63
+ *
64
+ * Instant now = Instant.now();
65
+ *
66
+ * Timestamp timestamp =
67
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
68
+ * .setNanos(now.getNano()).build();
69
+ *
70
+ *
71
+ * Example 6: Compute Timestamp from current time in Python.
72
+ *
73
+ * timestamp = Timestamp()
74
+ * timestamp.GetCurrentTime()
75
+ *
76
+ * # JSON Mapping
77
+ *
78
+ * In JSON format, the Timestamp type is encoded as a string in the
79
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
80
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
81
+ * where {year} is always expressed using four digits while {month}, {day},
82
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
83
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
84
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
85
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
86
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
87
+ * able to accept both UTC and other timezones (as indicated by an offset).
88
+ *
89
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
90
+ * 01:30 UTC on January 15, 2017.
91
+ *
92
+ * In JavaScript, one can convert a Date object to this format using the
93
+ * standard
94
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
95
+ * method. In Python, a standard `datetime.datetime` object can be converted
96
+ * to this format using
97
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
98
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
99
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
100
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
101
+ * ) to obtain a formatter capable of generating timestamps in this format.
102
+ *
103
+ *
104
+ *
105
+ * @generated from protobuf message google.protobuf.Timestamp
106
+ */
107
+ export interface Timestamp {
108
+ /**
109
+ * Represents seconds of UTC time since Unix epoch
110
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
111
+ * 9999-12-31T23:59:59Z inclusive.
112
+ *
113
+ * @generated from protobuf field: int64 seconds = 1;
114
+ */
115
+ seconds: string;
116
+ /**
117
+ * Non-negative fractions of a second at nanosecond resolution. Negative
118
+ * second values with fractions must still have non-negative nanos values
119
+ * that count forward in time. Must be from 0 to 999,999,999
120
+ * inclusive.
121
+ *
122
+ * @generated from protobuf field: int32 nanos = 2;
123
+ */
124
+ nanos: number;
125
+ }
126
+ declare class Timestamp$Type extends MessageType<Timestamp> {
127
+ constructor();
128
+ /**
129
+ * Creates a new `Timestamp` for the current time.
130
+ */
131
+ now(): Timestamp;
132
+ /**
133
+ * Converts a `Timestamp` to a JavaScript Date.
134
+ */
135
+ toDate(message: Timestamp): Date;
136
+ /**
137
+ * Converts a JavaScript Date to a `Timestamp`.
138
+ */
139
+ fromDate(date: Date): Timestamp;
140
+ /**
141
+ * In JSON format, the `Timestamp` type is encoded as a string
142
+ * in the RFC 3339 format.
143
+ */
144
+ internalJsonWrite(message: Timestamp, options: JsonWriteOptions): JsonValue;
145
+ /**
146
+ * In JSON format, the `Timestamp` type is encoded as a string
147
+ * in the RFC 3339 format.
148
+ */
149
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Timestamp): Timestamp;
150
+ create(value?: PartialMessage<Timestamp>): Timestamp;
151
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Timestamp): Timestamp;
152
+ internalBinaryWrite(message: Timestamp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
153
+ }
154
+ /**
155
+ * @generated MessageType for protobuf message google.protobuf.Timestamp
156
+ */
157
+ export declare const Timestamp: Timestamp$Type;
158
+ export {};
@@ -0,0 +1,66 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ /**
8
+ * @generated from protobuf message stream.video.coordinator.broadcast_v1.RTMPOptions
9
+ */
10
+ export interface RTMPOptions {
11
+ /**
12
+ * @generated from protobuf field: repeated string urls = 1;
13
+ */
14
+ urls: string[];
15
+ }
16
+ /**
17
+ * @generated from protobuf message stream.video.coordinator.broadcast_v1.Broadcast
18
+ */
19
+ export interface Broadcast {
20
+ /**
21
+ * @generated from protobuf field: stream.video.coordinator.broadcast_v1.RTMPOptions rtmp = 1;
22
+ */
23
+ rtmp?: RTMPOptions;
24
+ /**
25
+ * @generated from protobuf field: string hls_url = 2;
26
+ */
27
+ hlsUrl: string;
28
+ }
29
+ /**
30
+ * @generated from protobuf enum stream.video.coordinator.broadcast_v1.Codec
31
+ */
32
+ export declare enum Codec {
33
+ /**
34
+ * @generated from protobuf enum value: CODEC_H264_UNSPECIFIED = 0;
35
+ */
36
+ H264_UNSPECIFIED = 0,
37
+ /**
38
+ * @generated from protobuf enum value: CODEC_VP8 = 1;
39
+ */
40
+ VP8 = 1,
41
+ /**
42
+ * @generated from protobuf enum value: CODEC_VP9 = 2;
43
+ */
44
+ VP9 = 2
45
+ }
46
+ declare class RTMPOptions$Type extends MessageType<RTMPOptions> {
47
+ constructor();
48
+ create(value?: PartialMessage<RTMPOptions>): RTMPOptions;
49
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RTMPOptions): RTMPOptions;
50
+ internalBinaryWrite(message: RTMPOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
51
+ }
52
+ /**
53
+ * @generated MessageType for protobuf message stream.video.coordinator.broadcast_v1.RTMPOptions
54
+ */
55
+ export declare const RTMPOptions: RTMPOptions$Type;
56
+ declare class Broadcast$Type extends MessageType<Broadcast> {
57
+ constructor();
58
+ create(value?: PartialMessage<Broadcast>): Broadcast;
59
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Broadcast): Broadcast;
60
+ internalBinaryWrite(message: Broadcast, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
61
+ }
62
+ /**
63
+ * @generated MessageType for protobuf message stream.video.coordinator.broadcast_v1.Broadcast
64
+ */
65
+ export declare const Broadcast: Broadcast$Type;
66
+ export {};