From 6cad4ba9fb6c2f5411a999fe86a9d23a63b05eb4 Mon Sep 17 00:00:00 2001 From: pratishta Date: Wed, 22 May 2024 13:29:26 -0400 Subject: [PATCH] Regenerate types and zod schemas --- src/gen/types/Agency.ts | 14 ++++++ src/gen/types/CapitalCommitment.ts | 50 +++++++++++++++++++ src/gen/types/CapitalProject.ts | 41 +++++++++++++++ src/gen/types/CapitalProjectBudgeted.ts | 22 ++++++++ src/gen/types/CapitalProjectCategory.ts | 7 +++ src/gen/types/CityCouncilDistrict.ts | 8 +++ src/gen/types/CommunityDistrict.ts | 15 ++++++ src/gen/types/FindAgencies.ts | 16 ++++++ .../FindCommunityDistrictsByBoroughId.ts | 27 ++++++++++ src/gen/types/FindTaxLots.ts | 4 +- src/gen/types/index.ts | 9 ++++ src/gen/zod/agencySchema.ts | 10 ++++ src/gen/zod/capitalCommitmentSchema.ts | 45 +++++++++++++++++ src/gen/zod/capitalProjectBudgetedSchema.ts | 23 +++++++++ src/gen/zod/capitalProjectCategorySchema.ts | 7 +++ src/gen/zod/capitalProjectSchema.ts | 22 ++++++++ src/gen/zod/cityCouncilDistrictSchema.ts | 8 +++ src/gen/zod/communityDistrictSchema.ts | 19 +++++++ src/gen/zod/findAgenciesSchema.ts | 14 ++++++ ...findCommunityDistrictsByBoroughIdSchema.ts | 29 +++++++++++ src/gen/zod/findTaxLotsSchema.ts | 4 +- src/gen/zod/index.ts | 9 ++++ 22 files changed, 399 insertions(+), 4 deletions(-) create mode 100644 src/gen/types/Agency.ts create mode 100644 src/gen/types/CapitalCommitment.ts create mode 100644 src/gen/types/CapitalProject.ts create mode 100644 src/gen/types/CapitalProjectBudgeted.ts create mode 100644 src/gen/types/CapitalProjectCategory.ts create mode 100644 src/gen/types/CityCouncilDistrict.ts create mode 100644 src/gen/types/CommunityDistrict.ts create mode 100644 src/gen/types/FindAgencies.ts create mode 100644 src/gen/types/FindCommunityDistrictsByBoroughId.ts create mode 100644 src/gen/zod/agencySchema.ts create mode 100644 src/gen/zod/capitalCommitmentSchema.ts create mode 100644 src/gen/zod/capitalProjectBudgetedSchema.ts create mode 100644 src/gen/zod/capitalProjectCategorySchema.ts create mode 100644 src/gen/zod/capitalProjectSchema.ts create mode 100644 src/gen/zod/cityCouncilDistrictSchema.ts create mode 100644 src/gen/zod/communityDistrictSchema.ts create mode 100644 src/gen/zod/findAgenciesSchema.ts create mode 100644 src/gen/zod/findCommunityDistrictsByBoroughIdSchema.ts diff --git a/src/gen/types/Agency.ts b/src/gen/types/Agency.ts new file mode 100644 index 00000000..36f80c62 --- /dev/null +++ b/src/gen/types/Agency.ts @@ -0,0 +1,14 @@ +export type Agency = { + /** + * @description A string of variable length containing the initials of the agency. + * @type string + * @example DOT + */ + initials: string; + /** + * @description The full name of the agency. + * @type string + * @example Department of Transportation + */ + name: string; +}; diff --git a/src/gen/types/CapitalCommitment.ts b/src/gen/types/CapitalCommitment.ts new file mode 100644 index 00000000..1e1058d5 --- /dev/null +++ b/src/gen/types/CapitalCommitment.ts @@ -0,0 +1,50 @@ +export type CapitalCommitment = { + /** + * @description A uuid used to refer to the capital commitment. + * @type string | undefined uuid + */ + id?: string; + /** + * @description A four character string used to refer to the commitment type. + * @type string | undefined + * @example DSGN + */ + type?: string; + /** + * @description A string used to refer to the date when the commitment is projected to be committed. + * @type string | undefined date + * @example 2012-04-23 + */ + plannedDate?: string; + /** + * @description A string used to refer to the budget line. + * @type string | undefined + * @example HW + */ + budgetLineCode?: string; + /** + * @description A string used to refer to the budget line. + * @type string | undefined + * @example 0002Q + */ + budgetLineId?: string; + /** + * @description A string of variable length containing the initials of the sponsoring agency. + * @type string | undefined + * @example DOT + */ + sponsoringAgencyInitials?: string; + /** + * @description A string of variable length denoting the type of budget. + * @type string | undefined + * @example Highways + */ + budgetType?: string; + /** + * @description A numeric string used to refer to the amount of total planned commitments. + * @type number | undefined + * @example 1600000 + */ + totalValue?: number; + required?: any; +}; diff --git a/src/gen/types/CapitalProject.ts b/src/gen/types/CapitalProject.ts new file mode 100644 index 00000000..acb3eeb4 --- /dev/null +++ b/src/gen/types/CapitalProject.ts @@ -0,0 +1,41 @@ +import type { CapitalProjectCategory } from "./CapitalProjectCategory"; + +export type CapitalProject = { + /** + * @description The id for the project, which combines with the managing code to make a unique id + * @type string + * @example HWPEDSF5 + */ + id: string; + /** + * @description The capital project title. + * @type string + * @example Multi-Site Pedestrian Safety Phase 5 + */ + description: string; + /** + * @description Three character string of numbers representing managing agency + * @type string + * @example 850 + */ + managingCode: string; + /** + * @description The managing agency name abbreviation or acronym + * @type string + * @example DOT + */ + managingAgencyInitials: string; + /** + * @description The starting date of the capital project + * @type date + * @example 2024-05-15T14:20:03.842Z + */ + minDate: any; + /** + * @description The ending date of the capital project + * @type date + * @example 2024-05-15T14:20:03.842Z + */ + maxDate: any; + category?: CapitalProjectCategory; +}; diff --git a/src/gen/types/CapitalProjectBudgeted.ts b/src/gen/types/CapitalProjectBudgeted.ts new file mode 100644 index 00000000..81d7011b --- /dev/null +++ b/src/gen/types/CapitalProjectBudgeted.ts @@ -0,0 +1,22 @@ +import type { CapitalProject } from "./CapitalProject"; + +export type CapitalProjectBudgeted = CapitalProject & { + /** + * @description The sum total of commitments for the capital project + * @type number + * @example 200000 + */ + commitmentsTotal: number; + /** + * @description An array containing string values representing the sponsoring agencies initials. + * @type array + * @example DOT + */ + sponsoringAgencyInitials: string[]; + /** + * @description An array containing string values representing the budget types. + * @type array + * @example Highways,Highway Bridges + */ + budgetType: string[]; +}; diff --git a/src/gen/types/CapitalProjectCategory.ts b/src/gen/types/CapitalProjectCategory.ts new file mode 100644 index 00000000..c02be798 --- /dev/null +++ b/src/gen/types/CapitalProjectCategory.ts @@ -0,0 +1,7 @@ +export const capitalProjectCategory = { + "Fixed Asset": "Fixed Asset", + "Lump Sum": "Lump Sum", + "ITT, Vehicles and Equipment": "ITT, Vehicles and Equipment", +} as const; +export type CapitalProjectCategory = + (typeof capitalProjectCategory)[keyof typeof capitalProjectCategory]; diff --git a/src/gen/types/CityCouncilDistrict.ts b/src/gen/types/CityCouncilDistrict.ts new file mode 100644 index 00000000..da7a65fc --- /dev/null +++ b/src/gen/types/CityCouncilDistrict.ts @@ -0,0 +1,8 @@ +export type CityCouncilDistrict = { + /** + * @description One or two character code to represent city council districts. + * @type string + * @example 25 + */ + id: string; +}; diff --git a/src/gen/types/CommunityDistrict.ts b/src/gen/types/CommunityDistrict.ts new file mode 100644 index 00000000..21a222bc --- /dev/null +++ b/src/gen/types/CommunityDistrict.ts @@ -0,0 +1,15 @@ +export type CommunityDistrict = { + /** + * @description The two character numeric string containing the number used to refer to the community district. + * @type string | undefined + * @example 1 + */ + id?: string; + /** + * @description A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5. + * @type string | undefined + * @example 1 + */ + boroughId?: string; + required?: any; +}; diff --git a/src/gen/types/FindAgencies.ts b/src/gen/types/FindAgencies.ts new file mode 100644 index 00000000..b54035f0 --- /dev/null +++ b/src/gen/types/FindAgencies.ts @@ -0,0 +1,16 @@ +import type { Error } from "./Error"; +import type { Agency } from "./Agency"; + +export type FindAgencies400 = Error; + +export type FindAgencies500 = Error; + +/** + * @description An object containing all agencies. + */ +export type FindAgenciesQueryResponse = { + /** + * @type array + */ + agencies: Agency[]; +}; diff --git a/src/gen/types/FindCommunityDistrictsByBoroughId.ts b/src/gen/types/FindCommunityDistrictsByBoroughId.ts new file mode 100644 index 00000000..21ac78c7 --- /dev/null +++ b/src/gen/types/FindCommunityDistrictsByBoroughId.ts @@ -0,0 +1,27 @@ +import type { Error } from "./Error"; +import type { CommunityDistrict } from "./CommunityDistrict"; + +export type FindCommunityDistrictsByBoroughIdPathParams = { + /** + * @description A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5. + * @type string + * @example 1 + */ + boroughId: string; +}; + +export type FindCommunityDistrictsByBoroughId400 = Error; + +export type FindCommunityDistrictsByBoroughId404 = Error; + +export type FindCommunityDistrictsByBoroughId500 = Error; + +/** + * @description An object of community district schemas for the borough + */ +export type FindCommunityDistrictsByBoroughIdQueryResponse = { + /** + * @type array + */ + communityDistricts: CommunityDistrict[]; +}; diff --git a/src/gen/types/FindTaxLots.ts b/src/gen/types/FindTaxLots.ts index d96ce563..9db1f479 100644 --- a/src/gen/types/FindTaxLots.ts +++ b/src/gen/types/FindTaxLots.ts @@ -28,13 +28,13 @@ export type FindTaxLotsQueryParams = { */ geometry?: FindTaxLotsQueryParamsGeometry; /** - * @description The longitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the latitudes. + * @description The longitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the latitudes. (If using a tool like axios, serializing the array with brackets is also supported. ex; lons[]=-74.010776&lons[]=-74.010776) * @type array | undefined * @example -74.010776,-74.010776,-74.010139,-74.010139,-74.010776 */ lons?: number[]; /** - * @description The latitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the longitudes. + * @description The latitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the longitudes. (If using a tool like axios, serializing the array with brackets is also supported. ex; lats[]=40.708649&lats[]=40.707800) * @type array | undefined */ lats?: number[]; diff --git a/src/gen/types/index.ts b/src/gen/types/index.ts index cb8cc02c..6e85f09b 100644 --- a/src/gen/types/index.ts +++ b/src/gen/types/index.ts @@ -1,7 +1,16 @@ +export * from "./Agency"; export * from "./BadRequest"; export * from "./Borough"; +export * from "./CapitalCommitment"; +export * from "./CapitalProject"; +export * from "./CapitalProjectBudgeted"; +export * from "./CapitalProjectCategory"; +export * from "./CityCouncilDistrict"; +export * from "./CommunityDistrict"; export * from "./Error"; +export * from "./FindAgencies"; export * from "./FindBoroughs"; +export * from "./FindCommunityDistrictsByBoroughId"; export * from "./FindLandUses"; export * from "./FindTaxLotByBbl"; export * from "./FindTaxLotGeoJsonByBbl"; diff --git a/src/gen/zod/agencySchema.ts b/src/gen/zod/agencySchema.ts new file mode 100644 index 00000000..af563e6a --- /dev/null +++ b/src/gen/zod/agencySchema.ts @@ -0,0 +1,10 @@ +import { z } from "zod"; + +export const agencySchema = z.object({ + initials: z + .string() + .describe( + `A string of variable length containing the initials of the agency.`, + ), + name: z.string().describe(`The full name of the agency.`), +}); diff --git a/src/gen/zod/capitalCommitmentSchema.ts b/src/gen/zod/capitalCommitmentSchema.ts new file mode 100644 index 00000000..735f42f7 --- /dev/null +++ b/src/gen/zod/capitalCommitmentSchema.ts @@ -0,0 +1,45 @@ +import { z } from "zod"; + +export const capitalCommitmentSchema = z.object({ + id: z + .string() + .describe(`A uuid used to refer to the capital commitment.`) + .uuid() + .optional(), + type: z + .string() + .describe(`A four character string used to refer to the commitment type.`) + .regex(new RegExp("^([A-z]{4})$")) + .optional(), + plannedDate: z + .string() + .describe( + `A string used to refer to the date when the commitment is projected to be committed.`, + ) + .optional(), + budgetLineCode: z + .string() + .describe(`A string used to refer to the budget line.`) + .optional(), + budgetLineId: z + .string() + .describe(`A string used to refer to the budget line.`) + .optional(), + sponsoringAgencyInitials: z + .string() + .describe( + `A string of variable length containing the initials of the sponsoring agency.`, + ) + .optional(), + budgetType: z + .string() + .describe(`A string of variable length denoting the type of budget.`) + .optional(), + totalValue: z + .number() + .describe( + `A numeric string used to refer to the amount of total planned commitments.`, + ) + .optional(), + required: z.any().optional(), +}); diff --git a/src/gen/zod/capitalProjectBudgetedSchema.ts b/src/gen/zod/capitalProjectBudgetedSchema.ts new file mode 100644 index 00000000..292a9252 --- /dev/null +++ b/src/gen/zod/capitalProjectBudgetedSchema.ts @@ -0,0 +1,23 @@ +import { z } from "zod"; + +import { capitalProjectSchema } from "./capitalProjectSchema"; + +export const capitalProjectBudgetedSchema = z + .lazy(() => capitalProjectSchema) + .schema.and( + z.object({ + commitmentsTotal: z + .number() + .describe(`The sum total of commitments for the capital project`), + sponsoringAgencyInitials: z + .array(z.string()) + .describe( + `An array containing string values representing the sponsoring agencies initials.`, + ), + budgetType: z + .array(z.string()) + .describe( + `An array containing string values representing the budget types.`, + ), + }), + ); diff --git a/src/gen/zod/capitalProjectCategorySchema.ts b/src/gen/zod/capitalProjectCategorySchema.ts new file mode 100644 index 00000000..e3e58cb4 --- /dev/null +++ b/src/gen/zod/capitalProjectCategorySchema.ts @@ -0,0 +1,7 @@ +import { z } from "zod"; + +export const capitalProjectCategorySchema = z.enum([ + `Fixed Asset`, + `Lump Sum`, + `ITT, Vehicles and Equipment`, +]); diff --git a/src/gen/zod/capitalProjectSchema.ts b/src/gen/zod/capitalProjectSchema.ts new file mode 100644 index 00000000..d4eb07b1 --- /dev/null +++ b/src/gen/zod/capitalProjectSchema.ts @@ -0,0 +1,22 @@ +import { z } from "zod"; + +import { capitalProjectCategorySchema } from "./capitalProjectCategorySchema"; + +export const capitalProjectSchema = z.object({ + id: z + .string() + .describe( + `The id for the project, which combines with the managing code to make a unique id`, + ), + description: z.string().describe(`The capital project title.`), + managingCode: z + .string() + .describe(`Three character string of numbers representing managing agency`) + .regex(new RegExp("^([0-9]{3})$")), + managingAgencyInitials: z + .string() + .describe(`The managing agency name abbreviation or acronym`), + minDate: z.any().describe(`The starting date of the capital project`), + maxDate: z.any().describe(`The ending date of the capital project`), + category: z.lazy(() => capitalProjectCategorySchema).schema.optional(), +}); diff --git a/src/gen/zod/cityCouncilDistrictSchema.ts b/src/gen/zod/cityCouncilDistrictSchema.ts new file mode 100644 index 00000000..fd310de2 --- /dev/null +++ b/src/gen/zod/cityCouncilDistrictSchema.ts @@ -0,0 +1,8 @@ +import { z } from "zod"; + +export const cityCouncilDistrictSchema = z.object({ + id: z + .string() + .describe(`One or two character code to represent city council districts.`) + .regex(new RegExp("^([0-9]{1,2})$")), +}); diff --git a/src/gen/zod/communityDistrictSchema.ts b/src/gen/zod/communityDistrictSchema.ts new file mode 100644 index 00000000..8011815e --- /dev/null +++ b/src/gen/zod/communityDistrictSchema.ts @@ -0,0 +1,19 @@ +import { z } from "zod"; + +export const communityDistrictSchema = z.object({ + id: z + .string() + .describe( + `The two character numeric string containing the number used to refer to the community district.`, + ) + .regex(new RegExp("^([0-9]{2})$")) + .optional(), + boroughId: z + .string() + .describe( + `A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5.`, + ) + .regex(new RegExp("\\b[1-9]\\b")) + .optional(), + required: z.any().optional(), +}); diff --git a/src/gen/zod/findAgenciesSchema.ts b/src/gen/zod/findAgenciesSchema.ts new file mode 100644 index 00000000..572bfe26 --- /dev/null +++ b/src/gen/zod/findAgenciesSchema.ts @@ -0,0 +1,14 @@ +import { z } from "zod"; + +import { errorSchema } from "./errorSchema"; +import { agencySchema } from "./agencySchema"; + +export const findAgencies400Schema = z.lazy(() => errorSchema).schema; +export const findAgencies500Schema = z.lazy(() => errorSchema).schema; + +/** + * @description An object containing all agencies. + */ +export const findAgenciesQueryResponseSchema = z.object({ + agencies: z.array(z.lazy(() => agencySchema).schema), +}); diff --git a/src/gen/zod/findCommunityDistrictsByBoroughIdSchema.ts b/src/gen/zod/findCommunityDistrictsByBoroughIdSchema.ts new file mode 100644 index 00000000..7e1fc210 --- /dev/null +++ b/src/gen/zod/findCommunityDistrictsByBoroughIdSchema.ts @@ -0,0 +1,29 @@ +import { z } from "zod"; + +import { errorSchema } from "./errorSchema"; +import { communityDistrictSchema } from "./communityDistrictSchema"; + +export const findCommunityDistrictsByBoroughIdPathParamsSchema = z.object({ + boroughId: z + .string() + .describe( + `A single character numeric string containing the common number used to refer to the borough. Possible values are 1-5.`, + ) + .regex(new RegExp("^([0-9]{1})$")), +}); +export const findCommunityDistrictsByBoroughId400Schema = z.lazy( + () => errorSchema, +).schema; +export const findCommunityDistrictsByBoroughId404Schema = z.lazy( + () => errorSchema, +).schema; +export const findCommunityDistrictsByBoroughId500Schema = z.lazy( + () => errorSchema, +).schema; + +/** + * @description An object of community district schemas for the borough + */ +export const findCommunityDistrictsByBoroughIdQueryResponseSchema = z.object({ + communityDistricts: z.array(z.lazy(() => communityDistrictSchema).schema), +}); diff --git a/src/gen/zod/findTaxLotsSchema.ts b/src/gen/zod/findTaxLotsSchema.ts index 884ecdb4..a3625171 100644 --- a/src/gen/zod/findTaxLotsSchema.ts +++ b/src/gen/zod/findTaxLotsSchema.ts @@ -28,7 +28,7 @@ export const findTaxLotsQueryParamsSchema = z.object({ lons: z .array(z.number()) .describe( - `The longitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the latitudes.`, + `The longitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the latitudes. (If using a tool like axios, serializing the array with brackets is also supported. ex; lons[]=-74.010776&lons[]=-74.010776)`, ) .min(1) .max(5) @@ -36,7 +36,7 @@ export const findTaxLotsQueryParamsSchema = z.object({ lats: z .array(z.number()) .describe( - `The latitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the longitudes.`, + `The latitude portion of coordinates. It must be provided when applying a spatial filter and have the same length as the longitudes. (If using a tool like axios, serializing the array with brackets is also supported. ex; lats[]=40.708649&lats[]=40.707800)`, ) .min(1) .max(5) diff --git a/src/gen/zod/index.ts b/src/gen/zod/index.ts index dd06c164..ad6e407e 100644 --- a/src/gen/zod/index.ts +++ b/src/gen/zod/index.ts @@ -1,7 +1,16 @@ +export * from "./agencySchema"; export * from "./badRequestSchema"; export * from "./boroughSchema"; +export * from "./capitalCommitmentSchema"; +export * from "./capitalProjectBudgetedSchema"; +export * from "./capitalProjectCategorySchema"; +export * from "./capitalProjectSchema"; +export * from "./cityCouncilDistrictSchema"; +export * from "./communityDistrictSchema"; export * from "./errorSchema"; +export * from "./findAgenciesSchema"; export * from "./findBoroughsSchema"; +export * from "./findCommunityDistrictsByBoroughIdSchema"; export * from "./findLandUsesSchema"; export * from "./findTaxLotByBblSchema"; export * from "./findTaxLotGeoJsonByBblSchema";