@armi-wave/common 1.10.0 → 1.13.0

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,7 +1,7 @@
1
1
  import mongoose from 'mongoose';
2
2
  import { PostType } from '../enums/PostType';
3
3
  interface PostAttributes {
4
- idUser: string;
4
+ userId: string;
5
5
  username: string;
6
6
  likes: number;
7
7
  upVotes: number;
@@ -16,7 +16,7 @@ interface PostModel extends mongoose.Model<PostDocument> {
16
16
  build(attrs: PostAttributes): PostDocument;
17
17
  }
18
18
  interface PostDocument extends mongoose.Document {
19
- idUser: string;
19
+ userId: string;
20
20
  username: string;
21
21
  likes: number;
22
22
  upVotes: number;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const mongoose_1 = __importDefault(require("mongoose"));
7
7
  const postSchema = new mongoose_1.default.Schema({
8
- idUser: {
8
+ userId: {
9
9
  type: String,
10
10
  required: true,
11
11
  },
@@ -132,21 +132,14 @@ const userSchema = new mongoose_1.default.Schema({
132
132
  delete ret.password;
133
133
  delete ret.__v;
134
134
  delete ret._id;
135
- delete ret.followers;
136
- delete ret.following;
137
135
  delete ret.phoneNumber;
138
- delete ret.verified;
139
136
  delete ret.paidPlan;
140
137
  delete ret.savedPosts;
141
138
  delete ret.likedPosts;
142
139
  delete ret.upVotedPosts;
143
140
  delete ret.likedComments;
144
- delete ret.bannedAccounts;
145
141
  delete ret.reportedPosts;
146
142
  delete ret.validReportedPosts;
147
- delete ret.totalLikes;
148
- delete ret.totalUpVotes;
149
- delete ret.totalDownVotes;
150
143
  delete ret.location;
151
144
  delete ret.height;
152
145
  delete ret.weight;
@@ -1,5 +1,5 @@
1
1
  export default class CountryUtils {
2
- static isValidCode(code: string): Promise<boolean>;
3
- static isValidDialCode(dialCode: string): Promise<boolean>;
4
- static getNameFromCode(code: string): Promise<string | false>;
2
+ static isValidCode(code: string): boolean;
3
+ static isValidDialCode(dialCode: string): boolean;
4
+ static getNameFromCode(code: string): string | false;
5
5
  }
@@ -1,45 +1,30 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const countries_1 = require("./countries");
13
4
  class CountryUtils {
14
5
  static isValidCode(code) {
15
- return __awaiter(this, void 0, void 0, function* () {
16
- for (const country of countries_1.countries) {
17
- if (country.code == code) {
18
- return true;
19
- }
6
+ for (const country of countries_1.countries) {
7
+ if (country.code == code) {
8
+ return true;
20
9
  }
21
- return false;
22
- });
10
+ }
11
+ return false;
23
12
  }
24
13
  static isValidDialCode(dialCode) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- for (const country of countries_1.countries) {
27
- if (country.dialCode == dialCode) {
28
- return true;
29
- }
14
+ for (const country of countries_1.countries) {
15
+ if (country.dialCode == dialCode) {
16
+ return true;
30
17
  }
31
- return false;
32
- });
18
+ }
19
+ return false;
33
20
  }
34
21
  static getNameFromCode(code) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- for (const country of countries_1.countries) {
37
- if (country.code == code) {
38
- return country.name;
39
- }
22
+ for (const country of countries_1.countries) {
23
+ if (country.code == code) {
24
+ return country.name;
40
25
  }
41
- return false;
42
- });
26
+ }
27
+ return false;
43
28
  }
44
29
  }
45
30
  exports.default = CountryUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armi-wave/common",
3
- "version": "1.10.0",
3
+ "version": "1.13.0",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",