gemcap-be-common 1.4.252 → 1.4.254

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,5 +1,6 @@
1
1
  export declare const MESSAGE_CHANNELS: {
2
2
  readonly AI: "ai.exchange";
3
+ readonly AUTH: "auth.exchange";
3
4
  readonly COMPLIANCE: "compliance.exchange";
4
5
  readonly CRM: "crm.exchange";
5
6
  readonly FINANCE: "finance.exchange";
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MESSAGE_CHANNELS = void 0;
4
4
  exports.MESSAGE_CHANNELS = {
5
5
  AI: 'ai.exchange',
6
+ AUTH: 'auth.exchange',
6
7
  COMPLIANCE: 'compliance.exchange',
7
8
  CRM: 'crm.exchange',
8
9
  FINANCE: 'finance.exchange',
@@ -1,5 +1,6 @@
1
1
  export const MESSAGE_CHANNELS = {
2
2
  AI: 'ai.exchange',
3
+ AUTH: 'auth.exchange',
3
4
  COMPLIANCE: 'compliance.exchange',
4
5
  CRM: 'crm.exchange',
5
6
  FINANCE: 'finance.exchange',
@@ -8,6 +8,13 @@ export declare const EVENT_KEYS: {
8
8
  readonly COMPLIANCE_FIND_MATCH_REQUESTED: "ai.compliance.find-match.requested";
9
9
  readonly PORTFOLIO_NOTE_SUMMARY_REQUESTED: "ai.portfolio.note.summary.requested";
10
10
  };
11
+ /**
12
+ * ========= AUTH DOMAIN EVENTS =========
13
+ */
14
+ readonly auth: {
15
+ readonly PASSWORD_RESET_BY_ADMIN_REQUESTED: "auth.password.reset-by-admin.requested";
16
+ readonly PASSWORD_UPDATE_BY_USER_REQUESTED: "auth.password.update-by-user.requested";
17
+ };
11
18
  /**
12
19
  * ========= COMPLIANCE DOMAIN EVENTS =========
13
20
  */
@@ -11,6 +11,13 @@ exports.EVENT_KEYS = {
11
11
  COMPLIANCE_FIND_MATCH_REQUESTED: 'ai.compliance.find-match.requested',
12
12
  PORTFOLIO_NOTE_SUMMARY_REQUESTED: 'ai.portfolio.note.summary.requested',
13
13
  },
14
+ /**
15
+ * ========= AUTH DOMAIN EVENTS =========
16
+ */
17
+ auth: {
18
+ PASSWORD_RESET_BY_ADMIN_REQUESTED: 'auth.password.reset-by-admin.requested',
19
+ PASSWORD_UPDATE_BY_USER_REQUESTED: 'auth.password.update-by-user.requested',
20
+ },
14
21
  /**
15
22
  * ========= COMPLIANCE DOMAIN EVENTS =========
16
23
  */
@@ -9,6 +9,14 @@ export const EVENT_KEYS = {
9
9
  PORTFOLIO_NOTE_SUMMARY_REQUESTED: 'ai.portfolio.note.summary.requested',
10
10
  },
11
11
 
12
+ /**
13
+ * ========= AUTH DOMAIN EVENTS =========
14
+ */
15
+ auth: {
16
+ PASSWORD_RESET_BY_ADMIN_REQUESTED: 'auth.password.reset-by-admin.requested',
17
+ PASSWORD_UPDATE_BY_USER_REQUESTED: 'auth.password.update-by-user.requested',
18
+ },
19
+
12
20
  /**
13
21
  * ========= COMPLIANCE DOMAIN EVENTS =========
14
22
  */
@@ -13,6 +13,12 @@ export declare const QUEUES: {
13
13
  };
14
14
  };
15
15
  };
16
+ readonly auth: {
17
+ readonly password: {
18
+ readonly resetByAdmin: "auth.password.reset-by-admin";
19
+ readonly updateByUser: "auth.password.update-by-user";
20
+ };
21
+ };
16
22
  readonly compliance: {
17
23
  readonly summaryReady: "compliance.summary.ready";
18
24
  readonly findMatchReady: "compliance.find-match.ready";
@@ -16,6 +16,12 @@ exports.QUEUES = {
16
16
  },
17
17
  }
18
18
  },
19
+ auth: {
20
+ password: {
21
+ resetByAdmin: 'auth.password.reset-by-admin',
22
+ updateByUser: 'auth.password.update-by-user',
23
+ }
24
+ },
19
25
  compliance: {
20
26
  summaryReady: 'compliance.summary.ready',
21
27
  findMatchReady: 'compliance.find-match.ready',
@@ -13,6 +13,12 @@ export const QUEUES = {
13
13
  },
14
14
  }
15
15
  },
