@vepler/sdk 2.141.0 → 2.149.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 (140) hide show
  1. package/dist/commonjs/funcs/censusGetBreaks.js +1 -1
  2. package/dist/commonjs/funcs/censusGetBreaks.js.map +1 -1
  3. package/dist/commonjs/funcs/censusGetTile.js +1 -1
  4. package/dist/commonjs/funcs/censusGetTile.js.map +1 -1
  5. package/dist/commonjs/funcs/censusGetWholeLevel.js +1 -1
  6. package/dist/commonjs/funcs/censusGetWholeLevel.js.map +1 -1
  7. package/dist/commonjs/funcs/planningGetPlanningApplications.d.ts +1 -1
  8. package/dist/commonjs/funcs/planningGetPlanningApplications.js +1 -1
  9. package/dist/commonjs/funcs/planningGetPlanningApplicationsBySource.d.ts +1 -1
  10. package/dist/commonjs/funcs/planningGetPlanningApplicationsBySource.js +1 -1
  11. package/dist/commonjs/funcs/planningSearchPlanningApplications.d.ts +1 -1
  12. package/dist/commonjs/funcs/planningSearchPlanningApplications.js +1 -1
  13. package/dist/commonjs/funcs/searchSearchSuggest.d.ts +6 -0
  14. package/dist/commonjs/funcs/searchSearchSuggest.d.ts.map +1 -1
  15. package/dist/commonjs/funcs/searchSearchSuggest.js +10 -0
  16. package/dist/commonjs/funcs/searchSearchSuggest.js.map +1 -1
  17. package/dist/commonjs/lib/config.d.ts +3 -3
  18. package/dist/commonjs/lib/config.js +3 -3
  19. package/dist/commonjs/sdk/models/operations/getplanningapplications.d.ts +1 -1
  20. package/dist/commonjs/sdk/models/operations/getplanningapplicationsbysource.d.ts +1 -1
  21. package/dist/commonjs/sdk/models/operations/searchsuggest.d.ts +51 -3
  22. package/dist/commonjs/sdk/models/operations/searchsuggest.d.ts.map +1 -1
  23. package/dist/commonjs/sdk/models/operations/searchsuggest.js +27 -2
  24. package/dist/commonjs/sdk/models/operations/searchsuggest.js.map +1 -1
  25. package/dist/commonjs/sdk/models/shared/index.d.ts +3 -0
  26. package/dist/commonjs/sdk/models/shared/index.d.ts.map +1 -1
  27. package/dist/commonjs/sdk/models/shared/index.js +3 -0
  28. package/dist/commonjs/sdk/models/shared/index.js.map +1 -1
  29. package/dist/commonjs/sdk/models/shared/planningapplication.d.ts +27 -0
  30. package/dist/commonjs/sdk/models/shared/planningapplication.d.ts.map +1 -1
  31. package/dist/commonjs/sdk/models/shared/planningapplication.js +15 -1
  32. package/dist/commonjs/sdk/models/shared/planningapplication.js.map +1 -1
  33. package/dist/commonjs/sdk/models/shared/planningclassificationreasoning.d.ts +45 -0
  34. package/dist/commonjs/sdk/models/shared/planningclassificationreasoning.d.ts.map +1 -0
  35. package/dist/commonjs/sdk/models/shared/planningclassificationreasoning.js +57 -0
  36. package/dist/commonjs/sdk/models/shared/planningclassificationreasoning.js.map +1 -0
  37. package/dist/commonjs/sdk/models/shared/planningdocument.d.ts +8 -0
  38. package/dist/commonjs/sdk/models/shared/planningdocument.d.ts.map +1 -1
  39. package/dist/commonjs/sdk/models/shared/planningdocument.js +2 -0
  40. package/dist/commonjs/sdk/models/shared/planningdocument.js.map +1 -1
  41. package/dist/commonjs/sdk/models/shared/planningimage.d.ts +49 -0
  42. package/dist/commonjs/sdk/models/shared/planningimage.d.ts.map +1 -0
  43. package/dist/commonjs/sdk/models/shared/planningimage.js +59 -0
  44. package/dist/commonjs/sdk/models/shared/planningimage.js.map +1 -0
  45. package/dist/commonjs/sdk/models/shared/planningqueryrequest.d.ts +4 -1
  46. package/dist/commonjs/sdk/models/shared/planningqueryrequest.d.ts.map +1 -1
  47. package/dist/commonjs/sdk/models/shared/planningqueryrequest.js +3 -0
  48. package/dist/commonjs/sdk/models/shared/planningqueryrequest.js.map +1 -1
  49. package/dist/commonjs/sdk/models/shared/planningsemanticchunk.d.ts +37 -0
  50. package/dist/commonjs/sdk/models/shared/planningsemanticchunk.d.ts.map +1 -0
  51. package/dist/commonjs/sdk/models/shared/planningsemanticchunk.js +56 -0
  52. package/dist/commonjs/sdk/models/shared/planningsemanticchunk.js.map +1 -0
  53. package/dist/commonjs/sdk/models/shared/searchresult.d.ts +2 -2
  54. package/dist/commonjs/sdk/planning.d.ts +3 -3
  55. package/dist/commonjs/sdk/planning.js +3 -3
  56. package/dist/commonjs/sdk/search.d.ts +6 -0
  57. package/dist/commonjs/sdk/search.d.ts.map +1 -1
  58. package/dist/commonjs/sdk/search.js +6 -0
  59. package/dist/commonjs/sdk/search.js.map +1 -1
  60. package/dist/esm/funcs/censusGetBreaks.js +1 -1
  61. package/dist/esm/funcs/censusGetBreaks.js.map +1 -1
  62. package/dist/esm/funcs/censusGetTile.js +1 -1
  63. package/dist/esm/funcs/censusGetTile.js.map +1 -1
  64. package/dist/esm/funcs/censusGetWholeLevel.js +1 -1
  65. package/dist/esm/funcs/censusGetWholeLevel.js.map +1 -1
  66. package/dist/esm/funcs/planningGetPlanningApplications.d.ts +1 -1
  67. package/dist/esm/funcs/planningGetPlanningApplications.js +1 -1
  68. package/dist/esm/funcs/planningGetPlanningApplicationsBySource.d.ts +1 -1
  69. package/dist/esm/funcs/planningGetPlanningApplicationsBySource.js +1 -1
  70. package/dist/esm/funcs/planningSearchPlanningApplications.d.ts +1 -1
  71. package/dist/esm/funcs/planningSearchPlanningApplications.js +1 -1
  72. package/dist/esm/funcs/searchSearchSuggest.d.ts +6 -0
  73. package/dist/esm/funcs/searchSearchSuggest.d.ts.map +1 -1
  74. package/dist/esm/funcs/searchSearchSuggest.js +10 -0
  75. package/dist/esm/funcs/searchSearchSuggest.js.map +1 -1
  76. package/dist/esm/lib/config.d.ts +3 -3
  77. package/dist/esm/lib/config.js +3 -3
  78. package/dist/esm/sdk/models/operations/getplanningapplications.d.ts +1 -1
  79. package/dist/esm/sdk/models/operations/getplanningapplicationsbysource.d.ts +1 -1
  80. package/dist/esm/sdk/models/operations/searchsuggest.d.ts +51 -3
  81. package/dist/esm/sdk/models/operations/searchsuggest.d.ts.map +1 -1
  82. package/dist/esm/sdk/models/operations/searchsuggest.js +26 -1
  83. package/dist/esm/sdk/models/operations/searchsuggest.js.map +1 -1
  84. package/dist/esm/sdk/models/shared/index.d.ts +3 -0
  85. package/dist/esm/sdk/models/shared/index.d.ts.map +1 -1
  86. package/dist/esm/sdk/models/shared/index.js +3 -0
  87. package/dist/esm/sdk/models/shared/index.js.map +1 -1
  88. package/dist/esm/sdk/models/shared/planningapplication.d.ts +27 -0
  89. package/dist/esm/sdk/models/shared/planningapplication.d.ts.map +1 -1
  90. package/dist/esm/sdk/models/shared/planningapplication.js +13 -0
  91. package/dist/esm/sdk/models/shared/planningapplication.js.map +1 -1
  92. package/dist/esm/sdk/models/shared/planningclassificationreasoning.d.ts +45 -0
  93. package/dist/esm/sdk/models/shared/planningclassificationreasoning.d.ts.map +1 -0
  94. package/dist/esm/sdk/models/shared/planningclassificationreasoning.js +20 -0
  95. package/dist/esm/sdk/models/shared/planningclassificationreasoning.js.map +1 -0
  96. package/dist/esm/sdk/models/shared/planningdocument.d.ts +8 -0
  97. package/dist/esm/sdk/models/shared/planningdocument.d.ts.map +1 -1
  98. package/dist/esm/sdk/models/shared/planningdocument.js +2 -0
  99. package/dist/esm/sdk/models/shared/planningdocument.js.map +1 -1
  100. package/dist/esm/sdk/models/shared/planningimage.d.ts +49 -0
  101. package/dist/esm/sdk/models/shared/planningimage.d.ts.map +1 -0
  102. package/dist/esm/sdk/models/shared/planningimage.js +22 -0
  103. package/dist/esm/sdk/models/shared/planningimage.js.map +1 -0
  104. package/dist/esm/sdk/models/shared/planningqueryrequest.d.ts +4 -1
  105. package/dist/esm/sdk/models/shared/planningqueryrequest.d.ts.map +1 -1
  106. package/dist/esm/sdk/models/shared/planningqueryrequest.js +3 -0
  107. package/dist/esm/sdk/models/shared/planningqueryrequest.js.map +1 -1
  108. package/dist/esm/sdk/models/shared/planningsemanticchunk.d.ts +37 -0
  109. package/dist/esm/sdk/models/shared/planningsemanticchunk.d.ts.map +1 -0
  110. package/dist/esm/sdk/models/shared/planningsemanticchunk.js +19 -0
  111. package/dist/esm/sdk/models/shared/planningsemanticchunk.js.map +1 -0
  112. package/dist/esm/sdk/models/shared/searchresult.d.ts +2 -2
  113. package/dist/esm/sdk/planning.d.ts +3 -3
  114. package/dist/esm/sdk/planning.js +3 -3
  115. package/dist/esm/sdk/search.d.ts +6 -0
  116. package/dist/esm/sdk/search.d.ts.map +1 -1
  117. package/dist/esm/sdk/search.js +6 -0
  118. package/dist/esm/sdk/search.js.map +1 -1
  119. package/package.json +1 -1
  120. package/src/funcs/censusGetBreaks.ts +1 -1
  121. package/src/funcs/censusGetTile.ts +1 -1
  122. package/src/funcs/censusGetWholeLevel.ts +1 -1
  123. package/src/funcs/planningGetPlanningApplications.ts +1 -1
  124. package/src/funcs/planningGetPlanningApplicationsBySource.ts +1 -1
  125. package/src/funcs/planningSearchPlanningApplications.ts +1 -1
  126. package/src/funcs/searchSearchSuggest.ts +10 -0
  127. package/src/lib/config.ts +3 -3
  128. package/src/sdk/models/operations/getplanningapplications.ts +1 -1
  129. package/src/sdk/models/operations/getplanningapplicationsbysource.ts +1 -1
  130. package/src/sdk/models/operations/searchsuggest.ts +64 -3
  131. package/src/sdk/models/shared/index.ts +3 -0
  132. package/src/sdk/models/shared/planningapplication.ts +53 -0
  133. package/src/sdk/models/shared/planningclassificationreasoning.ts +69 -0
  134. package/src/sdk/models/shared/planningdocument.ts +10 -0
  135. package/src/sdk/models/shared/planningimage.ts +79 -0
  136. package/src/sdk/models/shared/planningqueryrequest.ts +4 -1
  137. package/src/sdk/models/shared/planningsemanticchunk.ts +64 -0
  138. package/src/sdk/models/shared/searchresult.ts +2 -2
  139. package/src/sdk/planning.ts +3 -3
  140. package/src/sdk/search.ts +6 -0
