@lendi/integrations-transform 1.0.7 → 1.1.1
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/lib/index.d.ts +7 -0
- package/lib/index.js +20 -0
- package/lib/logger.d.ts +2 -0
- package/lib/logger.js +5 -0
- package/lib/schemas/credit-report-retrieved-event.json +57 -0
- package/lib/schemas/public-applicant-event.json +652 -0
- package/lib/schemas/public-application-event.json +224 -0
- package/lib/schemas/public-asset-event.json +633 -0
- package/lib/schemas/public-asset-liability-relation-delete-event.json +74 -0
- package/lib/schemas/public-asset-liability-relation-event.json +73 -0
- package/lib/schemas/public-create-applicant-event.json +610 -0
- package/lib/schemas/public-delete-applicant-event.json +66 -0
- package/lib/schemas/public-delete-asset-event.json +53 -0
- package/lib/schemas/public-delete-income-event.json +55 -0
- package/lib/schemas/public-employment-delete-event.json +31 -0
- package/lib/schemas/public-employment-event.json +302 -0
- package/lib/schemas/public-expense-delete-event.json +41 -0
- package/lib/schemas/public-expense-event.json +132 -0
- package/lib/schemas/public-funding-position-event.json +289 -0
- package/lib/schemas/public-income-event.json +242 -0
- package/lib/schemas/public-liability-delete-event.json +37 -0
- package/lib/schemas/public-liability-event.json +234 -0
- package/lib/schemas/public-required-document-event.json +98 -0
- package/lib/schemas/public-update-applicant-event.json +607 -0
- package/lib/schemas/sf-opportunity-event-out.json +138 -0
- package/lib/transform-events/generate-asset-liability-link.d.ts +8 -0
- package/lib/transform-events/generate-asset-liability-link.js +29 -0
- package/lib/transform-events/generate-asset.d.ts +17 -0
- package/lib/transform-events/generate-asset.js +178 -0
- package/lib/transform-events/generate-credit-report-rebuilt.d.ts +8 -0
- package/lib/transform-events/generate-credit-report-rebuilt.js +41 -0
- package/lib/transform-events/generate-employment.d.ts +8 -0
- package/lib/transform-events/generate-employment.js +106 -0
- package/lib/transform-events/generate-funding-position.d.ts +18 -0
- package/lib/transform-events/generate-funding-position.js +82 -0
- package/lib/transform-events/generate-income.d.ts +37 -0
- package/lib/transform-events/generate-income.js +254 -0
- package/lib/transform-events/generate-liability.d.ts +8 -0
- package/lib/transform-events/generate-liability.js +87 -0
- package/lib/transform-events/generate-lixi-percentowned.d.ts +9 -0
- package/lib/transform-events/generate-lixi-percentowned.js +24 -0
- package/lib/transform-events/generate-opportunity.d.ts +8 -0
- package/lib/transform-events/generate-opportunity.js +32 -0
- package/lib/transform-events/generate-required-document.d.ts +8 -0
- package/lib/transform-events/generate-required-document.js +54 -0
- package/lib/transform-events/transform-applicant.d.ts +33 -0
- package/lib/transform-events/transform-applicant.js +189 -0
- package/lib/transform-events/transform-application.d.ts +8 -0
- package/lib/transform-events/transform-application.js +54 -0
- package/lib/transform-events/transform-expenses.d.ts +37 -0
- package/lib/transform-events/transform-expenses.js +121 -0
- package/lib/types/enum-mappings/alieo-frequency.d.ts +15 -0
- package/lib/types/enum-mappings/alieo-frequency.js +26 -0
- package/lib/types/enum-mappings/country-code.d.ts +7 -0
- package/lib/types/enum-mappings/country-code.js +247 -0
- package/lib/types/enum-mappings/employment-basis.d.ts +7 -0
- package/lib/types/enum-mappings/employment-basis.js +13 -0
- package/lib/types/enum-mappings/expense-frequency.d.ts +7 -0
- package/lib/types/enum-mappings/expense-frequency.js +12 -0
- package/lib/types/enum-mappings/funding-position.d.ts +18 -0
- package/lib/types/enum-mappings/funding-position.js +34 -0
- package/lib/types/enum-mappings/government-benefits.d.ts +7 -0
- package/lib/types/enum-mappings/government-benefits.js +11 -0
- package/lib/types/enum-mappings/housing-status.d.ts +7 -0
- package/lib/types/enum-mappings/housing-status.js +16 -0
- package/lib/types/enum-mappings/income-type.d.ts +7 -0
- package/lib/types/enum-mappings/income-type.js +17 -0
- package/lib/types/enum-mappings/liability-payment-type.d.ts +7 -0
- package/lib/types/enum-mappings/liability-payment-type.js +10 -0
- package/lib/types/enum-mappings/liability-type.d.ts +7 -0
- package/lib/types/enum-mappings/liability-type.js +22 -0
- package/lib/types/enum-mappings/living-expense.d.ts +7 -0
- package/lib/types/enum-mappings/living-expense.js +31 -0
- package/lib/types/enum-mappings/marital-status.d.ts +7 -0
- package/lib/types/enum-mappings/marital-status.js +13 -0
- package/lib/types/enum-mappings/postcode.d.ts +6 -0
- package/lib/types/enum-mappings/postcode.js +16 -0
- package/lib/types/enum-mappings/preferred-repayment.d.ts +7 -0
- package/lib/types/enum-mappings/preferred-repayment.js +11 -0
- package/lib/types/enum-mappings/proof-of-identity.d.ts +7 -0
- package/lib/types/enum-mappings/proof-of-identity.js +11 -0
- package/lib/types/enum-mappings/public-financial-asset.d.ts +7 -0
- package/lib/types/enum-mappings/public-financial-asset.js +13 -0
- package/lib/types/enum-mappings/public-primary-purpose.d.ts +7 -0
- package/lib/types/enum-mappings/public-primary-purpose.js +10 -0
- package/lib/types/enum-mappings/public-property-status.d.ts +7 -0
- package/lib/types/enum-mappings/public-property-status.js +12 -0
- package/lib/types/enum-mappings/public-property-type.d.ts +7 -0
- package/lib/types/enum-mappings/public-property-type.js +24 -0
- package/lib/types/enum-mappings/residency-status.d.ts +7 -0
- package/lib/types/enum-mappings/residency-status.js +12 -0
- package/lib/types/enum-mappings/title-gender.d.ts +7 -0
- package/lib/types/enum-mappings/title-gender.js +14 -0
- package/lib/types/enum-mappings/title.d.ts +7 -0
- package/lib/types/enum-mappings/title.js +14 -0
- package/lib/types/enum-mappings/transaction-type.d.ts +7 -0
- package/lib/types/enum-mappings/transaction-type.js +10 -0
- package/lib/types/events/applicant-delete.d.ts +42 -0
- package/lib/types/events/applicant-delete.js +15 -0
- package/lib/types/events/asset-delete.d.ts +33 -0
- package/lib/types/events/asset-delete.js +15 -0
- package/lib/types/events/asset-liability-relation-delete.d.ts +52 -0
- package/lib/types/events/asset-liability-relation-delete.js +15 -0
- package/lib/types/events/credit-report-retrieved.d.ts +36 -0
- package/lib/types/events/credit-report-retrieved.js +15 -0
- package/lib/types/events/employment-delete.d.ts +19 -0
- package/lib/types/events/employment-delete.js +7 -0
- package/lib/types/events/expense-delete.d.ts +21 -0
- package/lib/types/events/expense-delete.js +7 -0
- package/lib/types/events/funding-position.d.ts +116 -0
- package/lib/types/events/funding-position.js +34 -0
- package/lib/types/events/income-delete.d.ts +33 -0
- package/lib/types/events/income-delete.js +15 -0
- package/lib/types/events/liability-delete.d.ts +17 -0
- package/lib/types/events/liability-delete.js +7 -0
- package/lib/types/events/opportunity.d.ts +102 -0
- package/lib/types/events/opportunity.js +47 -0
- package/lib/types/events/public-applicant.d.ts +485 -0
- package/lib/types/events/public-applicant.js +343 -0
- package/lib/types/events/public-application.d.ts +145 -0
- package/lib/types/events/public-application.js +100 -0
- package/lib/types/events/public-asset-liability-relation.d.ts +52 -0
- package/lib/types/events/public-asset-liability-relation.js +15 -0
- package/lib/types/events/public-asset.d.ts +469 -0
- package/lib/types/events/public-asset.js +319 -0
- package/lib/types/events/public-employment.d.ts +190 -0
- package/lib/types/events/public-employment.js +69 -0
- package/lib/types/events/public-expense.d.ts +83 -0
- package/lib/types/events/public-expense.js +50 -0
- package/lib/types/events/public-funding-position.d.ts +226 -0
- package/lib/types/events/public-funding-position.js +7 -0
- package/lib/types/events/public-income.d.ts +144 -0
- package/lib/types/events/public-income.js +65 -0
- package/lib/types/events/public-liability.d.ts +133 -0
- package/lib/types/events/public-liability.js +68 -0
- package/lib/types/events/public-required-document.d.ts +99 -0
- package/lib/types/events/public-required-document.js +44 -0
- package/lib/types/partial-application.d.ts +3 -0
- package/lib/types/partial-application.js +2 -0
- package/lib/types/recursive-partial.d.ts +3 -0
- package/lib/types/recursive-partial.js +2 -0
- package/lib/utils/address-tools.d.ts +69 -0
- package/lib/utils/address-tools.js +146 -0
- package/lib/utils/clean-up.d.ts +7 -0
- package/lib/utils/clean-up.js +24 -0
- package/lib/utils/generate-address.d.ts +19 -0
- package/lib/utils/generate-address.js +102 -0
- package/lib/utils/get-financial-institution.d.ts +7 -0
- package/lib/utils/get-financial-institution.js +16 -0
- package/lib/utils/is-income-type.d.ts +83 -0
- package/lib/utils/is-income-type.js +166 -0
- package/lib/utils/normalise-date.d.ts +8 -0
- package/lib/utils/normalise-date.js +17 -0
- package/lib/utils/round-decimal.d.ts +6 -0
- package/lib/utils/round-decimal.js +12 -0
- package/package.json +10 -7
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.sortBusinessIncome = exports.getApplicantId = exports.getStoredApplicantId = exports.getEmploymentIds = exports.isValidSelfEmployedIncomeEvent = exports.isValidPaygIncomeEvent = exports.isValidRentalIncomeEvent = exports.isFullDocOrLowDocIncome = exports.isOtherIncome = exports.isRentalIncome = exports.isSelfEmployedIncome = exports.isPaygIncome = exports.PAYGList = exports.descriptionOtherIncomeTypes = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var public_income_1 = require("../types/events/public-income");
|
|
6
|
+
exports.descriptionOtherIncomeTypes = [
|
|
7
|
+
public_income_1.IncomeType.InvestmentIncome,
|
|
8
|
+
public_income_1.IncomeType.PaygNonVoluntaryDeductionsPreTax,
|
|
9
|
+
public_income_1.IncomeType.RentalIncome,
|
|
10
|
+
];
|
|
11
|
+
exports.PAYGList = [
|
|
12
|
+
public_income_1.IncomeType.PaygAllowancesNotTaxed,
|
|
13
|
+
public_income_1.IncomeType.PaygAllowancesTaxed,
|
|
14
|
+
public_income_1.IncomeType.PaygBaseSalary,
|
|
15
|
+
public_income_1.IncomeType.PaygBonusIncome,
|
|
16
|
+
public_income_1.IncomeType.PaygCarAllowance,
|
|
17
|
+
public_income_1.IncomeType.PaygCommissionIncome,
|
|
18
|
+
public_income_1.IncomeType.PaygCompanyCar,
|
|
19
|
+
public_income_1.IncomeType.PaygOvertimeIncome,
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* @description Is income type one of the PAYG income.
|
|
23
|
+
* @param {string} incomeType Income type.
|
|
24
|
+
* @returns {boolean} Returns true if Income type is a PAYG Income.
|
|
25
|
+
*/
|
|
26
|
+
function isPaygIncome(incomeType) {
|
|
27
|
+
return exports.PAYGList.includes(incomeType);
|
|
28
|
+
}
|
|
29
|
+
exports.isPaygIncome = isPaygIncome;
|
|
30
|
+
/**
|
|
31
|
+
* @description Is income type SelfEmployedBusinessIncome.
|
|
32
|
+
* @param {string} incomeType Income type.
|
|
33
|
+
* @returns {boolean} Returns true if Income type is SelfEmployedBusinessIncome.
|
|
34
|
+
*/
|
|
35
|
+
function isSelfEmployedIncome(incomeType) {
|
|
36
|
+
return incomeType === public_income_1.IncomeType.SelfEmployedBusinessIncome;
|
|
37
|
+
}
|
|
38
|
+
exports.isSelfEmployedIncome = isSelfEmployedIncome;
|
|
39
|
+
/**
|
|
40
|
+
* @description Is income type Rental Income.
|
|
41
|
+
* @param {IncomeType} incomeType Income type.
|
|
42
|
+
* @returns {boolean} true if Income type is Rental Income.
|
|
43
|
+
*/
|
|
44
|
+
function isRentalIncome(incomeType) {
|
|
45
|
+
return incomeType === public_income_1.IncomeType.RentalIncome;
|
|
46
|
+
}
|
|
47
|
+
exports.isRentalIncome = isRentalIncome;
|
|
48
|
+
/**
|
|
49
|
+
* @description Is Income type one of OtherIncome types.
|
|
50
|
+
* @param {IncomeType} incomeType Income Type.
|
|
51
|
+
* @returns {boolean} returns true for other income.
|
|
52
|
+
*/
|
|
53
|
+
function isOtherIncome(incomeType) {
|
|
54
|
+
return exports.descriptionOtherIncomeTypes.includes(incomeType);
|
|
55
|
+
}
|
|
56
|
+
exports.isOtherIncome = isOtherIncome;
|
|
57
|
+
/**
|
|
58
|
+
* @description Is Self Employed Full Doc or Low Doc Income
|
|
59
|
+
* @param incomeType Income Type from Event
|
|
60
|
+
* @returns {boolean} True if either Full Doc or Low Doc Self Employed Income.
|
|
61
|
+
*/
|
|
62
|
+
function isFullDocOrLowDocIncome(incomeType) {
|
|
63
|
+
return [public_income_1.IncomeType.SelfEmployedBusinessIncomeFullDoc, public_income_1.IncomeType.SelfEmployedBusinessIncomeLowDoc].includes(incomeType);
|
|
64
|
+
}
|
|
65
|
+
exports.isFullDocOrLowDocIncome = isFullDocOrLowDocIncome;
|
|
66
|
+
/**
|
|
67
|
+
* @description Checks if an Income event is a valid rental income event.
|
|
68
|
+
* @param {Income} income Income.
|
|
69
|
+
* @returns {boolean} true if event is a valid Rental Income.
|
|
70
|
+
*/
|
|
71
|
+
function isValidRentalIncomeEvent(_a) {
|
|
72
|
+
var assetId = _a.assetId, incomeType = _a.type;
|
|
73
|
+
return isRentalIncome(incomeType) && !assetId;
|
|
74
|
+
}
|
|
75
|
+
exports.isValidRentalIncomeEvent = isValidRentalIncomeEvent;
|
|
76
|
+
/**
|
|
77
|
+
* @description Is event valid PAYG income event.
|
|
78
|
+
* @param {Income} income Income.
|
|
79
|
+
* @param {PersonApplicant[]} applicants An array of applicants.
|
|
80
|
+
* @returns {boolean} true if Income type is a PAYG value and event is valid PAYG event.
|
|
81
|
+
*/
|
|
82
|
+
function isValidPaygIncomeEvent(_a, applicants) {
|
|
83
|
+
var percentOwned = _a.percentOwned, employmentId = _a.employmentId, incomeType = _a.type;
|
|
84
|
+
if (applicants === void 0) { applicants = []; }
|
|
85
|
+
if (!isPaygIncome(incomeType))
|
|
86
|
+
return false;
|
|
87
|
+
var applicantId = (0, lodash_1.get)(percentOwned, 'owners[0].applicantId') || getStoredApplicantId(applicants, employmentId, 'PAYG');
|
|
88
|
+
if (!applicantId)
|
|
89
|
+
return false;
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
exports.isValidPaygIncomeEvent = isValidPaygIncomeEvent;
|
|
93
|
+
/**
|
|
94
|
+
* @description Checks if an Income event is a valid self-employment income event.
|
|
95
|
+
* @param {Income} income Income.
|
|
96
|
+
* @param {PersonApplicant[]} applicants An array of applicants.
|
|
97
|
+
* @returns {boolean} Returns true if event is a valid self employment income event.
|
|
98
|
+
*/
|
|
99
|
+
function isValidSelfEmployedIncomeEvent(_a, applicants) {
|
|
100
|
+
var percentOwned = _a.percentOwned, employmentId = _a.employmentId, incomeType = _a.type;
|
|
101
|
+
if (applicants === void 0) { applicants = []; }
|
|
102
|
+
if (!isSelfEmployedIncome(incomeType))
|
|
103
|
+
return false;
|
|
104
|
+
var applicantId = (0, lodash_1.get)(percentOwned, 'owners[0].applicantId') || getStoredApplicantId(applicants, employmentId, 'PAYG');
|
|
105
|
+
if (!applicantId)
|
|
106
|
+
return false;
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
exports.isValidSelfEmployedIncomeEvent = isValidSelfEmployedIncomeEvent;
|
|
110
|
+
/**
|
|
111
|
+
* @description Get the employment ids for an applicant for a specific employment type.
|
|
112
|
+
* @param {PersonApplicant} applicant An applicant
|
|
113
|
+
* @param {string} key Employment type key: PAYG or SelfEmployed.
|
|
114
|
+
* @returns {string[]} An array of employment ids for the applicant of the specified type.
|
|
115
|
+
*/
|
|
116
|
+
function getEmploymentIds(applicant, key) {
|
|
117
|
+
return (0, lodash_1.compact)(applicant.Employment.flatMap(function (employment) { return (0, lodash_1.get)(employment, "".concat(key, ".@UniqueID")); }));
|
|
118
|
+
}
|
|
119
|
+
exports.getEmploymentIds = getEmploymentIds;
|
|
120
|
+
/**
|
|
121
|
+
* @description Get applicantId from an array of applicants given an employmentId and employmentType.
|
|
122
|
+
* @param {PersonApplicant[]} applicants An array of applicants.
|
|
123
|
+
* @param {string} employmentId EmploymentId
|
|
124
|
+
* @param {string} key Employment type: PAYG or SelfEmployed
|
|
125
|
+
* @returns {string | undefined} Returns applicantId or undefined.
|
|
126
|
+
*/
|
|
127
|
+
function getStoredApplicantId(applicants, employmentId, key) {
|
|
128
|
+
for (var _i = 0, applicants_1 = applicants; _i < applicants_1.length; _i++) {
|
|
129
|
+
var applicant = applicants_1[_i];
|
|
130
|
+
var employmentIds = getEmploymentIds(applicant, key);
|
|
131
|
+
if (employmentIds.includes(employmentId))
|
|
132
|
+
return applicant['@UniqueID'];
|
|
133
|
+
}
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
exports.getStoredApplicantId = getStoredApplicantId;
|
|
137
|
+
/**
|
|
138
|
+
* @description Get an applicantId from the event or the applicants.
|
|
139
|
+
* @param {Income} income Income.
|
|
140
|
+
* @param {PersonApplicant[]} applicants An array of LIXI applicants.
|
|
141
|
+
* @returns {string | undefined} An applicantId or undefined.
|
|
142
|
+
*/
|
|
143
|
+
function getApplicantId(_a, applicants) {
|
|
144
|
+
var percentOwned = _a.percentOwned, employmentId = _a.employmentId;
|
|
145
|
+
if (applicants === void 0) { applicants = []; }
|
|
146
|
+
return ((0, lodash_1.get)(percentOwned, 'owners[0].applicantId') ||
|
|
147
|
+
getStoredApplicantId(applicants, employmentId, 'PAYG') ||
|
|
148
|
+
getStoredApplicantId(applicants, employmentId, 'SelfEmployed'));
|
|
149
|
+
}
|
|
150
|
+
exports.getApplicantId = getApplicantId;
|
|
151
|
+
/**
|
|
152
|
+
* @description Sort Business Income By Year.
|
|
153
|
+
* @param incomeA Income Details for Self Employed Full Doc.
|
|
154
|
+
* @param incomeB Income Details for Self Employed Full Doc.
|
|
155
|
+
* @returns {0 | - 1 | 1} Returns a number to be used for sorting income.
|
|
156
|
+
*/
|
|
157
|
+
function sortBusinessIncome(_a, _b) {
|
|
158
|
+
var _c = _a.year, yearA = _c === void 0 ? 0 : _c;
|
|
159
|
+
var _d = _b.year, yearB = _d === void 0 ? 0 : _d;
|
|
160
|
+
if (yearA > yearB)
|
|
161
|
+
return -1;
|
|
162
|
+
if (yearB > yearA)
|
|
163
|
+
return 1;
|
|
164
|
+
return 0;
|
|
165
|
+
}
|
|
166
|
+
exports.sortBusinessIncome = sortBusinessIncome;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare type DateConstructorParam = ConstructorParameters<DateConstructor>[0];
|
|
2
|
+
/**
|
|
3
|
+
* Accepts any type of data format and normalises it into a consistent format
|
|
4
|
+
* as "2019-09-19".
|
|
5
|
+
*
|
|
6
|
+
* @param {any} dateOfBirth - Date string.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normaliseDate(dateOfBirth: DateConstructorParam): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.normaliseDate = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Accepts any type of data format and normalises it into a consistent format
|
|
6
|
+
* as "2019-09-19".
|
|
7
|
+
*
|
|
8
|
+
* @param {any} dateOfBirth - Date string.
|
|
9
|
+
*/
|
|
10
|
+
function normaliseDate(dateOfBirth) {
|
|
11
|
+
var date = new Date(dateOfBirth);
|
|
12
|
+
var year = date.getFullYear();
|
|
13
|
+
var month = ('0' + (date.getMonth() + 1)).slice(-2);
|
|
14
|
+
var day = ('0' + date.getDate()).slice(-2);
|
|
15
|
+
return "".concat(year, "-").concat(month, "-").concat(day);
|
|
16
|
+
}
|
|
17
|
+
exports.normaliseDate = normaliseDate;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.roundDecimal = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Rounds given value to 2 decimals.
|
|
6
|
+
*
|
|
7
|
+
* @param amount A number value.
|
|
8
|
+
*/
|
|
9
|
+
function roundDecimal(amount) {
|
|
10
|
+
return parseFloat(amount.toFixed(2));
|
|
11
|
+
}
|
|
12
|
+
exports.roundDecimal = roundDecimal;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lendi/integrations-transform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Library for kafka event data transforming",
|
|
5
5
|
"author": "Integrations <integrations@lendi.com.au>",
|
|
6
6
|
"homepage": "https://bitbucket.org/lendi-dev/integrations-shared-packages#readme",
|
|
7
7
|
"license": "ISC",
|
|
8
|
-
"main": "",
|
|
8
|
+
"main": "./lib/index.js",
|
|
9
9
|
"directories": {
|
|
10
10
|
"lib": "lib",
|
|
11
11
|
"test": "test"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"lib"
|
|
14
|
+
"lib/**/*"
|
|
15
15
|
],
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
@@ -70,20 +70,23 @@
|
|
|
70
70
|
"build": "tsc && cp -r src/schemas lib",
|
|
71
71
|
"build:types": "yarn run build:types:events && yarn run format",
|
|
72
72
|
"build:types:events": "./src/scripts/build-event-types.sh",
|
|
73
|
-
"check": "yarn run check:typings:sources && yarn run check:typings:tests && yarn run check:linting:sources && yarn run check:linting:tests && yarn run check:formatting",
|
|
74
73
|
"check:formatting": "prettier-check '**/*.{json,ts,md}'",
|
|
75
|
-
"check:linting:sources": "tslint --config tslint.json --project tsconfig.json 'src/**/*.ts'",
|
|
76
|
-
"check:linting:tests": "tslint --config tslint.tests.json --project tsconfig.json 'src/**/*.test.ts'",
|
|
77
74
|
"check:typings:sources": "tsc --project tsconfig.json --noEmit",
|
|
78
75
|
"check:typings:tests": "tsc --project tsconfig.tests.json --noEmit",
|
|
79
76
|
"lint:types": "tsc --project tsconfig.json --noEmit",
|
|
80
77
|
"lint": "eslint './src/**/*.ts'; exit 0",
|
|
81
78
|
"lint:fix": "eslint './src/**/*.ts' --fix",
|
|
82
79
|
"format": "prettier --write '**/*.{json,ts,md}'",
|
|
83
|
-
"
|
|
80
|
+
"prepack": "npm run build",
|
|
81
|
+
"prepublishOnly": "npm run build",
|
|
82
|
+
"postpack": "rm -rf lib",
|
|
84
83
|
"test": "yarn test:unit",
|
|
85
84
|
"test:cover": "yarn test:unit --coverage",
|
|
86
85
|
"test:unit": "jest --config jest.config.json --detectOpenHandles",
|
|
86
|
+
"list:package-contents": "npm publish --dry-run",
|
|
87
|
+
"semver:patch": "npm version patch",
|
|
88
|
+
"semver:minor": "npm version minor",
|
|
89
|
+
"semver:major": "npm version major",
|
|
87
90
|
"current:version": "echo $npm_package_version"
|
|
88
91
|
}
|
|
89
92
|
}
|