Skip to content

Commit

Permalink
Regenerate types and zod schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
pratishta committed May 24, 2024
1 parent b710a11 commit 3d4420f
Show file tree
Hide file tree
Showing 22 changed files with 399 additions and 4 deletions.
14 changes: 14 additions & 0 deletions src/gen/types/Agency.ts
Original file line number Diff line number Diff line change
@@ -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;
};
50 changes: 50 additions & 0 deletions src/gen/types/CapitalCommitment.ts
Original file line number Diff line number Diff line change
@@ -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;
};
41 changes: 41 additions & 0 deletions src/gen/types/CapitalProject.ts
Original file line number Diff line number Diff line change
@@ -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;
};
22 changes: 22 additions & 0 deletions src/gen/types/CapitalProjectBudgeted.ts
Original file line number Diff line number Diff line change
@@ -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[];
};
7 changes: 7 additions & 0 deletions src/gen/types/CapitalProjectCategory.ts
Original file line number Diff line number Diff line change
@@ -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];
8 changes: 8 additions & 0 deletions src/gen/types/CityCouncilDistrict.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export type CityCouncilDistrict = {
/**
* @description One or two character code to represent city council districts.
* @type string
* @example 25
*/
id: string;
};
15 changes: 15 additions & 0 deletions src/gen/types/CommunityDistrict.ts
Original file line number Diff line number Diff line change
@@ -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;
};
16 changes: 16 additions & 0 deletions src/gen/types/FindAgencies.ts
Original file line number Diff line number Diff line change
@@ -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[];
};
27 changes: 27 additions & 0 deletions src/gen/types/FindCommunityDistrictsByBoroughId.ts
Original file line number Diff line number Diff line change
@@ -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[];
};
4 changes: 2 additions & 2 deletions src/gen/types/FindTaxLots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
9 changes: 9 additions & 0 deletions src/gen/types/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
10 changes: 10 additions & 0 deletions src/gen/zod/agencySchema.ts
Original file line number Diff line number Diff line change
@@ -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.`),
});
45 changes: 45 additions & 0 deletions src/gen/zod/capitalCommitmentSchema.ts
Original file line number Diff line number Diff line change
@@ -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(),
});
23 changes: 23 additions & 0 deletions src/gen/zod/capitalProjectBudgetedSchema.ts
Original file line number Diff line number Diff line change
@@ -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.`,
),
}),
);
7 changes: 7 additions & 0 deletions src/gen/zod/capitalProjectCategorySchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { z } from "zod";

export const capitalProjectCategorySchema = z.enum([
`Fixed Asset`,
`Lump Sum`,
`ITT, Vehicles and Equipment`,
]);
22 changes: 22 additions & 0 deletions src/gen/zod/capitalProjectSchema.ts
Original file line number Diff line number Diff line change
@@ -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(),
});
8 changes: 8 additions & 0 deletions src/gen/zod/cityCouncilDistrictSchema.ts
Original file line number Diff line number Diff line change
@@ -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})$")),
});
19 changes: 19 additions & 0 deletions src/gen/zod/communityDistrictSchema.ts
Original file line number Diff line number Diff line change
@@ -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(),
});
14 changes: 14 additions & 0 deletions src/gen/zod/findAgenciesSchema.ts
Original file line number Diff line number Diff line change
@@ -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),
});
Loading

0 comments on commit 3d4420f

Please sign in to comment.