Skip to content

Commit a2e7f42

Browse files
authored
fix: sdk backend transferstates (#199)
* fix: transferstate in backend api * chore: update deps
1 parent e525c01 commit a2e7f42

File tree

10 files changed

+487
-346
lines changed

10 files changed

+487
-346
lines changed

docs/sdk-scheme-adapter-backend-v2_1_0-openapi3-snippets.yaml

+18-6
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ components:
15381538
description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems.
15391539
type: string
15401540
transferState:
1541-
$ref: '#/components/schemas/transferState'
1541+
$ref: '#/components/schemas/TransferStateFromBackend'
15421542
required:
15431543
- homeTransactionId
15441544
type: object
@@ -2293,6 +2293,18 @@ components:
22932293
- QRCODE - QR code used as One Time Password.
22942294
- U2F - U2F is a new addition isolated to Thirdparty stream.
22952295
example: OTP
2296+
TransferStateFromBackend:
2297+
title: TransferStateFromBackend
2298+
type: string
2299+
enum:
2300+
- RESERVED
2301+
- COMMITTED
2302+
description: |-
2303+
Below are the allowed values for the enumeration.
2304+
- RESERVED - Next ledger has reserved the transfer.
2305+
- COMMITTED - Next ledger has successfully performed the transfer.
2306+
Note: There is no ABORTED state, http error response with proper mojaloop error code should be used to abort / reject a transfer.
2307+
example: COMMITTED
22962308
TransfersIDPutResponse:
22972309
title: TransfersIDPutResponse
22982310
type: object
@@ -2681,10 +2693,6 @@ components:
26812693
allOf:
26822694
- $ref: '#/components/schemas/DateTime'
26832695
- description: Time and date when the conversion was executed.
2684-
conversionState:
2685-
allOf:
2686-
- $ref: '#/components/schemas/TransferState'
2687-
- description: The current status of the conversion request.
26882696
FxTransfersPostBackendResponse:
26892697
title: FxTransfersPostBackendResponse
26902698
type: object
@@ -2698,11 +2706,15 @@ components:
26982706
completedTimestamp:
26992707
$ref: '#/components/schemas/completedTimestamp'
27002708
conversionState:
2701-
$ref: '#/components/schemas/conversionState'
2709+
$ref: '#/components/schemas/TransferStateFromBackend'
27022710
extensionList:
27032711
$ref: '#/components/schemas/ExtensionList_v2_1_0'
27042712
required:
27052713
- conversionState
2714+
conversionState:
2715+
allOf:
2716+
- $ref: '#/components/schemas/TransferState'
2717+
- description: The current status of the conversion request.
27062718
FxTransfersPutBackendRequest:
27072719
title: FxTransfersPutBackendRequest
27082720
type: object

package-lock.json

+387-286
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -101,30 +101,30 @@
101101
"@redocly/cli": "^1.5.0",
102102
"@types/jest": "^29.5.14",
103103
"@types/js-yaml": "^4.0.9",
104-
"@typescript-eslint/eslint-plugin": "^8.27.0",
105-
"@typescript-eslint/parser": "^8.27.0",
104+
"@typescript-eslint/eslint-plugin": "^8.28.0",
105+
"@typescript-eslint/parser": "^8.28.0",
106106
"audit-ci": "^7.1.0",
107107
"browser-sync": "^3.0.3",
108108
"diff": "^7.0.0",
109109
"eslint": "^8.55.0",
110110
"eslint-config-prettier": "^10.1.1",
111111
"eslint-config-standard": "^17.1.0",
112-
"eslint-import-resolver-typescript": "^4.2.2",
112+
"eslint-import-resolver-typescript": "^4.2.5",
113113
"eslint-plugin-cucumber": "^2.0.0",
114114
"eslint-plugin-import": "^2.31.0",
115115
"eslint-plugin-node": "^11.1.0",
116-
"eslint-plugin-prettier": "^5.2.3",
116+
"eslint-plugin-prettier": "^5.2.5",
117117
"eslint-plugin-promise": "^6.2.0",
118118
"eslint-plugin-standard": "^5.0.0",
119119
"husky": "9.1.7",
120120
"jest": "^29.7.0",
121121
"jest-junit": "^16.0.0",
122122
"lint-staged": "^15.5.0",
123-
"npm-check-updates": "^17.1.15",
123+
"npm-check-updates": "^17.1.16",
124124
"prettier": "^3.5.3",
125125
"standard-version": "^9.5.0",
126126
"swagger-cli": "^4.0.4",
127-
"ts-jest": "^29.2.6",
127+
"ts-jest": "^29.3.0",
128128
"ts-node": "^10.9.2",
129129
"ts-patch": "^3.3.0",
130130
"tslib": "^2.8.1",

sdk-scheme-adapter/v2_1_0/backend/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ components:
14591459
description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems.
14601460
type: string
14611461
transferState:
1462-
$ref: '#/components/schemas/transferState'
1462+
$ref: '../components/schemas/TransferStateFromBackend.yaml'
14631463
required:
14641464
- homeTransactionId
14651465
type: object

sdk-scheme-adapter/v2_1_0/components/schemas/FxTransfersPostBackendResponse.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ properties:
1010
completedTimestamp:
1111
$ref: "../../../../fspiop/v2_0/openapi3/components/schemas/FxTransfersIDPutResponse.yaml#/properties/completedTimestamp"
1212
conversionState:
13-
$ref: "../../../../fspiop/v2_0/openapi3/components/schemas/FxTransfersIDPutResponse.yaml#/properties/conversionState"
13+
$ref: ./TransferStateFromBackend.yaml
1414
extensionList:
1515
$ref: "./ExtensionList_v2_1_0.yaml"
1616
required:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: TransferStateFromBackend
2+
type: string
3+
enum:
4+
- RESERVED
5+
- COMMITTED
6+
description: >-
7+
Below are the allowed values for the enumeration.
8+
9+
- RESERVED - Next ledger has reserved the transfer.
10+
11+
- COMMITTED - Next ledger has successfully performed the transfer.
12+
13+
Note: There is no ABORTED state, http error response with proper mojaloop error code should be used to abort / reject a transfer.
14+
15+
example: 'COMMITTED'

src/sdk-scheme-adapter/v2_1_0/backend/json-schemas.json

+42-41
Original file line numberDiff line numberDiff line change
@@ -22101,14 +22101,14 @@
2210122101
"type": "string"
2210222102
},
2210322103
"transferState": {
22104-
"description": "Below are the allowed values for the enumeration - RECEIVED DFSP has received the transfer. - RESERVED DFSP has reserved the transfer. - COMMITTED DFSP has successfully performed the transfer. - ABORTED DFSP has aborted the transfer due a rejection or failure to perform the transfer.\n",
22104+
"title": "TransferStateFromBackend",
22105+
"type": "string",
2210522106
"enum": [
22106-
"RECEIVED",
2210722107
"RESERVED",
22108-
"COMMITTED",
22109-
"ABORTED"
22108+
"COMMITTED"
2211022109
],
22111-
"type": "string"
22110+
"description": "Below are the allowed values for the enumeration.\n- RESERVED - Next ledger has reserved the transfer.\n- COMMITTED - Next ledger has successfully performed the transfer.\nNote: There is no ABORTED state, http error response with proper mojaloop error code should be used to abort / reject a transfer.",
22111+
"example": "COMMITTED"
2211222112
}
2211322113
},
2211422114
"required": [
@@ -29817,6 +29817,16 @@
2981729817
"description": "Below are the allowed values for the enumeration AuthenticationType.\n- OTP - One-time password generated by the Payer FSP.\n- QRCODE - QR code used as One Time Password.\n- U2F - U2F is a new addition isolated to Thirdparty stream.",
2981829818
"example": "OTP"
2981929819
},
29820+
"TransferStateFromBackend": {
29821+
"title": "TransferStateFromBackend",
29822+
"type": "string",
29823+
"enum": [
29824+
"RESERVED",
29825+
"COMMITTED"
29826+
],
29827+
"description": "Below are the allowed values for the enumeration.\n- RESERVED - Next ledger has reserved the transfer.\n- COMMITTED - Next ledger has successfully performed the transfer.\nNote: There is no ABORTED state, http error response with proper mojaloop error code should be used to abort / reject a transfer.",
29828+
"example": "COMMITTED"
29829+
},
2982029830
"TransfersIDPutResponse": {
2982129831
"title": "TransfersIDPutResponse",
2982229832
"type": "object",
@@ -37448,25 +37458,6 @@
3744837458
}
3744937459
]
3745037460
},
37451-
"conversionState": {
37452-
"allOf": [
37453-
{
37454-
"title": "TransferState",
37455-
"type": "string",
37456-
"enum": [
37457-
"RECEIVED",
37458-
"RESERVED",
37459-
"COMMITTED",
37460-
"ABORTED"
37461-
],
37462-
"description": "Below are the allowed values for the enumeration.\n- RECEIVED - Next ledger has received the transfer.\n- RESERVED - Next ledger has reserved the transfer.\n- COMMITTED - Next ledger has successfully performed the transfer.\n- ABORTED - Next ledger has aborted the transfer due to a rejection or failure to perform the transfer.",
37463-
"example": "RESERVED"
37464-
},
37465-
{
37466-
"description": "The current status of the conversion request."
37467-
}
37468-
]
37469-
},
3747037461
"FxTransfersPostBackendResponse": {
3747137462
"title": "FxTransfersPostBackendResponse",
3747237463
"type": "object",
@@ -37506,23 +37497,14 @@
3750637497
]
3750737498
},
3750837499
"conversionState": {
37509-
"allOf": [
37510-
{
37511-
"title": "TransferState",
37512-
"type": "string",
37513-
"enum": [
37514-
"RECEIVED",
37515-
"RESERVED",
37516-
"COMMITTED",
37517-
"ABORTED"
37518-
],
37519-
"description": "Below are the allowed values for the enumeration.\n- RECEIVED - Next ledger has received the transfer.\n- RESERVED - Next ledger has reserved the transfer.\n- COMMITTED - Next ledger has successfully performed the transfer.\n- ABORTED - Next ledger has aborted the transfer due to a rejection or failure to perform the transfer.",
37520-
"example": "RESERVED"
37521-
},
37522-
{
37523-
"description": "The current status of the conversion request."
37524-
}
37525-
]
37500+
"title": "TransferStateFromBackend",
37501+
"type": "string",
37502+
"enum": [
37503+
"RESERVED",
37504+
"COMMITTED"
37505+
],
37506+
"description": "Below are the allowed values for the enumeration.\n- RESERVED - Next ledger has reserved the transfer.\n- COMMITTED - Next ledger has successfully performed the transfer.\nNote: There is no ABORTED state, http error response with proper mojaloop error code should be used to abort / reject a transfer.",
37507+
"example": "COMMITTED"
3752637508
},
3752737509
"extensionList": {
3752837510
"title": "ExtensionList",
@@ -37569,6 +37551,25 @@
3756937551
"conversionState"
3757037552
]
3757137553
},
37554+
"conversionState": {
37555+
"allOf": [
37556+
{
37557+
"title": "TransferState",
37558+
"type": "string",
37559+
"enum": [
37560+
"RECEIVED",
37561+
"RESERVED",
37562+
"COMMITTED",
37563+
"ABORTED"
37564+
],
37565+
"description": "Below are the allowed values for the enumeration.\n- RECEIVED - Next ledger has received the transfer.\n- RESERVED - Next ledger has reserved the transfer.\n- COMMITTED - Next ledger has successfully performed the transfer.\n- ABORTED - Next ledger has aborted the transfer due to a rejection or failure to perform the transfer.",
37566+
"example": "RESERVED"
37567+
},
37568+
{
37569+
"description": "The current status of the conversion request."
37570+
}
37571+
]
37572+
},
3757237573
"FxTransfersPutBackendRequest": {
3757337574
"title": "FxTransfersPutBackendRequest",
3757437575
"type": "object",

src/sdk-scheme-adapter/v2_1_0/backend/openapi.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ export interface components {
776776
fulfilment?: components["schemas"]["IlpFulfilment"];
777777
/** @description Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems. */
778778
homeTransactionId: string;
779-
transferState?: components["schemas"]["transferState"];
779+
transferState?: components["schemas"]["TransferStateFromBackend"];
780780
};
781781
/**
782782
* @description Below are the allowed values for the enumeration - RECEIVED DFSP has received the transfer. - RESERVED DFSP has reserved the transfer. - COMMITTED DFSP has successfully performed the transfer. - ABORTED DFSP has aborted the transfer due a rejection or failure to perform the transfer.
@@ -1165,6 +1165,16 @@ export interface components {
11651165
* @enum {string}
11661166
*/
11671167
AuthenticationType: "OTP" | "QRCODE" | "U2F";
1168+
/**
1169+
* TransferStateFromBackend
1170+
* @description Below are the allowed values for the enumeration.
1171+
* - RESERVED - Next ledger has reserved the transfer.
1172+
* - COMMITTED - Next ledger has successfully performed the transfer.
1173+
* Note: There is no ABORTED state, http error response with proper mojaloop error code should be used to abort / reject a transfer.
1174+
* @example COMMITTED
1175+
* @enum {string}
1176+
*/
1177+
TransferStateFromBackend: "RESERVED" | "COMMITTED";
11681178
/**
11691179
* TransfersIDPutResponse
11701180
* @description The object sent in the PUT /transfers/{ID} callback.
@@ -1365,7 +1375,6 @@ export interface components {
13651375
};
13661376
fulfilment: components["schemas"]["IlpFulfilment"] & unknown;
13671377
completedTimestamp: components["schemas"]["DateTime"] & unknown;
1368-
conversionState: components["schemas"]["TransferState"] & unknown;
13691378
/**
13701379
* FxTransfersPostBackendResponse
13711380
* @description The object sent as a response for the POST /fxTransfers request.
@@ -1375,9 +1384,10 @@ export interface components {
13751384
homeTransactionId?: string;
13761385
fulfilment?: components["schemas"]["fulfilment"];
13771386
completedTimestamp?: components["schemas"]["completedTimestamp"];
1378-
conversionState: components["schemas"]["conversionState"];
1387+
conversionState: components["schemas"]["TransferStateFromBackend"];
13791388
extensionList?: components["schemas"]["ExtensionList_v2_1_0"];
13801389
};
1390+
conversionState: components["schemas"]["TransferState"] & unknown;
13811391
/**
13821392
* FxTransfersPutBackendRequest
13831393
* @description PUT /fxTransfers/{commitRequestId} object

src/sdk-scheme-adapter/v2_1_0/backend/schemas.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export namespace Schemas {
116116
export const CurrencyConverter = JsonSchemas["CurrencyConverter"]
117117
export const FxRate = JsonSchemas["FxRate"]
118118
export const AuthenticationType = JsonSchemas["AuthenticationType"]
119+
export const TransferStateFromBackend = JsonSchemas["TransferStateFromBackend"]
119120
export const TransfersIDPutResponse = JsonSchemas["TransfersIDPutResponse"]
120121
export const TransfersPostRequest = JsonSchemas["TransfersPostRequest"]
121122
export const QuotesIDPutResponse = JsonSchemas["QuotesIDPutResponse"]
@@ -142,8 +143,8 @@ export namespace Schemas {
142143
export const FxTransfersPostBackendRequest = JsonSchemas["FxTransfersPostBackendRequest"]
143144
export const fulfilment = JsonSchemas["fulfilment"]
144145
export const completedTimestamp = JsonSchemas["completedTimestamp"]
145-
export const conversionState = JsonSchemas["conversionState"]
146146
export const FxTransfersPostBackendResponse = JsonSchemas["FxTransfersPostBackendResponse"]
147+
export const conversionState = JsonSchemas["conversionState"]
147148
export const FxTransfersPutBackendRequest = JsonSchemas["FxTransfersPutBackendRequest"]
148149
export const FxTransfersPatchBackendRequest = JsonSchemas["FxTransfersPatchBackendRequest"]
149150
}

src/sdk-scheme-adapter/v2_1_0/backend/types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export namespace Types {
116116
export type CurrencyConverter = components['schemas']['CurrencyConverter']
117117
export type FxRate = components['schemas']['FxRate']
118118
export type AuthenticationType = components['schemas']['AuthenticationType']
119+
export type TransferStateFromBackend = components['schemas']['TransferStateFromBackend']
119120
export type TransfersIDPutResponse = components['schemas']['TransfersIDPutResponse']
120121
export type TransfersPostRequest = components['schemas']['TransfersPostRequest']
121122
export type QuotesIDPutResponse = components['schemas']['QuotesIDPutResponse']
@@ -142,8 +143,8 @@ export namespace Types {
142143
export type FxTransfersPostBackendRequest = components['schemas']['FxTransfersPostBackendRequest']
143144
export type fulfilment = components['schemas']['fulfilment']
144145
export type completedTimestamp = components['schemas']['completedTimestamp']
145-
export type conversionState = components['schemas']['conversionState']
146146
export type FxTransfersPostBackendResponse = components['schemas']['FxTransfersPostBackendResponse']
147+
export type conversionState = components['schemas']['conversionState']
147148
export type FxTransfersPutBackendRequest = components['schemas']['FxTransfersPutBackendRequest']
148149
export type FxTransfersPatchBackendRequest = components['schemas']['FxTransfersPatchBackendRequest']
149150
}

0 commit comments

Comments
 (0)