@@ -13,6 +13,10 @@ import {
13
13
  PlanningApplicant,
14
14
  PlanningApplicant$inboundSchema,
15
15
  } from "./planningapplicant.js";
16
+ import {
17
+ PlanningClassificationReasoning,
18
+ PlanningClassificationReasoning$inboundSchema,
19
+ } from "./planningclassificationreasoning.js";
16
20
  import {
17
21
  PlanningConstraint,
18
22
  PlanningConstraint$inboundSchema,
@@ -37,6 +41,7 @@ import {
37
41
  PlanningExtractionCoverage,
38
42
  PlanningExtractionCoverage$inboundSchema,
39
43
  } from "./planningextractioncoverage.js";
44
+ import { PlanningImage, PlanningImage$inboundSchema } from "./planningimage.js";
40
45
  import {
41
46
  PlanningOfficerAssessmentExtractionEnvelope,
42
47
  PlanningOfficerAssessmentExtractionEnvelope$inboundSchema,
@@ -49,6 +54,10 @@ import {
49
54
  PlanningS106ExtractionEnvelope,
50
55
  PlanningS106ExtractionEnvelope$inboundSchema,
51
56
  } from "./plannings106extractionenvelope.js";
57
+ import {
58
+ PlanningSemanticChunk,
59
+ PlanningSemanticChunk$inboundSchema,
60
+ } from "./planningsemanticchunk.js";
52
61
  import {
53
62
  PlanningStatusHistory,
54
63
  PlanningStatusHistory$inboundSchema,
@@ -96,6 +105,20 @@ export type PlanningApplicationAddress = {
96
105
  ward?: string | null | undefined;
97
106
  };
98
107
 
108
+ /**
109
+ * AI reasoning and processing artefacts behind the application: how it was classified (with confidence and uncertainty) and how its documents were segmented and summarised. Only present when 'enrichment' is requested via the include parameter. Sub-arrays may be empty when the relevant pipeline has not run for this application.
110
+ */
111
+ export type Enrichment = {
112
+ /**
113
+ * AI classification reasoning runs for the application (most recent first). Shows how our pipeline determined the application's type, status and development category, with confidence and uncertainty. May be empty when no audit was recorded.
114
+ */
115
+ classification: Array<PlanningClassificationReasoning>;
116
+ /**
117
+ * Section-level structure and AI context summaries derived from the application's documents (no embeddings or full text). Conveys how the documents were segmented and understood. May be empty when semantic processing has not run.
118
+ */
119
+ semanticChunks: Array<PlanningSemanticChunk>;
120
+ };
121
+
99
122
  /**
100
123
  * Structured, citation-backed data extracted from the application's documents — decision outcome and refusal reasons, development specifics, section 106 obligations, the officer's assessment, and consultee responses. Only present when 'extractions' is requested via the include parameter (GET) or the include array (POST /query); omitted entirely otherwise. Each sub-extraction may itself be null when that schema has not been extracted for this application. Coverage and per-extraction verification status are reported so consumers can degrade honestly when data is partial or unverified.
101
124
  */
@@ -352,6 +375,10 @@ export type PlanningApplication = {
352
375
  * Documents associated with the planning application, including submitted plans, decision notices, consultation responses, and supporting material. May be empty if no documents have been collected from the source.
353
376
  */
354
377
  documents?: Array<PlanningDocument> | undefined;
378
+ /**
379
+ * AI reasoning and processing artefacts behind the application: how it was classified (with confidence and uncertainty) and how its documents were segmented and summarised. Only present when 'enrichment' is requested via the include parameter. Sub-arrays may be empty when the relevant pipeline has not run for this application.
380
+ */
381
+ enrichment?: Enrichment | null | undefined;
355
382
  /**
356
383
  * The date on which the planning permission expires if not implemented, formatted as an ISO 8601 datetime string. Most permissions must be commenced within three years of approval. Null if not applicable or not recorded.
357
384
  */
@@ -364,6 +391,10 @@ export type PlanningApplication = {
364
391
  * Unique identifier for the planning application record. Use this UUID to retrieve the application via the GET /{applicationIds} endpoint.
365
392
  */
366
393
  id: string;
394
+ /**
395
+ * Deduplicated gallery of images (plans, elevations, photographs) extracted from the application's documents, each with a directly-renderable CDN URL. Only present when 'images' is requested via the include parameter. May be empty when no images have been extracted — image coverage is sparse, so expect this for most applications and render an honest empty state.
396
+ */
397
+ images?: Array<PlanningImage> | undefined;
367
398
  /**
368
399
  * The planning application reference number as assigned by the local planning authority. Format varies by council (e.g. 'APP/2024/0001', '24/00123/FUL', 'DC/24/0456'). This is the reference number a member of the public would use when contacting the council about the application.
369
400
  */
@@ -461,6 +492,26 @@ export function planningApplicationAddressFromJSON(
461
492
  );
462
493
  }
463
494
 
495
+ /** @internal */
496
+ export const Enrichment$inboundSchema: z.ZodType<
497
+ Enrichment,
498
+ z.ZodTypeDef,
499
+ unknown
500
+ > = z.object({
501
+ classification: z.array(PlanningClassificationReasoning$inboundSchema),
502
+ semanticChunks: z.array(PlanningSemanticChunk$inboundSchema),
503
+ });
504
+
505
+ export function enrichmentFromJSON(
506
+ jsonString: string,
507
+ ): SafeParseResult<Enrichment, SDKValidationError> {
508
+ return safeParse(
509
+ jsonString,
510
+ (x) => Enrichment$inboundSchema.parse(JSON.parse(x)),
511
+ `Failed to parse 'Enrichment' from JSON`,
512
+ );
513
+ }
514
+
464
515
  /** @internal */
465
516
  export const Extractions$inboundSchema: z.ZodType<
466
517
  Extractions,
@@ -697,9 +748,11 @@ export const PlanningApplication$inboundSchema: z.ZodType<
697
748
  developmentCategory: z.nullable(z.string()).optional(),
698
749
  distance: z.nullable(z.number()).optional(),
699
750
  documents: z.array(PlanningDocument$inboundSchema).optional(),
751
+ enrichment: z.nullable(z.lazy(() => Enrichment$inboundSchema)).optional(),
700
752
  expiryDate: z.nullable(z.string()).optional(),
701
753
  extractions: z.nullable(z.lazy(() => Extractions$inboundSchema)).optional(),
702
754
  id: z.string(),
755
+ images: z.array(PlanningImage$inboundSchema).optional(),
703
756
  key: z.string(),
704
757
  people: z.nullable(z.lazy(() => People$inboundSchema)).optional(),
705
758
  provider: z.string(),
@@ -0,0 +1,69 @@
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 PlanningClassificationReasoning = {
11
+ /**
12
+ * Version of the classification pipeline that produced this result.
13
+ */
14
+ classificationVersion?: string | null | undefined;
15
+ /**
16
+ * Per-dimension confidence detail behind the final classification.
17
+ */
18
+ confidenceBreakdown?: { [k: string]: any } | null | undefined;
19
+ /**
20
+ * ISO 8601 datetime when this classification run was recorded.
21
+ */
22
+ createdAt: string;
23
+ /**
24
+ * The ensemble's final classification result (type/status/category and supporting fields).
25
+ */
26
+ finalClassification?: { [k: string]: any } | null | undefined;
27
+ /**
28
+ * Natural-language explanation of how the classification was reached.
29
+ */
30
+ reasoning?: string | null | undefined;
31
+ /**
32
+ * Whether the pipeline flagged this classification for human review.
33
+ */
34
+ requiresHumanReview?: boolean | null | undefined;
35
+ /**
36
+ * Specific points of uncertainty the model surfaced (empty when none).
37
+ */
38
+ uncertaintyFlags?: Array<any> | undefined;
39
+ /**
40
+ * Issues flagged by the validation pass (empty when none).
41
+ */
42
+ validationIssues?: Array<any> | undefined;
43
+ };
44
+
45
+ /** @internal */
46
+ export const PlanningClassificationReasoning$inboundSchema: z.ZodType<
47
+ PlanningClassificationReasoning,
48
+ z.ZodTypeDef,
49
+ unknown
50
+ > = z.object({
51
+ classificationVersion: z.nullable(z.string()).optional(),
52
+ confidenceBreakdown: z.nullable(z.record(z.any())).optional(),
53
+ createdAt: z.string(),
54
+ finalClassification: z.nullable(z.record(z.any())).optional(),
55
+ reasoning: z.nullable(z.string()).optional(),
56
+ requiresHumanReview: z.nullable(z.boolean()).optional(),
57
+ uncertaintyFlags: z.array(z.any()).optional(),
58
+ validationIssues: z.array(z.any()).optional(),
59
+ });
60
+
61
+ export function planningClassificationReasoningFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<PlanningClassificationReasoning, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) => PlanningClassificationReasoning$inboundSchema.parse(JSON.parse(x)),
67
+ `Failed to parse 'PlanningClassificationReasoning' from JSON`,
68
+ );
69
+ }
@@ -28,10 +28,18 @@ export type PlanningDocument = {
28
28
  * File size in bytes, if known. Null if the file size was not available from the source.
29
29
  */
30
30
  fileSize?: number | null | undefined;
31
+ /**
32
+ * Direct, publicly-readable URL to the document file (PDF) as stored and served by us via CDN — stable and CORS-enabled, suitable for rendering in-browser (unlike the council's sourceUrl, which may require cookies or expire). Present only when the 'content' expansion is requested via the include parameter. Null when we hold no stored copy of the file (fall back to sourceUrl).
33
+ */
34
+ fileUrl?: string | null | undefined;
31
35
  /**
32
36
  * Unique identifier for the document record.
33
37
  */
34
38
  id: string;
39
+ /**
40
+ * Direct, publicly-readable CDN URL to the extracted text of the document, as Markdown. Produced by our OCR/conversion pipeline. Present only when the 'content' expansion is requested. Null when the document has not been OCR-processed (no text is available).
41
+ */
42
+ ocrUrl?: string | null | undefined;
35
43
  /**
36
44
  * Number of pages in the document, if known. Primarily available for PDF documents.
37
45
  */
@@ -57,7 +65,9 @@ export const PlanningDocument$inboundSchema: z.ZodType<
57
65
  documentTypeDetailed: z.nullable(z.string()).optional(),
58
66
  fileName: z.string(),
59
67
  fileSize: z.nullable(z.number()).optional(),
68
+ fileUrl: z.nullable(z.string()).optional(),
60
69
  id: z.string(),
70
+ ocrUrl: z.nullable(z.string()).optional(),
61
71
  pageCount: z.nullable(z.number()).optional(),
62
72
  planningApplicationId: z.string(),
63
73
  sourceUrl: z.string(),
@@ -0,0 +1,79 @@
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 PlanningImage = {
11
+ /**
12
+ * AI classification of what the image depicts (e.g. 'site_plan', 'elevation', 'floor_plan', 'location_plan', 'photograph'). Null when the image has not yet been classified.
13
+ */
14
+ classification?: string | null | undefined;
15
+ /**
16
+ * Confidence in the classification, 0–1. Null when unclassified.
17
+ */
18
+ classificationConfidence?: number | null | undefined;
19
+ /**
20
+ * File name of the source document the image was extracted from, when known.
21
+ */
22
+ documentFileName?: string | null | undefined;
23
+ /**
24
+ * Image height in pixels, if known.
25
+ */
26
+ height?: number | null | undefined;
27
+ /**
28
+ * Unique identifier for the canonical image (deduplicated within the application).
29
+ */
30
+ id: string;
31
+ /**
32
+ * Image MIME type.
33
+ */
34
+ mimeType?: string | null | undefined;
35
+ /**
36
+ * Page of the source document on which this image first appears (1-based).
37
+ */
38
+ pageNumber?: number | null | undefined;
39
+ /**
40
+ * How many times this image appears across the application's documents. A higher count often indicates a recurring key drawing (e.g. a site plan repeated in several documents).
41
+ */
42
+ refCount?: number | undefined;
43
+ /**
44
+ * Publicly-readable CDN URL for the image, suitable for direct rendering in an <img> tag. Stable and CORS-enabled.
45
+ */
46
+ url: string;
47
+ /**
48
+ * Image width in pixels, if known.
49
+ */
50
+ width?: number | null | undefined;
51
+ };
52
+
53
+ /** @internal */
54
+ export const PlanningImage$inboundSchema: z.ZodType<
55
+ PlanningImage,
56
+ z.ZodTypeDef,
57
+ unknown
58
+ > = z.object({
59
+ classification: z.nullable(z.string()).optional(),
60
+ classificationConfidence: z.nullable(z.number()).optional(),
61
+ documentFileName: z.nullable(z.string()).optional(),
62
+ height: z.nullable(z.number()).optional(),
63
+ id: z.string(),
64
+ mimeType: z.nullable(z.string()).optional(),
65
+ pageNumber: z.nullable(z.number()).optional(),
66
+ refCount: z.number().optional(),
67
+ url: z.string(),
68
+ width: z.nullable(z.number()).optional(),
69
+ });
70
+
71
+ export function planningImageFromJSON(
72
+ jsonString: string,
73
+ ): SafeParseResult<PlanningImage, SDKValidationError> {
74
+ return safeParse(
75
+ jsonString,
76
+ (x) => PlanningImage$inboundSchema.parse(JSON.parse(x)),
77
+ `Failed to parse 'PlanningImage' from JSON`,
78
+ );
79
+ }
@@ -12,6 +12,9 @@ import {
12
12
 
13
13
  export const Include = {
14
14
  Extractions: "extractions",
15
+ Images: "images",
16
+ Content: "content",
17
+ Enrichment: "enrichment",
15
18
  } as const;
16
19
  export type Include = ClosedEnum<typeof Include>;
17
20
 
@@ -48,7 +51,7 @@ export type PlanningQueryRequestSortOrder = ClosedEnum<
48
51
 
49
52
  export type PlanningQueryRequest = {
50
53
  /**
51
- * Optional expansions to attach to each returned application. 'extractions' attaches structured, citation-backed extractions (decision, development, s106, officer assessment, consultee responses). Omitted by default to keep responses lean — extractions are large. Request only when you need the detail (e.g. a handful of specific applications), not for bulk aggregation.
54
+ * Optional expansions to attach to each returned application. 'extractions' — structured, citation-backed extractions (decision, development, s106, officer assessment, consultee responses). 'images' — a deduplicated image gallery with directly-renderable CDN URLs. 'content' — adds fileUrl (CDN PDF) and ocrUrl (CDN Markdown text) to each document so it can be rendered/searched in-browser. 'enrichment' — AI classification reasoning and document segmentation summaries. All are omitted by default to keep responses lean; request only what you need (e.g. a handful of specific applications), not for bulk aggregation.
52
55
  */
53
56
  include?: Array<Include> | undefined;
54
57
  /**
@@ -0,0 +1,64 @@
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 PlanningSemanticChunk = {
11
+ /**
12
+ * Kind of chunk (e.g. 'document', 'section').
13
+ */
14
+ chunkType?: string | null | undefined;
15
+ /**
16
+ * AI-written summary giving the surrounding context of this chunk.
17
+ */
18
+ contextSummary?: string | null | undefined;
19
+ /**
20
+ * UUID of the source document this chunk belongs to.
21
+ */
22
+ documentId?: string | null | undefined;
23
+ /**
24
+ * Unique identifier for the semantic chunk.
25
+ */
26
+ id: string;
27
+ /**
28
+ * Last page the chunk spans (1-based).
29
+ */
30
+ pageEnd?: number | null | undefined;
31
+ /**
32
+ * First page the chunk spans (1-based).
33
+ */
34
+ pageStart?: number | null | undefined;
35
+ /**
36
+ * Hierarchical section heading path locating the chunk within the document.
37
+ */
38
+ sectionPath?: Array<string> | null | undefined;
39
+ };
40
+
41
+ /** @internal */
42
+ export const PlanningSemanticChunk$inboundSchema: z.ZodType<
43
+ PlanningSemanticChunk,
44
+ z.ZodTypeDef,
45
+ unknown
46
+ > = z.object({
47
+ chunkType: z.nullable(z.string()).optional(),
48
+ contextSummary: z.nullable(z.string()).optional(),
49
+ documentId: z.nullable(z.string()).optional(),
50
+ id: z.string(),
51
+ pageEnd: z.nullable(z.number()).optional(),
52
+ pageStart: z.nullable(z.number()).optional(),
53
+ sectionPath: z.nullable(z.array(z.string())).optional(),
54
+ });
55
+
56
+ export function planningSemanticChunkFromJSON(
57
+ jsonString: string,
58
+ ): SafeParseResult<PlanningSemanticChunk, SDKValidationError> {
59
+ return safeParse(
60
+ jsonString,
61
+ (x) => PlanningSemanticChunk$inboundSchema.parse(JSON.parse(x)),
62
+ `Failed to parse 'PlanningSemanticChunk' from JSON`,
63
+ );
64
+ }
@@ -70,7 +70,7 @@ export type SearchResult = {
70
70
  */
71
71
  location?: SearchResultCoordinates | undefined;
72
72
  /**
73
- * Primary display text — building + street
73
+ * Primary display text: building + street
74
74
  */
75
75
  mainText?: string | undefined;
76
76
  /**
@@ -102,7 +102,7 @@ export type SearchResult = {
102
102
  */
103
103
  score: number;
104
104
  /**
105
- * Secondary display text — locality + postcode
105
+ * Secondary display text: locality + postcode
106
106
  */
107
107
  secondaryText?: string | undefined;
108
108
  /**
@@ -15,7 +15,7 @@ export class Planning extends ClientSDK {
15
15
  * Get planning applications by application IDs
16
16
  *
17
17
  * @remarks
18
- * Retrieve one or more planning applications by their internal UUIDs. Provide up to 100 comma-separated application IDs in the path. Returns the matching applications in a paginated list response. If you have council reference numbers rather than UUIDs, use the GET /sources/{sourceIds} endpoint instead. Pass ?include=extractions to attach structured, citation-backed extractions to each application.
18
+ * Retrieve one or more planning applications by their internal UUIDs. Provide up to 100 comma-separated application IDs in the path. Returns the matching applications in a paginated list response. If you have council reference numbers rather than UUIDs, use the GET /sources/{sourceIds} endpoint instead. Use ?include= to attach optional expansions (comma-separated): 'extractions' (structured, citation-backed extractions), 'images' (a renderable image gallery), 'content' (fileUrl + ocrUrl on each document), 'enrichment' (AI classification reasoning and document summaries).
19
19
  */
20
20
  async getPlanningApplications(
21
21
  request: operations.GetPlanningApplicationsRequest,
@@ -32,7 +32,7 @@ export class Planning extends ClientSDK {
32
32
  * Get planning applications by source IDs
33
33
  *
34
34
  * @remarks
35
- * Retrieve one or more planning applications by their source identifiers. Each source ID uses the format 'provider::key' where provider is the council slug and key is the council's reference number (e.g. 'lambeth::24/00123/FUL'). Provide up to 100 comma-separated source IDs in the path. This is the recommended lookup method when you know the council and application reference number. Pass ?include=extractions to attach structured, citation-backed extractions to each application.
35
+ * Retrieve one or more planning applications by their source identifiers. Each source ID uses the format 'provider::key' where provider is the council slug and key is the council's reference number (e.g. 'lambeth::24/00123/FUL'). Provide up to 100 comma-separated source IDs in the path. This is the recommended lookup method when you know the council and application reference number. Use ?include= to attach optional expansions (comma-separated): 'extractions' (structured, citation-backed extractions), 'images' (a renderable image gallery), 'content' (fileUrl + ocrUrl on each document), 'enrichment' (AI classification reasoning and document summaries).
36
36
  */
37
37
  async getPlanningApplicationsBySource(
38
38
  request: operations.GetPlanningApplicationsBySourceRequest,
@@ -49,7 +49,7 @@ export class Planning extends ClientSDK {
49
49
  * Query planning applications with advanced filters
50
50
  *
51
51
  * @remarks
52
- * Search for planning applications using a combination of filters including council, status, type, development category, and date ranges. Use the `near` filter ({ lat, lng, radiusM }) to retrieve applications around a point — the primary way to find a property's planning context; results come back closest-first with `distance` (metres) populated. Pass `include: ["extractions"]` to attach structured, citation-backed extractions. Filters within the query object are combined with AND logic, whilst array values within a single filter use OR logic. Results are paginated and can be sorted by any date field (the `near` filter overrides sort with closest-first). Supports up to 100 results per page.
52
+ * Search for planning applications using a combination of filters including council, status, type, development category, and date ranges. Use the `near` filter ({ lat, lng, radiusM }) to retrieve applications around a point — the primary way to find a property's planning context; results come back closest-first with `distance` (metres) populated. Pass `include` (any of `["extractions", "images", "content", "enrichment"]`) to attach structured citation-backed extractions, a renderable image gallery, document fileUrl/ocrUrl, and/or AI classification reasoning. Filters within the query object are combined with AND logic, whilst array values within a single filter use OR logic. Results are paginated and can be sorted by any date field (the `near` filter overrides sort with closest-first). Supports up to 100 results per page.
53
53
  */
54
54
  async searchPlanningApplications(
55
55
  request?: shared.PlanningQueryRequest | undefined,
package/src/sdk/search.ts CHANGED
@@ -14,6 +14,12 @@ export class Search extends ClientSDK {
14
14
  *
15
15
  * @remarks
16
16
  * 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.
17
+ *
18
+ * Optionally accepts a geographic centre point (`lat`, `lng`) to make results proximity-aware:
19
+ * - `geo_mode=bias` (default): soft preference. The best textual matches near the point rank higher, but distant matches are still returned.
20
+ * - `geo_mode=restrict`: hard cutoff. Only address results within `radius_meters` of the point are returned.
21
+ *
22
+ * When a centre point is supplied, address results include a `distance` (metres from the point). Geographic ranking applies to the address source, so pair it with `source=address` for the most predictable proximity results.
17
23
  */
18
24
  async searchSuggest(
19
25
  request: operations.SearchSuggestRequest,