mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-21 13:06:59 +02:00
@@ -30,7 +30,7 @@ const listAccessTokensParamsSchema = z
|
|||||||
error: "Either resourceId or orgId must be provided, but not both"
|
error: "Either resourceId or orgId must be provided, but not both"
|
||||||
});
|
});
|
||||||
|
|
||||||
const listAccessTokensSchema = z.object({
|
const listAccessTokensSchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const paramsSchema = z.object({
|
|||||||
apiKeyId: z.string().nonempty()
|
apiKeyId: z.string().nonempty()
|
||||||
});
|
});
|
||||||
|
|
||||||
const querySchema = z.object({
|
const querySchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { eq, and } from "drizzle-orm";
|
|||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
||||||
|
|
||||||
const querySchema = z.object({
|
const querySchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { z } from "zod";
|
|||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
|
|
||||||
const querySchema = z.object({
|
const querySchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import response from "@server/lib/response";
|
|||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
|
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
|
||||||
|
|
||||||
export const queryAccessAuditLogsQuery = z.object({
|
export const queryAccessAuditLogsQuery = z.strictObject({
|
||||||
// iso string just validate its a parseable date
|
// iso string just validate its a parseable date
|
||||||
timeStart: z
|
timeStart: z
|
||||||
.string()
|
.string()
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const listClientsParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listClientsSchema = z.object({
|
const listClientsSchema = z.strictObject({
|
||||||
pageSize: z.coerce
|
pageSize: z.coerce
|
||||||
.number<string>() // for prettier formatting
|
.number<string>() // for prettier formatting
|
||||||
.int()
|
.int()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const listUserDevicesParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listUserDevicesSchema = z.object({
|
const listUserDevicesSchema = z.strictObject({
|
||||||
pageSize: z.coerce
|
pageSize: z.coerce
|
||||||
.number<string>() // for prettier formatting
|
.number<string>() // for prettier formatting
|
||||||
.int()
|
.int()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import logger from "@server/logger";
|
|||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
import { getUserDeviceName } from "@server/db/names";
|
import { getUserDeviceName } from "@server/db/names";
|
||||||
|
|
||||||
const querySchema = z.object({
|
const querySchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { fromZodError } from "zod-validation-error";
|
|||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
||||||
|
|
||||||
const listOrgsSchema = z.object({
|
const listOrgsSchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const listOrgsParamsSchema = z.object({
|
|||||||
userId: z.string()
|
userId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listOrgsSchema = z.object({
|
const listOrgsSchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const listResourceRulesParamsSchema = z.strictObject({
|
|||||||
resourceId: z.coerce.number().int().positive()
|
resourceId: z.coerce.number().int().positive()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listResourceRulesSchema = z.object({
|
const listResourceRulesSchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const listResourcesParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listResourcesSchema = z.object({
|
const listResourcesSchema = z.strictObject({
|
||||||
pageSize: z.coerce
|
pageSize: z.coerce
|
||||||
.number<string>() // for prettier formatting
|
.number<string>() // for prettier formatting
|
||||||
.int()
|
.int()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const listUserResourceAliasesParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listUserResourceAliasesQuerySchema = z.object({
|
const listUserResourceAliasesQuerySchema = z.strictObject({
|
||||||
pageSize: z.coerce
|
pageSize: z.coerce
|
||||||
.number<string>()
|
.number<string>()
|
||||||
.int()
|
.int()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const listRolesParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listRolesSchema = z.object({
|
const listRolesSchema = z.strictObject({
|
||||||
pageSize: z.coerce
|
pageSize: z.coerce
|
||||||
.number<string>() // for prettier formatting
|
.number<string>() // for prettier formatting
|
||||||
.int()
|
.int()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const listSitesParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listSitesSchema = z.object({
|
const listSitesSchema = z.strictObject({
|
||||||
pageSize: z.coerce
|
pageSize: z.coerce
|
||||||
.number<string>() // for prettier formatting
|
.number<string>() // for prettier formatting
|
||||||
.int()
|
.int()
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const listAllSiteResourcesByOrgParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listAllSiteResourcesByOrgQuerySchema = z.object({
|
const listAllSiteResourcesByOrgQuerySchema = z.strictObject({
|
||||||
pageSize: z.coerce
|
pageSize: z.coerce
|
||||||
.number<string>() // for prettier formatting
|
.number<string>() // for prettier formatting
|
||||||
.int()
|
.int()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const listSiteResourcesParamsSchema = z.strictObject({
|
|||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listSiteResourcesQuerySchema = z.object({
|
const listSiteResourcesQuerySchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const listTargetsParamsSchema = z.strictObject({
|
|||||||
resourceId: z.coerce.number().int().positive()
|
resourceId: z.coerce.number().int().positive()
|
||||||
});
|
});
|
||||||
|
|
||||||
const listTargetsSchema = z.object({
|
const listTargetsSchema = z.strictObject({
|
||||||
limit: z
|
limit: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
|
|||||||
Reference in New Issue
Block a user