@scalar/api-reference 1.24.21 → 1.24.24
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/CHANGELOG.md +41 -0
- package/dist/browser/standalone.js +21905 -22407
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/components/ApiClientModal.vue.js +19 -18
- package/dist/components/ApiReference.vue.js +14 -14
- package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +130 -151
- package/dist/components/Content/Authentication/Authentication.vue.d.ts.map +1 -1
- package/dist/components/Content/Authentication/Authentication.vue.js +2 -2
- package/dist/components/Content/Authentication/Authentication.vue2.js +20 -18
- package/dist/components/Content/Content.vue.d.ts +3 -0
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +29 -27
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
- package/dist/components/Content/Lazy/Loading.vue.js +1 -1
- package/dist/components/Content/Operation/CustomRequestExamples.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/CustomRequestExamples.vue.js +1 -1
- package/dist/components/Content/Operation/CustomRequestExamples.vue2.js +19 -19
- package/dist/components/Content/Operation/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/ExampleRequest.vue.js +2 -2
- package/dist/components/Content/Operation/ExampleRequest.vue2.js +63 -59
- package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue.js +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue2.js +26 -26
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue2.js +18 -36
- package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
- package/dist/components/Content/Tag/Endpoints.vue2.js +23 -23
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +42 -0
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -0
- package/dist/components/HttpMethod/HttpMethod.vue.js +28 -0
- package/dist/components/HttpMethod/HttpMethod.vue2.js +4 -0
- package/dist/components/HttpMethod/constants.d.ts +9 -0
- package/dist/components/HttpMethod/constants.d.ts.map +1 -0
- package/dist/components/HttpMethod/constants.js +36 -0
- package/dist/components/HttpMethod/index.d.ts +2 -0
- package/dist/components/HttpMethod/index.d.ts.map +1 -0
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +4 -0
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +1 -0
- package/dist/components/HttpMethod/utils/isRequestMethod.js +7 -0
- package/dist/components/Sidebar/SidebarHttpBadge.vue.js +1 -1
- package/dist/components/Sidebar/SidebarHttpBadge.vue2.js +6 -6
- package/dist/components/api-client-bus.d.ts +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts +9 -0
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +43 -33
- package/dist/helpers/getApiClientRequest.d.ts +1 -1
- package/dist/helpers/getApiClientRequest.d.ts.map +1 -1
- package/dist/helpers/getApiClientRequest.js +12 -11
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/openClientFor.js +10 -7
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +33 -31
- package/dist/hooks/useReactiveSpec.d.ts +1 -1
- package/dist/hooks/useSidebar.js +18 -17
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -102
- package/dist/legacy/components/CardForm.vue.d.ts +10 -0
- package/dist/legacy/components/CardForm.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardForm.vue.js +13 -0
- package/dist/legacy/components/CardFormButton.vue.d.ts +12 -0
- package/dist/legacy/components/CardFormButton.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormButton.vue.js +7 -0
- package/dist/legacy/components/CardFormButton.vue2.js +18 -0
- package/dist/legacy/components/CardFormGroup.vue.d.ts +10 -0
- package/dist/legacy/components/CardFormGroup.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormGroup.vue.js +13 -0
- package/dist/legacy/components/CardFormRows.vue.d.ts +10 -0
- package/dist/legacy/components/CardFormRows.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormRows.vue.js +13 -0
- package/dist/legacy/components/CardFormTextInput.vue.d.ts +25 -0
- package/dist/legacy/components/CardFormTextInput.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormTextInput.vue.js +7 -0
- package/dist/legacy/components/CardFormTextInput.vue2.js +37 -0
- package/dist/legacy/components/SecurityScheme.vue.d.ts +19 -0
- package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -0
- package/dist/legacy/components/SecurityScheme.vue.js +7 -0
- package/dist/legacy/components/SecurityScheme.vue2.js +364 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts +26 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts.map +1 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue.js +7 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue2.js +91 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts +25 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue.js +7 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue2.js +64 -0
- package/dist/legacy/fixtures/httpHeaders.d.ts +6 -0
- package/dist/legacy/fixtures/httpHeaders.d.ts.map +1 -0
- package/dist/legacy/fixtures/httpRequestMethods.d.ts +10 -0
- package/dist/legacy/fixtures/httpRequestMethods.d.ts.map +1 -0
- package/dist/legacy/fixtures/httpRequestMethods.js +18 -0
- package/dist/legacy/fixtures/index.d.ts +3 -0
- package/dist/legacy/fixtures/index.d.ts.map +1 -0
- package/dist/legacy/helpers/createPlaceholderRequest.d.ts +6 -0
- package/dist/legacy/helpers/createPlaceholderRequest.d.ts.map +1 -0
- package/dist/legacy/helpers/createPlaceholderRequest.js +14 -0
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts +5 -0
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts.map +1 -0
- package/dist/legacy/helpers/encodeStringAsBase64.js +6 -0
- package/dist/legacy/helpers/getRequestFromAuthentication.d.ts +10 -0
- package/dist/legacy/helpers/getRequestFromAuthentication.d.ts.map +1 -0
- package/dist/legacy/helpers/getRequestFromAuthentication.js +83 -0
- package/dist/legacy/helpers/getUrlFromServerState.d.ts +6 -0
- package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -0
- package/dist/legacy/helpers/getUrlFromServerState.js +9 -0
- package/dist/legacy/helpers/humanDiff.d.ts +5 -0
- package/dist/legacy/helpers/humanDiff.d.ts.map +1 -0
- package/dist/legacy/helpers/index.d.ts +12 -0
- package/dist/legacy/helpers/index.d.ts.map +1 -0
- package/dist/legacy/helpers/mapFromArray.d.ts +5 -0
- package/dist/legacy/helpers/mapFromArray.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizeHeaders.d.ts +9 -0
- package/dist/legacy/helpers/normalizeHeaders.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizePath.d.ts +5 -0
- package/dist/legacy/helpers/normalizePath.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts +6 -0
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizeRequestMethod.js +14 -0
- package/dist/legacy/helpers/normalizeUrl.d.ts +5 -0
- package/dist/legacy/helpers/normalizeUrl.d.ts.map +1 -0
- package/dist/legacy/helpers/prepareClientRequestConfig.d.ts +24 -0
- package/dist/legacy/helpers/prepareClientRequestConfig.d.ts.map +1 -0
- package/dist/legacy/index.d.ts +5 -0
- package/dist/legacy/index.d.ts.map +1 -0
- package/dist/legacy/stores/index.d.ts +6 -0
- package/dist/legacy/stores/index.d.ts.map +1 -0
- package/dist/legacy/stores/useApiClientStore.d.ts +18 -0
- package/dist/legacy/stores/useApiClientStore.d.ts.map +1 -0
- package/dist/legacy/stores/useApiClientStore.js +32 -0
- package/dist/legacy/stores/useAuthenticationStore.d.ts +59 -0
- package/dist/legacy/stores/useAuthenticationStore.d.ts.map +1 -0
- package/dist/legacy/stores/useAuthenticationStore.js +36 -0
- package/dist/legacy/stores/useOpenApiStore.d.ts +95 -0
- package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -0
- package/dist/legacy/stores/useOpenApiStore.js +23 -0
- package/dist/legacy/stores/useRequestStore.d.ts +58 -0
- package/dist/legacy/stores/useRequestStore.d.ts.map +1 -0
- package/dist/legacy/stores/useRequestStore.js +33 -0
- package/dist/legacy/stores/useServerStore.d.ts +18 -0
- package/dist/legacy/stores/useServerStore.d.ts.map +1 -0
- package/dist/legacy/stores/useServerStore.js +18 -0
- package/dist/legacy/types.d.ts +117 -0
- package/dist/legacy/types.d.ts.map +1 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +7 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +14 -13
- package/dist/components/ApiClientModalOld.vue.d.ts +0 -36
- package/dist/components/ApiClientModalOld.vue.d.ts.map +0 -1
- package/dist/components/ApiClientModalOld.vue.js +0 -7
- package/dist/components/ApiClientModalOld.vue2.js +0 -88
- package/dist/components/Content/Schema/SchemaProperty.spec.d.ts +0 -2
- package/dist/components/Content/Schema/SchemaProperty.spec.d.ts.map +0 -1
- package/dist/features.d.ts +0 -8
- package/dist/features.d.ts.map +0 -1
- package/dist/features.js +0 -5
- package/dist/standalone.spec.d.ts +0 -2
- package/dist/standalone.spec.d.ts.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { AuthenticationState } from '@scalar/oas-utils';
|
|
2
|
+
export declare const createEmptyAuthenticationState: () => AuthenticationState;
|
|
3
|
+
export declare const useAuthenticationStore: () => {
|
|
4
|
+
authentication: {
|
|
5
|
+
customSecurity: boolean;
|
|
6
|
+
preferredSecurityScheme: string | null;
|
|
7
|
+
securitySchemes?: import("@scalar/openapi-parser").OpenAPIV2.SecurityDefinitionsObject | {
|
|
8
|
+
[key: string]: import("@scalar/openapi-parser").OpenAPIV3.ReferenceObject | import("@scalar/openapi-parser").OpenAPIV3.SecuritySchemeObject;
|
|
9
|
+
} | Record<string, import("@scalar/openapi-parser").OpenAPIV3_1.ReferenceObject | import("@scalar/openapi-parser").OpenAPIV3.SecuritySchemeObject> | undefined;
|
|
10
|
+
http: {
|
|
11
|
+
basic: {
|
|
12
|
+
username: string;
|
|
13
|
+
password: string;
|
|
14
|
+
};
|
|
15
|
+
bearer: {
|
|
16
|
+
token: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
apiKey: {
|
|
20
|
+
token: string;
|
|
21
|
+
};
|
|
22
|
+
oAuth2: {
|
|
23
|
+
clientId: string;
|
|
24
|
+
scopes: string[];
|
|
25
|
+
accessToken: string;
|
|
26
|
+
state: string;
|
|
27
|
+
username: string;
|
|
28
|
+
password: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
setAuthentication: (newState: Partial<AuthenticationState>) => {
|
|
32
|
+
customSecurity: boolean;
|
|
33
|
+
preferredSecurityScheme: string | null;
|
|
34
|
+
securitySchemes?: import("@scalar/openapi-parser").OpenAPIV2.SecurityDefinitionsObject | {
|
|
35
|
+
[key: string]: import("@scalar/openapi-parser").OpenAPIV3.ReferenceObject | import("@scalar/openapi-parser").OpenAPIV3.SecuritySchemeObject;
|
|
36
|
+
} | Record<string, import("@scalar/openapi-parser").OpenAPIV3_1.ReferenceObject | import("@scalar/openapi-parser").OpenAPIV3.SecuritySchemeObject> | undefined;
|
|
37
|
+
http: {
|
|
38
|
+
basic: {
|
|
39
|
+
username: string;
|
|
40
|
+
password: string;
|
|
41
|
+
};
|
|
42
|
+
bearer: {
|
|
43
|
+
token: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
apiKey: {
|
|
47
|
+
token: string;
|
|
48
|
+
};
|
|
49
|
+
oAuth2: {
|
|
50
|
+
clientId: string;
|
|
51
|
+
scopes: string[];
|
|
52
|
+
accessToken: string;
|
|
53
|
+
state: string;
|
|
54
|
+
username: string;
|
|
55
|
+
password: string;
|
|
56
|
+
};
|
|
57
|
+
} & Partial<AuthenticationState>;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=useAuthenticationStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuthenticationStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useAuthenticationStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAI5D,eAAO,MAAM,8BAA8B,QAAO,mBAwBhD,CAAA;AASF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAHE,QAAQ,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM/D,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ssrState as o } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { reactive as s } from "vue";
|
|
3
|
+
const a = () => ({
|
|
4
|
+
preferredSecurityScheme: null,
|
|
5
|
+
// In case the spec has no security and the user would like to add some
|
|
6
|
+
customSecurity: !1,
|
|
7
|
+
http: {
|
|
8
|
+
basic: {
|
|
9
|
+
username: "",
|
|
10
|
+
password: ""
|
|
11
|
+
},
|
|
12
|
+
bearer: {
|
|
13
|
+
token: ""
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
apiKey: {
|
|
17
|
+
token: ""
|
|
18
|
+
},
|
|
19
|
+
oAuth2: {
|
|
20
|
+
username: "",
|
|
21
|
+
password: "",
|
|
22
|
+
clientId: "",
|
|
23
|
+
scopes: [],
|
|
24
|
+
accessToken: "",
|
|
25
|
+
state: ""
|
|
26
|
+
}
|
|
27
|
+
}), t = s(
|
|
28
|
+
o["useGlobalStore-authentication"] ?? a()
|
|
29
|
+
), n = (e) => Object.assign(t, e), i = () => ({
|
|
30
|
+
authentication: t,
|
|
31
|
+
setAuthentication: n
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
a as createEmptyAuthenticationState,
|
|
35
|
+
i as useAuthenticationStore
|
|
36
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { TransformedOperation } from '@scalar/oas-utils';
|
|
2
|
+
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
|
|
3
|
+
export type OpenApiState = {
|
|
4
|
+
operation: Partial<TransformedOperation>;
|
|
5
|
+
globalSecurity: OpenAPIV3.SecurityRequirementObject[] | OpenAPIV3_1.SecurityRequirementObject[];
|
|
6
|
+
};
|
|
7
|
+
export declare const createEmptyOpenApiState: () => OpenApiState;
|
|
8
|
+
export declare const useOpenApiStore: () => {
|
|
9
|
+
openApi: {
|
|
10
|
+
operation: {
|
|
11
|
+
httpVerb?: "GET" | "POST" | "PUT" | "HEAD" | "DELETE" | "PATCH" | "OPTIONS" | "CONNECT" | "TRACE" | undefined;
|
|
12
|
+
path?: string | undefined;
|
|
13
|
+
operationId?: string | undefined;
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
description?: string | undefined;
|
|
16
|
+
information?: {
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
operationId?: string | number | undefined;
|
|
19
|
+
parameters?: {
|
|
20
|
+
name: string;
|
|
21
|
+
in?: string | undefined;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
required?: boolean | undefined;
|
|
24
|
+
deprecated?: boolean | undefined;
|
|
25
|
+
allowEmptyValue?: boolean | undefined;
|
|
26
|
+
style?: "form" | "simple" | undefined;
|
|
27
|
+
explode?: boolean | undefined;
|
|
28
|
+
allowReserved?: boolean | undefined;
|
|
29
|
+
schema?: {
|
|
30
|
+
type: string;
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
example?: any;
|
|
33
|
+
default?: any;
|
|
34
|
+
format?: string | undefined;
|
|
35
|
+
description?: string | undefined;
|
|
36
|
+
properties?: Record<string, import("@scalar/oas-utils").Schema> | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
example?: any;
|
|
39
|
+
examples?: (Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>) | undefined;
|
|
40
|
+
}[] | undefined;
|
|
41
|
+
responses?: Record<string, import("@scalar/oas-utils").ScalarResponse> | undefined;
|
|
42
|
+
security?: OpenAPIV3.SecurityRequirementObject[] | undefined;
|
|
43
|
+
requestBody?: {
|
|
44
|
+
description?: string | undefined;
|
|
45
|
+
required?: boolean | undefined;
|
|
46
|
+
content?: import("@scalar/oas-utils").RequestBodyMimeTypes | undefined;
|
|
47
|
+
} | undefined;
|
|
48
|
+
summary?: string | undefined;
|
|
49
|
+
tags?: string[] | undefined;
|
|
50
|
+
deprecated?: boolean | undefined;
|
|
51
|
+
'x-custom-examples'?: {
|
|
52
|
+
lang: string;
|
|
53
|
+
label: string;
|
|
54
|
+
source: string;
|
|
55
|
+
}[] | undefined;
|
|
56
|
+
'x-codeSamples'?: {
|
|
57
|
+
lang: string;
|
|
58
|
+
label: string;
|
|
59
|
+
source: string;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
'x-code-samples'?: {
|
|
62
|
+
lang: string;
|
|
63
|
+
label: string;
|
|
64
|
+
source: string;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
pathParameters?: {
|
|
68
|
+
name: string;
|
|
69
|
+
in?: string | undefined;
|
|
70
|
+
description?: string | undefined;
|
|
71
|
+
required?: boolean | undefined;
|
|
72
|
+
deprecated?: boolean | undefined;
|
|
73
|
+
allowEmptyValue?: boolean | undefined;
|
|
74
|
+
style?: "form" | "simple" | undefined;
|
|
75
|
+
explode?: boolean | undefined;
|
|
76
|
+
allowReserved?: boolean | undefined;
|
|
77
|
+
schema?: {
|
|
78
|
+
type: string;
|
|
79
|
+
name?: string | undefined;
|
|
80
|
+
example?: any;
|
|
81
|
+
default?: any;
|
|
82
|
+
format?: string | undefined;
|
|
83
|
+
description?: string | undefined;
|
|
84
|
+
properties?: Record<string, import("@scalar/oas-utils").Schema> | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
example?: any;
|
|
87
|
+
examples?: (Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>) | undefined;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
};
|
|
90
|
+
globalSecurity: OpenAPIV3.SecurityRequirementObject[] | OpenAPIV3_1.SecurityRequirementObject[];
|
|
91
|
+
};
|
|
92
|
+
setOperation: (newOperation: TransformedOperation | undefined) => void;
|
|
93
|
+
setGlobalSecurity: (newGlobalSecurity: OpenAPIV3_1.SecurityRequirementObject[] | undefined) => void;
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=useOpenApiStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOpenApiStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useOpenApiStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAGpE,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACxC,cAAc,EACV,SAAS,CAAC,yBAAyB,EAAE,GACrC,WAAW,CAAC,yBAAyB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,uBAAuB,QAAO,YAGzC,CAAA;AAoBF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA3BtB,UAAU,yBAAyB,EAAE,GACrC,YAAY,yBAAyB,EAAE;;iCAUT,oBAAoB,GAAG,SAAS;2CAQ/C,YAAY,yBAAyB,EAAE,GAAG,SAAS;CAYtE,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { reactive as o } from "vue";
|
|
2
|
+
const i = () => ({
|
|
3
|
+
operation: {},
|
|
4
|
+
globalSecurity: []
|
|
5
|
+
}), t = o(i()), n = (e) => {
|
|
6
|
+
Object.assign(t, {
|
|
7
|
+
...t,
|
|
8
|
+
operation: e
|
|
9
|
+
});
|
|
10
|
+
}, c = (e) => {
|
|
11
|
+
Object.assign(t, {
|
|
12
|
+
...t,
|
|
13
|
+
globalSecurity: e
|
|
14
|
+
});
|
|
15
|
+
}, r = () => ({
|
|
16
|
+
openApi: t,
|
|
17
|
+
setOperation: n,
|
|
18
|
+
setGlobalSecurity: c
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
i as createEmptyOpenApiState,
|
|
22
|
+
r as useOpenApiStore
|
|
23
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ClientRequestConfig, RequestResult } from '../types';
|
|
2
|
+
type RequestHistoryEntry = RequestResult;
|
|
3
|
+
export declare const useRequestStore: () => {
|
|
4
|
+
readOnly: import("vue").Ref<boolean>;
|
|
5
|
+
activeRequest: {
|
|
6
|
+
id?: string | undefined;
|
|
7
|
+
name?: string | undefined;
|
|
8
|
+
url: string;
|
|
9
|
+
type: string;
|
|
10
|
+
path: string;
|
|
11
|
+
variables?: {
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string | null | undefined;
|
|
14
|
+
value: string | number | Record<string, any>;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
}[] | undefined;
|
|
18
|
+
query?: {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string | null | undefined;
|
|
21
|
+
value: string | number | Record<string, any>;
|
|
22
|
+
required?: boolean | undefined;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
}[] | undefined;
|
|
25
|
+
cookies?: {
|
|
26
|
+
name: string;
|
|
27
|
+
description?: string | null | undefined;
|
|
28
|
+
value: string | number | Record<string, any>;
|
|
29
|
+
required?: boolean | undefined;
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
}[] | undefined;
|
|
32
|
+
headers?: {
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string | null | undefined;
|
|
35
|
+
value: string | number | Record<string, any>;
|
|
36
|
+
required?: boolean | undefined;
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
}[] | undefined;
|
|
39
|
+
body?: string | undefined;
|
|
40
|
+
formData?: {
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string | null | undefined;
|
|
43
|
+
value: string | number | Record<string, any>;
|
|
44
|
+
required?: boolean | undefined;
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
}[] | undefined;
|
|
47
|
+
};
|
|
48
|
+
activeResponse: import("vue").ComputedRef<import("../types").ClientResponse | null>;
|
|
49
|
+
requestHistory: Record<string, RequestResult>;
|
|
50
|
+
requestHistoryOrder: import("vue").Ref<string[]>;
|
|
51
|
+
activeRequestId: import("vue").Ref<string>;
|
|
52
|
+
setActiveResponse: (historyID: string) => void;
|
|
53
|
+
resetActiveResponse: () => void;
|
|
54
|
+
addRequestToHistory: (value: RequestHistoryEntry) => void;
|
|
55
|
+
setActiveRequest: (request: ClientRequestConfig) => void;
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=useRequestStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRequestStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useRequestStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMlE,KAAK,mBAAmB,GAAG,aAAa,CAAA;AA8DxC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCApCU,MAAM;;iCAPR,mBAAmB;gCA2BpB,mBAAmB;CA2BpD,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { reactive as u, ref as n, computed as d } from "vue";
|
|
2
|
+
import { createPlaceholderRequest as p } from "../helpers/createPlaceholderRequest.js";
|
|
3
|
+
const o = u({}), a = n([]), s = n(""), r = u(p()), l = (e) => {
|
|
4
|
+
o[e.responseId] = e, s.value = e.responseId, a.value.unshift(e.responseId);
|
|
5
|
+
}, v = (e) => {
|
|
6
|
+
var i;
|
|
7
|
+
s.value = e;
|
|
8
|
+
const t = (i = o[e]) == null ? void 0 : i.request, c = JSON.parse(JSON.stringify(t));
|
|
9
|
+
c.body = JSON.stringify((t == null ? void 0 : t.body) ?? "", null, 2), Object.assign(r, c);
|
|
10
|
+
}, q = d(
|
|
11
|
+
() => {
|
|
12
|
+
var e;
|
|
13
|
+
return s.value ? (e = o[s.value ?? ""]) == null ? void 0 : e.response : null;
|
|
14
|
+
}
|
|
15
|
+
), R = (e) => {
|
|
16
|
+
Object.assign(r, e);
|
|
17
|
+
}, y = () => {
|
|
18
|
+
s.value = "";
|
|
19
|
+
}, O = n(!0), b = () => ({
|
|
20
|
+
readOnly: O,
|
|
21
|
+
activeRequest: r,
|
|
22
|
+
activeResponse: q,
|
|
23
|
+
requestHistory: o,
|
|
24
|
+
requestHistoryOrder: a,
|
|
25
|
+
activeRequestId: s,
|
|
26
|
+
setActiveResponse: v,
|
|
27
|
+
resetActiveResponse: y,
|
|
28
|
+
addRequestToHistory: l,
|
|
29
|
+
setActiveRequest: R
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
b as useRequestStore
|
|
33
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ServerState } from '../types';
|
|
2
|
+
export declare const createEmptyServerState: () => ServerState;
|
|
3
|
+
export declare const useServerStore: () => {
|
|
4
|
+
server: {
|
|
5
|
+
selectedServer: number | null;
|
|
6
|
+
description?: string | undefined;
|
|
7
|
+
servers?: {
|
|
8
|
+
url: string;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
variables?: import("../types").ServerVariables | undefined;
|
|
11
|
+
}[] | undefined;
|
|
12
|
+
variables: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
setServer: (newState: Partial<ServerState>) => void;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useServerStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useServerStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useServerStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,eAAO,MAAM,sBAAsB,QAAO,WAIxC,CAAA;AAWF,eAAO,MAAM,cAAc;;;;;;;;;;;;;0BAPE,QAAQ,WAAW,CAAC;CAU/C,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive as t } from "vue";
|
|
2
|
+
const s = () => ({
|
|
3
|
+
selectedServer: null,
|
|
4
|
+
servers: [],
|
|
5
|
+
variables: {}
|
|
6
|
+
}), e = t(s()), c = (r) => {
|
|
7
|
+
Object.assign(e, {
|
|
8
|
+
...e,
|
|
9
|
+
...r
|
|
10
|
+
});
|
|
11
|
+
}, v = () => ({
|
|
12
|
+
server: e,
|
|
13
|
+
setServer: c
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
s as createEmptyServerState,
|
|
17
|
+
v as useServerStore
|
|
18
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { BaseParameter } from '@scalar/oas-utils';
|
|
2
|
+
export type Header = BaseParameter;
|
|
3
|
+
export type Query = BaseParameter;
|
|
4
|
+
export type Cookie = BaseParameter;
|
|
5
|
+
export type FormDataItem = BaseParameter;
|
|
6
|
+
export type GeneratedParameter = {
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
/** Complete request state for a client request */
|
|
11
|
+
export type ClientRequestConfig = {
|
|
12
|
+
id?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
url: string;
|
|
15
|
+
/** HTTP Request Method */
|
|
16
|
+
type: string;
|
|
17
|
+
/** Request path */
|
|
18
|
+
path: string;
|
|
19
|
+
/** Variables */
|
|
20
|
+
variables?: BaseParameter[];
|
|
21
|
+
/** Query parameters */
|
|
22
|
+
query?: Query[];
|
|
23
|
+
/** Cookies */
|
|
24
|
+
cookies?: Cookie[];
|
|
25
|
+
/** Request headers */
|
|
26
|
+
headers?: Header[];
|
|
27
|
+
/** Content type matched body */
|
|
28
|
+
body?: string;
|
|
29
|
+
/** Optional form data body */
|
|
30
|
+
formData?: FormDataItem[];
|
|
31
|
+
};
|
|
32
|
+
/** Formatted request for the proxy server */
|
|
33
|
+
export type ProxyPayload = {
|
|
34
|
+
method: string;
|
|
35
|
+
url: string;
|
|
36
|
+
body: string;
|
|
37
|
+
headers: Header[];
|
|
38
|
+
auth: Record<string, string>;
|
|
39
|
+
grpc: boolean;
|
|
40
|
+
};
|
|
41
|
+
/** Client response from the proxy */
|
|
42
|
+
export type ClientResponse = {
|
|
43
|
+
cookies: Record<string, string>;
|
|
44
|
+
headers: Record<string, string>;
|
|
45
|
+
statusCode: number;
|
|
46
|
+
statusText: string;
|
|
47
|
+
data: string;
|
|
48
|
+
query: Record<string, any>;
|
|
49
|
+
duration: number;
|
|
50
|
+
};
|
|
51
|
+
export type SendRequestConfig = Partial<ClientRequestConfig> & Required<Pick<ClientRequestConfig, 'url'>>;
|
|
52
|
+
export type RequestResult = {
|
|
53
|
+
request: ClientRequestConfig;
|
|
54
|
+
response: ClientResponse;
|
|
55
|
+
responseId: string;
|
|
56
|
+
sentTime: number;
|
|
57
|
+
};
|
|
58
|
+
export type Schema = {
|
|
59
|
+
format: string;
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
export type Security = Record<string, any>;
|
|
63
|
+
export type ContentProperties = {
|
|
64
|
+
[key: string]: {
|
|
65
|
+
type: string;
|
|
66
|
+
format: string;
|
|
67
|
+
example: string;
|
|
68
|
+
required: string[];
|
|
69
|
+
description?: string;
|
|
70
|
+
properties?: ContentProperties;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export type ContentSchemaSchema = {
|
|
74
|
+
type: string;
|
|
75
|
+
required: string[];
|
|
76
|
+
properties: ContentProperties;
|
|
77
|
+
};
|
|
78
|
+
export type ContentSchema = {
|
|
79
|
+
schema: ContentSchemaSchema;
|
|
80
|
+
};
|
|
81
|
+
export type ContentType = 'application/json' | 'application/xml' | 'text/plain' | 'text/html' | 'application/x-www-form-urlencoded' | 'multipart/form-data';
|
|
82
|
+
export type Content = {
|
|
83
|
+
[key in ContentType]: ContentSchema;
|
|
84
|
+
};
|
|
85
|
+
export type RequestBody = {
|
|
86
|
+
description: string;
|
|
87
|
+
content: Content;
|
|
88
|
+
required: boolean;
|
|
89
|
+
};
|
|
90
|
+
export type Response = {
|
|
91
|
+
description: string;
|
|
92
|
+
content: any;
|
|
93
|
+
};
|
|
94
|
+
export type Server = {
|
|
95
|
+
url: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
variables?: ServerVariables;
|
|
98
|
+
};
|
|
99
|
+
export type ServerVariables = Record<string, {
|
|
100
|
+
default?: string | number;
|
|
101
|
+
description?: string;
|
|
102
|
+
enum?: (string | number)[];
|
|
103
|
+
}>;
|
|
104
|
+
export type Variable = {
|
|
105
|
+
name: string;
|
|
106
|
+
value: string;
|
|
107
|
+
enum?: (string | number)[];
|
|
108
|
+
};
|
|
109
|
+
export type ServerState = {
|
|
110
|
+
selectedServer: null | number;
|
|
111
|
+
description?: string;
|
|
112
|
+
servers?: Server[];
|
|
113
|
+
variables: {
|
|
114
|
+
[key: string]: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/legacy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD,MAAM,MAAM,MAAM,GAAG,aAAa,CAAA;AAElC,MAAM,MAAM,KAAK,GAAG,aAAa,CAAA;AAEjC,MAAM,MAAM,MAAM,GAAG,aAAa,CAAA;AAElC,MAAM,MAAM,YAAY,GAAG,aAAa,CAAA;AAExC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB;IAChB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAA;IAC3B,uBAAuB;IACvB,KAAK,CAAC,EAAE,KAAK,EAAE,CAAA;IACf,cAAc;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,YA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B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,IAAI,GAAG,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACrC,CAAA"}
|
package/dist/stores/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stores/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stores/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,yCAAyC,CAAA"}
|