@fivenet-app/gen 0.9.3-3 → 0.9.3-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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fivenet-app/gen",
3
3
  "private": false,
4
- "version": "0.9.3-3",
4
+ "version": "0.9.3-5",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "repository": {
@@ -69,9 +69,9 @@ export interface DataUserLocations {
69
69
  */
70
70
  users: UserLocation[];
71
71
  /**
72
- * @generated from protobuf field: optional bool clear = 2;
72
+ * @generated from protobuf field: optional bool clear_all = 2;
73
73
  */
74
- clear?: boolean;
74
+ clearAll?: boolean;
75
75
  }
76
76
  /**
77
77
  * @generated from protobuf message resources.sync.UserLocation
@@ -93,6 +93,10 @@ export interface UserLocation {
93
93
  * @generated from protobuf field: bool hidden = 4;
94
94
  */
95
95
  hidden: boolean;
96
+ /**
97
+ * @generated from protobuf field: bool remove = 5;
98
+ */
99
+ remove: boolean;
96
100
  }
97
101
  // @generated message type with reflection information, may provide speed optimized methods
98
102
  class DataStatus$Type extends MessageType<DataStatus> {
@@ -334,7 +338,7 @@ class DataUserLocations$Type extends MessageType<DataUserLocations> {
334
338
  constructor() {
335
339
  super("resources.sync.DataUserLocations", [
336
340
  { no: 1, name: "users", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => UserLocation, options: { "validate.rules": { repeated: { maxItems: "2000" } } } },
337
- { no: 2, name: "clear", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
341
+ { no: 2, name: "clear_all", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
338
342
  ]);
339
343
  }
340
344
  create(value?: PartialMessage<DataUserLocations>): DataUserLocations {
@@ -352,8 +356,8 @@ class DataUserLocations$Type extends MessageType<DataUserLocations> {
352
356
  case /* repeated resources.sync.UserLocation users */ 1:
353
357
  message.users.push(UserLocation.internalBinaryRead(reader, reader.uint32(), options));
354
358
  break;
355
- case /* optional bool clear */ 2:
356
- message.clear = reader.bool();
359
+ case /* optional bool clear_all */ 2:
360
+ message.clearAll = reader.bool();
357
361
  break;
358
362
  default:
359
363
  let u = options.readUnknownField;
@@ -370,9 +374,9 @@ class DataUserLocations$Type extends MessageType<DataUserLocations> {
370
374
  /* repeated resources.sync.UserLocation users = 1; */
371
375
  for (let i = 0; i < message.users.length; i++)
372
376
  UserLocation.internalBinaryWrite(message.users[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
373
- /* optional bool clear = 2; */
374
- if (message.clear !== undefined)
375
- writer.tag(2, WireType.Varint).bool(message.clear);
377
+ /* optional bool clear_all = 2; */
378
+ if (message.clearAll !== undefined)
379
+ writer.tag(2, WireType.Varint).bool(message.clearAll);
376
380
  let u = options.writeUnknownFields;
377
381
  if (u !== false)
378
382
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -390,7 +394,8 @@ class UserLocation$Type extends MessageType<UserLocation> {
390
394
  { no: 1, name: "identifier", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "64" } } } },
391
395
  { no: 2, name: "job", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "20" } } } },
392
396
  { no: 3, name: "coords", kind: "message", T: () => Coords, options: { "validate.rules": { message: { required: true } } } },
393
- { no: 4, name: "hidden", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
397
+ { no: 4, name: "hidden", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
398
+ { no: 5, name: "remove", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
394
399
  ]);
395
400
  }
396
401
  create(value?: PartialMessage<UserLocation>): UserLocation {
@@ -398,6 +403,7 @@ class UserLocation$Type extends MessageType<UserLocation> {
398
403
  message.identifier = "";
399
404
  message.job = "";
400
405
  message.hidden = false;
406
+ message.remove = false;
401
407
  if (value !== undefined)
402
408
  reflectionMergePartial<UserLocation>(this, message, value);
403
409
  return message;
@@ -419,6 +425,9 @@ class UserLocation$Type extends MessageType<UserLocation> {
419
425
  case /* bool hidden */ 4:
420
426
  message.hidden = reader.bool();
421
427
  break;
428
+ case /* bool remove */ 5:
429
+ message.remove = reader.bool();
430
+ break;
422
431
  default:
423
432
  let u = options.readUnknownField;
424
433
  if (u === "throw")
@@ -443,6 +452,9 @@ class UserLocation$Type extends MessageType<UserLocation> {
443
452
  /* bool hidden = 4; */
444
453
  if (message.hidden !== false)
445
454
  writer.tag(4, WireType.Varint).bool(message.hidden);
455
+ /* bool remove = 5; */
456
+ if (message.remove !== false)
457
+ writer.tag(5, WireType.Varint).bool(message.remove);
446
458
  let u = options.writeUnknownFields;
447
459
  if (u !== false)
448
460
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -188,11 +188,11 @@ export interface UserWantedChange {
188
188
  */
189
189
  export interface UserTrafficInfractionPointsChange {
190
190
  /**
191
- * @generated from protobuf field: int32 old = 1;
191
+ * @generated from protobuf field: uint32 old = 1;
192
192
  */
193
193
  old: number;
194
194
  /**
195
- * @generated from protobuf field: int32 new = 2;
195
+ * @generated from protobuf field: uint32 new = 2;
196
196
  */
197
197
  new: number;
198
198
  }
@@ -778,8 +778,8 @@ export const UserWantedChange = new UserWantedChange$Type();
778
778
  class UserTrafficInfractionPointsChange$Type extends MessageType<UserTrafficInfractionPointsChange> {
779
779
  constructor() {
780
780
  super("resources.users.UserTrafficInfractionPointsChange", [
781
- { no: 1, name: "old", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
782
- { no: 2, name: "new", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
781
+ { no: 1, name: "old", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
782
+ { no: 2, name: "new", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
783
783
  ]);
784
784
  }
785
785
  create(value?: PartialMessage<UserTrafficInfractionPointsChange>): UserTrafficInfractionPointsChange {
@@ -795,11 +795,11 @@ class UserTrafficInfractionPointsChange$Type extends MessageType<UserTrafficInfr
795
795
  while (reader.pos < end) {
796
796
  let [fieldNo, wireType] = reader.tag();
797
797
  switch (fieldNo) {
798
- case /* int32 old */ 1:
799
- message.old = reader.int32();
798
+ case /* uint32 old */ 1:
799
+ message.old = reader.uint32();
800
800
  break;
801
- case /* int32 new */ 2:
802
- message.new = reader.int32();
801
+ case /* uint32 new */ 2:
802
+ message.new = reader.uint32();
803
803
  break;
804
804
  default:
805
805
  let u = options.readUnknownField;
@@ -813,12 +813,12 @@ class UserTrafficInfractionPointsChange$Type extends MessageType<UserTrafficInfr
813
813
  return message;
814
814
  }
815
815
  internalBinaryWrite(message: UserTrafficInfractionPointsChange, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
816
- /* int32 old = 1; */
816
+ /* uint32 old = 1; */
817
817
  if (message.old !== 0)
818
- writer.tag(1, WireType.Varint).int32(message.old);
819
- /* int32 new = 2; */
818
+ writer.tag(1, WireType.Varint).uint32(message.old);
819
+ /* uint32 new = 2; */
820
820
  if (message.new !== 0)
821
- writer.tag(2, WireType.Varint).int32(message.new);
821
+ writer.tag(2, WireType.Varint).uint32(message.new);
822
822
  let u = options.writeUnknownFields;
823
823
  if (u !== false)
824
824
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -9,6 +9,8 @@ import type { StreamRequest } from "./sync";
9
9
  import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
10
10
  import type { SendDataResponse } from "./sync";
11
11
  import type { SendDataRequest } from "./sync";
12
+ import type { TransferAccountResponse } from "./sync";
13
+ import type { TransferAccountRequest } from "./sync";
12
14
  import type { RegisterAccountResponse } from "./sync";
13
15
  import type { RegisterAccountRequest } from "./sync";
14
16
  import type { AddActivityResponse } from "./sync";
@@ -40,6 +42,12 @@ export interface ISyncServiceClient {
40
42
  * @generated from protobuf rpc: RegisterAccount(services.sync.RegisterAccountRequest) returns (services.sync.RegisterAccountResponse);
41
43
  */
42
44
  registerAccount(input: RegisterAccountRequest, options?: RpcOptions): UnaryCall<RegisterAccountRequest, RegisterAccountResponse>;
45
+ /**
46
+ * Transfer account from one license to another
47
+ *
48
+ * @generated from protobuf rpc: TransferAccount(services.sync.TransferAccountRequest) returns (services.sync.TransferAccountResponse);
49
+ */
50
+ transferAccount(input: TransferAccountRequest, options?: RpcOptions): UnaryCall<TransferAccountRequest, TransferAccountResponse>;
43
51
  /**
44
52
  * DBSync's method of sending (mass) data to the FiveNet server for storing.
45
53
  *
@@ -89,13 +97,22 @@ export class SyncServiceClient implements ISyncServiceClient, ServiceInfo {
89
97
  const method = this.methods[2], opt = this._transport.mergeOptions(options);
90
98
  return stackIntercept<RegisterAccountRequest, RegisterAccountResponse>("unary", this._transport, method, opt, input);
91
99
  }
100
+ /**
101
+ * Transfer account from one license to another
102
+ *
103
+ * @generated from protobuf rpc: TransferAccount(services.sync.TransferAccountRequest) returns (services.sync.TransferAccountResponse);
104
+ */
105
+ transferAccount(input: TransferAccountRequest, options?: RpcOptions): UnaryCall<TransferAccountRequest, TransferAccountResponse> {
106
+ const method = this.methods[3], opt = this._transport.mergeOptions(options);
107
+ return stackIntercept<TransferAccountRequest, TransferAccountResponse>("unary", this._transport, method, opt, input);
108
+ }
92
109
  /**
93
110
  * DBSync's method of sending (mass) data to the FiveNet server for storing.
94
111
  *
95
112
  * @generated from protobuf rpc: SendData(services.sync.SendDataRequest) returns (services.sync.SendDataResponse);
96
113
  */
97
114
  sendData(input: SendDataRequest, options?: RpcOptions): UnaryCall<SendDataRequest, SendDataResponse> {
98
- const method = this.methods[3], opt = this._transport.mergeOptions(options);
115
+ const method = this.methods[4], opt = this._transport.mergeOptions(options);
99
116
  return stackIntercept<SendDataRequest, SendDataResponse>("unary", this._transport, method, opt, input);
100
117
  }
101
118
  /**
@@ -104,7 +121,7 @@ export class SyncServiceClient implements ISyncServiceClient, ServiceInfo {
104
121
  * @generated from protobuf rpc: Stream(services.sync.StreamRequest) returns (stream services.sync.StreamResponse);
105
122
  */
106
123
  stream(input: StreamRequest, options?: RpcOptions): ServerStreamingCall<StreamRequest, StreamResponse> {
107
- const method = this.methods[4], opt = this._transport.mergeOptions(options);
124
+ const method = this.methods[5], opt = this._transport.mergeOptions(options);
108
125
  return stackIntercept<StreamRequest, StreamResponse>("serverStreaming", this._transport, method, opt, input);
109
126
  }
110
127
  }
@@ -161,6 +161,24 @@ export interface RegisterAccountResponse {
161
161
  */
162
162
  username?: string;
163
163
  }
164
+ /**
165
+ * @generated from protobuf message services.sync.TransferAccountRequest
166
+ */
167
+ export interface TransferAccountRequest {
168
+ /**
169
+ * @generated from protobuf field: string old_license = 1;
170
+ */
171
+ oldLicense: string;
172
+ /**
173
+ * @generated from protobuf field: string new_license = 2;
174
+ */
175
+ newLicense: string;
176
+ }
177
+ /**
178
+ * @generated from protobuf message services.sync.TransferAccountResponse
179
+ */
180
+ export interface TransferAccountResponse {
181
+ }
164
182
  /**
165
183
  * @generated from protobuf message services.sync.SendDataRequest
166
184
  */
@@ -585,6 +603,86 @@ class RegisterAccountResponse$Type extends MessageType<RegisterAccountResponse>
585
603
  */
586
604
  export const RegisterAccountResponse = new RegisterAccountResponse$Type();
587
605
  // @generated message type with reflection information, may provide speed optimized methods
606
+ class TransferAccountRequest$Type extends MessageType<TransferAccountRequest> {
607
+ constructor() {
608
+ super("services.sync.TransferAccountRequest", [
609
+ { no: 1, name: "old_license", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "64" } } } },
610
+ { no: 2, name: "new_license", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "64" } } } }
611
+ ]);
612
+ }
613
+ create(value?: PartialMessage<TransferAccountRequest>): TransferAccountRequest {
614
+ const message = globalThis.Object.create((this.messagePrototype!));
615
+ message.oldLicense = "";
616
+ message.newLicense = "";
617
+ if (value !== undefined)
618
+ reflectionMergePartial<TransferAccountRequest>(this, message, value);
619
+ return message;
620
+ }
621
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TransferAccountRequest): TransferAccountRequest {
622
+ let message = target ?? this.create(), end = reader.pos + length;
623
+ while (reader.pos < end) {
624
+ let [fieldNo, wireType] = reader.tag();
625
+ switch (fieldNo) {
626
+ case /* string old_license */ 1:
627
+ message.oldLicense = reader.string();
628
+ break;
629
+ case /* string new_license */ 2:
630
+ message.newLicense = reader.string();
631
+ break;
632
+ default:
633
+ let u = options.readUnknownField;
634
+ if (u === "throw")
635
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
636
+ let d = reader.skip(wireType);
637
+ if (u !== false)
638
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
639
+ }
640
+ }
641
+ return message;
642
+ }
643
+ internalBinaryWrite(message: TransferAccountRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
644
+ /* string old_license = 1; */
645
+ if (message.oldLicense !== "")
646
+ writer.tag(1, WireType.LengthDelimited).string(message.oldLicense);
647
+ /* string new_license = 2; */
648
+ if (message.newLicense !== "")
649
+ writer.tag(2, WireType.LengthDelimited).string(message.newLicense);
650
+ let u = options.writeUnknownFields;
651
+ if (u !== false)
652
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
653
+ return writer;
654
+ }
655
+ }
656
+ /**
657
+ * @generated MessageType for protobuf message services.sync.TransferAccountRequest
658
+ */
659
+ export const TransferAccountRequest = new TransferAccountRequest$Type();
660
+ // @generated message type with reflection information, may provide speed optimized methods
661
+ class TransferAccountResponse$Type extends MessageType<TransferAccountResponse> {
662
+ constructor() {
663
+ super("services.sync.TransferAccountResponse", []);
664
+ }
665
+ create(value?: PartialMessage<TransferAccountResponse>): TransferAccountResponse {
666
+ const message = globalThis.Object.create((this.messagePrototype!));
667
+ if (value !== undefined)
668
+ reflectionMergePartial<TransferAccountResponse>(this, message, value);
669
+ return message;
670
+ }
671
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TransferAccountResponse): TransferAccountResponse {
672
+ return target ?? this.create();
673
+ }
674
+ internalBinaryWrite(message: TransferAccountResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
675
+ let u = options.writeUnknownFields;
676
+ if (u !== false)
677
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
678
+ return writer;
679
+ }
680
+ }
681
+ /**
682
+ * @generated MessageType for protobuf message services.sync.TransferAccountResponse
683
+ */
684
+ export const TransferAccountResponse = new TransferAccountResponse$Type();
685
+ // @generated message type with reflection information, may provide speed optimized methods
588
686
  class SendDataRequest$Type extends MessageType<SendDataRequest> {
589
687
  constructor() {
590
688
  super("services.sync.SendDataRequest", [
@@ -800,6 +898,7 @@ export const SyncService = new ServiceType("services.sync.SyncService", [
800
898
  { name: "GetStatus", options: {}, I: GetStatusRequest, O: GetStatusResponse },
801
899
  { name: "AddActivity", options: {}, I: AddActivityRequest, O: AddActivityResponse },
802
900
  { name: "RegisterAccount", options: {}, I: RegisterAccountRequest, O: RegisterAccountResponse },
901
+ { name: "TransferAccount", options: {}, I: TransferAccountRequest, O: TransferAccountResponse },
803
902
  { name: "SendData", options: {}, I: SendDataRequest, O: SendDataResponse },
804
903
  { name: "Stream", serverStreaming: true, options: {}, I: StreamRequest, O: StreamResponse }
805
904
  ]);
package/svcs.ts CHANGED
@@ -298,6 +298,7 @@ export const grpcMethods = [
298
298
  'SyncService/GetStatus',
299
299
  'SyncService/AddActivity',
300
300
  'SyncService/RegisterAccount',
301
+ 'SyncService/TransferAccount',
301
302
  'SyncService/SendData',
302
303
  'SyncService/Stream',
303
304
  'WikiService/ListPages',