@moneylion/engine-api 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -92,3 +92,11 @@ This is a relatively normal NPM and Typescript project.
92
92
  1. `npm install` to install dependencies
93
93
  2. `npm run build` to build the project
94
94
  3. `npm test` to run the tests
95
+
96
+ # Publishing to NPM
97
+
98
+ Run the following steps to publish the library to NPM.
99
+
100
+ 0. Update the version number in `package.json`. Commit this change.
101
+ 1. `npm run build` - This will run Typescript to compile the Javascript.
102
+ 2. `npm publish --access=public`. This will publish the library.
@@ -21,7 +21,10 @@ export declare const originatorImageDecoder: Decoder<components["schemas"]["Orig
21
21
  export declare const originatorDecoder: Decoder<FixNull<components["schemas"]["Originator"]>>;
22
22
  export declare const aprTypeDecoder: Decoder<components["schemas"]["AprType"]>;
23
23
  type OldLoanOffer = components["schemas"]["LoanOffer"];
24
- type LoanOffer = FixNull<OldLoanOffer>;
24
+ type TempLoanOfferWithNulledFields = {
25
+ [P in keyof OldLoanOffer]: P extends "termLength" | "termUnit" ? OldLoanOffer[P] | null | undefined : OldLoanOffer[P];
26
+ };
27
+ type LoanOffer = FixNull<TempLoanOfferWithNulledFields>;
25
28
  export declare const loanOfferDecoder: Decoder<LoanOffer>;
26
29
  export declare const mortgageLoanTypeDecoder: Decoder<components["schemas"]["MortgageLoanType"]>;
27
30
  export declare const mortgageAdjustmentTypeDecoder: Decoder<components["schemas"]["MortgageAdjustmentType"]>;
@@ -34,7 +37,10 @@ export declare const savingsOfferDecoder: Decoder<FixNull<components["schemas"][
34
37
  export declare const specialOfferDecoder: Decoder<FixNull<components["schemas"]["SpecialOffer"]>>;
35
38
  export declare const pendingResponseDecoder: Decoder<FixNull<components["schemas"]["PendingResponse"]>>;
36
39
  type OldRateTable = components["schemas"]["RateTable"];
37
- export type FixedRateTable = FixNull<OldRateTable>;
40
+ type TempRateTableWithNulledFields = {
41
+ [P in keyof OldRateTable]: P extends "loanOffers" ? Array<LoanOffer> : OldRateTable[P];
42
+ };
43
+ export type FixedRateTable = FixNull<TempRateTableWithNulledFields>;
38
44
  export declare const rateTableDecoder: Decoder<FixedRateTable>;
39
45
  export declare const leadUuidDecoder: Decoder<components["schemas"]["LeadUuid"]>;
40
46
  export {};
package/dist/decoders.js CHANGED
@@ -119,8 +119,8 @@ export const loanOfferDecoder = object({
119
119
  sponsored: boolean(),
120
120
  maxAmount: number(),
121
121
  minAmount: optional(number()),
122
- termLength: number(),
123
- termUnit: termUnitDecoder,
122
+ termLength: optional(number()),
123
+ termUnit: optional(termUnitDecoder),
124
124
  displayTermUnit: optional(string()),
125
125
  termDescription: optional(string()),
126
126
  maxApr: optional(number()),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneylion/engine-api",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Interface to engine.tech API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",