@scalar/oas-utils 0.2.124 → 0.2.126
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 +24 -0
- package/dist/entities/spec/request-examples.d.ts +27 -27
- package/dist/entities/spec/spec-objects.d.ts.map +1 -1
- package/dist/entities/spec/spec-objects.js +8 -1
- package/dist/helpers/fetch-document.d.ts +7 -0
- package/dist/helpers/fetch-document.d.ts.map +1 -0
- package/dist/helpers/fetch-document.js +35 -0
- package/dist/helpers/fetch-with-proxy-fallback.d.ts +3 -3
- package/dist/helpers/fetch-with-proxy-fallback.d.ts.map +1 -1
- package/dist/helpers/fetch-with-proxy-fallback.js +6 -6
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/redirect-to-proxy.d.ts +15 -5
- package/dist/helpers/redirect-to-proxy.d.ts.map +1 -1
- package/dist/helpers/redirect-to-proxy.js +68 -23
- package/dist/spec-getters/get-example-from-schema.d.ts.map +1 -1
- package/dist/spec-getters/get-example-from-schema.js +12 -3
- package/dist/transforms/import-spec.d.ts +1 -1
- package/dist/transforms/import-spec.d.ts.map +1 -1
- package/dist/transforms/import-spec.js +1 -1
- package/package.json +6 -6
- package/dist/entities/spec/security.d.ts +0 -1436
- package/dist/entities/spec/security.d.ts.map +0 -1
- package/dist/entities/spec/security.js +0 -179
- package/dist/helpers/fetch-spec-from-url.d.ts +0 -7
- package/dist/helpers/fetch-spec-from-url.d.ts.map +0 -1
- package/dist/helpers/fetch-spec-from-url.js +0 -36
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/security.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsBvB,eAAO,MAAM,sBAAsB,wCAAyC,CAAA;AAc5E,eAAO,MAAM,oBAAoB;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2M1E,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { nanoidSchema } from '@scalar/types/utils';
|
|
3
|
-
|
|
4
|
-
// ---------------------------------------------------------------------------
|
|
5
|
-
// COMMON PROPS FOR ALL SECURITY SCHEMES
|
|
6
|
-
/** Some common properties used in all security schemes */
|
|
7
|
-
const commonProps = z.object({
|
|
8
|
-
/* A description for security scheme. CommonMark syntax MAY be used for rich text representation. */
|
|
9
|
-
description: z.string().optional(),
|
|
10
|
-
});
|
|
11
|
-
const extendedSecuritySchema = z.object({
|
|
12
|
-
uid: nanoidSchema.brand(),
|
|
13
|
-
/** The name key that links a security requirement to a security object */
|
|
14
|
-
nameKey: z.string().optional().default(''),
|
|
15
|
-
});
|
|
16
|
-
// ---------------------------------------------------------------------------
|
|
17
|
-
// API KEY
|
|
18
|
-
const securitySchemeApiKeyIn = ['query', 'header', 'cookie'];
|
|
19
|
-
const oasSecuritySchemeApiKey = commonProps.extend({
|
|
20
|
-
type: z.literal('apiKey'),
|
|
21
|
-
/** REQUIRED. The name of the header, query or cookie parameter to be used. */
|
|
22
|
-
name: z.string().optional().default(''),
|
|
23
|
-
/** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
|
|
24
|
-
in: z.enum(securitySchemeApiKeyIn).optional().default('header'),
|
|
25
|
-
});
|
|
26
|
-
const apiKeyValueSchema = z.object({
|
|
27
|
-
value: z.string().default(''),
|
|
28
|
-
});
|
|
29
|
-
const securityApiKeySchema = oasSecuritySchemeApiKey.merge(extendedSecuritySchema).merge(apiKeyValueSchema);
|
|
30
|
-
// ---------------------------------------------------------------------------
|
|
31
|
-
// HTTP
|
|
32
|
-
const oasSecuritySchemeHttp = commonProps.extend({
|
|
33
|
-
type: z.literal('http'),
|
|
34
|
-
/**
|
|
35
|
-
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
36
|
-
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
37
|
-
*/
|
|
38
|
-
scheme: z
|
|
39
|
-
.string()
|
|
40
|
-
.toLowerCase()
|
|
41
|
-
.pipe(z.enum(['basic', 'bearer']))
|
|
42
|
-
.optional()
|
|
43
|
-
.default('basic'),
|
|
44
|
-
/**
|
|
45
|
-
* A hint to the client to identify how the bearer token is formatted.
|
|
46
|
-
* Bearer tokens are usually generated by an authorization server, so
|
|
47
|
-
* this information is primarily for documentation purposes.
|
|
48
|
-
*/
|
|
49
|
-
bearerFormat: z
|
|
50
|
-
.union([z.literal('JWT'), z.string()])
|
|
51
|
-
.optional()
|
|
52
|
-
.default('JWT'),
|
|
53
|
-
});
|
|
54
|
-
const httpValueSchema = z.object({
|
|
55
|
-
username: z.string().default(''),
|
|
56
|
-
password: z.string().default(''),
|
|
57
|
-
token: z.string().default(''),
|
|
58
|
-
});
|
|
59
|
-
const securityHttpSchema = oasSecuritySchemeHttp.merge(extendedSecuritySchema).merge(httpValueSchema);
|
|
60
|
-
// ---------------------------------------------------------------------------
|
|
61
|
-
// OPENID CONNECT
|
|
62
|
-
const oasSecuritySchemeOpenId = commonProps.extend({
|
|
63
|
-
type: z.literal('openIdConnect'),
|
|
64
|
-
/**
|
|
65
|
-
* REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the
|
|
66
|
-
* form of a URL. The OpenID Connect standard requires the use of TLS.
|
|
67
|
-
*/
|
|
68
|
-
openIdConnectUrl: z.string().optional().default(''),
|
|
69
|
-
});
|
|
70
|
-
const securityOpenIdSchema = oasSecuritySchemeOpenId.merge(extendedSecuritySchema);
|
|
71
|
-
// ---------------------------------------------------------------------------
|
|
72
|
-
/**
|
|
73
|
-
* REQUIRED. The authorization URL to be used for this flow. This MUST be in
|
|
74
|
-
* the form of a URL. The OAuth2 standard requires the use of TLS.
|
|
75
|
-
*/
|
|
76
|
-
const authorizationUrl = z.string().default('');
|
|
77
|
-
/**
|
|
78
|
-
* REQUIRED. The token URL to be used for this flow. This MUST be in the
|
|
79
|
-
* form of a URL. The OAuth2 standard requires the use of TLS.
|
|
80
|
-
*/
|
|
81
|
-
const tokenUrl = z.string().default('');
|
|
82
|
-
/** Common properties used across all oauth2 flows */
|
|
83
|
-
const flowsCommon = z.object({
|
|
84
|
-
/**
|
|
85
|
-
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
86
|
-
* URL. The OAuth2 standard requires the use of TLS.
|
|
87
|
-
*/
|
|
88
|
-
'refreshUrl': z.string().optional().default(''),
|
|
89
|
-
/**
|
|
90
|
-
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
91
|
-
* between the scope name and a short description for it. The map MAY be empty.
|
|
92
|
-
*/
|
|
93
|
-
'scopes': z.record(z.string(), z.string().optional().default('')).optional().default({}).catch({}),
|
|
94
|
-
'selectedScopes': z.array(z.string()).optional().default([]),
|
|
95
|
-
/** Extension to save the client Id associated with an oauth flow */
|
|
96
|
-
'x-scalar-client-id': z.string().optional().default(''),
|
|
97
|
-
/** The auth token */
|
|
98
|
-
'token': z.string().default(''),
|
|
99
|
-
});
|
|
100
|
-
/** Setup a default redirect uri if we can */
|
|
101
|
-
const defaultRedirectUri = typeof window !== 'undefined' ? window.location.origin + window.location.pathname : '';
|
|
102
|
-
/** Options for the x-usePkce extension */
|
|
103
|
-
const pkceOptions = ['SHA-256', 'plain', 'no'];
|
|
104
|
-
/** Oauth2 security scheme */
|
|
105
|
-
const oasSecuritySchemeOauth2 = commonProps.extend({
|
|
106
|
-
type: z.literal('oauth2'),
|
|
107
|
-
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
108
|
-
flows: z
|
|
109
|
-
.object({
|
|
110
|
-
/** Configuration for the OAuth Implicit flow */
|
|
111
|
-
implicit: flowsCommon.extend({
|
|
112
|
-
'type': z.literal('implicit'),
|
|
113
|
-
authorizationUrl,
|
|
114
|
-
'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),
|
|
115
|
-
}),
|
|
116
|
-
/** Configuration for the OAuth Resource Owner Password flow */
|
|
117
|
-
password: flowsCommon.extend({
|
|
118
|
-
type: z.literal('password'),
|
|
119
|
-
tokenUrl,
|
|
120
|
-
clientSecret: z.string().default(''),
|
|
121
|
-
username: z.string().default(''),
|
|
122
|
-
password: z.string().default(''),
|
|
123
|
-
}),
|
|
124
|
-
/** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */
|
|
125
|
-
clientCredentials: flowsCommon.extend({
|
|
126
|
-
type: z.literal('clientCredentials'),
|
|
127
|
-
tokenUrl,
|
|
128
|
-
clientSecret: z.string().default(''),
|
|
129
|
-
}),
|
|
130
|
-
/** Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.*/
|
|
131
|
-
authorizationCode: flowsCommon.extend({
|
|
132
|
-
'type': z.literal('authorizationCode'),
|
|
133
|
-
authorizationUrl,
|
|
134
|
-
/**
|
|
135
|
-
* Whether to use PKCE for the authorization code flow.
|
|
136
|
-
*
|
|
137
|
-
* TODO: add docs
|
|
138
|
-
*/
|
|
139
|
-
'x-usePkce': z.enum(pkceOptions).optional().default('no'),
|
|
140
|
-
'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),
|
|
141
|
-
tokenUrl,
|
|
142
|
-
'clientSecret': z.string().default(''),
|
|
143
|
-
}),
|
|
144
|
-
})
|
|
145
|
-
.partial()
|
|
146
|
-
.default({
|
|
147
|
-
implicit: { type: 'implicit', authorizationUrl: 'http://localhost:8080' },
|
|
148
|
-
}),
|
|
149
|
-
});
|
|
150
|
-
const securityOauthSchema = oasSecuritySchemeOauth2.merge(extendedSecuritySchema);
|
|
151
|
-
// ---------------------------------------------------------------------------
|
|
152
|
-
// Final Types
|
|
153
|
-
/**
|
|
154
|
-
* Security Requirement
|
|
155
|
-
* Lists the required security schemes to execute this operation OR the whole collection/spec.
|
|
156
|
-
* The name used for each property MUST correspond to a security scheme declared in the Security
|
|
157
|
-
* Schemes under the Components Object.
|
|
158
|
-
*
|
|
159
|
-
* The key (name) here will be matched to the key of the securityScheme for linking
|
|
160
|
-
*
|
|
161
|
-
* @see https://spec.openapis.org/oas/latest.html#security-requirement-object
|
|
162
|
-
*/
|
|
163
|
-
z.record(z.string(), z.array(z.string()).optional().default([]));
|
|
164
|
-
/** OAS Compliant security schemes */
|
|
165
|
-
z.union([
|
|
166
|
-
oasSecuritySchemeApiKey,
|
|
167
|
-
oasSecuritySchemeHttp,
|
|
168
|
-
oasSecuritySchemeOauth2,
|
|
169
|
-
oasSecuritySchemeOpenId,
|
|
170
|
-
]);
|
|
171
|
-
/** Extended security schemes for workspace usage */
|
|
172
|
-
const securitySchemeSchema = z.union([
|
|
173
|
-
securityApiKeySchema,
|
|
174
|
-
securityHttpSchema,
|
|
175
|
-
securityOpenIdSchema,
|
|
176
|
-
securityOauthSchema,
|
|
177
|
-
]);
|
|
178
|
-
|
|
179
|
-
export { pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeApiKeyIn, securitySchemeSchema };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetches an OpenAPI/Swagger specification from a given URL.
|
|
3
|
-
*
|
|
4
|
-
* @throws an error if the fetch fails
|
|
5
|
-
*/
|
|
6
|
-
export declare function fetchSpecFromUrl(url: string, proxy?: string, beautify?: boolean): Promise<string>;
|
|
7
|
-
//# sourceMappingURL=fetch-spec-from-url.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-spec-from-url.d.ts","sourceRoot":"","sources":["../../src/helpers/fetch-spec-from-url.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BpG"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { formatJsonOrYamlString } from './parse.js';
|
|
2
|
-
import { redirectToProxy } from './redirect-to-proxy.js';
|
|
3
|
-
|
|
4
|
-
// Doesn’t work
|
|
5
|
-
const OLD_PROXY_URL = 'https://api.scalar.com/request-proxy';
|
|
6
|
-
// Does work
|
|
7
|
-
const NEW_PROXY_URL = 'https://proxy.scalar.com';
|
|
8
|
-
/**
|
|
9
|
-
* Fetches an OpenAPI/Swagger specification from a given URL.
|
|
10
|
-
*
|
|
11
|
-
* @throws an error if the fetch fails
|
|
12
|
-
*/
|
|
13
|
-
async function fetchSpecFromUrl(url, proxy, beautify = true) {
|
|
14
|
-
// This replaces the OLD_PROXY_URL with the NEW_PROXY_URL on the fly.
|
|
15
|
-
if (proxy === OLD_PROXY_URL) {
|
|
16
|
-
// biome-ignore lint/style/noParameterAssign: It’s ok, let’s make an exception here.
|
|
17
|
-
proxy = NEW_PROXY_URL;
|
|
18
|
-
}
|
|
19
|
-
// To use a proxy or not to use a proxy
|
|
20
|
-
const response = await fetch(proxy ? redirectToProxy(proxy, url) : url);
|
|
21
|
-
// Looks like the request failed
|
|
22
|
-
if (response.status !== 200) {
|
|
23
|
-
console.error(`[fetchSpecFromUrl] Failed to fetch the specification at ${url} (Status: ${response.status})`);
|
|
24
|
-
if (!proxy) {
|
|
25
|
-
console.warn(`[fetchSpecFromUrl] Tried to fetch the specification (url: ${url}) without a proxy. Are the CORS headers configured to allow cross-domain requests? https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS`);
|
|
26
|
-
}
|
|
27
|
-
throw new Error(`Failed to fetch the specification (Status: ${response.status})`);
|
|
28
|
-
}
|
|
29
|
-
// If it’s JSON, make it pretty
|
|
30
|
-
if (beautify) {
|
|
31
|
-
return formatJsonOrYamlString(await response.text());
|
|
32
|
-
}
|
|
33
|
-
return await response.text();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { fetchSpecFromUrl };
|