@vepler/sdk 2.6.6 → 2.8.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.
Files changed (224) hide show
  1. package/README.md +7 -0
  2. package/dist/commonjs/funcs/searchSearchSuggest.d.ts +17 -0
  3. package/dist/commonjs/funcs/searchSearchSuggest.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/searchSearchSuggest.js +120 -0
  5. package/dist/commonjs/funcs/searchSearchSuggest.js.map +1 -0
  6. package/dist/commonjs/funcs/systemCheckSearchHealth.d.ts +17 -0
  7. package/dist/commonjs/funcs/systemCheckSearchHealth.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/systemCheckSearchHealth.js +104 -0
  9. package/dist/commonjs/funcs/systemCheckSearchHealth.js.map +1 -0
  10. package/dist/commonjs/lib/config.d.ts +4 -4
  11. package/dist/commonjs/lib/config.js +4 -4
  12. package/dist/commonjs/sdk/models/operations/index.d.ts +1 -0
  13. package/dist/commonjs/sdk/models/operations/index.d.ts.map +1 -1
  14. package/dist/commonjs/sdk/models/operations/index.js +1 -0
  15. package/dist/commonjs/sdk/models/operations/index.js.map +1 -1
  16. package/dist/commonjs/sdk/models/operations/searchsuggest.d.ts +136 -0
  17. package/dist/commonjs/sdk/models/operations/searchsuggest.d.ts.map +1 -0
  18. package/dist/commonjs/sdk/models/operations/searchsuggest.js +135 -0
  19. package/dist/commonjs/sdk/models/operations/searchsuggest.js.map +1 -0
  20. package/dist/commonjs/sdk/models/shared/avmpredictrequest.d.ts +13 -3
  21. package/dist/commonjs/sdk/models/shared/avmpredictrequest.d.ts.map +1 -1
  22. package/dist/commonjs/sdk/models/shared/avmpredictrequest.js +11 -1
  23. package/dist/commonjs/sdk/models/shared/avmpredictrequest.js.map +1 -1
  24. package/dist/commonjs/sdk/models/shared/chargeentry.d.ts +1 -1
  25. package/dist/commonjs/sdk/models/shared/chargeentry.d.ts.map +1 -1
  26. package/dist/commonjs/sdk/models/shared/chargeentry.js +1 -1
  27. package/dist/commonjs/sdk/models/shared/chargeentry.js.map +1 -1
  28. package/dist/commonjs/sdk/models/shared/chargehistory.d.ts +1 -1
  29. package/dist/commonjs/sdk/models/shared/chargehistory.d.ts.map +1 -1
  30. package/dist/commonjs/sdk/models/shared/chargehistory.js +1 -1
  31. package/dist/commonjs/sdk/models/shared/chargehistory.js.map +1 -1
  32. package/dist/commonjs/sdk/models/shared/counciltaxbanddetails.d.ts +4 -4
  33. package/dist/commonjs/sdk/models/shared/counciltaxbanddetails.d.ts.map +1 -1
  34. package/dist/commonjs/sdk/models/shared/counciltaxbanddetails.js +4 -4
  35. package/dist/commonjs/sdk/models/shared/counciltaxbanddetails.js.map +1 -1
  36. package/dist/commonjs/sdk/models/shared/epcdata.d.ts +7 -7
  37. package/dist/commonjs/sdk/models/shared/epcdata.d.ts.map +1 -1
  38. package/dist/commonjs/sdk/models/shared/epcdata.js +7 -7
  39. package/dist/commonjs/sdk/models/shared/epcdata.js.map +1 -1
  40. package/dist/commonjs/sdk/models/shared/index.d.ts +3 -0
  41. package/dist/commonjs/sdk/models/shared/index.d.ts.map +1 -1
  42. package/dist/commonjs/sdk/models/shared/index.js +3 -0
  43. package/dist/commonjs/sdk/models/shared/index.js.map +1 -1
  44. package/dist/commonjs/sdk/models/shared/lease.d.ts +1 -1
  45. package/dist/commonjs/sdk/models/shared/lease.d.ts.map +1 -1
  46. package/dist/commonjs/sdk/models/shared/lease.js +1 -1
  47. package/dist/commonjs/sdk/models/shared/lease.js.map +1 -1
  48. package/dist/commonjs/sdk/models/shared/listing.d.ts +4 -4
  49. package/dist/commonjs/sdk/models/shared/listing.d.ts.map +1 -1
  50. package/dist/commonjs/sdk/models/shared/listing.js +4 -4
  51. package/dist/commonjs/sdk/models/shared/listing.js.map +1 -1
  52. package/dist/commonjs/sdk/models/shared/listingimage.d.ts +1 -1
  53. package/dist/commonjs/sdk/models/shared/listingimage.d.ts.map +1 -1
  54. package/dist/commonjs/sdk/models/shared/listingimage.js +1 -1
  55. package/dist/commonjs/sdk/models/shared/listingimage.js.map +1 -1
  56. package/dist/commonjs/sdk/models/shared/listingpricechange.d.ts +4 -4
  57. package/dist/commonjs/sdk/models/shared/listingpricechange.d.ts.map +1 -1
  58. package/dist/commonjs/sdk/models/shared/listingpricechange.js +4 -5
  59. package/dist/commonjs/sdk/models/shared/listingpricechange.js.map +1 -1
  60. package/dist/commonjs/sdk/models/shared/pricechange.d.ts +4 -4
  61. package/dist/commonjs/sdk/models/shared/pricechange.d.ts.map +1 -1
  62. package/dist/commonjs/sdk/models/shared/pricechange.js +4 -5
  63. package/dist/commonjs/sdk/models/shared/pricechange.js.map +1 -1
  64. package/dist/commonjs/sdk/models/shared/pricingdata.d.ts +1 -1
  65. package/dist/commonjs/sdk/models/shared/pricingdata.d.ts.map +1 -1
  66. package/dist/commonjs/sdk/models/shared/pricingdata.js +1 -1
  67. package/dist/commonjs/sdk/models/shared/pricingdata.js.map +1 -1
  68. package/dist/commonjs/sdk/models/shared/searchhighlight.d.ts +21 -0
  69. package/dist/commonjs/sdk/models/shared/searchhighlight.d.ts.map +1 -0
  70. package/dist/commonjs/sdk/models/shared/searchhighlight.js +52 -0
  71. package/dist/commonjs/sdk/models/shared/searchhighlight.js.map +1 -0
  72. package/dist/commonjs/sdk/models/shared/searchresponse.d.ts +109 -0
  73. package/dist/commonjs/sdk/models/shared/searchresponse.d.ts.map +1 -0
  74. package/dist/commonjs/sdk/models/shared/searchresponse.js +96 -0
  75. package/dist/commonjs/sdk/models/shared/searchresponse.js.map +1 -0
  76. package/dist/commonjs/sdk/models/shared/searchresult.d.ts +106 -0
  77. package/dist/commonjs/sdk/models/shared/searchresult.d.ts.map +1 -0
  78. package/dist/commonjs/sdk/models/shared/searchresult.js +86 -0
  79. package/dist/commonjs/sdk/models/shared/searchresult.js.map +1 -0
  80. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  81. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  82. package/dist/commonjs/sdk/sdk.js +4 -0
  83. package/dist/commonjs/sdk/sdk.js.map +1 -1
  84. package/dist/commonjs/sdk/search.d.ts +12 -0
  85. package/dist/commonjs/sdk/search.d.ts.map +1 -0
  86. package/dist/commonjs/sdk/search.js +22 -0
  87. package/dist/commonjs/sdk/search.js.map +1 -0
  88. package/dist/commonjs/sdk/system.d.ts +7 -0
  89. package/dist/commonjs/sdk/system.d.ts.map +1 -1
  90. package/dist/commonjs/sdk/system.js +10 -0
  91. package/dist/commonjs/sdk/system.js.map +1 -1
  92. package/dist/commonjs/sdk/types/enums.d.ts +10 -6
  93. package/dist/commonjs/sdk/types/enums.d.ts.map +1 -1
  94. package/dist/commonjs/sdk/types/enums.js +76 -2
  95. package/dist/commonjs/sdk/types/enums.js.map +1 -1
  96. package/dist/commonjs/sdk/types/index.d.ts +0 -1
  97. package/dist/commonjs/sdk/types/index.d.ts.map +1 -1
  98. package/dist/commonjs/sdk/types/index.js +1 -3
  99. package/dist/commonjs/sdk/types/index.js.map +1 -1
  100. package/dist/esm/funcs/searchSearchSuggest.d.ts +17 -0
  101. package/dist/esm/funcs/searchSearchSuggest.d.ts.map +1 -0
  102. package/dist/esm/funcs/searchSearchSuggest.js +84 -0
  103. package/dist/esm/funcs/searchSearchSuggest.js.map +1 -0
  104. package/dist/esm/funcs/systemCheckSearchHealth.d.ts +17 -0
  105. package/dist/esm/funcs/systemCheckSearchHealth.d.ts.map +1 -0
  106. package/dist/esm/funcs/systemCheckSearchHealth.js +68 -0
  107. package/dist/esm/funcs/systemCheckSearchHealth.js.map +1 -0
  108. package/dist/esm/lib/config.d.ts +4 -4
  109. package/dist/esm/lib/config.js +4 -4
  110. package/dist/esm/sdk/models/operations/index.d.ts +1 -0
  111. package/dist/esm/sdk/models/operations/index.d.ts.map +1 -1
  112. package/dist/esm/sdk/models/operations/index.js +1 -0
  113. package/dist/esm/sdk/models/operations/index.js.map +1 -1
  114. package/dist/esm/sdk/models/operations/searchsuggest.d.ts +136 -0
  115. package/dist/esm/sdk/models/operations/searchsuggest.d.ts.map +1 -0
  116. package/dist/esm/sdk/models/operations/searchsuggest.js +93 -0
  117. package/dist/esm/sdk/models/operations/searchsuggest.js.map +1 -0
  118. package/dist/esm/sdk/models/shared/avmpredictrequest.d.ts +13 -3
  119. package/dist/esm/sdk/models/shared/avmpredictrequest.d.ts.map +1 -1
  120. package/dist/esm/sdk/models/shared/avmpredictrequest.js +11 -1
  121. package/dist/esm/sdk/models/shared/avmpredictrequest.js.map +1 -1
  122. package/dist/esm/sdk/models/shared/chargeentry.d.ts +1 -1
  123. package/dist/esm/sdk/models/shared/chargeentry.d.ts.map +1 -1
  124. package/dist/esm/sdk/models/shared/chargeentry.js +1 -1
  125. package/dist/esm/sdk/models/shared/chargeentry.js.map +1 -1
  126. package/dist/esm/sdk/models/shared/chargehistory.d.ts +1 -1
  127. package/dist/esm/sdk/models/shared/chargehistory.d.ts.map +1 -1
  128. package/dist/esm/sdk/models/shared/chargehistory.js +1 -1
  129. package/dist/esm/sdk/models/shared/chargehistory.js.map +1 -1
  130. package/dist/esm/sdk/models/shared/counciltaxbanddetails.d.ts +4 -4
  131. package/dist/esm/sdk/models/shared/counciltaxbanddetails.d.ts.map +1 -1
  132. package/dist/esm/sdk/models/shared/counciltaxbanddetails.js +4 -4
  133. package/dist/esm/sdk/models/shared/counciltaxbanddetails.js.map +1 -1
  134. package/dist/esm/sdk/models/shared/epcdata.d.ts +7 -7
  135. package/dist/esm/sdk/models/shared/epcdata.d.ts.map +1 -1
  136. package/dist/esm/sdk/models/shared/epcdata.js +7 -7
  137. package/dist/esm/sdk/models/shared/epcdata.js.map +1 -1
  138. package/dist/esm/sdk/models/shared/index.d.ts +3 -0
  139. package/dist/esm/sdk/models/shared/index.d.ts.map +1 -1
  140. package/dist/esm/sdk/models/shared/index.js +3 -0
  141. package/dist/esm/sdk/models/shared/index.js.map +1 -1
  142. package/dist/esm/sdk/models/shared/lease.d.ts +1 -1
  143. package/dist/esm/sdk/models/shared/lease.d.ts.map +1 -1
  144. package/dist/esm/sdk/models/shared/lease.js +1 -1
  145. package/dist/esm/sdk/models/shared/lease.js.map +1 -1
  146. package/dist/esm/sdk/models/shared/listing.d.ts +4 -4
  147. package/dist/esm/sdk/models/shared/listing.d.ts.map +1 -1
  148. package/dist/esm/sdk/models/shared/listing.js +4 -4
  149. package/dist/esm/sdk/models/shared/listing.js.map +1 -1
  150. package/dist/esm/sdk/models/shared/listingimage.d.ts +1 -1
  151. package/dist/esm/sdk/models/shared/listingimage.d.ts.map +1 -1
  152. package/dist/esm/sdk/models/shared/listingimage.js +1 -1
  153. package/dist/esm/sdk/models/shared/listingimage.js.map +1 -1
  154. package/dist/esm/sdk/models/shared/listingpricechange.d.ts +4 -4
  155. package/dist/esm/sdk/models/shared/listingpricechange.d.ts.map +1 -1
  156. package/dist/esm/sdk/models/shared/listingpricechange.js +4 -5
  157. package/dist/esm/sdk/models/shared/listingpricechange.js.map +1 -1
  158. package/dist/esm/sdk/models/shared/pricechange.d.ts +4 -4
  159. package/dist/esm/sdk/models/shared/pricechange.d.ts.map +1 -1
  160. package/dist/esm/sdk/models/shared/pricechange.js +4 -5
  161. package/dist/esm/sdk/models/shared/pricechange.js.map +1 -1
  162. package/dist/esm/sdk/models/shared/pricingdata.d.ts +1 -1
  163. package/dist/esm/sdk/models/shared/pricingdata.d.ts.map +1 -1
  164. package/dist/esm/sdk/models/shared/pricingdata.js +1 -1
  165. package/dist/esm/sdk/models/shared/pricingdata.js.map +1 -1
  166. package/dist/esm/sdk/models/shared/searchhighlight.d.ts +21 -0
  167. package/dist/esm/sdk/models/shared/searchhighlight.d.ts.map +1 -0
  168. package/dist/esm/sdk/models/shared/searchhighlight.js +15 -0
  169. package/dist/esm/sdk/models/shared/searchhighlight.js.map +1 -0
  170. package/dist/esm/sdk/models/shared/searchresponse.d.ts +109 -0
  171. package/dist/esm/sdk/models/shared/searchresponse.d.ts.map +1 -0
  172. package/dist/esm/sdk/models/shared/searchresponse.js +58 -0
  173. package/dist/esm/sdk/models/shared/searchresponse.js.map +1 -0
  174. package/dist/esm/sdk/models/shared/searchresult.d.ts +106 -0
  175. package/dist/esm/sdk/models/shared/searchresult.d.ts.map +1 -0
  176. package/dist/esm/sdk/models/shared/searchresult.js +48 -0
  177. package/dist/esm/sdk/models/shared/searchresult.js.map +1 -0
  178. package/dist/esm/sdk/sdk.d.ts +3 -0
  179. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  180. package/dist/esm/sdk/sdk.js +4 -0
  181. package/dist/esm/sdk/sdk.js.map +1 -1
  182. package/dist/esm/sdk/search.d.ts +12 -0
  183. package/dist/esm/sdk/search.d.ts.map +1 -0
  184. package/dist/esm/sdk/search.js +18 -0
  185. package/dist/esm/sdk/search.js.map +1 -0
  186. package/dist/esm/sdk/system.d.ts +7 -0
  187. package/dist/esm/sdk/system.d.ts.map +1 -1
  188. package/dist/esm/sdk/system.js +10 -0
  189. package/dist/esm/sdk/system.js.map +1 -1
  190. package/dist/esm/sdk/types/enums.d.ts +10 -6
  191. package/dist/esm/sdk/types/enums.d.ts.map +1 -1
  192. package/dist/esm/sdk/types/enums.js +38 -1
  193. package/dist/esm/sdk/types/enums.js.map +1 -1
  194. package/dist/esm/sdk/types/index.d.ts +0 -1
  195. package/dist/esm/sdk/types/index.d.ts.map +1 -1
  196. package/dist/esm/sdk/types/index.js +0 -1
  197. package/dist/esm/sdk/types/index.js.map +1 -1
  198. package/jsr.json +1 -1
  199. package/package.json +1 -1
  200. package/src/funcs/searchSearchSuggest.ts +167 -0
  201. package/src/funcs/systemCheckSearchHealth.ts +140 -0
  202. package/src/lib/config.ts +4 -4
  203. package/src/sdk/models/operations/index.ts +1 -0
  204. package/src/sdk/models/operations/searchsuggest.ts +276 -0
  205. package/src/sdk/models/shared/avmpredictrequest.ts +13 -3
  206. package/src/sdk/models/shared/chargeentry.ts +2 -2
  207. package/src/sdk/models/shared/chargehistory.ts +2 -2
  208. package/src/sdk/models/shared/counciltaxbanddetails.ts +8 -8
  209. package/src/sdk/models/shared/epcdata.ts +14 -14
  210. package/src/sdk/models/shared/index.ts +3 -0
  211. package/src/sdk/models/shared/lease.ts +2 -2
  212. package/src/sdk/models/shared/listing.ts +8 -8
  213. package/src/sdk/models/shared/listingimage.ts +2 -2
  214. package/src/sdk/models/shared/listingpricechange.ts +10 -9
  215. package/src/sdk/models/shared/pricechange.ts +10 -9
  216. package/src/sdk/models/shared/pricingdata.ts +2 -2
  217. package/src/sdk/models/shared/searchhighlight.ts +44 -0
  218. package/src/sdk/models/shared/searchresponse.ts +161 -0
  219. package/src/sdk/models/shared/searchresult.ts +161 -0
  220. package/src/sdk/sdk.ts +6 -0
  221. package/src/sdk/search.ts +27 -0
  222. package/src/sdk/system.ts +16 -0
  223. package/src/sdk/types/enums.ts +55 -6
  224. package/src/sdk/types/index.ts +0 -1
