/*
 * 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: true,
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        attackModeEnabled: true,
        attackModeUpdatedAt: 6133.77,
    });
});
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: 892.22,
            updatedAt: "1745792555559",
            firewallEnabled: true,
            crs: {
                sd: {
                    active: false,
                    action: "log",
                },
                ma: {
                    active: false,
                    action: "log",
                },
                lfi: {
                    active: false,
                    action: "deny",
                },
                rfi: {
                    active: false,
                    action: "deny",
                },
                rce: {
                    active: true,
                    action: "deny",
                },
                php: {
                    active: false,
                    action: "deny",
                },
                gen: {
                    active: false,
                    action: "deny",
                },
                xss: {
                    active: true,
                    action: "log",
                },
                sqli: {
                    active: true,
                    action: "deny",
                },
                sf: {
                    active: true,
                    action: "log",
                },
                java: {
                    active: false,
                    action: "deny",
                },
            },
            rules: [
                {
                    id: "<id>",
                    name: "<value>",
                    active: false,
                    conditionGroup: [
                        {
                            conditions: [
                                {
                                    type: "geo_city",
                                    op: "pre",
                                },
                            ],
                        },
                    ],
                    action: {},
                },
                {
                    id: "<id>",
                    name: "<value>",
                    active: false,
                    conditionGroup: [],
                    action: {},
                },
                {
                    id: "<id>",
                    name: "<value>",
                    active: false,
                    conditionGroup: [
                        {
                            conditions: [
                                {
                                    type: "ip_address",
                                    op: "sub",
                                },
                                {
                                    type: "ja3_digest",
                                    op: "suf",
                                },
                                {
                                    type: "protocol",
                                    op: "sub",
                                },
                            ],
                        },
                        {
                            conditions: [
                                {
                                    type: "geo_as_number",
                                    op: "re",
                                },
                                {
                                    type: "geo_continent",
                                    op: "nex",
                                },
                                {
                                    type: "region",
                                    op: "gt",
                                },
                            ],
                        },
                        {
                            conditions: [
                                {
                                    type: "method",
                                    op: "gte",
                                },
                                {
                                    type: "header",
                                    op: "inc",
                                },
                                {
                                    type: "query",
                                    op: "eq",
                                },
                            ],
                        },
                    ],
                    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: "managedRules.update",
            id: "<id>",
            value: {
                active: true,
            },
        },
    });
    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: 228.9,
        updatedAt: "1744362822275",
        firewallEnabled: false,
        crs: {
            sd: {
                active: true,
                action: "deny",
            },
            ma: {
                active: false,
                action: "log",
            },
            lfi: {
                active: false,
                action: "log",
            },
            rfi: {
                active: true,
                action: "deny",
            },
            rce: {
                active: true,
                action: "log",
            },
            php: {
                active: false,
                action: "log",
            },
            gen: {
                active: false,
                action: "deny",
            },
            xss: {
                active: true,
                action: "deny",
            },
            sqli: {
                active: true,
                action: "deny",
            },
            sf: {
                active: true,
                action: "deny",
            },
            java: {
                active: true,
                action: "deny",
            },
        },
        rules: [
            {
                id: "<id>",
                name: "<value>",
                active: false,
                conditionGroup: [
                    {
                        conditions: [
                            {
                                type: "path",
                                op: "neq",
                            },
                        ],
                    },
                ],
                action: {},
            },
        ],
        ips: [
            {
                id: "<id>",
                hostname: "crowded-suspension.net",
                ip: "194.99.165.97",
                action: "bypass",
            },
            {
                id: "<id>",
                hostname: "burly-academics.name",
                ip: "42.161.47.142",
                action: "bypass",
            },
            {
                id: "<id>",
                hostname: "damaged-bracelet.info",
                ip: "8ad7:ffff:b919:0fee:fa4e:54ce:6be3:2203",
                action: "log",
            },
        ],
        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: "sneaky-intervention.info",
                ip: "124.153.161.35",
                createdAt: "1730712703128",
                updatedAt: "1744368534759",
                updatedAtHour: "<value>",
            },
        ],
        pagination: "<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();
    expect(result).toEqual({
        ok: false,
        result: [
            {
                ownerId: "<id>",
                id: "<id>",
                domain: "jubilant-outrun.name",
                projectId: "<id>",
                note: "<value>",
                isProjectRule: true,
            },
        ],
        pagination: "<value>",
    });
});
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: true,
    });
});
//# sourceMappingURL=security.test.js.map