fix: use ai approval config endpoint
This commit is contained in:
1 parent
c6bae13dff
commit
87725a4ca0
6 files changed
+37
-9
No files matched your search
@@ -27,7 +27,7 @@ For an already-authenticated Seal source, copy `enterprises/example.direct.json`
|
||||
"seal": {
|
||||
"url": "https://corp-id.sealai.cc",
|
||||
"endpoints": {
|
||||
"approvalStylePreferences": "api/v1/approval/style-preferences"
|
||||
"approvalStylePreferences": "api/v1/agent/ai-approval/config"
|
||||
}
|
||||
},
|
||||
"source": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"seal": {
|
||||
"url": "https://corp-id.sealai.cc",
|
||||
"endpoints": {
|
||||
"approvalStylePreferences": "api/v1/approval/style-preferences"
|
||||
"approvalStylePreferences": "api/v1/agent/ai-approval/config"
|
||||
}
|
||||
},
|
||||
"source": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"seal": {
|
||||
"url": "https://corp-id.sealai.cc",
|
||||
"endpoints": {
|
||||
"approvalStylePreferences": "api/v1/approval/style-preferences"
|
||||
"approvalStylePreferences": "api/v1/agent/ai-approval/config"
|
||||
}
|
||||
},
|
||||
"source": {
|
||||
|
||||
@@ -46,13 +46,13 @@ export const SealEndpointSchema = z.object({
|
||||
url: z.string().url().optional(),
|
||||
tenantSlug: z.string().optional(),
|
||||
endpoints: z.object({
|
||||
approvalStylePreferences: z.string().default("api/v1/approval/style-preferences")
|
||||
approvalStylePreferences: z.string().default("api/v1/agent/ai-approval/config")
|
||||
}).default({
|
||||
approvalStylePreferences: "api/v1/approval/style-preferences"
|
||||
approvalStylePreferences: "api/v1/agent/ai-approval/config"
|
||||
})
|
||||
}).default({
|
||||
endpoints: {
|
||||
approvalStylePreferences: "api/v1/approval/style-preferences"
|
||||
approvalStylePreferences: "api/v1/agent/ai-approval/config"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ export async function updateApprovalDocument(
|
||||
|
||||
export async function getApprovalStylePreferences(
|
||||
client: KyInstance,
|
||||
endpoint = "api/v1/approval/style-preferences"
|
||||
endpoint = "api/v1/agent/ai-approval/config"
|
||||
): Promise<ApprovalStylePreferences> {
|
||||
return unwrap(
|
||||
await client.get(endpoint),
|
||||
@@ -161,7 +161,7 @@ export async function getApprovalStylePreferences(
|
||||
export async function updateApprovalStylePreferences(
|
||||
client: KyInstance,
|
||||
params: Record<string, unknown>,
|
||||
endpoint = "api/v1/approval/style-preferences"
|
||||
endpoint = "api/v1/agent/ai-approval/config"
|
||||
): Promise<ApprovalStylePreferences> {
|
||||
return unwrap(
|
||||
await client.patch(endpoint, { json: params }),
|
||||
|
||||
@@ -103,6 +103,29 @@ export const ApprovalDocumentListDataSchema = z.object({
|
||||
total: z.number().optional()
|
||||
});
|
||||
|
||||
export const DecisionPreferencesSchema = z.object({
|
||||
explicitApprove: z.string().default(""),
|
||||
explicitReject: z.string().default(""),
|
||||
exemptApprove: z.string().default(""),
|
||||
review: z.string().default("")
|
||||
}).passthrough();
|
||||
|
||||
export const ApprovalIntegrationSchema = z.object({
|
||||
type: z.string(),
|
||||
signKey: z.string().optional(),
|
||||
outboundName: z.string().optional(),
|
||||
mode: z.string().optional(),
|
||||
autoApprovalRate: z.number().optional(),
|
||||
apiKey: z.string().optional(),
|
||||
apiSecret: z.string().optional(),
|
||||
apiOrigin: z.string().optional(),
|
||||
corporationId: z.string().optional(),
|
||||
ebotSignKey: z.string().optional(),
|
||||
completionSignKey: z.string().optional(),
|
||||
outboundMessageId: z.string().optional(),
|
||||
completionMessageId: z.string().optional()
|
||||
}).passthrough();
|
||||
|
||||
export const ApprovalStylePreferencesSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
tenantId: z.string().optional(),
|
||||
@@ -113,7 +136,10 @@ export const ApprovalStylePreferencesSchema = z.object({
|
||||
examples: z.array(z.string()).default([]),
|
||||
prohibitedPhrases: z.array(z.string()).default([]),
|
||||
customInstructions: z.string().optional(),
|
||||
updatedAt: z.number().optional()
|
||||
updatedAt: z.number().optional(),
|
||||
decisionPreferences: DecisionPreferencesSchema.optional(),
|
||||
integrationSystem: z.string().optional(),
|
||||
integrations: z.array(ApprovalIntegrationSchema).default([])
|
||||
}).passthrough();
|
||||
|
||||
export type MeData = z.infer<typeof MeDataSchema>;
|
||||
@@ -122,4 +148,6 @@ export type ApprovalRulesData = z.infer<typeof ApprovalRulesDataSchema>;
|
||||
export type RuleSetVersion = z.infer<typeof RuleSetVersionSchema>;
|
||||
export type ApprovalDocument = z.infer<typeof ApprovalDocumentSchema>;
|
||||
export type ApprovalDocumentListData = z.infer<typeof ApprovalDocumentListDataSchema>;
|
||||
export type DecisionPreferences = z.infer<typeof DecisionPreferencesSchema>;
|
||||
export type ApprovalIntegration = z.infer<typeof ApprovalIntegrationSchema>;
|
||||
export type ApprovalStylePreferences = z.infer<typeof ApprovalStylePreferencesSchema>;
|
||||
Reference in new issue
Block a user