@land-catalyst/batch-data-sdk 1.1.19 → 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/builders.d.ts +2 -1
- package/dist/builders/builders.js +20 -2
- package/dist/core/types.d.ts +13 -2
- package/package.json +1 -1
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,7 @@
|
|
|
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 "../core/types";
|
|
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
20
|
import type { PropertyFieldMetadata } from "../property-field/metadata";
|
|
21
21
|
/**
|
|
22
22
|
* Base interface for all builders
|
|
@@ -735,6 +735,7 @@ export declare class DeliveryConfigBuilder {
|
|
|
735
735
|
static from(config: DeliveryConfig): DeliveryConfigBuilder;
|
|
736
736
|
webhook(url: string, headers?: Record<string, string>, errorUrl?: string): this;
|
|
737
737
|
kinesis(streamName: string, region: string, iamAccessKeyId: string, iamSecretAccessKey: string): this;
|
|
738
|
+
eventHub(config: EventHubConfig): this;
|
|
738
739
|
build(): DeliveryConfig;
|
|
739
740
|
}
|
|
740
741
|
/**
|
|
@@ -90,7 +90,7 @@ class BaseBuilder {
|
|
|
90
90
|
getSearchCriteriaFieldMetadata(searchCriteriaPath) {
|
|
91
91
|
// Dynamic import to avoid circular dependency
|
|
92
92
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
93
|
-
const { getSearchCriteriaFieldMetadata } = require("../property-field/utils");
|
|
93
|
+
const { getSearchCriteriaFieldMetadata, } = require("../property-field/utils");
|
|
94
94
|
return getSearchCriteriaFieldMetadata(searchCriteriaPath);
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
@@ -2095,9 +2095,14 @@ class DeliveryConfigBuilder {
|
|
|
2095
2095
|
this.config.iamSecretAccessKey = iamSecretAccessKey;
|
|
2096
2096
|
return this;
|
|
2097
2097
|
}
|
|
2098
|
+
eventHub(config) {
|
|
2099
|
+
this.config.type = "event-hub";
|
|
2100
|
+
this.config.eventHub = config;
|
|
2101
|
+
return this;
|
|
2102
|
+
}
|
|
2098
2103
|
build() {
|
|
2099
2104
|
if (!this.config.type) {
|
|
2100
|
-
throw new Error("Delivery type (webhook or
|
|
2105
|
+
throw new Error("Delivery type (webhook, kinesis, or event-hub) is required");
|
|
2101
2106
|
}
|
|
2102
2107
|
if (this.config.type === "webhook" && !this.config.url) {
|
|
2103
2108
|
throw new Error("URL is required for webhook delivery");
|
|
@@ -2110,6 +2115,19 @@ class DeliveryConfigBuilder {
|
|
|
2110
2115
|
throw new Error("Stream name, region, IAM access key ID, and secret access key are required for Kinesis delivery");
|
|
2111
2116
|
}
|
|
2112
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
|
+
}
|
|
2113
2131
|
return this.config;
|
|
2114
2132
|
}
|
|
2115
2133
|
}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -379,10 +379,20 @@ export interface SearchCriteria {
|
|
|
379
379
|
or?: OrSearchCriteria[];
|
|
380
380
|
}
|
|
381
381
|
/**
|
|
382
|
-
*
|
|
382
|
+
* Event Hub configuration for Azure Event Hubs
|
|
383
|
+
*/
|
|
384
|
+
export interface EventHubConfig {
|
|
385
|
+
fullyQualifiedNamespace: string;
|
|
386
|
+
clientId: string;
|
|
387
|
+
tenantId: string;
|
|
388
|
+
clientSecret: string;
|
|
389
|
+
eventHubName: string;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Delivery configuration for webhook, Kinesis, or Event Hub
|
|
383
393
|
*/
|
|
384
394
|
export interface DeliveryConfig {
|
|
385
|
-
type: "webhook" | "kinesis";
|
|
395
|
+
type: "webhook" | "kinesis" | "event-hub";
|
|
386
396
|
streamName?: string;
|
|
387
397
|
region?: string;
|
|
388
398
|
iamAccessKeyId?: string;
|
|
@@ -390,6 +400,7 @@ export interface DeliveryConfig {
|
|
|
390
400
|
url?: string;
|
|
391
401
|
errorUrl?: string;
|
|
392
402
|
headers?: Record<string, string>;
|
|
403
|
+
eventHub?: EventHubConfig;
|
|
393
404
|
}
|
|
394
405
|
/**
|
|
395
406
|
* Property subscription request payload
|
package/package.json
CHANGED