openapi and swagger ui improvements and cleanup

This commit is contained in:
miloschwartz
2026-03-02 21:59:20 -08:00
parent 64bae5b142
commit ed95f10fcc
103 changed files with 206 additions and 132 deletions

View File

@@ -17,6 +17,7 @@ import fs from "fs";
import path from "path"; import path from "path";
import { APP_PATH } from "./lib/consts"; import { APP_PATH } from "./lib/consts";
import yaml from "js-yaml"; import yaml from "js-yaml";
import { z } from "zod";
const dev = process.env.ENVIRONMENT !== "prod"; const dev = process.env.ENVIRONMENT !== "prod";
const externalPort = config.getRawConfig().server.integration_port; const externalPort = config.getRawConfig().server.integration_port;
@@ -38,12 +39,24 @@ export function createIntegrationApiServer() {
apiServer.use(cookieParser()); apiServer.use(cookieParser());
apiServer.use(express.json()); apiServer.use(express.json());
const openApiDocumentation = getOpenApiDocumentation();
apiServer.use( apiServer.use(
"/v1/docs", "/v1/docs",
swaggerUi.serve, swaggerUi.serve,
swaggerUi.setup(getOpenApiDocumentation()) swaggerUi.setup(openApiDocumentation)
); );
// Unauthenticated OpenAPI spec endpoints
apiServer.get("/v1/openapi.json", (_req, res) => {
res.json(openApiDocumentation);
});
apiServer.get("/v1/openapi.yaml", (_req, res) => {
const yamlOutput = yaml.dump(openApiDocumentation);
res.type("application/yaml").send(yamlOutput);
});
// API routes // API routes
const prefix = `/v1`; const prefix = `/v1`;
apiServer.use(logIncomingMiddleware); apiServer.use(logIncomingMiddleware);
@@ -75,16 +88,6 @@ function getOpenApiDocumentation() {
} }
); );
for (const def of registry.definitions) {
if (def.type === "route") {
def.route.security = [
{
[bearerAuth.name]: []
}
];
}
}
registry.registerPath({ registry.registerPath({
method: "get", method: "get",
path: "/", path: "/",
@@ -94,6 +97,74 @@ function getOpenApiDocumentation() {
responses: {} responses: {}
}); });
registry.registerPath({
method: "get",
path: "/openapi.json",
description: "Get OpenAPI specification as JSON",
tags: [],
request: {},
responses: {
"200": {
description: "OpenAPI specification as JSON",
content: {
"application/json": {
schema: {
type: "object"
}
}
}
}
}
});
registry.registerPath({
method: "get",
path: "/openapi.yaml",
description: "Get OpenAPI specification as YAML",
tags: [],
request: {},
responses: {
"200": {
description: "OpenAPI specification as YAML",
content: {
"application/yaml": {
schema: {
type: "string"
}
}
}
}
}
});
for (const def of registry.definitions) {
if (def.type === "route") {
def.route.security = [
{
[bearerAuth.name]: []
}
];
// Ensure every route has a generic JSON response schema so Swagger UI can render responses
const existingResponses = def.route.responses;
const hasExistingResponses =
existingResponses && Object.keys(existingResponses).length > 0;
if (!hasExistingResponses) {
def.route.responses = {
"*": {
description: "",
content: {
"application/json": {
schema: z.object({})
}
}
}
};
}
}
}
const generator = new OpenApiGeneratorV3(registry.definitions); const generator = new OpenApiGeneratorV3(registry.definitions);
const generated = generator.generateDocument({ const generated = generator.generateDocument({

View File

@@ -5,17 +5,20 @@ export const registry = new OpenAPIRegistry();
export enum OpenAPITags { export enum OpenAPITags {
Site = "Site", Site = "Site",
Org = "Organization", Org = "Organization",
Resource = "Resource", PublicResource = "Public Resource",
PrivateResource = "Private Resource",
Role = "Role", Role = "Role",
User = "User", User = "User",
Invitation = "Invitation", Invitation = "User Invitation",
Target = "Target", Target = "Resource Target",
Rule = "Rule", Rule = "Rule",
AccessToken = "Access Token", AccessToken = "Access Token",
Idp = "Identity Provider", GlobalIdp = "Identity Provider (Global)",
OrgIdp = "Identity Provider (Organization Only)",
Client = "Client", Client = "Client",
ApiKey = "API Key", ApiKey = "API Key",
Domain = "Domain", Domain = "Domain",
Blueprint = "Blueprint", Blueprint = "Blueprint",
Ssh = "SSH" Ssh = "SSH",
Logs = "Logs"
} }

View File

@@ -32,7 +32,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/logs/access/export", path: "/org/{orgId}/logs/access/export",
description: "Export the access audit log for an organization as CSV", description: "Export the access audit log for an organization as CSV",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Logs],
request: { request: {
query: queryAccessAuditLogsQuery, query: queryAccessAuditLogsQuery,
params: queryAccessAuditLogsParams params: queryAccessAuditLogsParams

View File

@@ -32,7 +32,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/logs/action/export", path: "/org/{orgId}/logs/action/export",
description: "Export the action audit log for an organization as CSV", description: "Export the action audit log for an organization as CSV",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Logs],
request: { request: {
query: queryActionAuditLogsQuery, query: queryActionAuditLogsQuery,
params: queryActionAuditLogsParams params: queryActionAuditLogsParams

View File

@@ -249,7 +249,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/logs/access", path: "/org/{orgId}/logs/access",
description: "Query the access audit log for an organization", description: "Query the access audit log for an organization",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Logs],
request: { request: {
query: queryAccessAuditLogsQuery, query: queryAccessAuditLogsQuery,
params: queryAccessAuditLogsParams params: queryAccessAuditLogsParams

View File

@@ -160,7 +160,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/logs/action", path: "/org/{orgId}/logs/action",
description: "Query the action audit log for an organization", description: "Query the action audit log for an organization",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Logs],
request: { request: {
query: queryActionAuditLogsQuery, query: queryActionAuditLogsQuery,
params: queryActionAuditLogsParams params: queryActionAuditLogsParams

View File

@@ -31,16 +31,16 @@ const getOrgSchema = z.strictObject({
orgId: z.string() orgId: z.string()
}); });
registry.registerPath({ // registry.registerPath({
method: "get", // method: "get",
path: "/org/{orgId}/billing/usage", // path: "/org/{orgId}/billing/usage",
description: "Get an organization's billing usage", // description: "Get an organization's billing usage",
tags: [OpenAPITags.Org], // tags: [OpenAPITags.Org],
request: { // request: {
params: getOrgSchema // params: getOrgSchema
}, // },
responses: {} // responses: {}
}); // });
export async function getOrgUsage( export async function getOrgUsage(
req: Request, req: Request,

View File

@@ -52,7 +52,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/idp/oidc", path: "/org/{orgId}/idp/oidc",
description: "Create an OIDC IdP for a specific organization.", description: "Create an OIDC IdP for a specific organization.",
tags: [OpenAPITags.Idp, OpenAPITags.Org], tags: [OpenAPITags.OrgIdp],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -35,7 +35,7 @@ registry.registerPath({
method: "delete", method: "delete",
path: "/org/{orgId}/idp/{idpId}", path: "/org/{orgId}/idp/{idpId}",
description: "Delete IDP for a specific organization.", description: "Delete IDP for a specific organization.",
tags: [OpenAPITags.Idp, OpenAPITags.Org], tags: [OpenAPITags.OrgIdp],
request: { request: {
params: paramsSchema params: paramsSchema
}, },

View File

@@ -50,9 +50,9 @@ async function query(idpId: number, orgId: string) {
registry.registerPath({ registry.registerPath({
method: "get", method: "get",
path: "/org/:orgId/idp/:idpId", path: "/org/{orgId}/idp/{idpId}",
description: "Get an IDP by its IDP ID for a specific organization.", description: "Get an IDP by its IDP ID for a specific organization.",
tags: [OpenAPITags.Idp, OpenAPITags.Org], tags: [OpenAPITags.OrgIdp],
request: { request: {
params: paramsSchema params: paramsSchema
}, },

View File

@@ -67,7 +67,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/idp", path: "/org/{orgId}/idp",
description: "List all IDP for a specific organization.", description: "List all IDP for a specific organization.",
tags: [OpenAPITags.Idp, OpenAPITags.Org], tags: [OpenAPITags.OrgIdp],
request: { request: {
query: querySchema, query: querySchema,
params: paramsSchema params: paramsSchema

View File

@@ -59,7 +59,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/org/{orgId}/idp/{idpId}/oidc", path: "/org/{orgId}/idp/{idpId}/oidc",
description: "Update an OIDC IdP for a specific organization.", description: "Update an OIDC IdP for a specific organization.",
tags: [OpenAPITags.Idp, OpenAPITags.Org], tags: [OpenAPITags.OrgIdp],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -52,7 +52,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/maintenance/info", path: "/maintenance/info",
description: "Get maintenance information for a resource by domain.", description: "Get maintenance information for a resource by domain.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
query: z.object({ query: z.object({
fullDomain: z.string() fullDomain: z.string()

View File

@@ -43,7 +43,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/access-token", path: "/resource/{resourceId}/access-token",
description: "Generate a new access token for a resource.", description: "Generate a new access token for a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.AccessToken], tags: [OpenAPITags.PublicResource, OpenAPITags.AccessToken],
request: { request: {
params: generateAccssTokenParamsSchema, params: generateAccssTokenParamsSchema,
body: { body: {

View File

@@ -122,7 +122,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/access-tokens", path: "/org/{orgId}/access-tokens",
description: "List all access tokens in an organization.", description: "List all access tokens in an organization.",
tags: [OpenAPITags.Org, OpenAPITags.AccessToken], tags: [OpenAPITags.AccessToken],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string() orgId: z.string()
@@ -135,8 +135,8 @@ registry.registerPath({
registry.registerPath({ registry.registerPath({
method: "get", method: "get",
path: "/resource/{resourceId}/access-tokens", path: "/resource/{resourceId}/access-tokens",
description: "List all access tokens in an organization.", description: "List all access tokens for a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.AccessToken], tags: [OpenAPITags.PublicResource, OpenAPITags.AccessToken],
request: { request: {
params: z.object({ params: z.object({
resourceId: z.number() resourceId: z.number()

View File

@@ -37,7 +37,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/api-key", path: "/org/{orgId}/api-key",
description: "Create a new API key scoped to the organization.", description: "Create a new API key scoped to the organization.",
tags: [OpenAPITags.Org, OpenAPITags.ApiKey], tags: [OpenAPITags.ApiKey],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -18,7 +18,7 @@ registry.registerPath({
method: "delete", method: "delete",
path: "/org/{orgId}/api-key/{apiKeyId}", path: "/org/{orgId}/api-key/{apiKeyId}",
description: "Delete an API key.", description: "Delete an API key.",
tags: [OpenAPITags.Org, OpenAPITags.ApiKey], tags: [OpenAPITags.ApiKey],
request: { request: {
params: paramsSchema params: paramsSchema
}, },

View File

@@ -48,7 +48,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/api-key/{apiKeyId}/actions", path: "/org/{orgId}/api-key/{apiKeyId}/actions",
description: "List all actions set for an API key.", description: "List all actions set for an API key.",
tags: [OpenAPITags.Org, OpenAPITags.ApiKey], tags: [OpenAPITags.ApiKey],
request: { request: {
params: paramsSchema, params: paramsSchema,
query: querySchema query: querySchema

View File

@@ -52,7 +52,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/api-keys", path: "/org/{orgId}/api-keys",
description: "List all API keys for an organization", description: "List all API keys for an organization",
tags: [OpenAPITags.Org, OpenAPITags.ApiKey], tags: [OpenAPITags.ApiKey],
request: { request: {
params: paramsSchema, params: paramsSchema,
query: querySchema query: querySchema

View File

@@ -25,7 +25,7 @@ registry.registerPath({
path: "/org/{orgId}/api-key/{apiKeyId}/actions", path: "/org/{orgId}/api-key/{apiKeyId}/actions",
description: description:
"Set actions for an API key. This will replace any existing actions.", "Set actions for an API key. This will replace any existing actions.",
tags: [OpenAPITags.Org, OpenAPITags.ApiKey], tags: [OpenAPITags.ApiKey],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -20,7 +20,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/logs/request", path: "/org/{orgId}/logs/request",
description: "Query the request audit log for an organization", description: "Query the request audit log for an organization",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Logs],
request: { request: {
query: queryAccessAuditLogsQuery.omit({ query: queryAccessAuditLogsQuery.omit({
limit: true, limit: true,

View File

@@ -151,7 +151,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/logs/analytics", path: "/org/{orgId}/logs/analytics",
description: "Query the request audit analytics for an organization", description: "Query the request audit analytics for an organization",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Logs],
request: { request: {
query: queryAccessAuditLogsQuery, query: queryAccessAuditLogsQuery,
params: queryRequestAuditLogsParams params: queryRequestAuditLogsParams

View File

@@ -182,7 +182,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/logs/request", path: "/org/{orgId}/logs/request",
description: "Query the request audit log for an organization", description: "Query the request audit log for an organization",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Logs],
request: { request: {
query: queryAccessAuditLogsQuery, query: queryAccessAuditLogsQuery,
params: queryRequestAuditLogsParams params: queryRequestAuditLogsParams

View File

@@ -20,7 +20,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/blueprint", path: "/org/{orgId}/blueprint",
description: "Apply a base64 encoded JSON blueprint to an organization", description: "Apply a base64 encoded JSON blueprint to an organization",
tags: [OpenAPITags.Org, OpenAPITags.Blueprint], tags: [OpenAPITags.Blueprint],
request: { request: {
params: applyBlueprintParamsSchema, params: applyBlueprintParamsSchema,
body: { body: {

View File

@@ -43,7 +43,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/blueprint", path: "/org/{orgId}/blueprint",
description: "Create and apply a YAML blueprint to an organization", description: "Create and apply a YAML blueprint to an organization",
tags: [OpenAPITags.Org, OpenAPITags.Blueprint], tags: [OpenAPITags.Blueprint],
request: { request: {
params: applyBlueprintParamsSchema, params: applyBlueprintParamsSchema,
body: { body: {

View File

@@ -53,7 +53,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/blueprint/{blueprintId}", path: "/org/{orgId}/blueprint/{blueprintId}",
description: "Get a blueprint by its blueprint ID.", description: "Get a blueprint by its blueprint ID.",
tags: [OpenAPITags.Org, OpenAPITags.Blueprint], tags: [OpenAPITags.Blueprint],
request: { request: {
params: getBlueprintSchema params: getBlueprintSchema
}, },

View File

@@ -67,7 +67,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/blueprints", path: "/org/{orgId}/blueprints",
description: "List all blueprints for a organization.", description: "List all blueprints for a organization.",
tags: [OpenAPITags.Org, OpenAPITags.Blueprint], tags: [OpenAPITags.Blueprint],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string() orgId: z.string()

View File

@@ -48,7 +48,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/client", path: "/org/{orgId}/client",
description: "Create a new client for an organization.", description: "Create a new client for an organization.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.Client],
request: { request: {
params: createClientParamsSchema, params: createClientParamsSchema,
body: { body: {

View File

@@ -49,7 +49,7 @@ registry.registerPath({
path: "/org/{orgId}/user/{userId}/client", path: "/org/{orgId}/user/{userId}/client",
description: description:
"Create a new client for a user and associate it with an existing olm.", "Create a new client for a user and associate it with an existing olm.",
tags: [OpenAPITags.Client, OpenAPITags.Org, OpenAPITags.User], tags: [OpenAPITags.Client],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -243,7 +243,7 @@ registry.registerPath({
path: "/org/{orgId}/client/{niceId}", path: "/org/{orgId}/client/{niceId}",
description: description:
"Get a client by orgId and niceId. NiceId is a readable ID for the site and unique on a per org basis.", "Get a client by orgId and niceId. NiceId is a readable ID for the site and unique on a per org basis.",
tags: [OpenAPITags.Org, OpenAPITags.Site], tags: [OpenAPITags.Site],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string(), orgId: z.string(),

View File

@@ -237,7 +237,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/clients", path: "/org/{orgId}/clients",
description: "List all clients for an organization.", description: "List all clients for an organization.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.Client],
request: { request: {
query: listClientsSchema, query: listClientsSchema,
params: listClientsParamsSchema params: listClientsParamsSchema

View File

@@ -256,7 +256,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/user-devices", path: "/org/{orgId}/user-devices",
description: "List all user devices for an organization.", description: "List all user devices for an organization.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.Client],
request: { request: {
query: listUserDevicesSchema, query: listUserDevicesSchema,
params: listUserDevicesParamsSchema params: listUserDevicesParamsSchema

View File

@@ -23,7 +23,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/pick-client-defaults", path: "/org/{orgId}/pick-client-defaults",
description: "Return pre-requisite data for creating a client.", description: "Return pre-requisite data for creating a client.",
tags: [OpenAPITags.Client, OpenAPITags.Site], tags: [OpenAPITags.Client],
request: { request: {
params: pickClientDefaultsSchema params: pickClientDefaultsSchema
}, },

View File

@@ -59,7 +59,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/domains", path: "/org/{orgId}/domains",
description: "List all domains for a organization.", description: "List all domains for a organization.",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Domain],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string() orgId: z.string()

View File

@@ -27,7 +27,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/idp/{idpId}/org/{orgId}", path: "/idp/{idpId}/org/{orgId}",
description: "Create an IDP policy for an existing IDP on an organization.", description: "Create an IDP policy for an existing IDP on an organization.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -37,7 +37,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/idp/oidc", path: "/idp/oidc",
description: "Create an OIDC IdP.", description: "Create an OIDC IdP.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
body: { body: {
content: { content: {

View File

@@ -21,7 +21,7 @@ registry.registerPath({
method: "delete", method: "delete",
path: "/idp/{idpId}", path: "/idp/{idpId}",
description: "Delete IDP.", description: "Delete IDP.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
params: paramsSchema params: paramsSchema
}, },

View File

@@ -19,7 +19,7 @@ registry.registerPath({
method: "delete", method: "delete",
path: "/idp/{idpId}/org/{orgId}", path: "/idp/{idpId}/org/{orgId}",
description: "Create an OIDC IdP for an organization.", description: "Create an OIDC IdP for an organization.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
params: paramsSchema params: paramsSchema
}, },

View File

@@ -34,7 +34,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/idp/{idpId}", path: "/idp/{idpId}",
description: "Get an IDP by its IDP ID.", description: "Get an IDP by its IDP ID.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
params: paramsSchema params: paramsSchema
}, },

View File

@@ -48,7 +48,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/idp/{idpId}/org", path: "/idp/{idpId}/org",
description: "List all org policies on an IDP.", description: "List all org policies on an IDP.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
params: paramsSchema, params: paramsSchema,
query: querySchema query: querySchema

View File

@@ -58,7 +58,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/idp", path: "/idp",
description: "List all IDP in the system.", description: "List all IDP in the system.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
query: querySchema query: querySchema
}, },

View File

@@ -26,7 +26,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/idp/{idpId}/org/{orgId}", path: "/idp/{idpId}/org/{orgId}",
description: "Update an IDP org policy.", description: "Update an IDP org policy.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -42,7 +42,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/idp/{idpId}/oidc", path: "/idp/{idpId}/oidc",
description: "Update an OIDC IdP.", description: "Update an OIDC IdP.",
tags: [OpenAPITags.Idp], tags: [OpenAPITags.GlobalIdp],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -29,7 +29,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/whitelist/add", path: "/resource/{resourceId}/whitelist/add",
description: "Add a single email to the resource whitelist.", description: "Add a single email to the resource whitelist.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: addEmailToResourceWhitelistParamsSchema, params: addEmailToResourceWhitelistParamsSchema,
body: { body: {

View File

@@ -29,7 +29,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/roles/add", path: "/resource/{resourceId}/roles/add",
description: "Add a single role to a resource.", description: "Add a single role to a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PublicResource, OpenAPITags.Role],
request: { request: {
params: addRoleToResourceParamsSchema, params: addRoleToResourceParamsSchema,
body: { body: {

View File

@@ -29,7 +29,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/users/add", path: "/resource/{resourceId}/users/add",
description: "Add a single user to a resource.", description: "Add a single user to a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PublicResource, OpenAPITags.User],
request: { request: {
params: addUserToResourceParamsSchema, params: addUserToResourceParamsSchema,
body: { body: {

View File

@@ -79,7 +79,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/resource", path: "/org/{orgId}/resource",
description: "Create a resource.", description: "Create a resource.",
tags: [OpenAPITags.Org, OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: createResourceParamsSchema, params: createResourceParamsSchema,
body: { body: {

View File

@@ -31,7 +31,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/resource/{resourceId}/rule", path: "/resource/{resourceId}/rule",
description: "Create a resource rule.", description: "Create a resource rule.",
tags: [OpenAPITags.Resource, OpenAPITags.Rule], tags: [OpenAPITags.PublicResource, OpenAPITags.Rule],
request: { request: {
params: createResourceRuleParamsSchema, params: createResourceRuleParamsSchema,
body: { body: {

View File

@@ -22,7 +22,7 @@ registry.registerPath({
method: "delete", method: "delete",
path: "/resource/{resourceId}", path: "/resource/{resourceId}",
description: "Delete a resource.", description: "Delete a resource.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: deleteResourceSchema params: deleteResourceSchema
}, },

View File

@@ -19,7 +19,7 @@ registry.registerPath({
method: "delete", method: "delete",
path: "/resource/{resourceId}/rule/{ruleId}", path: "/resource/{resourceId}/rule/{ruleId}",
description: "Delete a resource rule.", description: "Delete a resource rule.",
tags: [OpenAPITags.Resource, OpenAPITags.Rule], tags: [OpenAPITags.PublicResource, OpenAPITags.Rule],
request: { request: {
params: deleteResourceRuleSchema params: deleteResourceRuleSchema
}, },

View File

@@ -54,7 +54,7 @@ registry.registerPath({
path: "/org/{orgId}/resource/{niceId}", path: "/org/{orgId}/resource/{niceId}",
description: description:
"Get a resource by orgId and niceId. NiceId is a readable ID for the resource and unique on a per org basis.", "Get a resource by orgId and niceId. NiceId is a readable ID for the resource and unique on a per org basis.",
tags: [OpenAPITags.Org, OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string(), orgId: z.string(),
@@ -68,7 +68,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/resource/{resourceId}", path: "/resource/{resourceId}",
description: "Get a resource by resourceId.", description: "Get a resource by resourceId.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: z.object({ params: z.object({
resourceId: z.number() resourceId: z.number()

View File

@@ -31,7 +31,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/resource/{resourceId}/whitelist", path: "/resource/{resourceId}/whitelist",
description: "Get the whitelist of emails for a specific resource.", description: "Get the whitelist of emails for a specific resource.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: getResourceWhitelistSchema params: getResourceWhitelistSchema
}, },

View File

@@ -33,7 +33,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/resources-names", path: "/org/{orgId}/resources-names",
description: "List all resource names for an organization.", description: "List all resource names for an organization.",
tags: [OpenAPITags.Org, OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string() orgId: z.string()

View File

@@ -35,7 +35,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/resource/{resourceId}/roles", path: "/resource/{resourceId}/roles",
description: "List all roles for a resource.", description: "List all roles for a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PublicResource, OpenAPITags.Role],
request: { request: {
params: listResourceRolesSchema params: listResourceRolesSchema
}, },

View File

@@ -56,7 +56,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/resource/{resourceId}/rules", path: "/resource/{resourceId}/rules",
description: "List rules for a resource.", description: "List rules for a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Rule], tags: [OpenAPITags.PublicResource, OpenAPITags.Rule],
request: { request: {
params: listResourceRulesParamsSchema, params: listResourceRulesParamsSchema,
query: listResourceRulesSchema query: listResourceRulesSchema

View File

@@ -38,7 +38,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/resource/{resourceId}/users", path: "/resource/{resourceId}/users",
description: "List all users for a resource.", description: "List all users for a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PublicResource, OpenAPITags.User],
request: { request: {
params: listResourceUsersSchema params: listResourceUsersSchema
}, },

View File

@@ -225,7 +225,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/resources", path: "/org/{orgId}/resources",
description: "List resources for an organization.", description: "List resources for an organization.",
tags: [OpenAPITags.Org, OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string() orgId: z.string()

View File

@@ -29,7 +29,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/whitelist/remove", path: "/resource/{resourceId}/whitelist/remove",
description: "Remove a single email from the resource whitelist.", description: "Remove a single email from the resource whitelist.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: removeEmailFromResourceWhitelistParamsSchema, params: removeEmailFromResourceWhitelistParamsSchema,
body: { body: {

View File

@@ -29,7 +29,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/roles/remove", path: "/resource/{resourceId}/roles/remove",
description: "Remove a single role from a resource.", description: "Remove a single role from a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PublicResource, OpenAPITags.Role],
request: { request: {
params: removeRoleFromResourceParamsSchema, params: removeRoleFromResourceParamsSchema,
body: { body: {

View File

@@ -29,7 +29,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/users/remove", path: "/resource/{resourceId}/users/remove",
description: "Remove a single user from a resource.", description: "Remove a single user from a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PublicResource, OpenAPITags.User],
request: { request: {
params: removeUserFromResourceParamsSchema, params: removeUserFromResourceParamsSchema,
body: { body: {

View File

@@ -29,7 +29,7 @@ registry.registerPath({
path: "/resource/{resourceId}/header-auth", path: "/resource/{resourceId}/header-auth",
description: description:
"Set or update the header authentication for a resource. If user and password is not provided, it will remove the header authentication.", "Set or update the header authentication for a resource. If user and password is not provided, it will remove the header authentication.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: setResourceAuthMethodsParamsSchema, params: setResourceAuthMethodsParamsSchema,
body: { body: {

View File

@@ -25,7 +25,7 @@ registry.registerPath({
path: "/resource/{resourceId}/password", path: "/resource/{resourceId}/password",
description: description:
"Set the password for a resource. Setting the password to null will remove it.", "Set the password for a resource. Setting the password to null will remove it.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: setResourceAuthMethodsParamsSchema, params: setResourceAuthMethodsParamsSchema,
body: { body: {

View File

@@ -29,7 +29,7 @@ registry.registerPath({
path: "/resource/{resourceId}/pincode", path: "/resource/{resourceId}/pincode",
description: description:
"Set the PIN code for a resource. Setting the PIN code to null will remove it.", "Set the PIN code for a resource. Setting the PIN code to null will remove it.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: setResourceAuthMethodsParamsSchema, params: setResourceAuthMethodsParamsSchema,
body: { body: {

View File

@@ -23,7 +23,7 @@ registry.registerPath({
path: "/resource/{resourceId}/roles", path: "/resource/{resourceId}/roles",
description: description:
"Set roles for a resource. This will replace all existing roles.", "Set roles for a resource. This will replace all existing roles.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PublicResource, OpenAPITags.Role],
request: { request: {
params: setResourceRolesParamsSchema, params: setResourceRolesParamsSchema,
body: { body: {

View File

@@ -23,7 +23,7 @@ registry.registerPath({
path: "/resource/{resourceId}/users", path: "/resource/{resourceId}/users",
description: description:
"Set users for a resource. This will replace all existing users.", "Set users for a resource. This will replace all existing users.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PublicResource, OpenAPITags.User],
request: { request: {
params: setUserResourcesParamsSchema, params: setUserResourcesParamsSchema,
body: { body: {

View File

@@ -32,7 +32,7 @@ registry.registerPath({
path: "/resource/{resourceId}/whitelist", path: "/resource/{resourceId}/whitelist",
description: description:
"Set email whitelist for a resource. This will replace all existing emails.", "Set email whitelist for a resource. This will replace all existing emails.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: setResourceWhitelistParamsSchema, params: setResourceWhitelistParamsSchema,
body: { body: {

View File

@@ -136,7 +136,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}", path: "/resource/{resourceId}",
description: "Update a resource.", description: "Update a resource.",
tags: [OpenAPITags.Resource], tags: [OpenAPITags.PublicResource],
request: { request: {
params: updateResourceParamsSchema, params: updateResourceParamsSchema,
body: { body: {

View File

@@ -38,7 +38,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/resource/{resourceId}/rule/{ruleId}", path: "/resource/{resourceId}/rule/{ruleId}",
description: "Update a resource rule.", description: "Update a resource rule.",
tags: [OpenAPITags.Resource, OpenAPITags.Rule], tags: [OpenAPITags.PublicResource, OpenAPITags.Rule],
request: { request: {
params: updateResourceRuleParamsSchema, params: updateResourceRuleParamsSchema,
body: { body: {

View File

@@ -45,7 +45,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/role", path: "/org/{orgId}/role",
description: "Create a role.", description: "Create a role.",
tags: [OpenAPITags.Org, OpenAPITags.Role], tags: [OpenAPITags.Role],
request: { request: {
params: createRoleParamsSchema, params: createRoleParamsSchema,
body: { body: {

View File

@@ -7,7 +7,7 @@ import { and, eq, inArray, sql } from "drizzle-orm";
import { ActionsEnum } from "@server/auth/actions"; import { ActionsEnum } from "@server/auth/actions";
import { NextFunction, Request, Response } from "express"; import { NextFunction, Request, Response } from "express";
import createHttpError from "http-errors"; import createHttpError from "http-errors";
import { z } from "zod"; import { object, z } from "zod";
import { fromError } from "zod-validation-error"; import { fromError } from "zod-validation-error";
const listRolesParamsSchema = z.strictObject({ const listRolesParamsSchema = z.strictObject({
@@ -64,7 +64,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/roles", path: "/org/{orgId}/roles",
description: "List roles.", description: "List roles.",
tags: [OpenAPITags.Org, OpenAPITags.Role], tags: [OpenAPITags.Role],
request: { request: {
params: listRolesParamsSchema, params: listRolesParamsSchema,
query: listRolesSchema query: listRolesSchema

View File

@@ -58,7 +58,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/site", path: "/org/{orgId}/site",
description: "Create a new site.", description: "Create a new site.",
tags: [OpenAPITags.Site, OpenAPITags.Org], tags: [OpenAPITags.Site],
request: { request: {
params: createSiteParamsSchema, params: createSiteParamsSchema,
body: { body: {

View File

@@ -51,7 +51,7 @@ registry.registerPath({
path: "/org/{orgId}/site/{niceId}", path: "/org/{orgId}/site/{niceId}",
description: description:
"Get a site by orgId and niceId. NiceId is a readable ID for the site and unique on a per org basis.", "Get a site by orgId and niceId. NiceId is a readable ID for the site and unique on a per org basis.",
tags: [OpenAPITags.Org, OpenAPITags.Site], tags: [OpenAPITags.Site],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string(), orgId: z.string(),

View File

@@ -180,7 +180,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/sites", path: "/org/{orgId}/sites",
description: "List all sites in an organization", description: "List all sites in an organization",
tags: [OpenAPITags.Org, OpenAPITags.Site], tags: [OpenAPITags.Site],
request: { request: {
params: listSitesParamsSchema, params: listSitesParamsSchema,
query: listSitesSchema query: listSitesSchema

View File

@@ -35,7 +35,7 @@ registry.registerPath({
path: "/org/{orgId}/pick-site-defaults", path: "/org/{orgId}/pick-site-defaults",
description: description:
"Return pre-requisite data for creating a site, such as the exit node, subnet, Newt credentials, etc.", "Return pre-requisite data for creating a site, such as the exit node, subnet, Newt credentials, etc.",
tags: [OpenAPITags.Org, OpenAPITags.Site], tags: [OpenAPITags.Site],
request: { request: {
params: z.object({ params: z.object({
orgId: z.string() orgId: z.string()

View File

@@ -30,7 +30,7 @@ registry.registerPath({
path: "/site-resource/{siteResourceId}/clients/add", path: "/site-resource/{siteResourceId}/clients/add",
description: description:
"Add a single client to a site resource. Clients with a userId cannot be added.", "Add a single client to a site resource. Clients with a userId cannot be added.",
tags: [OpenAPITags.Resource, OpenAPITags.Client], tags: [OpenAPITags.PrivateResource, OpenAPITags.Client],
request: { request: {
params: addClientToSiteResourceParamsSchema, params: addClientToSiteResourceParamsSchema,
body: { body: {

View File

@@ -30,7 +30,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/site-resource/{siteResourceId}/roles/add", path: "/site-resource/{siteResourceId}/roles/add",
description: "Add a single role to a site resource.", description: "Add a single role to a site resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PrivateResource, OpenAPITags.Role],
request: { request: {
params: addRoleToSiteResourceParamsSchema, params: addRoleToSiteResourceParamsSchema,
body: { body: {

View File

@@ -30,7 +30,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/site-resource/{siteResourceId}/users/add", path: "/site-resource/{siteResourceId}/users/add",
description: "Add a single user to a site resource.", description: "Add a single user to a site resource.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PrivateResource, OpenAPITags.User],
request: { request: {
params: addUserToSiteResourceParamsSchema, params: addUserToSiteResourceParamsSchema,
body: { body: {

View File

@@ -114,7 +114,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/site-resource", path: "/org/{orgId}/site-resource",
description: "Create a new site resource.", description: "Create a new site resource.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.PrivateResource],
request: { request: {
params: createSiteResourceParamsSchema, params: createSiteResourceParamsSchema,
body: { body: {

View File

@@ -23,7 +23,7 @@ registry.registerPath({
method: "delete", method: "delete",
path: "/site-resource/{siteResourceId}", path: "/site-resource/{siteResourceId}",
description: "Delete a site resource.", description: "Delete a site resource.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.PrivateResource],
request: { request: {
params: deleteSiteResourceParamsSchema params: deleteSiteResourceParamsSchema
}, },

View File

@@ -65,7 +65,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/site-resource/{siteResourceId}", path: "/site-resource/{siteResourceId}",
description: "Get a specific site resource by siteResourceId.", description: "Get a specific site resource by siteResourceId.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.PrivateResource],
request: { request: {
params: z.object({ params: z.object({
siteResourceId: z.number(), siteResourceId: z.number(),
@@ -80,7 +80,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/site/{siteId}/resource/nice/{niceId}", path: "/org/{orgId}/site/{siteId}/resource/nice/{niceId}",
description: "Get a specific site resource by niceId.", description: "Get a specific site resource by niceId.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.PrivateResource],
request: { request: {
params: z.object({ params: z.object({
niceId: z.string(), niceId: z.string(),

View File

@@ -112,7 +112,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/site-resources", path: "/org/{orgId}/site-resources",
description: "List all site resources for an organization.", description: "List all site resources for an organization.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.PrivateResource],
request: { request: {
params: listAllSiteResourcesByOrgParamsSchema, params: listAllSiteResourcesByOrgParamsSchema,
query: listAllSiteResourcesByOrgQuerySchema query: listAllSiteResourcesByOrgQuerySchema

View File

@@ -39,7 +39,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/site-resource/{siteResourceId}/clients", path: "/site-resource/{siteResourceId}/clients",
description: "List all clients for a site resource.", description: "List all clients for a site resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Client], tags: [OpenAPITags.PrivateResource, OpenAPITags.Client],
request: { request: {
params: listSiteResourceClientsSchema params: listSiteResourceClientsSchema
}, },

View File

@@ -40,7 +40,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/site-resource/{siteResourceId}/roles", path: "/site-resource/{siteResourceId}/roles",
description: "List all roles for a site resource.", description: "List all roles for a site resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PrivateResource, OpenAPITags.Role],
request: { request: {
params: listSiteResourceRolesSchema params: listSiteResourceRolesSchema
}, },

View File

@@ -43,7 +43,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/site-resource/{siteResourceId}/users", path: "/site-resource/{siteResourceId}/users",
description: "List all users for a site resource.", description: "List all users for a site resource.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PrivateResource, OpenAPITags.User],
request: { request: {
params: listSiteResourceUsersSchema params: listSiteResourceUsersSchema
}, },

View File

@@ -58,7 +58,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/site/{siteId}/resources", path: "/org/{orgId}/site/{siteId}/resources",
description: "List site resources for a site.", description: "List site resources for a site.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.PrivateResource],
request: { request: {
params: listSiteResourcesParamsSchema, params: listSiteResourcesParamsSchema,
query: listSiteResourcesQuerySchema query: listSiteResourcesQuerySchema

View File

@@ -30,7 +30,7 @@ registry.registerPath({
path: "/site-resource/{siteResourceId}/clients/remove", path: "/site-resource/{siteResourceId}/clients/remove",
description: description:
"Remove a single client from a site resource. Clients with a userId cannot be removed.", "Remove a single client from a site resource. Clients with a userId cannot be removed.",
tags: [OpenAPITags.Resource, OpenAPITags.Client], tags: [OpenAPITags.PrivateResource, OpenAPITags.Client],
request: { request: {
params: removeClientFromSiteResourceParamsSchema, params: removeClientFromSiteResourceParamsSchema,
body: { body: {

View File

@@ -30,7 +30,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/site-resource/{siteResourceId}/roles/remove", path: "/site-resource/{siteResourceId}/roles/remove",
description: "Remove a single role from a site resource.", description: "Remove a single role from a site resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PrivateResource, OpenAPITags.Role],
request: { request: {
params: removeRoleFromSiteResourceParamsSchema, params: removeRoleFromSiteResourceParamsSchema,
body: { body: {

View File

@@ -30,7 +30,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/site-resource/{siteResourceId}/users/remove", path: "/site-resource/{siteResourceId}/users/remove",
description: "Remove a single user from a site resource.", description: "Remove a single user from a site resource.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PrivateResource, OpenAPITags.User],
request: { request: {
params: removeUserFromSiteResourceParamsSchema, params: removeUserFromSiteResourceParamsSchema,
body: { body: {

View File

@@ -30,7 +30,7 @@ registry.registerPath({
path: "/site-resource/{siteResourceId}/clients", path: "/site-resource/{siteResourceId}/clients",
description: description:
"Set clients for a site resource. This will replace all existing clients. Clients with a userId cannot be added.", "Set clients for a site resource. This will replace all existing clients. Clients with a userId cannot be added.",
tags: [OpenAPITags.Resource, OpenAPITags.Client], tags: [OpenAPITags.PrivateResource, OpenAPITags.Client],
request: { request: {
params: setSiteResourceClientsParamsSchema, params: setSiteResourceClientsParamsSchema,
body: { body: {

View File

@@ -31,7 +31,7 @@ registry.registerPath({
path: "/site-resource/{siteResourceId}/roles", path: "/site-resource/{siteResourceId}/roles",
description: description:
"Set roles for a site resource. This will replace all existing roles.", "Set roles for a site resource. This will replace all existing roles.",
tags: [OpenAPITags.Resource, OpenAPITags.Role], tags: [OpenAPITags.PrivateResource, OpenAPITags.Role],
request: { request: {
params: setSiteResourceRolesParamsSchema, params: setSiteResourceRolesParamsSchema,
body: { body: {

View File

@@ -31,7 +31,7 @@ registry.registerPath({
path: "/site-resource/{siteResourceId}/users", path: "/site-resource/{siteResourceId}/users",
description: description:
"Set users for a site resource. This will replace all existing users.", "Set users for a site resource. This will replace all existing users.",
tags: [OpenAPITags.Resource, OpenAPITags.User], tags: [OpenAPITags.PrivateResource, OpenAPITags.User],
request: { request: {
params: setSiteResourceUsersParamsSchema, params: setSiteResourceUsersParamsSchema,
body: { body: {

View File

@@ -121,7 +121,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/site-resource/{siteResourceId}", path: "/site-resource/{siteResourceId}",
description: "Update a site resource.", description: "Update a site resource.",
tags: [OpenAPITags.Client, OpenAPITags.Org], tags: [OpenAPITags.PrivateResource],
request: { request: {
params: updateSiteResourceParamsSchema, params: updateSiteResourceParamsSchema,
body: { body: {

View File

@@ -58,7 +58,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/resource/{resourceId}/target", path: "/resource/{resourceId}/target",
description: "Create a target for a resource.", description: "Create a target for a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Target], tags: [OpenAPITags.PublicResource, OpenAPITags.Target],
request: { request: {
params: createTargetParamsSchema, params: createTargetParamsSchema,
body: { body: {

View File

@@ -88,7 +88,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/resource/{resourceId}/targets", path: "/resource/{resourceId}/targets",
description: "List targets for a resource.", description: "List targets for a resource.",
tags: [OpenAPITags.Resource, OpenAPITags.Target], tags: [OpenAPITags.PublicResource, OpenAPITags.Target],
request: { request: {
params: listTargetsParamsSchema, params: listTargetsParamsSchema,
query: listTargetsSchema query: listTargetsSchema

View File

@@ -37,7 +37,7 @@ registry.registerPath({
method: "put", method: "put",
path: "/org/{orgId}/user", path: "/org/{orgId}/user",
description: "Create an organization user.", description: "Create an organization user.",
tags: [OpenAPITags.User, OpenAPITags.Org], tags: [OpenAPITags.User],
request: { request: {
params: paramsSchema, params: paramsSchema,
body: { body: {

View File

@@ -55,7 +55,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/user/{userId}", path: "/org/{orgId}/user/{userId}",
description: "Get a user in an organization.", description: "Get a user in an organization.",
tags: [OpenAPITags.Org, OpenAPITags.User], tags: [OpenAPITags.User],
request: { request: {
params: getOrgUserParamsSchema params: getOrgUserParamsSchema
}, },

View File

@@ -35,7 +35,7 @@ registry.registerPath({
path: "/org/{orgId}/user-by-username", path: "/org/{orgId}/user-by-username",
description: description:
"Get a user in an organization by username. When idpId is not passed, only internal users are searched (username is globally unique for them). For external (OIDC) users, pass idpId to search by username within that identity provider.", "Get a user in an organization by username. When idpId is not passed, only internal users are searched (username is globally unique for them). For external (OIDC) users, pass idpId to search by username within that identity provider.",
tags: [OpenAPITags.Org, OpenAPITags.User], tags: [OpenAPITags.User],
request: { request: {
params: getOrgUserByUsernameParamsSchema, params: getOrgUserByUsernameParamsSchema,
query: getOrgUserByUsernameQuerySchema query: getOrgUserByUsernameQuerySchema

View File

@@ -44,7 +44,7 @@ registry.registerPath({
method: "post", method: "post",
path: "/org/{orgId}/create-invite", path: "/org/{orgId}/create-invite",
description: "Invite a user to join an organization.", description: "Invite a user to join an organization.",
tags: [OpenAPITags.Org], tags: [OpenAPITags.Invitation],
request: { request: {
params: inviteUserParamsSchema, params: inviteUserParamsSchema,
body: { body: {

View File

@@ -54,7 +54,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/invitations", path: "/org/{orgId}/invitations",
description: "List invitations in an organization.", description: "List invitations in an organization.",
tags: [OpenAPITags.Org, OpenAPITags.Invitation], tags: [OpenAPITags.Invitation],
request: { request: {
params: listInvitationsParamsSchema, params: listInvitationsParamsSchema,
query: listInvitationsQuerySchema query: listInvitationsQuerySchema

View File

@@ -69,7 +69,7 @@ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}/users", path: "/org/{orgId}/users",
description: "List users in an organization.", description: "List users in an organization.",
tags: [OpenAPITags.Org, OpenAPITags.User], tags: [OpenAPITags.User],
request: { request: {
params: listUsersParamsSchema, params: listUsersParamsSchema,
query: listUsersSchema query: listUsersSchema

Some files were not shown because too many files have changed in this diff Show More