/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { expect, test } from "vitest"; import { Apideck } from "../index.js"; import { createTestHTTPClient } from "./testclient.js"; test("Connectionconsent Vault Connection Consent Update", async () => { const testHttpClient = createTestHTTPClient("vault.connectionConsentUpdate"); const apideck = new Apideck({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiKey: process.env["APIDECK_API_KEY"] ?? "value", }); const result = await apideck.vault.connectionConsent.update({ consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "pipedrive", unifiedApi: "crm", updateConsentRequest: { resources: "*", granted: true, }, }); expect(result.httpMeta.response.status).toBe(200); expect(result.updateConsentResponse).toBeDefined(); expect(result.updateConsentResponse).toEqual({ statusCode: 200, status: "OK", data: { id: "con_1234567890", createdAt: "2025-04-15T14:30:00Z", granted: true, resources: { "hris.employees": { "id": { read: true, write: false, }, "first_name": { read: true, write: true, }, "last_name": { read: true, write: true, }, "email": { read: true, write: true, }, "addresses[].street": { read: true, write: false, }, "addresses[].city": { read: true, write: false, }, "employment.job_title": { read: true, write: true, }, "custom_fields[].employee_number": { read: true, write: false, }, }, "hris.departments": { "id": { read: true, write: false, }, "name": { read: true, write: true, }, "code": { read: true, write: false, }, }, }, }, }); });