@lucaapp/service-utils 1.55.9 → 1.55.11
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/lib/api/types/http.js +1 -1
- package/dist/lib/email/email.d.ts +3 -2
- package/dist/lib/kafka/events/consumerPushNotification.js +1 -1
- package/dist/lib/kafka/events.js +1 -2
- package/dist/lib/logger/index.d.ts +3 -0
- package/dist/lib/money/money.d.ts +15 -2
- package/dist/lib/serviceIdentity/environment.js +1 -2
- package/dist/lib/serviceIdentity/service.js +1 -2
- package/dist/lib/serviceIdentity/serviceIdentity.d.ts +2 -1
- package/dist/lib/serviceIdentity/serviceIdentity.js +1 -1
- package/package.json +10 -8
|
@@ -18,4 +18,4 @@ var HTTPStatus;
|
|
|
18
18
|
HTTPStatus["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
19
19
|
HTTPStatus["BAD_GATEWAY"] = "BAD_GATEWAY";
|
|
20
20
|
HTTPStatus["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
|
|
21
|
-
})(HTTPStatus
|
|
21
|
+
})(HTTPStatus || (exports.HTTPStatus = HTTPStatus = {}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface EmailInterface {
|
|
2
2
|
compare(comparator: Email): boolean;
|
|
3
3
|
}
|
|
4
|
-
declare class Email implements
|
|
4
|
+
declare class Email implements EmailInterface {
|
|
5
5
|
private readonly email;
|
|
6
6
|
constructor(email: string);
|
|
7
|
+
compare(comparator: Email): boolean;
|
|
7
8
|
}
|
|
8
9
|
export { Email };
|
|
@@ -6,4 +6,4 @@ var NotificationType;
|
|
|
6
6
|
NotificationType["RESERVATION_REMINDER"] = "reservationReminder";
|
|
7
7
|
NotificationType["RESERVATION_RESPONSE"] = "reservationResponse";
|
|
8
8
|
NotificationType["PAYMENT_REFUNDED"] = "paymentRefunded";
|
|
9
|
-
})(NotificationType
|
|
9
|
+
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
package/dist/lib/kafka/events.js
CHANGED
|
@@ -17,8 +17,7 @@ var KafkaTopic;
|
|
|
17
17
|
KafkaTopic["WS_EVENT_backend"] = "wsevent_backend";
|
|
18
18
|
KafkaTopic["WS_EVENT_backend_pay"] = "wsevent_backend-pay";
|
|
19
19
|
KafkaTopic["WS_EVENT_backend_pos"] = "wsevent_backend-pos";
|
|
20
|
-
})(KafkaTopic || (KafkaTopic = {}));
|
|
21
|
-
exports.KafkaTopic = KafkaTopic;
|
|
20
|
+
})(KafkaTopic || (exports.KafkaTopic = KafkaTopic = {}));
|
|
22
21
|
const MessageIssuer = {
|
|
23
22
|
[KafkaTopic.PAYMENTS]: serviceIdentity_1.Service.BACKEND_PAY,
|
|
24
23
|
[KafkaTopic.CONSUMERS]: serviceIdentity_1.Service.BACKEND,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Model } from 'sequelize';
|
|
2
|
-
interface
|
|
2
|
+
interface MoneyInterface {
|
|
3
3
|
getAmount(): number;
|
|
4
4
|
add(addend?: Money): Money;
|
|
5
5
|
subtract(subtrahend?: Money): Money;
|
|
@@ -14,20 +14,33 @@ interface Money {
|
|
|
14
14
|
isPositive(): boolean;
|
|
15
15
|
isNegative(): boolean;
|
|
16
16
|
}
|
|
17
|
-
declare class Money implements
|
|
17
|
+
declare class Money implements MoneyInterface {
|
|
18
18
|
private readonly value;
|
|
19
19
|
static fromAmount(value: number): Money;
|
|
20
20
|
static fromFloat(value: number): Money;
|
|
21
21
|
static zero(): Money;
|
|
22
22
|
private constructor();
|
|
23
23
|
clone(): Money;
|
|
24
|
+
getAmount(): number;
|
|
24
25
|
getEuroAmount(): number;
|
|
25
26
|
/**
|
|
26
27
|
* @deprecated Use getFormattedString in place of getEuroString
|
|
27
28
|
*/
|
|
28
29
|
getEuroString(): string;
|
|
29
30
|
getFormattedString(locale: string, includeSymbol?: boolean): string;
|
|
31
|
+
add(addend?: Money | null): Money;
|
|
32
|
+
subtract(subtrahend?: Money | null): Money;
|
|
33
|
+
multiply(multiplier: number): Money;
|
|
34
|
+
divide(divisor: number): Money;
|
|
30
35
|
percentage(percentage: number): Money;
|
|
36
|
+
equalsTo(comparator: Money): boolean;
|
|
37
|
+
lessThan(comparator: Money): boolean;
|
|
38
|
+
lessThanOrEqual(comparator: Money): boolean;
|
|
39
|
+
greaterThan(comparator: Money): boolean;
|
|
40
|
+
greaterThanOrEqual(comparator: Money): boolean;
|
|
41
|
+
isZero(): boolean;
|
|
42
|
+
isPositive(): boolean;
|
|
43
|
+
isNegative(): boolean;
|
|
31
44
|
min(comparator: Money): Money;
|
|
32
45
|
max(comparator: Money): Money;
|
|
33
46
|
}
|
|
@@ -10,5 +10,4 @@ var Service;
|
|
|
10
10
|
Service["BACKEND_ATTESTATION"] = "backend-attestation";
|
|
11
11
|
Service["BACKEND_PUBSUB"] = "backend-pubsub";
|
|
12
12
|
Service["BACKEND_AI"] = "backend-ai";
|
|
13
|
-
})(Service || (Service = {}));
|
|
14
|
-
exports.Service = Service;
|
|
13
|
+
})(Service || (exports.Service = Service = {}));
|
|
@@ -6,6 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
type JWKS = {
|
|
7
7
|
keys: jose.JWK[];
|
|
8
8
|
};
|
|
9
|
+
type RemoteJWKS = ReturnType<typeof jose.createRemoteJWKSet>;
|
|
9
10
|
export declare enum ServiceIdentityErrorType {
|
|
10
11
|
NO_JWT_PROVIDED = "SERVICE_IDENTITY_NO_JWT_PROVIDED",
|
|
11
12
|
URL_MISMATCH = "SERVICE_IDENTITY_URL_MISMATCH",
|
|
@@ -25,7 +26,7 @@ declare class ServiceIdentity {
|
|
|
25
26
|
private readonly keyCache;
|
|
26
27
|
private readonly axiosClient;
|
|
27
28
|
constructor(identityName: string, identityKid: string, identityPrivateKey: string, identityPublicKey: string, debug?: boolean);
|
|
28
|
-
getRemoteJWKS: (service: string) =>
|
|
29
|
+
getRemoteJWKS: (service: string) => RemoteJWKS;
|
|
29
30
|
private getJwtVerifyOptions;
|
|
30
31
|
getIdentityPublicKey: () => Promise<jose.KeyLike>;
|
|
31
32
|
getIdentityPrivateKey: () => Promise<jose.KeyLike>;
|
|
@@ -47,7 +47,7 @@ var ServiceIdentityErrorType;
|
|
|
47
47
|
ServiceIdentityErrorType["NO_JWT_PROVIDED"] = "SERVICE_IDENTITY_NO_JWT_PROVIDED";
|
|
48
48
|
ServiceIdentityErrorType["URL_MISMATCH"] = "SERVICE_IDENTITY_URL_MISMATCH";
|
|
49
49
|
ServiceIdentityErrorType["METHOD_MISMATCH"] = "SERVICE_IDENTITY_METHOD_MISMATCH";
|
|
50
|
-
})(ServiceIdentityErrorType
|
|
50
|
+
})(ServiceIdentityErrorType || (exports.ServiceIdentityErrorType = ServiceIdentityErrorType = {}));
|
|
51
51
|
class ServiceIdentityError extends Error {
|
|
52
52
|
constructor(type, message, meta) {
|
|
53
53
|
super(message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucaapp/service-utils",
|
|
3
|
-
"version": "1.55.
|
|
3
|
+
"version": "1.55.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,15 +21,16 @@
|
|
|
21
21
|
"@asteasolutions/zod-to-openapi": "6.1.0",
|
|
22
22
|
"@hapi/boom": "^10.0.0",
|
|
23
23
|
"@tsconfig/node18": "1.0.1",
|
|
24
|
-
"@types/express": "4.17.
|
|
24
|
+
"@types/express": "4.17.21",
|
|
25
|
+
"@types/express-serve-static-core": "4.17.43",
|
|
25
26
|
"@types/node": "18.18.2",
|
|
26
27
|
"@types/response-time": "^2.3.5",
|
|
27
28
|
"@types/swagger-ui-express": "4.1.3",
|
|
28
29
|
"axios": "^1.6.0",
|
|
29
30
|
"cls-rtracer": "^2.6.2",
|
|
30
|
-
"express": "4.18.
|
|
31
|
+
"express": "4.18.3",
|
|
31
32
|
"express-async-errors": "3.1.1",
|
|
32
|
-
"jose": "4.
|
|
33
|
+
"jose": "4.15.5",
|
|
33
34
|
"kafkajs": "2.1.0",
|
|
34
35
|
"libphonenumber-js": "1.9.44",
|
|
35
36
|
"lodash": "^4.17.21",
|
|
@@ -46,14 +47,15 @@
|
|
|
46
47
|
"zod": "3.22.3"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@types/express": "4.17.
|
|
50
|
+
"@types/express": "4.17.21",
|
|
51
|
+
"@types/express-serve-static-core": "4.17.43",
|
|
50
52
|
"@types/lodash": "^4.14.187",
|
|
51
53
|
"@types/negotiator": "^0.6.1",
|
|
52
54
|
"@types/pino-http": "5.8.4",
|
|
53
55
|
"@types/supertest": "2.0.11",
|
|
54
56
|
"@types/uuid": "^8.3.4",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
56
|
-
"@typescript-eslint/parser": "^
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
|
58
|
+
"@typescript-eslint/parser": "^7.1.1",
|
|
57
59
|
"@vitest/coverage-v8": "0.32.0",
|
|
58
60
|
"@vitest/ui": "0.32.0",
|
|
59
61
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
"semantic-release": "^19.0.3",
|
|
66
68
|
"semantic-release-monorepo": "^7.0.5",
|
|
67
69
|
"supertest": "^6.3.3",
|
|
68
|
-
"typescript": "
|
|
70
|
+
"typescript": "5.3.3",
|
|
69
71
|
"vite-tsconfig-paths": "4.0.5"
|
|
70
72
|
},
|
|
71
73
|
"resolutions": {
|