@keboola/api-client 12.0.0 → 13.0.0
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/API-SURFACE.md +25 -1
- package/dist/ai/index.d.cts +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/types.d.cts +2 -2
- package/dist/ai/types.d.ts +2 -2
- package/dist/auth/index.cjs +13 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +142 -0
- package/dist/auth/index.d.ts +142 -0
- package/dist/auth/index.js +4 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/types.cjs +4 -0
- package/dist/auth/types.cjs.map +1 -0
- package/dist/auth/types.d.cts +2 -0
- package/dist/auth/types.d.ts +2 -0
- package/dist/auth/types.js +3 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/chat/index.d.cts +7 -2
- package/dist/chat/index.d.ts +7 -2
- package/dist/chat/types.d.cts +2 -2
- package/dist/chat/types.d.ts +2 -2
- package/dist/chunk-I3VK6VQT.js +113 -0
- package/dist/chunk-I3VK6VQT.js.map +1 -0
- package/dist/chunk-IL5MYBXL.cjs +115 -0
- package/dist/chunk-IL5MYBXL.cjs.map +1 -0
- package/dist/{createOpenapiFetchClient-CKNLT4ND.d.cts → createOpenapiFetchClient-DIsEiRUz.d.cts} +1 -1
- package/dist/{createOpenapiFetchClient-B50N1zkV.d.ts → createOpenapiFetchClient-Oi-KX-f-.d.ts} +1 -1
- package/dist/dataScience/index.d.cts +3 -3
- package/dist/dataScience/index.d.ts +3 -3
- package/dist/dataScience/types.d.cts +2 -2
- package/dist/dataScience/types.d.ts +2 -2
- package/dist/domain/permissions/index.d.cts +3 -3
- package/dist/domain/permissions/index.d.ts +3 -3
- package/dist/editor/index.d.cts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/types.d.cts +2 -2
- package/dist/editor/types.d.ts +2 -2
- package/dist/encryption/index.d.cts +2 -2
- package/dist/encryption/index.d.ts +2 -2
- package/dist/encryption/types.d.cts +2 -2
- package/dist/encryption/types.d.ts +2 -2
- package/dist/index.cjs +20 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +200 -60
- package/dist/index.d.ts +200 -60
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/management/index.d.cts +2 -2
- package/dist/management/index.d.ts +2 -2
- package/dist/metastore/index.d.cts +3 -3
- package/dist/metastore/index.d.ts +3 -3
- package/dist/metastore/types.d.cts +2 -2
- package/dist/metastore/types.d.ts +2 -2
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/types.d.cts +2 -2
- package/dist/notifications/types.d.ts +2 -2
- package/dist/{project-BxSa1Ci9.d.ts → project-D9FCXphc.d.ts} +1 -1
- package/dist/{project-NJuUPx8-.d.cts → project-DWdvh1ev.d.cts} +1 -1
- package/dist/queryService/index.d.cts +2 -2
- package/dist/queryService/index.d.ts +2 -2
- package/dist/queryService/types.d.cts +2 -2
- package/dist/queryService/types.d.ts +2 -2
- package/dist/queue/index.d.cts +2 -2
- package/dist/queue/index.d.ts +2 -2
- package/dist/queue/types.d.cts +2 -2
- package/dist/queue/types.d.ts +2 -2
- package/dist/scheduler/index.d.cts +1 -1
- package/dist/scheduler/index.d.ts +1 -1
- package/dist/scheduler/types.d.cts +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/sdk/configurations/index.d.cts +5 -5
- package/dist/sdk/configurations/index.d.ts +5 -5
- package/dist/sdk/storage/index.d.cts +5 -5
- package/dist/sdk/storage/index.d.ts +5 -5
- package/dist/sdk/tag/index.d.cts +3 -3
- package/dist/sdk/tag/index.d.ts +3 -3
- package/dist/sdk/tag/types.d.cts +3 -3
- package/dist/sdk/tag/types.d.ts +3 -3
- package/dist/sdk/vault/index.d.cts +3 -3
- package/dist/sdk/vault/index.d.ts +3 -3
- package/dist/storage/index.d.cts +4 -4
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/types.d.cts +5 -5
- package/dist/storage/types.d.ts +5 -5
- package/dist/{storageClient-Bk4H2HIw.d.ts → storageClient-Bm2xAtWJ.d.ts} +26 -26
- package/dist/{storageClient-CB4U57Pr.d.cts → storageClient-CeLEkQNI.d.cts} +26 -26
- package/dist/{storageSdk-BDrsuMDA.d.ts → storageSdk-CBM85gUk.d.cts} +20 -20
- package/dist/{storageSdk-wn97Zloc.d.cts → storageSdk-Db1TowTM.d.ts} +20 -20
- package/dist/stream/index.d.cts +2 -2
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/types.d.cts +2 -2
- package/dist/stream/types.d.ts +2 -2
- package/dist/syncActions/index.d.cts +2 -2
- package/dist/syncActions/index.d.ts +2 -2
- package/dist/syncActions/types.d.cts +1 -1
- package/dist/syncActions/types.d.ts +1 -1
- package/dist/{types-yKV1EX6f.d.ts → types-5hVwJbZy.d.ts} +1 -1
- package/dist/{types-DTkxk0fW.d.cts → types-BMHNYi_B.d.cts} +1 -1
- package/dist/{types-CWebeQXy.d.cts → types-BavhR4tO.d.cts} +1 -1
- package/dist/{types-D9cNOf-3.d.cts → types-BiylbcWm.d.cts} +1 -1
- package/dist/types-BsA3W6Mo.d.cts +1786 -0
- package/dist/{types-DsqDUWJn.d.cts → types-BsIu3NSe.d.cts} +1 -1
- package/dist/types-CBYDpcI1.d.ts +1786 -0
- package/dist/{types-BVldT2vs.d.cts → types-CD0r-1MV.d.cts} +1 -1
- package/dist/{types-CvHPHNH0.d.cts → types-CaoEwPpD.d.cts} +1 -1
- package/dist/{types-BxjcUj-y.d.cts → types-Coaofyh9.d.cts} +1 -1
- package/dist/{types-GmAeMsok.d.ts → types-Ct6wJf9k.d.ts} +1 -1
- package/dist/{types-CS8MYc2k.d.ts → types-CyQJ4AXd.d.ts} +1 -1
- package/dist/{types-DFWnAftN.d.cts → types-DHA8WCNr.d.ts} +1 -1
- package/dist/{types-D64zThBJ.d.ts → types-DLUrR6Xu.d.ts} +1 -1
- package/dist/{types-CFd7q2ed.d.ts → types-DLWBh7iV.d.ts} +1 -1
- package/dist/{types-CMEwVQ78.d.cts → types-DclddzzB.d.cts} +1 -1
- package/dist/{types-Bc-H4gfv.d.cts → types-QLM97gSa.d.cts} +7 -1
- package/dist/{types-JvKRS8Qd.d.ts → types-R6KVJSvx.d.ts} +7 -1
- package/dist/{types-D3Kkh6yW.d.ts → types-_uKmxlZr.d.ts} +1 -1
- package/dist/{types-jKnx7Tm_.d.cts → types-auVqO7UT.d.cts} +1 -1
- package/dist/{types-jKnx7Tm_.d.ts → types-auVqO7UT.d.ts} +1 -1
- package/dist/{types-Dv3vN7M9.d.ts → types-kPz1WIPX.d.cts} +1 -1
- package/dist/{types-Mghz1gMD.d.ts → types-njJEULW3.d.ts} +1 -1
- package/dist/{types-DacFMc6L.d.ts → types-rgoWljL8.d.ts} +1 -1
- package/dist/{utils-Cl4emy8g.d.ts → utils-BcMjZotB.d.ts} +1 -1
- package/dist/{utils-JsCYFmHj.d.cts → utils-IEMDjlU4.d.cts} +1 -1
- package/dist/vault/index.d.cts +1 -1
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/types.d.cts +1 -1
- package/dist/vault/types.d.ts +1 -1
- package/dist/verify/index.d.cts +2 -2
- package/dist/verify/index.d.ts +2 -2
- package/package.json +30 -4
- package/surface/auth.md +27 -0
- package/surface/chat.md +1 -1
package/API-SURFACE.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Every namespace and method reachable from an initialized `ApiClient` (`createApiClient()` after `init()`, or `useApiClient()`). Generated from the TypeScript type checker — see `scripts/gen-surface.mjs`.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
23 top-level namespaces, 436 methods. This index lists method **names** only — full signatures live per namespace under [`surface/`](./surface). Open `surface/<namespace>.md` for the one you need.
|
|
8
8
|
|
|
9
9
|
## [`api.ai`](./surface/ai.md)
|
|
10
10
|
|
|
@@ -21,6 +21,30 @@ Every namespace and method reachable from an initialized `ApiClient` (`createApi
|
|
|
21
21
|
|
|
22
22
|
- `getPublishedChangelogPosts`
|
|
23
23
|
|
|
24
|
+
## [`api.auth`](./surface/auth.md)
|
|
25
|
+
|
|
26
|
+
- `approveDeviceAuthorization`
|
|
27
|
+
- `assertSaml`
|
|
28
|
+
- `createDeviceAuthorization`
|
|
29
|
+
- `createPat`
|
|
30
|
+
- `createSudoChallenge`
|
|
31
|
+
- `exchangePat`
|
|
32
|
+
- `getDeviceAuthorizationToken`
|
|
33
|
+
- `getPkceToken`
|
|
34
|
+
- `initiateSaml`
|
|
35
|
+
- `introspectToken`
|
|
36
|
+
- `listPats`
|
|
37
|
+
- `listSessions`
|
|
38
|
+
- `login`
|
|
39
|
+
- `refreshToken`
|
|
40
|
+
- `regenerateRecoveryCodes`
|
|
41
|
+
- `revokeAllSessions`
|
|
42
|
+
- `revokePat`
|
|
43
|
+
- `revokeSession`
|
|
44
|
+
- `revokeToken`
|
|
45
|
+
- `sudo`
|
|
46
|
+
- `verifyMfa`
|
|
47
|
+
|
|
24
48
|
## [`api.chat`](./surface/chat.md)
|
|
25
49
|
|
|
26
50
|
- `createChat`
|
package/dist/ai/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DescribeConfigurationVersionBody, a as DescribeConfigurationMergeBody, E as ExplainErrorBody, b as DescribeConfigurationBody, S as SuggestComponentBody, c as components, F as FeedbackBody, d as DocsQuestionBody } from '../types-
|
|
1
|
+
import { D as DescribeConfigurationVersionBody, a as DescribeConfigurationMergeBody, E as ExplainErrorBody, b as DescribeConfigurationBody, S as SuggestComponentBody, c as components, F as FeedbackBody, d as DocsQuestionBody } from '../types-CaoEwPpD.cjs';
|
|
2
2
|
import { C as ClientInitOptions } from '../types-BLJoO6YL.cjs';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-auVqO7UT.cjs';
|
|
4
4
|
import 'qs';
|
|
5
5
|
|
|
6
6
|
declare const createAiClient: ({ baseUrl, middlewares, token }: ClientInitOptions) => {
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DescribeConfigurationVersionBody, a as DescribeConfigurationMergeBody, E as ExplainErrorBody, b as DescribeConfigurationBody, S as SuggestComponentBody, c as components, F as FeedbackBody, d as DocsQuestionBody } from '../types-
|
|
1
|
+
import { D as DescribeConfigurationVersionBody, a as DescribeConfigurationMergeBody, E as ExplainErrorBody, b as DescribeConfigurationBody, S as SuggestComponentBody, c as components, F as FeedbackBody, d as DocsQuestionBody } from '../types-_uKmxlZr.js';
|
|
2
2
|
import { C as ClientInitOptions } from '../types-BLJoO6YL.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-auVqO7UT.js';
|
|
4
4
|
import 'qs';
|
|
5
5
|
|
|
6
6
|
declare const createAiClient: ({ baseUrl, middlewares, token }: ClientInitOptions) => {
|
package/dist/ai/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../types-
|
|
2
|
-
export { C as ComponentDocsDetail, e as ComponentSuggestion, b as DescribeConfigurationBody, a as DescribeConfigurationMergeBody, D as DescribeConfigurationVersionBody, f as DocsAnswer, d as DocsQuestionBody, g as ErrorExplanation, E as ExplainErrorBody, F as FeedbackBody, O as ObjectDescription, S as SuggestComponentBody } from '../types-
|
|
1
|
+
import '../types-auVqO7UT.cjs';
|
|
2
|
+
export { C as ComponentDocsDetail, e as ComponentSuggestion, b as DescribeConfigurationBody, a as DescribeConfigurationMergeBody, D as DescribeConfigurationVersionBody, f as DocsAnswer, d as DocsQuestionBody, g as ErrorExplanation, E as ExplainErrorBody, F as FeedbackBody, O as ObjectDescription, S as SuggestComponentBody } from '../types-CaoEwPpD.cjs';
|
package/dist/ai/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../types-
|
|
2
|
-
export { C as ComponentDocsDetail, e as ComponentSuggestion, b as DescribeConfigurationBody, a as DescribeConfigurationMergeBody, D as DescribeConfigurationVersionBody, f as DocsAnswer, d as DocsQuestionBody, g as ErrorExplanation, E as ExplainErrorBody, F as FeedbackBody, O as ObjectDescription, S as SuggestComponentBody } from '../types-
|
|
1
|
+
import '../types-auVqO7UT.js';
|
|
2
|
+
export { C as ComponentDocsDetail, e as ComponentSuggestion, b as DescribeConfigurationBody, a as DescribeConfigurationMergeBody, D as DescribeConfigurationVersionBody, f as DocsAnswer, d as DocsQuestionBody, g as ErrorExplanation, E as ExplainErrorBody, F as FeedbackBody, O as ObjectDescription, S as SuggestComponentBody } from '../types-_uKmxlZr.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkIL5MYBXL_cjs = require('../chunk-IL5MYBXL.cjs');
|
|
4
|
+
require('../chunk-OWGJ3PVA.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "createAuthClient", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkIL5MYBXL_cjs.createAuthClient; }
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=index.cjs.map
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { L as LoginBody, c as components, V as VerifyMfaBody, S as SudoBody, A as AssertSamlBody, I as InitiateSamlBody, C as CreateDeviceAuthorizationBody, a as ApproveDeviceAuthorizationBody, G as GetDeviceAuthorizationTokenBody, b as GetPkceTokenBody, d as CreatePatBody, E as ExchangePatBody, R as RevokePatPath, e as RevokeSessionPath, f as RefreshTokenBody, g as RevokeTokenBody } from '../types-BsA3W6Mo.cjs';
|
|
2
|
+
import { C as ClientInitOptions } from '../types-BLJoO6YL.cjs';
|
|
3
|
+
import '../types-auVqO7UT.cjs';
|
|
4
|
+
import 'qs';
|
|
5
|
+
|
|
6
|
+
type AuthClientInitOptions = Omit<ClientInitOptions, 'token'>;
|
|
7
|
+
declare const createAuthClient: ({ baseUrl, middlewares }: AuthClientInitOptions) => {
|
|
8
|
+
login: (body: LoginBody, signal?: AbortSignal) => Promise<{
|
|
9
|
+
accessToken: string;
|
|
10
|
+
refreshToken: string;
|
|
11
|
+
tokenType: string;
|
|
12
|
+
expiresIn: number;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
15
|
+
} | {
|
|
16
|
+
mfaRequired: boolean;
|
|
17
|
+
mfaType: string;
|
|
18
|
+
mfaToken: string;
|
|
19
|
+
expiresIn: number;
|
|
20
|
+
allowedMethods: string[];
|
|
21
|
+
webauthn: Record<string, never> | null;
|
|
22
|
+
}>;
|
|
23
|
+
verifyMfa: (body: VerifyMfaBody, signal?: AbortSignal) => Promise<{
|
|
24
|
+
accessToken: string;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
tokenType: string;
|
|
27
|
+
expiresIn: number;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
30
|
+
}>;
|
|
31
|
+
regenerateRecoveryCodes: (signal?: AbortSignal) => Promise<{
|
|
32
|
+
codes: string[];
|
|
33
|
+
}>;
|
|
34
|
+
sudo: (body: SudoBody, signal?: AbortSignal) => Promise<{
|
|
35
|
+
sudoVerified: boolean;
|
|
36
|
+
sudoExpiresAt: string;
|
|
37
|
+
sudoTimeoutSeconds: number;
|
|
38
|
+
}>;
|
|
39
|
+
createSudoChallenge: (signal?: AbortSignal) => Promise<{
|
|
40
|
+
challengeToken: string;
|
|
41
|
+
options: Record<string, never>;
|
|
42
|
+
expiresIn: number;
|
|
43
|
+
}>;
|
|
44
|
+
assertSaml: (body: AssertSamlBody, signal?: AbortSignal) => Promise<{
|
|
45
|
+
accessToken: string;
|
|
46
|
+
refreshToken: string;
|
|
47
|
+
tokenType: string;
|
|
48
|
+
expiresIn: number;
|
|
49
|
+
sessionId: string;
|
|
50
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
51
|
+
} | {
|
|
52
|
+
mfaRequired: boolean;
|
|
53
|
+
mfaType: string;
|
|
54
|
+
mfaToken: string;
|
|
55
|
+
expiresIn: number;
|
|
56
|
+
allowedMethods: string[];
|
|
57
|
+
webauthn: Record<string, never> | null;
|
|
58
|
+
}>;
|
|
59
|
+
initiateSaml: (body?: InitiateSamlBody, signal?: AbortSignal) => Promise<{
|
|
60
|
+
ssoUrl: string;
|
|
61
|
+
requestHandle: string;
|
|
62
|
+
expiresIn: number;
|
|
63
|
+
}>;
|
|
64
|
+
createDeviceAuthorization: (body: CreateDeviceAuthorizationBody, signal?: AbortSignal) => Promise<{
|
|
65
|
+
deviceCode: string;
|
|
66
|
+
userCode: string;
|
|
67
|
+
verificationUri: string;
|
|
68
|
+
verificationUriComplete: string;
|
|
69
|
+
expiresIn: number;
|
|
70
|
+
interval: number;
|
|
71
|
+
}>;
|
|
72
|
+
approveDeviceAuthorization: (body: ApproveDeviceAuthorizationBody, signal?: AbortSignal) => Promise<{
|
|
73
|
+
status: "approved" | "denied";
|
|
74
|
+
idempotent: boolean;
|
|
75
|
+
decision: components["schemas"]["DeviceApprovalDecision"];
|
|
76
|
+
}>;
|
|
77
|
+
getDeviceAuthorizationToken: (body: GetDeviceAuthorizationTokenBody, signal?: AbortSignal) => Promise<{
|
|
78
|
+
accessToken: string;
|
|
79
|
+
refreshToken: string;
|
|
80
|
+
tokenType: string;
|
|
81
|
+
expiresIn: number;
|
|
82
|
+
sessionId: string;
|
|
83
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
84
|
+
}>;
|
|
85
|
+
getPkceToken: (body: GetPkceTokenBody, signal?: AbortSignal) => Promise<{
|
|
86
|
+
accessToken: string;
|
|
87
|
+
refreshToken: string;
|
|
88
|
+
tokenType: string;
|
|
89
|
+
expiresIn: number;
|
|
90
|
+
sessionId: string;
|
|
91
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
92
|
+
}>;
|
|
93
|
+
listPats: (signal?: AbortSignal) => Promise<{
|
|
94
|
+
items: components["schemas"]["PatItemResponse"][];
|
|
95
|
+
}>;
|
|
96
|
+
createPat: (body: CreatePatBody, signal?: AbortSignal) => Promise<{
|
|
97
|
+
accessToken: string;
|
|
98
|
+
tokenType: string;
|
|
99
|
+
expiresIn: number;
|
|
100
|
+
pat: components["schemas"]["PatItemResponse"];
|
|
101
|
+
}>;
|
|
102
|
+
exchangePat: (body?: ExchangePatBody, signal?: AbortSignal) => Promise<{
|
|
103
|
+
accessToken: string;
|
|
104
|
+
tokenType: string;
|
|
105
|
+
expiresIn: number;
|
|
106
|
+
scope: Record<string, never>;
|
|
107
|
+
readOnly: boolean;
|
|
108
|
+
parentTokenId: string;
|
|
109
|
+
parentTokenType: "session" | "pat";
|
|
110
|
+
expiresAt: string;
|
|
111
|
+
pat: components["schemas"]["PatItemResponse"];
|
|
112
|
+
}>;
|
|
113
|
+
revokePat: (id: RevokePatPath["id"], signal?: AbortSignal) => Promise<void>;
|
|
114
|
+
listSessions: (signal?: AbortSignal) => Promise<{
|
|
115
|
+
sessions?: components["schemas"]["SessionItemResponse"][];
|
|
116
|
+
}>;
|
|
117
|
+
revokeAllSessions: (signal?: AbortSignal) => Promise<void>;
|
|
118
|
+
revokeSession: (sessionId: RevokeSessionPath["sessionId"], signal?: AbortSignal) => Promise<void>;
|
|
119
|
+
introspectToken: (signal?: AbortSignal) => Promise<{
|
|
120
|
+
sessionId: string;
|
|
121
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
122
|
+
grantType: string;
|
|
123
|
+
sudoVerified: boolean;
|
|
124
|
+
createdAt: string;
|
|
125
|
+
expiresAt: string;
|
|
126
|
+
lastUsedAt?: string | null;
|
|
127
|
+
lastUsedIp?: string | null;
|
|
128
|
+
userAgent?: string | null;
|
|
129
|
+
projects: components["schemas"]["ProjectAccessItem"][];
|
|
130
|
+
}>;
|
|
131
|
+
refreshToken: (body: RefreshTokenBody, signal?: AbortSignal) => Promise<{
|
|
132
|
+
accessToken: string;
|
|
133
|
+
refreshToken: string;
|
|
134
|
+
tokenType: string;
|
|
135
|
+
expiresIn: number;
|
|
136
|
+
sessionId: string;
|
|
137
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
138
|
+
}>;
|
|
139
|
+
revokeToken: (body: RevokeTokenBody, signal?: AbortSignal) => Promise<void>;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export { type AuthClientInitOptions, createAuthClient };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { L as LoginBody, c as components, V as VerifyMfaBody, S as SudoBody, A as AssertSamlBody, I as InitiateSamlBody, C as CreateDeviceAuthorizationBody, a as ApproveDeviceAuthorizationBody, G as GetDeviceAuthorizationTokenBody, b as GetPkceTokenBody, d as CreatePatBody, E as ExchangePatBody, R as RevokePatPath, e as RevokeSessionPath, f as RefreshTokenBody, g as RevokeTokenBody } from '../types-CBYDpcI1.js';
|
|
2
|
+
import { C as ClientInitOptions } from '../types-BLJoO6YL.js';
|
|
3
|
+
import '../types-auVqO7UT.js';
|
|
4
|
+
import 'qs';
|
|
5
|
+
|
|
6
|
+
type AuthClientInitOptions = Omit<ClientInitOptions, 'token'>;
|
|
7
|
+
declare const createAuthClient: ({ baseUrl, middlewares }: AuthClientInitOptions) => {
|
|
8
|
+
login: (body: LoginBody, signal?: AbortSignal) => Promise<{
|
|
9
|
+
accessToken: string;
|
|
10
|
+
refreshToken: string;
|
|
11
|
+
tokenType: string;
|
|
12
|
+
expiresIn: number;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
15
|
+
} | {
|
|
16
|
+
mfaRequired: boolean;
|
|
17
|
+
mfaType: string;
|
|
18
|
+
mfaToken: string;
|
|
19
|
+
expiresIn: number;
|
|
20
|
+
allowedMethods: string[];
|
|
21
|
+
webauthn: Record<string, never> | null;
|
|
22
|
+
}>;
|
|
23
|
+
verifyMfa: (body: VerifyMfaBody, signal?: AbortSignal) => Promise<{
|
|
24
|
+
accessToken: string;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
tokenType: string;
|
|
27
|
+
expiresIn: number;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
30
|
+
}>;
|
|
31
|
+
regenerateRecoveryCodes: (signal?: AbortSignal) => Promise<{
|
|
32
|
+
codes: string[];
|
|
33
|
+
}>;
|
|
34
|
+
sudo: (body: SudoBody, signal?: AbortSignal) => Promise<{
|
|
35
|
+
sudoVerified: boolean;
|
|
36
|
+
sudoExpiresAt: string;
|
|
37
|
+
sudoTimeoutSeconds: number;
|
|
38
|
+
}>;
|
|
39
|
+
createSudoChallenge: (signal?: AbortSignal) => Promise<{
|
|
40
|
+
challengeToken: string;
|
|
41
|
+
options: Record<string, never>;
|
|
42
|
+
expiresIn: number;
|
|
43
|
+
}>;
|
|
44
|
+
assertSaml: (body: AssertSamlBody, signal?: AbortSignal) => Promise<{
|
|
45
|
+
accessToken: string;
|
|
46
|
+
refreshToken: string;
|
|
47
|
+
tokenType: string;
|
|
48
|
+
expiresIn: number;
|
|
49
|
+
sessionId: string;
|
|
50
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
51
|
+
} | {
|
|
52
|
+
mfaRequired: boolean;
|
|
53
|
+
mfaType: string;
|
|
54
|
+
mfaToken: string;
|
|
55
|
+
expiresIn: number;
|
|
56
|
+
allowedMethods: string[];
|
|
57
|
+
webauthn: Record<string, never> | null;
|
|
58
|
+
}>;
|
|
59
|
+
initiateSaml: (body?: InitiateSamlBody, signal?: AbortSignal) => Promise<{
|
|
60
|
+
ssoUrl: string;
|
|
61
|
+
requestHandle: string;
|
|
62
|
+
expiresIn: number;
|
|
63
|
+
}>;
|
|
64
|
+
createDeviceAuthorization: (body: CreateDeviceAuthorizationBody, signal?: AbortSignal) => Promise<{
|
|
65
|
+
deviceCode: string;
|
|
66
|
+
userCode: string;
|
|
67
|
+
verificationUri: string;
|
|
68
|
+
verificationUriComplete: string;
|
|
69
|
+
expiresIn: number;
|
|
70
|
+
interval: number;
|
|
71
|
+
}>;
|
|
72
|
+
approveDeviceAuthorization: (body: ApproveDeviceAuthorizationBody, signal?: AbortSignal) => Promise<{
|
|
73
|
+
status: "approved" | "denied";
|
|
74
|
+
idempotent: boolean;
|
|
75
|
+
decision: components["schemas"]["DeviceApprovalDecision"];
|
|
76
|
+
}>;
|
|
77
|
+
getDeviceAuthorizationToken: (body: GetDeviceAuthorizationTokenBody, signal?: AbortSignal) => Promise<{
|
|
78
|
+
accessToken: string;
|
|
79
|
+
refreshToken: string;
|
|
80
|
+
tokenType: string;
|
|
81
|
+
expiresIn: number;
|
|
82
|
+
sessionId: string;
|
|
83
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
84
|
+
}>;
|
|
85
|
+
getPkceToken: (body: GetPkceTokenBody, signal?: AbortSignal) => Promise<{
|
|
86
|
+
accessToken: string;
|
|
87
|
+
refreshToken: string;
|
|
88
|
+
tokenType: string;
|
|
89
|
+
expiresIn: number;
|
|
90
|
+
sessionId: string;
|
|
91
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
92
|
+
}>;
|
|
93
|
+
listPats: (signal?: AbortSignal) => Promise<{
|
|
94
|
+
items: components["schemas"]["PatItemResponse"][];
|
|
95
|
+
}>;
|
|
96
|
+
createPat: (body: CreatePatBody, signal?: AbortSignal) => Promise<{
|
|
97
|
+
accessToken: string;
|
|
98
|
+
tokenType: string;
|
|
99
|
+
expiresIn: number;
|
|
100
|
+
pat: components["schemas"]["PatItemResponse"];
|
|
101
|
+
}>;
|
|
102
|
+
exchangePat: (body?: ExchangePatBody, signal?: AbortSignal) => Promise<{
|
|
103
|
+
accessToken: string;
|
|
104
|
+
tokenType: string;
|
|
105
|
+
expiresIn: number;
|
|
106
|
+
scope: Record<string, never>;
|
|
107
|
+
readOnly: boolean;
|
|
108
|
+
parentTokenId: string;
|
|
109
|
+
parentTokenType: "session" | "pat";
|
|
110
|
+
expiresAt: string;
|
|
111
|
+
pat: components["schemas"]["PatItemResponse"];
|
|
112
|
+
}>;
|
|
113
|
+
revokePat: (id: RevokePatPath["id"], signal?: AbortSignal) => Promise<void>;
|
|
114
|
+
listSessions: (signal?: AbortSignal) => Promise<{
|
|
115
|
+
sessions?: components["schemas"]["SessionItemResponse"][];
|
|
116
|
+
}>;
|
|
117
|
+
revokeAllSessions: (signal?: AbortSignal) => Promise<void>;
|
|
118
|
+
revokeSession: (sessionId: RevokeSessionPath["sessionId"], signal?: AbortSignal) => Promise<void>;
|
|
119
|
+
introspectToken: (signal?: AbortSignal) => Promise<{
|
|
120
|
+
sessionId: string;
|
|
121
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
122
|
+
grantType: string;
|
|
123
|
+
sudoVerified: boolean;
|
|
124
|
+
createdAt: string;
|
|
125
|
+
expiresAt: string;
|
|
126
|
+
lastUsedAt?: string | null;
|
|
127
|
+
lastUsedIp?: string | null;
|
|
128
|
+
userAgent?: string | null;
|
|
129
|
+
projects: components["schemas"]["ProjectAccessItem"][];
|
|
130
|
+
}>;
|
|
131
|
+
refreshToken: (body: RefreshTokenBody, signal?: AbortSignal) => Promise<{
|
|
132
|
+
accessToken: string;
|
|
133
|
+
refreshToken: string;
|
|
134
|
+
tokenType: string;
|
|
135
|
+
expiresIn: number;
|
|
136
|
+
sessionId: string;
|
|
137
|
+
user: components["schemas"]["UserLoggedInResponse"];
|
|
138
|
+
}>;
|
|
139
|
+
revokeToken: (body: RevokeTokenBody, signal?: AbortSignal) => Promise<void>;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export { type AuthClientInitOptions, createAuthClient };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.cjs"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import '../types-auVqO7UT.cjs';
|
|
2
|
+
export { a as ApproveDeviceAuthorizationBody, h as ApproveDeviceAuthorizationResult, A as AssertSamlBody, i as AssertSamlResult, C as CreateDeviceAuthorizationBody, j as CreateDeviceAuthorizationResult, d as CreatePatBody, k as CreatePatResult, E as ExchangePatBody, l as ExchangePatResult, G as GetDeviceAuthorizationTokenBody, m as GetDeviceAuthorizationTokenResult, b as GetPkceTokenBody, n as GetPkceTokenResult, I as InitiateSamlBody, o as InitiateSamlResult, p as IntrospectTokenResult, q as ListPatsResult, r as ListSessionsResult, L as LoginBody, s as LoginResult, f as RefreshTokenBody, t as RefreshTokenResult, u as RegenerateRecoveryCodesResult, R as RevokePatPath, e as RevokeSessionPath, g as RevokeTokenBody, S as SudoBody, v as SudoChallengeResult, w as SudoResult, V as VerifyMfaBody, x as VerifyMfaResult } from '../types-BsA3W6Mo.cjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import '../types-auVqO7UT.js';
|
|
2
|
+
export { a as ApproveDeviceAuthorizationBody, h as ApproveDeviceAuthorizationResult, A as AssertSamlBody, i as AssertSamlResult, C as CreateDeviceAuthorizationBody, j as CreateDeviceAuthorizationResult, d as CreatePatBody, k as CreatePatResult, E as ExchangePatBody, l as ExchangePatResult, G as GetDeviceAuthorizationTokenBody, m as GetDeviceAuthorizationTokenResult, b as GetPkceTokenBody, n as GetPkceTokenResult, I as InitiateSamlBody, o as InitiateSamlResult, p as IntrospectTokenResult, q as ListPatsResult, r as ListSessionsResult, L as LoginBody, s as LoginResult, f as RefreshTokenBody, t as RefreshTokenResult, u as RegenerateRecoveryCodesResult, R as RevokePatPath, e as RevokeSessionPath, g as RevokeTokenBody, S as SudoBody, v as SudoChallengeResult, w as SudoResult, V as VerifyMfaBody, x as VerifyMfaResult } from '../types-CBYDpcI1.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
package/dist/chat/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { G as GetHistoryQuery, c as components, a as GetChatPath, C as ChatRequest, b as GetVotesQuery, V as VoteRequest, U as UsageResponse, A as AgentSettings, d as UpdateAgentSettingsRequest, e as UserAgentSettings, f as UpdateUserAgentSettingsRequest, T as ToolsListResponse } from '../types-
|
|
1
|
+
import { G as GetHistoryQuery, c as components, a as GetChatPath, C as ChatRequest, b as GetVotesQuery, V as VoteRequest, U as UsageResponse, A as AgentSettings, d as UpdateAgentSettingsRequest, e as UserAgentSettings, f as UpdateUserAgentSettingsRequest, T as ToolsListResponse } from '../types-QLM97gSa.cjs';
|
|
2
2
|
import { C as ClientInitOptions } from '../types-BLJoO6YL.cjs';
|
|
3
3
|
import { SuggestionsRequestBody, SuggestionsApiResponse } from './suggestions.cjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-auVqO7UT.cjs';
|
|
6
6
|
import 'qs';
|
|
7
7
|
|
|
8
8
|
type ChatClientOptions = ClientInitOptions & {
|
|
@@ -21,6 +21,11 @@ declare const createChatClient: ({ baseUrl, middlewares, storageApiUrl, token, }
|
|
|
21
21
|
lastMessageAt: string;
|
|
22
22
|
visibility: "public" | "private";
|
|
23
23
|
branchId?: number | null;
|
|
24
|
+
contextWindow?: {
|
|
25
|
+
usedTokens: number;
|
|
26
|
+
maxTokens: number;
|
|
27
|
+
percentage: number;
|
|
28
|
+
} | null;
|
|
24
29
|
messages: components["schemas"]["Message"][];
|
|
25
30
|
}>;
|
|
26
31
|
deleteChat: (chatId: string) => Promise<{
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { G as GetHistoryQuery, c as components, a as GetChatPath, C as ChatRequest, b as GetVotesQuery, V as VoteRequest, U as UsageResponse, A as AgentSettings, d as UpdateAgentSettingsRequest, e as UserAgentSettings, f as UpdateUserAgentSettingsRequest, T as ToolsListResponse } from '../types-
|
|
1
|
+
import { G as GetHistoryQuery, c as components, a as GetChatPath, C as ChatRequest, b as GetVotesQuery, V as VoteRequest, U as UsageResponse, A as AgentSettings, d as UpdateAgentSettingsRequest, e as UserAgentSettings, f as UpdateUserAgentSettingsRequest, T as ToolsListResponse } from '../types-R6KVJSvx.js';
|
|
2
2
|
import { C as ClientInitOptions } from '../types-BLJoO6YL.js';
|
|
3
3
|
import { SuggestionsRequestBody, SuggestionsApiResponse } from './suggestions.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-auVqO7UT.js';
|
|
6
6
|
import 'qs';
|
|
7
7
|
|
|
8
8
|
type ChatClientOptions = ClientInitOptions & {
|
|
@@ -21,6 +21,11 @@ declare const createChatClient: ({ baseUrl, middlewares, storageApiUrl, token, }
|
|
|
21
21
|
lastMessageAt: string;
|
|
22
22
|
visibility: "public" | "private";
|
|
23
23
|
branchId?: number | null;
|
|
24
|
+
contextWindow?: {
|
|
25
|
+
usedTokens: number;
|
|
26
|
+
maxTokens: number;
|
|
27
|
+
percentage: number;
|
|
28
|
+
} | null;
|
|
24
29
|
messages: components["schemas"]["Message"][];
|
|
25
30
|
}>;
|
|
26
31
|
deleteChat: (chatId: string) => Promise<{
|
package/dist/chat/types.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { A as AgentSettings, g as AskUserQuestionAnswers, h as Chat, i as ChatMessage, C as ChatRequest, j as ChatWithMessage, k as ChatWithMessages, a as GetChatPath, G as GetHistoryQuery, b as GetVotesQuery, H as HistoryResponse, M as MessageStatus, l as TextPart, m as ToolInfo, n as ToolPermissionValue, T as ToolsListResponse, d as UpdateAgentSettingsRequest, f as UpdateUserAgentSettingsRequest, U as UsageResponse, e as UserAgentSettings, o as UserMessage, p as Vote, V as VoteRequest, q as VotesResponse, r as askUserQuestionAnswersSchema } from '../types-
|
|
2
|
+
import '../types-auVqO7UT.cjs';
|
|
3
|
+
export { A as AgentSettings, g as AskUserQuestionAnswers, h as Chat, i as ChatMessage, C as ChatRequest, j as ChatWithMessage, k as ChatWithMessages, a as GetChatPath, G as GetHistoryQuery, b as GetVotesQuery, H as HistoryResponse, M as MessageStatus, l as TextPart, m as ToolInfo, n as ToolPermissionValue, T as ToolsListResponse, d as UpdateAgentSettingsRequest, f as UpdateUserAgentSettingsRequest, U as UsageResponse, e as UserAgentSettings, o as UserMessage, p as Vote, V as VoteRequest, q as VotesResponse, r as askUserQuestionAnswersSchema } from '../types-QLM97gSa.cjs';
|
package/dist/chat/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { A as AgentSettings, g as AskUserQuestionAnswers, h as Chat, i as ChatMessage, C as ChatRequest, j as ChatWithMessage, k as ChatWithMessages, a as GetChatPath, G as GetHistoryQuery, b as GetVotesQuery, H as HistoryResponse, M as MessageStatus, l as TextPart, m as ToolInfo, n as ToolPermissionValue, T as ToolsListResponse, d as UpdateAgentSettingsRequest, f as UpdateUserAgentSettingsRequest, U as UsageResponse, e as UserAgentSettings, o as UserMessage, p as Vote, V as VoteRequest, q as VotesResponse, r as askUserQuestionAnswersSchema } from '../types-
|
|
2
|
+
import '../types-auVqO7UT.js';
|
|
3
|
+
export { A as AgentSettings, g as AskUserQuestionAnswers, h as Chat, i as ChatMessage, C as ChatRequest, j as ChatWithMessage, k as ChatWithMessages, a as GetChatPath, G as GetHistoryQuery, b as GetVotesQuery, H as HistoryResponse, M as MessageStatus, l as TextPart, m as ToolInfo, n as ToolPermissionValue, T as ToolsListResponse, d as UpdateAgentSettingsRequest, f as UpdateUserAgentSettingsRequest, U as UsageResponse, e as UserAgentSettings, o as UserMessage, p as Vote, V as VoteRequest, q as VotesResponse, r as askUserQuestionAnswersSchema } from '../types-R6KVJSvx.js';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createOpenapiFetchClient } from './chunk-FBGUBMJ7.js';
|
|
2
|
+
|
|
3
|
+
// src/clients/auth/authClient.ts
|
|
4
|
+
var createAuthClient = ({ baseUrl, middlewares }) => {
|
|
5
|
+
const client = createOpenapiFetchClient({ baseUrl, middlewares });
|
|
6
|
+
const login = async (body, signal) => {
|
|
7
|
+
const { data } = await client.post("/v1/auth/login", { body }, { signal });
|
|
8
|
+
return data;
|
|
9
|
+
};
|
|
10
|
+
const verifyMfa = async (body, signal) => {
|
|
11
|
+
const { data } = await client.post("/v1/auth/mfa", { body }, { signal });
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
const regenerateRecoveryCodes = async (signal) => {
|
|
15
|
+
const { data } = await client.post("/v1/auth/mfa/recovery-codes", {}, { signal });
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
const sudo = async (body, signal) => {
|
|
19
|
+
const { data } = await client.post("/v1/auth/sudo", { body }, { signal });
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
const createSudoChallenge = async (signal) => {
|
|
23
|
+
const { data } = await client.post("/v1/auth/sudo/challenge", {}, { signal });
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
const assertSaml = async (body, signal) => {
|
|
27
|
+
const { data } = await client.post("/v1/auth/saml/assert", { body }, { signal });
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
const initiateSaml = async (body, signal) => {
|
|
31
|
+
const { data } = await client.post("/v1/auth/saml/initiate", { body }, { signal });
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
const createDeviceAuthorization = async (body, signal) => {
|
|
35
|
+
const { data } = await client.post("/v1/auth/device", { body }, { signal });
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
const approveDeviceAuthorization = async (body, signal) => {
|
|
39
|
+
const { data } = await client.post("/v1/auth/device/approve", { body }, { signal });
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
const getDeviceAuthorizationToken = async (body, signal) => {
|
|
43
|
+
const { data } = await client.post("/v1/auth/device/token", { body }, { signal });
|
|
44
|
+
return data;
|
|
45
|
+
};
|
|
46
|
+
const getPkceToken = async (body, signal) => {
|
|
47
|
+
const { data } = await client.post("/v1/auth/pkce/token", { body }, { signal });
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
const listPats = async (signal) => {
|
|
51
|
+
const { data } = await client.get("/v1/auth/pat", {}, { signal });
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
const createPat = async (body, signal) => {
|
|
55
|
+
const { data } = await client.post("/v1/auth/pat", { body }, { signal });
|
|
56
|
+
return data;
|
|
57
|
+
};
|
|
58
|
+
const exchangePat = async (body, signal) => {
|
|
59
|
+
const { data } = await client.post("/v1/auth/pat/exchange", { body }, { signal });
|
|
60
|
+
return data;
|
|
61
|
+
};
|
|
62
|
+
const revokePat = async (id, signal) => {
|
|
63
|
+
await client.delete("/v1/auth/pat/{id}", { path: { id } }, { signal });
|
|
64
|
+
};
|
|
65
|
+
const listSessions = async (signal) => {
|
|
66
|
+
const { data } = await client.get("/v1/auth/sessions", {}, { signal });
|
|
67
|
+
return data;
|
|
68
|
+
};
|
|
69
|
+
const revokeAllSessions = async (signal) => {
|
|
70
|
+
await client.delete("/v1/auth/sessions", {}, { signal });
|
|
71
|
+
};
|
|
72
|
+
const revokeSession = async (sessionId, signal) => {
|
|
73
|
+
await client.delete("/v1/auth/sessions/{sessionId}", { path: { sessionId } }, { signal });
|
|
74
|
+
};
|
|
75
|
+
const introspectToken = async (signal) => {
|
|
76
|
+
const { data } = await client.get("/v1/auth/token/introspect", {}, { signal });
|
|
77
|
+
return data;
|
|
78
|
+
};
|
|
79
|
+
const refreshToken = async (body, signal) => {
|
|
80
|
+
const { data } = await client.post("/v1/auth/token/refresh", { body }, { signal });
|
|
81
|
+
return data;
|
|
82
|
+
};
|
|
83
|
+
const revokeToken = async (body, signal) => {
|
|
84
|
+
await client.post("/v1/auth/token/revoke", { body }, { signal });
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
login,
|
|
88
|
+
verifyMfa,
|
|
89
|
+
regenerateRecoveryCodes,
|
|
90
|
+
sudo,
|
|
91
|
+
createSudoChallenge,
|
|
92
|
+
assertSaml,
|
|
93
|
+
initiateSaml,
|
|
94
|
+
createDeviceAuthorization,
|
|
95
|
+
approveDeviceAuthorization,
|
|
96
|
+
getDeviceAuthorizationToken,
|
|
97
|
+
getPkceToken,
|
|
98
|
+
listPats,
|
|
99
|
+
createPat,
|
|
100
|
+
exchangePat,
|
|
101
|
+
revokePat,
|
|
102
|
+
listSessions,
|
|
103
|
+
revokeAllSessions,
|
|
104
|
+
revokeSession,
|
|
105
|
+
introspectToken,
|
|
106
|
+
refreshToken,
|
|
107
|
+
revokeToken
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export { createAuthClient };
|
|
112
|
+
//# sourceMappingURL=chunk-I3VK6VQT.js.map
|
|
113
|
+
//# sourceMappingURL=chunk-I3VK6VQT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/clients/auth/authClient.ts"],"names":[],"mappings":";;;AAwBO,IAAM,gBAAA,GAAmB,CAAC,EAAE,OAAA,EAAS,aAAY,KAA6B;AACnF,EAAA,MAAM,MAAA,GAAS,wBAAA,CAAgC,EAAE,OAAA,EAAS,aAAa,CAAA;AAEvE,EAAA,MAAM,KAAA,GAAQ,OAAO,IAAA,EAAiB,MAAA,KAAyB;AAC7D,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,MAAA,CAAO,IAAA,CAAK,gBAAA,EAAkB,EAAE,IAAA,EAAK,EAAG,EAAE,MAAA,EAAQ,CAAA;AACzE,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAM,SAAA,GAAY,OAAO,IAAA,EAAqB,MAAA,KAAyB;AACrE,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM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AAA;AAAA,EAC1F,CAAA;AAEA,EAAA,MAAM,eAAA,GAAkB,OAAO,MAAA,KAAyB;AACtD,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,MAAA,CAAO,GAAA,CAAI,2BAAA,EAA6B,EAAC,EAAG,EAAE,MAAA,EAAQ,CAAA;AAC7E,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAM,YAAA,GAAe,OAAO,IAAA,EAAwB,MAAA,KAAyB;AAC3E,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,MAAA,CAAO,IAAA,CAAK,wBAAA,EAA0B,EAAE,IAAA,EAAK,EAAG,EAAE,MAAA,EAAQ,CAAA;AACjF,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAM,WAAA,GAAc,OAAO,IAAA,EAAuB,MAAA,KAAyB;AACzE,IAAA,MAAM,MAAA,CAAO,KAAK,uBAAA,EAAyB,EAAE,MAAK,EAAG,EAAE,QAAQ,CAAA;AAAA,EACjE,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,KAAA;AAAA,IACA,SAAA;AAAA,IACA,uBAAA;AAAA,IACA,IAAA;AAAA,IACA,mBAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,yBAAA;AAAA,IACA,0BAAA;AAAA,IACA,2BAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,aAAA;AAAA,IACA,eAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-I3VK6VQT.js","sourcesContent":["import { createOpenapiFetchClient } from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport type {\n ApproveDeviceAuthorizationBody,\n AssertSamlBody,\n CreateDeviceAuthorizationBody,\n CreatePatBody,\n ExchangePatBody,\n GetDeviceAuthorizationTokenBody,\n GetPkceTokenBody,\n InitiateSamlBody,\n LoginBody,\n RefreshTokenBody,\n RevokePatPath,\n RevokeSessionPath,\n RevokeTokenBody,\n SudoBody,\n VerifyMfaBody,\n} from './types';\n\nexport type AuthClientInitOptions = Omit<ClientInitOptions, 'token'>;\n\nexport const createAuthClient = ({ baseUrl, middlewares }: AuthClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({ baseUrl, middlewares });\n\n const login = async (body: LoginBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/login', { body }, { signal });\n return data;\n };\n\n const verifyMfa = async (body: VerifyMfaBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/mfa', { body }, { signal });\n return data;\n };\n\n const regenerateRecoveryCodes = async (signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/mfa/recovery-codes', {}, { signal });\n return data;\n };\n\n const sudo = async (body: SudoBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/sudo', { body }, { signal });\n return data;\n };\n\n const createSudoChallenge = async (signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/sudo/challenge', {}, { signal });\n return data;\n };\n\n const assertSaml = async (body: AssertSamlBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/saml/assert', { body }, { signal });\n return data;\n };\n\n const initiateSaml = async (body?: InitiateSamlBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/saml/initiate', { body }, { signal });\n return data;\n };\n\n const createDeviceAuthorization = async (\n body: CreateDeviceAuthorizationBody,\n signal?: AbortSignal,\n ) => {\n const { data } = await client.post('/v1/auth/device', { body }, { signal });\n return data;\n };\n\n const approveDeviceAuthorization = async (\n body: ApproveDeviceAuthorizationBody,\n signal?: AbortSignal,\n ) => {\n const { data } = await client.post('/v1/auth/device/approve', { body }, { signal });\n return data;\n };\n\n const getDeviceAuthorizationToken = async (\n body: GetDeviceAuthorizationTokenBody,\n signal?: AbortSignal,\n ) => {\n const { data } = await client.post('/v1/auth/device/token', { body }, { signal });\n return data;\n };\n\n const getPkceToken = async (body: GetPkceTokenBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/pkce/token', { body }, { signal });\n return data;\n };\n\n const listPats = async (signal?: AbortSignal) => {\n const { data } = await client.get('/v1/auth/pat', {}, { signal });\n return data;\n };\n\n const createPat = async (body: CreatePatBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/pat', { body }, { signal });\n return data;\n };\n\n const exchangePat = async (body?: ExchangePatBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/pat/exchange', { body }, { signal });\n return data;\n };\n\n const revokePat = async (id: RevokePatPath['id'], signal?: AbortSignal) => {\n await client.delete('/v1/auth/pat/{id}', { path: { id } }, { signal });\n };\n\n const listSessions = async (signal?: AbortSignal) => {\n const { data } = await client.get('/v1/auth/sessions', {}, { signal });\n return data;\n };\n\n const revokeAllSessions = async (signal?: AbortSignal) => {\n await client.delete('/v1/auth/sessions', {}, { signal });\n };\n\n const revokeSession = async (sessionId: RevokeSessionPath['sessionId'], signal?: AbortSignal) => {\n await client.delete('/v1/auth/sessions/{sessionId}', { path: { sessionId } }, { signal });\n };\n\n const introspectToken = async (signal?: AbortSignal) => {\n const { data } = await client.get('/v1/auth/token/introspect', {}, { signal });\n return data;\n };\n\n const refreshToken = async (body: RefreshTokenBody, signal?: AbortSignal) => {\n const { data } = await client.post('/v1/auth/token/refresh', { body }, { signal });\n return data;\n };\n\n const revokeToken = async (body: RevokeTokenBody, signal?: AbortSignal) => {\n await client.post('/v1/auth/token/revoke', { body }, { signal });\n };\n\n return {\n login,\n verifyMfa,\n regenerateRecoveryCodes,\n sudo,\n createSudoChallenge,\n assertSaml,\n initiateSaml,\n createDeviceAuthorization,\n approveDeviceAuthorization,\n getDeviceAuthorizationToken,\n getPkceToken,\n listPats,\n createPat,\n exchangePat,\n revokePat,\n listSessions,\n revokeAllSessions,\n revokeSession,\n introspectToken,\n refreshToken,\n revokeToken,\n };\n};\n"]}
|