/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { expect, test } from "vitest";
import { Vercel } from "../index.js";
import { createTestHTTPClient } from "./testclient.js";
test("Security Update Attack Challenge Mode", async () => {
    const testHttpClient = createTestHTTPClient("updateAttackChallengeMode");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.security.updateAttackChallengeMode({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            projectId: "<id>",
            attackModeEnabled: false,
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        attackModeEnabled: false,
        attackModeUpdatedAt: 7411.4,
    });
});
test("Security Put Firewall Config", async () => {
    const testHttpClient = createTestHTTPClient("putFirewallConfig");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.security.putFirewallConfig({
        projectId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            firewallEnabled: true,
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        active: {
            ownerId: "<id>",
            projectKey: "<value>",
            id: "<id>",
            version: 9165.84,
            updatedAt: "1735603203410",
            firewallEnabled: false,
            crs: {
                sd: {
                    active: false,
                    action: "deny",
                },
                ma: {
                    active: false,
                    action: "deny",
                },
                lfi: {
                    active: true,
                    action: "log",
                },
                rfi: {
                    active: true,
                    action: "deny",
                },
                rce: {
                    active: false,
                    action: "log",
                },
                php: {
                    active: true,
                    action: "log",
                },
                gen: {
                    active: true,
                    action: "deny",
                },
                xss: {
                    active: true,
                    action: "log",
                },
                sqli: {
                    active: false,
                    action: "deny",
                },
                sf: {
                    active: false,
                    action: "deny",
                },
                java: {
                    active: true,
                    action: "log",
                },
            },
            rules: [
                {
                    id: "<id>",
                    name: "<value>",
                    active: true,
                    conditionGroup: [
                        {
                            conditions: [
                                {
                                    type: "target_path",
                                    op: "pre",
                                },
                            ],
                        },
                        {
                            conditions: [
                                {
                                    type: "target_path",
                                    op: "pre",
                                },
                            ],
                        },
                    ],
                    action: {},
                },
                {
                    id: "<id>",
                    name: "<value>",
                    active: true,
                    conditionGroup: [
                        {
                            conditions: [
                                {
                                    type: "target_path",
                                    op: "pre",
                                },
                            ],
                        },
                        {
                            conditions: [
                                {
                                    type: "target_path",
                                    op: "pre",
                                },
                            ],
                        },
                    ],
                    action: {},
                },
            ],
            ips: [],
            changes: [
                {},
            ],
        },
    });
});
test("Security Update Firewall Config", async () => {
    const testHttpClient = createTestHTTPClient("updateFirewallConfig");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.security.updateFirewallConfig({
        projectId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            action: "ip.remove",
            id: "<id>",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({});
});
test("Security Get Firewall Config", async () => {
    const testHttpClient = createTestHTTPClient("getFirewallConfig");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.security.getFirewallConfig({
        projectId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        configVersion: "<value>",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        ownerId: "<id>",
        projectKey: "<value>",
        id: "<id>",
        version: 6575.82,
        updatedAt: "1735634663735",
        firewallEnabled: false,
        crs: {
            sd: {
                active: true,
                action: "log",
            },
            ma: {
                active: false,
                action: "deny",
            },
            lfi: {
                active: false,
                action: "deny",
            },
            rfi: {
                active: true,
                action: "deny",
            },
            rce: {
                active: true,
                action: "log",
            },
            php: {
                active: true,
                action: "deny",
            },
            gen: {
                active: true,
                action: "deny",
            },
            xss: {
                active: false,
                action: "log",
            },
            sqli: {
                active: true,
                action: "deny",
            },
            sf: {
                active: true,
                action: "log",
            },
            java: {
                active: true,
                action: "deny",
            },
        },
        rules: [
            {
                id: "<id>",
                name: "<value>",
                active: false,
                conditionGroup: [
                    {
                        conditions: [
                            {
                                type: "header",
                                op: "ex",
                            },
                            {
                                type: "header",
                                op: "ex",
                            },
                        ],
                    },
                ],
                action: {},
            },
        ],
        ips: [
            {
                id: "<id>",
                hostname: "graceful-elevator.com",
                ip: "dc71:cdcf:e1e6:bce1:4c8c:7202:5f76:e329",
                action: "bypass",
            },
            {
                id: "<id>",
                hostname: "graceful-elevator.com",
                ip: "dc71:cdcf:e1e6:bce1:4c8c:7202:5f76:e329",
                action: "bypass",
            },
            {
                id: "<id>",
                hostname: "graceful-elevator.com",
                ip: "dc71:cdcf:e1e6:bce1:4c8c:7202:5f76:e329",
                action: "bypass",
            },
        ],
        changes: [
            {},
            {},
            {},
        ],
    });
});
test("Security Get Bypass Ip", async () => {
    const testHttpClient = createTestHTTPClient("getBypassIp");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.security.getBypassIp({
        projectId: "<id>",
        limit: 10,
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        result: [
            {
                ownerId: "<id>",
                id: "<id>",
                domain: "second-newsletter.name",
                ip: "165.112.228.246",
                createdAt: "1716245811354",
                updatedAt: "1735671604252",
                updatedAtHour: "<value>",
            },
        ],
    });
});
test("Security Add Bypass Ip", async () => {
    const testHttpClient = createTestHTTPClient("addBypassIp");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.security.addBypassIp({
        projectId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
});
test("Security Remove Bypass Ip", async () => {
    const testHttpClient = createTestHTTPClient("removeBypassIp");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.security.removeBypassIp({
        projectId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        ok: false,
    });
});
//# sourceMappingURL=security.test.js.map