@fatehan/tsrp 1.1.0 → 1.1.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.
@@ -1,20 +1,25 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
2
  import Long from "long";
3
- import { Car, Device, DeviceIcon, SystemIo, Tracker } from "../devices/devices";
3
+ import { Car, CarBrand, CarModel, Device, DeviceIcon, SystemIo, Tracker } from "../devices/devices";
4
4
  import { Wallet } from "../financial/financial";
5
- import { Organization, Person, User } from "../identities/identities";
5
+ import { Driver, Organization, Person, User } from "../identities/identities";
6
6
  import { DeviceStatus } from "../packets/dataModel";
7
7
  export declare const protobufPackage = "com.fatehan.services";
8
8
  export interface DeviceRepo {
9
9
  device?: Device | undefined;
10
10
  icon?: DeviceIcon | undefined;
11
11
  tracker?: Tracker | undefined;
12
- car?: Car | undefined;
12
+ car?: CarRepo | undefined;
13
13
  deviceStatus?: DeviceStatus | undefined;
14
14
  userDeviceIo: SystemIo[];
15
- owner?: User | undefined;
15
+ owner?: UserRepo | undefined;
16
16
  organization?: Organization | undefined;
17
17
  }
18
+ export interface CarRepo {
19
+ car?: Car | undefined;
20
+ driver?: DriverRepo | undefined;
21
+ carModel?: CarModelRepo | undefined;
22
+ }
18
23
  export interface PersonRepo {
19
24
  person?: Person | undefined;
20
25
  wallet?: Wallet | undefined;
@@ -24,9 +29,20 @@ export interface UserRepo {
24
29
  user?: User | undefined;
25
30
  persons: Person[];
26
31
  }
32
+ export interface DriverRepo {
33
+ driver?: Driver | undefined;
34
+ person?: Person | undefined;
35
+ }
36
+ export interface CarModelRepo {
37
+ carModel?: CarModel | undefined;
38
+ carBrand?: CarBrand | undefined;
39
+ }
27
40
  export declare const DeviceRepo: MessageFns<DeviceRepo>;
41
+ export declare const CarRepo: MessageFns<CarRepo>;
28
42
  export declare const PersonRepo: MessageFns<PersonRepo>;
29
43
  export declare const UserRepo: MessageFns<UserRepo>;
44
+ export declare const DriverRepo: MessageFns<DriverRepo>;
45
+ export declare const CarModelRepo: MessageFns<CarModelRepo>;
30
46
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
31
47
  export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
32
48
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -1 +1 @@
1
- {"version":3,"file":"repositories.d.ts","sourceRoot":"","sources":["../../../src/fatehan/services/repositories.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,GAAG,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,YAAY,EAAE,QAAQ,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WA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AS,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GACrD,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CAAE,CAAC;AAMnG,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACxD,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;CAC/D"}
@@ -5,7 +5,7 @@
5
5
  // protoc v6.31.1
6
6
  // source: services/repositories.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.UserRepo = exports.PersonRepo = exports.DeviceRepo = exports.protobufPackage = void 0;
8
+ exports.CarModelRepo = exports.DriverRepo = exports.UserRepo = exports.PersonRepo = exports.CarRepo = exports.DeviceRepo = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  const devices_1 = require("../devices/devices");
@@ -37,7 +37,7 @@ exports.DeviceRepo = {
37
37
  devices_1.Tracker.encode(message.tracker, writer.uint32(26).fork()).join();
38
38
  }
39
39
  if (message.car !== undefined) {
40
- devices_1.Car.encode(message.car, writer.uint32(34).fork()).join();
40
+ exports.CarRepo.encode(message.car, writer.uint32(34).fork()).join();
41
41
  }
42
42
  if (message.deviceStatus !== undefined) {
43
43
  dataModel_1.DeviceStatus.encode(message.deviceStatus, writer.uint32(42).fork()).join();
@@ -46,7 +46,7 @@ exports.DeviceRepo = {
46
46
  devices_1.SystemIo.encode(v, writer.uint32(50).fork()).join();
47
47
  }
48
48
  if (message.owner !== undefined) {
49
- identities_1.User.encode(message.owner, writer.uint32(58).fork()).join();
49
+ exports.UserRepo.encode(message.owner, writer.uint32(58).fork()).join();
50
50
  }
51
51
  if (message.organization !== undefined) {
52
52
  identities_1.Organization.encode(message.organization, writer.uint32(66).fork()).join();
@@ -85,7 +85,7 @@ exports.DeviceRepo = {
85
85
  if (tag !== 34) {
86
86
  break;
87
87
  }
88
- message.car = devices_1.Car.decode(reader, reader.uint32());
88
+ message.car = exports.CarRepo.decode(reader, reader.uint32());
89
89
  continue;
90
90
  }
91
91
  case 5: {
@@ -106,7 +106,7 @@ exports.DeviceRepo = {
106
106
  if (tag !== 58) {
107
107
  break;
108
108
  }
109
- message.owner = identities_1.User.decode(reader, reader.uint32());
109
+ message.owner = exports.UserRepo.decode(reader, reader.uint32());
110
110
  continue;
111
111
  }
112
112
  case 8: {
@@ -129,12 +129,12 @@ exports.DeviceRepo = {
129
129
  device: isSet(object.device) ? devices_1.Device.fromJSON(object.device) : undefined,
130
130
  icon: isSet(object.icon) ? devices_1.DeviceIcon.fromJSON(object.icon) : undefined,
131
131
  tracker: isSet(object.tracker) ? devices_1.Tracker.fromJSON(object.tracker) : undefined,
132
- car: isSet(object.object) ? devices_1.Car.fromJSON(object.object) : undefined,
132
+ car: isSet(object.car) ? exports.CarRepo.fromJSON(object.car) : undefined,
133
133
  deviceStatus: isSet(object.device_status) ? dataModel_1.DeviceStatus.fromJSON(object.device_status) : undefined,
134
134
  userDeviceIo: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.user_device_io)
135
135
  ? object.user_device_io.map((e) => devices_1.SystemIo.fromJSON(e))
136
136
  : [],
137
- owner: isSet(object.owner) ? identities_1.User.fromJSON(object.owner) : undefined,
137
+ owner: isSet(object.owner) ? exports.UserRepo.fromJSON(object.owner) : undefined,
138
138
  organization: isSet(object.organization) ? identities_1.Organization.fromJSON(object.organization) : undefined,
139
139
  };
140
140
  },
@@ -151,7 +151,7 @@ exports.DeviceRepo = {
151
151
  obj.tracker = devices_1.Tracker.toJSON(message.tracker);
152
152
  }
153
153
  if (message.car !== undefined) {
154
- obj.object = devices_1.Car.toJSON(message.car);
154
+ obj.car = exports.CarRepo.toJSON(message.car);
155
155
  }
156
156
  if (message.deviceStatus !== undefined) {
157
157
  obj.device_status = dataModel_1.DeviceStatus.toJSON(message.deviceStatus);
@@ -160,7 +160,7 @@ exports.DeviceRepo = {
160
160
  obj.user_device_io = message.userDeviceIo.map((e) => devices_1.SystemIo.toJSON(e));
161
161
  }
162
162
  if (message.owner !== undefined) {
163
- obj.owner = identities_1.User.toJSON(message.owner);
163
+ obj.owner = exports.UserRepo.toJSON(message.owner);
164
164
  }
165
165
  if (message.organization !== undefined) {
166
166
  obj.organization = identities_1.Organization.toJSON(message.organization);
@@ -182,18 +182,107 @@ exports.DeviceRepo = {
182
182
  message.tracker = (object.tracker !== undefined && object.tracker !== null)
183
183
  ? devices_1.Tracker.fromPartial(object.tracker)
184
184
  : undefined;
185
- message.car = (object.car !== undefined && object.car !== null) ? devices_1.Car.fromPartial(object.car) : undefined;
185
+ message.car = (object.car !== undefined && object.car !== null) ? exports.CarRepo.fromPartial(object.car) : undefined;
186
186
  message.deviceStatus = (object.deviceStatus !== undefined && object.deviceStatus !== null)
187
187
  ? dataModel_1.DeviceStatus.fromPartial(object.deviceStatus)
188
188
  : undefined;
189
189
  message.userDeviceIo = ((_a = object.userDeviceIo) === null || _a === void 0 ? void 0 : _a.map((e) => devices_1.SystemIo.fromPartial(e))) || [];
190
- message.owner = (object.owner !== undefined && object.owner !== null) ? identities_1.User.fromPartial(object.owner) : undefined;
190
+ message.owner = (object.owner !== undefined && object.owner !== null)
191
+ ? exports.UserRepo.fromPartial(object.owner)
192
+ : undefined;
191
193
  message.organization = (object.organization !== undefined && object.organization !== null)
192
194
  ? identities_1.Organization.fromPartial(object.organization)
193
195
  : undefined;
194
196
  return message;
195
197
  },
196
198
  };
199
+ function createBaseCarRepo() {
200
+ return { car: undefined, driver: undefined, carModel: undefined };
201
+ }
202
+ exports.CarRepo = {
203
+ encode(message, writer = new wire_1.BinaryWriter()) {
204
+ if (message.car !== undefined) {
205
+ devices_1.Car.encode(message.car, writer.uint32(10).fork()).join();
206
+ }
207
+ if (message.driver !== undefined) {
208
+ exports.DriverRepo.encode(message.driver, writer.uint32(18).fork()).join();
209
+ }
210
+ if (message.carModel !== undefined) {
211
+ exports.CarModelRepo.encode(message.carModel, writer.uint32(26).fork()).join();
212
+ }
213
+ return writer;
214
+ },
215
+ decode(input, length) {
216
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
217
+ const end = length === undefined ? reader.len : reader.pos + length;
218
+ const message = createBaseCarRepo();
219
+ while (reader.pos < end) {
220
+ const tag = reader.uint32();
221
+ switch (tag >>> 3) {
222
+ case 1: {
223
+ if (tag !== 10) {
224
+ break;
225
+ }
226
+ message.car = devices_1.Car.decode(reader, reader.uint32());
227
+ continue;
228
+ }
229
+ case 2: {
230
+ if (tag !== 18) {
231
+ break;
232
+ }
233
+ message.driver = exports.DriverRepo.decode(reader, reader.uint32());
234
+ continue;
235
+ }
236
+ case 3: {
237
+ if (tag !== 26) {
238
+ break;
239
+ }
240
+ message.carModel = exports.CarModelRepo.decode(reader, reader.uint32());
241
+ continue;
242
+ }
243
+ }
244
+ if ((tag & 7) === 4 || tag === 0) {
245
+ break;
246
+ }
247
+ reader.skip(tag & 7);
248
+ }
249
+ return message;
250
+ },
251
+ fromJSON(object) {
252
+ return {
253
+ car: isSet(object.object) ? devices_1.Car.fromJSON(object.object) : undefined,
254
+ driver: isSet(object.driver) ? exports.DriverRepo.fromJSON(object.driver) : undefined,
255
+ carModel: isSet(object.car_types) ? exports.CarModelRepo.fromJSON(object.car_types) : undefined,
256
+ };
257
+ },
258
+ toJSON(message) {
259
+ const obj = {};
260
+ if (message.car !== undefined) {
261
+ obj.object = devices_1.Car.toJSON(message.car);
262
+ }
263
+ if (message.driver !== undefined) {
264
+ obj.driver = exports.DriverRepo.toJSON(message.driver);
265
+ }
266
+ if (message.carModel !== undefined) {
267
+ obj.car_types = exports.CarModelRepo.toJSON(message.carModel);
268
+ }
269
+ return obj;
270
+ },
271
+ create(base) {
272
+ return exports.CarRepo.fromPartial(base !== null && base !== void 0 ? base : {});
273
+ },
274
+ fromPartial(object) {
275
+ const message = createBaseCarRepo();
276
+ message.car = (object.car !== undefined && object.car !== null) ? devices_1.Car.fromPartial(object.car) : undefined;
277
+ message.driver = (object.driver !== undefined && object.driver !== null)
278
+ ? exports.DriverRepo.fromPartial(object.driver)
279
+ : undefined;
280
+ message.carModel = (object.carModel !== undefined && object.carModel !== null)
281
+ ? exports.CarModelRepo.fromPartial(object.carModel)
282
+ : undefined;
283
+ return message;
284
+ },
285
+ };
197
286
  function createBasePersonRepo() {
198
287
  return { person: undefined, wallet: undefined, organization: undefined };
199
288
  }
@@ -353,6 +442,150 @@ exports.UserRepo = {
353
442
  return message;
354
443
  },
355
444
  };
445
+ function createBaseDriverRepo() {
446
+ return { driver: undefined, person: undefined };
447
+ }
448
+ exports.DriverRepo = {
449
+ encode(message, writer = new wire_1.BinaryWriter()) {
450
+ if (message.driver !== undefined) {
451
+ identities_1.Driver.encode(message.driver, writer.uint32(10).fork()).join();
452
+ }
453
+ if (message.person !== undefined) {
454
+ identities_1.Person.encode(message.person, writer.uint32(18).fork()).join();
455
+ }
456
+ return writer;
457
+ },
458
+ decode(input, length) {
459
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
460
+ const end = length === undefined ? reader.len : reader.pos + length;
461
+ const message = createBaseDriverRepo();
462
+ while (reader.pos < end) {
463
+ const tag = reader.uint32();
464
+ switch (tag >>> 3) {
465
+ case 1: {
466
+ if (tag !== 10) {
467
+ break;
468
+ }
469
+ message.driver = identities_1.Driver.decode(reader, reader.uint32());
470
+ continue;
471
+ }
472
+ case 2: {
473
+ if (tag !== 18) {
474
+ break;
475
+ }
476
+ message.person = identities_1.Person.decode(reader, reader.uint32());
477
+ continue;
478
+ }
479
+ }
480
+ if ((tag & 7) === 4 || tag === 0) {
481
+ break;
482
+ }
483
+ reader.skip(tag & 7);
484
+ }
485
+ return message;
486
+ },
487
+ fromJSON(object) {
488
+ return {
489
+ driver: isSet(object.driver) ? identities_1.Driver.fromJSON(object.driver) : undefined,
490
+ person: isSet(object.person) ? identities_1.Person.fromJSON(object.person) : undefined,
491
+ };
492
+ },
493
+ toJSON(message) {
494
+ const obj = {};
495
+ if (message.driver !== undefined) {
496
+ obj.driver = identities_1.Driver.toJSON(message.driver);
497
+ }
498
+ if (message.person !== undefined) {
499
+ obj.person = identities_1.Person.toJSON(message.person);
500
+ }
501
+ return obj;
502
+ },
503
+ create(base) {
504
+ return exports.DriverRepo.fromPartial(base !== null && base !== void 0 ? base : {});
505
+ },
506
+ fromPartial(object) {
507
+ const message = createBaseDriverRepo();
508
+ message.driver = (object.driver !== undefined && object.driver !== null)
509
+ ? identities_1.Driver.fromPartial(object.driver)
510
+ : undefined;
511
+ message.person = (object.person !== undefined && object.person !== null)
512
+ ? identities_1.Person.fromPartial(object.person)
513
+ : undefined;
514
+ return message;
515
+ },
516
+ };
517
+ function createBaseCarModelRepo() {
518
+ return { carModel: undefined, carBrand: undefined };
519
+ }
520
+ exports.CarModelRepo = {
521
+ encode(message, writer = new wire_1.BinaryWriter()) {
522
+ if (message.carModel !== undefined) {
523
+ devices_1.CarModel.encode(message.carModel, writer.uint32(10).fork()).join();
524
+ }
525
+ if (message.carBrand !== undefined) {
526
+ devices_1.CarBrand.encode(message.carBrand, writer.uint32(18).fork()).join();
527
+ }
528
+ return writer;
529
+ },
530
+ decode(input, length) {
531
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
532
+ const end = length === undefined ? reader.len : reader.pos + length;
533
+ const message = createBaseCarModelRepo();
534
+ while (reader.pos < end) {
535
+ const tag = reader.uint32();
536
+ switch (tag >>> 3) {
537
+ case 1: {
538
+ if (tag !== 10) {
539
+ break;
540
+ }
541
+ message.carModel = devices_1.CarModel.decode(reader, reader.uint32());
542
+ continue;
543
+ }
544
+ case 2: {
545
+ if (tag !== 18) {
546
+ break;
547
+ }
548
+ message.carBrand = devices_1.CarBrand.decode(reader, reader.uint32());
549
+ continue;
550
+ }
551
+ }
552
+ if ((tag & 7) === 4 || tag === 0) {
553
+ break;
554
+ }
555
+ reader.skip(tag & 7);
556
+ }
557
+ return message;
558
+ },
559
+ fromJSON(object) {
560
+ return {
561
+ carModel: isSet(object.car_model) ? devices_1.CarModel.fromJSON(object.car_model) : undefined,
562
+ carBrand: isSet(object.car_brand) ? devices_1.CarBrand.fromJSON(object.car_brand) : undefined,
563
+ };
564
+ },
565
+ toJSON(message) {
566
+ const obj = {};
567
+ if (message.carModel !== undefined) {
568
+ obj.car_model = devices_1.CarModel.toJSON(message.carModel);
569
+ }
570
+ if (message.carBrand !== undefined) {
571
+ obj.car_brand = devices_1.CarBrand.toJSON(message.carBrand);
572
+ }
573
+ return obj;
574
+ },
575
+ create(base) {
576
+ return exports.CarModelRepo.fromPartial(base !== null && base !== void 0 ? base : {});
577
+ },
578
+ fromPartial(object) {
579
+ const message = createBaseCarModelRepo();
580
+ message.carModel = (object.carModel !== undefined && object.carModel !== null)
581
+ ? devices_1.CarModel.fromPartial(object.carModel)
582
+ : undefined;
583
+ message.carBrand = (object.carBrand !== undefined && object.carBrand !== null)
584
+ ? devices_1.CarBrand.fromPartial(object.carBrand)
585
+ : undefined;
586
+ return message;
587
+ },
588
+ };
356
589
  function isSet(value) {
357
590
  return value !== null && value !== undefined;
358
591
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatehan/tsrp",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "fatehan main models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,146 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- import Long from "long";
3
- export declare const protobufPackage = "google.protobuf";
4
- /**
5
- * `Any` contains an arbitrary serialized protocol buffer message along with a
6
- * URL that describes the type of the serialized message.
7
- *
8
- * Protobuf library provides support to pack/unpack Any values in the form
9
- * of utility functions or additional generated methods of the Any type.
10
- *
11
- * Example 1: Pack and unpack a message in C++.
12
- *
13
- * Foo foo = ...;
14
- * Any any;
15
- * any.PackFrom(foo);
16
- * ...
17
- * if (any.UnpackTo(&foo)) {
18
- * ...
19
- * }
20
- *
21
- * Example 2: Pack and unpack a message in Java.
22
- *
23
- * Foo foo = ...;
24
- * Any any = Any.pack(foo);
25
- * ...
26
- * if (any.is(Foo.class)) {
27
- * foo = any.unpack(Foo.class);
28
- * }
29
- * // or ...
30
- * if (any.isSameTypeAs(Foo.getDefaultInstance())) {
31
- * foo = any.unpack(Foo.getDefaultInstance());
32
- * }
33
- *
34
- * Example 3: Pack and unpack a message in Python.
35
- *
36
- * foo = Foo(...)
37
- * any = Any()
38
- * any.Pack(foo)
39
- * ...
40
- * if any.Is(Foo.DESCRIPTOR):
41
- * any.Unpack(foo)
42
- * ...
43
- *
44
- * Example 4: Pack and unpack a message in Go
45
- *
46
- * foo := &pb.Foo{...}
47
- * any, err := anypb.New(foo)
48
- * if err != nil {
49
- * ...
50
- * }
51
- * ...
52
- * foo := &pb.Foo{}
53
- * if err := any.UnmarshalTo(foo); err != nil {
54
- * ...
55
- * }
56
- *
57
- * The pack methods provided by protobuf library will by default use
58
- * 'type.googleapis.com/full.type.name' as the type URL and the unpack
59
- * methods only use the fully qualified type name after the last '/'
60
- * in the type URL, for example "foo.bar.com/x/y.z" will yield type
61
- * name "y.z".
62
- *
63
- * JSON
64
- * ====
65
- * The JSON representation of an `Any` value uses the regular
66
- * representation of the deserialized, embedded message, with an
67
- * additional field `@type` which contains the type URL. Example:
68
- *
69
- * package google.profile;
70
- * message Person {
71
- * string first_name = 1;
72
- * string last_name = 2;
73
- * }
74
- *
75
- * {
76
- * "@type": "type.googleapis.com/google.profile.Person",
77
- * "firstName": <string>,
78
- * "lastName": <string>
79
- * }
80
- *
81
- * If the embedded message type is well-known and has a custom JSON
82
- * representation, that representation will be embedded adding a field
83
- * `value` which holds the custom JSON in addition to the `@type`
84
- * field. Example (for message [google.protobuf.Duration][]):
85
- *
86
- * {
87
- * "@type": "type.googleapis.com/google.protobuf.Duration",
88
- * "value": "1.212s"
89
- * }
90
- */
91
- export interface Any {
92
- /**
93
- * A URL/resource name that uniquely identifies the type of the serialized
94
- * protocol buffer message. This string must contain at least
95
- * one "/" character. The last segment of the URL's path must represent
96
- * the fully qualified name of the type (as in
97
- * `path/google.protobuf.Duration`). The name should be in a canonical form
98
- * (e.g., leading "." is not accepted).
99
- *
100
- * In practice, teams usually precompile into the binary all types that they
101
- * expect it to use in the context of Any. However, for URLs which use the
102
- * scheme `http`, `https`, or no scheme, one can optionally set up a type
103
- * server that maps type URLs to message definitions as follows:
104
- *
105
- * * If no scheme is provided, `https` is assumed.
106
- * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
107
- * value in binary format, or produce an error.
108
- * * Applications are allowed to cache lookup results based on the
109
- * URL, or have them precompiled into a binary to avoid any
110
- * lookup. Therefore, binary compatibility needs to be preserved
111
- * on changes to types. (Use versioned type names to manage
112
- * breaking changes.)
113
- *
114
- * Note: this functionality is not currently available in the official
115
- * protobuf release, and it is not used for type URLs beginning with
116
- * type.googleapis.com. As of May 2023, there are no widely used type server
117
- * implementations and no plans to implement one.
118
- *
119
- * Schemes other than `http`, `https` (or the empty scheme) might be
120
- * used with implementation specific semantics.
121
- */
122
- typeUrl: string;
123
- /** Must be a valid serialized protocol buffer of the above specified type. */
124
- value: Uint8Array;
125
- }
126
- export declare const Any: MessageFns<Any>;
127
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
128
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
129
- [K in keyof T]?: DeepPartial<T[K]>;
130
- } : Partial<T>;
131
- type KeysOfUnion<T> = T extends T ? keyof T : never;
132
- export type Exact<P, I extends P> = P extends Builtin ? P : P & {
133
- [K in keyof P]: Exact<P[K], I[K]>;
134
- } & {
135
- [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
136
- };
137
- export interface MessageFns<T> {
138
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
139
- decode(input: BinaryReader | Uint8Array, length?: number): T;
140
- fromJSON(object: any): T;
141
- toJSON(message: T): unknown;
142
- create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
143
- fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
144
- }
145
- export {};
146
- //# sourceMappingURL=any.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"any.d.ts","sourceRoot":"","sources":["../../../../src/fatehan/google/protobuf/any.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,MAAM,WAAW,GAAG;IAClB;;;;;;;;;;;;;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M,WAAW,UAAU,CAAC,CAAC;IAC3B,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACxD,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;CAC/D"}
@@ -1,108 +0,0 @@
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 v6.31.1
6
- // source: google/protobuf/any.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Any = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- exports.protobufPackage = "google.protobuf";
12
- function createBaseAny() {
13
- return { typeUrl: "", value: new Uint8Array(0) };
14
- }
15
- exports.Any = {
16
- encode(message, writer = new wire_1.BinaryWriter()) {
17
- if (message.typeUrl !== "") {
18
- writer.uint32(10).string(message.typeUrl);
19
- }
20
- if (message.value.length !== 0) {
21
- writer.uint32(18).bytes(message.value);
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 = createBaseAny();
29
- while (reader.pos < end) {
30
- const tag = reader.uint32();
31
- switch (tag >>> 3) {
32
- case 1: {
33
- if (tag !== 10) {
34
- break;
35
- }
36
- message.typeUrl = reader.string();
37
- continue;
38
- }
39
- case 2: {
40
- if (tag !== 18) {
41
- break;
42
- }
43
- message.value = reader.bytes();
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
- typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "",
57
- value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
58
- };
59
- },
60
- toJSON(message) {
61
- const obj = {};
62
- if (message.typeUrl !== "") {
63
- obj.typeUrl = message.typeUrl;
64
- }
65
- if (message.value.length !== 0) {
66
- obj.value = base64FromBytes(message.value);
67
- }
68
- return obj;
69
- },
70
- create(base) {
71
- return exports.Any.fromPartial(base !== null && base !== void 0 ? base : {});
72
- },
73
- fromPartial(object) {
74
- var _a, _b;
75
- const message = createBaseAny();
76
- message.typeUrl = (_a = object.typeUrl) !== null && _a !== void 0 ? _a : "";
77
- message.value = (_b = object.value) !== null && _b !== void 0 ? _b : new Uint8Array(0);
78
- return message;
79
- },
80
- };
81
- function bytesFromBase64(b64) {
82
- if (globalThis.Buffer) {
83
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
84
- }
85
- else {
86
- const bin = globalThis.atob(b64);
87
- const arr = new Uint8Array(bin.length);
88
- for (let i = 0; i < bin.length; ++i) {
89
- arr[i] = bin.charCodeAt(i);
90
- }
91
- return arr;
92
- }
93
- }
94
- function base64FromBytes(arr) {
95
- if (globalThis.Buffer) {
96
- return globalThis.Buffer.from(arr).toString("base64");
97
- }
98
- else {
99
- const bin = [];
100
- arr.forEach((byte) => {
101
- bin.push(globalThis.String.fromCharCode(byte));
102
- });
103
- return globalThis.btoa(bin.join(""));
104
- }
105
- }
106
- function isSet(value) {
107
- return value !== null && value !== undefined;
108
- }