Skip to content

Commit

Permalink
generate kubb files
Browse files Browse the repository at this point in the history
  • Loading branch information
TangoYankee committed Aug 13, 2024
1 parent 3901a69 commit 8123436
Show file tree
Hide file tree
Showing 43 changed files with 1,158 additions and 1 deletion.
18 changes: 18 additions & 0 deletions app/gen/axios/findCapitalCommitmentTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import client from "@kubb/swagger-client/client";
import type { ResponseConfig } from "@kubb/swagger-client/client";
import type { FindCapitalCommitmentTypesQueryResponse } from "../types/FindCapitalCommitmentTypes";

/**
* @summary Capital Commitment Types
* @link /capital-commitment-types
*/
export async function findCapitalCommitmentTypes(
options: Partial<Parameters<typeof client>[0]> = {},
): Promise<ResponseConfig<FindCapitalCommitmentTypesQueryResponse>["data"]> {
const res = await client<FindCapitalCommitmentTypesQueryResponse>({
method: "get",
url: `/capital-commitment-types`,
...options,
});
return res.data;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import client from "@kubb/swagger-client/client";
import type { ResponseConfig } from "@kubb/swagger-client/client";
import type {
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse,
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams,
} from "../types/FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId";

/**
* @summary Find a single capital project as a geojson feature
* @link /capital-projects/:managingCode/:capitalProjectId/geojson
*/
export async function findCapitalProjectGeoJsonByManagingCodeCapitalProjectId(
managingCode: FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams["managingCode"],
capitalProjectId: FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams["capitalProjectId"],
options: Partial<Parameters<typeof client>[0]> = {},
): Promise<
ResponseConfig<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse>["data"]
> {
const res =
await client<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse>(
{
method: "get",
url: `/capital-projects/${managingCode}/${capitalProjectId}/geojson`,
...options,
},
);
return res.data;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import client from "@kubb/swagger-client/client";
import type { ResponseConfig } from "@kubb/swagger-client/client";
import type {
FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse,
FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams,
} from "../types/FindCityCouncilDistrictGeoJsonByCityCouncilDistrictId";

/**
* @summary Find GeoJson for a specific city council district
* @link /city-council-districts/:cityCouncilDistrictId/geojson
*/
export async function findCityCouncilDistrictGeoJsonByCityCouncilDistrictId(
cityCouncilDistrictId: FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdPathParams["cityCouncilDistrictId"],
options: Partial<Parameters<typeof client>[0]> = {},
): Promise<
ResponseConfig<FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse>["data"]
> {
const res =
await client<FindCityCouncilDistrictGeoJsonByCityCouncilDistrictIdQueryResponse>(
{
method: "get",
url: `/city-council-districts/${cityCouncilDistrictId}/geojson`,
...options,
},
);
return res.data;
}
2 changes: 1 addition & 1 deletion app/gen/axios/findCityCouncilDistrictTiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
} from "../types/FindCityCouncilDistrictTiles";

/**
* @summary 🚧 Mapbox Vector Tiles for city council districts
* @summary Mapbox Vector Tiles for city council districts
* @link /city-council-districts/:z/:x/:y.pbf
*/
export async function findCityCouncilDistrictTiles(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import client from "@kubb/swagger-client/client";
import type { ResponseConfig } from "@kubb/swagger-client/client";
import type {
FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse,
FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams,
} from "../types/FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId";

/**
* @summary Find GeoJson for a specific community district
* @link /boroughs/:boroughId/community-districts/:communityDistrictId/geojson
*/
export async function findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId(
boroughId: FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams["boroughId"],
communityDistrictId: FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdPathParams["communityDistrictId"],
options: Partial<Parameters<typeof client>[0]> = {},
): Promise<
ResponseConfig<FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse>["data"]
> {
const res =
await client<FindCommunityDistrictGeoJsonByBoroughIdCommunityDistrictIdQueryResponse>(
{
method: "get",
url: `/boroughs/${boroughId}/community-districts/${communityDistrictId}/geojson`,
...options,
},
);
return res.data;
}
4 changes: 4 additions & 0 deletions app/gen/axios/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
export * from "./findAgencies";
export * from "./findBoroughs";
export * from "./findCapitalCommitmentTypes";
export * from "./findCapitalCommitmentsByManagingCodeCapitalProjectId";
export * from "./findCapitalProjectByManagingCodeCapitalProjectId";
export * from "./findCapitalProjectGeoJsonByManagingCodeCapitalProjectId";
export * from "./findCapitalProjectTiles";
export * from "./findCapitalProjectsByBoroughIdCommunityDistrictId";
export * from "./findCapitalProjectsByCityCouncilId";
export * from "./findCityCouncilDistrictGeoJsonByCityCouncilDistrictId";
export * from "./findCityCouncilDistrictTiles";
export * from "./findCityCouncilDistricts";
export * from "./findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId";
export * from "./findCommunityDistrictTiles";
export * from "./findCommunityDistrictsByBoroughId";
export * from "./findLandUses";
Expand Down
16 changes: 16 additions & 0 deletions app/gen/axios/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,26 @@ export const operations = {
path: "/boroughs/:boroughId/community-districts",
method: "get",
},
findCommunityDistrictGeoJsonByBoroughIdCommunityDistrictId: {
path: "/boroughs/:boroughId/community-districts/:communityDistrictId/geojson",
method: "get",
},
findCapitalProjectsByBoroughIdCommunityDistrictId: {
path: "/boroughs/:boroughId/community-districts/:communityDistrictId/capital-projects",
method: "get",
},
findCapitalCommitmentTypes: {
path: "/capital-commitment-types",
method: "get",
},
findCapitalCommitmentsByManagingCodeCapitalProjectId: {
path: "/capital-projects/:managingCode/:capitalProjectId/capital-commitments",
method: "get",
},
findCapitalProjectGeoJsonByManagingCodeCapitalProjectId: {
path: "/capital-projects/:managingCode/:capitalProjectId/geojson",
method: "get",
},
findCapitalProjectByManagingCodeCapitalProjectId: {
path: "/capital-projects/:managingCode/:capitalProjectId",
method: "get",
Expand All @@ -31,6 +43,10 @@ export const operations = {
path: "/city-council-districts",
method: "get",
},
findCityCouncilDistrictGeoJsonByCityCouncilDistrictId: {
path: "/city-council-districts/:cityCouncilDistrictId/geojson",
method: "get",
},
findCapitalProjectsByCityCouncilId: {
path: "/city-council-districts/:cityCouncilDistrictId/capital-projects",
method: "get",
Expand Down
12 changes: 12 additions & 0 deletions app/gen/mocks/createCapitalCommitmentType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { faker } from "@faker-js/faker";
import RandExp from "randexp";
import type { CapitalCommitmentType } from "../types/CapitalCommitmentType";

export function createCapitalCommitmentType(
data: NonNullable<Partial<CapitalCommitmentType>> = {},
): NonNullable<CapitalCommitmentType> {
return {
...{ code: faker.string.alpha(), description: faker.string.alpha() },
...data,
};
}
23 changes: 23 additions & 0 deletions app/gen/mocks/createCapitalProjectBudgetedGeoJson.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { createMultiPoint } from "./createMultiPoint";
import { createMultiPolygon } from "./createMultiPolygon";
import { createCapitalProjectBudgeted } from "./createCapitalProjectBudgeted";
import { faker } from "@faker-js/faker";
import RandExp from "randexp";
import type { CapitalProjectBudgetedGeoJson } from "../types/CapitalProjectBudgetedGeoJson";

export function createCapitalProjectBudgetedGeoJson(
data: NonNullable<Partial<CapitalProjectBudgetedGeoJson>> = {},
): NonNullable<CapitalProjectBudgetedGeoJson> {
return {
...{
id: faker.string.alpha(),
type: faker.helpers.arrayElement<any>(["Feature"]),
geometry: faker.helpers.arrayElement<any>([
createMultiPoint(),
createMultiPolygon(),
]),
properties: createCapitalProjectBudgeted(),
},
...data,
};
}
22 changes: 22 additions & 0 deletions app/gen/mocks/createCityCouncilDistrictGeoJson.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { createCityCouncilDistrict } from "./createCityCouncilDistrict";
import { createMultiPolygon } from "./createMultiPolygon";
import { faker } from "@faker-js/faker";
import RandExp from "randexp";
import type { CityCouncilDistrictGeoJson } from "../types/CityCouncilDistrictGeoJson";

export function createCityCouncilDistrictGeoJson(
data: NonNullable<Partial<CityCouncilDistrictGeoJson>> = {},
): NonNullable<CityCouncilDistrictGeoJson> {
return {
...{
id: faker.helpers.arrayElement<any>([
faker.string.alpha(),
new RandExp("^([0-9]{1,2})$").gen(),
]),
type: faker.helpers.arrayElement<any>(["Feature"]),
properties: createCityCouncilDistrict(),
geometry: createMultiPolygon(),
},
...data,
};
}
22 changes: 22 additions & 0 deletions app/gen/mocks/createCommunityDistrictGeoJson.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { createCommunityDistrict } from "./createCommunityDistrict";
import { createMultiPolygon } from "./createMultiPolygon";
import { faker } from "@faker-js/faker";
import RandExp from "randexp";
import type { CommunityDistrictGeoJson } from "../types/CommunityDistrictGeoJson";

export function createCommunityDistrictGeoJson(
data: NonNullable<Partial<CommunityDistrictGeoJson>> = {},
): NonNullable<CommunityDistrictGeoJson> {
return {
...{
id: faker.helpers.arrayElement<any>([
faker.string.alpha(),
new RandExp("^([0-9]{3})$").gen(),
]),
type: faker.helpers.arrayElement<any>(["Feature"]),
properties: createCommunityDistrict(),
geometry: createMultiPolygon(),
},
...data,
};
}
46 changes: 46 additions & 0 deletions app/gen/mocks/createFindCapitalCommitmentTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { faker } from "@faker-js/faker";
import RandExp from "randexp";
import { createCapitalCommitmentType } from "./createCapitalCommitmentType";
import { createError } from "./createError";
import type {
FindCapitalCommitmentTypes200,
FindCapitalCommitmentTypes400,
FindCapitalCommitmentTypes500,
FindCapitalCommitmentTypesQueryResponse,
} from "../types/FindCapitalCommitmentTypes";

/**
* @description An object containing all capital commitment types.
*/
export function createFindCapitalCommitmentTypes200(): NonNullable<FindCapitalCommitmentTypes200> {
return {
capitalCommitmentTypes: faker.helpers.arrayElements([
createCapitalCommitmentType(),
]) as any,
};
}

/**
* @description Invalid client request
*/
export function createFindCapitalCommitmentTypes400(): NonNullable<FindCapitalCommitmentTypes400> {
return createError();
}

/**
* @description Server side error
*/
export function createFindCapitalCommitmentTypes500(): NonNullable<FindCapitalCommitmentTypes500> {
return createError();
}

/**
* @description An object containing all capital commitment types.
*/
export function createFindCapitalCommitmentTypesQueryResponse(): NonNullable<FindCapitalCommitmentTypesQueryResponse> {
return {
capitalCommitmentTypes: faker.helpers.arrayElements([
createCapitalCommitmentType(),
]) as any,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { faker } from "@faker-js/faker";
import RandExp from "randexp";
import { createCapitalProjectBudgetedGeoJson } from "./createCapitalProjectBudgetedGeoJson";
import { createError } from "./createError";
import type {
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams,
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId200,
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId400,
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId404,
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId500,
FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse,
} from "../types/FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId";

export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams(): NonNullable<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdPathParams> {
return {
managingCode: faker.helpers.arrayElement<any>([
faker.string.alpha(),
new RandExp("^([0-9]{3})$").gen(),
]),
capitalProjectId: faker.string.alpha(),
};
}

/**
* @description A capital project geojson object
*/
export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId200(): NonNullable<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId200> {
return createCapitalProjectBudgetedGeoJson();
}

/**
* @description Invalid client request
*/
export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId400(): NonNullable<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId400> {
return createError();
}

/**
* @description Requested resource does not exist or is not available
*/
export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId404(): NonNullable<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId404> {
return createError();
}

/**
* @description Server side error
*/
export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectId500(): NonNullable<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectId500> {
return createError();
}

/**
* @description A capital project geojson object
*/
export function createFindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse(): NonNullable<FindCapitalProjectGeoJsonByManagingCodeCapitalProjectIdQueryResponse> {
return createCapitalProjectBudgetedGeoJson();
}
Loading

0 comments on commit 8123436

Please sign in to comment.