@mojaloop/central-services-shared 18.35.2 → 18.35.5
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/.circleci/config.yml +1 -1
- package/.grype.yaml +16 -35
- package/.nvmrc +1 -1
- package/CHANGELOG.md +21 -0
- package/audit-ci.jsonc +2 -1
- package/package.json +16 -15
- package/src/index.d.ts +185 -14
- package/src/util/endpoints.js +3 -0
package/.circleci/config.yml
CHANGED
package/.grype.yaml
CHANGED
|
@@ -1,40 +1,21 @@
|
|
|
1
|
-
# Grype vulnerability scanning configuration for central-services-shared
|
|
2
|
-
# This is a library project without Docker images, so we use source scanning
|
|
3
1
|
scan-type: source
|
|
4
|
-
|
|
5
|
-
# Enable vulnerability scanning
|
|
6
2
|
disabled: false
|
|
7
|
-
|
|
8
|
-
# Vulnerability ignore rules
|
|
9
|
-
# Add specific CVEs here if they are false positives or acceptable risks
|
|
10
3
|
ignore:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# version: "1.0.0"
|
|
18
|
-
# reason: "Not exploitable in our usage context"
|
|
19
|
-
|
|
20
|
-
# Output formats for scan results
|
|
4
|
+
- vulnerability: GHSA-2g4f-4pwh-qvx6
|
|
5
|
+
include-aliases: true
|
|
6
|
+
reason: "Unfixable npm transitive vulnerability: ajv ReDoS (moderate) as of 2026-02-19"
|
|
7
|
+
- vulnerability: GHSA-3ppc-4f35-3m26
|
|
8
|
+
include-aliases: true
|
|
9
|
+
reason: "Unfixable npm transitive vulnerability: minimatch ReDoS - fix requires v10 major version break as of 2026-02-19"
|
|
21
10
|
output:
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
add-cpes-if-none: false # Don't add CPEs if none are found
|
|
30
|
-
by-cve: false # Group by vulnerability rather than CVE
|
|
31
|
-
|
|
32
|
-
# Database settings
|
|
11
|
+
- table
|
|
12
|
+
- json
|
|
13
|
+
quiet: false
|
|
14
|
+
check-for-app-update: false
|
|
15
|
+
only-fixed: false
|
|
16
|
+
add-cpes-if-none: false
|
|
17
|
+
by-cve: false
|
|
33
18
|
db:
|
|
34
|
-
auto-update: true
|
|
35
|
-
validate-age: true
|
|
36
|
-
max-allowed-built-age: 120h
|
|
37
|
-
|
|
38
|
-
# Severity thresholds (handled by the orb, but documented here for clarity)
|
|
39
|
-
# The build will fail on Critical, High, or Medium severity vulnerabilities
|
|
40
|
-
# Low and Negligible severities are reported but won't fail the build
|
|
19
|
+
auto-update: true
|
|
20
|
+
validate-age: true
|
|
21
|
+
max-allowed-built-age: 120h
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
22.
|
|
1
|
+
22.22.0
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [18.35.5](https://github.com/mojaloop/central-services-shared/compare/v18.35.4...v18.35.5) (2026-02-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Chore
|
|
9
|
+
|
|
10
|
+
* update orb and dep ver ([#509](https://github.com/mojaloop/central-services-shared/issues/509)) ([7293cff](https://github.com/mojaloop/central-services-shared/commit/7293cffea15145d115b25625eb4352ceb651bb35))
|
|
11
|
+
|
|
12
|
+
### [18.35.4](https://github.com/mojaloop/central-services-shared/compare/v18.35.3...v18.35.4) (2026-02-19)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Chore
|
|
16
|
+
|
|
17
|
+
* update dependencies, node.js 22.22.0, and security patches ([#508](https://github.com/mojaloop/central-services-shared/issues/508)) ([51281d8](https://github.com/mojaloop/central-services-shared/commit/51281d8eaaa8b9da53214f2b6543d1aef165a682))
|
|
18
|
+
|
|
19
|
+
### [18.35.3](https://github.com/mojaloop/central-services-shared/compare/v18.35.2...v18.35.3) (2026-02-06)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Chore
|
|
23
|
+
|
|
24
|
+
* extend type definitions ([#503](https://github.com/mojaloop/central-services-shared/issues/503)) ([82b9820](https://github.com/mojaloop/central-services-shared/commit/82b9820f8df7221397e8cd3cff53ea0df9cf0042))
|
|
25
|
+
|
|
5
26
|
### [18.35.2](https://github.com/mojaloop/central-services-shared/compare/v18.35.1...v18.35.2) (2026-01-28)
|
|
6
27
|
|
|
7
28
|
|
package/audit-ci.jsonc
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// Only use one of ["low": true, "moderate": true, "high": true, "critical": true]
|
|
5
5
|
"moderate": true,
|
|
6
6
|
"allowlist": [ // NOTE: Please add as much information as possible to any items added to the allowList
|
|
7
|
-
|
|
7
|
+
"GHSA-2g4f-4pwh-qvx6",
|
|
8
|
+
"GHSA-3ppc-4f35-3m26" // minimatch ReDoS - fix requires v10 (major version break), unfixable via override
|
|
8
9
|
]
|
|
9
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/central-services-shared",
|
|
3
|
-
"version": "18.35.
|
|
3
|
+
"version": "18.35.5",
|
|
4
4
|
"description": "Shared code for mojaloop central services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "ModusBox",
|
|
@@ -67,16 +67,16 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@hapi/catbox": "12.1.1",
|
|
69
69
|
"@hapi/catbox-memory": "5.0.1",
|
|
70
|
-
"@hapi/hapi": "21.4.
|
|
70
|
+
"@hapi/hapi": "21.4.6",
|
|
71
71
|
"@hapi/joi-date": "2.0.1",
|
|
72
72
|
"@mojaloop/inter-scheme-proxy-cache-lib": "2.9.0",
|
|
73
73
|
"@opentelemetry/api": "1.9.0",
|
|
74
74
|
"async-exit-hook": "2.0.1",
|
|
75
75
|
"async-retry": "1.3.3",
|
|
76
|
-
"axios": "1.13.
|
|
76
|
+
"axios": "1.13.5",
|
|
77
77
|
"clone": "2.1.2",
|
|
78
78
|
"convict": "^6.2.4",
|
|
79
|
-
"dotenv": "17.
|
|
79
|
+
"dotenv": "17.3.1",
|
|
80
80
|
"env-var": "7.5.0",
|
|
81
81
|
"event-stream": "4.0.1",
|
|
82
82
|
"fast-safe-stringify": "2.1.1",
|
|
@@ -96,20 +96,20 @@
|
|
|
96
96
|
"yaml": "2.8.2"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@mojaloop/central-services-error-handling": "13.1.
|
|
100
|
-
"@mojaloop/central-services-logger": "11.10.
|
|
101
|
-
"@mojaloop/central-services-metrics": "12.8.
|
|
102
|
-
"@mojaloop/event-sdk": "14.8.
|
|
103
|
-
"@mojaloop/sdk-standard-components": "19.18.
|
|
104
|
-
"@opentelemetry/auto-instrumentations-node": "^0.
|
|
99
|
+
"@mojaloop/central-services-error-handling": "13.1.6",
|
|
100
|
+
"@mojaloop/central-services-logger": "11.10.4",
|
|
101
|
+
"@mojaloop/central-services-metrics": "12.8.5",
|
|
102
|
+
"@mojaloop/event-sdk": "14.8.3",
|
|
103
|
+
"@mojaloop/sdk-standard-components": "19.18.7",
|
|
104
|
+
"@opentelemetry/auto-instrumentations-node": "^0.70.0",
|
|
105
105
|
"@types/hapi__joi": "17.1.15",
|
|
106
|
-
"ajv": "
|
|
106
|
+
"ajv": "8.18.0",
|
|
107
107
|
"ajv-formats": "^3.0.1",
|
|
108
108
|
"ajv-keywords": "^5.1.0",
|
|
109
109
|
"audit-ci": "7.1.0",
|
|
110
110
|
"base64url": "3.0.1",
|
|
111
111
|
"chance": "1.1.13",
|
|
112
|
-
"npm-check-updates": "19.
|
|
112
|
+
"npm-check-updates": "19.4.1",
|
|
113
113
|
"nyc": "17.1.0",
|
|
114
114
|
"portfinder": "1.0.38",
|
|
115
115
|
"pre-commit": "1.2.2",
|
|
@@ -125,10 +125,10 @@
|
|
|
125
125
|
"tapes": "4.1.0"
|
|
126
126
|
},
|
|
127
127
|
"overrides": {
|
|
128
|
-
"axios": "1.13.
|
|
129
|
-
"qs": "6.14.
|
|
128
|
+
"axios": "1.13.5",
|
|
129
|
+
"qs": "6.14.2",
|
|
130
130
|
"brace-expansion": "2.0.2",
|
|
131
|
-
"form-data": "4.0.
|
|
131
|
+
"form-data": "4.0.5",
|
|
132
132
|
"nanoid": "5.1.5",
|
|
133
133
|
"postcss": {
|
|
134
134
|
"nanoid": "5.1.5"
|
|
@@ -145,6 +145,7 @@
|
|
|
145
145
|
"swagger2openapi": "7.0.8"
|
|
146
146
|
},
|
|
147
147
|
"markdown-it": "12.3.2",
|
|
148
|
+
"fast-xml-parser": "5.3.6",
|
|
148
149
|
"trim": "0.0.3",
|
|
149
150
|
"cross-spawn": "7.0.6",
|
|
150
151
|
"yargs-parser": "21.1.1",
|
package/src/index.d.ts
CHANGED
|
@@ -366,7 +366,7 @@ declare namespace CentralServicesShared {
|
|
|
366
366
|
|
|
367
367
|
enum TransferInternalStateEnum {
|
|
368
368
|
ABORTED_ERROR = 'ABORTED_ERROR',
|
|
369
|
-
ABORTED_REJECTED= 'ABORTED_REJECTED',
|
|
369
|
+
ABORTED_REJECTED = 'ABORTED_REJECTED',
|
|
370
370
|
COMMITTED = 'COMMITTED',
|
|
371
371
|
EXPIRED_PREPARED = 'EXPIRED_PREPARED',
|
|
372
372
|
EXPIRED_RESERVED = 'EXPIRED_RESERVED',
|
|
@@ -443,6 +443,56 @@ declare namespace CentralServicesShared {
|
|
|
443
443
|
LIMIT_ADJUSTMENT = 'limit-adjustment'
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
+
enum LedgerAccountTypeEnum {
|
|
447
|
+
POSITION = 1,
|
|
448
|
+
SETTLEMENT = 2,
|
|
449
|
+
HUB_RECONCILIATION = 3,
|
|
450
|
+
HUB_MULTILATERAL_SETTLEMENT = 4,
|
|
451
|
+
HUB_FEE = 5,
|
|
452
|
+
POSITION_REMITTANCE = 7,
|
|
453
|
+
SETTLEMENT_REMITTANCE = 8
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
enum LedgerEntryTypeEnum {
|
|
457
|
+
PRINCIPLE_VALUE = 1,
|
|
458
|
+
INTERCHANGE_FEE = 2,
|
|
459
|
+
HUB_FEE = 3,
|
|
460
|
+
POSITION_DEPOSIT = 4,
|
|
461
|
+
POSITION_WITHDRAWAL = 5,
|
|
462
|
+
SETTLEMENT_NET_RECIPIENT = 6,
|
|
463
|
+
SETTLEMENT_NET_SENDER = 7,
|
|
464
|
+
SETTLEMENT_NET_ZERO = 8,
|
|
465
|
+
SETTLEMENT_ACCOUNT_DEPOSIT = 9,
|
|
466
|
+
SETTLEMENT_ACCOUNT_WITHDRAWAL = 10
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
enum ParticipantLimitTypeEnum {
|
|
470
|
+
NET_DEBIT_CAP = 1
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
enum TransferParticipantRoleTypeEnum {
|
|
474
|
+
PAYER_DFSP = 1,
|
|
475
|
+
PAYEE_DFSP = 2,
|
|
476
|
+
HUB = 3,
|
|
477
|
+
DFSP_SETTLEMENT = 4,
|
|
478
|
+
DFSP_POSITION = 5,
|
|
479
|
+
INITIATING_FSP = 6,
|
|
480
|
+
COUNTER_PARTY_FSP = 7
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
enum PartyTypeEnum {
|
|
484
|
+
MSISDN = 'MSISDN',
|
|
485
|
+
EMAIL = 'EMAIL',
|
|
486
|
+
PERSONAL_ID = 'PERSONAL_ID',
|
|
487
|
+
BUSINESS = 'BUSINESS',
|
|
488
|
+
DEVICE = 'DEVICE',
|
|
489
|
+
ACCOUNT_ID = 'ACCOUNT_ID',
|
|
490
|
+
IBAN = 'IBAN',
|
|
491
|
+
ALIAS = 'ALIAS',
|
|
492
|
+
CONSENT = 'CONSENT',
|
|
493
|
+
THIRD_PARTY_LINK = 'THIRD_PARTY_LINK'
|
|
494
|
+
}
|
|
495
|
+
|
|
446
496
|
interface Enum {
|
|
447
497
|
Http: HttpEnum;
|
|
448
498
|
EndPoints: EndPointsEnum;
|
|
@@ -451,8 +501,18 @@ declare namespace CentralServicesShared {
|
|
|
451
501
|
CONSUMER: string,
|
|
452
502
|
PRODUCER: string,
|
|
453
503
|
}
|
|
504
|
+
Topics: {
|
|
505
|
+
NOTIFICATION: string;
|
|
506
|
+
POSITION: string;
|
|
507
|
+
TRANSFER: string;
|
|
508
|
+
[key: string]: string;
|
|
509
|
+
}
|
|
454
510
|
}
|
|
455
511
|
Events: {
|
|
512
|
+
EventStatus: {
|
|
513
|
+
FAILURE: { status: string };
|
|
514
|
+
SUCCESS: { status: string };
|
|
515
|
+
};
|
|
456
516
|
Event: {
|
|
457
517
|
Action: {
|
|
458
518
|
ABORT: EventActionEnum.ABORT;
|
|
@@ -628,6 +688,53 @@ declare namespace CentralServicesShared {
|
|
|
628
688
|
LIMIT_ADJUSTMENT: AdminNotificationActionsEnum.LIMIT_ADJUSTMENT;
|
|
629
689
|
};
|
|
630
690
|
};
|
|
691
|
+
Accounts: {
|
|
692
|
+
LedgerAccountType: {
|
|
693
|
+
POSITION: LedgerAccountTypeEnum.POSITION;
|
|
694
|
+
SETTLEMENT: LedgerAccountTypeEnum.SETTLEMENT;
|
|
695
|
+
HUB_RECONCILIATION: LedgerAccountTypeEnum.HUB_RECONCILIATION;
|
|
696
|
+
HUB_MULTILATERAL_SETTLEMENT: LedgerAccountTypeEnum.HUB_MULTILATERAL_SETTLEMENT;
|
|
697
|
+
HUB_FEE: LedgerAccountTypeEnum.HUB_FEE;
|
|
698
|
+
POSITION_REMITTANCE: LedgerAccountTypeEnum.POSITION_REMITTANCE;
|
|
699
|
+
SETTLEMENT_REMITTANCE: LedgerAccountTypeEnum.SETTLEMENT_REMITTANCE;
|
|
700
|
+
};
|
|
701
|
+
LedgerEntryType: {
|
|
702
|
+
PRINCIPLE_VALUE: LedgerEntryTypeEnum.PRINCIPLE_VALUE;
|
|
703
|
+
INTERCHANGE_FEE: LedgerEntryTypeEnum.INTERCHANGE_FEE;
|
|
704
|
+
HUB_FEE: LedgerEntryTypeEnum.HUB_FEE;
|
|
705
|
+
POSITION_DEPOSIT: LedgerEntryTypeEnum.POSITION_DEPOSIT;
|
|
706
|
+
POSITION_WITHDRAWAL: LedgerEntryTypeEnum.POSITION_WITHDRAWAL;
|
|
707
|
+
SETTLEMENT_NET_RECIPIENT: LedgerEntryTypeEnum.SETTLEMENT_NET_RECIPIENT;
|
|
708
|
+
SETTLEMENT_NET_SENDER: LedgerEntryTypeEnum.SETTLEMENT_NET_SENDER;
|
|
709
|
+
SETTLEMENT_NET_ZERO: LedgerEntryTypeEnum.SETTLEMENT_NET_ZERO;
|
|
710
|
+
SETTLEMENT_ACCOUNT_DEPOSIT: LedgerEntryTypeEnum.SETTLEMENT_ACCOUNT_DEPOSIT;
|
|
711
|
+
SETTLEMENT_ACCOUNT_WITHDRAWAL: LedgerEntryTypeEnum.SETTLEMENT_ACCOUNT_WITHDRAWAL;
|
|
712
|
+
};
|
|
713
|
+
ParticipantLimitType: {
|
|
714
|
+
NET_DEBIT_CAP: ParticipantLimitTypeEnum.NET_DEBIT_CAP;
|
|
715
|
+
};
|
|
716
|
+
TransferParticipantRoleType: {
|
|
717
|
+
PAYER_DFSP: TransferParticipantRoleTypeEnum.PAYER_DFSP;
|
|
718
|
+
PAYEE_DFSP: TransferParticipantRoleTypeEnum.PAYEE_DFSP;
|
|
719
|
+
HUB: TransferParticipantRoleTypeEnum.HUB;
|
|
720
|
+
DFSP_SETTLEMENT: TransferParticipantRoleTypeEnum.DFSP_SETTLEMENT;
|
|
721
|
+
DFSP_POSITION: TransferParticipantRoleTypeEnum.DFSP_POSITION;
|
|
722
|
+
INITIATING_FSP: TransferParticipantRoleTypeEnum.INITIATING_FSP;
|
|
723
|
+
COUNTER_PARTY_FSP: TransferParticipantRoleTypeEnum.COUNTER_PARTY_FSP;
|
|
724
|
+
};
|
|
725
|
+
PartyTypes: {
|
|
726
|
+
MSISDN: PartyTypeEnum.MSISDN;
|
|
727
|
+
EMAIL: PartyTypeEnum.EMAIL;
|
|
728
|
+
PERSONAL_ID: PartyTypeEnum.PERSONAL_ID;
|
|
729
|
+
BUSINESS: PartyTypeEnum.BUSINESS;
|
|
730
|
+
DEVICE: PartyTypeEnum.DEVICE;
|
|
731
|
+
ACCOUNT_ID: PartyTypeEnum.ACCOUNT_ID;
|
|
732
|
+
IBAN: PartyTypeEnum.IBAN;
|
|
733
|
+
ALIAS: PartyTypeEnum.ALIAS;
|
|
734
|
+
CONSENT: PartyTypeEnum.CONSENT;
|
|
735
|
+
THIRD_PARTY_LINK: PartyTypeEnum.THIRD_PARTY_LINK;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
631
738
|
}
|
|
632
739
|
|
|
633
740
|
interface Cacheable {
|
|
@@ -662,13 +769,18 @@ declare namespace CentralServicesShared {
|
|
|
662
769
|
}
|
|
663
770
|
|
|
664
771
|
interface Kafka {
|
|
665
|
-
createGeneralTopicConf(template: string, functionality: string, action: string, key?: string, partition?: number, opaqueKey?: any, topicNameOverride?: string): {topicName: string, key: string | null, partition: number | null, opaqueKey: any }
|
|
772
|
+
createGeneralTopicConf(template: string, functionality: string, action: string, key?: string, partition?: number, opaqueKey?: any, topicNameOverride?: string): { topicName: string, key: string | null, partition: number | null, opaqueKey: any }
|
|
773
|
+
transformGeneralTopicName(template: string, functionality: string, action: string): string
|
|
774
|
+
getKafkaConfig(kafkaConfig: object, flow: string, functionality: string, action: string): object
|
|
666
775
|
}
|
|
667
776
|
|
|
668
777
|
type MimeTypes = 'text/plain' | 'application/json' | 'application/vnd.interoperability.'
|
|
669
778
|
interface StreamingProtocol {
|
|
670
779
|
decodePayload(input: string, options: Object): Object
|
|
671
780
|
encodePayload(input: string | Buffer, mimeType: MimeTypes): string
|
|
781
|
+
createEventState(status: string, errorCode: string, errorDescription: string): any
|
|
782
|
+
createMetadataWithCorrelatedEvent(transferId: string, topic: string, action: string, state: any): any
|
|
783
|
+
createMessage(id: string, destination: string, source: string, metadata: any, headers: any, payload: any, uriParams: any, contentType: string): any
|
|
672
784
|
}
|
|
673
785
|
|
|
674
786
|
interface HeaderValidation {
|
|
@@ -686,8 +798,8 @@ declare namespace CentralServicesShared {
|
|
|
686
798
|
type ProtocolVersions = (string | symbol)[]
|
|
687
799
|
type ApiTypeValues = 'fspiop' | 'iso20022'
|
|
688
800
|
type APIDocumentationPluginOptions =
|
|
689
|
-
|
|
690
|
-
|
|
801
|
+
| { documentPath: string; document?: never }
|
|
802
|
+
| { document?: string; documentPath?: never }
|
|
691
803
|
|
|
692
804
|
type LoggingPluginOptions = {
|
|
693
805
|
log?: ILogger,
|
|
@@ -759,7 +871,7 @@ declare namespace CentralServicesShared {
|
|
|
759
871
|
|
|
760
872
|
interface PubSub {
|
|
761
873
|
(config: object, publisherClient?: IORedis, subscriberClient?: IORedis): PubSub;
|
|
762
|
-
new
|
|
874
|
+
new(config: object, publisherClient?: IORedis, subscriberClient?: IORedis): PubSub;
|
|
763
875
|
connect(): Promise<void>;
|
|
764
876
|
disconnect(): Promise<boolean>;
|
|
765
877
|
healthCheck(): Promise<boolean>;
|
|
@@ -772,7 +884,7 @@ declare namespace CentralServicesShared {
|
|
|
772
884
|
|
|
773
885
|
interface RedisCache {
|
|
774
886
|
(config: object, client?: IORedis): RedisCache;
|
|
775
|
-
new
|
|
887
|
+
new(config: object, client?: IORedis): RedisCache;
|
|
776
888
|
connect(): Promise<boolean>;
|
|
777
889
|
disconnect(): Promise<boolean>;
|
|
778
890
|
healthCheck(): Promise<boolean>;
|
|
@@ -788,16 +900,16 @@ declare namespace CentralServicesShared {
|
|
|
788
900
|
RedisCache: RedisCache;
|
|
789
901
|
}
|
|
790
902
|
|
|
791
|
-
type RedisInstanceConfig =
|
|
903
|
+
type RedisInstanceConfig =
|
|
792
904
|
| {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
905
|
+
type: 'redis';
|
|
906
|
+
host: string;
|
|
907
|
+
port: number;
|
|
908
|
+
}
|
|
797
909
|
| {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
910
|
+
type: 'redis-cluster';
|
|
911
|
+
cluster: Array<{ host: string; port: number }>;
|
|
912
|
+
};
|
|
801
913
|
|
|
802
914
|
interface DistributedLockConfig {
|
|
803
915
|
redisConfigs: RedisInstanceConfig[];
|
|
@@ -824,6 +936,59 @@ declare namespace CentralServicesShared {
|
|
|
824
936
|
createLock(config: DistributedLockConfig, logger?: ILogger): DistributedLock;
|
|
825
937
|
}
|
|
826
938
|
|
|
939
|
+
interface RethrowOptions {
|
|
940
|
+
operation?: string;
|
|
941
|
+
step?: string;
|
|
942
|
+
loggerOverride?: ILogger;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
interface RethrowModule {
|
|
946
|
+
rethrowAndCountFspiopError(error: Error, options?: RethrowOptions, context?: string): never;
|
|
947
|
+
rethrowDatabaseError(error: Error, options?: RethrowOptions): never;
|
|
948
|
+
rethrowCachedDatabaseError(error: Error, options?: RethrowOptions): never;
|
|
949
|
+
rethrowRedisError(error: Error, options?: RethrowOptions): never;
|
|
950
|
+
rethrowKafkaError(error: Error, options?: RethrowOptions): never;
|
|
951
|
+
rethrowCacheError(error: Error, options?: RethrowOptions): never;
|
|
952
|
+
constructSystemExtensionError(error: Error, system: string): Error;
|
|
953
|
+
countFspiopError(error: Error, options?: RethrowOptions, context?: string): Error;
|
|
954
|
+
with(context: string): RethrowModule;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
interface SpanTags {
|
|
958
|
+
transactionType: string;
|
|
959
|
+
transactionAction: string;
|
|
960
|
+
transactionId: string | undefined;
|
|
961
|
+
source: string | undefined;
|
|
962
|
+
destination: string | undefined;
|
|
963
|
+
payerFsp?: string;
|
|
964
|
+
payeeFsp?: string;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
interface QueryTags {
|
|
968
|
+
serviceName: string;
|
|
969
|
+
auditType: string;
|
|
970
|
+
contentType: string;
|
|
971
|
+
operation: string;
|
|
972
|
+
[key: string]: any;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
interface TransferSpanInput {
|
|
976
|
+
payload?: any;
|
|
977
|
+
headers?: Record<string, string>;
|
|
978
|
+
params?: { id?: string };
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
interface EventFramework {
|
|
982
|
+
getTransferSpanTags(input: TransferSpanInput, transactionType: string, transactionAction: string): SpanTags;
|
|
983
|
+
getSpanTags(transactionType: string, transactionAction: string, transactionId: string, source: string, destination: string): SpanTags;
|
|
984
|
+
getQueryTags(serviceName: string, auditType: string, contentType: string, operation: string, additionalTags?: Record<string, any>): QueryTags;
|
|
985
|
+
Tags: {
|
|
986
|
+
getTransferSpanTags: (input: TransferSpanInput, transactionType: string, transactionAction: string) => SpanTags;
|
|
987
|
+
getSpanTags: (transactionType: string, transactionAction: string, transactionId: string, source: string, destination: string) => SpanTags;
|
|
988
|
+
getQueryTags: (serviceName: string, auditType: string, contentType: string, operation: string, additionalTags?: Record<string, any>) => QueryTags;
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
|
|
827
992
|
interface Util {
|
|
828
993
|
Endpoints: Endpoints;
|
|
829
994
|
Participants: Participants;
|
|
@@ -836,6 +1001,12 @@ declare namespace CentralServicesShared {
|
|
|
836
1001
|
HeaderValidation: HeaderValidation;
|
|
837
1002
|
Redis: Redis;
|
|
838
1003
|
distLock: DistLock;
|
|
1004
|
+
rethrow: RethrowModule;
|
|
1005
|
+
EventFramework: EventFramework;
|
|
1006
|
+
resourceVersions: Record<string, { contentVersion: string }>;
|
|
1007
|
+
Http: {
|
|
1008
|
+
SwitchDefaultHeaders: (destination: string, resource: string, hubName: string, contentVersion: string) => Record<string, any>;
|
|
1009
|
+
};
|
|
839
1010
|
}
|
|
840
1011
|
|
|
841
1012
|
const Enum: Enum
|
package/src/util/endpoints.js
CHANGED
|
@@ -197,6 +197,9 @@ exports.getEndpoint = async (switchUrl, fsp, endpointType, options = {}, renderO
|
|
|
197
197
|
hit = endpoints.cached !== null
|
|
198
198
|
endpoints = endpoints.value
|
|
199
199
|
}
|
|
200
|
+
if (!hit) {
|
|
201
|
+
log.warn(`getEndpoint cache miss for fsp=${fsp}, endpointType=${endpointType}`)
|
|
202
|
+
}
|
|
200
203
|
|
|
201
204
|
const result = renderEndpoint(endpoints)
|
|
202
205
|
histTimer({ success: true, hit })
|