naijarea-ts 1.0.6 → 1.0.8

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/dist/account.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { Setting, UserPreference } from "./chat";
2
3
  import { DeleteResponse } from "./common";
3
4
  import { AccountType, Constituency, District, LocalGovernment, State } from "./lookup";
4
5
  import { Post } from "./posts";
@@ -19,6 +20,7 @@ export interface GetProfileResponse {
19
20
  }
20
21
  export interface UpdateProfileRequest {
21
22
  name: string;
23
+ username: string;
22
24
  phoneNumber: string;
23
25
  gender: string;
24
26
  dob: string;
@@ -115,6 +117,10 @@ export interface Profile {
115
117
  replies: Post[];
116
118
  media: Post[];
117
119
  likes: Post[];
120
+ /** Only included for authenticated user's own profile */
121
+ preferences: UserPreference[];
122
+ /** Only included for authenticated user's own profile */
123
+ settings: Setting[];
118
124
  }
119
125
  export interface AccountStatus {
120
126
  emailVerified: boolean;
package/dist/account.js CHANGED
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.AccountServiceDefinition = exports.GetStatusResponse = exports.GetStatusRequest = exports.GetAccountRepostsResponse = exports.GetAccountRepostsRequest = exports.GetAccountLikesResponse = exports.GetAccountLikesRequest = exports.GetAccountMediaResponse = exports.GetAccountMediaRequest = exports.GetAccountRepliesResponse = exports.GetAccountRepliesRequest = exports.GetAccountPostsResponse = exports.GetAccountPostsRequest = exports.GetFollowingResponse = exports.GetFollowingRequest = exports.GetFollowersResponse = exports.GetFollowersRequest = exports.UnfollowUserResponse = exports.UnfollowUserRequest = exports.FollowUserResponse = exports.FollowUserRequest = exports.Representative = exports.OnboardingProgress = exports.AccountStatus = exports.Profile = exports.Account = exports.ProfileStats = exports.ApplyForRepresentativeResponse = exports.ApplyForRepresentativeRequest = exports.OnboardResponse = exports.OnboardRequest = exports.UploadPhotoResponse = exports.UploadPhotoRequest = exports.UpdatePasswordRequest = exports.UpdateProfileResponse = exports.UpdateProfileRequest = exports.GetProfileResponse = exports.GetProfileRequest = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
+ const chat_1 = require("./chat");
11
12
  const common_1 = require("./common");
12
13
  const lookup_1 = require("./lookup");
13
14
  const posts_1 = require("./posts");
@@ -252,6 +253,7 @@ exports.GetProfileResponse = {
252
253
  function createBaseUpdateProfileRequest() {
253
254
  return {
254
255
  name: "",
256
+ username: "",
255
257
  phoneNumber: "",
256
258
  gender: "",
257
259
  dob: "",
@@ -268,32 +270,35 @@ exports.UpdateProfileRequest = {
268
270
  if (message.name !== "") {
269
271
  writer.uint32(10).string(message.name);
270
272
  }
273
+ if (message.username !== "") {
274
+ writer.uint32(18).string(message.username);
275
+ }
271
276
  if (message.phoneNumber !== "") {
272
- writer.uint32(18).string(message.phoneNumber);
277
+ writer.uint32(26).string(message.phoneNumber);
273
278
  }
274
279
  if (message.gender !== "") {
275
- writer.uint32(26).string(message.gender);
280
+ writer.uint32(34).string(message.gender);
276
281
  }
277
282
  if (message.dob !== "") {
278
- writer.uint32(34).string(message.dob);
283
+ writer.uint32(42).string(message.dob);
279
284
  }
280
285
  if (message.location !== "") {
281
- writer.uint32(42).string(message.location);
286
+ writer.uint32(50).string(message.location);
282
287
  }
283
288
  if (message.stateId !== "") {
284
- writer.uint32(50).string(message.stateId);
289
+ writer.uint32(58).string(message.stateId);
285
290
  }
286
291
  if (message.localGovernmentId !== "") {
287
- writer.uint32(58).string(message.localGovernmentId);
292
+ writer.uint32(66).string(message.localGovernmentId);
288
293
  }
289
294
  if (message.constituencyId !== "") {
290
- writer.uint32(66).string(message.constituencyId);
295
+ writer.uint32(74).string(message.constituencyId);
291
296
  }
292
297
  if (message.districtId !== "") {
293
- writer.uint32(74).string(message.districtId);
298
+ writer.uint32(82).string(message.districtId);
294
299
  }
295
300
  if (message.pollingUnit !== "") {
296
- writer.uint32(82).string(message.pollingUnit);
301
+ writer.uint32(90).string(message.pollingUnit);
297
302
  }
298
303
  return writer;
299
304
  },
@@ -315,62 +320,69 @@ exports.UpdateProfileRequest = {
315
320
  if (tag !== 18) {
316
321
  break;
317
322
  }
318
- message.phoneNumber = reader.string();
323
+ message.username = reader.string();
319
324
  continue;
320
325
  }
321
326
  case 3: {
322
327
  if (tag !== 26) {
323
328
  break;
324
329
  }
325
- message.gender = reader.string();
330
+ message.phoneNumber = reader.string();
326
331
  continue;
327
332
  }
328
333
  case 4: {
329
334
  if (tag !== 34) {
330
335
  break;
331
336
  }
332
- message.dob = reader.string();
337
+ message.gender = reader.string();
333
338
  continue;
334
339
  }
335
340
  case 5: {
336
341
  if (tag !== 42) {
337
342
  break;
338
343
  }
339
- message.location = reader.string();
344
+ message.dob = reader.string();
340
345
  continue;
341
346
  }
342
347
  case 6: {
343
348
  if (tag !== 50) {
344
349
  break;
345
350
  }
346
- message.stateId = reader.string();
351
+ message.location = reader.string();
347
352
  continue;
348
353
  }
349
354
  case 7: {
350
355
  if (tag !== 58) {
351
356
  break;
352
357
  }
353
- message.localGovernmentId = reader.string();
358
+ message.stateId = reader.string();
354
359
  continue;
355
360
  }
356
361
  case 8: {
357
362
  if (tag !== 66) {
358
363
  break;
359
364
  }
360
- message.constituencyId = reader.string();
365
+ message.localGovernmentId = reader.string();
361
366
  continue;
362
367
  }
363
368
  case 9: {
364
369
  if (tag !== 74) {
365
370
  break;
366
371
  }
367
- message.districtId = reader.string();
372
+ message.constituencyId = reader.string();
368
373
  continue;
369
374
  }
370
375
  case 10: {
371
376
  if (tag !== 82) {
372
377
  break;
373
378
  }
379
+ message.districtId = reader.string();
380
+ continue;
381
+ }
382
+ case 11: {
383
+ if (tag !== 90) {
384
+ break;
385
+ }
374
386
  message.pollingUnit = reader.string();
375
387
  continue;
376
388
  }
@@ -385,6 +397,7 @@ exports.UpdateProfileRequest = {
385
397
  fromJSON(object) {
386
398
  return {
387
399
  name: isSet(object.name) ? globalThis.String(object.name) : "",
400
+ username: isSet(object.username) ? globalThis.String(object.username) : "",
388
401
  phoneNumber: isSet(object.phoneNumber) ? globalThis.String(object.phoneNumber) : "",
389
402
  gender: isSet(object.gender) ? globalThis.String(object.gender) : "",
390
403
  dob: isSet(object.dob) ? globalThis.String(object.dob) : "",
@@ -401,6 +414,9 @@ exports.UpdateProfileRequest = {
401
414
  if (message.name !== "") {
402
415
  obj.name = message.name;
403
416
  }
417
+ if (message.username !== "") {
418
+ obj.username = message.username;
419
+ }
404
420
  if (message.phoneNumber !== "") {
405
421
  obj.phoneNumber = message.phoneNumber;
406
422
  }
@@ -434,18 +450,19 @@ exports.UpdateProfileRequest = {
434
450
  return exports.UpdateProfileRequest.fromPartial(base !== null && base !== void 0 ? base : {});
435
451
  },
436
452
  fromPartial(object) {
437
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
453
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
438
454
  const message = createBaseUpdateProfileRequest();
439
455
  message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
440
- message.phoneNumber = (_b = object.phoneNumber) !== null && _b !== void 0 ? _b : "";
441
- message.gender = (_c = object.gender) !== null && _c !== void 0 ? _c : "";
442
- message.dob = (_d = object.dob) !== null && _d !== void 0 ? _d : "";
443
- message.location = (_e = object.location) !== null && _e !== void 0 ? _e : "";
444
- message.stateId = (_f = object.stateId) !== null && _f !== void 0 ? _f : "";
445
- message.localGovernmentId = (_g = object.localGovernmentId) !== null && _g !== void 0 ? _g : "";
446
- message.constituencyId = (_h = object.constituencyId) !== null && _h !== void 0 ? _h : "";
447
- message.districtId = (_j = object.districtId) !== null && _j !== void 0 ? _j : "";
448
- message.pollingUnit = (_k = object.pollingUnit) !== null && _k !== void 0 ? _k : "";
456
+ message.username = (_b = object.username) !== null && _b !== void 0 ? _b : "";
457
+ message.phoneNumber = (_c = object.phoneNumber) !== null && _c !== void 0 ? _c : "";
458
+ message.gender = (_d = object.gender) !== null && _d !== void 0 ? _d : "";
459
+ message.dob = (_e = object.dob) !== null && _e !== void 0 ? _e : "";
460
+ message.location = (_f = object.location) !== null && _f !== void 0 ? _f : "";
461
+ message.stateId = (_g = object.stateId) !== null && _g !== void 0 ? _g : "";
462
+ message.localGovernmentId = (_h = object.localGovernmentId) !== null && _h !== void 0 ? _h : "";
463
+ message.constituencyId = (_j = object.constituencyId) !== null && _j !== void 0 ? _j : "";
464
+ message.districtId = (_k = object.districtId) !== null && _k !== void 0 ? _k : "";
465
+ message.pollingUnit = (_l = object.pollingUnit) !== null && _l !== void 0 ? _l : "";
449
466
  return message;
450
467
  },
451
468
  };
@@ -1779,7 +1796,16 @@ exports.Account = {
1779
1796
  },
1780
1797
  };
1781
1798
  function createBaseProfile() {
1782
- return { user: undefined, stats: undefined, posts: [], replies: [], media: [], likes: [] };
1799
+ return {
1800
+ user: undefined,
1801
+ stats: undefined,
1802
+ posts: [],
1803
+ replies: [],
1804
+ media: [],
1805
+ likes: [],
1806
+ preferences: [],
1807
+ settings: [],
1808
+ };
1783
1809
  }
1784
1810
  exports.Profile = {
1785
1811
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -1801,6 +1827,12 @@ exports.Profile = {
1801
1827
  for (const v of message.likes) {
1802
1828
  posts_1.Post.encode(v, writer.uint32(50).fork()).join();
1803
1829
  }
1830
+ for (const v of message.preferences) {
1831
+ chat_1.UserPreference.encode(v, writer.uint32(58).fork()).join();
1832
+ }
1833
+ for (const v of message.settings) {
1834
+ chat_1.Setting.encode(v, writer.uint32(66).fork()).join();
1835
+ }
1804
1836
  return writer;
1805
1837
  },
1806
1838
  decode(input, length) {
@@ -1852,6 +1884,20 @@ exports.Profile = {
1852
1884
  message.likes.push(posts_1.Post.decode(reader, reader.uint32()));
1853
1885
  continue;
1854
1886
  }
1887
+ case 7: {
1888
+ if (tag !== 58) {
1889
+ break;
1890
+ }
1891
+ message.preferences.push(chat_1.UserPreference.decode(reader, reader.uint32()));
1892
+ continue;
1893
+ }
1894
+ case 8: {
1895
+ if (tag !== 66) {
1896
+ break;
1897
+ }
1898
+ message.settings.push(chat_1.Setting.decode(reader, reader.uint32()));
1899
+ continue;
1900
+ }
1855
1901
  }
1856
1902
  if ((tag & 7) === 4 || tag === 0) {
1857
1903
  break;
@@ -1868,10 +1914,14 @@ exports.Profile = {
1868
1914
  replies: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.replies) ? object.replies.map((e) => posts_1.Post.fromJSON(e)) : [],
1869
1915
  media: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.media) ? object.media.map((e) => posts_1.Post.fromJSON(e)) : [],
1870
1916
  likes: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.likes) ? object.likes.map((e) => posts_1.Post.fromJSON(e)) : [],
1917
+ preferences: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.preferences)
1918
+ ? object.preferences.map((e) => chat_1.UserPreference.fromJSON(e))
1919
+ : [],
1920
+ settings: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.settings) ? object.settings.map((e) => chat_1.Setting.fromJSON(e)) : [],
1871
1921
  };
1872
1922
  },
1873
1923
  toJSON(message) {
1874
- var _a, _b, _c, _d;
1924
+ var _a, _b, _c, _d, _e, _f;
1875
1925
  const obj = {};
1876
1926
  if (message.user !== undefined) {
1877
1927
  obj.user = exports.Account.toJSON(message.user);
@@ -1891,13 +1941,19 @@ exports.Profile = {
1891
1941
  if ((_d = message.likes) === null || _d === void 0 ? void 0 : _d.length) {
1892
1942
  obj.likes = message.likes.map((e) => posts_1.Post.toJSON(e));
1893
1943
  }
1944
+ if ((_e = message.preferences) === null || _e === void 0 ? void 0 : _e.length) {
1945
+ obj.preferences = message.preferences.map((e) => chat_1.UserPreference.toJSON(e));
1946
+ }
1947
+ if ((_f = message.settings) === null || _f === void 0 ? void 0 : _f.length) {
1948
+ obj.settings = message.settings.map((e) => chat_1.Setting.toJSON(e));
1949
+ }
1894
1950
  return obj;
1895
1951
  },
1896
1952
  create(base) {
1897
1953
  return exports.Profile.fromPartial(base !== null && base !== void 0 ? base : {});
1898
1954
  },
1899
1955
  fromPartial(object) {
1900
- var _a, _b, _c, _d;
1956
+ var _a, _b, _c, _d, _e, _f;
1901
1957
  const message = createBaseProfile();
1902
1958
  message.user = (object.user !== undefined && object.user !== null) ? exports.Account.fromPartial(object.user) : undefined;
1903
1959
  message.stats = (object.stats !== undefined && object.stats !== null)
@@ -1907,6 +1963,8 @@ exports.Profile = {
1907
1963
  message.replies = ((_b = object.replies) === null || _b === void 0 ? void 0 : _b.map((e) => posts_1.Post.fromPartial(e))) || [];
1908
1964
  message.media = ((_c = object.media) === null || _c === void 0 ? void 0 : _c.map((e) => posts_1.Post.fromPartial(e))) || [];
1909
1965
  message.likes = ((_d = object.likes) === null || _d === void 0 ? void 0 : _d.map((e) => posts_1.Post.fromPartial(e))) || [];
1966
+ message.preferences = ((_e = object.preferences) === null || _e === void 0 ? void 0 : _e.map((e) => chat_1.UserPreference.fromPartial(e))) || [];
1967
+ message.settings = ((_f = object.settings) === null || _f === void 0 ? void 0 : _f.map((e) => chat_1.Setting.fromPartial(e))) || [];
1910
1968
  return message;
1911
1969
  },
1912
1970
  };