@vepler/sdk 2.18.12 → 2.20.2

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 (171) hide show
  1. package/README.md +7 -0
  2. package/dist/commonjs/funcs/councilsGet.d.ts +17 -0
  3. package/dist/commonjs/funcs/councilsGet.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/councilsGet.js +119 -0
  5. package/dist/commonjs/funcs/councilsGet.js.map +1 -0
  6. package/dist/commonjs/funcs/councilsList.d.ts +17 -0
  7. package/dist/commonjs/funcs/councilsList.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/councilsList.js +119 -0
  9. package/dist/commonjs/funcs/councilsList.js.map +1 -0
  10. package/dist/commonjs/lib/config.d.ts +3 -3
  11. package/dist/commonjs/lib/config.js +3 -3
  12. package/dist/commonjs/lib/config.js.map +1 -1
  13. package/dist/commonjs/sdk/councils.d.ts +19 -0
  14. package/dist/commonjs/sdk/councils.d.ts.map +1 -0
  15. package/dist/commonjs/sdk/councils.js +32 -0
  16. package/dist/commonjs/sdk/councils.js.map +1 -0
  17. package/dist/commonjs/sdk/models/operations/getcouncilbyproviderid.d.ts +19 -0
  18. package/dist/commonjs/sdk/models/operations/getcouncilbyproviderid.d.ts.map +1 -0
  19. package/dist/commonjs/sdk/models/operations/getcouncilbyproviderid.js +60 -0
  20. package/dist/commonjs/sdk/models/operations/getcouncilbyproviderid.js.map +1 -0
  21. package/dist/commonjs/sdk/models/operations/index.d.ts +2 -0
  22. package/dist/commonjs/sdk/models/operations/index.d.ts.map +1 -1
  23. package/dist/commonjs/sdk/models/operations/index.js +2 -0
  24. package/dist/commonjs/sdk/models/operations/index.js.map +1 -1
  25. package/dist/commonjs/sdk/models/operations/listcouncils.d.ts +78 -0
  26. package/dist/commonjs/sdk/models/operations/listcouncils.d.ts.map +1 -0
  27. package/dist/commonjs/sdk/models/operations/listcouncils.js +96 -0
  28. package/dist/commonjs/sdk/models/operations/listcouncils.js.map +1 -0
  29. package/dist/commonjs/sdk/models/operations/resolveaddress.d.ts +115 -0
  30. package/dist/commonjs/sdk/models/operations/resolveaddress.d.ts.map +1 -1
  31. package/dist/commonjs/sdk/models/operations/resolveaddress.js +61 -1
  32. package/dist/commonjs/sdk/models/operations/resolveaddress.js.map +1 -1
  33. package/dist/commonjs/sdk/models/shared/council.d.ts +131 -0
  34. package/dist/commonjs/sdk/models/shared/council.d.ts.map +1 -0
  35. package/dist/commonjs/sdk/models/shared/council.js +115 -0
  36. package/dist/commonjs/sdk/models/shared/council.js.map +1 -0
  37. package/dist/commonjs/sdk/models/shared/councilbranding.d.ts +32 -0
  38. package/dist/commonjs/sdk/models/shared/councilbranding.d.ts.map +1 -0
  39. package/dist/commonjs/sdk/models/shared/councilbranding.js +65 -0
  40. package/dist/commonjs/sdk/models/shared/councilbranding.js.map +1 -0
  41. package/dist/commonjs/sdk/models/shared/councilcontactdetails.d.ts +47 -0
  42. package/dist/commonjs/sdk/models/shared/councilcontactdetails.d.ts.map +1 -0
  43. package/dist/commonjs/sdk/models/shared/councilcontactdetails.js +79 -0
  44. package/dist/commonjs/sdk/models/shared/councilcontactdetails.js.map +1 -0
  45. package/dist/commonjs/sdk/models/shared/councilerrorresponse.d.ts +29 -0
  46. package/dist/commonjs/sdk/models/shared/councilerrorresponse.d.ts.map +1 -0
  47. package/dist/commonjs/sdk/models/shared/councilerrorresponse.js +70 -0
  48. package/dist/commonjs/sdk/models/shared/councilerrorresponse.js.map +1 -0
  49. package/dist/commonjs/sdk/models/shared/councillistresponse.d.ts +43 -0
  50. package/dist/commonjs/sdk/models/shared/councillistresponse.d.ts.map +1 -0
  51. package/dist/commonjs/sdk/models/shared/councillistresponse.js +69 -0
  52. package/dist/commonjs/sdk/models/shared/councillistresponse.js.map +1 -0
  53. package/dist/commonjs/sdk/models/shared/councilmetadata.d.ts +34 -0
  54. package/dist/commonjs/sdk/models/shared/councilmetadata.d.ts.map +1 -0
  55. package/dist/commonjs/sdk/models/shared/councilmetadata.js +59 -0
  56. package/dist/commonjs/sdk/models/shared/councilmetadata.js.map +1 -0
  57. package/dist/commonjs/sdk/models/shared/councilserviceurls.d.ts +26 -0
  58. package/dist/commonjs/sdk/models/shared/councilserviceurls.d.ts.map +1 -0
  59. package/dist/commonjs/sdk/models/shared/councilserviceurls.js +60 -0
  60. package/dist/commonjs/sdk/models/shared/councilserviceurls.js.map +1 -0
  61. package/dist/commonjs/sdk/models/shared/index.d.ts +7 -0
  62. package/dist/commonjs/sdk/models/shared/index.d.ts.map +1 -1
  63. package/dist/commonjs/sdk/models/shared/index.js +7 -0
  64. package/dist/commonjs/sdk/models/shared/index.js.map +1 -1
  65. package/dist/commonjs/sdk/models/shared/listing.d.ts +8 -8
  66. package/dist/commonjs/sdk/models/shared/listing.d.ts.map +1 -1
  67. package/dist/commonjs/sdk/models/shared/listing.js +8 -8
  68. package/dist/commonjs/sdk/models/shared/listing.js.map +1 -1
  69. package/dist/commonjs/sdk/models/shared/school.d.ts +8 -8
  70. package/dist/commonjs/sdk/models/shared/school.d.ts.map +1 -1
  71. package/dist/commonjs/sdk/models/shared/school.js +9 -10
  72. package/dist/commonjs/sdk/models/shared/school.js.map +1 -1
  73. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  74. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  75. package/dist/commonjs/sdk/sdk.js +4 -0
  76. package/dist/commonjs/sdk/sdk.js.map +1 -1
  77. package/dist/esm/funcs/councilsGet.d.ts +17 -0
  78. package/dist/esm/funcs/councilsGet.d.ts.map +1 -0
  79. package/dist/esm/funcs/councilsGet.js +83 -0
  80. package/dist/esm/funcs/councilsGet.js.map +1 -0
  81. package/dist/esm/funcs/councilsList.d.ts +17 -0
  82. package/dist/esm/funcs/councilsList.d.ts.map +1 -0
  83. package/dist/esm/funcs/councilsList.js +83 -0
  84. package/dist/esm/funcs/councilsList.js.map +1 -0
  85. package/dist/esm/lib/config.d.ts +3 -3
  86. package/dist/esm/lib/config.js +3 -3
  87. package/dist/esm/lib/config.js.map +1 -1
  88. package/dist/esm/sdk/councils.d.ts +19 -0
  89. package/dist/esm/sdk/councils.d.ts.map +1 -0
  90. package/dist/esm/sdk/councils.js +28 -0
  91. package/dist/esm/sdk/councils.js.map +1 -0
  92. package/dist/esm/sdk/models/operations/getcouncilbyproviderid.d.ts +19 -0
  93. package/dist/esm/sdk/models/operations/getcouncilbyproviderid.d.ts.map +1 -0
  94. package/dist/esm/sdk/models/operations/getcouncilbyproviderid.js +22 -0
  95. package/dist/esm/sdk/models/operations/getcouncilbyproviderid.js.map +1 -0
  96. package/dist/esm/sdk/models/operations/index.d.ts +2 -0
  97. package/dist/esm/sdk/models/operations/index.d.ts.map +1 -1
  98. package/dist/esm/sdk/models/operations/index.js +2 -0
  99. package/dist/esm/sdk/models/operations/index.js.map +1 -1
  100. package/dist/esm/sdk/models/operations/listcouncils.d.ts +78 -0
  101. package/dist/esm/sdk/models/operations/listcouncils.d.ts.map +1 -0
  102. package/dist/esm/sdk/models/operations/listcouncils.js +58 -0
  103. package/dist/esm/sdk/models/operations/listcouncils.js.map +1 -0
  104. package/dist/esm/sdk/models/operations/resolveaddress.d.ts +115 -0
  105. package/dist/esm/sdk/models/operations/resolveaddress.d.ts.map +1 -1
  106. package/dist/esm/sdk/models/operations/resolveaddress.js +57 -0
  107. package/dist/esm/sdk/models/operations/resolveaddress.js.map +1 -1
  108. package/dist/esm/sdk/models/shared/council.d.ts +131 -0
  109. package/dist/esm/sdk/models/shared/council.d.ts.map +1 -0
  110. package/dist/esm/sdk/models/shared/council.js +78 -0
  111. package/dist/esm/sdk/models/shared/council.js.map +1 -0
  112. package/dist/esm/sdk/models/shared/councilbranding.d.ts +32 -0
  113. package/dist/esm/sdk/models/shared/councilbranding.d.ts.map +1 -0
  114. package/dist/esm/sdk/models/shared/councilbranding.js +27 -0
  115. package/dist/esm/sdk/models/shared/councilbranding.js.map +1 -0
  116. package/dist/esm/sdk/models/shared/councilcontactdetails.d.ts +47 -0
  117. package/dist/esm/sdk/models/shared/councilcontactdetails.d.ts.map +1 -0
  118. package/dist/esm/sdk/models/shared/councilcontactdetails.js +40 -0
  119. package/dist/esm/sdk/models/shared/councilcontactdetails.js.map +1 -0
  120. package/dist/esm/sdk/models/shared/councilerrorresponse.d.ts +29 -0
  121. package/dist/esm/sdk/models/shared/councilerrorresponse.d.ts.map +1 -0
  122. package/dist/esm/sdk/models/shared/councilerrorresponse.js +32 -0
  123. package/dist/esm/sdk/models/shared/councilerrorresponse.js.map +1 -0
  124. package/dist/esm/sdk/models/shared/councillistresponse.d.ts +43 -0
  125. package/dist/esm/sdk/models/shared/councillistresponse.d.ts.map +1 -0
  126. package/dist/esm/sdk/models/shared/councillistresponse.js +32 -0
  127. package/dist/esm/sdk/models/shared/councillistresponse.js.map +1 -0
  128. package/dist/esm/sdk/models/shared/councilmetadata.d.ts +34 -0
  129. package/dist/esm/sdk/models/shared/councilmetadata.d.ts.map +1 -0
  130. package/dist/esm/sdk/models/shared/councilmetadata.js +22 -0
  131. package/dist/esm/sdk/models/shared/councilmetadata.js.map +1 -0
  132. package/dist/esm/sdk/models/shared/councilserviceurls.d.ts +26 -0
  133. package/dist/esm/sdk/models/shared/councilserviceurls.d.ts.map +1 -0
  134. package/dist/esm/sdk/models/shared/councilserviceurls.js +23 -0
  135. package/dist/esm/sdk/models/shared/councilserviceurls.js.map +1 -0
  136. package/dist/esm/sdk/models/shared/index.d.ts +7 -0
  137. package/dist/esm/sdk/models/shared/index.d.ts.map +1 -1
  138. package/dist/esm/sdk/models/shared/index.js +7 -0
  139. package/dist/esm/sdk/models/shared/index.js.map +1 -1
  140. package/dist/esm/sdk/models/shared/listing.d.ts +8 -8
  141. package/dist/esm/sdk/models/shared/listing.d.ts.map +1 -1
  142. package/dist/esm/sdk/models/shared/listing.js +7 -7
  143. package/dist/esm/sdk/models/shared/listing.js.map +1 -1
  144. package/dist/esm/sdk/models/shared/school.d.ts +8 -8
  145. package/dist/esm/sdk/models/shared/school.d.ts.map +1 -1
  146. package/dist/esm/sdk/models/shared/school.js +7 -8
  147. package/dist/esm/sdk/models/shared/school.js.map +1 -1
  148. package/dist/esm/sdk/sdk.d.ts +3 -0
  149. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  150. package/dist/esm/sdk/sdk.js +4 -0
  151. package/dist/esm/sdk/sdk.js.map +1 -1
  152. package/package.json +1 -1
  153. package/src/funcs/councilsGet.ts +167 -0
  154. package/src/funcs/councilsList.ts +167 -0
  155. package/src/lib/config.ts +3 -3
  156. package/src/sdk/councils.ts +45 -0
  157. package/src/sdk/models/operations/getcouncilbyproviderid.ts +61 -0
  158. package/src/sdk/models/operations/index.ts +2 -0
  159. package/src/sdk/models/operations/listcouncils.ts +131 -0
  160. package/src/sdk/models/operations/resolveaddress.ts +182 -0
  161. package/src/sdk/models/shared/council.ts +191 -0
  162. package/src/sdk/models/shared/councilbranding.ts +77 -0
  163. package/src/sdk/models/shared/councilcontactdetails.ts +112 -0
  164. package/src/sdk/models/shared/councilerrorresponse.ts +73 -0
  165. package/src/sdk/models/shared/councillistresponse.ts +80 -0
  166. package/src/sdk/models/shared/councilmetadata.ts +64 -0
  167. package/src/sdk/models/shared/councilserviceurls.ts +57 -0
  168. package/src/sdk/models/shared/index.ts +7 -0
  169. package/src/sdk/models/shared/listing.ts +13 -13
  170. package/src/sdk/models/shared/school.ts +24 -21
  171. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,131 @@
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 * as shared from "../shared/index.js";
11
+
12
+ /**
13
+ * Filter by country code (GB = Great Britain, IE = Ireland)
14
+ */
15
+ export const Country = {
16
+ Gb: "GB",
17
+ Ie: "IE",
18
+ } as const;
19
+ /**
20
+ * Filter by country code (GB = Great Britain, IE = Ireland)
21
+ */
22
+ export type Country = ClosedEnum<typeof Country>;
23
+
24
+ /**
25
+ * Filter by council status
26
+ */
27
+ export const QueryParamStatus = {
28
+ Active: "active",
29
+ Merged: "merged",
30
+ Abolished: "abolished",
31
+ Inactive: "inactive",
32
+ } as const;
33
+ /**
34
+ * Filter by council status
35
+ */
36
+ export type QueryParamStatus = ClosedEnum<typeof QueryParamStatus>;
37
+
38
+ /**
39
+ * Filter by council type
40
+ */
41
+ export const QueryParamType = {
42
+ Unitary: "unitary",
43
+ Metropolitan: "metropolitan",
44
+ County: "county",
45
+ LondonBorough: "london_borough",
46
+ District: "district",
47
+ LocalAuthority: "local_authority",
48
+ } as const;
49
+ /**
50
+ * Filter by council type
51
+ */
52
+ export type QueryParamType = ClosedEnum<typeof QueryParamType>;
53
+
54
+ export type ListCouncilsRequest = {
55
+ /**
56
+ * Filter by country code (GB = Great Britain, IE = Ireland)
57
+ */
58
+ country?: Country | undefined;
59
+ /**
60
+ * Filter by council status
61
+ */
62
+ status?: QueryParamStatus | undefined;
63
+ /**
64
+ * Filter by council type
65
+ */
66
+ type?: QueryParamType | undefined;
67
+ };
68
+
69
+ export type ListCouncilsResponse =
70
+ | shared.CouncilListResponse
71
+ | shared.CouncilErrorResponse;
72
+
73
+ /** @internal */
74
+ export const Country$outboundSchema: z.ZodNativeEnum<typeof Country> = z
75
+ .nativeEnum(Country);
76
+
77
+ /** @internal */
78
+ export const QueryParamStatus$outboundSchema: z.ZodNativeEnum<
79
+ typeof QueryParamStatus
80
+ > = z.nativeEnum(QueryParamStatus);
81
+
82
+ /** @internal */
83
+ export const QueryParamType$outboundSchema: z.ZodNativeEnum<
84
+ typeof QueryParamType
85
+ > = z.nativeEnum(QueryParamType);
86
+
87
+ /** @internal */
88
+ export type ListCouncilsRequest$Outbound = {
89
+ country?: string | undefined;
90
+ status?: string | undefined;
91
+ type?: string | undefined;
92
+ };
93
+
94
+ /** @internal */
95
+ export const ListCouncilsRequest$outboundSchema: z.ZodType<
96
+ ListCouncilsRequest$Outbound,
97
+ z.ZodTypeDef,
98
+ ListCouncilsRequest
99
+ > = z.object({
100
+ country: Country$outboundSchema.optional(),
101
+ status: QueryParamStatus$outboundSchema.optional(),
102
+ type: QueryParamType$outboundSchema.optional(),
103
+ });
104
+
105
+ export function listCouncilsRequestToJSON(
106
+ listCouncilsRequest: ListCouncilsRequest,
107
+ ): string {
108
+ return JSON.stringify(
109
+ ListCouncilsRequest$outboundSchema.parse(listCouncilsRequest),
110
+ );
111
+ }
112
+
113
+ /** @internal */
114
+ export const ListCouncilsResponse$inboundSchema: z.ZodType<
115
+ ListCouncilsResponse,
116
+ z.ZodTypeDef,
117
+ unknown
118
+ > = z.union([
119
+ shared.CouncilListResponse$inboundSchema,
120
+ shared.CouncilErrorResponse$inboundSchema,
121
+ ]);
122
+
123
+ export function listCouncilsResponseFromJSON(
124
+ jsonString: string,
125
+ ): SafeParseResult<ListCouncilsResponse, SDKValidationError> {
126
+ return safeParse(
127
+ jsonString,
128
+ (x) => ListCouncilsResponse$inboundSchema.parse(JSON.parse(x)),
129
+ `Failed to parse 'ListCouncilsResponse' from JSON`,
130
+ );
131
+ }
@@ -110,10 +110,109 @@ export const ConfidenceZone = {
110
110
  */
111
111
  export type ConfidenceZone = ClosedEnum<typeof ConfidenceZone>;
112
112
 
113
+ /**
114
+ * Recommended action based on match quality
115
+ */
116
+ export const Action = {
117
+ Accept: "accept",
118
+ Review: "review",
119
+ Reject: "reject",
120
+ } as const;
121
+ /**
122
+ * Recommended action based on match quality
123
+ */
124
+ export type Action = ClosedEnum<typeof Action>;
125
+
126
+ /**
127
+ * Individual factors contributing to quality assessment
128
+ */
129
+ export type Factors = {
130
+ /**
131
+ * Significant confidence gap from second result
132
+ */
133
+ hasClearWinner: boolean;
134
+ /**
135
+ * Top result has high absolute confidence
136
+ */
137
+ hasHighConfidence: boolean;
138
+ /**
139
+ * Building number matched exactly (score = 1.0)
140
+ */
141
+ hasPerfectBuildingMatch: boolean;
142
+ /**
143
+ * Only one candidate found
144
+ */
145
+ isSingleResult: boolean;
146
+ };
147
+
148
+ /**
149
+ * Quality grade: A (excellent), B (good), C (acceptable), D (poor), F (fail)
150
+ */
151
+ export const Grade = {
152
+ A: "A",
153
+ B: "B",
154
+ C: "C",
155
+ D: "D",
156
+ F: "F",
157
+ } as const;
158
+ /**
159
+ * Quality grade: A (excellent), B (good), C (acceptable), D (poor), F (fail)
160
+ */
161
+ export type Grade = ClosedEnum<typeof Grade>;
162
+
163
+ /**
164
+ * Smart match quality evaluation (considers building scores, confidence gaps, unambiguity)
165
+ */
166
+ export type MatchQuality = {
167
+ /**
168
+ * Recommended action based on match quality
169
+ */
170
+ action: Action;
171
+ /**
172
+ * Individual factors contributing to quality assessment
173
+ */
174
+ factors: Factors;
175
+ /**
176
+ * Quality grade: A (excellent), B (good), C (acceptable), D (poor), F (fail)
177
+ */
178
+ grade: Grade;
179
+ /**
180
+ * Whether the match is reliable enough for automatic use
181
+ */
182
+ isReliable: boolean;
183
+ /**
184
+ * Human-readable explanation of the quality assessment
185
+ */
186
+ reason: string;
187
+ /**
188
+ * Confidence gap between top 2 results (0-100)
189
+ */
190
+ unambiguityScore: number;
191
+ };
192
+
193
+ /**
194
+ * ONS AIMS Hopper structural scores
195
+ */
196
+ export type HopperComponents = {
197
+ /**
198
+ * Building score (1.0 = exact number match)
199
+ */
200
+ building: number;
201
+ /**
202
+ * Locality score (street, town, postcode)
203
+ */
204
+ locality: number;
205
+ /**
206
+ * Unit score (flat/sub-building)
207
+ */
208
+ unit: number;
209
+ };
210
+
113
211
  /**
114
212
  * Source of the match
115
213
  */
116
214
  export const Source = {
215
+ Elasticsearch: "elasticsearch",
117
216
  ElasticsearchExact: "elasticsearch-exact",
118
217
  ElasticsearchPartial: "elasticsearch-partial",
119
218
  ElasticsearchFuzzy: "elasticsearch-fuzzy",
@@ -135,6 +234,10 @@ export type Matches = {
135
234
  * Match confidence score (0-100)
136
235
  */
137
236
  confidence: number;
237
+ /**
238
+ * ONS AIMS Hopper structural scores
239
+ */
240
+ hopperComponents?: HopperComponents | undefined;
138
241
  /**
139
242
  * Original parsed address fragment
140
243
  */
@@ -247,6 +350,10 @@ export type Result = {
247
350
  * Confidence zone: H (High, >66%), M (Medium, 50-66%), L (Low, <50%)
248
351
  */
249
352
  confidenceZone?: ConfidenceZone | undefined;
353
+ /**
354
+ * Smart match quality evaluation (considers building scores, confidence gaps, unambiguity)
355
+ */
356
+ matchQuality?: MatchQuality | undefined;
250
357
  /**
251
358
  * Array of matched addresses
252
359
  */
@@ -426,6 +533,79 @@ export const ConfidenceZone$inboundSchema: z.ZodNativeEnum<
426
533
  typeof ConfidenceZone
427
534
  > = z.nativeEnum(ConfidenceZone);
428
535
 
536
+ /** @internal */
537
+ export const Action$inboundSchema: z.ZodNativeEnum<typeof Action> = z
538
+ .nativeEnum(Action);
539
+
540
+ /** @internal */
541
+ export const Factors$inboundSchema: z.ZodType<Factors, z.ZodTypeDef, unknown> =
542
+ z.object({
543
+ hasClearWinner: z.boolean(),
544
+ hasHighConfidence: z.boolean(),
545
+ hasPerfectBuildingMatch: z.boolean(),
546
+ isSingleResult: z.boolean(),
547
+ });
548
+
549
+ export function factorsFromJSON(
550
+ jsonString: string,
551
+ ): SafeParseResult<Factors, SDKValidationError> {
552
+ return safeParse(
553
+ jsonString,
554
+ (x) => Factors$inboundSchema.parse(JSON.parse(x)),
555
+ `Failed to parse 'Factors' from JSON`,
556
+ );
557
+ }
558
+
559
+ /** @internal */
560
+ export const Grade$inboundSchema: z.ZodNativeEnum<typeof Grade> = z.nativeEnum(
561
+ Grade,
562
+ );
563
+
564
+ /** @internal */
565
+ export const MatchQuality$inboundSchema: z.ZodType<
566
+ MatchQuality,
567
+ z.ZodTypeDef,
568
+ unknown
569
+ > = z.object({
570
+ action: Action$inboundSchema,
571
+ factors: z.lazy(() => Factors$inboundSchema),
572
+ grade: Grade$inboundSchema,
573
+ isReliable: z.boolean(),
574
+ reason: z.string(),
575
+ unambiguityScore: z.number(),
576
+ });
577
+
578
+ export function matchQualityFromJSON(
579
+ jsonString: string,
580
+ ): SafeParseResult<MatchQuality, SDKValidationError> {
581
+ return safeParse(
582
+ jsonString,
583
+ (x) => MatchQuality$inboundSchema.parse(JSON.parse(x)),
584
+ `Failed to parse 'MatchQuality' from JSON`,
585
+ );
586
+ }
587
+
588
+ /** @internal */
589
+ export const HopperComponents$inboundSchema: z.ZodType<
590
+ HopperComponents,
591
+ z.ZodTypeDef,
592
+ unknown
593
+ > = z.object({
594
+ building: z.number(),
595
+ locality: z.number(),
596
+ unit: z.number(),
597
+ });
598
+
599
+ export function hopperComponentsFromJSON(
600
+ jsonString: string,
601
+ ): SafeParseResult<HopperComponents, SDKValidationError> {
602
+ return safeParse(
603
+ jsonString,
604
+ (x) => HopperComponents$inboundSchema.parse(JSON.parse(x)),
605
+ `Failed to parse 'HopperComponents' from JSON`,
606
+ );
607
+ }
608
+
429
609
  /** @internal */
430
610
  export const Source$inboundSchema: z.ZodNativeEnum<typeof Source> = z
431
611
  .nativeEnum(Source);
@@ -435,6 +615,7 @@ export const Matches$inboundSchema: z.ZodType<Matches, z.ZodTypeDef, unknown> =
435
615
  z.object({
436
616
  address: z.string(),
437
617
  confidence: z.number(),
618
+ hopperComponents: z.lazy(() => HopperComponents$inboundSchema).optional(),
438
619
  originalAddress: z.string(),
439
620
  source: Source$inboundSchema,
440
621
  uprn: z.string(),
@@ -515,6 +696,7 @@ export const Result$inboundSchema: z.ZodType<Result, z.ZodTypeDef, unknown> = z
515
696
  .object({
516
697
  confidence: z.number(),
517
698
  confidenceZone: ConfidenceZone$inboundSchema.optional(),
699
+ matchQuality: z.lazy(() => MatchQuality$inboundSchema).optional(),
518
700
  matches: z.array(z.lazy(() => Matches$inboundSchema)),
519
701
  metadata: z.lazy(() => ResolveAddressMetadata$inboundSchema),
520
702
  recommendationCode: RecommendationCode$inboundSchema.optional(),
@@ -0,0 +1,191 @@
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
+ CouncilBranding,
12
+ CouncilBranding$inboundSchema,
13
+ } from "./councilbranding.js";
14
+ import {
15
+ CouncilContactDetails,
16
+ CouncilContactDetails$inboundSchema,
17
+ } from "./councilcontactdetails.js";
18
+ import {
19
+ CouncilMetadata,
20
+ CouncilMetadata$inboundSchema,
21
+ } from "./councilmetadata.js";
22
+ import {
23
+ CouncilServiceUrls,
24
+ CouncilServiceUrls$inboundSchema,
25
+ } from "./councilserviceurls.js";
26
+
27
+ /**
28
+ * Country code (GB = Great Britain, IE = Ireland)
29
+ */
30
+ export const Country = {
31
+ Gb: "GB",
32
+ Ie: "IE",
33
+ } as const;
34
+ /**
35
+ * Country code (GB = Great Britain, IE = Ireland)
36
+ */
37
+ export type Country = ClosedEnum<typeof Country>;
38
+
39
+ /**
40
+ * Object type identifier
41
+ */
42
+ export const ObjectT = {
43
+ Council: "council",
44
+ } as const;
45
+ /**
46
+ * Object type identifier
47
+ */
48
+ export type ObjectT = ClosedEnum<typeof ObjectT>;
49
+
50
+ /**
51
+ * Current operational status
52
+ */
53
+ export const Status = {
54
+ Active: "active",
55
+ Merged: "merged",
56
+ Abolished: "abolished",
57
+ Inactive: "inactive",
58
+ } as const;
59
+ /**
60
+ * Current operational status
61
+ */
62
+ export type Status = ClosedEnum<typeof Status>;
63
+
64
+ /**
65
+ * Council type classification
66
+ */
67
+ export const Type = {
68
+ Unitary: "unitary",
69
+ Metropolitan: "metropolitan",
70
+ County: "county",
71
+ LondonBorough: "london_borough",
72
+ District: "district",
73
+ LocalAuthority: "local_authority",
74
+ } as const;
75
+ /**
76
+ * Council type classification
77
+ */
78
+ export type Type = ClosedEnum<typeof Type>;
79
+
80
+ export type Council = {
81
+ branding?: CouncilBranding | undefined;
82
+ contactDetails?: CouncilContactDetails | undefined;
83
+ /**
84
+ * Irish council code
85
+ */
86
+ councilCode?: string | null | undefined;
87
+ /**
88
+ * Country code (GB = Great Britain, IE = Ireland)
89
+ */
90
+ country: Country;
91
+ /**
92
+ * Creation timestamp in ISO format
93
+ */
94
+ createdAt: string;
95
+ /**
96
+ * Government Statistical Service code
97
+ */
98
+ gssCode: string | null;
99
+ /**
100
+ * Unique council identifier
101
+ */
102
+ id: string;
103
+ metadata?: CouncilMetadata | undefined;
104
+ /**
105
+ * Official council name
106
+ */
107
+ name: string;
108
+ /**
109
+ * Normalised name for matching
110
+ */
111
+ normalisedName: string;
112
+ /**
113
+ * Object type identifier
114
+ */
115
+ object: ObjectT;
116
+ /**
117
+ * Office for National Statistics code
118
+ */
119
+ onsCode: string | null;
120
+ /**
121
+ * Provider identifier for integrations
122
+ */
123
+ providerId: string | null;
124
+ serviceUrls?: CouncilServiceUrls | undefined;
125
+ /**
126
+ * Current operational status
127
+ */
128
+ status: Status;
129
+ /**
130
+ * Council type classification
131
+ */
132
+ type: Type | null;
133
+ /**
134
+ * Last update timestamp in ISO format
135
+ */
136
+ updatedAt: string;
137
+ /**
138
+ * Whether the council data has been verified
139
+ */
140
+ verified: boolean;
141
+ };
142
+
143
+ /** @internal */
144
+ export const Country$inboundSchema: z.ZodNativeEnum<typeof Country> = z
145
+ .nativeEnum(Country);
146
+
147
+ /** @internal */
148
+ export const ObjectT$inboundSchema: z.ZodNativeEnum<typeof ObjectT> = z
149
+ .nativeEnum(ObjectT);
150
+
151
+ /** @internal */
152
+ export const Status$inboundSchema: z.ZodNativeEnum<typeof Status> = z
153
+ .nativeEnum(Status);
154
+
155
+ /** @internal */
156
+ export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
157
+ Type,
158
+ );
159
+
160
+ /** @internal */
161
+ export const Council$inboundSchema: z.ZodType<Council, z.ZodTypeDef, unknown> =
162
+ z.object({
163
+ branding: CouncilBranding$inboundSchema.optional(),
164
+ contactDetails: CouncilContactDetails$inboundSchema.optional(),
165
+ councilCode: z.nullable(z.string()).optional(),
166
+ country: Country$inboundSchema,
167
+ createdAt: z.string(),
168
+ gssCode: z.nullable(z.string()),
169
+ id: z.string(),
170
+ metadata: CouncilMetadata$inboundSchema.optional(),
171
+ name: z.string(),
172
+ normalisedName: z.string(),
173
+ object: ObjectT$inboundSchema,
174
+ onsCode: z.nullable(z.string()),
175
+ providerId: z.nullable(z.string()),
176
+ serviceUrls: CouncilServiceUrls$inboundSchema.optional(),
177
+ status: Status$inboundSchema,
178
+ type: z.nullable(Type$inboundSchema),
179
+ updatedAt: z.string(),
180
+ verified: z.boolean(),
181
+ });
182
+
183
+ export function councilFromJSON(
184
+ jsonString: string,
185
+ ): SafeParseResult<Council, SDKValidationError> {
186
+ return safeParse(
187
+ jsonString,
188
+ (x) => Council$inboundSchema.parse(JSON.parse(x)),
189
+ `Failed to parse 'Council' from JSON`,
190
+ );
191
+ }
@@ -0,0 +1,77 @@
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 SocialMedia = {
11
+ facebook?: string | undefined;
12
+ instagram?: string | undefined;
13
+ linkedin?: string | undefined;
14
+ twitter?: string | undefined;
15
+ youtube?: string | undefined;
16
+ };
17
+
18
+ export type CouncilBranding = {
19
+ /**
20
+ * URL to council logo
21
+ */
22
+ logoUrl?: string | undefined;
23
+ /**
24
+ * Primary brand colour (hex)
25
+ */
26
+ primaryColour?: string | undefined;
27
+ /**
28
+ * Secondary brand colour (hex)
29
+ */
30
+ secondaryColour?: string | undefined;
31
+ socialMedia?: SocialMedia | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const SocialMedia$inboundSchema: z.ZodType<
36
+ SocialMedia,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({
40
+ facebook: z.string().optional(),
41
+ instagram: z.string().optional(),
42
+ linkedin: z.string().optional(),
43
+ twitter: z.string().optional(),
44
+ youtube: z.string().optional(),
45
+ });
46
+
47
+ export function socialMediaFromJSON(
48
+ jsonString: string,
49
+ ): SafeParseResult<SocialMedia, SDKValidationError> {
50
+ return safeParse(
51
+ jsonString,
52
+ (x) => SocialMedia$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'SocialMedia' from JSON`,
54
+ );
55
+ }
56
+
57
+ /** @internal */
58
+ export const CouncilBranding$inboundSchema: z.ZodType<
59
+ CouncilBranding,
60
+ z.ZodTypeDef,
61
+ unknown
62
+ > = z.object({
63
+ logoUrl: z.string().optional(),
64
+ primaryColour: z.string().optional(),
65
+ secondaryColour: z.string().optional(),
66
+ socialMedia: z.lazy(() => SocialMedia$inboundSchema).optional(),
67
+ });
68
+
69
+ export function councilBrandingFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<CouncilBranding, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) => CouncilBranding$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'CouncilBranding' from JSON`,
76
+ );
77
+ }