@fatehan/tsrp 1.0.2

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.
@@ -0,0 +1,51 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "fatehan";
3
+ export declare enum AreaType {
4
+ Circle = 0,
5
+ Polygon = 1,
6
+ Rectangle = 2,
7
+ Point = 3,
8
+ Marker = 4,
9
+ UNRECOGNIZED = -1
10
+ }
11
+ export declare function areaTypeFromJSON(object: any): AreaType;
12
+ export declare function areaTypeToJSON(object: AreaType): string;
13
+ export interface Area {
14
+ id: number;
15
+ type: AreaType;
16
+ name?: string | undefined;
17
+ organizationId: number;
18
+ radius?: number | undefined;
19
+ color?: string | undefined;
20
+ createdBy?: number | undefined;
21
+ updatedBy?: number | undefined;
22
+ categoryId?: number | undefined;
23
+ createdAt: Date | undefined;
24
+ updatedAt: Date | undefined;
25
+ coordinates: Area_Point[];
26
+ }
27
+ export interface Area_Point {
28
+ latitude: number;
29
+ longitude: number;
30
+ }
31
+ export declare const Area: MessageFns<Area>;
32
+ export declare const Area_Point: MessageFns<Area_Point>;
33
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
34
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
35
+ [K in keyof T]?: DeepPartial<T[K]>;
36
+ } : Partial<T>;
37
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
38
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
39
+ [K in keyof P]: Exact<P[K], I[K]>;
40
+ } & {
41
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
42
+ };
43
+ export interface MessageFns<T> {
44
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
45
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
46
+ fromJSON(object: any): T;
47
+ toJSON(message: T): unknown;
48
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
49
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
50
+ }
51
+ export {};
@@ -0,0 +1,401 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.0
5
+ // protoc v3.21.12
6
+ // source: areas/area.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Area_Point = exports.Area = exports.AreaType = exports.protobufPackage = void 0;
9
+ exports.areaTypeFromJSON = areaTypeFromJSON;
10
+ exports.areaTypeToJSON = areaTypeToJSON;
11
+ /* eslint-disable */
12
+ const wire_1 = require("@bufbuild/protobuf/wire");
13
+ const timestamp_1 = require("../google/protobuf/timestamp");
14
+ exports.protobufPackage = "fatehan";
15
+ var AreaType;
16
+ (function (AreaType) {
17
+ AreaType[AreaType["Circle"] = 0] = "Circle";
18
+ AreaType[AreaType["Polygon"] = 1] = "Polygon";
19
+ AreaType[AreaType["Rectangle"] = 2] = "Rectangle";
20
+ AreaType[AreaType["Point"] = 3] = "Point";
21
+ AreaType[AreaType["Marker"] = 4] = "Marker";
22
+ AreaType[AreaType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
23
+ })(AreaType || (exports.AreaType = AreaType = {}));
24
+ function areaTypeFromJSON(object) {
25
+ switch (object) {
26
+ case 0:
27
+ case "Circle":
28
+ return AreaType.Circle;
29
+ case 1:
30
+ case "Polygon":
31
+ return AreaType.Polygon;
32
+ case 2:
33
+ case "Rectangle":
34
+ return AreaType.Rectangle;
35
+ case 3:
36
+ case "Point":
37
+ return AreaType.Point;
38
+ case 4:
39
+ case "Marker":
40
+ return AreaType.Marker;
41
+ case -1:
42
+ case "UNRECOGNIZED":
43
+ default:
44
+ return AreaType.UNRECOGNIZED;
45
+ }
46
+ }
47
+ function areaTypeToJSON(object) {
48
+ switch (object) {
49
+ case AreaType.Circle:
50
+ return "Circle";
51
+ case AreaType.Polygon:
52
+ return "Polygon";
53
+ case AreaType.Rectangle:
54
+ return "Rectangle";
55
+ case AreaType.Point:
56
+ return "Point";
57
+ case AreaType.Marker:
58
+ return "Marker";
59
+ case AreaType.UNRECOGNIZED:
60
+ default:
61
+ return "UNRECOGNIZED";
62
+ }
63
+ }
64
+ function createBaseArea() {
65
+ return {
66
+ id: 0,
67
+ type: 0,
68
+ name: undefined,
69
+ organizationId: 0,
70
+ radius: undefined,
71
+ color: undefined,
72
+ createdBy: undefined,
73
+ updatedBy: undefined,
74
+ categoryId: undefined,
75
+ createdAt: undefined,
76
+ updatedAt: undefined,
77
+ coordinates: [],
78
+ };
79
+ }
80
+ exports.Area = {
81
+ encode(message, writer = new wire_1.BinaryWriter()) {
82
+ if (message.id !== 0) {
83
+ writer.uint32(8).uint64(message.id);
84
+ }
85
+ if (message.type !== 0) {
86
+ writer.uint32(16).int32(message.type);
87
+ }
88
+ if (message.name !== undefined) {
89
+ writer.uint32(26).string(message.name);
90
+ }
91
+ if (message.organizationId !== 0) {
92
+ writer.uint32(32).uint64(message.organizationId);
93
+ }
94
+ if (message.radius !== undefined) {
95
+ writer.uint32(45).float(message.radius);
96
+ }
97
+ if (message.color !== undefined) {
98
+ writer.uint32(50).string(message.color);
99
+ }
100
+ if (message.createdBy !== undefined) {
101
+ writer.uint32(56).uint64(message.createdBy);
102
+ }
103
+ if (message.updatedBy !== undefined) {
104
+ writer.uint32(64).uint64(message.updatedBy);
105
+ }
106
+ if (message.categoryId !== undefined) {
107
+ writer.uint32(72).uint64(message.categoryId);
108
+ }
109
+ if (message.createdAt !== undefined) {
110
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
111
+ }
112
+ if (message.updatedAt !== undefined) {
113
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
114
+ }
115
+ for (const v of message.coordinates) {
116
+ exports.Area_Point.encode(v, writer.uint32(98).fork()).join();
117
+ }
118
+ return writer;
119
+ },
120
+ decode(input, length) {
121
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
122
+ let end = length === undefined ? reader.len : reader.pos + length;
123
+ const message = createBaseArea();
124
+ while (reader.pos < end) {
125
+ const tag = reader.uint32();
126
+ switch (tag >>> 3) {
127
+ case 1: {
128
+ if (tag !== 8) {
129
+ break;
130
+ }
131
+ message.id = longToNumber(reader.uint64());
132
+ continue;
133
+ }
134
+ case 2: {
135
+ if (tag !== 16) {
136
+ break;
137
+ }
138
+ message.type = reader.int32();
139
+ continue;
140
+ }
141
+ case 3: {
142
+ if (tag !== 26) {
143
+ break;
144
+ }
145
+ message.name = reader.string();
146
+ continue;
147
+ }
148
+ case 4: {
149
+ if (tag !== 32) {
150
+ break;
151
+ }
152
+ message.organizationId = longToNumber(reader.uint64());
153
+ continue;
154
+ }
155
+ case 5: {
156
+ if (tag !== 45) {
157
+ break;
158
+ }
159
+ message.radius = reader.float();
160
+ continue;
161
+ }
162
+ case 6: {
163
+ if (tag !== 50) {
164
+ break;
165
+ }
166
+ message.color = reader.string();
167
+ continue;
168
+ }
169
+ case 7: {
170
+ if (tag !== 56) {
171
+ break;
172
+ }
173
+ message.createdBy = longToNumber(reader.uint64());
174
+ continue;
175
+ }
176
+ case 8: {
177
+ if (tag !== 64) {
178
+ break;
179
+ }
180
+ message.updatedBy = longToNumber(reader.uint64());
181
+ continue;
182
+ }
183
+ case 9: {
184
+ if (tag !== 72) {
185
+ break;
186
+ }
187
+ message.categoryId = longToNumber(reader.uint64());
188
+ continue;
189
+ }
190
+ case 10: {
191
+ if (tag !== 82) {
192
+ break;
193
+ }
194
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
195
+ continue;
196
+ }
197
+ case 11: {
198
+ if (tag !== 90) {
199
+ break;
200
+ }
201
+ message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
202
+ continue;
203
+ }
204
+ case 12: {
205
+ if (tag !== 98) {
206
+ break;
207
+ }
208
+ message.coordinates.push(exports.Area_Point.decode(reader, reader.uint32()));
209
+ continue;
210
+ }
211
+ }
212
+ if ((tag & 7) === 4 || tag === 0) {
213
+ break;
214
+ }
215
+ reader.skip(tag & 7);
216
+ }
217
+ return message;
218
+ },
219
+ fromJSON(object) {
220
+ return {
221
+ id: isSet(object.id) ? globalThis.Number(object.id) : 0,
222
+ type: isSet(object.type) ? areaTypeFromJSON(object.type) : 0,
223
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
224
+ organizationId: isSet(object.organization_id) ? globalThis.Number(object.organization_id) : 0,
225
+ radius: isSet(object.radius) ? globalThis.Number(object.radius) : undefined,
226
+ color: isSet(object.color) ? globalThis.String(object.color) : undefined,
227
+ createdBy: isSet(object.created_by) ? globalThis.Number(object.created_by) : undefined,
228
+ updatedBy: isSet(object.updated_by) ? globalThis.Number(object.updated_by) : undefined,
229
+ categoryId: isSet(object.category_id) ? globalThis.Number(object.category_id) : undefined,
230
+ createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
231
+ updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
232
+ coordinates: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.coordinates)
233
+ ? object.coordinates.map((e) => exports.Area_Point.fromJSON(e))
234
+ : [],
235
+ };
236
+ },
237
+ toJSON(message) {
238
+ var _a;
239
+ const obj = {};
240
+ if (message.id !== 0) {
241
+ obj.id = Math.round(message.id);
242
+ }
243
+ if (message.type !== 0) {
244
+ obj.type = areaTypeToJSON(message.type);
245
+ }
246
+ if (message.name !== undefined) {
247
+ obj.name = message.name;
248
+ }
249
+ if (message.organizationId !== 0) {
250
+ obj.organization_id = Math.round(message.organizationId);
251
+ }
252
+ if (message.radius !== undefined) {
253
+ obj.radius = message.radius;
254
+ }
255
+ if (message.color !== undefined) {
256
+ obj.color = message.color;
257
+ }
258
+ if (message.createdBy !== undefined) {
259
+ obj.created_by = Math.round(message.createdBy);
260
+ }
261
+ if (message.updatedBy !== undefined) {
262
+ obj.updated_by = Math.round(message.updatedBy);
263
+ }
264
+ if (message.categoryId !== undefined) {
265
+ obj.category_id = Math.round(message.categoryId);
266
+ }
267
+ if (message.createdAt !== undefined) {
268
+ obj.created_at = message.createdAt.toISOString();
269
+ }
270
+ if (message.updatedAt !== undefined) {
271
+ obj.updated_at = message.updatedAt.toISOString();
272
+ }
273
+ if ((_a = message.coordinates) === null || _a === void 0 ? void 0 : _a.length) {
274
+ obj.coordinates = message.coordinates.map((e) => exports.Area_Point.toJSON(e));
275
+ }
276
+ return obj;
277
+ },
278
+ create(base) {
279
+ return exports.Area.fromPartial(base !== null && base !== void 0 ? base : {});
280
+ },
281
+ fromPartial(object) {
282
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
283
+ const message = createBaseArea();
284
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
285
+ message.type = (_b = object.type) !== null && _b !== void 0 ? _b : 0;
286
+ message.name = (_c = object.name) !== null && _c !== void 0 ? _c : undefined;
287
+ message.organizationId = (_d = object.organizationId) !== null && _d !== void 0 ? _d : 0;
288
+ message.radius = (_e = object.radius) !== null && _e !== void 0 ? _e : undefined;
289
+ message.color = (_f = object.color) !== null && _f !== void 0 ? _f : undefined;
290
+ message.createdBy = (_g = object.createdBy) !== null && _g !== void 0 ? _g : undefined;
291
+ message.updatedBy = (_h = object.updatedBy) !== null && _h !== void 0 ? _h : undefined;
292
+ message.categoryId = (_j = object.categoryId) !== null && _j !== void 0 ? _j : undefined;
293
+ message.createdAt = (_k = object.createdAt) !== null && _k !== void 0 ? _k : undefined;
294
+ message.updatedAt = (_l = object.updatedAt) !== null && _l !== void 0 ? _l : undefined;
295
+ message.coordinates = ((_m = object.coordinates) === null || _m === void 0 ? void 0 : _m.map((e) => exports.Area_Point.fromPartial(e))) || [];
296
+ return message;
297
+ },
298
+ };
299
+ function createBaseArea_Point() {
300
+ return { latitude: 0, longitude: 0 };
301
+ }
302
+ exports.Area_Point = {
303
+ encode(message, writer = new wire_1.BinaryWriter()) {
304
+ if (message.latitude !== 0) {
305
+ writer.uint32(13).float(message.latitude);
306
+ }
307
+ if (message.longitude !== 0) {
308
+ writer.uint32(21).float(message.longitude);
309
+ }
310
+ return writer;
311
+ },
312
+ decode(input, length) {
313
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
314
+ let end = length === undefined ? reader.len : reader.pos + length;
315
+ const message = createBaseArea_Point();
316
+ while (reader.pos < end) {
317
+ const tag = reader.uint32();
318
+ switch (tag >>> 3) {
319
+ case 1: {
320
+ if (tag !== 13) {
321
+ break;
322
+ }
323
+ message.latitude = reader.float();
324
+ continue;
325
+ }
326
+ case 2: {
327
+ if (tag !== 21) {
328
+ break;
329
+ }
330
+ message.longitude = reader.float();
331
+ continue;
332
+ }
333
+ }
334
+ if ((tag & 7) === 4 || tag === 0) {
335
+ break;
336
+ }
337
+ reader.skip(tag & 7);
338
+ }
339
+ return message;
340
+ },
341
+ fromJSON(object) {
342
+ return {
343
+ latitude: isSet(object.latitude) ? globalThis.Number(object.latitude) : 0,
344
+ longitude: isSet(object.longitude) ? globalThis.Number(object.longitude) : 0,
345
+ };
346
+ },
347
+ toJSON(message) {
348
+ const obj = {};
349
+ if (message.latitude !== 0) {
350
+ obj.latitude = message.latitude;
351
+ }
352
+ if (message.longitude !== 0) {
353
+ obj.longitude = message.longitude;
354
+ }
355
+ return obj;
356
+ },
357
+ create(base) {
358
+ return exports.Area_Point.fromPartial(base !== null && base !== void 0 ? base : {});
359
+ },
360
+ fromPartial(object) {
361
+ var _a, _b;
362
+ const message = createBaseArea_Point();
363
+ message.latitude = (_a = object.latitude) !== null && _a !== void 0 ? _a : 0;
364
+ message.longitude = (_b = object.longitude) !== null && _b !== void 0 ? _b : 0;
365
+ return message;
366
+ },
367
+ };
368
+ function toTimestamp(date) {
369
+ const seconds = Math.trunc(date.getTime() / 1000);
370
+ const nanos = (date.getTime() % 1000) * 1000000;
371
+ return { seconds, nanos };
372
+ }
373
+ function fromTimestamp(t) {
374
+ let millis = (t.seconds || 0) * 1000;
375
+ millis += (t.nanos || 0) / 1000000;
376
+ return new globalThis.Date(millis);
377
+ }
378
+ function fromJsonTimestamp(o) {
379
+ if (o instanceof globalThis.Date) {
380
+ return o;
381
+ }
382
+ else if (typeof o === "string") {
383
+ return new globalThis.Date(o);
384
+ }
385
+ else {
386
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
387
+ }
388
+ }
389
+ function longToNumber(int64) {
390
+ const num = globalThis.Number(int64.toString());
391
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
392
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
393
+ }
394
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
395
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
396
+ }
397
+ return num;
398
+ }
399
+ function isSet(value) {
400
+ return value !== null && value !== undefined;
401
+ }
@@ -0,0 +1,128 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * A Timestamp represents a point in time independent of any time zone or local
5
+ * calendar, encoded as a count of seconds and fractions of seconds at
6
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
7
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
8
+ * Gregorian calendar backwards to year one.
9
+ *
10
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
11
+ * second table is needed for interpretation, using a [24-hour linear
12
+ * smear](https://developers.google.com/time/smear).
13
+ *
14
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
15
+ * restricting to that range, we ensure that we can convert to and from [RFC
16
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
17
+ *
18
+ * # Examples
19
+ *
20
+ * Example 1: Compute Timestamp from POSIX `time()`.
21
+ *
22
+ * Timestamp timestamp;
23
+ * timestamp.set_seconds(time(NULL));
24
+ * timestamp.set_nanos(0);
25
+ *
26
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
27
+ *
28
+ * struct timeval tv;
29
+ * gettimeofday(&tv, NULL);
30
+ *
31
+ * Timestamp timestamp;
32
+ * timestamp.set_seconds(tv.tv_sec);
33
+ * timestamp.set_nanos(tv.tv_usec * 1000);
34
+ *
35
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
36
+ *
37
+ * FILETIME ft;
38
+ * GetSystemTimeAsFileTime(&ft);
39
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
40
+ *
41
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
42
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
43
+ * Timestamp timestamp;
44
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
45
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
46
+ *
47
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
48
+ *
49
+ * long millis = System.currentTimeMillis();
50
+ *
51
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
52
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
53
+ *
54
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
55
+ *
56
+ * Instant now = Instant.now();
57
+ *
58
+ * Timestamp timestamp =
59
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
60
+ * .setNanos(now.getNano()).build();
61
+ *
62
+ * Example 6: Compute Timestamp from current time in Python.
63
+ *
64
+ * timestamp = Timestamp()
65
+ * timestamp.GetCurrentTime()
66
+ *
67
+ * # JSON Mapping
68
+ *
69
+ * In JSON format, the Timestamp type is encoded as a string in the
70
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
71
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
72
+ * where {year} is always expressed using four digits while {month}, {day},
73
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
74
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
75
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
76
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
77
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
78
+ * able to accept both UTC and other timezones (as indicated by an offset).
79
+ *
80
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
81
+ * 01:30 UTC on January 15, 2017.
82
+ *
83
+ * In JavaScript, one can convert a Date object to this format using the
84
+ * standard
85
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
86
+ * method. In Python, a standard `datetime.datetime` object can be converted
87
+ * to this format using
88
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
89
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
90
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
91
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
92
+ * ) to obtain a formatter capable of generating timestamps in this format.
93
+ */
94
+ export interface Timestamp {
95
+ /**
96
+ * Represents seconds of UTC time since Unix epoch
97
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
98
+ * 9999-12-31T23:59:59Z inclusive.
99
+ */
100
+ seconds: number;
101
+ /**
102
+ * Non-negative fractions of a second at nanosecond resolution. Negative
103
+ * second values with fractions must still have non-negative nanos values
104
+ * that count forward in time. Must be from 0 to 999,999,999
105
+ * inclusive.
106
+ */
107
+ nanos: number;
108
+ }
109
+ export declare const Timestamp: MessageFns<Timestamp>;
110
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
111
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
112
+ [K in keyof T]?: DeepPartial<T[K]>;
113
+ } : Partial<T>;
114
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
115
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
116
+ [K in keyof P]: Exact<P[K], I[K]>;
117
+ } & {
118
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
119
+ };
120
+ export interface MessageFns<T> {
121
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
122
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
123
+ fromJSON(object: any): T;
124
+ toJSON(message: T): unknown;
125
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
126
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
127
+ }
128
+ export {};
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.0
5
+ // protoc v3.21.12
6
+ // source: google/protobuf/timestamp.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Timestamp = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ exports.protobufPackage = "google.protobuf";
12
+ function createBaseTimestamp() {
13
+ return { seconds: 0, nanos: 0 };
14
+ }
15
+ exports.Timestamp = {
16
+ encode(message, writer = new wire_1.BinaryWriter()) {
17
+ if (message.seconds !== 0) {
18
+ writer.uint32(8).int64(message.seconds);
19
+ }
20
+ if (message.nanos !== 0) {
21
+ writer.uint32(16).int32(message.nanos);
22
+ }
23
+ return writer;
24
+ },
25
+ decode(input, length) {
26
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
27
+ let end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = createBaseTimestamp();
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32();
31
+ switch (tag >>> 3) {
32
+ case 1: {
33
+ if (tag !== 8) {
34
+ break;
35
+ }
36
+ message.seconds = longToNumber(reader.int64());
37
+ continue;
38
+ }
39
+ case 2: {
40
+ if (tag !== 16) {
41
+ break;
42
+ }
43
+ message.nanos = reader.int32();
44
+ continue;
45
+ }
46
+ }
47
+ if ((tag & 7) === 4 || tag === 0) {
48
+ break;
49
+ }
50
+ reader.skip(tag & 7);
51
+ }
52
+ return message;
53
+ },
54
+ fromJSON(object) {
55
+ return {
56
+ seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
57
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
58
+ };
59
+ },
60
+ toJSON(message) {
61
+ const obj = {};
62
+ if (message.seconds !== 0) {
63
+ obj.seconds = Math.round(message.seconds);
64
+ }
65
+ if (message.nanos !== 0) {
66
+ obj.nanos = Math.round(message.nanos);
67
+ }
68
+ return obj;
69
+ },
70
+ create(base) {
71
+ return exports.Timestamp.fromPartial(base !== null && base !== void 0 ? base : {});
72
+ },
73
+ fromPartial(object) {
74
+ var _a, _b;
75
+ const message = createBaseTimestamp();
76
+ message.seconds = (_a = object.seconds) !== null && _a !== void 0 ? _a : 0;
77
+ message.nanos = (_b = object.nanos) !== null && _b !== void 0 ? _b : 0;
78
+ return message;
79
+ },
80
+ };
81
+ function longToNumber(int64) {
82
+ const num = globalThis.Number(int64.toString());
83
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
84
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
85
+ }
86
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
87
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
88
+ }
89
+ return num;
90
+ }
91
+ function isSet(value) {
92
+ return value !== null && value !== undefined;
93
+ }