/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 55eff26eac34 */ import { assert, expect, it, test } from "vitest"; import { Glean } from "../index.js"; import { RFCDate } from "../types/index.js"; import { createTestHTTPClient } from "./testclient.js"; test("Collections Addcollectionitems", async () => { const testHttpClient = createTestHTTPClient("addcollectionitems"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); const result = await glean.client.collections.addItems({ collectionId: 6460.15, }); expect(result).toBeDefined(); }); test("Collections Createcollection", async () => { const testHttpClient = createTestHTTPClient("createcollection"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); const result = await glean.client.collections.create({ name: "", addedRoles: [ { person: { name: "George Clooney", obfuscatedId: "abc123", relatedDocuments: [ { querySuggestion: { query: "app:github type:pull author:mortimer", searchProviderInfo: { name: "Google", searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en", }, label: "Mortimer's PRs", datasource: "github", requestOptions: { datasourceFilter: "JIRA", datasourcesFilter: [ "JIRA", ], queryOverridesFacetFilters: true, facetFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], facetFilterSets: [ { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, ], facetBucketSize: 134365, authTokens: [ { accessToken: "123abc", datasource: "gmail", scope: "email profile https://www.googleapis.com/auth/gmail.readonly", tokenType: "Bearer", authUser: "1", }, ], }, ranges: [ { startIndex: 796474, document: { metadata: { datasource: "datasource", objectType: "Feature Request", container: "container", parentId: "JIRA_EN-1337", mimeType: "mimeType", documentId: "documentId", createTime: new Date("2000-01-23T04:56:07.000Z"), updateTime: new Date("2000-01-23T04:56:07.000Z"), components: [ "Backend", "Networking", ], status: "[\"Done\"]", pins: [ { audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], documentId: "", }, { audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], documentId: "", }, { audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], documentId: "", }, ], collections: [ { name: "", description: "fumigate convection though zowie", audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], id: 496323, items: [ { collectionId: 782367, itemType: "DOCUMENT", }, ], }, ], interactions: { reacts: [ {}, {}, {}, ], shares: [ { numDaysAgo: 219974, }, { numDaysAgo: 449221, }, { numDaysAgo: 427887, }, ], }, verification: { state: "VERIFIED", metadata: { reminders: [ { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 491427, }, ], lastReminder: { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 490420, }, }, }, customData: { "someCustomField": {}, }, }, }, }, ], inputDetails: { hasCopyPaste: true, }, }, results: [ { title: "title", url: "https://example.com/foo/bar", nativeAppUrl: "slack://foo/bar", snippets: [ { mimeType: "mimeType", snippet: "snippet", }, ], }, ], }, { querySuggestion: { query: "app:github type:pull author:mortimer", searchProviderInfo: { name: "Google", searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en", }, label: "Mortimer's PRs", datasource: "github", requestOptions: { datasourceFilter: "JIRA", datasourcesFilter: [ "JIRA", ], queryOverridesFacetFilters: true, facetFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], facetFilterSets: [ { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, ], facetBucketSize: 45416, authTokens: [ { accessToken: "123abc", datasource: "gmail", scope: "email profile https://www.googleapis.com/auth/gmail.readonly", tokenType: "Bearer", authUser: "1", }, ], }, inputDetails: { hasCopyPaste: true, }, }, }, ], metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, ], querySuggestions: { suggestions: [ { query: "app:github type:pull author:mortimer", label: "Mortimer's PRs", datasource: "github", }, ], }, inviteInfo: { invites: [ {}, ], }, customFields: [ { label: "", values: [ {}, {}, ], }, { label: "", values: [], }, ], badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "OWNER", }, { person: { name: "George Clooney", obfuscatedId: "abc123", metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, ], querySuggestions: {}, inviteInfo: {}, badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "VERIFIER", }, ], removedRoles: [ { person: { name: "George Clooney", obfuscatedId: "abc123", metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, ], querySuggestions: {}, inviteInfo: {}, badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "VERIFIER", }, { person: { name: "George Clooney", obfuscatedId: "abc123", metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, { datasource: "github", handle: "", }, { datasource: "github", handle: "", }, ], querySuggestions: {}, inviteInfo: {}, badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "ANSWER_MODERATOR", }, { person: { name: "George Clooney", obfuscatedId: "abc123", metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, ], querySuggestions: {}, inviteInfo: {}, badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "OWNER", }, ], audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }); expect(result).toBeDefined(); }); test("Collections Deletecollection", async () => { const testHttpClient = createTestHTTPClient("deletecollection"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); await glean.client.collections.delete({ ids: [ 698486, 386564, ], }); }); test("Collections Deletecollectionitem", async () => { const testHttpClient = createTestHTTPClient("deletecollectionitem"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); const result = await glean.client.collections.deleteItem({ collectionId: 1357.59, itemId: "", }); expect(result).toBeDefined(); }); test("Collections Editcollection", async () => { const testHttpClient = createTestHTTPClient("editcollection"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); const result = await glean.client.collections.update({ name: "", addedRoles: [ { person: { name: "George Clooney", obfuscatedId: "abc123", relatedDocuments: [ { querySuggestion: { query: "app:github type:pull author:mortimer", searchProviderInfo: { name: "Google", searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en", }, label: "Mortimer's PRs", datasource: "github", requestOptions: { datasourceFilter: "JIRA", datasourcesFilter: [ "JIRA", ], queryOverridesFacetFilters: true, facetFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], facetFilterSets: [ { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, ], facetBucketSize: 991464, authTokens: [ { accessToken: "123abc", datasource: "gmail", scope: "email profile https://www.googleapis.com/auth/gmail.readonly", tokenType: "Bearer", authUser: "1", }, ], }, ranges: [ { startIndex: 488852, document: { metadata: { datasource: "datasource", objectType: "Feature Request", container: "container", parentId: "JIRA_EN-1337", mimeType: "mimeType", documentId: "documentId", createTime: new Date("2000-01-23T04:56:07.000Z"), updateTime: new Date("2000-01-23T04:56:07.000Z"), components: [ "Backend", "Networking", ], status: "[\"Done\"]", pins: [ { audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], documentId: "", }, { audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], documentId: "", }, { audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], documentId: "", }, ], collections: [ { name: "", description: "eulogise whereas till mild than during meanwhile disapprove finer ha", audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], id: 2984, items: [ { collectionId: 477967, itemType: "URL", }, { collectionId: 813577, itemType: "TEXT", }, ], }, ], interactions: { reacts: [ {}, ], shares: [ { numDaysAgo: 301848, }, { numDaysAgo: 657278, }, ], }, verification: { state: "UNVERIFIED", metadata: { reminders: [ { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 335191, }, ], lastReminder: { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 532806, }, }, }, customData: { "someCustomField": {}, }, }, }, }, { startIndex: 556706, document: { metadata: { datasource: "datasource", objectType: "Feature Request", container: "container", parentId: "JIRA_EN-1337", mimeType: "mimeType", documentId: "documentId", createTime: new Date("2000-01-23T04:56:07.000Z"), updateTime: new Date("2000-01-23T04:56:07.000Z"), components: [ "Backend", "Networking", ], status: "[\"Done\"]", interactions: {}, verification: { state: "VERIFIED", metadata: { lastReminder: { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 416023, }, }, }, customData: { "someCustomField": {}, }, }, }, }, ], inputDetails: { hasCopyPaste: true, }, }, results: [ { title: "title", url: "https://example.com/foo/bar", nativeAppUrl: "slack://foo/bar", snippets: [ { mimeType: "mimeType", snippet: "snippet", }, ], }, ], }, { querySuggestion: { query: "app:github type:pull author:mortimer", searchProviderInfo: { name: "Google", searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en", }, label: "Mortimer's PRs", datasource: "github", requestOptions: { datasourceFilter: "JIRA", datasourcesFilter: [ "JIRA", ], queryOverridesFacetFilters: true, facetFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], facetFilterSets: [ { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, ], facetBucketSize: 967252, authTokens: [ { accessToken: "123abc", datasource: "gmail", scope: "email profile https://www.googleapis.com/auth/gmail.readonly", tokenType: "Bearer", authUser: "1", }, ], }, inputDetails: { hasCopyPaste: true, }, }, }, ], metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, ], querySuggestions: { suggestions: [ { query: "app:github type:pull author:mortimer", label: "Mortimer's PRs", datasource: "github", }, ], }, inviteInfo: { invites: [ {}, ], }, customFields: [ { label: "", values: [], }, { label: "", values: [], }, { label: "", values: [], }, ], badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "ANSWER_MODERATOR", }, { person: { name: "George Clooney", obfuscatedId: "abc123", metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, { datasource: "github", handle: "", }, ], querySuggestions: {}, inviteInfo: {}, badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "EDITOR", }, { person: { name: "George Clooney", obfuscatedId: "abc123", metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, { datasource: "github", handle: "", }, ], querySuggestions: {}, inviteInfo: {}, badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "ANSWER_MODERATOR", }, ], removedRoles: [ { person: { name: "George Clooney", obfuscatedId: "abc123", metadata: { type: "FULL_TIME", title: "Actor", department: "Movies", email: "george@example.com", location: "Hollywood, CA", phone: "6505551234", photoUrl: "https://example.com/george.jpg", startDate: new RFCDate("2000-01-23"), datasourceProfile: [ { datasource: "github", handle: "", }, ], querySuggestions: {}, inviteInfo: {}, badges: [ { key: "deployment_name_new_hire", displayName: "New hire", iconConfig: { color: "#343CED", key: "person_icon", iconType: "GLYPH", name: "user", }, }, ], }, }, role: "ANSWER_MODERATOR", }, ], audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], id: 720396, }); expect(result).toBeDefined(); }); test("Collections Editcollectionitem", async () => { const testHttpClient = createTestHTTPClient("editcollectionitem"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); const result = await glean.client.collections.updateItem({ collectionId: 795203, itemId: "", }); expect(result).toBeDefined(); }); it.skip("Collections Editdocumentcollections", async () => { assert.fail( "incomplete test found please make sure to address the following errors: [`workflow step editdocumentcollections.test referencing operation editdocumentcollections not found in document`]", ); }); test("Collections Getcollection", async () => { const testHttpClient = createTestHTTPClient("getcollection"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); const result = await glean.client.collections.retrieve({ id: 700347, }); expect(result).toBeDefined(); }); test("Collections Listcollections", async () => { const testHttpClient = createTestHTTPClient("listcollections"); const glean = new Glean({ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", httpClient: testHttpClient, apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", }); const result = await glean.client.collections.list({}); expect(result).toBeDefined(); }); it.skip("Collections Movecollectionitem", async () => { assert.fail( "incomplete test found please make sure to address the following errors: [`workflow step movecollectionitem.test referencing operation movecollectionitem not found in document`]", ); }); it.skip("Collections Pincollection", async () => { assert.fail( "incomplete test found please make sure to address the following errors: [`workflow step pincollection.test referencing operation pincollection not found in document`]", ); });