@gleanwork/api-client 0.17.0 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/commonjs/__tests__/messages.test.js +1 -1
- package/dist/commonjs/__tests__/messages.test.js.map +1 -1
- package/dist/commonjs/__tests__/summarize.test.js +4 -4
- package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
- package/dist/commonjs/__tests__/tools.test.js +22 -0
- package/dist/commonjs/__tests__/tools.test.js.map +1 -1
- package/dist/commonjs/funcs/agentsCreateRun.js +1 -1
- package/dist/commonjs/funcs/agentsCreateRun.js.map +1 -1
- package/dist/commonjs/funcs/agentsSearch.js +1 -1
- package/dist/commonjs/funcs/agentsSearch.js.map +1 -1
- package/dist/commonjs/funcs/clientToolsAuthorizeToolServer.d.ts +23 -0
- package/dist/commonjs/funcs/clientToolsAuthorizeToolServer.d.ts.map +1 -0
- package/dist/commonjs/funcs/clientToolsAuthorizeToolServer.js +135 -0
- package/dist/commonjs/funcs/clientToolsAuthorizeToolServer.js.map +1 -0
- package/dist/commonjs/funcs/clientToolsRetrieveToolServerAuthStatus.d.ts +18 -0
- package/dist/commonjs/funcs/clientToolsRetrieveToolServerAuthStatus.d.ts.map +1 -0
- package/dist/commonjs/funcs/clientToolsRetrieveToolServerAuthStatus.js +126 -0
- package/dist/commonjs/funcs/clientToolsRetrieveToolServerAuthStatus.js.map +1 -0
- package/dist/commonjs/funcs/searchQuery.js +1 -1
- package/dist/commonjs/funcs/searchQuery.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/announcement.d.ts +2 -0
- package/dist/commonjs/models/components/announcement.d.ts.map +1 -1
- package/dist/commonjs/models/components/announcement.js +2 -0
- package/dist/commonjs/models/components/announcement.js.map +1 -1
- package/dist/commonjs/models/components/answerresult.d.ts +2 -0
- package/dist/commonjs/models/components/answerresult.d.ts.map +1 -1
- package/dist/commonjs/models/components/answerresult.js +2 -0
- package/dist/commonjs/models/components/answerresult.js.map +1 -1
- package/dist/commonjs/models/components/authorizetoolserverrequest.d.ts +18 -0
- package/dist/commonjs/models/components/authorizetoolserverrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/authorizetoolserverrequest.js +50 -0
- package/dist/commonjs/models/components/authorizetoolserverrequest.js.map +1 -0
- package/dist/commonjs/models/components/authorizetoolserverresponse.d.ts +16 -0
- package/dist/commonjs/models/components/authorizetoolserverresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/authorizetoolserverresponse.js +51 -0
- package/dist/commonjs/models/components/authorizetoolserverresponse.js.map +1 -0
- package/dist/commonjs/models/components/collection.d.ts +3 -0
- package/dist/commonjs/models/components/collection.d.ts.map +1 -1
- package/dist/commonjs/models/components/collection.js +3 -0
- package/dist/commonjs/models/components/collection.js.map +1 -1
- package/dist/commonjs/models/components/editcollectionresponse.d.ts +2 -0
- package/dist/commonjs/models/components/editcollectionresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/editcollectionresponse.js +2 -0
- package/dist/commonjs/models/components/editcollectionresponse.js.map +1 -1
- package/dist/commonjs/models/components/favoriteinfo.d.ts +10 -0
- package/dist/commonjs/models/components/favoriteinfo.d.ts.map +1 -1
- package/dist/commonjs/models/components/favoriteinfo.js +12 -1
- package/dist/commonjs/models/components/favoriteinfo.js.map +1 -1
- package/dist/commonjs/models/components/feedentry.d.ts +2 -0
- package/dist/commonjs/models/components/feedentry.d.ts.map +1 -1
- package/dist/commonjs/models/components/feedentry.js +2 -0
- package/dist/commonjs/models/components/feedentry.js.map +1 -1
- package/dist/commonjs/models/components/feedrequest.d.ts +2 -0
- package/dist/commonjs/models/components/feedrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/feedrequest.js +2 -0
- package/dist/commonjs/models/components/feedrequest.js.map +1 -1
- package/dist/commonjs/models/components/feedresult.d.ts +2 -0
- package/dist/commonjs/models/components/feedresult.d.ts.map +1 -1
- package/dist/commonjs/models/components/feedresult.js +2 -0
- package/dist/commonjs/models/components/feedresult.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +4 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +4 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/pindocument.d.ts +3 -0
- package/dist/commonjs/models/components/pindocument.d.ts.map +1 -1
- package/dist/commonjs/models/components/pindocument.js +3 -0
- package/dist/commonjs/models/components/pindocument.js.map +1 -1
- package/dist/commonjs/models/components/platformproblemdetailcode.d.ts +1 -0
- package/dist/commonjs/models/components/platformproblemdetailcode.d.ts.map +1 -1
- package/dist/commonjs/models/components/platformproblemdetailcode.js +1 -0
- package/dist/commonjs/models/components/platformproblemdetailcode.js.map +1 -1
- package/dist/commonjs/models/components/shortcut.d.ts +3 -0
- package/dist/commonjs/models/components/shortcut.d.ts.map +1 -1
- package/dist/commonjs/models/components/shortcut.js +3 -0
- package/dist/commonjs/models/components/shortcut.js.map +1 -1
- package/dist/commonjs/models/components/toolserverauthstatus.d.ts +16 -0
- package/dist/commonjs/models/components/toolserverauthstatus.d.ts.map +1 -0
- package/dist/commonjs/models/components/toolserverauthstatus.js +51 -0
- package/dist/commonjs/models/components/toolserverauthstatus.js.map +1 -0
- package/dist/commonjs/models/components/toolserverauthstatusresponse.d.ts +36 -0
- package/dist/commonjs/models/components/toolserverauthstatusresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/toolserverauthstatusresponse.js +57 -0
- package/dist/commonjs/models/components/toolserverauthstatusresponse.js.map +1 -0
- package/dist/commonjs/models/components/ugctype.d.ts +2 -0
- package/dist/commonjs/models/components/ugctype.d.ts.map +1 -1
- package/dist/commonjs/models/components/ugctype.js +3 -1
- package/dist/commonjs/models/components/ugctype.js.map +1 -1
- package/dist/commonjs/models/operations/authorizetoolserver.d.ts +18 -0
- package/dist/commonjs/models/operations/authorizetoolserver.d.ts.map +1 -0
- package/dist/commonjs/models/operations/authorizetoolserver.js +57 -0
- package/dist/commonjs/models/operations/authorizetoolserver.js.map +1 -0
- package/dist/commonjs/models/operations/gettoolserverauthstatus.d.ts +15 -0
- package/dist/commonjs/models/operations/gettoolserverauthstatus.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gettoolserverauthstatus.js +50 -0
- package/dist/commonjs/models/operations/gettoolserverauthstatus.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/clientToolsAuthorizeToolServer.d.ts +35 -0
- package/dist/commonjs/react-query/clientToolsAuthorizeToolServer.d.ts.map +1 -0
- package/dist/commonjs/react-query/clientToolsAuthorizeToolServer.js +54 -0
- package/dist/commonjs/react-query/clientToolsAuthorizeToolServer.js.map +1 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.core.d.ts +12 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.core.js +40 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.core.js.map +1 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.d.ts +29 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.d.ts.map +1 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.js +72 -0
- package/dist/commonjs/react-query/clientToolsRetrieveToolServerAuthStatus.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/tools.d.ts +21 -0
- package/dist/commonjs/sdk/tools.d.ts.map +1 -1
- package/dist/commonjs/sdk/tools.js +27 -0
- package/dist/commonjs/sdk/tools.js.map +1 -1
- package/dist/esm/__tests__/messages.test.js +1 -1
- package/dist/esm/__tests__/messages.test.js.map +1 -1
- package/dist/esm/__tests__/summarize.test.js +4 -4
- package/dist/esm/__tests__/summarize.test.js.map +1 -1
- package/dist/esm/__tests__/tools.test.js +22 -0
- package/dist/esm/__tests__/tools.test.js.map +1 -1
- package/dist/esm/funcs/agentsCreateRun.js +1 -1
- package/dist/esm/funcs/agentsCreateRun.js.map +1 -1
- package/dist/esm/funcs/agentsSearch.js +1 -1
- package/dist/esm/funcs/agentsSearch.js.map +1 -1
- package/dist/esm/funcs/clientToolsAuthorizeToolServer.d.ts +23 -0
- package/dist/esm/funcs/clientToolsAuthorizeToolServer.d.ts.map +1 -0
- package/dist/esm/funcs/clientToolsAuthorizeToolServer.js +99 -0
- package/dist/esm/funcs/clientToolsAuthorizeToolServer.js.map +1 -0
- package/dist/esm/funcs/clientToolsRetrieveToolServerAuthStatus.d.ts +18 -0
- package/dist/esm/funcs/clientToolsRetrieveToolServerAuthStatus.d.ts.map +1 -0
- package/dist/esm/funcs/clientToolsRetrieveToolServerAuthStatus.js +90 -0
- package/dist/esm/funcs/clientToolsRetrieveToolServerAuthStatus.js.map +1 -0
- package/dist/esm/funcs/searchQuery.js +1 -1
- package/dist/esm/funcs/searchQuery.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/announcement.d.ts +2 -0
- package/dist/esm/models/components/announcement.d.ts.map +1 -1
- package/dist/esm/models/components/announcement.js +2 -0
- package/dist/esm/models/components/announcement.js.map +1 -1
- package/dist/esm/models/components/answerresult.d.ts +2 -0
- package/dist/esm/models/components/answerresult.d.ts.map +1 -1
- package/dist/esm/models/components/answerresult.js +2 -0
- package/dist/esm/models/components/answerresult.js.map +1 -1
- package/dist/esm/models/components/authorizetoolserverrequest.d.ts +18 -0
- package/dist/esm/models/components/authorizetoolserverrequest.d.ts.map +1 -0
- package/dist/esm/models/components/authorizetoolserverrequest.js +13 -0
- package/dist/esm/models/components/authorizetoolserverrequest.js.map +1 -0
- package/dist/esm/models/components/authorizetoolserverresponse.d.ts +16 -0
- package/dist/esm/models/components/authorizetoolserverresponse.d.ts.map +1 -0
- package/dist/esm/models/components/authorizetoolserverresponse.js +14 -0
- package/dist/esm/models/components/authorizetoolserverresponse.js.map +1 -0
- package/dist/esm/models/components/collection.d.ts +3 -0
- package/dist/esm/models/components/collection.d.ts.map +1 -1
- package/dist/esm/models/components/collection.js +3 -0
- package/dist/esm/models/components/collection.js.map +1 -1
- package/dist/esm/models/components/editcollectionresponse.d.ts +2 -0
- package/dist/esm/models/components/editcollectionresponse.d.ts.map +1 -1
- package/dist/esm/models/components/editcollectionresponse.js +2 -0
- package/dist/esm/models/components/editcollectionresponse.js.map +1 -1
- package/dist/esm/models/components/favoriteinfo.d.ts +10 -0
- package/dist/esm/models/components/favoriteinfo.d.ts.map +1 -1
- package/dist/esm/models/components/favoriteinfo.js +11 -1
- package/dist/esm/models/components/favoriteinfo.js.map +1 -1
- package/dist/esm/models/components/feedentry.d.ts +2 -0
- package/dist/esm/models/components/feedentry.d.ts.map +1 -1
- package/dist/esm/models/components/feedentry.js +2 -0
- package/dist/esm/models/components/feedentry.js.map +1 -1
- package/dist/esm/models/components/feedrequest.d.ts +2 -0
- package/dist/esm/models/components/feedrequest.d.ts.map +1 -1
- package/dist/esm/models/components/feedrequest.js +2 -0
- package/dist/esm/models/components/feedrequest.js.map +1 -1
- package/dist/esm/models/components/feedresult.d.ts +2 -0
- package/dist/esm/models/components/feedresult.d.ts.map +1 -1
- package/dist/esm/models/components/feedresult.js +2 -0
- package/dist/esm/models/components/feedresult.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +4 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +4 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/pindocument.d.ts +3 -0
- package/dist/esm/models/components/pindocument.d.ts.map +1 -1
- package/dist/esm/models/components/pindocument.js +3 -0
- package/dist/esm/models/components/pindocument.js.map +1 -1
- package/dist/esm/models/components/platformproblemdetailcode.d.ts +1 -0
- package/dist/esm/models/components/platformproblemdetailcode.d.ts.map +1 -1
- package/dist/esm/models/components/platformproblemdetailcode.js +1 -0
- package/dist/esm/models/components/platformproblemdetailcode.js.map +1 -1
- package/dist/esm/models/components/shortcut.d.ts +3 -0
- package/dist/esm/models/components/shortcut.d.ts.map +1 -1
- package/dist/esm/models/components/shortcut.js +3 -0
- package/dist/esm/models/components/shortcut.js.map +1 -1
- package/dist/esm/models/components/toolserverauthstatus.d.ts +16 -0
- package/dist/esm/models/components/toolserverauthstatus.d.ts.map +1 -0
- package/dist/esm/models/components/toolserverauthstatus.js +15 -0
- package/dist/esm/models/components/toolserverauthstatus.js.map +1 -0
- package/dist/esm/models/components/toolserverauthstatusresponse.d.ts +36 -0
- package/dist/esm/models/components/toolserverauthstatusresponse.d.ts.map +1 -0
- package/dist/esm/models/components/toolserverauthstatusresponse.js +20 -0
- package/dist/esm/models/components/toolserverauthstatusresponse.js.map +1 -0
- package/dist/esm/models/components/ugctype.d.ts +2 -0
- package/dist/esm/models/components/ugctype.d.ts.map +1 -1
- package/dist/esm/models/components/ugctype.js +2 -0
- package/dist/esm/models/components/ugctype.js.map +1 -1
- package/dist/esm/models/operations/authorizetoolserver.d.ts +18 -0
- package/dist/esm/models/operations/authorizetoolserver.d.ts.map +1 -0
- package/dist/esm/models/operations/authorizetoolserver.js +20 -0
- package/dist/esm/models/operations/authorizetoolserver.js.map +1 -0
- package/dist/esm/models/operations/gettoolserverauthstatus.d.ts +15 -0
- package/dist/esm/models/operations/gettoolserverauthstatus.d.ts.map +1 -0
- package/dist/esm/models/operations/gettoolserverauthstatus.js +13 -0
- package/dist/esm/models/operations/gettoolserverauthstatus.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/clientToolsAuthorizeToolServer.d.ts +35 -0
- package/dist/esm/react-query/clientToolsAuthorizeToolServer.d.ts.map +1 -0
- package/dist/esm/react-query/clientToolsAuthorizeToolServer.js +49 -0
- package/dist/esm/react-query/clientToolsAuthorizeToolServer.js.map +1 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.core.d.ts +12 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.core.d.ts.map +1 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.core.js +35 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.core.js.map +1 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.d.ts +29 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.d.ts.map +1 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.js +62 -0
- package/dist/esm/react-query/clientToolsRetrieveToolServerAuthStatus.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/tools.d.ts +21 -0
- package/dist/esm/sdk/tools.d.ts.map +1 -1
- package/dist/esm/sdk/tools.js +27 -0
- package/dist/esm/sdk/tools.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/messages.test.ts +1 -1
- package/src/__tests__/summarize.test.ts +4 -4
- package/src/__tests__/tools.test.ts +28 -0
- package/src/funcs/agentsCreateRun.ts +1 -1
- package/src/funcs/agentsSearch.ts +1 -1
- package/src/funcs/clientToolsAuthorizeToolServer.ts +189 -0
- package/src/funcs/clientToolsRetrieveToolServerAuthStatus.ts +177 -0
- package/src/funcs/searchQuery.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/announcement.ts +3 -0
- package/src/models/components/answerresult.ts +3 -0
- package/src/models/components/authorizetoolserverrequest.ts +38 -0
- package/src/models/components/authorizetoolserverresponse.ts +38 -0
- package/src/models/components/collection.ts +10 -0
- package/src/models/components/editcollectionresponse.ts +3 -0
- package/src/models/components/favoriteinfo.ts +27 -1
- package/src/models/components/feedentry.ts +2 -0
- package/src/models/components/feedrequest.ts +2 -0
- package/src/models/components/feedresult.ts +2 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/pindocument.ts +10 -0
- package/src/models/components/platformproblemdetailcode.ts +1 -0
- package/src/models/components/shortcut.ts +10 -0
- package/src/models/components/toolserverauthstatus.ts +27 -0
- package/src/models/components/toolserverauthstatusresponse.ts +68 -0
- package/src/models/components/ugctype.ts +3 -0
- package/src/models/operations/authorizetoolserver.ts +45 -0
- package/src/models/operations/gettoolserverauthstatus.ts +37 -0
- package/src/models/operations/index.ts +2 -0
- package/src/react-query/clientToolsAuthorizeToolServer.ts +119 -0
- package/src/react-query/clientToolsRetrieveToolServerAuthStatus.core.ts +79 -0
- package/src/react-query/clientToolsRetrieveToolServerAuthStatus.ts +150 -0
- package/src/react-query/index.ts +2 -0
- package/src/sdk/tools.ts +45 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d3f54c35c5a2
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { GleanCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import * as components from "../models/components/index.js";
|
|
16
|
+
import { GleanBaseError } from "../models/errors/gleanbaseerror.js";
|
|
17
|
+
import {
|
|
18
|
+
ConnectionError,
|
|
19
|
+
InvalidRequestError,
|
|
20
|
+
RequestAbortedError,
|
|
21
|
+
RequestTimeoutError,
|
|
22
|
+
UnexpectedClientError,
|
|
23
|
+
} from "../models/errors/httpclienterrors.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Start the OAuth authorization flow for a tool server.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Initiates the third-party OAuth flow for the specified tool server and returns the
|
|
35
|
+
* authorization URL that the client should navigate the end user to. After the OAuth
|
|
36
|
+
* callback completes, the user's browser is redirected back to `returnUrl` with query
|
|
37
|
+
* parameters indicating the result.
|
|
38
|
+
*
|
|
39
|
+
* `returnUrl` must match the tenant's configured return URL allowlist; otherwise the
|
|
40
|
+
* request is rejected with 400.
|
|
41
|
+
*/
|
|
42
|
+
export function clientToolsAuthorizeToolServer(
|
|
43
|
+
client: GleanCore,
|
|
44
|
+
authorizeToolServerRequest: components.AuthorizeToolServerRequest,
|
|
45
|
+
serverId: string,
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<
|
|
48
|
+
Result<
|
|
49
|
+
components.AuthorizeToolServerResponse,
|
|
50
|
+
| GleanBaseError
|
|
51
|
+
| ResponseValidationError
|
|
52
|
+
| ConnectionError
|
|
53
|
+
| RequestAbortedError
|
|
54
|
+
| RequestTimeoutError
|
|
55
|
+
| InvalidRequestError
|
|
56
|
+
| UnexpectedClientError
|
|
57
|
+
| SDKValidationError
|
|
58
|
+
>
|
|
59
|
+
> {
|
|
60
|
+
return new APIPromise($do(
|
|
61
|
+
client,
|
|
62
|
+
authorizeToolServerRequest,
|
|
63
|
+
serverId,
|
|
64
|
+
options,
|
|
65
|
+
));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function $do(
|
|
69
|
+
client: GleanCore,
|
|
70
|
+
authorizeToolServerRequest: components.AuthorizeToolServerRequest,
|
|
71
|
+
serverId: string,
|
|
72
|
+
options?: RequestOptions,
|
|
73
|
+
): Promise<
|
|
74
|
+
[
|
|
75
|
+
Result<
|
|
76
|
+
components.AuthorizeToolServerResponse,
|
|
77
|
+
| GleanBaseError
|
|
78
|
+
| ResponseValidationError
|
|
79
|
+
| ConnectionError
|
|
80
|
+
| RequestAbortedError
|
|
81
|
+
| RequestTimeoutError
|
|
82
|
+
| InvalidRequestError
|
|
83
|
+
| UnexpectedClientError
|
|
84
|
+
| SDKValidationError
|
|
85
|
+
>,
|
|
86
|
+
APICall,
|
|
87
|
+
]
|
|
88
|
+
> {
|
|
89
|
+
const input: operations.AuthorizeToolServerRequest = {
|
|
90
|
+
authorizeToolServerRequest: authorizeToolServerRequest,
|
|
91
|
+
serverId: serverId,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const parsed = safeParse(
|
|
95
|
+
input,
|
|
96
|
+
(value) =>
|
|
97
|
+
operations.AuthorizeToolServerRequest$outboundSchema.parse(value),
|
|
98
|
+
"Input validation failed",
|
|
99
|
+
);
|
|
100
|
+
if (!parsed.ok) {
|
|
101
|
+
return [parsed, { status: "invalid" }];
|
|
102
|
+
}
|
|
103
|
+
const payload = parsed.value;
|
|
104
|
+
const body = encodeJSON("body", payload.AuthorizeToolServerRequest, {
|
|
105
|
+
explode: true,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const pathParams = {
|
|
109
|
+
serverId: encodeSimple("serverId", payload.serverId, {
|
|
110
|
+
explode: false,
|
|
111
|
+
charEncoding: "percent",
|
|
112
|
+
}),
|
|
113
|
+
};
|
|
114
|
+
const path = pathToFunc("/rest/api/v1/tool-servers/{serverId}/auth")(
|
|
115
|
+
pathParams,
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
const headers = new Headers(compactMap({
|
|
119
|
+
"Content-Type": "application/json",
|
|
120
|
+
Accept: "application/json",
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
const secConfig = await extractSecurity(client._options.apiToken);
|
|
124
|
+
const securityInput = secConfig == null ? {} : { apiToken: secConfig };
|
|
125
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
126
|
+
|
|
127
|
+
const context = {
|
|
128
|
+
options: client._options,
|
|
129
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
130
|
+
operationID: "authorizeToolServer",
|
|
131
|
+
oAuth2Scopes: null,
|
|
132
|
+
|
|
133
|
+
resolvedSecurity: requestSecurity,
|
|
134
|
+
|
|
135
|
+
securitySource: client._options.apiToken,
|
|
136
|
+
retryConfig: options?.retries
|
|
137
|
+
|| client._options.retryConfig
|
|
138
|
+
|| { strategy: "none" },
|
|
139
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const requestRes = client._createRequest(context, {
|
|
143
|
+
security: requestSecurity,
|
|
144
|
+
method: "POST",
|
|
145
|
+
baseURL: options?.serverURL,
|
|
146
|
+
path: path,
|
|
147
|
+
headers: headers,
|
|
148
|
+
body: body,
|
|
149
|
+
userAgent: client._options.userAgent,
|
|
150
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
151
|
+
}, options);
|
|
152
|
+
if (!requestRes.ok) {
|
|
153
|
+
return [requestRes, { status: "invalid" }];
|
|
154
|
+
}
|
|
155
|
+
const req = requestRes.value;
|
|
156
|
+
|
|
157
|
+
const doResult = await client._do(req, {
|
|
158
|
+
context,
|
|
159
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
160
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
161
|
+
retryConfig: context.retryConfig,
|
|
162
|
+
retryCodes: context.retryCodes,
|
|
163
|
+
});
|
|
164
|
+
if (!doResult.ok) {
|
|
165
|
+
return [doResult, { status: "request-error", request: req }];
|
|
166
|
+
}
|
|
167
|
+
const response = doResult.value;
|
|
168
|
+
|
|
169
|
+
const [result] = await M.match<
|
|
170
|
+
components.AuthorizeToolServerResponse,
|
|
171
|
+
| GleanBaseError
|
|
172
|
+
| ResponseValidationError
|
|
173
|
+
| ConnectionError
|
|
174
|
+
| RequestAbortedError
|
|
175
|
+
| RequestTimeoutError
|
|
176
|
+
| InvalidRequestError
|
|
177
|
+
| UnexpectedClientError
|
|
178
|
+
| SDKValidationError
|
|
179
|
+
>(
|
|
180
|
+
M.json(200, components.AuthorizeToolServerResponse$inboundSchema),
|
|
181
|
+
M.fail([400, 401, 403, 404, 429, "4XX"]),
|
|
182
|
+
M.fail("5XX"),
|
|
183
|
+
)(response, req);
|
|
184
|
+
if (!result.ok) {
|
|
185
|
+
return [result, { status: "complete", request: req, response }];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return [result, { status: "complete", request: req, response }];
|
|
189
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e991c3e9afec
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { GleanCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import * as components from "../models/components/index.js";
|
|
16
|
+
import { GleanBaseError } from "../models/errors/gleanbaseerror.js";
|
|
17
|
+
import {
|
|
18
|
+
ConnectionError,
|
|
19
|
+
InvalidRequestError,
|
|
20
|
+
RequestAbortedError,
|
|
21
|
+
RequestTimeoutError,
|
|
22
|
+
UnexpectedClientError,
|
|
23
|
+
} from "../models/errors/httpclienterrors.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get end-user authentication status for a tool server.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Returns display information and the calling user's current authentication status
|
|
35
|
+
* for the specified tool server.
|
|
36
|
+
*/
|
|
37
|
+
export function clientToolsRetrieveToolServerAuthStatus(
|
|
38
|
+
client: GleanCore,
|
|
39
|
+
serverId: string,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
components.ToolServerAuthStatusResponse,
|
|
44
|
+
| GleanBaseError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
serverId,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: GleanCore,
|
|
63
|
+
serverId: string,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
components.ToolServerAuthStatusResponse,
|
|
69
|
+
| GleanBaseError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const input: operations.GetToolServerAuthStatusRequest = {
|
|
82
|
+
serverId: serverId,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const parsed = safeParse(
|
|
86
|
+
input,
|
|
87
|
+
(value) =>
|
|
88
|
+
operations.GetToolServerAuthStatusRequest$outboundSchema.parse(value),
|
|
89
|
+
"Input validation failed",
|
|
90
|
+
);
|
|
91
|
+
if (!parsed.ok) {
|
|
92
|
+
return [parsed, { status: "invalid" }];
|
|
93
|
+
}
|
|
94
|
+
const payload = parsed.value;
|
|
95
|
+
const body = null;
|
|
96
|
+
|
|
97
|
+
const pathParams = {
|
|
98
|
+
serverId: encodeSimple("serverId", payload.serverId, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
const path = pathToFunc("/rest/api/v1/tool-servers/{serverId}/auth")(
|
|
104
|
+
pathParams,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const secConfig = await extractSecurity(client._options.apiToken);
|
|
112
|
+
const securityInput = secConfig == null ? {} : { apiToken: secConfig };
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "getToolServerAuthStatus",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.apiToken,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "GET",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
148
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const [result] = await M.match<
|
|
158
|
+
components.ToolServerAuthStatusResponse,
|
|
159
|
+
| GleanBaseError
|
|
160
|
+
| ResponseValidationError
|
|
161
|
+
| ConnectionError
|
|
162
|
+
| RequestAbortedError
|
|
163
|
+
| RequestTimeoutError
|
|
164
|
+
| InvalidRequestError
|
|
165
|
+
| UnexpectedClientError
|
|
166
|
+
| SDKValidationError
|
|
167
|
+
>(
|
|
168
|
+
M.json(200, components.ToolServerAuthStatusResponse$inboundSchema),
|
|
169
|
+
M.fail([400, 401, 404, 429, "4XX"]),
|
|
170
|
+
M.fail("5XX"),
|
|
171
|
+
)(response, req);
|
|
172
|
+
if (!result.ok) {
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return [result, { status: "complete", request: req, response }];
|
|
177
|
+
}
|
package/src/funcs/searchQuery.ts
CHANGED
|
@@ -161,7 +161,7 @@ async function $do(
|
|
|
161
161
|
>(
|
|
162
162
|
M.json(200, components.PlatformSearchResponse$inboundSchema),
|
|
163
163
|
M.jsonErr(
|
|
164
|
-
[400, 401, 403, 404, 408, 429],
|
|
164
|
+
[400, 401, 403, 404, 408, 413, 429],
|
|
165
165
|
errors.PlatformProblemDetailError$inboundSchema,
|
|
166
166
|
{ ctype: "application/problem+json" },
|
|
167
167
|
),
|
package/src/lib/config.ts
CHANGED
|
@@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "0.9.0",
|
|
76
|
-
sdkVersion: "0.17.
|
|
77
|
-
genVersion: "2.
|
|
76
|
+
sdkVersion: "0.17.2",
|
|
77
|
+
genVersion: "2.916.2",
|
|
78
78
|
userAgent:
|
|
79
|
-
"speakeasy-sdk/typescript 0.17.
|
|
79
|
+
"speakeasy-sdk/typescript 0.17.2 2.916.2 0.9.0 @gleanwork/api-client",
|
|
80
80
|
} as const;
|
|
@@ -11,6 +11,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
11
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
12
|
import { Document, Document$inboundSchema } from "./document.js";
|
|
13
13
|
import { FacetFilter, FacetFilter$inboundSchema } from "./facetfilter.js";
|
|
14
|
+
import { FavoriteInfo, FavoriteInfo$inboundSchema } from "./favoriteinfo.js";
|
|
14
15
|
import {
|
|
15
16
|
ObjectPermissions,
|
|
16
17
|
ObjectPermissions$inboundSchema,
|
|
@@ -134,6 +135,7 @@ export type Announcement = {
|
|
|
134
135
|
* Whether or not the announcement is published.
|
|
135
136
|
*/
|
|
136
137
|
isPublished?: boolean | undefined;
|
|
138
|
+
favoriteInfo?: FavoriteInfo | undefined;
|
|
137
139
|
};
|
|
138
140
|
|
|
139
141
|
/** @internal */
|
|
@@ -203,6 +205,7 @@ export const Announcement$inboundSchema: z.ZodType<
|
|
|
203
205
|
viewerInfo: z.lazy(() => AnnouncementViewerInfo$inboundSchema).optional(),
|
|
204
206
|
sourceDocument: Document$inboundSchema.optional(),
|
|
205
207
|
isPublished: z.boolean().optional(),
|
|
208
|
+
favoriteInfo: FavoriteInfo$inboundSchema.optional(),
|
|
206
209
|
});
|
|
207
210
|
|
|
208
211
|
export function announcementFromJSON(
|
|
@@ -8,6 +8,7 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
import { Answer, Answer$inboundSchema } from "./answer.js";
|
|
11
|
+
import { FavoriteInfo, FavoriteInfo$inboundSchema } from "./favoriteinfo.js";
|
|
11
12
|
|
|
12
13
|
export type AnswerResult = {
|
|
13
14
|
answer: Answer;
|
|
@@ -17,6 +18,7 @@ export type AnswerResult = {
|
|
|
17
18
|
* @deprecated field: Deprecated on 2026-05-07, removal scheduled for 2027-01-15: Use `answer.trackingToken` instead..
|
|
18
19
|
*/
|
|
19
20
|
trackingToken?: string | undefined;
|
|
21
|
+
favoriteInfo?: FavoriteInfo | undefined;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
/** @internal */
|
|
@@ -27,6 +29,7 @@ export const AnswerResult$inboundSchema: z.ZodType<
|
|
|
27
29
|
> = z.object({
|
|
28
30
|
answer: Answer$inboundSchema,
|
|
29
31
|
trackingToken: z.string().optional(),
|
|
32
|
+
favoriteInfo: FavoriteInfo$inboundSchema.optional(),
|
|
30
33
|
});
|
|
31
34
|
|
|
32
35
|
export function answerResultFromJSON(
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: db98d96ed2da
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
|
|
8
|
+
export type AuthorizeToolServerRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* URL to redirect the end user's browser back to after the OAuth flow completes.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Must be present in the tenant's configured return URL allowlist.
|
|
14
|
+
*/
|
|
15
|
+
returnUrl: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export type AuthorizeToolServerRequest$Outbound = {
|
|
20
|
+
returnUrl: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const AuthorizeToolServerRequest$outboundSchema: z.ZodType<
|
|
25
|
+
AuthorizeToolServerRequest$Outbound,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
AuthorizeToolServerRequest
|
|
28
|
+
> = z.object({
|
|
29
|
+
returnUrl: z.string(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function authorizeToolServerRequestToJSON(
|
|
33
|
+
authorizeToolServerRequest: AuthorizeToolServerRequest,
|
|
34
|
+
): string {
|
|
35
|
+
return JSON.stringify(
|
|
36
|
+
AuthorizeToolServerRequest$outboundSchema.parse(authorizeToolServerRequest),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 216073fe950b
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type AuthorizeToolServerResponse = {
|
|
12
|
+
/**
|
|
13
|
+
* URL that the client should navigate the end user to in order to begin the OAuth flow.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* After the user consents, control returns to `returnUrl` from the request.
|
|
17
|
+
*/
|
|
18
|
+
authorizationUrl: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const AuthorizeToolServerResponse$inboundSchema: z.ZodType<
|
|
23
|
+
AuthorizeToolServerResponse,
|
|
24
|
+
z.ZodTypeDef,
|
|
25
|
+
unknown
|
|
26
|
+
> = z.object({
|
|
27
|
+
authorizationUrl: z.string(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function authorizeToolServerResponseFromJSON(
|
|
31
|
+
jsonString: string,
|
|
32
|
+
): SafeParseResult<AuthorizeToolServerResponse, SDKValidationError> {
|
|
33
|
+
return safeParse(
|
|
34
|
+
jsonString,
|
|
35
|
+
(x) => AuthorizeToolServerResponse$inboundSchema.parse(JSON.parse(x)),
|
|
36
|
+
`Failed to parse 'AuthorizeToolServerResponse' from JSON`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -25,6 +25,12 @@ import {
|
|
|
25
25
|
FacetFilter$Outbound,
|
|
26
26
|
FacetFilter$outboundSchema,
|
|
27
27
|
} from "./facetfilter.js";
|
|
28
|
+
import {
|
|
29
|
+
FavoriteInfo,
|
|
30
|
+
FavoriteInfo$inboundSchema,
|
|
31
|
+
FavoriteInfo$Outbound,
|
|
32
|
+
FavoriteInfo$outboundSchema,
|
|
33
|
+
} from "./favoriteinfo.js";
|
|
28
34
|
import {
|
|
29
35
|
ObjectPermissions,
|
|
30
36
|
ObjectPermissions$inboundSchema,
|
|
@@ -126,6 +132,7 @@ export type Collection = {
|
|
|
126
132
|
* A list of user roles for the Collection.
|
|
127
133
|
*/
|
|
128
134
|
roles?: Array<UserRoleSpecification> | undefined;
|
|
135
|
+
favoriteInfo?: FavoriteInfo | undefined;
|
|
129
136
|
};
|
|
130
137
|
|
|
131
138
|
/** @internal */
|
|
@@ -162,6 +169,7 @@ export const Collection$inboundSchema: z.ZodType<
|
|
|
162
169
|
shortcuts: z.array(z.string()).optional(),
|
|
163
170
|
children: z.array(z.lazy(() => Collection$inboundSchema)).optional(),
|
|
164
171
|
roles: z.array(z.lazy(() => UserRoleSpecification$inboundSchema)).optional(),
|
|
172
|
+
favoriteInfo: FavoriteInfo$inboundSchema.optional(),
|
|
165
173
|
});
|
|
166
174
|
/** @internal */
|
|
167
175
|
export type Collection$Outbound = {
|
|
@@ -189,6 +197,7 @@ export type Collection$Outbound = {
|
|
|
189
197
|
shortcuts?: Array<string> | undefined;
|
|
190
198
|
children?: Array<Collection$Outbound> | undefined;
|
|
191
199
|
roles?: Array<UserRoleSpecification$Outbound> | undefined;
|
|
200
|
+
favoriteInfo?: FavoriteInfo$Outbound | undefined;
|
|
192
201
|
};
|
|
193
202
|
|
|
194
203
|
/** @internal */
|
|
@@ -223,6 +232,7 @@ export const Collection$outboundSchema: z.ZodType<
|
|
|
223
232
|
shortcuts: z.array(z.string()).optional(),
|
|
224
233
|
children: z.array(z.lazy(() => Collection$outboundSchema)).optional(),
|
|
225
234
|
roles: z.array(z.lazy(() => UserRoleSpecification$outboundSchema)).optional(),
|
|
235
|
+
favoriteInfo: FavoriteInfo$outboundSchema.optional(),
|
|
226
236
|
});
|
|
227
237
|
|
|
228
238
|
export function collectionToJSON(collection: Collection): string {
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
CollectionPinnedMetadata$inboundSchema,
|
|
24
24
|
} from "./collectionpinnedmetadata.js";
|
|
25
25
|
import { FacetFilter, FacetFilter$inboundSchema } from "./facetfilter.js";
|
|
26
|
+
import { FavoriteInfo, FavoriteInfo$inboundSchema } from "./favoriteinfo.js";
|
|
26
27
|
import {
|
|
27
28
|
ObjectPermissions,
|
|
28
29
|
ObjectPermissions$inboundSchema,
|
|
@@ -124,6 +125,7 @@ export type EditCollectionResponse = {
|
|
|
124
125
|
* A list of user roles for the Collection.
|
|
125
126
|
*/
|
|
126
127
|
roles?: Array<UserRoleSpecification> | undefined;
|
|
128
|
+
favoriteInfo?: FavoriteInfo | undefined;
|
|
127
129
|
errorCode: EditCollectionResponseErrorCode;
|
|
128
130
|
collection?: Collection | undefined;
|
|
129
131
|
error?: CollectionError | undefined;
|
|
@@ -168,6 +170,7 @@ export const EditCollectionResponse$inboundSchema: z.ZodType<
|
|
|
168
170
|
shortcuts: z.array(z.string()).optional(),
|
|
169
171
|
children: z.array(Collection$inboundSchema).optional(),
|
|
170
172
|
roles: z.array(UserRoleSpecification$inboundSchema).optional(),
|
|
173
|
+
favoriteInfo: FavoriteInfo$inboundSchema.optional(),
|
|
171
174
|
errorCode: EditCollectionResponseErrorCode$inboundSchema,
|
|
172
175
|
collection: Collection$inboundSchema.optional(),
|
|
173
176
|
error: CollectionError$inboundSchema.optional(),
|
|
@@ -7,7 +7,11 @@ import * as z from "zod/v3";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
UgcType,
|
|
12
|
+
UgcType$inboundSchema,
|
|
13
|
+
UgcType$outboundSchema,
|
|
14
|
+
} from "./ugctype.js";
|
|
11
15
|
|
|
12
16
|
export type FavoriteInfo = {
|
|
13
17
|
ugcType?: UgcType | undefined;
|
|
@@ -36,7 +40,29 @@ export const FavoriteInfo$inboundSchema: z.ZodType<
|
|
|
36
40
|
count: z.number().int().optional(),
|
|
37
41
|
favoritedByUser: z.boolean().optional(),
|
|
38
42
|
});
|
|
43
|
+
/** @internal */
|
|
44
|
+
export type FavoriteInfo$Outbound = {
|
|
45
|
+
ugcType?: string | undefined;
|
|
46
|
+
id?: string | undefined;
|
|
47
|
+
count?: number | undefined;
|
|
48
|
+
favoritedByUser?: boolean | undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const FavoriteInfo$outboundSchema: z.ZodType<
|
|
53
|
+
FavoriteInfo$Outbound,
|
|
54
|
+
z.ZodTypeDef,
|
|
55
|
+
FavoriteInfo
|
|
56
|
+
> = z.object({
|
|
57
|
+
ugcType: UgcType$outboundSchema.optional(),
|
|
58
|
+
id: z.string().optional(),
|
|
59
|
+
count: z.number().int().optional(),
|
|
60
|
+
favoritedByUser: z.boolean().optional(),
|
|
61
|
+
});
|
|
39
62
|
|
|
63
|
+
export function favoriteInfoToJSON(favoriteInfo: FavoriteInfo): string {
|
|
64
|
+
return JSON.stringify(FavoriteInfo$outboundSchema.parse(favoriteInfo));
|
|
65
|
+
}
|
|
40
66
|
export function favoriteInfoFromJSON(
|
|
41
67
|
jsonString: string,
|
|
42
68
|
): SafeParseResult<FavoriteInfo, SDKValidationError> {
|
|
@@ -100,6 +100,7 @@ export const JustificationType = {
|
|
|
100
100
|
ZeroStateAgentSuggestion: "ZERO_STATE_AGENT_SUGGESTION",
|
|
101
101
|
PersonalizedChatSuggestion: "PERSONALIZED_CHAT_SUGGESTION",
|
|
102
102
|
DailyDigest: "DAILY_DIGEST",
|
|
103
|
+
Podcast: "PODCAST",
|
|
103
104
|
Task: "TASK",
|
|
104
105
|
PlanMyDay: "PLAN_MY_DAY",
|
|
105
106
|
EndMyDay: "END_MY_DAY",
|
|
@@ -121,6 +122,7 @@ export const JustificationType = {
|
|
|
121
122
|
DemoCard: "DEMO_CARD",
|
|
122
123
|
OooPlanner: "OOO_PLANNER",
|
|
123
124
|
OooCatchUp: "OOO_CATCH_UP",
|
|
125
|
+
AdminHealthCenter: "ADMIN_HEALTH_CENTER",
|
|
124
126
|
} as const;
|
|
125
127
|
/**
|
|
126
128
|
* Type of the justification.
|
|
@@ -42,6 +42,7 @@ export const FeedRequestCategory = {
|
|
|
42
42
|
ZeroStateWorkflowSuggestion: "ZERO_STATE_WORKFLOW_SUGGESTION",
|
|
43
43
|
PersonalizedChatSuggestion: "PERSONALIZED_CHAT_SUGGESTION",
|
|
44
44
|
DailyDigest: "DAILY_DIGEST",
|
|
45
|
+
Podcast: "PODCAST",
|
|
45
46
|
Task: "TASK",
|
|
46
47
|
PlanMyDay: "PLAN_MY_DAY",
|
|
47
48
|
EndMyDay: "END_MY_DAY",
|
|
@@ -59,6 +60,7 @@ export const FeedRequestCategory = {
|
|
|
59
60
|
DemoCard: "DEMO_CARD",
|
|
60
61
|
OooPlanner: "OOO_PLANNER",
|
|
61
62
|
OooCatchUp: "OOO_CATCH_UP",
|
|
63
|
+
AdminHealthCenter: "ADMIN_HEALTH_CENTER",
|
|
62
64
|
} as const;
|
|
63
65
|
export type FeedRequestCategory = ClosedEnum<typeof FeedRequestCategory>;
|
|
64
66
|
|
|
@@ -40,6 +40,7 @@ export const FeedResultCategory = {
|
|
|
40
40
|
ZeroStateWorkflowSuggestion: "ZERO_STATE_WORKFLOW_SUGGESTION",
|
|
41
41
|
PersonalizedChatSuggestion: "PERSONALIZED_CHAT_SUGGESTION",
|
|
42
42
|
DailyDigest: "DAILY_DIGEST",
|
|
43
|
+
Podcast: "PODCAST",
|
|
43
44
|
Task: "TASK",
|
|
44
45
|
PlanMyDay: "PLAN_MY_DAY",
|
|
45
46
|
EndMyDay: "END_MY_DAY",
|
|
@@ -57,6 +58,7 @@ export const FeedResultCategory = {
|
|
|
57
58
|
DemoCard: "DEMO_CARD",
|
|
58
59
|
OooPlanner: "OOO_PLANNER",
|
|
59
60
|
OooCatchUp: "OOO_CATCH_UP",
|
|
61
|
+
AdminHealthCenter: "ADMIN_HEALTH_CENTER",
|
|
60
62
|
} as const;
|
|
61
63
|
/**
|
|
62
64
|
* Category of the result, one of the requested categories in incoming request.
|