bmlt-query-client 1.0.1 → 1.0.3

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/app.d.ts ADDED
@@ -0,0 +1,1001 @@
1
+ export declare interface BaseSearchParams {
2
+ /** Data format for response */
3
+ format?: BmltDataFormat;
4
+ /** Language code for format names */
5
+ lang_enum?: Language;
6
+ /** JSONP callback function name */
7
+ callback?: string;
8
+ }
9
+
10
+ export declare class BmltClient {
11
+ private timeout;
12
+ private userAgent;
13
+ private geocodingService?;
14
+ private rootServerURL;
15
+ private defaultFormat;
16
+ constructor(options: BmltClientOptions);
17
+ /**
18
+ * Make a request to the BMLT API
19
+ */
20
+ private makeRequest;
21
+ /**
22
+ * Search for meetings
23
+ */
24
+ searchMeetings(params?: SearchResultsParams): Promise<Meeting[]>;
25
+ /**
26
+ * Search for meetings by geographic location using geocoding
27
+ */
28
+ searchMeetingsByAddress(params: GeographicSearchParams): Promise<Meeting[]>;
29
+ /**
30
+ * Search for meetings by coordinates
31
+ */
32
+ searchMeetingsByCoordinates(coordinates: Coordinates, radiusMiles?: number, radiusKm?: number, searchParams?: Omit<SearchResultsParams, 'lat_val' | 'long_val' | 'geo_width' | 'geo_width_km'>): Promise<Meeting[]>;
33
+ /**
34
+ * Get available meeting formats
35
+ */
36
+ getFormats(params?: FormatsParams): Promise<Format[]>;
37
+ /**
38
+ * Get service bodies
39
+ */
40
+ getServiceBodies(params?: ServiceBodiesParams): Promise<ServiceBody[]>;
41
+ /**
42
+ * Get meeting changes within a date range
43
+ */
44
+ getChanges(params?: ChangesParams): Promise<Change[]>;
45
+ /**
46
+ * Get available field keys
47
+ */
48
+ getFieldKeys(): Promise<FieldKey[]>;
49
+ /**
50
+ * Get field values for a specific field key
51
+ */
52
+ getFieldValues(params: FieldValuesParams): Promise<FieldValue[]>;
53
+ /**
54
+ * Get NAWS dump for a service body (CSV format only)
55
+ */
56
+ getNAWSDump(params: NAWSDumpParams): Promise<string>;
57
+ /**
58
+ * Get server information
59
+ */
60
+ getServerInfo(): Promise<ServerInfo>;
61
+ /**
62
+ * Get server coverage area
63
+ */
64
+ getCoverageArea(): Promise<CoverageArea>;
65
+ /**
66
+ * Geocode an address using the built-in geocoding service
67
+ */
68
+ geocodeAddress(address: string, options?: Partial<GeocodeOptions>): Promise<GeocodeResult>;
69
+ /**
70
+ * Reverse geocode coordinates to an address
71
+ */
72
+ reverseGeocode(coordinates: Coordinates, options?: Partial<GeocodeOptions>): Promise<GeocodeResult>;
73
+ /**
74
+ * Get the root server URL
75
+ */
76
+ getRootServerURL(): string;
77
+ /**
78
+ * Update the root server URL
79
+ */
80
+ setRootServerURL(url: string): void;
81
+ /**
82
+ * Get the default data format
83
+ */
84
+ getDefaultFormat(): BmltDataFormat;
85
+ /**
86
+ * Set the default data format
87
+ */
88
+ setDefaultFormat(format: BmltDataFormat): void;
89
+ /**
90
+ * Get geocoding service statistics
91
+ */
92
+ getGeocodingStats(): {
93
+ queueSize: number;
94
+ pendingCount: number;
95
+ } | null;
96
+ /**
97
+ * Clear the geocoding queue
98
+ */
99
+ clearGeocodingQueue(): void;
100
+ /**
101
+ * Get the current user agent string
102
+ */
103
+ getUserAgent(): string;
104
+ /**
105
+ * Set the user agent string for HTTP requests
106
+ */
107
+ setUserAgent(userAgent: string): void;
108
+ /**
109
+ * Get the current timeout setting
110
+ */
111
+ getTimeout(): number;
112
+ /**
113
+ * Set the timeout for HTTP requests
114
+ */
115
+ setTimeout(timeout: number): void;
116
+ }
117
+
118
+ export declare interface BmltClientOptions {
119
+ /** Root server URL */
120
+ rootServerURL: string;
121
+ /** Default data format */
122
+ defaultFormat?: BmltDataFormat;
123
+ /** HTTP request timeout in milliseconds */
124
+ timeout?: number;
125
+ /** User agent string */
126
+ userAgent?: string;
127
+ /** Geocoding options */
128
+ geocodingOptions?: GeocodeOptions & RateLimitOptions;
129
+ /** Enable automatic geocoding for address searches */
130
+ enableGeocoding?: boolean;
131
+ }
132
+
133
+ /**
134
+ * Base types and enums for BMLT API
135
+ */
136
+ export declare enum BmltDataFormat {
137
+ JSON = "json",
138
+ JSONP = "jsonp",
139
+ TSML = "tsml",
140
+ CSV = "csv"
141
+ }
142
+
143
+ export declare enum BmltEndpoint {
144
+ GET_SEARCH_RESULTS = "GetSearchResults",
145
+ GET_FORMATS = "GetFormats",
146
+ GET_SERVICE_BODIES = "GetServiceBodies",
147
+ GET_CHANGES = "GetChanges",
148
+ GET_FIELD_KEYS = "GetFieldKeys",
149
+ GET_FIELD_VALUES = "GetFieldValues",
150
+ GET_NAWS_DUMP = "GetNAWSDump",
151
+ GET_SERVER_INFO = "GetServerInfo",
152
+ GET_COVERAGE_AREA = "GetCoverageArea"
153
+ }
154
+
155
+ export declare interface BmltError extends Error {
156
+ statusCode?: number;
157
+ response?: unknown;
158
+ }
159
+
160
+ /**
161
+ * Comprehensive error handling for BMLT Query Client
162
+ */
163
+ export declare enum BmltErrorType {
164
+ API_ERROR = "ApiError",
165
+ NETWORK_ERROR = "NetworkError",
166
+ VALIDATION_ERROR = "ValidationError",
167
+ GEOCODING_ERROR = "GeocodingError",
168
+ RATE_LIMIT_ERROR = "RateLimitError",
169
+ TIMEOUT_ERROR = "TimeoutError",
170
+ AUTHENTICATION_ERROR = "AuthenticationError",
171
+ SERVER_ERROR = "ServerError",
172
+ CLIENT_ERROR = "ClientError",
173
+ CONFIGURATION_ERROR = "ConfigurationError"
174
+ }
175
+
176
+ export declare class BmltQueryError extends Error {
177
+ readonly type: BmltErrorType;
178
+ readonly statusCode?: number;
179
+ readonly response?: unknown;
180
+ readonly originalError?: Error;
181
+ readonly context?: Record<string, unknown>;
182
+ constructor(type: BmltErrorType, message: string, options?: {
183
+ statusCode?: number;
184
+ response?: unknown;
185
+ originalError?: Error;
186
+ context?: Record<string, unknown>;
187
+ });
188
+ /**
189
+ * Check if error is of a specific type
190
+ */
191
+ isType(type: BmltErrorType): boolean;
192
+ /**
193
+ * Check if error is retryable
194
+ */
195
+ isRetryable(): boolean;
196
+ /**
197
+ * Check if error is a client-side error (4xx)
198
+ */
199
+ isClientError(): boolean;
200
+ /**
201
+ * Check if error is a server-side error (5xx)
202
+ */
203
+ isServerError(): boolean;
204
+ /**
205
+ * Get a user-friendly error message
206
+ */
207
+ getUserMessage(): string;
208
+ /**
209
+ * Convert error to JSON for logging
210
+ */
211
+ toJSON(): {
212
+ name: string;
213
+ type: BmltErrorType;
214
+ message: string;
215
+ statusCode: number | undefined;
216
+ response: unknown;
217
+ context: Record<string, unknown> | undefined;
218
+ stack: string | undefined;
219
+ originalError: {
220
+ name: string;
221
+ message: string;
222
+ stack: string | undefined;
223
+ } | undefined;
224
+ };
225
+ }
226
+
227
+ /**
228
+ * Build a BMLT API URL with parameters
229
+ */
230
+ export declare function buildBmltURL(options: URLBuilderOptions): string;
231
+
232
+ export declare interface Change {
233
+ /** Change ID */
234
+ change_id: string;
235
+ /** Meeting ID affected by change */
236
+ meeting_id: string;
237
+ /** Service body ID */
238
+ service_body_id: string;
239
+ /** User ID who made change */
240
+ user_id: string;
241
+ /** User name who made change */
242
+ user_name: string;
243
+ /** Change date (YYYY-MM-DD) */
244
+ change_date: string;
245
+ /** Change time (HH:MM:SS) */
246
+ change_time: string;
247
+ /** Change type */
248
+ change_type: string;
249
+ /** Change description */
250
+ change_description: string;
251
+ /** Meeting name before change */
252
+ original_meeting_name?: string;
253
+ /** Meeting name after change */
254
+ changed_meeting_name?: string;
255
+ /** JSON object with detailed changes */
256
+ json_data?: unknown;
257
+ /** Root server URI (for aggregator mode) */
258
+ root_server_uri?: string;
259
+ }
260
+
261
+ export declare interface ChangesParams extends BaseSearchParams {
262
+ /** Start date in YYYY-MM-DD format */
263
+ start_date?: string;
264
+ /** End date in YYYY-MM-DD format */
265
+ end_date?: string;
266
+ /** Specific meeting ID */
267
+ meeting_id?: number;
268
+ /** Service body ID */
269
+ service_body_id?: number;
270
+ }
271
+
272
+ export declare interface Coordinates {
273
+ latitude: number;
274
+ longitude: number;
275
+ }
276
+
277
+ export declare interface CoverageArea {
278
+ /** North boundary */
279
+ north_latitude: number;
280
+ /** South boundary */
281
+ south_latitude: number;
282
+ /** East boundary */
283
+ east_longitude: number;
284
+ /** West boundary */
285
+ west_longitude: number;
286
+ }
287
+
288
+ /**
289
+ * Factory class for creating specific error types
290
+ */
291
+ export declare class ErrorFactory {
292
+ static createApiError(message: string, statusCode?: number, response?: unknown, originalError?: Error): BmltQueryError;
293
+ static createNetworkError(message: string, originalError?: Error): BmltQueryError;
294
+ static createTimeoutError(message: string, originalError?: Error): BmltQueryError;
295
+ static createValidationError(message: string, context?: Record<string, unknown>): BmltQueryError;
296
+ static createGeocodingError(message: string, originalError?: Error, context?: Record<string, unknown>): BmltQueryError;
297
+ static createRateLimitError(message: string, statusCode?: number, response?: unknown): BmltQueryError;
298
+ static createConfigurationError(message: string, context?: Record<string, unknown>): BmltQueryError;
299
+ }
300
+
301
+ /**
302
+ * Error handler utility class
303
+ */
304
+ export declare class ErrorHandler {
305
+ /**
306
+ * Handle and transform fetch errors
307
+ */
308
+ static handleFetchError(error: unknown, response?: Response): BmltQueryError;
309
+ /**
310
+ * @deprecated Use handleFetchError instead
311
+ */
312
+ static handleAxiosError(error: any): BmltQueryError;
313
+ /**
314
+ * Handle validation errors with detailed context
315
+ */
316
+ static handleValidationError(field: string, value: unknown, expectedType: string, constraints?: string[]): BmltQueryError;
317
+ /**
318
+ * Handle endpoint validation errors
319
+ */
320
+ static handleEndpointError(endpoint: string, format: string): BmltQueryError;
321
+ /**
322
+ * Handle URL validation errors
323
+ */
324
+ static handleUrlError(url: string, reason: string): BmltQueryError;
325
+ /**
326
+ * Handle coordinate validation errors
327
+ */
328
+ static handleCoordinateError(latitude?: number, longitude?: number, reason?: string): BmltQueryError;
329
+ /**
330
+ * Wrap and enhance existing errors
331
+ */
332
+ static wrapError(originalError: Error, context: string, additionalContext?: Record<string, unknown>): BmltQueryError;
333
+ }
334
+
335
+ /**
336
+ * Extract numeric IDs from various parameter formats
337
+ */
338
+ export declare function extractIds(value: unknown): number[];
339
+
340
+ export declare interface FieldKey {
341
+ /** Field key */
342
+ key: string;
343
+ /** Field description */
344
+ description: string;
345
+ }
346
+
347
+ export declare interface FieldValue {
348
+ /** Field key */
349
+ key: string;
350
+ /** Field value */
351
+ value: string;
352
+ /** Meeting ID */
353
+ meeting_id: string;
354
+ }
355
+
356
+ export declare interface FieldValuesParams extends BaseSearchParams {
357
+ /** The field key to get values for (required) */
358
+ meeting_key: string;
359
+ /** Comma-separated list of format IDs to limit field values to */
360
+ specific_formats?: string;
361
+ /** Include all formats */
362
+ all_formats?: boolean;
363
+ }
364
+
365
+ export declare interface Format {
366
+ /** Format ID */
367
+ shared_id_bigint: string;
368
+ /** Format key string */
369
+ key_string: string;
370
+ /** Format name */
371
+ name_string: string;
372
+ /** Format description */
373
+ description_string: string;
374
+ /** Language */
375
+ lang: string;
376
+ /** Root server URI (for aggregator mode) */
377
+ root_server_uri?: string;
378
+ }
379
+
380
+ export declare interface FormatsParams extends BaseSearchParams {
381
+ /** Show all formats */
382
+ show_all?: boolean;
383
+ /** Array of format IDs to include/exclude */
384
+ format_ids?: number[];
385
+ /** Array of format key strings to filter by */
386
+ key_strings?: string[];
387
+ }
388
+
389
+ /**
390
+ * Format time values for BMLT API
391
+ */
392
+ export declare function formatTimeValue(hours?: number, minutes?: number): {
393
+ hours?: number;
394
+ minutes?: number;
395
+ };
396
+
397
+ export declare interface GeocodeOptions {
398
+ retryCount?: number;
399
+ timeout?: number;
400
+ userAgent?: string;
401
+ /** Country code for region bias (e.g., 'us', 'ca', 'gb') */
402
+ countryCode?: string;
403
+ /** Viewbox for region bias [minLon, minLat, maxLon, maxLat] */
404
+ viewbox?: [number, number, number, number];
405
+ /** Bounded search - restrict results to viewbox */
406
+ bounded?: boolean;
407
+ }
408
+
409
+ export declare interface GeocodeResult {
410
+ /** Geocoded coordinates */
411
+ coordinates: Coordinates;
412
+ /** Display name of the geocoded address */
413
+ display_name: string;
414
+ /** Geocoding confidence (0-1) */
415
+ confidence?: number;
416
+ /** Address components */
417
+ address?: {
418
+ house_number?: string;
419
+ road?: string;
420
+ neighbourhood?: string;
421
+ suburb?: string;
422
+ city?: string;
423
+ county?: string;
424
+ state?: string;
425
+ postcode?: string;
426
+ country?: string;
427
+ };
428
+ }
429
+
430
+ export declare class GeocodingService {
431
+ private baseURL;
432
+ private queue;
433
+ private readonly defaultOptions;
434
+ constructor(options?: GeocodeOptions & RateLimitOptions);
435
+ /**
436
+ * Make a fetch request with timeout and error handling
437
+ */
438
+ private fetchWithTimeout;
439
+ /**
440
+ * Geocode an address using Nominatim
441
+ */
442
+ geocode(address: string, options?: Partial<GeocodeOptions>): Promise<GeocodeResult>;
443
+ /**
444
+ * Batch geocode multiple addresses
445
+ */
446
+ batchGeocode(addresses: string[], options?: Partial<GeocodeOptions>): Promise<GeocodeResult[]>;
447
+ /**
448
+ * Reverse geocode coordinates to an address
449
+ */
450
+ reverseGeocode(coordinates: Coordinates, options?: Partial<GeocodeOptions>): Promise<GeocodeResult>;
451
+ /**
452
+ * Get the current queue size
453
+ */
454
+ getQueueSize(): number;
455
+ /**
456
+ * Get the number of pending operations
457
+ */
458
+ getPendingCount(): number;
459
+ /**
460
+ * Clear the queue
461
+ */
462
+ clearQueue(): void;
463
+ /**
464
+ * Set concurrency limit
465
+ */
466
+ setConcurrency(concurrency: number): void;
467
+ /**
468
+ * Get the current user agent string
469
+ */
470
+ getUserAgent(): string;
471
+ /**
472
+ * Set the user agent string for geocoding requests
473
+ */
474
+ setUserAgent(userAgent: string): void;
475
+ }
476
+
477
+ export declare interface GeographicSearchParams {
478
+ /** Address to geocode and search around */
479
+ address: string;
480
+ /** Search radius in miles */
481
+ radiusMiles?: number;
482
+ /** Search radius in kilometers */
483
+ radiusKm?: number;
484
+ /** Sort results by distance */
485
+ sortByDistance?: boolean;
486
+ /** Other search parameters */
487
+ searchParams?: Omit<SearchResultsParams, 'lat_val' | 'long_val' | 'geo_width' | 'geo_width_km' | 'sort_results_by_distance'>;
488
+ }
489
+
490
+ /**
491
+ * Convert kilometers to miles
492
+ */
493
+ export declare function kilometersToMiles(km: number): number;
494
+
495
+ export declare enum Language {
496
+ ENGLISH = "en",
497
+ GERMAN = "de",
498
+ DANISH = "dk",
499
+ SPANISH = "es",
500
+ PERSIAN = "fa",
501
+ FRENCH = "fr",
502
+ ITALIAN = "it",
503
+ POLISH = "pl",
504
+ PORTUGUESE = "pt",
505
+ SWEDISH = "sv"
506
+ }
507
+
508
+ export declare interface Meeting {
509
+ /** Meeting ID */
510
+ id_bigint: string;
511
+ /** Weekday (1-7) */
512
+ weekday_tinyint: number;
513
+ /** Venue type (1=In-person, 2=Virtual, 3=Hybrid) */
514
+ venue_type: number;
515
+ /** Start time (24-hour format HH:MM:SS) */
516
+ start_time: string;
517
+ /** Duration time (HH:MM:SS) */
518
+ duration_time: string;
519
+ /** Time zone */
520
+ time_zone?: string;
521
+ /** Meeting name */
522
+ meeting_name: string;
523
+ /** Location text */
524
+ location_text: string;
525
+ /** Location info */
526
+ location_info?: string;
527
+ /** Location street address */
528
+ location_street?: string;
529
+ /** Location neighborhood */
530
+ location_neighborhood?: string;
531
+ /** Location borough */
532
+ location_municipality?: string;
533
+ /** Location city/town */
534
+ location_city_subsection?: string;
535
+ /** Location postal code */
536
+ location_postal_code_1?: string;
537
+ /** Location province/state */
538
+ location_province?: string;
539
+ /** Location nation */
540
+ location_nation?: string;
541
+ /** Latitude */
542
+ latitude: number;
543
+ /** Longitude */
544
+ longitude: number;
545
+ /** Published status (0=unpublished, 1=published) */
546
+ published: number;
547
+ /** Email contact */
548
+ email_contact?: string;
549
+ /** World Committee Code */
550
+ worldid_mixed?: string;
551
+ /** Shared group ID */
552
+ shared_group_id_bigint?: string;
553
+ /** Service body ID */
554
+ service_body_bigint: string;
555
+ /** Meeting formats (comma-separated format IDs) */
556
+ format_shared_id_list?: string;
557
+ /** Meeting comments */
558
+ comments?: string;
559
+ /** Virtual meeting URL */
560
+ virtual_meeting_link?: string;
561
+ /** Virtual meeting additional info */
562
+ virtual_meeting_additional_info?: string;
563
+ /** Root server URI (for aggregator mode) */
564
+ root_server_uri?: string;
565
+ /** Distance from search point (when using geographic search) */
566
+ distance_in_km?: number;
567
+ /** Distance in miles from search point */
568
+ distance_in_miles?: number;
569
+ }
570
+
571
+ export declare class MeetingQueryBuilder {
572
+ private params;
573
+ private client;
574
+ constructor(client: BmltClient);
575
+ /**
576
+ * Include or exclude specific meeting IDs
577
+ */
578
+ meetingIds(ids: number | number[], exclude?: boolean): this;
579
+ /**
580
+ * Include meetings on specific weekdays
581
+ */
582
+ onWeekdays(...days: Weekday[]): this;
583
+ /**
584
+ * Exclude meetings on specific weekdays
585
+ */
586
+ notOnWeekdays(...days: Weekday[]): this;
587
+ /**
588
+ * Filter by venue types
589
+ */
590
+ venueTypes(...types: VenueType[]): this;
591
+ /**
592
+ * Include only in-person meetings
593
+ */
594
+ inPersonOnly(): this;
595
+ /**
596
+ * Include only virtual meetings
597
+ */
598
+ virtualOnly(): this;
599
+ /**
600
+ * Include only hybrid meetings
601
+ */
602
+ hybridOnly(): this;
603
+ /**
604
+ * Include virtual and hybrid meetings
605
+ */
606
+ virtualOrHybrid(): this;
607
+ /**
608
+ * Filter by meeting formats
609
+ */
610
+ formats(formatIds: number | number[], exclude?: boolean): this;
611
+ /**
612
+ * Use OR logic for format matching instead of AND
613
+ */
614
+ anyFormat(): this;
615
+ /**
616
+ * Filter by service bodies
617
+ */
618
+ serviceBodies(serviceBodyIds: number | number[], exclude?: boolean): this;
619
+ /**
620
+ * Include child service bodies
621
+ */
622
+ includeChildServiceBodies(): this;
623
+ /**
624
+ * Search for specific text
625
+ */
626
+ searchText(text: string): this;
627
+ /**
628
+ * Meetings starting after specific time
629
+ */
630
+ startingAfter(hours: number, minutes?: number): this;
631
+ /**
632
+ * Meetings starting before specific time
633
+ */
634
+ startingBefore(hours: number, minutes?: number): this;
635
+ /**
636
+ * Meetings ending before specific time
637
+ */
638
+ endingBefore(hours: number, minutes?: number): this;
639
+ /**
640
+ * Minimum meeting duration
641
+ */
642
+ minimumDuration(hours?: number, minutes?: number): this;
643
+ /**
644
+ * Maximum meeting duration
645
+ */
646
+ maximumDuration(hours?: number, minutes?: number): this;
647
+ /**
648
+ * Search within geographic area by coordinates
649
+ */
650
+ nearCoordinates(coordinates: Coordinates, radiusMiles?: number, radiusKm?: number): this;
651
+ /**
652
+ * Search for specific field value
653
+ */
654
+ fieldValue(fieldKey: string, value: string): this;
655
+ /**
656
+ * Return only specific fields
657
+ */
658
+ selectFields(...fields: string[]): this;
659
+ /**
660
+ * Sort results by specific fields
661
+ */
662
+ sortBy(...fields: string[]): this;
663
+ /**
664
+ * Sort by predefined aliases
665
+ */
666
+ sortByAlias(alias: SortKey): this;
667
+ /**
668
+ * Sort by distance (requires geographic search)
669
+ */
670
+ sortByDistance(): this;
671
+ /**
672
+ * Set pagination
673
+ */
674
+ paginate(pageSize: number, pageNumber?: number): this;
675
+ /**
676
+ * Include unpublished meetings
677
+ */
678
+ includeUnpublished(): this;
679
+ /**
680
+ * Include only unpublished meetings
681
+ */
682
+ unpublishedOnly(): this;
683
+ /**
684
+ * Set language for format names
685
+ */
686
+ language(lang: Language): this;
687
+ /**
688
+ * Set response format
689
+ */
690
+ format(format: BmltDataFormat): this;
691
+ /**
692
+ * Include formats used in search results
693
+ */
694
+ includeFormats(): this;
695
+ /**
696
+ * Return only formats (requires includeFormats)
697
+ */
698
+ formatsOnly(): this;
699
+ /**
700
+ * Filter by root server IDs (aggregator mode)
701
+ */
702
+ rootServerIds(serverIds: number | number[], exclude?: boolean): this;
703
+ /**
704
+ * Get the current query parameters
705
+ */
706
+ getParams(): SearchResultsParams;
707
+ /**
708
+ * Reset the query builder
709
+ */
710
+ reset(): this;
711
+ /**
712
+ * Clone the current query builder
713
+ */
714
+ clone(): MeetingQueryBuilder;
715
+ /**
716
+ * Execute the search and return results
717
+ */
718
+ execute(): Promise<Meeting[]>;
719
+ /**
720
+ * Execute the search by geocoding an address first
721
+ */
722
+ executeNearAddress(address: string, radiusMiles?: number, radiusKm?: number, sortByDistance?: boolean): Promise<Meeting[]>;
723
+ }
724
+
725
+ /**
726
+ * Convert miles to kilometers
727
+ */
728
+ export declare function milesToKilometers(miles: number): number;
729
+
730
+ export declare interface NAWSDumpParams extends Record<string, unknown> {
731
+ /** Service body ID (required) */
732
+ sb_id: number;
733
+ }
734
+
735
+ export declare interface NominatimResponse {
736
+ place_id: number;
737
+ licence: string;
738
+ osm_type: string;
739
+ osm_id: number;
740
+ lat: string;
741
+ lon: string;
742
+ display_name: string;
743
+ address?: {
744
+ house_number?: string;
745
+ road?: string;
746
+ neighbourhood?: string;
747
+ suburb?: string;
748
+ city?: string;
749
+ town?: string;
750
+ village?: string;
751
+ county?: string;
752
+ state?: string;
753
+ postcode?: string;
754
+ country?: string;
755
+ country_code?: string;
756
+ };
757
+ importance?: number;
758
+ boundingbox: string[];
759
+ }
760
+
761
+ /**
762
+ * Normalize parameter values for BMLT API
763
+ */
764
+ export declare function normalizeParameters(params: Record<string, unknown>): Record<string, unknown>;
765
+
766
+ /**
767
+ * Convenience methods for common search patterns
768
+ */
769
+ export declare class QuickSearch {
770
+ private client;
771
+ constructor(client: BmltClient);
772
+ /**
773
+ * Search for today's meetings
774
+ */
775
+ today(): MeetingQueryBuilder;
776
+ /**
777
+ * Search for weekend meetings
778
+ */
779
+ weekend(): MeetingQueryBuilder;
780
+ /**
781
+ * Search for weekday meetings
782
+ */
783
+ weekdays(): MeetingQueryBuilder;
784
+ /**
785
+ * Search for evening meetings (after 5 PM)
786
+ */
787
+ evening(): MeetingQueryBuilder;
788
+ /**
789
+ * Search for morning meetings (before 12 PM)
790
+ */
791
+ morning(): MeetingQueryBuilder;
792
+ /**
793
+ * Search for virtual meetings only
794
+ */
795
+ virtual(): MeetingQueryBuilder;
796
+ /**
797
+ * Search for in-person meetings only
798
+ */
799
+ inPerson(): MeetingQueryBuilder;
800
+ /**
801
+ * Search by meeting name or location
802
+ */
803
+ byText(searchText: string): MeetingQueryBuilder;
804
+ }
805
+
806
+ export declare interface RateLimitOptions {
807
+ intervalCap?: number;
808
+ interval?: number;
809
+ carryoverConcurrencyCount?: boolean;
810
+ concurrency?: number;
811
+ }
812
+
813
+ export declare class RetryHandler {
814
+ static withRetry<T>(operation: () => Promise<T>, options: RetryOptions): Promise<T>;
815
+ }
816
+
817
+ /**
818
+ * Retry utility for handling retryable errors
819
+ */
820
+ export declare interface RetryOptions {
821
+ maxRetries: number;
822
+ baseDelay: number;
823
+ maxDelay: number;
824
+ factor: number;
825
+ onRetry?: (error: BmltQueryError, attempt: number) => void;
826
+ }
827
+
828
+ export declare interface SearchResultsParams extends BaseSearchParams {
829
+ /** Include specific meeting IDs (positive) or exclude (negative) */
830
+ meeting_ids?: number | number[];
831
+ /** Include formats used in search results */
832
+ get_used_formats?: boolean;
833
+ /** Return only formats (requires get_used_formats=true) */
834
+ get_formats_only?: boolean;
835
+ /** Include meetings on specific days */
836
+ weekdays?: Weekday | Weekday[];
837
+ /** Include meetings with specific venue types */
838
+ venue_types?: VenueType | VenueType[];
839
+ /** Include meetings with specific formats */
840
+ formats?: number | number[];
841
+ /** Use OR logic for format matching (default is AND) */
842
+ formats_comparison_operator?: 'OR';
843
+ /** Include meetings from specific service bodies */
844
+ services?: number | number[];
845
+ /** Include child service bodies when filtering by services */
846
+ recursive?: boolean;
847
+ /** Search for specific text */
848
+ SearchString?: string;
849
+ /** Search radius for geographic searches */
850
+ SearchStringRadius?: number;
851
+ /** Meetings starting after hour (0-23) */
852
+ StartsAfterH?: number;
853
+ /** Meetings starting after minute (0-59) */
854
+ StartsAfterM?: number;
855
+ /** Meetings starting before hour (0-23) */
856
+ StartsBeforeH?: number;
857
+ /** Meetings starting before minute (0-59) */
858
+ StartsBeforeM?: number;
859
+ /** Meetings ending before hour (0-23) */
860
+ EndsBeforeH?: number;
861
+ /** Meetings ending before minute (0-59) */
862
+ EndsBeforeM?: number;
863
+ /** Minimum duration in hours */
864
+ MinDurationH?: number;
865
+ /** Minimum duration in minutes */
866
+ MinDurationM?: number;
867
+ /** Maximum duration in hours */
868
+ MaxDurationH?: number;
869
+ /** Maximum duration in minutes */
870
+ MaxDurationM?: number;
871
+ /** Latitude for geographic search */
872
+ lat_val?: number;
873
+ /** Longitude for geographic search */
874
+ long_val?: number;
875
+ /** Search radius in miles */
876
+ geo_width?: number;
877
+ /** Search radius in kilometers */
878
+ geo_width_km?: number;
879
+ /** Sort results by distance when using geographic search */
880
+ sort_results_by_distance?: boolean;
881
+ /** Search for specific field value */
882
+ meeting_key?: string;
883
+ /** The value to search for */
884
+ meeting_key_value?: string;
885
+ /** Return only specific fields (comma-separated) */
886
+ data_field_key?: string;
887
+ /** Sort results by specific fields (comma-separated) */
888
+ sort_keys?: string;
889
+ /** Use predefined sort aliases */
890
+ sort_key?: SortKey;
891
+ /** Number of results per page */
892
+ page_size?: number;
893
+ /** Page number (defaults to 1) */
894
+ page_num?: number;
895
+ /** Published status: undefined=published only, 0=all, -1=unpublished only */
896
+ advanced_published?: 0 | -1;
897
+ /** Include specific root server IDs (for aggregator mode) */
898
+ root_server_ids?: number | number[];
899
+ }
900
+
901
+ export declare interface ServerInfo {
902
+ /** Server version */
903
+ version: string;
904
+ /** Available endpoints */
905
+ availableEndpoints: string[];
906
+ /** Supported formats */
907
+ supportedFormats: string[];
908
+ /** Supported languages */
909
+ langs: string[];
910
+ /** Native language */
911
+ nativeLang: string;
912
+ /** Server name */
913
+ name?: string;
914
+ /** Server description */
915
+ description?: string;
916
+ /** Coverage area information */
917
+ coverageArea?: CoverageArea;
918
+ }
919
+
920
+ export declare interface ServiceBodiesParams extends BaseSearchParams {
921
+ /** Array of service body IDs to include/exclude */
922
+ services?: number[];
923
+ /** Include child service bodies */
924
+ recursive?: boolean;
925
+ /** Include parent service bodies */
926
+ parents?: boolean;
927
+ }
928
+
929
+ export declare interface ServiceBody {
930
+ /** Service body ID */
931
+ id: string;
932
+ /** Service body name */
933
+ name: string;
934
+ /** Service body description */
935
+ description?: string;
936
+ /** Service body type */
937
+ type: string;
938
+ /** Service body URL */
939
+ url?: string;
940
+ /** Help line */
941
+ helpline?: string;
942
+ /** World service committee code */
943
+ world_id?: string;
944
+ /** Parent service body ID */
945
+ parent_id?: string;
946
+ /** Root server URI (for aggregator mode) */
947
+ root_server_uri?: string;
948
+ }
949
+
950
+ export declare enum SortKey {
951
+ WEEKDAY = "weekday",
952
+ TIME = "time",
953
+ TOWN = "town",
954
+ STATE = "state",
955
+ WEEKDAY_STATE = "weekday_state"
956
+ }
957
+
958
+ export declare interface URLBuilderOptions {
959
+ rootServerURL: string;
960
+ format: BmltDataFormat;
961
+ endpoint: BmltEndpoint;
962
+ parameters?: Record<string, unknown>;
963
+ }
964
+
965
+ /**
966
+ * Validate coordinate values
967
+ */
968
+ export declare function validateCoordinates(latitude: number, longitude: number): void;
969
+
970
+ /**
971
+ * Validate endpoint/format combinations
972
+ */
973
+ export declare function validateEndpointFormat(endpoint: BmltEndpoint, format: BmltDataFormat): void;
974
+
975
+ /**
976
+ * Validate radius values
977
+ */
978
+ export declare function validateRadius(radius: number): void;
979
+
980
+ /**
981
+ * Clean and validate a root server URL
982
+ */
983
+ export declare function validateRootServerURL(url: string): string;
984
+
985
+ export declare enum VenueType {
986
+ IN_PERSON = 1,
987
+ VIRTUAL = 2,
988
+ HYBRID = 3
989
+ }
990
+
991
+ export declare enum Weekday {
992
+ SUNDAY = 1,
993
+ MONDAY = 2,
994
+ TUESDAY = 3,
995
+ WEDNESDAY = 4,
996
+ THURSDAY = 5,
997
+ FRIDAY = 6,
998
+ SATURDAY = 7
999
+ }
1000
+
1001
+ export { }