connect-react-native
Advanced tools
Comparing version 2.43.0 to 2.44.0
@@ -0,1 +1,5 @@ | ||
## 2.44.0 | ||
- Added beneficairyCoolDownPeriod to DapiError. | ||
## 2.43.0 | ||
@@ -2,0 +6,0 @@ |
@@ -38,3 +38,3 @@ "use strict"; | ||
class DapiError extends Error { | ||
constructor(message, type, operationID, account) { | ||
constructor(message, type, operationID, account, beneficiaryCoolDownPeriod) { | ||
super(message); | ||
@@ -44,2 +44,3 @@ _defineProperty(this, "type", void 0); | ||
_defineProperty(this, "account", void 0); | ||
_defineProperty(this, "beneficiaryCoolDownPeriod", void 0); | ||
this.name = 'DapiError'; | ||
@@ -49,2 +50,3 @@ this.type = type; | ||
this.account = account; | ||
this.beneficiaryCoolDownPeriod = beneficiaryCoolDownPeriod; | ||
} | ||
@@ -323,5 +325,10 @@ } | ||
type, | ||
operationID | ||
operationID, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID)); | ||
reject(new DapiError(message, type, operationID, undefined, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -358,5 +365,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -379,5 +391,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -394,5 +411,10 @@ }); | ||
type, | ||
operationID | ||
operationID, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID)); | ||
reject(new DapiError(message, type, operationID, undefined, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -429,5 +451,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -450,5 +477,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -469,5 +501,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -675,3 +712,2 @@ }); | ||
function errorInfo(error) { | ||
console.log("DEBUG_ERROR: ", error.message); | ||
let json = JSON.parse(error.message); | ||
@@ -682,2 +718,4 @@ let message; | ||
let account; | ||
let unit; | ||
let value; | ||
if (json.hasOwnProperty("message")) { | ||
@@ -695,2 +733,8 @@ message = json.message; | ||
} | ||
if (json.hasOwnProperty("unit")) { | ||
unit = json.unit; | ||
} | ||
if (json.hasOwnProperty("value")) { | ||
value = json.value; | ||
} | ||
return { | ||
@@ -700,5 +744,7 @@ message: message, | ||
operationID: operationID, | ||
account: account | ||
account: account, | ||
unit: unit, | ||
value: value | ||
}; | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -7,3 +7,3 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
export class DapiError extends Error { | ||
constructor(message, type, operationID, account) { | ||
constructor(message, type, operationID, account, beneficiaryCoolDownPeriod) { | ||
super(message); | ||
@@ -13,2 +13,3 @@ _defineProperty(this, "type", void 0); | ||
_defineProperty(this, "account", void 0); | ||
_defineProperty(this, "beneficiaryCoolDownPeriod", void 0); | ||
this.name = 'DapiError'; | ||
@@ -18,2 +19,3 @@ this.type = type; | ||
this.account = account; | ||
this.beneficiaryCoolDownPeriod = beneficiaryCoolDownPeriod; | ||
} | ||
@@ -289,5 +291,10 @@ } | ||
type, | ||
operationID | ||
operationID, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID)); | ||
reject(new DapiError(message, type, operationID, undefined, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -324,5 +331,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -345,5 +357,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -360,5 +377,10 @@ }); | ||
type, | ||
operationID | ||
operationID, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID)); | ||
reject(new DapiError(message, type, operationID, undefined, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -395,5 +417,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -416,5 +443,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -435,5 +467,10 @@ }); | ||
operationID, | ||
account | ||
account, | ||
unit, | ||
value | ||
} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
reject(new DapiError(message, type, operationID, account, { | ||
value, | ||
unit | ||
})); | ||
}); | ||
@@ -632,3 +669,2 @@ }); | ||
function errorInfo(error) { | ||
console.log("DEBUG_ERROR: ", error.message); | ||
let json = JSON.parse(error.message); | ||
@@ -639,2 +675,4 @@ let message; | ||
let account; | ||
let unit; | ||
let value; | ||
if (json.hasOwnProperty("message")) { | ||
@@ -652,2 +690,8 @@ message = json.message; | ||
} | ||
if (json.hasOwnProperty("unit")) { | ||
unit = json.unit; | ||
} | ||
if (json.hasOwnProperty("value")) { | ||
value = json.value; | ||
} | ||
return { | ||
@@ -657,3 +701,5 @@ message: message, | ||
operationID: operationID, | ||
account: account | ||
account: account, | ||
unit: unit, | ||
value: value | ||
}; | ||
@@ -660,0 +706,0 @@ } |
@@ -6,3 +6,10 @@ import { IDapiConfigurations, IAccount, ICard, IBeneficiary, IWireBeneficiary, IDapiConnection, IPair, IAccountResponse, IIdentityResponse, ITransactionResponse, IAccountsMetadataResponse, DapiEnvironment, IBankBeneficiaryResponse, IBankWireBeneficiaryResponse, IDapiResult, DapiEndpoint, ITransferResponse, ICardResponse, ICardBalance, ILineAddress, IAccountBalance, DapiTransactionsType, IDapiThemeConfigurations, DapiTheme, DapiLanguage } from './internal/types'; | ||
account?: string; | ||
constructor(message: string, type?: string, operationID?: string, account?: string); | ||
beneficiaryCoolDownPeriod?: { | ||
value: number; | ||
unit: string; | ||
}; | ||
constructor(message: string, type?: string, operationID?: string, account?: string, beneficiaryCoolDownPeriod?: { | ||
value: number; | ||
unit: string; | ||
}); | ||
} | ||
@@ -9,0 +16,0 @@ export declare class DapiConfigurations implements IDapiConfigurations { |
{ | ||
"name": "connect-react-native", | ||
"version": "2.43.0", | ||
"version": "2.44.0", | ||
"description": "Financial APIs to connect users' bank accounts", | ||
@@ -28,4 +28,4 @@ "react-native": "src/index.ts", | ||
"start": "react-native start", | ||
"test": "yarn validate:eslint && yarn validate:typescript", | ||
"validate:eslint": "eslint \"src/**/*.{js,ts,tsx}\" \"example/**/*.{js,ts,tsx}\"", | ||
"test": "jest", | ||
"validate:eslint": "eslint \"src/**/*.{js,ts,tsx}\" \"'examples/example_js/**/*.{js,ts,tsx}\" \"'examples/example_ts/**/*.{js,ts,tsx}\"", | ||
"validate:typescript": "tsc --project ./ --noEmit", | ||
@@ -47,32 +47,32 @@ "test:jest": "jest \"/src/\"", | ||
"devDependencies": { | ||
"@babel/core": "^7.20.2", | ||
"@babel/runtime": "^7.20.1", | ||
"@babel/core": "^7.20.12", | ||
"@babel/runtime": "^7.20.13", | ||
"@react-native-community/eslint-config": "^3.2.0", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@semantic-release/changelog": "^6.0.2", | ||
"@semantic-release/git": "10.0.1", | ||
"@types/jest": "^29.2.3", | ||
"@types/react": "^18.0.25", | ||
"@types/react-native": "^0.70.6", | ||
"@typescript-eslint/eslint-plugin": "^5.43.0", | ||
"@typescript-eslint/parser": "^5.43.0", | ||
"babel-jest": "^29.3.1", | ||
"eslint": "8.27.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"@types/jest": "^29.4.0", | ||
"@types/react": "^18.0.28", | ||
"@types/react-native": "^0.71.3", | ||
"@typescript-eslint/eslint-plugin": "^5.53.0", | ||
"@typescript-eslint/parser": "^5.52.0", | ||
"babel-jest": "^29.4.3", | ||
"eslint": "8.34.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"husky": "^8.0.2", | ||
"jest": "^29.3.1", | ||
"lint-staged": "^13.0.3", | ||
"metro-react-native-babel-preset": "^0.73.3", | ||
"prettier": "^2.7.1", | ||
"husky": "^8.0.3", | ||
"jest": "^29.4.3", | ||
"lint-staged": "^13.1.2", | ||
"metro-react-native-babel-preset": "^0.75.0", | ||
"prettier": "^2.8.4", | ||
"react": "18.2.0", | ||
"react-native": "0.70.6", | ||
"react-native-builder-bob": "^0.20.1", | ||
"react-native": "0.71.3", | ||
"react-native-builder-bob": "^0.20.3", | ||
"react-test-renderer": "18.2.0", | ||
"rimraf": "^3.0.2", | ||
"semantic-release": "19.0.5", | ||
"ts-jest": "^29.0.3", | ||
"typescript": "^4.9.3" | ||
"rimraf": "^4.1.2", | ||
"semantic-release": "20.1.0", | ||
"ts-jest": "^29.0.5", | ||
"typescript": "^4.9.5" | ||
}, | ||
"resolutions": { | ||
"@types/react": "^18.0.25" | ||
"@types/react": "^18.0.28" | ||
}, | ||
@@ -119,2 +119,2 @@ "repository": { | ||
} | ||
} | ||
} |
@@ -34,3 +34,10 @@ import NativeInterface from './internal/nativeInterface'; | ||
account?: string | ||
constructor(message: string, type?: string, operationID?: string, account?: string) { | ||
beneficiaryCoolDownPeriod?: { | ||
value: number; | ||
unit: string; | ||
}; | ||
constructor(message: string, type?: string, operationID?: string, account?: string, beneficiaryCoolDownPeriod?: { | ||
value: number; | ||
unit: string; | ||
}) { | ||
super(message); | ||
@@ -41,2 +48,3 @@ this.name = 'DapiError'; | ||
this.account = account; | ||
this.beneficiaryCoolDownPeriod = beneficiaryCoolDownPeriod; | ||
} | ||
@@ -333,4 +341,4 @@ } | ||
}).catch(error => { | ||
let { message, type , operationID} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID)); | ||
let { message, type, operationID, unit, value} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, undefined, {value, unit})); | ||
}) | ||
@@ -367,4 +375,4 @@ }); | ||
}).catch(error => { | ||
let { message, type , operationID, account} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
let { message, type , operationID, account, unit, value} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account, {value, unit})); | ||
}); | ||
@@ -396,4 +404,4 @@ }); | ||
}).catch(error => { | ||
let { message, type , operationID, account} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
let { message, type , operationID, account, unit, value} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account, {value, unit})); | ||
}); | ||
@@ -408,4 +416,4 @@ }); | ||
}).catch(error => { | ||
let { message, type , operationID} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID)); | ||
let { message, type , operationID, unit, value} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, undefined, {value, unit})); | ||
}) | ||
@@ -442,4 +450,4 @@ }); | ||
}).catch(error => { | ||
let { message, type , operationID, account} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
let { message, type , operationID, account, unit, value} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account, {value, unit})); | ||
}); | ||
@@ -470,4 +478,4 @@ }); | ||
}).catch(error => { | ||
let { message, type , operationID, account} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
let { message, type , operationID, account, unit, value} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account, {value, unit})); | ||
}); | ||
@@ -490,4 +498,4 @@ }); | ||
}).catch(error => { | ||
let { message, type , operationID, account} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account)); | ||
let { message, type , operationID, account, unit, value} = errorInfo(error); | ||
reject(new DapiError(message, type, operationID, account, {value, unit})); | ||
}); | ||
@@ -761,3 +769,2 @@ }); | ||
function errorInfo(error: any) { | ||
console.log("DEBUG_ERROR: ", error.message); | ||
let json = JSON.parse(error.message); | ||
@@ -769,2 +776,4 @@ | ||
let account; | ||
let unit; | ||
let value; | ||
@@ -787,3 +796,11 @@ if(json.hasOwnProperty("message")) { | ||
return { message: message, type: type, operationID: operationID, account: account }; | ||
if(json.hasOwnProperty("unit")) { | ||
unit = json.unit; | ||
} | ||
if(json.hasOwnProperty("value")) { | ||
value = json.value; | ||
} | ||
return { message: message, type: type, operationID: operationID, account: account, unit: unit, value: value }; | ||
} | ||
@@ -790,0 +807,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1364568
4623