@scalar/types 0.1.15 → 0.2.1
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 +25 -0
- package/dist/api-client/api-client-plugin.d.ts +123 -0
- package/dist/api-client/api-client-plugin.d.ts.map +1 -0
- package/dist/api-client/api-client-plugin.js +32 -0
- package/dist/api-client/api-client-plugin.js.map +7 -0
- package/dist/api-client/index.d.ts +2 -0
- package/dist/api-client/index.d.ts.map +1 -0
- package/dist/api-client/index.js +5 -0
- package/dist/api-client/index.js.map +7 -0
- package/dist/api-reference/api-reference-configuration.d.ts +440 -33
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +4 -1
- package/dist/api-reference/api-reference-configuration.js.map +2 -2
- package/dist/entities/security-scheme.d.ts +10 -10
- package/dist/legacy/reference-config.d.ts +1 -4
- package/dist/legacy/reference-config.d.ts.map +1 -1
- package/dist/legacy/reference-config.js.map +2 -2
- package/package.json +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @scalar/types
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4440949: chore: bumping packages
|
|
8
|
+
- Updated dependencies [4440949]
|
|
9
|
+
- @scalar/openapi-types@0.3.1
|
|
10
|
+
|
|
11
|
+
## 0.2.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 483ca93: chore: require Node 20 (or above)
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [483ca93]
|
|
20
|
+
- @scalar/openapi-types@0.3.0
|
|
21
|
+
|
|
22
|
+
## 0.1.16
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- be8a6ec: chore: remove unused HarRequestWithPath
|
|
27
|
+
|
|
3
28
|
## 0.1.15
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ApiClientPluginSchema: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
views: z.ZodObject<{
|
|
5
|
+
'request.section': z.ZodArray<z.ZodObject<{
|
|
6
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7
|
+
component: z.ZodUnknown;
|
|
8
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
title?: string | undefined;
|
|
11
|
+
component?: unknown;
|
|
12
|
+
props?: Record<string, any> | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
title?: string | undefined;
|
|
15
|
+
component?: unknown;
|
|
16
|
+
props?: Record<string, any> | undefined;
|
|
17
|
+
}>, "many">;
|
|
18
|
+
'response.section': z.ZodArray<z.ZodObject<{
|
|
19
|
+
title: z.ZodOptional<z.ZodString>;
|
|
20
|
+
component: z.ZodUnknown;
|
|
21
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
title?: string | undefined;
|
|
24
|
+
component?: unknown;
|
|
25
|
+
props?: Record<string, any> | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
title?: string | undefined;
|
|
28
|
+
component?: unknown;
|
|
29
|
+
props?: Record<string, any> | undefined;
|
|
30
|
+
}>, "many">;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
'request.section': {
|
|
33
|
+
title?: string | undefined;
|
|
34
|
+
component?: unknown;
|
|
35
|
+
props?: Record<string, any> | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
'response.section': {
|
|
38
|
+
title?: string | undefined;
|
|
39
|
+
component?: unknown;
|
|
40
|
+
props?: Record<string, any> | undefined;
|
|
41
|
+
}[];
|
|
42
|
+
}, {
|
|
43
|
+
'request.section': {
|
|
44
|
+
title?: string | undefined;
|
|
45
|
+
component?: unknown;
|
|
46
|
+
props?: Record<string, any> | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
'response.section': {
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
component?: unknown;
|
|
51
|
+
props?: Record<string, any> | undefined;
|
|
52
|
+
}[];
|
|
53
|
+
}>;
|
|
54
|
+
hooks: z.ZodObject<{
|
|
55
|
+
onBeforeRequest: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>;
|
|
56
|
+
onResponseReceived: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
57
|
+
response: z.ZodType<Response, z.ZodTypeDef, Response>;
|
|
58
|
+
operation: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
response: Response;
|
|
61
|
+
operation: Record<string, any>;
|
|
62
|
+
}, {
|
|
63
|
+
response: Response;
|
|
64
|
+
operation: Record<string, any>;
|
|
65
|
+
}>], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
onBeforeRequest: (...args: unknown[]) => void | Promise<void>;
|
|
68
|
+
onResponseReceived: (args_0: {
|
|
69
|
+
response: Response;
|
|
70
|
+
operation: Record<string, any>;
|
|
71
|
+
}, ...args: unknown[]) => void | Promise<void>;
|
|
72
|
+
}, {
|
|
73
|
+
onBeforeRequest: (...args: unknown[]) => void | Promise<void>;
|
|
74
|
+
onResponseReceived: (args_0: {
|
|
75
|
+
response: Response;
|
|
76
|
+
operation: Record<string, any>;
|
|
77
|
+
}, ...args: unknown[]) => void | Promise<void>;
|
|
78
|
+
}>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
name: string;
|
|
81
|
+
views: {
|
|
82
|
+
'request.section': {
|
|
83
|
+
title?: string | undefined;
|
|
84
|
+
component?: unknown;
|
|
85
|
+
props?: Record<string, any> | undefined;
|
|
86
|
+
}[];
|
|
87
|
+
'response.section': {
|
|
88
|
+
title?: string | undefined;
|
|
89
|
+
component?: unknown;
|
|
90
|
+
props?: Record<string, any> | undefined;
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
hooks: {
|
|
94
|
+
onBeforeRequest: (...args: unknown[]) => void | Promise<void>;
|
|
95
|
+
onResponseReceived: (args_0: {
|
|
96
|
+
response: Response;
|
|
97
|
+
operation: Record<string, any>;
|
|
98
|
+
}, ...args: unknown[]) => void | Promise<void>;
|
|
99
|
+
};
|
|
100
|
+
}, {
|
|
101
|
+
name: string;
|
|
102
|
+
views: {
|
|
103
|
+
'request.section': {
|
|
104
|
+
title?: string | undefined;
|
|
105
|
+
component?: unknown;
|
|
106
|
+
props?: Record<string, any> | undefined;
|
|
107
|
+
}[];
|
|
108
|
+
'response.section': {
|
|
109
|
+
title?: string | undefined;
|
|
110
|
+
component?: unknown;
|
|
111
|
+
props?: Record<string, any> | undefined;
|
|
112
|
+
}[];
|
|
113
|
+
};
|
|
114
|
+
hooks: {
|
|
115
|
+
onBeforeRequest: (...args: unknown[]) => void | Promise<void>;
|
|
116
|
+
onResponseReceived: (args_0: {
|
|
117
|
+
response: Response;
|
|
118
|
+
operation: Record<string, any>;
|
|
119
|
+
}, ...args: unknown[]) => void | Promise<void>;
|
|
120
|
+
};
|
|
121
|
+
}>>;
|
|
122
|
+
export type ApiClientPlugin = z.infer<typeof ApiClientPluginSchema>;
|
|
123
|
+
//# sourceMappingURL=api-client-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client-plugin.d.ts","sourceRoot":"","sources":["../../src/api-client/api-client-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA4BvB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMjC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const SectionViewSchema = z.object({
|
|
3
|
+
title: z.string().optional(),
|
|
4
|
+
// Since this is meant to be a Vue component, we'll use unknown
|
|
5
|
+
component: z.unknown(),
|
|
6
|
+
props: z.record(z.any()).optional()
|
|
7
|
+
});
|
|
8
|
+
const ViewsSchema = z.object({
|
|
9
|
+
"request.section": z.array(SectionViewSchema),
|
|
10
|
+
"response.section": z.array(SectionViewSchema)
|
|
11
|
+
});
|
|
12
|
+
const HooksSchema = z.object({
|
|
13
|
+
onBeforeRequest: z.function().returns(z.union([z.void(), z.promise(z.void())])),
|
|
14
|
+
onResponseReceived: z.function().args(
|
|
15
|
+
z.object({
|
|
16
|
+
response: z.instanceof(Response),
|
|
17
|
+
// Ideally, we'd have the Operation type here, but we don't.
|
|
18
|
+
operation: z.record(z.any())
|
|
19
|
+
})
|
|
20
|
+
).returns(z.union([z.void(), z.promise(z.void())]))
|
|
21
|
+
});
|
|
22
|
+
const ApiClientPluginSchema = z.function().returns(
|
|
23
|
+
z.object({
|
|
24
|
+
name: z.string(),
|
|
25
|
+
views: ViewsSchema,
|
|
26
|
+
hooks: HooksSchema
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
export {
|
|
30
|
+
ApiClientPluginSchema
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=api-client-plugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/api-client/api-client-plugin.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\nconst SectionViewSchema = z.object({\n title: z.string().optional(),\n // Since this is meant to be a Vue component, we'll use unknown\n component: z.unknown(),\n props: z.record(z.any()).optional(),\n})\n\nconst ViewsSchema = z.object({\n 'request.section': z.array(SectionViewSchema),\n 'response.section': z.array(SectionViewSchema),\n})\n\nconst HooksSchema = z.object({\n onBeforeRequest: z.function().returns(z.union([z.void(), z.promise(z.void())])),\n onResponseReceived: z\n .function()\n .args(\n z.object({\n response: z.instanceof(Response),\n // Ideally, we'd have the Operation type here, but we don't.\n operation: z.record(z.any()),\n }),\n )\n .returns(z.union([z.void(), z.promise(z.void())])),\n})\n\nexport const ApiClientPluginSchema = z.function().returns(\n z.object({\n name: z.string(),\n views: ViewsSchema,\n hooks: HooksSchema,\n }),\n)\n\nexport type ApiClientPlugin = z.infer<typeof ApiClientPluginSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAElB,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAE3B,WAAW,EAAE,QAAQ;AAAA,EACrB,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AACpC,CAAC;AAED,MAAM,cAAc,EAAE,OAAO;AAAA,EAC3B,mBAAmB,EAAE,MAAM,iBAAiB;AAAA,EAC5C,oBAAoB,EAAE,MAAM,iBAAiB;AAC/C,CAAC;AAED,MAAM,cAAc,EAAE,OAAO;AAAA,EAC3B,iBAAiB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAAA,EAC9E,oBAAoB,EACjB,SAAS,EACT;AAAA,IACC,EAAE,OAAO;AAAA,MACP,UAAU,EAAE,WAAW,QAAQ;AAAA;AAAA,MAE/B,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IAC7B,CAAC;AAAA,EACH,EACC,QAAQ,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAEM,MAAM,wBAAwB,EAAE,SAAS,EAAE;AAAA,EAChD,EAAE,OAAO;AAAA,IACP,MAAM,EAAE,OAAO;AAAA,IACf,OAAO;AAAA,IACP,OAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA"}
|