mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-07 04:58:44 +02:00
Recategorize
This commit is contained in:
@@ -6,7 +6,9 @@ export enum OpenAPITags {
|
|||||||
Site = "Site",
|
Site = "Site",
|
||||||
Org = "Organization",
|
Org = "Organization",
|
||||||
PublicResource = "Public Resource",
|
PublicResource = "Public Resource",
|
||||||
|
PublicResourceLegacy = "Public Resource (Legacy)",
|
||||||
PrivateResource = "Private Resource",
|
PrivateResource = "Private Resource",
|
||||||
|
PrivateResourceLegacy = "Private Resource (Legacy)",
|
||||||
Policy = "Policy",
|
Policy = "Policy",
|
||||||
Role = "Role",
|
Role = "Role",
|
||||||
User = "User",
|
User = "User",
|
||||||
|
|||||||
@@ -34,7 +34,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: addEmailToResourceWhitelistParamsSchema,
|
params: addEmailToResourceWhitelistParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
@@ -177,10 +177,7 @@ export async function addEmailToResourceWhitelist(
|
|||||||
.from(resourcePolicyWhiteList)
|
.from(resourcePolicyWhiteList)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
eq(
|
eq(resourcePolicyWhiteList.resourcePolicyId, policyId),
|
||||||
resourcePolicyWhiteList.resourcePolicyId,
|
|
||||||
policyId
|
|
||||||
),
|
|
||||||
eq(resourcePolicyWhiteList.email, email)
|
eq(resourcePolicyWhiteList.email, email)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -153,7 +153,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: createResourceParamsSchema,
|
params: createResourceParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: deleteResourceSchema
|
params: deleteResourceSchema
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -63,7 +63,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: z.object({
|
params: z.object({
|
||||||
orgId: z.string(),
|
orgId: z.string(),
|
||||||
@@ -92,7 +92,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: z.object({
|
params: z.object({
|
||||||
resourceId: z.number()
|
resourceId: z.number()
|
||||||
|
|||||||
@@ -44,7 +44,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: getResourceWhitelistSchema
|
params: getResourceWhitelistSchema
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: z.object({
|
params: z.object({
|
||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
|
|||||||
@@ -409,7 +409,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: z.object({
|
params: z.object({
|
||||||
orgId: z.string()
|
orgId: z.string()
|
||||||
|
|||||||
@@ -34,7 +34,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: removeEmailFromResourceWhitelistParamsSchema,
|
params: removeEmailFromResourceWhitelistParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
@@ -176,10 +176,7 @@ export async function removeEmailFromResourceWhitelist(
|
|||||||
.from(resourcePolicyWhiteList)
|
.from(resourcePolicyWhiteList)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
eq(
|
eq(resourcePolicyWhiteList.resourcePolicyId, policyId),
|
||||||
resourcePolicyWhiteList.resourcePolicyId,
|
|
||||||
policyId
|
|
||||||
),
|
|
||||||
eq(resourcePolicyWhiteList.email, email)
|
eq(resourcePolicyWhiteList.email, email)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -197,10 +194,7 @@ export async function removeEmailFromResourceWhitelist(
|
|||||||
.delete(resourcePolicyWhiteList)
|
.delete(resourcePolicyWhiteList)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
eq(
|
eq(resourcePolicyWhiteList.resourcePolicyId, policyId),
|
||||||
resourcePolicyWhiteList.resourcePolicyId,
|
|
||||||
policyId
|
|
||||||
),
|
|
||||||
eq(resourcePolicyWhiteList.email, email)
|
eq(resourcePolicyWhiteList.email, email)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -31,7 +31,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: setResourceAuthMethodsParamsSchema,
|
params: setResourceAuthMethodsParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -29,7 +29,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: setResourceAuthMethodsParamsSchema,
|
params: setResourceAuthMethodsParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: setResourceAuthMethodsParamsSchema,
|
params: setResourceAuthMethodsParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -37,7 +37,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.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: setResourceWhitelistParamsSchema,
|
params: setResourceWhitelistParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ registry.registerPath({
|
|||||||
path: "/resource/{resourceId}",
|
path: "/resource/{resourceId}",
|
||||||
description:
|
description:
|
||||||
"Update a resource. Policy fields (sso, mfa, pincode, password, whitelist) update the inline policy when no shared resource policy is assigned; when a shared policy is assigned those fields override the shared policy for this resource only.",
|
"Update a resource. Policy fields (sso, mfa, pincode, password, whitelist) update the inline policy when no shared resource policy is assigned; when a shared policy is assigned those fields override the shared policy for this resource only.",
|
||||||
tags: [OpenAPITags.PublicResource],
|
tags: [OpenAPITags.PublicResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: updateResourceParamsSchema,
|
params: updateResourceParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -207,7 +207,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.PrivateResource],
|
tags: [OpenAPITags.PrivateResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: createSiteResourceParamsSchema,
|
params: createSiteResourceParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@@ -27,7 +27,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.PrivateResource],
|
tags: [OpenAPITags.PrivateResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: deleteSiteResourceParamsSchema
|
params: deleteSiteResourceParamsSchema
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -57,7 +57,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.PrivateResource],
|
tags: [OpenAPITags.PrivateResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: z.object({
|
params: z.object({
|
||||||
siteResourceId: z.number(),
|
siteResourceId: z.number(),
|
||||||
|
|||||||
@@ -230,7 +230,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.PrivateResource],
|
tags: [OpenAPITags.PrivateResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: listAllSiteResourcesByOrgParamsSchema,
|
params: listAllSiteResourcesByOrgParamsSchema,
|
||||||
query: listAllSiteResourcesByOrgQuerySchema
|
query: listAllSiteResourcesByOrgQuerySchema
|
||||||
|
|||||||
@@ -67,7 +67,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.PrivateResource],
|
tags: [OpenAPITags.PrivateResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: listSiteResourcesParamsSchema,
|
params: listSiteResourcesParamsSchema,
|
||||||
query: listSiteResourcesQuerySchema
|
query: listSiteResourcesQuerySchema
|
||||||
|
|||||||
@@ -213,7 +213,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.PrivateResource],
|
tags: [OpenAPITags.PrivateResourceLegacy],
|
||||||
request: {
|
request: {
|
||||||
params: updateSiteResourceParamsSchema,
|
params: updateSiteResourceParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
Reference in New Issue
Block a user