All files / src/sdk/types integration.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 0/0
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 4813x   13x                       13x                                           13x       13x              
import { z } from "zod";
 
export const ZAuthMode = z.enum([
  "OAUTH2",
  "OAUTH1",
  "OAUTH1A",
  "API_KEY",
  "BASIC",
  "BEARER_TOKEN",
  "GOOGLE_SERVICE_ACCOUNT",
  "NO_AUTH",
  "BASIC_WITH_JWT",
]);
 
export const ZCreateIntegrationParams = z.object({
  name: z.string(),
  authScheme: ZAuthMode.optional(),
  appUniqueKey: z.string().optional(),
  appId: z.string().optional(),
  forceNewIntegration: z.boolean().optional(),
  authConfig: z
    .union([
      z.record(z.unknown()),
      z.object({
        client_id: z.string(),
        client_secret: z.string(),
        api_key: z.string(),
        consumer_key: z.string(),
        consumer_secret: z.string(),
        base_url: z.string(),
      }),
    ])
    .optional(),
  useComposioAuth: z.boolean().optional(),
});
 
export const ZSingleIntegrationParams = z.object({
  integrationId: z.string(),
});
 
export const ZListIntegrationsParams = z.object({
  page: z.number().optional(),
  pageSize: z.number().optional(),
  appName: z.string().optional(),
  appUniqueKey: z.string().optional(),
  showDisabled: z.boolean().optional(),
});