feat(api, web): implement short install link functionality for agents
- Added new API endpoints for creating, retrieving, and revoking install links for agents. - Enhanced the agent installation process with short links accessible via `/agent-install/:id` and `/:slug`. - Updated the README and documentation to reflect the new installation method and usage instructions. - Refactored relevant components in the web application to support the new install link feature. - Improved error handling and validation for install link operations. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -182,6 +182,34 @@ export const dashboardStatsSchema = z.object({
|
||||
lists_total: z.number().int(),
|
||||
})
|
||||
|
||||
export const createInstallLinkBodySchema = z.object({
|
||||
name: z.string().min(1),
|
||||
platform: agentPlatformSchema.optional().default('linux'),
|
||||
})
|
||||
|
||||
export const installLinkSchema = z.object({
|
||||
id: z.string(),
|
||||
slug: z.string(),
|
||||
client_name: z.string(),
|
||||
platform: agentPlatformSchema,
|
||||
created_at: z.string(),
|
||||
revoked_at: z.string().nullable().optional(),
|
||||
last_used_at: z.string().nullable().optional(),
|
||||
use_count: z.number().int(),
|
||||
urls: z
|
||||
.object({
|
||||
by_id: z.string(),
|
||||
by_slug: z.string(),
|
||||
})
|
||||
.optional(),
|
||||
curl: z
|
||||
.object({
|
||||
by_id: z.string(),
|
||||
by_slug: z.string(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
||||
export type Agent = z.infer<typeof agentSchema>
|
||||
export type IpList = z.infer<typeof ipListSchema>
|
||||
export type PolicyRule = z.infer<typeof policyRuleSchema>
|
||||
@@ -189,3 +217,4 @@ export type PolicySet = z.infer<typeof policySetSchema>
|
||||
export type IpOverride = z.infer<typeof ipOverrideSchema>
|
||||
export type AgentPolicy = z.infer<typeof agentPolicySchema>
|
||||
export type DashboardStats = z.infer<typeof dashboardStatsSchema>
|
||||
export type InstallLink = z.infer<typeof installLinkSchema>
|
||||
|
||||
Reference in New Issue
Block a user