@lucaapp/service-utils 1.20.0 → 1.22.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,4 +1,4 @@
1
- declare type Consumer = {
1
+ type Consumer = {
2
2
  uuid: string;
3
3
  username: string;
4
4
  createdAt: Date;
@@ -0,0 +1,7 @@
1
+ type Location = {
2
+ uuid: string;
3
+ groupId: string;
4
+ createdAt: Date;
5
+ updatedAt: Date;
6
+ };
7
+ export type { Location };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- declare type LocationGroup = {
1
+ type LocationGroup = {
2
2
  uuid: string;
3
3
  operatorId: string;
4
4
  createdAt: Date;
@@ -1,4 +1,4 @@
1
- declare type LocationGroupEmployees = {
1
+ type LocationGroupEmployees = {
2
2
  uuid: string;
3
3
  firstName: string;
4
4
  lastName: string | null;
@@ -1,4 +1,4 @@
1
- declare type Operator = {
1
+ type Operator = {
2
2
  uuid: string;
3
3
  firstName: string;
4
4
  lastName: string;
@@ -13,6 +13,5 @@ declare type Operator = {
13
13
  businessEntityCity: string | null;
14
14
  createdAt: Date;
15
15
  updatedAt: Date;
16
- deletedAt: Date | null;
17
16
  };
18
17
  export type { Operator };
@@ -1,4 +1,4 @@
1
- declare type Payment = {
1
+ type Payment = {
2
2
  uuid: string;
3
3
  locationId: string;
4
4
  locationName: string | null;
@@ -1,4 +1,4 @@
1
- declare type WsEvent = {
1
+ type WsEvent = {
2
2
  subId: string;
3
3
  type: string;
4
4
  data: any;
@@ -5,20 +5,23 @@ import type { LocationGroupEmployees } from './events/locationGroupEmployees';
5
5
  import type { WsEvent } from './events/wsEvent';
6
6
  import { Service } from '../serviceIdentity';
7
7
  import { LocationGroup } from './events/locationGroup';
8
+ import { Location } from './events/location';
8
9
  declare enum KafkaTopic {
9
10
  PAYMENTS = "payments",
10
11
  CONSUMERS = "consumers",
11
12
  OPERATORS = "operators",
13
+ LOCATIONS = "locations",
12
14
  LOCATION_GROUPS = "location_groups",
13
15
  LOCATION_GROUP_EMPLOYEES = "location_group_employees",
14
16
  WS_EVENT_backend = "wsevent_backend",
15
17
  WS_EVENT_backend_pay = "wsevent_backend-pay",
16
18
  WS_EVENT_backend_pos = "wsevent_backend-pos"
17
19
  }
18
- declare type MessageFormats = {
20
+ type MessageFormats = {
19
21
  [KafkaTopic.PAYMENTS]: Payment;
20
22
  [KafkaTopic.CONSUMERS]: Consumer;
21
23
  [KafkaTopic.OPERATORS]: Operator;
24
+ [KafkaTopic.LOCATIONS]: Location;
22
25
  [KafkaTopic.LOCATION_GROUPS]: LocationGroup;
23
26
  [KafkaTopic.LOCATION_GROUP_EMPLOYEES]: LocationGroupEmployees;
24
27
  [KafkaTopic.WS_EVENT_backend]: WsEvent;
@@ -29,6 +32,7 @@ declare const MessageIssuer: {
29
32
  payments: Service;
30
33
  consumers: Service;
31
34
  operators: Service;
35
+ locations: Service;
32
36
  location_groups: Service;
33
37
  location_group_employees: Service;
34
38
  wsevent_backend: Service;
@@ -7,6 +7,7 @@ var KafkaTopic;
7
7
  KafkaTopic["PAYMENTS"] = "payments";
8
8
  KafkaTopic["CONSUMERS"] = "consumers";
9
9
  KafkaTopic["OPERATORS"] = "operators";
10
+ KafkaTopic["LOCATIONS"] = "locations";
10
11
  KafkaTopic["LOCATION_GROUPS"] = "location_groups";
11
12
  KafkaTopic["LOCATION_GROUP_EMPLOYEES"] = "location_group_employees";
12
13
  KafkaTopic["WS_EVENT_backend"] = "wsevent_backend";
@@ -18,6 +19,7 @@ const MessageIssuer = {
18
19
  [KafkaTopic.PAYMENTS]: serviceIdentity_1.Service.BACKEND_PAY,
19
20
  [KafkaTopic.CONSUMERS]: serviceIdentity_1.Service.BACKEND,
20
21
  [KafkaTopic.OPERATORS]: serviceIdentity_1.Service.BACKEND,
22
+ [KafkaTopic.LOCATIONS]: serviceIdentity_1.Service.BACKEND,
21
23
  [KafkaTopic.LOCATION_GROUPS]: serviceIdentity_1.Service.BACKEND,
22
24
  [KafkaTopic.LOCATION_GROUP_EMPLOYEES]: serviceIdentity_1.Service.BACKEND,
23
25
  [KafkaTopic.WS_EVENT_backend]: serviceIdentity_1.Service.BACKEND,
@@ -1,12 +1,12 @@
1
1
  import { KafkaTopic, MessageFormats } from './events';
2
2
  import { Environment } from '../serviceIdentity';
3
3
  import { KafkaMessage } from 'kafkajs';
4
- declare type KafkaEvent<T extends KafkaTopic> = {
4
+ type KafkaEvent<T extends KafkaTopic> = {
5
5
  id: string;
6
- type: 'create' | 'update' | 'destroy';
6
+ type: 'create' | 'update' | 'soft-destroy' | 'destroy';
7
7
  entity: MessageFormats[T];
8
8
  };
9
- declare type KafkaConfiguration = {
9
+ type KafkaConfiguration = {
10
10
  environment: Environment;
11
11
  broker: string;
12
12
  clientId: string;
@@ -14,7 +14,7 @@ declare type KafkaConfiguration = {
14
14
  password?: string;
15
15
  ssl?: boolean;
16
16
  };
17
- declare type EventPayloadHandler<T extends KafkaTopic> = (message: Omit<KafkaMessage, 'value'> & {
17
+ type EventPayloadHandler<T extends KafkaTopic> = (message: Omit<KafkaMessage, 'value'> & {
18
18
  value: KafkaEvent<T>;
19
19
  }) => Promise<void>;
20
20
  export type { KafkaEvent, KafkaConfiguration, EventPayloadHandler, };
@@ -2,7 +2,7 @@ import * as jose from 'jose';
2
2
  import { HttpMethod } from 'types/http';
3
3
  import { Request, RequestHandler } from 'express';
4
4
  import { Service } from './service';
5
- declare type JWKS = {
5
+ type JWKS = {
6
6
  keys: jose.JWK[];
7
7
  };
8
8
  declare class ServiceIdentity {
@@ -1 +1 @@
1
- export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'PATCH' | 'OPTIONS' | 'TRACE' | 'CONNECT';
1
+ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'PATCH' | 'OPTIONS' | 'TRACE' | 'CONNECT';
@@ -1,4 +1,4 @@
1
- export declare type Literal = boolean | null | number | string;
2
- export declare type Json = Literal | {
1
+ export type Literal = boolean | null | number | string;
2
+ export type Json = Literal | {
3
3
  [key: string]: Json;
4
4
  } | Json[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [