@sendhome/common 1.0.161 → 1.0.163

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,6 +1,6 @@
1
1
  import { Subjects } from "../subjects/subjects";
2
2
  import { CompanyStatus } from "../types/company-status";
3
- import { ReceiveCountry } from "../types/receive-country";
3
+ import { CompanyCountry } from "../types/company-country";
4
4
  export interface CompanyCreatedEvent {
5
5
  subject: Subjects.CompanyCreated;
6
6
  data: {
@@ -13,8 +13,7 @@ export interface CompanyCreatedEvent {
13
13
  landlines: string[];
14
14
  email: string;
15
15
  address: string;
16
- send_country: string;
17
- country: ReceiveCountry;
16
+ country: CompanyCountry;
18
17
  currency: string;
19
18
  created_at: Date;
20
19
  updated_at: Date;
@@ -1,6 +1,6 @@
1
1
  import { Subjects } from "../subjects/subjects";
2
2
  import { CompanyStatus } from "../types/company-status";
3
- import { ReceiveCountry } from "../types/receive-country";
3
+ import { CompanyCountry } from "../types/company-country";
4
4
  export interface CompanyUpdatedEvent {
5
5
  subject: Subjects.CompanyUpdated;
6
6
  data: {
@@ -13,8 +13,7 @@ export interface CompanyUpdatedEvent {
13
13
  landlines: string[];
14
14
  email: string;
15
15
  address: string;
16
- send_country: string;
17
- country: ReceiveCountry;
16
+ country: CompanyCountry;
18
17
  currency: string;
19
18
  created_at: Date;
20
19
  updated_at: Date;
@@ -1,7 +1,8 @@
1
1
  import { Subjects } from "../subjects/subjects";
2
2
  import { ModuleStatus } from "../types/module-status";
3
- import { CompanyType } from "../types/company-type";
3
+ import { Category } from "../types/category";
4
4
  import { ReceiveCountry } from "../types/receive-country";
5
+ import { CompanyCountry } from "../types/company-country";
5
6
  export interface ModuleCreatedEvent {
6
7
  subject: Subjects.ModuleCreated;
7
8
  data: {
@@ -9,7 +10,7 @@ export interface ModuleCreatedEvent {
9
10
  logo: string;
10
11
  module_id: number;
11
12
  name: string;
12
- category: CompanyType;
13
+ category: Category;
13
14
  is_transport_company: boolean;
14
15
  delivery_details: {
15
16
  category: string;
@@ -17,7 +18,8 @@ export interface ModuleCreatedEvent {
17
18
  delivery_rate: number;
18
19
  }[];
19
20
  company: string;
20
- country: ReceiveCountry;
21
+ receive_countries: ReceiveCountry[];
22
+ country: CompanyCountry;
21
23
  status: ModuleStatus;
22
24
  created_at: Date;
23
25
  updated_at: Date;
@@ -1,7 +1,8 @@
1
1
  import { Subjects } from "../subjects/subjects";
2
2
  import { ModuleStatus } from "../types/module-status";
3
- import { CompanyType } from "../types/company-type";
3
+ import { Category } from "../types/category";
4
4
  import { ReceiveCountry } from "../types/receive-country";
5
+ import { CompanyCountry } from "../types/company-country";
5
6
  export interface ModuleUpdatedEvent {
6
7
  subject: Subjects.ModuleUpdated;
7
8
  data: {
@@ -9,7 +10,7 @@ export interface ModuleUpdatedEvent {
9
10
  logo: string;
10
11
  module_id: number;
11
12
  name: string;
12
- category: CompanyType;
13
+ category: Category;
13
14
  is_transport_company: boolean;
14
15
  delivery_details: {
15
16
  category: string;
@@ -17,7 +18,8 @@ export interface ModuleUpdatedEvent {
17
18
  delivery_rate: number;
18
19
  }[];
19
20
  company: string;
20
- country: ReceiveCountry;
21
+ receive_countries: ReceiveCountry[];
22
+ country: CompanyCountry;
21
23
  status: ModuleStatus;
22
24
  created_at: Date;
23
25
  updated_at: Date;
@@ -25,9 +25,11 @@ const requireAuth = (sessionServiceUrl) => {
25
25
  res.status(401).json({ message: 'No session token provided' });
26
26
  return;
27
27
  }
28
+ console.log("token", token);
28
29
  const payload = jsonwebtoken_1.default.verify(token, "EDWIN"
29
30
  // process.env.JWT_KEY!
30
31
  );
32
+ console.log("url", `${sessionServiceUrl}/${payload.sessionId}`);
31
33
  // Call the session service to validate the session
32
34
  const response = yield axios_1.default.get(`${sessionServiceUrl}/${payload.sessionId}`);
33
35
  if (response.status !== 200) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendhome/common",
3
- "version": "1.0.161",
3
+ "version": "1.0.163",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",