/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 965c8b18742f */ import { assert, expect, it, test } from "vitest"; import { Glean } from "../index.js"; import { RFCDate } from "../types/index.js"; import { createTestHTTPClient } from "./testclient.js"; test("Client Shortcuts Createshortcut", async () => { const testHttpClient = createTestHTTPClient("createshortcut"); 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.shortcuts.create({ data: { 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", }, ], }, }); expect(result).toBeDefined(); }); test("Client Shortcuts Deleteshortcut", async () => { const testHttpClient = createTestHTTPClient("deleteshortcut"); 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.shortcuts.delete({ id: 545907, }); }); test("Client Shortcuts Getshortcut", async () => { const testHttpClient = createTestHTTPClient("getshortcut"); 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.shortcuts.retrieve({ alias: "", }); expect(result).toBeDefined(); }); it.skip("Client Shortcuts Getsimilarshortcuts", async () => { assert.fail( "incomplete test found please make sure to address the following errors: [`workflow step getsimilarshortcuts.test referencing operation getsimilarshortcuts not found in document`]", ); }); test("Client Shortcuts Listshortcuts", async () => { const testHttpClient = createTestHTTPClient("listshortcuts"); 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.shortcuts.list({ pageSize: 10, filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }); expect(result).toBeDefined(); }); it.skip("Client Shortcuts Previewshortcut", async () => { assert.fail( "incomplete test found please make sure to address the following errors: [`workflow step previewshortcut.test referencing operation previewshortcut not found in document`]", ); }); test("Client Shortcuts Updateshortcut", async () => { const testHttpClient = createTestHTTPClient("updateshortcut"); 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.shortcuts.update({ id: 857478, 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", }, ], }, ], }, { filters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], }, ], facetBucketSize: 627690, authTokens: [ { accessToken: "123abc", datasource: "gmail", scope: "email profile https://www.googleapis.com/auth/gmail.readonly", tokenType: "Bearer", authUser: "1", }, ], }, ranges: [ { startIndex: 984008, 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: "", }, ], collections: [ { name: "", description: "for drat underneath sticky yuck even", audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], id: 996168, items: [ { collectionId: 392671, itemType: "TEXT", }, { collectionId: 434386, itemType: "COLLECTION", }, ], }, { name: "", description: "duh now mechanically during since anxiously lightly ultimately", audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], id: 958595, }, { name: "", description: "whereas anenst habit onto worriedly revoke hm eminent sham", audienceFilters: [ { fieldName: "type", values: [ { value: "Spreadsheet", relationType: "EQUALS", }, { value: "Presentation", relationType: "EQUALS", }, ], }, ], id: 115263, }, ], interactions: { reacts: [ {}, {}, {}, ], shares: [ { numDaysAgo: 691669, }, { numDaysAgo: 202116, }, ], }, verification: { state: "UNVERIFIED", metadata: { reminders: [ { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 246216, }, ], lastReminder: { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 778241, }, }, }, customData: { "someCustomField": {}, }, }, }, }, { startIndex: 475618, 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: "DEPRECATED", metadata: { lastReminder: { assignee: { name: "George Clooney", obfuscatedId: "abc123", }, remindAt: 234790, }, }, }, 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", }, ], }, ], }, ], facetBucketSize: 253591, 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: "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: "", }, { 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: "", }, { 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", }, ], }); expect(result).toBeDefined(); });