/* * 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("Collections Issue Tracking Collections All", async () => { const testHttpClient = createTestHTTPClient("issueTracking.collectionsAll"); 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.issueTracking.collections.list({ consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", sort: { by: "name", direction: "desc", }, passThrough: { "search": "San Francisco", }, fields: "id,updated_at", }); expect(result.httpMeta.response.status).toBe(200); expect(result.getCollectionsResponse).toBeDefined(); expect(result.getCollectionsResponse).toEqual({ statusCode: 200, status: "OK", service: "jira", resource: "Tickets", operation: "all", data: [ { id: "12345", parentId: "12345", type: "Technical", name: "Main IT Issues", description: "IT Issues", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), }, { id: "12345", parentId: "12345", type: "Technical", name: "Main IT Issues", description: "IT Issues", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), }, { id: "12345", parentId: "12345", type: "Technical", name: "Main IT Issues", description: "IT Issues", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), }, ], meta: { itemsOnPage: 50, cursors: { previous: "em9oby1jcm06OnBhZ2U6OjE=", current: "em9oby1jcm06OnBhZ2U6OjI=", next: "em9oby1jcm06OnBhZ2U6OjM=", }, }, links: { previous: "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", current: "https://unify.apideck.com/crm/companies", next: "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM", }, }); }); test("Collections Issue Tracking Collections One", async () => { const testHttpClient = createTestHTTPClient("issueTracking.collectionsOne"); 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.issueTracking.collections.get({ collectionId: "apideck-io", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", serviceId: "salesforce", fields: "id,updated_at", }); expect(result.httpMeta.response.status).toBe(200); expect(result.getCollectionResponse).toBeDefined(); expect(result.getCollectionResponse).toEqual({ statusCode: 200, status: "OK", service: "jira", resource: "Tickets", operation: "one", data: { id: "12345", parentId: "12345", type: "Technical", name: "Main IT Issues", description: "IT Issues", updatedAt: new Date("2020-09-30T07:43:32.000Z"), createdAt: new Date("2020-09-30T07:43:32.000Z"), }, }); });