16
+ auth: {
17
+ password: {
18
+ resetByAdmin: 'auth.password.reset-by-admin',
19
+ updateByUser: 'auth.password.update-by-user',
20
+ }
21
+ },
16
22
  compliance: {
17
23
  summaryReady: 'compliance.summary.ready',
18
24
  findMatchReady: 'compliance.find-match.ready',
@@ -33,6 +33,8 @@ export interface IBankIntegrationTransaction {
33
33
  status: string;
34
34
  rawPayload: string;
35
35
  syncedAt: Date;
36
+ text: string;
37
+ description: string;
36
38
  }
37
39
  export type TBankIntegrationTransactionCreate = Omit<IBankIntegrationTransaction, 'accountId'> & {
38
40
  accountId: string;
@@ -32,6 +32,12 @@ exports.BankIntegrationTransactionSchema = new mongoose_1.default.Schema({
32
32
  rawPayload: {
33
33
  type: String,
34
34
  },
35
+ text: {
36
+ type: String,
37
+ },
38
+ description: {
39
+ type: String,
40
+ },
35
41
  syncedAt: {
36
42
  type: Date,
37
43
  },
@@ -12,6 +12,8 @@ export interface IBankIntegrationTransaction {
12
12
  status: string;
13
13
  rawPayload: string;
14
14
  syncedAt: Date;
15
+ text: string;
16
+ description: string;
15
17
  }
16
18
 
17
19
  export type TBankIntegrationTransactionCreate = Omit<IBankIntegrationTransaction, 'accountId'> & {
@@ -66,6 +68,12 @@ export const BankIntegrationTransactionSchema = new mongoose.Schema<IBankIntegra
66
68
  rawPayload: {
67
69
  type: String,
68
70
  },
71
+ text: {
72
+ type: String,
73
+ },
74
+ description: {
75
+ type: String,
76
+ },
69
77
  syncedAt: {
70
78
  type: Date,
71
79
  },
@@ -22,14 +22,23 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import mongoose, { Document, Model } from 'mongoose';
25
+ import mongoose from 'mongoose';
26
26
  export interface IExternalUserAccess {
27
27
  email: string;
28
28
  hashedPassword: string;
29
29
  }
30
- export interface IExternalUserAccessDoc extends IExternalUserAccess, Document {
30
+ export type IExternalUserAccessDoc = mongoose.HydratedDocument<IExternalUserAccess>;
31
+ export interface IExternalUserAccessLean extends IExternalUserAccess {
32
+ _id: mongoose.Types.ObjectId;
33
+ createdAt: Date;
34
+ updatedAt: Date;
35
+ }
36
+ export interface IExternalUserAccessPlain extends Omit<IExternalUserAccess, 'prospectId'> {
37
+ _id: string;
38
+ createdAt: Date;
39
+ updatedAt: Date;
31
40
  }
32
- export type ExternalUserAccessModel = Model<IExternalUserAccess>;
41
+ export type ExternalUserAccessModel = mongoose.Model<IExternalUserAccess>;
33
42
  export declare const ExternalUserAccessSchema: mongoose.Schema<IExternalUserAccess, ExternalUserAccessModel, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, IExternalUserAccess, mongoose.Document<unknown, {}, mongoose.FlatRecord<IExternalUserAccess>> & mongoose.FlatRecord<IExternalUserAccess> & {
34
43
  _id: mongoose.Types.ObjectId;
35
44
  }>;
@@ -1,4 +1,4 @@
1
- import mongoose, { Document, Model } from 'mongoose';
1
+ import mongoose from 'mongoose';
2
2
 
3
3
  import { MODEL_NAMES } from './_models';
4
4
 
@@ -7,10 +7,21 @@ export interface IExternalUserAccess {
7
7
  hashedPassword: string;
8
8
  }
9
9
 
10
- export interface IExternalUserAccessDoc extends IExternalUserAccess, Document {
10
+ export type IExternalUserAccessDoc = mongoose.HydratedDocument<IExternalUserAccess>;
11
+
12
+ export interface IExternalUserAccessLean extends IExternalUserAccess {
13
+ _id: mongoose.Types.ObjectId;
14
+ createdAt: Date;
15
+ updatedAt: Date;
16
+ }
17
+
18
+ export interface IExternalUserAccessPlain extends Omit<IExternalUserAccess, 'prospectId'> {
19
+ _id: string;
20
+ createdAt: Date;
21
+ updatedAt: Date;
11
22
  }
12
23
 
13
- export type ExternalUserAccessModel = Model<IExternalUserAccess>;
24
+ export type ExternalUserAccessModel = mongoose.Model<IExternalUserAccess>;
14
25
 
15
26
  export const ExternalUserAccessSchema = new mongoose.Schema<IExternalUserAccess, ExternalUserAccessModel>(
16
27
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.252",
3
+ "version": "1.4.254",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,7 @@
1
+ import { TTaskEnvelope } from '../microservice/task-envelope.type';
1
2
  export declare class RabbitService {
2
3
  private connection;
3
4
  private channel;
4
5
  init(): Promise<void>;
5
- publish(exchange: string, routingKey: string, payload: unknown): Promise<void>;
6
+ publish(exchange: string, routingKey: string, payload: TTaskEnvelope<unknown>): void;
6
7
  }
@@ -42,7 +42,7 @@ class RabbitService {
42
42
  this.channel = await this.connection.createChannel();
43
43
  console.log('RabbitMQ connected');
44
44
  }
45
- async publish(exchange, routingKey, payload) {
45
+ publish(exchange, routingKey, payload) {
46
46
  if (!this.channel) {
47
47
  throw new Error('RabbitMQ channel is not initialized');
48
48
  }
@@ -1,5 +1,7 @@
1
1
  import * as amqp from 'amqplib';
2
2
 
3
+ import { TTaskEnvelope } from '../microservice/task-envelope.type';
4
+
3
5
  const { NODE_ENV } = process.env;
4
6
 
5
7
  export class RabbitService {
@@ -25,7 +27,7 @@ export class RabbitService {
25
27
  console.log('RabbitMQ connected');
26
28
  }
27
29
 
28
- async publish(exchange: string, routingKey: string, payload: unknown) {
30
+ publish(exchange: string, routingKey: string, payload: TTaskEnvelope<unknown>) {
29
31
  if (!this.channel) {
30
32
  throw new Error('RabbitMQ channel is not initialized');
31
33
  }