@@ -25,11 +25,11 @@ export type ListingPriceChange = {
25
25
  /**
26
26
  * Amount of change in pence
27
27
  */
28
- amount?: number | undefined;
28
+ amount?: number | null | undefined;
29
29
  /**
30
30
  * Date of price change
31
31
  */
32
- date?: Date | undefined;
32
+ date?: Date | null | undefined;
33
33
  /**
34
34
  * Direction of price change
35
35
  */
@@ -37,11 +37,11 @@ export type ListingPriceChange = {
37
37
  /**
38
38
  * Percentage change
39
39
  */
40
- percent?: number | undefined;
40
+ percent?: number | null | undefined;
41
41
  /**
42
42
  * New price after change in pence
43
43
  */
44
- price?: number | undefined;
44
+ price?: number | null | undefined;
45
45
  };
46
46
 
47
47
  /** @internal */
@@ -54,12 +54,13 @@ export const ListingPriceChange$inboundSchema: z.ZodType<
54
54
  z.ZodTypeDef,
55
55
  unknown
56
56
  > = z.object({
57
- amount: z.number().optional(),
58
- date: z.string().datetime({ offset: true }).transform(v => new Date(v))
59
- .optional(),
57
+ amount: z.nullable(z.number()).optional(),
58
+ date: z.nullable(
59
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
60
+ ).optional(),
60
61
  direction: Direction$inboundSchema.optional(),
61
- percent: z.number().optional(),
62
- price: z.number().optional(),
62
+ percent: z.nullable(z.number()).optional(),
63
+ price: z.nullable(z.number()).optional(),
63
64
  });
64
65
 
65
66
  export function listingPriceChangeFromJSON(
@@ -16,11 +16,11 @@ export const PriceChangeDirection = {
16
16
  export type PriceChangeDirection = ClosedEnum<typeof PriceChangeDirection>;
17
17
 
18
18
  export type PriceChange = {
19
- amount?: number | undefined;
20
- date?: Date | undefined;
19
+ amount?: number | null | undefined;
20
+ date?: Date | null | undefined;
21
21
  direction?: PriceChangeDirection | undefined;
22
- percent?: number | undefined;
23
- price?: number | undefined;
22
+ percent?: number | null | undefined;
23
+ price?: number | null | undefined;
24
24
  };
25
25
 
26
26
  /** @internal */
@@ -34,12 +34,13 @@ export const PriceChange$inboundSchema: z.ZodType<
34
34
  z.ZodTypeDef,
35
35
  unknown
36
36
  > = z.object({
37
- amount: z.number().optional(),
38
- date: z.string().datetime({ offset: true }).transform(v => new Date(v))
39
- .optional(),
37
+ amount: z.nullable(z.number()).optional(),
38
+ date: z.nullable(
39
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
40
+ ).optional(),
40
41
  direction: PriceChangeDirection$inboundSchema.optional(),
41
- percent: z.number().optional(),
42
- price: z.number().optional(),
42
+ percent: z.nullable(z.number()).optional(),
43
+ price: z.nullable(z.number()).optional(),
43
44
  });
44
45
 
45
46
  export function priceChangeFromJSON(
@@ -8,7 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  export type PricingData = {
11
- currency?: string | undefined;
11
+ currency?: string | null | undefined;
12
12
  currentRent?: number | null | undefined;
13
13
  currentSale?: number | null | undefined;
14
14
  estimatedRent?: number | null | undefined;
@@ -21,7 +21,7 @@ export const PricingData$inboundSchema: z.ZodType<
21
21
  z.ZodTypeDef,
22
22
  unknown
23
23
  > = z.object({
24
- currency: z.string().optional(),
24
+ currency: z.nullable(z.string()).optional(),
25
25
  currentRent: z.nullable(z.number()).optional(),
26
26
  currentSale: z.nullable(z.number()).optional(),
27
27
  estimatedRent: z.nullable(z.number()).optional(),
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type SearchHighlight = {
11
+ /**
12
+ * Field name that was highlighted
13
+ */
14
+ field: string;
15
+ /**
16
+ * Highlighted text fragments with match context
17
+ */
18
+ fragments: Array<string>;
19
+ /**
20
+ * Terms that matched in this field
21
+ */
22
+ matchedTerms?: Array<string> | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const SearchHighlight$inboundSchema: z.ZodType<
27
+ SearchHighlight,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ field: z.string(),
32
+ fragments: z.array(z.string()),
33
+ matchedTerms: z.array(z.string()).optional(),
34
+ });
35
+
36
+ export function searchHighlightFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<SearchHighlight, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) => SearchHighlight$inboundSchema.parse(JSON.parse(x)),
42
+ `Failed to parse 'SearchHighlight' from JSON`,
43
+ );
44
+ }
@@ -0,0 +1,161 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { SearchResult, SearchResult$inboundSchema } from "./searchresult.js";
11
+
12
+ /**
13
+ * Pattern detected in the search query:
14
+ *
15
+ * @remarks
16
+ * - postcode: UK postcode (e.g., SW1A 1AA or SW1A for outward code)
17
+ * - address: Full or partial address with house number (e.g., 10 Downing Street)
18
+ * - general: No specific pattern detected (general location search)
19
+ */
20
+ export const QueryPattern = {
21
+ Postcode: "postcode",
22
+ Address: "address",
23
+ General: "general",
24
+ } as const;
25
+ /**
26
+ * Pattern detected in the search query:
27
+ *
28
+ * @remarks
29
+ * - postcode: UK postcode (e.g., SW1A 1AA or SW1A for outward code)
30
+ * - address: Full or partial address with house number (e.g., 10 Downing Street)
31
+ * - general: No specific pattern detected (general location search)
32
+ */
33
+ export type QueryPattern = ClosedEnum<typeof QueryPattern>;
34
+
35
+ /**
36
+ * Data source to search:
37
+ *
38
+ * @remarks
39
+ * - address: UK property addresses with UPRN, full address details, and geocoding
40
+ * - location: UK postcodes, places, towns, and geographic locations
41
+ */
42
+ export const Sources = {
43
+ Address: "address",
44
+ Location: "location",
45
+ } as const;
46
+ /**
47
+ * Data source to search:
48
+ *
49
+ * @remarks
50
+ * - address: UK property addresses with UPRN, full address details, and geocoding
51
+ * - location: UK postcodes, places, towns, and geographic locations
52
+ */
53
+ export type Sources = ClosedEnum<typeof Sources>;
54
+
55
+ /**
56
+ * Search metadata
57
+ */
58
+ export type Metadata = {
59
+ /**
60
+ * Query processing time (e.g., '45ms')
61
+ */
62
+ processingTime?: string | undefined;
63
+ /**
64
+ * Pattern detected in the search query:
65
+ *
66
+ * @remarks
67
+ * - postcode: UK postcode (e.g., SW1A 1AA or SW1A for outward code)
68
+ * - address: Full or partial address with house number (e.g., 10 Downing Street)
69
+ * - general: No specific pattern detected (general location search)
70
+ */
71
+ queryPattern?: QueryPattern | undefined;
72
+ /**
73
+ * Data sources used in search
74
+ */
75
+ sources?: Array<Sources> | undefined;
76
+ };
77
+
78
+ export type SearchResponse = {
79
+ /**
80
+ * Whether more results are available
81
+ */
82
+ hasMore?: boolean | undefined;
83
+ /**
84
+ * Search metadata
85
+ */
86
+ metadata?: Metadata | undefined;
87
+ /**
88
+ * Offset for next page of results
89
+ */
90
+ nextOffset?: number | undefined;
91
+ /**
92
+ * Array of search results
93
+ */
94
+ results: Array<SearchResult>;
95
+ /**
96
+ * Number of results returned in this response
97
+ */
98
+ size: number;
99
+ /**
100
+ * Whether the search was successful
101
+ */
102
+ success: boolean;
103
+ /**
104
+ * Total number of results found
105
+ */
106
+ totalResults: number;
107
+ };
108
+
109
+ /** @internal */
110
+ export const QueryPattern$inboundSchema: z.ZodNativeEnum<typeof QueryPattern> =
111
+ z.nativeEnum(QueryPattern);
112
+
113
+ /** @internal */
114
+ export const Sources$inboundSchema: z.ZodNativeEnum<typeof Sources> = z
115
+ .nativeEnum(Sources);
116
+
117
+ /** @internal */
118
+ export const Metadata$inboundSchema: z.ZodType<
119
+ Metadata,
120
+ z.ZodTypeDef,
121
+ unknown
122
+ > = z.object({
123
+ processingTime: z.string().optional(),
124
+ queryPattern: QueryPattern$inboundSchema.optional(),
125
+ sources: z.array(Sources$inboundSchema).optional(),
126
+ });
127
+
128
+ export function metadataFromJSON(
129
+ jsonString: string,
130
+ ): SafeParseResult<Metadata, SDKValidationError> {
131
+ return safeParse(
132
+ jsonString,
133
+ (x) => Metadata$inboundSchema.parse(JSON.parse(x)),
134
+ `Failed to parse 'Metadata' from JSON`,
135
+ );
136
+ }
137
+
138
+ /** @internal */
139
+ export const SearchResponse$inboundSchema: z.ZodType<
140
+ SearchResponse,
141
+ z.ZodTypeDef,
142
+ unknown
143
+ > = z.object({
144
+ hasMore: z.boolean().optional(),
145
+ metadata: z.lazy(() => Metadata$inboundSchema).optional(),
146
+ nextOffset: z.number().optional(),
147
+ results: z.array(SearchResult$inboundSchema),
148
+ size: z.number(),
149
+ success: z.boolean(),
150
+ totalResults: z.number(),
151
+ });
152
+
153
+ export function searchResponseFromJSON(
154
+ jsonString: string,
155
+ ): SafeParseResult<SearchResponse, SDKValidationError> {
156
+ return safeParse(
157
+ jsonString,
158
+ (x) => SearchResponse$inboundSchema.parse(JSON.parse(x)),
159
+ `Failed to parse 'SearchResponse' from JSON`,
160
+ );
161
+ }
@@ -0,0 +1,161 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ SearchHighlight,
12
+ SearchHighlight$inboundSchema,
13
+ } from "./searchhighlight.js";
14
+
15
+ /**
16
+ * WGS84 coordinate pair
17
+ */
18
+ export type Coordinates = {
19
+ /**
20
+ * Latitude in decimal degrees
21
+ */
22
+ lat: number;
23
+ /**
24
+ * Longitude in decimal degrees
25
+ */
26
+ lng: number;
27
+ };
28
+
29
+ /**
30
+ * Data source to search:
31
+ *
32
+ * @remarks
33
+ * - address: UK property addresses with UPRN, full address details, and geocoding
34
+ * - location: UK postcodes, places, towns, and geographic locations
35
+ */
36
+ export const Source = {
37
+ Address: "address",
38
+ Location: "location",
39
+ } as const;
40
+ /**
41
+ * Data source to search:
42
+ *
43
+ * @remarks
44
+ * - address: UK property addresses with UPRN, full address details, and geocoding
45
+ * - location: UK postcodes, places, towns, and geographic locations
46
+ */
47
+ export type Source = ClosedEnum<typeof Source>;
48
+
49
+ export type SearchResult = {
50
+ /**
51
+ * Formatted address
52
+ */
53
+ address?: string | undefined;
54
+ /**
55
+ * Result description
56
+ */
57
+ description?: string | undefined;
58
+ /**
59
+ * Distance from query point in meters
60
+ */
61
+ distance?: number | undefined;
62
+ /**
63
+ * Highlighted matching text from search query
64
+ */
65
+ highlights?: Array<SearchHighlight> | undefined;
66
+ /**
67
+ * Unique result identifier
68
+ */
69
+ id: string;
70
+ /**
71
+ * WGS84 coordinate pair
72
+ */
73
+ location?: Coordinates | undefined;
74
+ /**
75
+ * Additional result-specific metadata (varies by result type)
76
+ */
77
+ metadata?: { [k: string]: any | null } | undefined;
78
+ /**
79
+ * URL path to view full details
80
+ */
81
+ path?: string | undefined;
82
+ /**
83
+ * Normalised relevance score (0-1)
84
+ */
85
+ relevanceScore: number;
86
+ /**
87
+ * Raw search score
88
+ */
89
+ score: number;
90
+ /**
91
+ * Data source to search:
92
+ *
93
+ * @remarks
94
+ * - address: UK property addresses with UPRN, full address details, and geocoding
95
+ * - location: UK postcodes, places, towns, and geographic locations
96
+ */
97
+ source: Source;
98
+ /**
99
+ * Result title
100
+ */
101
+ title: string;
102
+ /**
103
+ * Result type (address, postcode, location, etc.)
104
+ */
105
+ type: string;
106
+ };
107
+
108
+ /** @internal */
109
+ export const Coordinates$inboundSchema: z.ZodType<
110
+ Coordinates,
111
+ z.ZodTypeDef,
112
+ unknown
113
+ > = z.object({
114
+ lat: z.number(),
115
+ lng: z.number(),
116
+ });
117
+
118
+ export function coordinatesFromJSON(
119
+ jsonString: string,
120
+ ): SafeParseResult<Coordinates, SDKValidationError> {
121
+ return safeParse(
122
+ jsonString,
123
+ (x) => Coordinates$inboundSchema.parse(JSON.parse(x)),
124
+ `Failed to parse 'Coordinates' from JSON`,
125
+ );
126
+ }
127
+
128
+ /** @internal */
129
+ export const Source$inboundSchema: z.ZodNativeEnum<typeof Source> = z
130
+ .nativeEnum(Source);
131
+
132
+ /** @internal */
133
+ export const SearchResult$inboundSchema: z.ZodType<
134
+ SearchResult,
135
+ z.ZodTypeDef,
136
+ unknown
137
+ > = z.object({
138
+ address: z.string().optional(),
139
+ description: z.string().optional(),
140
+ distance: z.number().optional(),
141
+ highlights: z.array(SearchHighlight$inboundSchema).optional(),
142
+ id: z.string(),
143
+ location: z.lazy(() => Coordinates$inboundSchema).optional(),
144
+ metadata: z.record(z.nullable(z.any())).optional(),
145
+ path: z.string().optional(),
146
+ relevanceScore: z.number(),
147
+ score: z.number(),
148
+ source: Source$inboundSchema,
149
+ title: z.string(),
150
+ type: z.string(),
151
+ });
152
+
153
+ export function searchResultFromJSON(
154
+ jsonString: string,
155
+ ): SafeParseResult<SearchResult, SDKValidationError> {
156
+ return safeParse(
157
+ jsonString,
158
+ (x) => SearchResult$inboundSchema.parse(JSON.parse(x)),
159
+ `Failed to parse 'SearchResult' from JSON`,
160
+ );
161
+ }
package/src/sdk/sdk.ts CHANGED
@@ -15,6 +15,7 @@ import { Poi } from "./poi.js";
15
15
  import { Property } from "./property.js";
16
16
  import { Safety } from "./safety.js";
17
17
  import { Schools } from "./schools.js";
18
+ import { Search } from "./search.js";
18
19
  import { Streets } from "./streets.js";
19
20
  import { System } from "./system.js";
20
21
 
@@ -88,4 +89,9 @@ export class SDK extends ClientSDK {
88
89
  get schools(): Schools {
89
90
  return (this._schools ??= new Schools(this._options));
90
91
  }
92
+
93
+ private _search?: Search;
94
+ get search(): Search {
95
+ return (this._search ??= new Search(this._options));
96
+ }
91
97
  }
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { searchSearchSuggest } from "../funcs/searchSearchSuggest.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as operations from "./models/operations/index.js";
8
+ import { unwrapAsync } from "./types/fp.js";
9
+
10
+ export class Search extends ClientSDK {
11
+ /**
12
+ * Autocomplete search for UK addresses and locations
13
+ *
14
+ * @remarks
15
+ * Simple autocomplete for UK properties and locations. Searches across Address and Location sources with fuzzy matching. Automatically detects query type (postcode, address, place name) and returns suggestions.
16
+ */
17
+ async searchSuggest(
18
+ request: operations.SearchSuggestRequest,
19
+ options?: RequestOptions,
20
+ ): Promise<operations.SearchSuggestResponse> {
21
+ return unwrapAsync(searchSearchSuggest(
22
+ this,
23
+ request,
24
+ options,
25
+ ));
26
+ }
27
+ }
package/src/sdk/system.ts CHANGED
@@ -9,6 +9,7 @@ import { systemCheckListingsHealth } from "../funcs/systemCheckListingsHealth.js
9
9
  import { systemCheckLocationHealth } from "../funcs/systemCheckLocationHealth.js";
10
10
  import { systemCheckPlanningHealth } from "../funcs/systemCheckPlanningHealth.js";
11
11
  import { systemCheckPropertyHealth } from "../funcs/systemCheckPropertyHealth.js";
12
+ import { systemCheckSearchHealth } from "../funcs/systemCheckSearchHealth.js";
12
13
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
13
14
  import * as operations from "./models/operations/index.js";
14
15
  import * as shared from "./models/shared/index.js";
@@ -119,4 +120,19 @@ export class System extends ClientSDK {
119
120
  options,
120
121
  ));
121
122
  }
