@scalar/agent-chat 0.4.8 → 0.5.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/dist/App.vue.d.ts +56 -1
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +25 -20
- package/dist/Chat.vue.d.ts +5 -1
- package/dist/Chat.vue.d.ts.map +1 -1
- package/dist/Chat.vue.js +26 -22
- package/dist/client-tools/execute-request.d.ts +72 -0
- package/dist/client-tools/execute-request.d.ts.map +1 -0
- package/dist/client-tools/execute-request.js +92 -0
- package/dist/components/ActionsDropdown.vue.d.ts +17 -0
- package/dist/components/ActionsDropdown.vue.d.ts.map +1 -0
- package/dist/components/ActionsDropdown.vue.js +7 -0
- package/dist/components/ActionsDropdown.vue2.js +50 -0
- package/dist/components/RequestPreview.vue.d.ts +3 -3
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/RequestPreview.vue.js +2 -2
- package/dist/components/RequestPreview.vue2.js +31 -31
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +16 -16
- package/dist/entities/registry/document.d.ts +1 -0
- package/dist/entities/registry/document.d.ts.map +1 -1
- package/dist/entities/tools/execute-request.d.ts +27 -34
- package/dist/entities/tools/execute-request.d.ts.map +1 -1
- package/dist/entities/tools/execute-request.js +5 -4
- package/dist/helpers.d.ts +36 -275
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +44 -86
- package/dist/hooks/use-chat-approvals.d.ts +17 -10
- package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
- package/dist/hooks/use-chat-approvals.js +28 -15
- package/dist/hooks/use-search.d.ts +2 -0
- package/dist/hooks/use-search.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/package.json +2 -1
- package/dist/plugins/persistance.d.ts +16 -0
- package/dist/plugins/persistance.d.ts.map +1 -0
- package/dist/plugins/persistance.js +23 -0
- package/dist/state/state.d.ts +16 -5
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +148 -101
- package/dist/style.css +1 -1
- package/dist/views/Catalog/Catalog.vue.d.ts +7 -0
- package/dist/views/Catalog/Catalog.vue.d.ts.map +1 -0
- package/dist/views/Catalog/Catalog.vue.js +8 -0
- package/dist/views/Catalog/Catalog.vue2.js +70 -0
- package/dist/views/Chat/Chat.vue.d.ts +2 -0
- package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
- package/dist/views/Chat/Chat.vue.js +1 -1
- package/dist/views/Chat/Chat.vue2.js +36 -35
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +2 -2
- package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +50 -52
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +8 -7
- package/dist/views/Layout.vue.d.ts +2 -0
- package/dist/views/Layout.vue.d.ts.map +1 -1
- package/dist/views/Layout.vue.js +2 -2
- package/dist/views/Layout.vue2.js +16 -14
- package/dist/views/PromptForm.vue.d.ts +2 -0
- package/dist/views/PromptForm.vue.d.ts.map +1 -1
- package/dist/views/PromptForm.vue.js +1 -1
- package/dist/views/PromptForm.vue2.js +112 -99
- package/dist/views/Settings/Auth.vue.d.ts +2 -2
- package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
- package/dist/views/Settings/Auth.vue.js +32 -32
- package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +1 -1
- package/dist/views/Settings/DocSettings.vue2.js +22 -21
- package/dist/views/Start.vue.d.ts +2 -0
- package/dist/views/Start.vue.d.ts.map +1 -1
- package/dist/views/Start.vue.js +2 -2
- package/dist/views/Start.vue2.js +22 -21
- package/package.json +8 -7
package/dist/entities/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { AgentErrorCodes as
|
|
2
|
-
import { createError as
|
|
1
|
+
import { AgentErrorCodes as r } from "./error/constants.js";
|
|
2
|
+
import { createError as t } from "./error/helpers.js";
|
|
3
3
|
import { MAX_PROMPT_SIZE as A } from "./prompt/constants.js";
|
|
4
|
-
import { registryApiMetadata as
|
|
5
|
-
import { ASK_FOR_AUTHENTICATION_TOOL_NAME as
|
|
6
|
-
import { TOOL_NAMESPACE_SLUG_DELIMITER as
|
|
7
|
-
import {
|
|
4
|
+
import { registryApiMetadata as O } from "./registry/document.js";
|
|
5
|
+
import { ASK_FOR_AUTHENTICATION_TOOL_NAME as p, askForAuthenticationInputSchema as S } from "./tools/ask-for-authentication.js";
|
|
6
|
+
import { TOOL_NAMESPACE_SLUG_DELIMITER as m } from "./tools/constants.js";
|
|
7
|
+
import { EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME as x, executeClientSideRequestToolInputSchema as P } from "./tools/execute-request.js";
|
|
8
8
|
import { GET_MINI_OPENAPI_SPEC_TOOL_NAME as f, getMiniOpenAPIDocToolInputSchema as n } from "./tools/get-mini-openapi-spec.js";
|
|
9
|
-
import { GET_OPENAPI_SPECS_SUMMARY_TOOL_NAME as
|
|
9
|
+
import { GET_OPENAPI_SPECS_SUMMARY_TOOL_NAME as C } from "./tools/get-openapi-spec-summary.js";
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
p as ASK_FOR_AUTHENTICATION_TOOL_NAME,
|
|
12
|
+
r as AgentErrorCodes,
|
|
13
|
+
x as EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME,
|
|
14
14
|
f as GET_MINI_OPENAPI_SPEC_TOOL_NAME,
|
|
15
|
-
|
|
15
|
+
C as GET_OPENAPI_SPECS_SUMMARY_TOOL_NAME,
|
|
16
16
|
A as MAX_PROMPT_SIZE,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
P as
|
|
17
|
+
m as TOOL_NAMESPACE_SLUG_DELIMITER,
|
|
18
|
+
S as askForAuthenticationInputSchema,
|
|
19
|
+
t as createError,
|
|
20
|
+
P as executeClientSideRequestToolInputSchema,
|
|
21
21
|
n as getMiniOpenAPIDocToolInputSchema,
|
|
22
|
-
|
|
22
|
+
O as registryApiMetadata
|
|
23
23
|
};
|
|
@@ -11,6 +11,7 @@ export declare const registryApiMetadata: z.ZodObject<{
|
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
export type ApiMetadata = z.infer<typeof registryApiMetadata> & {
|
|
13
13
|
removable?: boolean;
|
|
14
|
+
searchEnabled?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export type RegistryDocument = {
|
|
16
17
|
namespace: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/entities/registry/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/entities/registry/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEhH,MAAM,MAAM,gBAAgB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAElE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CACnC,MAAM,EACN;IACE,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,YAAY,EAAE,WAAW,CAAC,YAAY,GAAG,SAAS,CAAA;CACnD,CACF,CAAA"}
|
|
@@ -1,42 +1,35 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Result } from 'neverpanic';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { AgentChatError } from '../../entities/error/constants.js';
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME: "execute-request";
|
|
5
|
+
export declare const executeClientSideRequestToolInputSchema: z.ZodObject<{
|
|
6
6
|
method: z.ZodString;
|
|
7
7
|
path: z.ZodString;
|
|
8
8
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
9
9
|
body: z.ZodOptional<z.ZodString>;
|
|
10
|
+
documentIdentifier: z.ZodString;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
|
-
export type
|
|
12
|
-
export type
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
error?: undefined;
|
|
35
|
-
} | {
|
|
36
|
-
success: false;
|
|
37
|
-
error: AgentChatError<'FAILED_TO_FETCH', {
|
|
38
|
-
originalError: unknown;
|
|
39
|
-
}>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
12
|
+
export type ExecuteClientSideRequestToolInput = z.input<typeof executeClientSideRequestToolInputSchema>;
|
|
13
|
+
export type ExecuteClientSideRequestToolOutput = Result<{
|
|
14
|
+
status: number;
|
|
15
|
+
responseBody?: unknown;
|
|
16
|
+
headers: {};
|
|
17
|
+
}, AgentChatError<'FAILED_TO_PARSE_RESPONSE_BODY', {
|
|
18
|
+
originalError: unknown;
|
|
19
|
+
}> | AgentChatError<'REQUEST_NOT_OK', {
|
|
20
|
+
status: number;
|
|
21
|
+
url: string;
|
|
22
|
+
responseBody: unknown;
|
|
23
|
+
headers: Record<string, string>;
|
|
24
|
+
}> | AgentChatError<'FAILED_TO_FETCH', {
|
|
25
|
+
originalError: unknown;
|
|
26
|
+
}> | AgentChatError<'DOCUMENT_SETTINGS_COULD_NOT_BE_DETERMINED', {
|
|
27
|
+
documentName: string;
|
|
28
|
+
namespace: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
}> | AgentChatError<'FAILED_TO_DETERMINE_DOCUMENT', {
|
|
31
|
+
namespace?: string;
|
|
32
|
+
slug?: string;
|
|
33
|
+
documentIdentifier: string;
|
|
34
|
+
}> | AgentChatError<'FAILED_TO_EXECUTE_REQUEST', unknown>>;
|
|
42
35
|
//# sourceMappingURL=execute-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-request.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/execute-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"execute-request.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/execute-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE,eAAO,MAAM,qCAAqC,EAAG,iBAA0B,CAAA;AAE/E,eAAO,MAAM,uCAAuC;;;;;;iBAMlD,CAAA;AAEF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAA;AAEvG,MAAM,MAAM,kCAAkC,GAAG,MAAM,CACrD;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,EAAE,CAAA;CAAE,EACrD,cAAc,CACZ,+BAA+B,EAC/B;IACE,aAAa,EAAE,OAAO,CAAA;CACvB,CACF,GACD,cAAc,CACZ,gBAAgB,EAChB;IACE,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,OAAO,CAAA;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CACF,GACD,cAAc,CACZ,iBAAiB,EACjB;IACE,aAAa,EAAE,OAAO,CAAA;CACvB,CACF,GACD,cAAc,CACZ,2CAA2C,EAC3C;IACE,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CACF,GACD,cAAc,CAAC,8BAA8B,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CAAC,GACjH,cAAc,CAAC,2BAA2B,EAAE,OAAO,CAAC,CACvD,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
const o = "execute-request",
|
|
2
|
+
const o = "execute-request", n = t.object({
|
|
3
3
|
method: t.string(),
|
|
4
4
|
path: t.string(),
|
|
5
5
|
headers: t.record(t.string(), t.string()).optional(),
|
|
6
|
-
body: t.string().optional()
|
|
6
|
+
body: t.string().optional(),
|
|
7
|
+
documentIdentifier: t.string()
|
|
7
8
|
});
|
|
8
9
|
export {
|
|
9
|
-
o as
|
|
10
|
-
|
|
10
|
+
o as EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME,
|
|
11
|
+
n as executeClientSideRequestToolInputSchema
|
|
11
12
|
};
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
|
-
import type
|
|
4
|
-
import type { OperationObject
|
|
5
|
-
import { type SecuritySchemes } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
import { type Auth } from '@scalar/workspace-store/entities/auth';
|
|
4
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
6
5
|
export declare function getOperations(doc: Partial<OpenAPIV3_1.Document>): OperationObject[];
|
|
7
6
|
/** Generate document settings from workspace store */
|
|
8
7
|
export declare function createDocumentSettings(workspaceStore: WorkspaceStore): {
|
|
9
8
|
[k: string]: {
|
|
10
9
|
activeServer: import("@scalar/workspace-store/schemas/v3.1/strict/server").ServerObject | null;
|
|
11
|
-
securitySchemes:
|
|
10
|
+
securitySchemes: import("@scalar/api-client/v2/blocks/scalar-auth-selector-block").SecuritySchemeObjectSecret[];
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
/**
|
|
@@ -20,52 +19,26 @@ export declare const authStorage: () => {
|
|
|
20
19
|
/**
|
|
21
20
|
* Retrieves and coerces the authentication schemes stored in local storage.
|
|
22
21
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} & {
|
|
40
|
-
bearerFormat?: string | undefined;
|
|
41
|
-
type: "http";
|
|
42
|
-
scheme: "basic" | "bearer";
|
|
43
|
-
}) | ({
|
|
44
|
-
description?: string | undefined;
|
|
45
|
-
} & {
|
|
46
|
-
type: "oauth2";
|
|
47
|
-
flows: {
|
|
22
|
+
getAuth: (slug: string) => {
|
|
23
|
+
secrets: {
|
|
24
|
+
[x: string]: ({
|
|
25
|
+
type: "apiKey";
|
|
26
|
+
} & {
|
|
27
|
+
'x-scalar-secret-token': string;
|
|
28
|
+
}) | ({
|
|
29
|
+
type: "http";
|
|
30
|
+
} & {
|
|
31
|
+
'x-scalar-secret-token': string;
|
|
32
|
+
} & {
|
|
33
|
+
'x-scalar-secret-username': string;
|
|
34
|
+
'x-scalar-secret-password': string;
|
|
35
|
+
}) | ({
|
|
36
|
+
type: "oauth2";
|
|
37
|
+
} & {
|
|
48
38
|
password?: ({
|
|
49
|
-
refreshUrl: string;
|
|
50
|
-
scopes: {
|
|
51
|
-
[x: string]: string;
|
|
52
|
-
};
|
|
53
|
-
} & {
|
|
54
39
|
'x-scalar-secret-client-id': string;
|
|
55
40
|
} & {
|
|
56
41
|
'x-scalar-secret-token': string;
|
|
57
|
-
} & {
|
|
58
|
-
'x-scalar-security-query'?: {
|
|
59
|
-
[x: string]: string;
|
|
60
|
-
} | undefined;
|
|
61
|
-
} & {
|
|
62
|
-
'x-scalar-security-body'?: {
|
|
63
|
-
[x: string]: string;
|
|
64
|
-
} | undefined;
|
|
65
|
-
} & {
|
|
66
|
-
'x-tokenName'?: string | undefined;
|
|
67
|
-
} & {
|
|
68
|
-
tokenUrl: string;
|
|
69
42
|
} & {
|
|
70
43
|
'x-scalar-secret-username': string;
|
|
71
44
|
'x-scalar-secret-password': string;
|
|
@@ -75,266 +48,54 @@ export declare const authStorage: () => {
|
|
|
75
48
|
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
76
49
|
}) | undefined;
|
|
77
50
|
implicit?: ({
|
|
78
|
-
refreshUrl: string;
|
|
79
|
-
scopes: {
|
|
80
|
-
[x: string]: string;
|
|
81
|
-
};
|
|
82
|
-
} & {
|
|
83
51
|
'x-scalar-secret-client-id': string;
|
|
84
52
|
} & {
|
|
85
53
|
'x-scalar-secret-token': string;
|
|
86
|
-
} & {
|
|
87
|
-
'x-scalar-security-query'?: {
|
|
88
|
-
[x: string]: string;
|
|
89
|
-
} | undefined;
|
|
90
|
-
} & {
|
|
91
|
-
'x-scalar-security-body'?: {
|
|
92
|
-
[x: string]: string;
|
|
93
|
-
} | undefined;
|
|
94
|
-
} & {
|
|
95
|
-
'x-tokenName'?: string | undefined;
|
|
96
|
-
} & {
|
|
97
|
-
authorizationUrl: string;
|
|
98
54
|
} & {
|
|
99
55
|
'x-scalar-secret-redirect-uri': string;
|
|
100
56
|
}) | undefined;
|
|
101
57
|
clientCredentials?: ({
|
|
102
|
-
refreshUrl: string;
|
|
103
|
-
scopes: {
|
|
104
|
-
[x: string]: string;
|
|
105
|
-
};
|
|
106
|
-
} & {
|
|
107
58
|
'x-scalar-secret-client-id': string;
|
|
108
59
|
} & {
|
|
109
60
|
'x-scalar-secret-token': string;
|
|
110
|
-
} & {
|
|
111
|
-
'x-scalar-security-query'?: {
|
|
112
|
-
[x: string]: string;
|
|
113
|
-
} | undefined;
|
|
114
|
-
} & {
|
|
115
|
-
'x-scalar-security-body'?: {
|
|
116
|
-
[x: string]: string;
|
|
117
|
-
} | undefined;
|
|
118
|
-
} & {
|
|
119
|
-
'x-tokenName'?: string | undefined;
|
|
120
|
-
} & {
|
|
121
|
-
tokenUrl: string;
|
|
122
61
|
} & {
|
|
123
62
|
'x-scalar-secret-client-secret': string;
|
|
124
63
|
} & {
|
|
125
64
|
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
126
65
|
}) | undefined;
|
|
127
66
|
authorizationCode?: ({
|
|
128
|
-
refreshUrl: string;
|
|
129
|
-
scopes: {
|
|
130
|
-
[x: string]: string;
|
|
131
|
-
};
|
|
132
|
-
} & {
|
|
133
67
|
'x-scalar-secret-client-id': string;
|
|
134
68
|
} & {
|
|
135
69
|
'x-scalar-secret-token': string;
|
|
136
|
-
} & {
|
|
137
|
-
'x-scalar-security-query'?: {
|
|
138
|
-
[x: string]: string;
|
|
139
|
-
} | undefined;
|
|
140
|
-
} & {
|
|
141
|
-
'x-scalar-security-body'?: {
|
|
142
|
-
[x: string]: string;
|
|
143
|
-
} | undefined;
|
|
144
|
-
} & {
|
|
145
|
-
'x-tokenName'?: string | undefined;
|
|
146
|
-
} & {
|
|
147
|
-
authorizationUrl: string;
|
|
148
|
-
tokenUrl: string;
|
|
149
70
|
} & {
|
|
150
71
|
'x-scalar-secret-client-secret': string;
|
|
151
72
|
} & {
|
|
152
73
|
'x-scalar-secret-redirect-uri': string;
|
|
153
|
-
} & {
|
|
154
|
-
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
155
74
|
} & {
|
|
156
75
|
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
157
76
|
}) | undefined;
|
|
158
|
-
};
|
|
159
|
-
} & {
|
|
160
|
-
'x-default-scopes'?: string[] | undefined;
|
|
161
|
-
}) | ({
|
|
162
|
-
description?: string | undefined;
|
|
163
|
-
} & {
|
|
164
|
-
type: "openIdConnect";
|
|
165
|
-
openIdConnectUrl: string;
|
|
166
|
-
}) | ({
|
|
167
|
-
description?: string | undefined;
|
|
168
|
-
summary?: string | undefined;
|
|
169
|
-
$ref: string;
|
|
170
|
-
} & {
|
|
171
|
-
$status?: "loading" | "error" | undefined;
|
|
172
|
-
$global?: boolean | undefined;
|
|
173
|
-
} & {
|
|
174
|
-
'$ref-value': ({
|
|
175
|
-
description?: string | undefined;
|
|
176
|
-
} & {
|
|
177
|
-
'x-scalar-secret-token': string;
|
|
178
|
-
} & {
|
|
179
|
-
type: "apiKey";
|
|
180
|
-
in: "cookie" | "query" | "header";
|
|
181
|
-
name: string;
|
|
182
|
-
}) | ({
|
|
183
|
-
description?: string | undefined;
|
|
184
|
-
} & {
|
|
185
|
-
'x-scalar-secret-token': string;
|
|
186
|
-
} & {
|
|
187
|
-
'x-scalar-secret-username': string;
|
|
188
|
-
'x-scalar-secret-password': string;
|
|
189
|
-
} & {
|
|
190
|
-
bearerFormat?: string | undefined;
|
|
191
|
-
type: "http";
|
|
192
|
-
scheme: "basic" | "bearer";
|
|
193
|
-
}) | ({
|
|
194
|
-
description?: string | undefined;
|
|
195
|
-
} & {
|
|
196
|
-
type: "oauth2";
|
|
197
|
-
flows: {
|
|
198
|
-
password?: ({
|
|
199
|
-
refreshUrl: string;
|
|
200
|
-
scopes: {
|
|
201
|
-
[x: string]: string;
|
|
202
|
-
};
|
|
203
|
-
} & {
|
|
204
|
-
'x-scalar-secret-client-id': string;
|
|
205
|
-
} & {
|
|
206
|
-
'x-scalar-secret-token': string;
|
|
207
|
-
} & {
|
|
208
|
-
'x-scalar-security-query'?: {
|
|
209
|
-
[x: string]: string;
|
|
210
|
-
} | undefined;
|
|
211
|
-
} & {
|
|
212
|
-
'x-scalar-security-body'?: {
|
|
213
|
-
[x: string]: string;
|
|
214
|
-
} | undefined;
|
|
215
|
-
} & {
|
|
216
|
-
'x-tokenName'?: string | undefined;
|
|
217
|
-
} & {
|
|
218
|
-
tokenUrl: string;
|
|
219
|
-
} & {
|
|
220
|
-
'x-scalar-secret-username': string;
|
|
221
|
-
'x-scalar-secret-password': string;
|
|
222
|
-
} & {
|
|
223
|
-
'x-scalar-secret-client-secret': string;
|
|
224
|
-
} & {
|
|
225
|
-
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
226
|
-
}) | undefined;
|
|
227
|
-
implicit?: ({
|
|
228
|
-
refreshUrl: string;
|
|
229
|
-
scopes: {
|
|
230
|
-
[x: string]: string;
|
|
231
|
-
};
|
|
232
|
-
} & {
|
|
233
|
-
'x-scalar-secret-client-id': string;
|
|
234
|
-
} & {
|
|
235
|
-
'x-scalar-secret-token': string;
|
|
236
|
-
} & {
|
|
237
|
-
'x-scalar-security-query'?: {
|
|
238
|
-
[x: string]: string;
|
|
239
|
-
} | undefined;
|
|
240
|
-
} & {
|
|
241
|
-
'x-scalar-security-body'?: {
|
|
242
|
-
[x: string]: string;
|
|
243
|
-
} | undefined;
|
|
244
|
-
} & {
|
|
245
|
-
'x-tokenName'?: string | undefined;
|
|
246
|
-
} & {
|
|
247
|
-
authorizationUrl: string;
|
|
248
|
-
} & {
|
|
249
|
-
'x-scalar-secret-redirect-uri': string;
|
|
250
|
-
}) | undefined;
|
|
251
|
-
clientCredentials?: ({
|
|
252
|
-
refreshUrl: string;
|
|
253
|
-
scopes: {
|
|
254
|
-
[x: string]: string;
|
|
255
|
-
};
|
|
256
|
-
} & {
|
|
257
|
-
'x-scalar-secret-client-id': string;
|
|
258
|
-
} & {
|
|
259
|
-
'x-scalar-secret-token': string;
|
|
260
|
-
} & {
|
|
261
|
-
'x-scalar-security-query'?: {
|
|
262
|
-
[x: string]: string;
|
|
263
|
-
} | undefined;
|
|
264
|
-
} & {
|
|
265
|
-
'x-scalar-security-body'?: {
|
|
266
|
-
[x: string]: string;
|
|
267
|
-
} | undefined;
|
|
268
|
-
} & {
|
|
269
|
-
'x-tokenName'?: string | undefined;
|
|
270
|
-
} & {
|
|
271
|
-
tokenUrl: string;
|
|
272
|
-
} & {
|
|
273
|
-
'x-scalar-secret-client-secret': string;
|
|
274
|
-
} & {
|
|
275
|
-
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
276
|
-
}) | undefined;
|
|
277
|
-
authorizationCode?: ({
|
|
278
|
-
refreshUrl: string;
|
|
279
|
-
scopes: {
|
|
280
|
-
[x: string]: string;
|
|
281
|
-
};
|
|
282
|
-
} & {
|
|
283
|
-
'x-scalar-secret-client-id': string;
|
|
284
|
-
} & {
|
|
285
|
-
'x-scalar-secret-token': string;
|
|
286
|
-
} & {
|
|
287
|
-
'x-scalar-security-query'?: {
|
|
288
|
-
[x: string]: string;
|
|
289
|
-
} | undefined;
|
|
290
|
-
} & {
|
|
291
|
-
'x-scalar-security-body'?: {
|
|
292
|
-
[x: string]: string;
|
|
293
|
-
} | undefined;
|
|
294
|
-
} & {
|
|
295
|
-
'x-tokenName'?: string | undefined;
|
|
296
|
-
} & {
|
|
297
|
-
authorizationUrl: string;
|
|
298
|
-
tokenUrl: string;
|
|
299
|
-
} & {
|
|
300
|
-
'x-scalar-secret-client-secret': string;
|
|
301
|
-
} & {
|
|
302
|
-
'x-scalar-secret-redirect-uri': string;
|
|
303
|
-
} & {
|
|
304
|
-
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
305
|
-
} & {
|
|
306
|
-
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
307
|
-
}) | undefined;
|
|
308
|
-
};
|
|
309
|
-
} & {
|
|
310
|
-
'x-default-scopes'?: string[] | undefined;
|
|
311
|
-
}) | ({
|
|
312
|
-
description?: string | undefined;
|
|
313
|
-
} & {
|
|
314
|
-
type: "openIdConnect";
|
|
315
|
-
openIdConnectUrl: string;
|
|
316
77
|
});
|
|
317
|
-
}
|
|
78
|
+
};
|
|
79
|
+
selected: {
|
|
80
|
+
document?: {
|
|
81
|
+
selectedIndex: number;
|
|
82
|
+
selectedSchemes: {}[];
|
|
83
|
+
} | undefined;
|
|
84
|
+
path?: {
|
|
85
|
+
[x: string]: {
|
|
86
|
+
[x: string]: {
|
|
87
|
+
selectedIndex: number;
|
|
88
|
+
selectedSchemes: {}[];
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
} | undefined;
|
|
92
|
+
};
|
|
318
93
|
};
|
|
319
94
|
/**
|
|
320
95
|
* Stores the authentication schemes in local storage.
|
|
321
|
-
* @param value The
|
|
322
|
-
*/
|
|
323
|
-
setSchemas: (slug: string, value: SecuritySchemes) => void;
|
|
324
|
-
/**
|
|
325
|
-
* Retrieves and coerces the selected authentication schemes stored in local storage.
|
|
326
|
-
*/
|
|
327
|
-
getSelectedSchemes: (slug: string) => {
|
|
328
|
-
'x-scalar-selected-security'?: {
|
|
329
|
-
selectedSchemes: {}[];
|
|
330
|
-
selectedIndex: number;
|
|
331
|
-
} | undefined;
|
|
332
|
-
};
|
|
333
|
-
/**
|
|
334
|
-
* Stores the user's selected authentication schemes in local storage.
|
|
335
|
-
* @param value The XScalarSelectedSecurity object to stringify and store.
|
|
96
|
+
* @param value The Auth object to stringify and store.
|
|
336
97
|
*/
|
|
337
|
-
|
|
98
|
+
setAuth: (slug: string, value: Auth) => void;
|
|
338
99
|
};
|
|
339
100
|
/**
|
|
340
101
|
* Restores authentication secrets from local storage to the workspace store.
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uCAAuC,CAAA;AAG7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,GACwB,eAAe,EAAE,CACxG;AAOD,sDAAsD;AACtD,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc;;;;;EAgBpE;AAKD;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAMpB;;OAEG;oBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAItB;;;OAGG;oBACa,MAAM,SAAS,IAAI;CAItC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GAAI,mCAG3C;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;CAC/B,KAAG,IAIH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,UAmB7C"}
|