@land-catalyst/batch-data-sdk 1.1.12 → 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 +19 -1
- package/dist/{builders.d.ts → builders/builders.d.ts} +76 -1
- package/dist/{builders.js → builders/builders.js} +109 -1
- package/dist/builders/property-field-builder-mixin.d.ts +47 -0
- package/dist/builders/property-field-builder-mixin.js +35 -0
- package/dist/{client.d.ts → client/client.d.ts} +2 -2
- package/dist/{client.interface.d.ts → client/client.interface.d.ts} +1 -1
- package/dist/{client.js → client/client.js} +2 -2
- package/dist/{types.d.ts → core/types.d.ts} +230 -2
- package/dist/index.d.ts +11 -7
- package/dist/index.js +8 -6
- package/dist/property-field/metadata.d.ts +105 -0
- package/dist/property-field/metadata.js +6251 -0
- package/dist/property-field/types.d.ts +33 -0
- package/dist/property-field/types.js +9 -0
- package/dist/property-field/utils.d.ts +306 -0
- package/dist/property-field/utils.js +479 -0
- package/package.json +5 -2
- /package/dist/{client.interface.js → client/client.interface.js} +0 -0
- /package/dist/{errors.d.ts → core/errors.d.ts} +0 -0
- /package/dist/{errors.js → core/errors.js} +0 -0
- /package/dist/{logger.interface.d.ts → core/logger.interface.d.ts} +0 -0
- /package/dist/{logger.interface.js → core/logger.interface.js} +0 -0
- /package/dist/{types.js → core/types.js} +0 -0
package/README.md
CHANGED
|
@@ -366,6 +366,23 @@ const subscription = new PropertySubscriptionBuilder()
|
|
|
366
366
|
.build();
|
|
367
367
|
```
|
|
368
368
|
|
|
369
|
+
### Property Subscription with Event Hub
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
const subscription = new PropertySubscriptionBuilder()
|
|
373
|
+
.searchCriteria((c) => c.query("Phoenix, AZ").orQuickLists(["on-market"]))
|
|
374
|
+
.deliveryConfig((dc) =>
|
|
375
|
+
dc.eventHub({
|
|
376
|
+
fullyQualifiedNamespace: "mynamespace.servicebus.windows.net",
|
|
377
|
+
clientId: "12345678-1234-1234-1234-123456789abc",
|
|
378
|
+
tenantId: "87654321-4321-4321-4321-cba987654321",
|
|
379
|
+
clientSecret: "your-client-secret",
|
|
380
|
+
eventHubName: "property-events",
|
|
381
|
+
})
|
|
382
|
+
)
|
|
383
|
+
.build();
|
|
384
|
+
```
|
|
385
|
+
|
|
369
386
|
### Property Lookup by Address
|
|
370
387
|
|
|
371
388
|
```typescript
|
|
@@ -903,7 +920,8 @@ if (response.results?.quicklistCounts) {
|
|
|
903
920
|
- `PropertySubscriptionResponse` - Subscription creation response
|
|
904
921
|
- `PropertySearchResponse` - Property search API response
|
|
905
922
|
- `Property` - Individual property object with all nested data
|
|
906
|
-
- `DeliveryConfig` - Webhook or
|
|
923
|
+
- `DeliveryConfig` - Webhook, Kinesis, or Event Hub delivery configuration
|
|
924
|
+
- `EventHubConfig` - Azure Event Hub configuration
|
|
907
925
|
|
|
908
926
|
### Builders
|
|
909
927
|
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
* .build();
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
import { StringFilter, NumericRangeFilter, DateRangeFilter, GeoLocationDistance, GeoLocationBoundingBox, GeoLocationPolygon, AddressSearchCriteria, AssessmentSearchCriteria, BuildingSearchCriteria, CompAddressSearchCriteria, DemographicsSearchCriteria, ForeclosureSearchCriteria, GeneralSearchCriteria, IdsSearchCriteria, IntelSearchCriteria, InvoluntaryLienSearchCriteria, LegalSearchCriteria, ListingSearchCriteria, LotSearchCriteria, OpenLienSearchCriteria, OwnerSearchCriteria, PermitSearchCriteria, PropertyOwnerProfileSearchCriteria, SaleSearchCriteria, TaxSearchCriteria, ValuationSearchCriteria, OrSearchCriteria, SearchCriteria, DeliveryConfig, PropertySubscriptionRequest, QuickListValueWithNot, PropertyLookupRequest, PropertyLookupRequestItem, PropertyLookupRequestAddress, PropertyLookupOptions, PropertyPermitRequest, PropertySearchRequest, PropertySearchAsyncRequest, PropertyLookupAsyncRequest, GeoPoint } from "
|
|
19
|
+
import { StringFilter, NumericRangeFilter, DateRangeFilter, GeoLocationDistance, GeoLocationBoundingBox, GeoLocationPolygon, AddressSearchCriteria, AssessmentSearchCriteria, BuildingSearchCriteria, CompAddressSearchCriteria, DemographicsSearchCriteria, ForeclosureSearchCriteria, GeneralSearchCriteria, IdsSearchCriteria, IntelSearchCriteria, InvoluntaryLienSearchCriteria, LegalSearchCriteria, ListingSearchCriteria, LotSearchCriteria, OpenLienSearchCriteria, OwnerSearchCriteria, PermitSearchCriteria, PropertyOwnerProfileSearchCriteria, SaleSearchCriteria, TaxSearchCriteria, ValuationSearchCriteria, OrSearchCriteria, SearchCriteria, DeliveryConfig, EventHubConfig, PropertySubscriptionRequest, QuickListValueWithNot, PropertyLookupRequest, PropertyLookupRequestItem, PropertyLookupRequestAddress, PropertyLookupOptions, PropertyPermitRequest, PropertySearchRequest, PropertySearchAsyncRequest, PropertyLookupAsyncRequest, GeoPoint } from "../core/types";
|
|
20
|
+
import type { PropertyFieldMetadata } from "../property-field/metadata";
|
|
20
21
|
/**
|
|
21
22
|
* Base interface for all builders
|
|
22
23
|
*/
|
|
@@ -47,6 +48,79 @@ export type BuildersStorage<T> = {
|
|
|
47
48
|
declare abstract class BaseBuilder<T> implements Builder<T> {
|
|
48
49
|
protected criteria: Partial<T>;
|
|
49
50
|
protected builders: BuildersStorage<T>;
|
|
51
|
+
/**
|
|
52
|
+
* Get metadata for a property field path
|
|
53
|
+
* @param fieldPath The field path (e.g., "address.city", "owner.fullName")
|
|
54
|
+
* @returns The field metadata, or undefined if not found
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const builder = new SearchCriteriaBuilder("test");
|
|
58
|
+
* const cityMeta = builder.getFieldMetadata("address.city");
|
|
59
|
+
* console.log(cityMeta?.description); // "The city (e.g. Chicago)"
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
getFieldMetadata(fieldPath: string): PropertyFieldMetadata | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Get description for a property field path
|
|
65
|
+
* @param fieldPath The field path
|
|
66
|
+
* @returns The description, or undefined if not found
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const builder = new SearchCriteriaBuilder("test");
|
|
70
|
+
* const desc = builder.getFieldDescription("address.city");
|
|
71
|
+
* console.log(desc); // "The city (e.g. Chicago)"
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
getFieldDescription(fieldPath: string): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Get data type for a property field path
|
|
77
|
+
* @param fieldPath The field path
|
|
78
|
+
* @returns The data type, or undefined if not found
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const builder = new SearchCriteriaBuilder("test");
|
|
82
|
+
* const type = builder.getFieldType("address.city");
|
|
83
|
+
* console.log(type); // "string"
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
getFieldType(fieldPath: string): PropertyFieldMetadata["dataType"] | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Get Property field metadata for a SearchCriteria field path
|
|
89
|
+
* This helps you understand what Property field you're filtering on
|
|
90
|
+
* @param searchCriteriaPath The SearchCriteria field path (e.g., "address.city")
|
|
91
|
+
* @returns The Property field metadata, or undefined if not found
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const builder = new AddressSearchCriteriaBuilder();
|
|
95
|
+
* builder.city((c) => {
|
|
96
|
+
* // See what Property field this filters on
|
|
97
|
+
* const meta = builder.getSearchCriteriaFieldMetadata("address.city");
|
|
98
|
+
* console.log(`Filtering on: ${meta?.description}`);
|
|
99
|
+
* c.equals("Phoenix");
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
getSearchCriteriaFieldMetadata(searchCriteriaPath: string): PropertyFieldMetadata | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Get SearchCriteria field metadata inferred from Property field metadata
|
|
106
|
+
* This provides a SearchCriteria-specific metadata object that explains what Property field
|
|
107
|
+
* you're filtering on, even if the mapping isn't exact
|
|
108
|
+
* @param searchCriteriaPath The SearchCriteria field path (e.g., "address.city")
|
|
109
|
+
* @returns SearchCriteria field metadata with Property field information
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* const builder = new AddressSearchCriteriaBuilder();
|
|
113
|
+
* builder.city((c) => {
|
|
114
|
+
* // Get SearchCriteria metadata (inferred from Property metadata)
|
|
115
|
+
* const scMeta = builder.getSearchCriteriaMetadata("address.city");
|
|
116
|
+
* console.log(scMeta.description); // "Filter on: The city (e.g. Chicago)"
|
|
117
|
+
* console.log(scMeta.hasPropertyMapping); // true
|
|
118
|
+
* console.log(scMeta.propertyDataType); // "string"
|
|
119
|
+
* c.equals("Phoenix");
|
|
120
|
+
* });
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
getSearchCriteriaMetadata(searchCriteriaPath: string): any;
|
|
50
124
|
/**
|
|
51
125
|
* Helper method to set a property either directly or via a builder configurator.
|
|
52
126
|
* This extracts the common pattern of checking if a configurator function is provided,
|
|
@@ -661,6 +735,7 @@ export declare class DeliveryConfigBuilder {
|
|
|
661
735
|
static from(config: DeliveryConfig): DeliveryConfigBuilder;
|
|
662
736
|
webhook(url: string, headers?: Record<string, string>, errorUrl?: string): this;
|
|
663
737
|
kinesis(streamName: string, region: string, iamAccessKeyId: string, iamSecretAccessKey: string): this;
|
|
738
|
+
eventHub(config: EventHubConfig): this;
|
|
664
739
|
build(): DeliveryConfig;
|
|
665
740
|
}
|
|
666
741
|
/**
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.PropertyPermitRequestBuilder = exports.PropertyLookupAsyncRequestBuilder = exports.PropertySearchAsyncRequestBuilder = exports.PropertySearchRequestBuilder = exports.PropertyLookupRequestBuilder = exports.AsyncPropertyLookupOptionsBuilder = exports.PropertyLookupOptionsBuilder = exports.PropertyLookupRequestItemBuilder = exports.PropertySubscriptionBuilder = exports.DeliveryConfigBuilder = exports.SearchCriteriaBuilder = exports.OrSearchCriteriaBuilder = exports.ValuationSearchCriteriaBuilder = exports.TaxSearchCriteriaBuilder = exports.SaleSearchCriteriaBuilder = exports.PropertyOwnerProfileSearchCriteriaBuilder = exports.PermitSearchCriteriaBuilder = exports.OwnerSearchCriteriaBuilder = exports.OpenLienSearchCriteriaBuilder = exports.LotSearchCriteriaBuilder = exports.ListingSearchCriteriaBuilder = exports.LegalSearchCriteriaBuilder = exports.InvoluntaryLienSearchCriteriaBuilder = exports.IntelSearchCriteriaBuilder = exports.IdsSearchCriteriaBuilder = exports.GeneralSearchCriteriaBuilder = exports.ForeclosureSearchCriteriaBuilder = exports.DemographicsSearchCriteriaBuilder = exports.CompAddressSearchCriteriaBuilder = exports.BuildingSearchCriteriaBuilder = exports.AssessmentSearchCriteriaBuilder = exports.AddressSearchCriteriaBuilder = exports.GeoLocationFactory = exports.DateRangeFilterBuilder = exports.NumericRangeFilterBuilder = exports.StringFilterBuilder = void 0;
|
|
22
|
+
const metadata_1 = require("../property-field/metadata");
|
|
22
23
|
/**
|
|
23
24
|
* Abstract base class for builders that store nested builders
|
|
24
25
|
* Handles the common pattern of storing builder instances and building them all at once
|
|
@@ -28,6 +29,95 @@ class BaseBuilder {
|
|
|
28
29
|
this.criteria = {};
|
|
29
30
|
this.builders = {};
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Get metadata for a property field path
|
|
34
|
+
* @param fieldPath The field path (e.g., "address.city", "owner.fullName")
|
|
35
|
+
* @returns The field metadata, or undefined if not found
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const builder = new SearchCriteriaBuilder("test");
|
|
39
|
+
* const cityMeta = builder.getFieldMetadata("address.city");
|
|
40
|
+
* console.log(cityMeta?.description); // "The city (e.g. Chicago)"
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
getFieldMetadata(fieldPath) {
|
|
44
|
+
return (0, metadata_1.getFieldMetadata)(fieldPath);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get description for a property field path
|
|
48
|
+
* @param fieldPath The field path
|
|
49
|
+
* @returns The description, or undefined if not found
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const builder = new SearchCriteriaBuilder("test");
|
|
53
|
+
* const desc = builder.getFieldDescription("address.city");
|
|
54
|
+
* console.log(desc); // "The city (e.g. Chicago)"
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
getFieldDescription(fieldPath) {
|
|
58
|
+
return this.getFieldMetadata(fieldPath)?.description;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get data type for a property field path
|
|
62
|
+
* @param fieldPath The field path
|
|
63
|
+
* @returns The data type, or undefined if not found
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const builder = new SearchCriteriaBuilder("test");
|
|
67
|
+
* const type = builder.getFieldType("address.city");
|
|
68
|
+
* console.log(type); // "string"
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
getFieldType(fieldPath) {
|
|
72
|
+
return this.getFieldMetadata(fieldPath)?.dataType;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get Property field metadata for a SearchCriteria field path
|
|
76
|
+
* This helps you understand what Property field you're filtering on
|
|
77
|
+
* @param searchCriteriaPath The SearchCriteria field path (e.g., "address.city")
|
|
78
|
+
* @returns The Property field metadata, or undefined if not found
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const builder = new AddressSearchCriteriaBuilder();
|
|
82
|
+
* builder.city((c) => {
|
|
83
|
+
* // See what Property field this filters on
|
|
84
|
+
* const meta = builder.getSearchCriteriaFieldMetadata("address.city");
|
|
85
|
+
* console.log(`Filtering on: ${meta?.description}`);
|
|
86
|
+
* c.equals("Phoenix");
|
|
87
|
+
* });
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
getSearchCriteriaFieldMetadata(searchCriteriaPath) {
|
|
91
|
+
// Dynamic import to avoid circular dependency
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
93
|
+
const { getSearchCriteriaFieldMetadata, } = require("../property-field/utils");
|
|
94
|
+
return getSearchCriteriaFieldMetadata(searchCriteriaPath);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get SearchCriteria field metadata inferred from Property field metadata
|
|
98
|
+
* This provides a SearchCriteria-specific metadata object that explains what Property field
|
|
99
|
+
* you're filtering on, even if the mapping isn't exact
|
|
100
|
+
* @param searchCriteriaPath The SearchCriteria field path (e.g., "address.city")
|
|
101
|
+
* @returns SearchCriteria field metadata with Property field information
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const builder = new AddressSearchCriteriaBuilder();
|
|
105
|
+
* builder.city((c) => {
|
|
106
|
+
* // Get SearchCriteria metadata (inferred from Property metadata)
|
|
107
|
+
* const scMeta = builder.getSearchCriteriaMetadata("address.city");
|
|
108
|
+
* console.log(scMeta.description); // "Filter on: The city (e.g. Chicago)"
|
|
109
|
+
* console.log(scMeta.hasPropertyMapping); // true
|
|
110
|
+
* console.log(scMeta.propertyDataType); // "string"
|
|
111
|
+
* c.equals("Phoenix");
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
getSearchCriteriaMetadata(searchCriteriaPath) {
|
|
116
|
+
// Dynamic import to avoid circular dependency
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
118
|
+
const { getSearchCriteriaMetadata } = require("../property-field/utils");
|
|
119
|
+
return getSearchCriteriaMetadata(searchCriteriaPath);
|
|
120
|
+
}
|
|
31
121
|
/**
|
|
32
122
|
* Helper method to set a property either directly or via a builder configurator.
|
|
33
123
|
* This extracts the common pattern of checking if a configurator function is provided,
|
|
@@ -2005,9 +2095,14 @@ class DeliveryConfigBuilder {
|
|
|
2005
2095
|
this.config.iamSecretAccessKey = iamSecretAccessKey;
|
|
2006
2096
|
return this;
|
|
2007
2097
|
}
|
|
2098
|
+
eventHub(config) {
|
|
2099
|
+
this.config.type = "event-hub";
|
|
2100
|
+
this.config.eventHub = config;
|
|
2101
|
+
return this;
|
|
2102
|
+
}
|
|
2008
2103
|
build() {
|
|
2009
2104
|
if (!this.config.type) {
|
|
2010
|
-
throw new Error("Delivery type (webhook or
|
|
2105
|
+
throw new Error("Delivery type (webhook, kinesis, or event-hub) is required");
|
|
2011
2106
|
}
|
|
2012
2107
|
if (this.config.type === "webhook" && !this.config.url) {
|
|
2013
2108
|
throw new Error("URL is required for webhook delivery");
|
|
@@ -2020,6 +2115,19 @@ class DeliveryConfigBuilder {
|
|
|
2020
2115
|
throw new Error("Stream name, region, IAM access key ID, and secret access key are required for Kinesis delivery");
|
|
2021
2116
|
}
|
|
2022
2117
|
}
|
|
2118
|
+
if (this.config.type === "event-hub") {
|
|
2119
|
+
if (!this.config.eventHub) {
|
|
2120
|
+
throw new Error("Event Hub configuration is required for event-hub delivery");
|
|
2121
|
+
}
|
|
2122
|
+
const { fullyQualifiedNamespace, clientId, tenantId, clientSecret, eventHubName, } = this.config.eventHub;
|
|
2123
|
+
if (!fullyQualifiedNamespace ||
|
|
2124
|
+
!clientId ||
|
|
2125
|
+
!tenantId ||
|
|
2126
|
+
!clientSecret ||
|
|
2127
|
+
!eventHubName) {
|
|
2128
|
+
throw new Error("Fully qualified namespace, client ID, tenant ID, client secret, and event hub name are required for Event Hub delivery");
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2023
2131
|
return this.config;
|
|
2024
2132
|
}
|
|
2025
2133
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Property Field Builder Mixin
|
|
3
|
+
*
|
|
4
|
+
* Mixin to add metadata access capabilities to builders
|
|
5
|
+
*/
|
|
6
|
+
import type { PropertyFieldMetadata } from "../property-field/metadata";
|
|
7
|
+
/**
|
|
8
|
+
* Interface for builders that support metadata access
|
|
9
|
+
*/
|
|
10
|
+
export interface MetadataAwareBuilder {
|
|
11
|
+
/**
|
|
12
|
+
* Get metadata for a field path
|
|
13
|
+
* @param fieldPath The field path (e.g., "address.city")
|
|
14
|
+
* @returns The field metadata, or undefined if not found
|
|
15
|
+
*/
|
|
16
|
+
getFieldMetadata(fieldPath: string): PropertyFieldMetadata | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Get description for a field path
|
|
19
|
+
* @param fieldPath The field path
|
|
20
|
+
* @returns The description, or undefined if not found
|
|
21
|
+
*/
|
|
22
|
+
getFieldDescription(fieldPath: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get data type for a field path
|
|
25
|
+
* @param fieldPath The field path
|
|
26
|
+
* @returns The data type, or undefined if not found
|
|
27
|
+
*/
|
|
28
|
+
getFieldType(fieldPath: string): PropertyFieldMetadata["dataType"] | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Mixin to add metadata capabilities to any builder
|
|
32
|
+
* @param Base The base builder class
|
|
33
|
+
* @returns A builder class with metadata access
|
|
34
|
+
*/
|
|
35
|
+
export declare function withMetadataAccess<T extends new (...args: any[]) => any>(Base: T): {
|
|
36
|
+
new (...args: any[]): {
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
getFieldMetadata(fieldPath: string): PropertyFieldMetadata | undefined;
|
|
39
|
+
getFieldDescription(fieldPath: string): string | undefined;
|
|
40
|
+
getFieldType(fieldPath: string): PropertyFieldMetadata["dataType"] | undefined;
|
|
41
|
+
};
|
|
42
|
+
} & T;
|
|
43
|
+
/**
|
|
44
|
+
* Helper to get metadata for a builder field
|
|
45
|
+
* This can be used as a static method or utility function
|
|
46
|
+
*/
|
|
47
|
+
export declare function getBuilderFieldMetadata(fieldPath: string): PropertyFieldMetadata | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Property Field Builder Mixin
|
|
4
|
+
*
|
|
5
|
+
* Mixin to add metadata access capabilities to builders
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.withMetadataAccess = withMetadataAccess;
|
|
9
|
+
exports.getBuilderFieldMetadata = getBuilderFieldMetadata;
|
|
10
|
+
const metadata_1 = require("../property-field/metadata");
|
|
11
|
+
/**
|
|
12
|
+
* Mixin to add metadata capabilities to any builder
|
|
13
|
+
* @param Base The base builder class
|
|
14
|
+
* @returns A builder class with metadata access
|
|
15
|
+
*/
|
|
16
|
+
function withMetadataAccess(Base) {
|
|
17
|
+
return class extends Base {
|
|
18
|
+
getFieldMetadata(fieldPath) {
|
|
19
|
+
return (0, metadata_1.getFieldMetadata)(fieldPath);
|
|
20
|
+
}
|
|
21
|
+
getFieldDescription(fieldPath) {
|
|
22
|
+
return (0, metadata_1.getFieldMetadata)(fieldPath)?.description;
|
|
23
|
+
}
|
|
24
|
+
getFieldType(fieldPath) {
|
|
25
|
+
return (0, metadata_1.getFieldMetadata)(fieldPath)?.dataType;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Helper to get metadata for a builder field
|
|
31
|
+
* This can be used as a static method or utility function
|
|
32
|
+
*/
|
|
33
|
+
function getBuilderFieldMetadata(fieldPath) {
|
|
34
|
+
return (0, metadata_1.getFieldMetadata)(fieldPath);
|
|
35
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse, AxiosError, InternalAxiosRequestConfig } from "axios";
|
|
2
2
|
import { IBatchDataClient } from "./client.interface";
|
|
3
|
-
import { ILogger } from "
|
|
4
|
-
import { PropertySubscriptionRequest, PropertySubscriptionResponse, PropertySearchRequest, PropertySearchResponse, AddressVerifyRequest, AddressVerifyResponse, AddressAutocompleteRequest, AddressAutocompleteResponse, AddressGeocodeRequest, AddressGeocodeResponse, AddressReverseGeocodeRequest, AddressReverseGeocodeResponse, PropertyLookupRequest, PropertyLookupResponse, PropertyLookupAsyncRequest, PropertyLookupAsyncResponse, PropertySearchAsyncRequest, PropertySearchAsyncResponse, PropertySkipTraceRequest, PropertySkipTraceResponse, PropertySkipTraceAsyncRequest, PropertySkipTraceAsyncResponse, PhoneVerificationRequest, PhoneVerificationResponse, PhoneVerificationAsyncRequest, PhoneVerificationAsyncResponse, PhoneDNCRequest, PhoneDNCResponse, PhoneDNCAsyncRequest, PhoneDNCAsyncResponse, PhoneTCPARequest, PhoneTCPAResponse, PhoneTCPAAsyncRequest, PhoneTCPAAsyncResponse, GetPropertySubscriptionsResponse, GetPropertySubscriptionDetailResponse, DeletePropertySubscriptionResponse, PropertyPermitRequest, PropertyPermitResponse, PropertySkipTraceV3Request, PropertySkipTraceV3Response, PropertySkipTraceV3AsyncRequest, PropertySkipTraceV3AsyncResponse } from "
|
|
3
|
+
import { ILogger } from "../core/logger.interface";
|
|
4
|
+
import { PropertySubscriptionRequest, PropertySubscriptionResponse, PropertySearchRequest, PropertySearchResponse, AddressVerifyRequest, AddressVerifyResponse, AddressAutocompleteRequest, AddressAutocompleteResponse, AddressGeocodeRequest, AddressGeocodeResponse, AddressReverseGeocodeRequest, AddressReverseGeocodeResponse, PropertyLookupRequest, PropertyLookupResponse, PropertyLookupAsyncRequest, PropertyLookupAsyncResponse, PropertySearchAsyncRequest, PropertySearchAsyncResponse, PropertySkipTraceRequest, PropertySkipTraceResponse, PropertySkipTraceAsyncRequest, PropertySkipTraceAsyncResponse, PhoneVerificationRequest, PhoneVerificationResponse, PhoneVerificationAsyncRequest, PhoneVerificationAsyncResponse, PhoneDNCRequest, PhoneDNCResponse, PhoneDNCAsyncRequest, PhoneDNCAsyncResponse, PhoneTCPARequest, PhoneTCPAResponse, PhoneTCPAAsyncRequest, PhoneTCPAAsyncResponse, GetPropertySubscriptionsResponse, GetPropertySubscriptionDetailResponse, DeletePropertySubscriptionResponse, PropertyPermitRequest, PropertyPermitResponse, PropertySkipTraceV3Request, PropertySkipTraceV3Response, PropertySkipTraceV3AsyncRequest, PropertySkipTraceV3AsyncResponse } from "../core/types";
|
|
5
5
|
/**
|
|
6
6
|
* Middleware function that executes before an HTTP request is sent.
|
|
7
7
|
* Can modify the request config or perform side effects (logging, metrics, etc.).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropertySubscriptionRequest, PropertySubscriptionResponse, PropertySearchRequest, PropertySearchResponse, AddressVerifyRequest, AddressVerifyResponse, AddressAutocompleteRequest, AddressAutocompleteResponse, AddressGeocodeRequest, AddressGeocodeResponse, AddressReverseGeocodeRequest, AddressReverseGeocodeResponse, PropertyLookupRequest, PropertyLookupResponse, PropertyLookupAsyncRequest, PropertyLookupAsyncResponse, PropertySearchAsyncRequest, PropertySearchAsyncResponse, PropertySkipTraceRequest, PropertySkipTraceResponse, PropertySkipTraceAsyncRequest, PropertySkipTraceAsyncResponse, PhoneVerificationRequest, PhoneVerificationResponse, PhoneVerificationAsyncRequest, PhoneVerificationAsyncResponse, PhoneDNCRequest, PhoneDNCResponse, PhoneDNCAsyncRequest, PhoneDNCAsyncResponse, PhoneTCPARequest, PhoneTCPAResponse, PhoneTCPAAsyncRequest, PhoneTCPAAsyncResponse, GetPropertySubscriptionsResponse, GetPropertySubscriptionDetailResponse, DeletePropertySubscriptionResponse, PropertyPermitRequest, PropertyPermitResponse, PropertySkipTraceV3Request, PropertySkipTraceV3Response, PropertySkipTraceV3AsyncRequest, PropertySkipTraceV3AsyncResponse } from "
|
|
1
|
+
import { PropertySubscriptionRequest, PropertySubscriptionResponse, PropertySearchRequest, PropertySearchResponse, AddressVerifyRequest, AddressVerifyResponse, AddressAutocompleteRequest, AddressAutocompleteResponse, AddressGeocodeRequest, AddressGeocodeResponse, AddressReverseGeocodeRequest, AddressReverseGeocodeResponse, PropertyLookupRequest, PropertyLookupResponse, PropertyLookupAsyncRequest, PropertyLookupAsyncResponse, PropertySearchAsyncRequest, PropertySearchAsyncResponse, PropertySkipTraceRequest, PropertySkipTraceResponse, PropertySkipTraceAsyncRequest, PropertySkipTraceAsyncResponse, PhoneVerificationRequest, PhoneVerificationResponse, PhoneVerificationAsyncRequest, PhoneVerificationAsyncResponse, PhoneDNCRequest, PhoneDNCResponse, PhoneDNCAsyncRequest, PhoneDNCAsyncResponse, PhoneTCPARequest, PhoneTCPAResponse, PhoneTCPAAsyncRequest, PhoneTCPAAsyncResponse, GetPropertySubscriptionsResponse, GetPropertySubscriptionDetailResponse, DeletePropertySubscriptionResponse, PropertyPermitRequest, PropertyPermitResponse, PropertySkipTraceV3Request, PropertySkipTraceV3Response, PropertySkipTraceV3AsyncRequest, PropertySkipTraceV3AsyncResponse } from "../core/types";
|
|
2
2
|
/**
|
|
3
3
|
* BatchData API Client Interface
|
|
4
4
|
*
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BatchDataClient = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const logger_interface_1 = require("
|
|
9
|
-
const builders_1 = require("
|
|
8
|
+
const logger_interface_1 = require("../core/logger.interface");
|
|
9
|
+
const builders_1 = require("../builders/builders");
|
|
10
10
|
/**
|
|
11
11
|
* BatchData API Client
|
|
12
12
|
*
|