123
+
124
+ /**
125
+ * Search service health check
126
+ *
127
+ * @remarks
128
+ * Check if the search service is operational
129
+ */
130
+ async checkSearchHealth(
131
+ options?: RequestOptions,
132
+ ): Promise<shared.HealthResponse> {
133
+ return unwrapAsync(systemCheckSearchHealth(
134
+ this,
135
+ options,
136
+ ));
137
+ }
122
138
  }
@@ -2,15 +2,64 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ import * as z from "zod/v3";
6
+
5
7
  declare const __brand: unique symbol;
6
8
  export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
9
+ export type ClosedEnum<T extends Readonly<Record<string, string | number>>> =
10
+ T[keyof T];
11
+ export type OpenEnum<T extends Readonly<Record<string, string | number>>> =
12
+ | T[keyof T]
13
+ | Unrecognized<T[keyof T] extends number ? number : string>;
7
14
 
8
- export function catchUnrecognizedEnum<T>(value: T): Unrecognized<T> {
15
+ function unrecognized<T>(value: T): Unrecognized<T> {
16
+ unrecognizedCount++;
9
17
  return value as Unrecognized<T>;
10
18
  }
11
19
 
12
- type Prettify<T> = { [K in keyof T]: T[K] } & {};
13
- export type ClosedEnum<T> = T[keyof T];
14
- export type OpenEnum<T> =
15
- | Prettify<T[keyof T]>
16
- | Unrecognized<T[keyof T] extends number ? number : string>;
20
+ let unrecognizedCount = 0;
21
+ let refCount = 0;
22
+ export function unrecognizedCounter() {
23
+ refCount++;
24
+ const start = unrecognizedCount;
25
+ return {
26
+ count: () => {
27
+ const count = unrecognizedCount - start;
28
+ if (--refCount === 0) unrecognizedCount = 0;
29
+ return count;
30
+ },
31
+ };
32
+ }
33
+
34
+ export function inboundSchema<T extends Record<string, string>>(
35
+ enumObj: T,
36
+ ): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown> {
37
+ const options = Object.values(enumObj);
38
+ return z.union([
39
+ ...options.map(x => z.literal(x)),
40
+ z.string().transform(x => unrecognized(x)),
41
+ ] as any);
42
+ }
43
+
44
+ export function inboundSchemaInt<T extends Record<string, number | string>>(
45
+ enumObj: T,
46
+ ): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown> {
47
+ // For numeric enums, Object.values returns both numbers and string keys
48
+ const options = Object.values(enumObj).filter(v => typeof v === "number");
49
+ return z.union([
50
+ ...options.map(x => z.literal(x)),
51
+ z.number().int().transform(x => unrecognized(x)),
52
+ ] as any);
53
+ }
54
+
55
+ export function outboundSchema<T extends Record<string, string>>(
56
+ _: T,
57
+ ): z.ZodType<string, z.ZodTypeDef, OpenEnum<T>> {
58
+ return z.string() as any;
59
+ }
60
+
61
+ export function outboundSchemaInt<T extends Record<string, number | string>>(
62
+ _: T,
63
+ ): z.ZodType<number, z.ZodTypeDef, OpenEnum<T>> {
64
+ return z.number().int() as any;
65
+ }
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  export { blobLikeSchema, isBlobLike } from "./blobs.js";
6
- export { catchUnrecognizedEnum } from "./enums.js";
7
6
  export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js";
8
7
  export type { Result } from "./fp.js";
9
8
  export type { PageIterator, Paginator } from "./operations.js";