@servicetitan/acquisition-functions 0.11.0 → 0.12.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/dist/__tests__/setup.js +2 -2
- package/dist/filter-fetcher/index.js +1 -2
- package/dist/fix-property-use/index.js +2 -3
- package/dist/index.js +1 -2
- package/dist/property-assessorlastsaledate-converter/index.js +2 -3
- package/dist/types.d.ts +2 -2
- package/dist/utils/utils.d.ts +5 -5
- package/dist/utils/utils.js +3 -3
- package/dist/zip-processor.d.ts +1 -1
- package/dist/zip-processor.js +1 -2
- package/package.json +2 -2
package/dist/__tests__/setup.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.closeConnection = exports.openConnection =
|
|
3
|
+
exports.closeConnection = exports.openConnection = void 0;
|
|
4
|
+
exports.setupProperties = setupProperties;
|
|
4
5
|
const mongodb_1 = require("mongodb");
|
|
5
6
|
const mock_1 = require("./mock");
|
|
6
7
|
async function setupProperties(base) {
|
|
@@ -24,7 +25,6 @@ async function setupProperties(base) {
|
|
|
24
25
|
// ignore
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
exports.setupProperties = setupProperties;
|
|
28
28
|
const url = `mongodb://${process.env.MONGO_HOSTNAME ?? 'localhost'}:27017`;
|
|
29
29
|
const mongoClient = new mongodb_1.MongoClient(url, {
|
|
30
30
|
maxPoolSize: 60,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFilterFetcherProcessor =
|
|
3
|
+
exports.getFilterFetcherProcessor = getFilterFetcherProcessor;
|
|
4
4
|
const calc_filter_count_1 = require("./calc-filter-count");
|
|
5
5
|
function getFilterFetcherProcessor(db) {
|
|
6
6
|
let invalidFilters;
|
|
@@ -103,4 +103,3 @@ function getFilterFetcherProcessor(db) {
|
|
|
103
103
|
return meta;
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
exports.getFilterFetcherProcessor = getFilterFetcherProcessor;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getPropertyUseGroupProcessor = getPropertyUseGroupProcessor;
|
|
4
|
+
exports.propertyUseGroupProcessorAggregate = propertyUseGroupProcessorAggregate;
|
|
4
5
|
const utils_1 = require("../utils/utils");
|
|
5
6
|
const getPropertiesCollection = async (db) => {
|
|
6
7
|
return db.collection('properties');
|
|
@@ -73,7 +74,6 @@ function getPropertyUseGroupProcessor(db) {
|
|
|
73
74
|
return meta;
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
exports.getPropertyUseGroupProcessor = getPropertyUseGroupProcessor;
|
|
77
77
|
async function propertyUseGroupProcessorAggregate(db) {
|
|
78
78
|
const collection = await getPropertiesCollection(db);
|
|
79
79
|
const aggCursor = await collection.aggregate([
|
|
@@ -102,4 +102,3 @@ async function propertyUseGroupProcessorAggregate(db) {
|
|
|
102
102
|
result = await aggCursor.next(); // eslint-disable-line no-await-in-loop
|
|
103
103
|
} while (result);
|
|
104
104
|
}
|
|
105
|
-
exports.propertyUseGroupProcessorAggregate = propertyUseGroupProcessorAggregate;
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.configureProcessor =
|
|
17
|
+
exports.configureProcessor = configureProcessor;
|
|
18
18
|
const filter_fetcher_1 = require("./filter-fetcher");
|
|
19
19
|
const fix_property_use_1 = require("./fix-property-use");
|
|
20
20
|
const property_assessorlastsaledate_converter_1 = require("./property-assessorlastsaledate-converter");
|
|
@@ -25,7 +25,6 @@ function configureProcessor(config) {
|
|
|
25
25
|
const propertyUseGroupProcessor = (0, zip_processor_1.zipProcessor)(config.workers, (0, fix_property_use_1.getPropertyUseGroupProcessor)(config.mongoDb));
|
|
26
26
|
return { filterFetcher, assessorLastSaleDateProcessor, propertyUseGroupProcessor };
|
|
27
27
|
}
|
|
28
|
-
exports.configureProcessor = configureProcessor;
|
|
29
28
|
__exportStar(require("./fix-property-use"), exports);
|
|
30
29
|
__exportStar(require("./property-assessorlastsaledate-converter"), exports);
|
|
31
30
|
__exportStar(require("./filter-fetcher"), exports);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAssessorLastSaleDateProcessor = getAssessorLastSaleDateProcessor;
|
|
4
|
+
exports.propertiesAssessorLastSaleDateAggregate = propertiesAssessorLastSaleDateAggregate;
|
|
4
5
|
const utils_1 = require("../utils/utils");
|
|
5
6
|
const getPropertiesCollection = async (db) => {
|
|
6
7
|
return db.collection('properties');
|
|
@@ -64,7 +65,6 @@ function getAssessorLastSaleDateProcessor(db) {
|
|
|
64
65
|
return meta;
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
exports.getAssessorLastSaleDateProcessor = getAssessorLastSaleDateProcessor;
|
|
68
68
|
async function propertiesAssessorLastSaleDateAggregate(db) {
|
|
69
69
|
const collection = await getPropertiesCollection(db);
|
|
70
70
|
const aggCursor = collection.aggregate([
|
|
@@ -103,4 +103,3 @@ async function propertiesAssessorLastSaleDateAggregate(db) {
|
|
|
103
103
|
result = await aggCursor.next(); // eslint-disable-line no-await-in-loop
|
|
104
104
|
} while (result);
|
|
105
105
|
}
|
|
106
|
-
exports.propertiesAssessorLastSaleDateAggregate = propertiesAssessorLastSaleDateAggregate;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WithId } from 'mongodb';
|
|
2
|
-
export
|
|
2
|
+
export type Property = WithId<{
|
|
3
3
|
attomid: number;
|
|
4
4
|
fulladdress: string;
|
|
5
5
|
addressstreet: string;
|
|
@@ -232,7 +232,7 @@ export interface Group {
|
|
|
232
232
|
export interface GroupNamed extends Group {
|
|
233
233
|
groupName: string;
|
|
234
234
|
}
|
|
235
|
-
export
|
|
235
|
+
export type Filter = WithId<{
|
|
236
236
|
zipcode: string;
|
|
237
237
|
propertyusegroup: Group[];
|
|
238
238
|
propertyusestandardized: GroupNamed[];
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -10,13 +10,13 @@ export declare const convertStringToDate: (props: Property[], propName: keyof Pr
|
|
|
10
10
|
addressunit: string;
|
|
11
11
|
primarynumber: number;
|
|
12
12
|
streetname: string;
|
|
13
|
-
streetpredirection?: string
|
|
14
|
-
streetpostdirection?: string
|
|
13
|
+
streetpredirection?: string;
|
|
14
|
+
streetpostdirection?: string;
|
|
15
15
|
streetsuffix: string;
|
|
16
|
-
secondarynumber?: number
|
|
16
|
+
secondarynumber?: number;
|
|
17
17
|
secondarydesignator: string;
|
|
18
|
-
extrasecondarynumber?: number
|
|
19
|
-
extrasecondarydesignator?: string
|
|
18
|
+
extrasecondarynumber?: number;
|
|
19
|
+
extrasecondarydesignator?: string;
|
|
20
20
|
cityname: string;
|
|
21
21
|
stateabbreviation: string;
|
|
22
22
|
zipcode: string;
|
package/dist/utils/utils.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.convertStringToDate = exports.convertToZipString = exports.isEmptyField = exports.UNKNOWN = exports.SEPARATOR_CHARACTER = void 0;
|
|
4
|
+
exports.FilterNameValidator = FilterNameValidator;
|
|
5
|
+
exports.capitalizeFirstLetter = capitalizeFirstLetter;
|
|
4
6
|
exports.SEPARATOR_CHARACTER = '___';
|
|
5
7
|
exports.UNKNOWN = 'unknown';
|
|
6
8
|
const isEmptyField = (field) => {
|
|
@@ -29,11 +31,9 @@ function FilterNameValidator(filtersToIgnore, unknownCharacter) {
|
|
|
29
31
|
},
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
|
-
exports.FilterNameValidator = FilterNameValidator;
|
|
33
34
|
function capitalizeFirstLetter(val) {
|
|
34
35
|
if (!val) {
|
|
35
36
|
return val;
|
|
36
37
|
}
|
|
37
38
|
return val[0].toUpperCase() + val.slice(1).toLowerCase();
|
|
38
39
|
}
|
|
39
|
-
exports.capitalizeFirstLetter = capitalizeFirstLetter;
|
package/dist/zip-processor.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface ResultsMeta {
|
|
|
4
4
|
errors: number;
|
|
5
5
|
filters?: number;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type ProcessInput = [from: string, to: string] | string;
|
|
8
8
|
export declare function zipProcessor(workers: number, processorFn: (zip: string, errors: Set<string>) => Promise<ResultsMeta>): {
|
|
9
9
|
getProcessor: () => AsyncGenerator<ResultsMeta | ResultsMeta[], void, unknown> | null;
|
|
10
10
|
start: (zips: ProcessInput) => Promise<Required<ResultsMeta>>;
|
package/dist/zip-processor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable no-await-in-loop, require-atomic-updates */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.zipProcessor =
|
|
4
|
+
exports.zipProcessor = zipProcessor;
|
|
5
5
|
const utils_1 = require("./utils/utils");
|
|
6
6
|
function zipProcessor(workers, processorFn) {
|
|
7
7
|
let processor = null;
|
|
@@ -85,4 +85,3 @@ function zipProcessor(workers, processorFn) {
|
|
|
85
85
|
clear,
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
exports.zipProcessor = zipProcessor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/acquisition-functions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"cli": {
|
|
28
28
|
"webpack": false
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "a80589bd64eb965e97ae60aa28232ea60b5ed19c"
|
|
31
31
|
}
|