@gleanwork/api-client 0.14.5 → 0.14.7
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__/authentication.test.d.ts +2 -0
- package/dist/commonjs/__tests__/authentication.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/authentication.test.js +19 -0
- package/dist/commonjs/__tests__/authentication.test.js.map +1 -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 +2 -2
- package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
- package/dist/commonjs/funcs/authenticationCheckdatasourceauth.d.ts +23 -0
- package/dist/commonjs/funcs/authenticationCheckdatasourceauth.d.ts.map +1 -0
- package/dist/commonjs/funcs/authenticationCheckdatasourceauth.js +110 -0
- package/dist/commonjs/funcs/authenticationCheckdatasourceauth.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/checkdatasourceauthresponse.d.ts +16 -0
- package/dist/commonjs/models/components/checkdatasourceauthresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/checkdatasourceauthresponse.js +51 -0
- package/dist/commonjs/models/components/checkdatasourceauthresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/unauthorizeddatasourceinstance.d.ts +1 -1
- package/dist/commonjs/react-query/authenticationCheckdatasourceauth.d.ts +33 -0
- package/dist/commonjs/react-query/authenticationCheckdatasourceauth.d.ts.map +1 -0
- package/dist/commonjs/react-query/authenticationCheckdatasourceauth.js +53 -0
- package/dist/commonjs/react-query/authenticationCheckdatasourceauth.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/authentication.d.ts +18 -0
- package/dist/commonjs/sdk/authentication.d.ts.map +1 -0
- package/dist/commonjs/sdk/authentication.js +28 -0
- package/dist/commonjs/sdk/authentication.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/__tests__/authentication.test.d.ts +2 -0
- package/dist/esm/__tests__/authentication.test.d.ts.map +1 -0
- package/dist/esm/__tests__/authentication.test.js +17 -0
- package/dist/esm/__tests__/authentication.test.js.map +1 -0
- 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 +2 -2
- package/dist/esm/__tests__/summarize.test.js.map +1 -1
- package/dist/esm/funcs/authenticationCheckdatasourceauth.d.ts +23 -0
- package/dist/esm/funcs/authenticationCheckdatasourceauth.d.ts.map +1 -0
- package/dist/esm/funcs/authenticationCheckdatasourceauth.js +74 -0
- package/dist/esm/funcs/authenticationCheckdatasourceauth.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/checkdatasourceauthresponse.d.ts +16 -0
- package/dist/esm/models/components/checkdatasourceauthresponse.d.ts.map +1 -0
- package/dist/esm/models/components/checkdatasourceauthresponse.js +14 -0
- package/dist/esm/models/components/checkdatasourceauthresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/unauthorizeddatasourceinstance.d.ts +1 -1
- package/dist/esm/react-query/authenticationCheckdatasourceauth.d.ts +33 -0
- package/dist/esm/react-query/authenticationCheckdatasourceauth.d.ts.map +1 -0
- package/dist/esm/react-query/authenticationCheckdatasourceauth.js +48 -0
- package/dist/esm/react-query/authenticationCheckdatasourceauth.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/authentication.d.ts +18 -0
- package/dist/esm/sdk/authentication.d.ts.map +1 -0
- package/dist/esm/sdk/authentication.js +24 -0
- package/dist/esm/sdk/authentication.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/authentication.test.ts +20 -0
- package/src/__tests__/messages.test.ts +1 -1
- package/src/__tests__/summarize.test.ts +2 -2
- package/src/funcs/authenticationCheckdatasourceauth.ts +148 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/checkdatasourceauthresponse.ts +42 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/unauthorizeddatasourceinstance.ts +1 -1
- package/src/react-query/authenticationCheckdatasourceauth.ts +112 -0
- package/src/react-query/index.ts +1 -0
- package/src/sdk/authentication.ts +31 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { GleanProvider, useGleanContext } from "./_context.js";
|
|
5
5
|
export * from "./_types.js";
|
|
6
|
+
export * from "./authenticationCheckdatasourceauth.js";
|
|
6
7
|
export * from "./clientActivityFeedback.js";
|
|
7
8
|
export * from "./clientActivityReport.js";
|
|
8
9
|
export * from "./clientAgentsList.js";
|
|
@@ -1 +1 @@
|
|
|
1
|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AAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as components from "../models/components/index.js";
|
|
3
|
+
export declare class Authentication extends ClientSDK {
|
|
4
|
+
/**
|
|
5
|
+
* Check datasource authorization
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Returns all datasource instances that require per-user OAuth authorization
|
|
9
|
+
* for the authenticated user, along with a transient auth token that can be
|
|
10
|
+
* appended to auth URLs to complete OAuth flows.
|
|
11
|
+
*
|
|
12
|
+
* Clients construct the full OAuth URL by combining the backend base URL,
|
|
13
|
+
* the `authUrlRelativePath` from each instance, and the transient auth token:
|
|
14
|
+
* `<backend>/<authUrlRelativePath>?transient_auth_token=<token>`.
|
|
15
|
+
*/
|
|
16
|
+
checkdatasourceauth(options?: RequestOptions): Promise<components.CheckDatasourceAuthResponse>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=authentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../../src/sdk/authentication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,cAAe,SAAQ,SAAS;IAC3C;;;;;;;;;;;OAWG;IACG,mBAAmB,CACvB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC;CAMnD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import { authenticationCheckdatasourceauth } from "../funcs/authenticationCheckdatasourceauth.js";
|
|
5
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
7
|
+
export class Authentication extends ClientSDK {
|
|
8
|
+
/**
|
|
9
|
+
* Check datasource authorization
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Returns all datasource instances that require per-user OAuth authorization
|
|
13
|
+
* for the authenticated user, along with a transient auth token that can be
|
|
14
|
+
* appended to auth URLs to complete OAuth flows.
|
|
15
|
+
*
|
|
16
|
+
* Clients construct the full OAuth URL by combining the backend base URL,
|
|
17
|
+
* the `authUrlRelativePath` from each instance, and the transient auth token:
|
|
18
|
+
* `<backend>/<authUrlRelativePath>?transient_auth_token=<token>`.
|
|
19
|
+
*/
|
|
20
|
+
async checkdatasourceauth(options) {
|
|
21
|
+
return unwrapAsync(authenticationCheckdatasourceauth(this, options));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../../src/sdk/authentication.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC3C;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,mBAAmB,CACvB,OAAwB;QAExB,OAAO,WAAW,CAAC,iCAAiC,CAClD,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/esm/sdk/sdk.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { ClientSDK } from "../lib/sdks.js";
|
|
2
|
+
import { Authentication } from "./authentication.js";
|
|
2
3
|
import { Client } from "./client.js";
|
|
3
4
|
import { Governance } from "./governance.js";
|
|
4
5
|
import { Indexing } from "./indexing.js";
|
|
5
6
|
export declare class Glean extends ClientSDK {
|
|
6
7
|
private _client?;
|
|
7
8
|
get client(): Client;
|
|
9
|
+
private _authentication?;
|
|
10
|
+
get authentication(): Authentication;
|
|
8
11
|
private _indexing?;
|
|
9
12
|
get indexing(): Indexing;
|
|
10
13
|
private _governance?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,KAAM,SAAQ,SAAS;IAClC,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,IAAI,UAAU,IAAI,UAAU,CAE3B;CACF"}
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,KAAM,SAAQ,SAAS;IAClC,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,IAAI,UAAU,IAAI,UAAU,CAE3B;CACF"}
|
package/dist/esm/sdk/sdk.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import { ClientSDK } from "../lib/sdks.js";
|
|
5
|
+
import { Authentication } from "./authentication.js";
|
|
5
6
|
import { Client } from "./client.js";
|
|
6
7
|
import { Governance } from "./governance.js";
|
|
7
8
|
import { Indexing } from "./indexing.js";
|
|
@@ -9,6 +10,9 @@ export class Glean extends ClientSDK {
|
|
|
9
10
|
get client() {
|
|
10
11
|
return (this._client ?? (this._client = new Client(this._options)));
|
|
11
12
|
}
|
|
13
|
+
get authentication() {
|
|
14
|
+
return (this._authentication ?? (this._authentication = new Authentication(this._options)));
|
|
15
|
+
}
|
|
12
16
|
get indexing() {
|
|
13
17
|
return (this._indexing ?? (this._indexing = new Indexing(this._options)));
|
|
14
18
|
}
|
package/dist/esm/sdk/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAA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cAAc;QAChB,OAAO,CAAC,IAAI,CAAC,eAAe,KAApB,IAAI,CAAC,eAAe,GAAK,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtE,CAAC;IAGD,IAAI,QAAQ;QACV,OAAO,CAAC,IAAI,CAAC,SAAS,KAAd,IAAI,CAAC,SAAS,GAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1D,CAAC;IAGD,IAAI,UAAU;QACZ,OAAO,CAAC,IAAI,CAAC,WAAW,KAAhB,IAAI,CAAC,WAAW,GAAK,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC9D,CAAC;CACF"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { expect, test } from "vitest";
|
|
6
|
+
import { Glean } from "../index.js";
|
|
7
|
+
import { createTestHTTPClient } from "./testclient.js";
|
|
8
|
+
|
|
9
|
+
test("Authentication Checkdatasourceauth", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("checkdatasourceauth");
|
|
11
|
+
|
|
12
|
+
const glean = new Glean({
|
|
13
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
14
|
+
httpClient: testHttpClient,
|
|
15
|
+
apiToken: process.env["GLEAN_API_TOKEN"] ?? "value",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const result = await glean.authentication.checkdatasourceauth();
|
|
19
|
+
expect(result).toBeDefined();
|
|
20
|
+
});
|
|
@@ -18,10 +18,10 @@ test("Summarize Summarize", async () => {
|
|
|
18
18
|
const result = await glean.client.documents.summarize({
|
|
19
19
|
documentSpecs: [
|
|
20
20
|
{
|
|
21
|
-
url: "https://
|
|
21
|
+
url: "https://educated-laughter.info/",
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
24
|
+
url: "https://educated-laughter.info/",
|
|
25
25
|
},
|
|
26
26
|
],
|
|
27
27
|
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GleanCore } from "../core.js";
|
|
6
|
+
import * as M from "../lib/matchers.js";
|
|
7
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
9
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
10
|
+
import { pathToFunc } from "../lib/url.js";
|
|
11
|
+
import * as components from "../models/components/index.js";
|
|
12
|
+
import { GleanBaseError } from "../models/errors/gleanbaseerror.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check datasource authorization
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Returns all datasource instances that require per-user OAuth authorization
|
|
30
|
+
* for the authenticated user, along with a transient auth token that can be
|
|
31
|
+
* appended to auth URLs to complete OAuth flows.
|
|
32
|
+
*
|
|
33
|
+
* Clients construct the full OAuth URL by combining the backend base URL,
|
|
34
|
+
* the `authUrlRelativePath` from each instance, and the transient auth token:
|
|
35
|
+
* `<backend>/<authUrlRelativePath>?transient_auth_token=<token>`.
|
|
36
|
+
*/
|
|
37
|
+
export function authenticationCheckdatasourceauth(
|
|
38
|
+
client: GleanCore,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
components.CheckDatasourceAuthResponse,
|
|
43
|
+
| GleanBaseError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: GleanCore,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
components.CheckDatasourceAuthResponse,
|
|
66
|
+
| GleanBaseError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const path = pathToFunc("/rest/api/v1/checkdatasourceauth")();
|
|
79
|
+
|
|
80
|
+
const headers = new Headers(compactMap({
|
|
81
|
+
Accept: "application/json",
|
|
82
|
+
}));
|
|
83
|
+
|
|
84
|
+
const secConfig = await extractSecurity(client._options.apiToken);
|
|
85
|
+
const securityInput = secConfig == null ? {} : { apiToken: secConfig };
|
|
86
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
87
|
+
|
|
88
|
+
const context = {
|
|
89
|
+
options: client._options,
|
|
90
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
91
|
+
operationID: "checkdatasourceauth",
|
|
92
|
+
oAuth2Scopes: null,
|
|
93
|
+
|
|
94
|
+
resolvedSecurity: requestSecurity,
|
|
95
|
+
|
|
96
|
+
securitySource: client._options.apiToken,
|
|
97
|
+
retryConfig: options?.retries
|
|
98
|
+
|| client._options.retryConfig
|
|
99
|
+
|| { strategy: "none" },
|
|
100
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const requestRes = client._createRequest(context, {
|
|
104
|
+
security: requestSecurity,
|
|
105
|
+
method: "POST",
|
|
106
|
+
baseURL: options?.serverURL,
|
|
107
|
+
path: path,
|
|
108
|
+
headers: headers,
|
|
109
|
+
userAgent: client._options.userAgent,
|
|
110
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
111
|
+
}, options);
|
|
112
|
+
if (!requestRes.ok) {
|
|
113
|
+
return [requestRes, { status: "invalid" }];
|
|
114
|
+
}
|
|
115
|
+
const req = requestRes.value;
|
|
116
|
+
|
|
117
|
+
const doResult = await client._do(req, {
|
|
118
|
+
context,
|
|
119
|
+
errorCodes: ["401", "429", "4XX", "5XX"],
|
|
120
|
+
retryConfig: context.retryConfig,
|
|
121
|
+
retryCodes: context.retryCodes,
|
|
122
|
+
});
|
|
123
|
+
if (!doResult.ok) {
|
|
124
|
+
return [doResult, { status: "request-error", request: req }];
|
|
125
|
+
}
|
|
126
|
+
const response = doResult.value;
|
|
127
|
+
|
|
128
|
+
const [result] = await M.match<
|
|
129
|
+
components.CheckDatasourceAuthResponse,
|
|
130
|
+
| GleanBaseError
|
|
131
|
+
| ResponseValidationError
|
|
132
|
+
| ConnectionError
|
|
133
|
+
| RequestAbortedError
|
|
134
|
+
| RequestTimeoutError
|
|
135
|
+
| InvalidRequestError
|
|
136
|
+
| UnexpectedClientError
|
|
137
|
+
| SDKValidationError
|
|
138
|
+
>(
|
|
139
|
+
M.json(200, components.CheckDatasourceAuthResponse$inboundSchema),
|
|
140
|
+
M.fail([401, 429, "4XX"]),
|
|
141
|
+
M.fail("5XX"),
|
|
142
|
+
)(response, req);
|
|
143
|
+
if (!result.ok) {
|
|
144
|
+
return [result, { status: "complete", request: req, response }];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return [result, { status: "complete", request: req, response }];
|
|
148
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -68,8 +68,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
68
68
|
export const SDK_METADATA = {
|
|
69
69
|
language: "typescript",
|
|
70
70
|
openapiDocVersion: "0.9.0",
|
|
71
|
-
sdkVersion: "0.14.
|
|
72
|
-
genVersion: "2.
|
|
71
|
+
sdkVersion: "0.14.7",
|
|
72
|
+
genVersion: "2.832.9",
|
|
73
73
|
userAgent:
|
|
74
|
-
"speakeasy-sdk/typescript 0.14.
|
|
74
|
+
"speakeasy-sdk/typescript 0.14.7 2.832.9 0.9.0 @gleanwork/api-client",
|
|
75
75
|
} as const;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
UnauthorizedDatasourceInstance,
|
|
11
|
+
UnauthorizedDatasourceInstance$inboundSchema,
|
|
12
|
+
} from "./unauthorizeddatasourceinstance.js";
|
|
13
|
+
|
|
14
|
+
export type CheckDatasourceAuthResponse = {
|
|
15
|
+
/**
|
|
16
|
+
* Datasource instances that require per-user OAuth authorization. Empty when all datasources are authorized.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
*/
|
|
20
|
+
unauthorizedDatasourceInstances: Array<UnauthorizedDatasourceInstance>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const CheckDatasourceAuthResponse$inboundSchema: z.ZodType<
|
|
25
|
+
CheckDatasourceAuthResponse,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
unauthorizedDatasourceInstances: z.array(
|
|
30
|
+
UnauthorizedDatasourceInstance$inboundSchema,
|
|
31
|
+
),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function checkDatasourceAuthResponseFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<CheckDatasourceAuthResponse, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => CheckDatasourceAuthResponse$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'CheckDatasourceAuthResponse' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -68,6 +68,7 @@ export * from "./chatrestrictionfilters.js";
|
|
|
68
68
|
export * from "./chatresult.js";
|
|
69
69
|
export * from "./chatsuggestion.js";
|
|
70
70
|
export * from "./chatzerostatesuggestionoptions.js";
|
|
71
|
+
export * from "./checkdatasourceauthresponse.js";
|
|
71
72
|
export * from "./checkdocumentaccessrequest.js";
|
|
72
73
|
export * from "./checkdocumentaccessresponse.js";
|
|
73
74
|
export * from "./clustergroup.js";
|
|
@@ -29,7 +29,7 @@ export type UnauthorizedDatasourceInstance = {
|
|
|
29
29
|
*/
|
|
30
30
|
authStatus?: AuthStatus | undefined;
|
|
31
31
|
/**
|
|
32
|
-
* Relative path to initiate or resume OAuth for the current user and instance. Clients should prepend their configured Glean backend base URL.
|
|
32
|
+
* Relative path to initiate or resume OAuth for the current user and instance, including a one-time authentication token as a query parameter. Clients should prepend their configured Glean backend base URL.
|
|
33
33
|
*
|
|
34
34
|
* @remarks
|
|
35
35
|
*/
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GleanCore } from "../core.js";
|
|
11
|
+
import { authenticationCheckdatasourceauth } from "../funcs/authenticationCheckdatasourceauth.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import { GleanBaseError } from "../models/errors/gleanbaseerror.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
26
|
+
import { useGleanContext } from "./_context.js";
|
|
27
|
+
import { MutationHookOptions } from "./_types.js";
|
|
28
|
+
|
|
29
|
+
export type AuthenticationCheckdatasourceauthMutationVariables = {
|
|
30
|
+
options?: RequestOptions;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type AuthenticationCheckdatasourceauthMutationData =
|
|
34
|
+
components.CheckDatasourceAuthResponse;
|
|
35
|
+
|
|
36
|
+
export type AuthenticationCheckdatasourceauthMutationError =
|
|
37
|
+
| GleanBaseError
|
|
38
|
+
| ResponseValidationError
|
|
39
|
+
| ConnectionError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| SDKValidationError;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Check datasource authorization
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Returns all datasource instances that require per-user OAuth authorization
|
|
51
|
+
* for the authenticated user, along with a transient auth token that can be
|
|
52
|
+
* appended to auth URLs to complete OAuth flows.
|
|
53
|
+
*
|
|
54
|
+
* Clients construct the full OAuth URL by combining the backend base URL,
|
|
55
|
+
* the `authUrlRelativePath` from each instance, and the transient auth token:
|
|
56
|
+
* `<backend>/<authUrlRelativePath>?transient_auth_token=<token>`.
|
|
57
|
+
*/
|
|
58
|
+
export function useAuthenticationCheckdatasourceauthMutation(
|
|
59
|
+
options?: MutationHookOptions<
|
|
60
|
+
AuthenticationCheckdatasourceauthMutationData,
|
|
61
|
+
AuthenticationCheckdatasourceauthMutationError,
|
|
62
|
+
AuthenticationCheckdatasourceauthMutationVariables
|
|
63
|
+
>,
|
|
64
|
+
): UseMutationResult<
|
|
65
|
+
AuthenticationCheckdatasourceauthMutationData,
|
|
66
|
+
AuthenticationCheckdatasourceauthMutationError,
|
|
67
|
+
AuthenticationCheckdatasourceauthMutationVariables
|
|
68
|
+
> {
|
|
69
|
+
const client = useGleanContext();
|
|
70
|
+
return useMutation({
|
|
71
|
+
...buildAuthenticationCheckdatasourceauthMutation(client, options),
|
|
72
|
+
...options,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function mutationKeyAuthenticationCheckdatasourceauth(): MutationKey {
|
|
77
|
+
return ["@gleanwork/api-client", "Authentication", "checkdatasourceauth"];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function buildAuthenticationCheckdatasourceauthMutation(
|
|
81
|
+
client$: GleanCore,
|
|
82
|
+
hookOptions?: RequestOptions,
|
|
83
|
+
): {
|
|
84
|
+
mutationKey: MutationKey;
|
|
85
|
+
mutationFn: (
|
|
86
|
+
variables: AuthenticationCheckdatasourceauthMutationVariables,
|
|
87
|
+
) => Promise<AuthenticationCheckdatasourceauthMutationData>;
|
|
88
|
+
} {
|
|
89
|
+
return {
|
|
90
|
+
mutationKey: mutationKeyAuthenticationCheckdatasourceauth(),
|
|
91
|
+
mutationFn: function authenticationCheckdatasourceauthMutationFn({
|
|
92
|
+
options,
|
|
93
|
+
}): Promise<AuthenticationCheckdatasourceauthMutationData> {
|
|
94
|
+
const mergedOptions = {
|
|
95
|
+
...hookOptions,
|
|
96
|
+
...options,
|
|
97
|
+
fetchOptions: {
|
|
98
|
+
...hookOptions?.fetchOptions,
|
|
99
|
+
...options?.fetchOptions,
|
|
100
|
+
signal: combineSignals(
|
|
101
|
+
hookOptions?.fetchOptions?.signal,
|
|
102
|
+
options?.fetchOptions?.signal,
|
|
103
|
+
),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
return unwrapAsync(authenticationCheckdatasourceauth(
|
|
107
|
+
client$,
|
|
108
|
+
mergedOptions,
|
|
109
|
+
));
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export { GleanProvider, useGleanContext } from "./_context.js";
|
|
6
6
|
export * from "./_types.js";
|
|
7
7
|
|
|
8
|
+
export * from "./authenticationCheckdatasourceauth.js";
|
|
8
9
|
export * from "./clientActivityFeedback.js";
|
|
9
10
|
export * from "./clientActivityReport.js";
|
|
10
11
|
export * from "./clientAgentsList.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { authenticationCheckdatasourceauth } from "../funcs/authenticationCheckdatasourceauth.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as components from "../models/components/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export class Authentication extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Check datasource authorization
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Returns all datasource instances that require per-user OAuth authorization
|
|
16
|
+
* for the authenticated user, along with a transient auth token that can be
|
|
17
|
+
* appended to auth URLs to complete OAuth flows.
|
|
18
|
+
*
|
|
19
|
+
* Clients construct the full OAuth URL by combining the backend base URL,
|
|
20
|
+
* the `authUrlRelativePath` from each instance, and the transient auth token:
|
|
21
|
+
* `<backend>/<authUrlRelativePath>?transient_auth_token=<token>`.
|
|
22
|
+
*/
|
|
23
|
+
async checkdatasourceauth(
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): Promise<components.CheckDatasourceAuthResponse> {
|
|
26
|
+
return unwrapAsync(authenticationCheckdatasourceauth(
|
|
27
|
+
this,
|
|
28
|
+
options,
|
|
29
|
+
));
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
+
import { Authentication } from "./authentication.js";
|
|
6
7
|
import { Client } from "./client.js";
|
|
7
8
|
import { Governance } from "./governance.js";
|
|
8
9
|
import { Indexing } from "./indexing.js";
|
|
@@ -13,6 +14,11 @@ export class Glean extends ClientSDK {
|
|
|
13
14
|
return (this._client ??= new Client(this._options));
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
private _authentication?: Authentication;
|
|
18
|
+
get authentication(): Authentication {
|
|
19
|
+
return (this._authentication ??= new Authentication(this._options));
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
private _indexing?: Indexing;
|
|
17
23
|
get indexing(): Indexing {
|
|
18
24
|
return (this._indexing ??= new Indexing(this._options));
|