@scalar/types 0.1.13 → 0.1.15
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 +19 -0
- package/dist/api-reference/api-reference-configuration.d.ts +41 -11
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +274 -290
- package/dist/api-reference/api-reference-configuration.js.map +7 -0
- package/dist/api-reference/api-reference-configuration.test.js +224 -0
- package/dist/api-reference/api-reference-configuration.test.js.map +7 -0
- package/dist/api-reference/api-reference-plugin.d.ts +16 -2
- package/dist/api-reference/api-reference-plugin.d.ts.map +1 -1
- package/dist/api-reference/api-reference-plugin.js +28 -22
- package/dist/api-reference/api-reference-plugin.js.map +7 -0
- package/dist/api-reference/authentication-configuration.d.ts +2 -2
- package/dist/api-reference/authentication-configuration.d.ts.map +1 -1
- package/dist/api-reference/authentication-configuration.js +1 -0
- package/dist/api-reference/authentication-configuration.js.map +7 -0
- package/dist/api-reference/authentication-configuration.test-d.js +45 -0
- package/dist/api-reference/authentication-configuration.test-d.js.map +7 -0
- package/dist/api-reference/html-api.d.ts +1 -1
- package/dist/api-reference/html-api.d.ts.map +1 -1
- package/dist/api-reference/html-api.js +1 -0
- package/dist/api-reference/html-api.js.map +7 -0
- package/dist/api-reference/html-rendering-configuration.d.ts +1 -1
- package/dist/api-reference/html-rendering-configuration.d.ts.map +1 -1
- package/dist/api-reference/html-rendering-configuration.js +19 -21
- package/dist/api-reference/html-rendering-configuration.js.map +7 -0
- package/dist/api-reference/index.d.ts +4 -5
- package/dist/api-reference/index.d.ts.map +1 -1
- package/dist/api-reference/index.js +17 -3
- package/dist/api-reference/index.js.map +7 -0
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +21 -1
- package/dist/entities/index.js.map +7 -0
- package/dist/entities/security-scheme.d.ts +104 -0
- package/dist/entities/security-scheme.d.ts.map +1 -1
- package/dist/entities/security-scheme.js +118 -157
- package/dist/entities/security-scheme.js.map +7 -0
- package/dist/entities/security-scheme.test.js +318 -0
- package/dist/entities/security-scheme.test.js.map +7 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +7 -0
- package/dist/legacy/index.d.ts +1 -1
- package/dist/legacy/index.d.ts.map +1 -1
- package/dist/legacy/index.js +2 -1
- package/dist/legacy/index.js.map +7 -0
- package/dist/legacy/reference-config.d.ts +2 -2
- package/dist/legacy/reference-config.d.ts.map +1 -1
- package/dist/legacy/reference-config.js +10 -8
- package/dist/legacy/reference-config.js.map +7 -0
- package/dist/snippetz/index.d.ts +1 -1
- package/dist/snippetz/index.d.ts.map +1 -1
- package/dist/snippetz/index.js +2 -1
- package/dist/snippetz/index.js.map +7 -0
- package/dist/snippetz/snippetz.d.ts +1 -1
- package/dist/snippetz/snippetz.d.ts.map +1 -1
- package/dist/snippetz/snippetz.js +39 -40
- package/dist/snippetz/snippetz.js.map +7 -0
- package/dist/snippetz/snippetz.test-d.js +28 -0
- package/dist/snippetz/snippetz.test-d.js.map +7 -0
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -1
- package/dist/utils/index.js.map +7 -0
- package/dist/utils/nanoid.js +7 -11
- package/dist/utils/nanoid.js.map +7 -0
- package/dist/utils/nanoid.test.js +29 -0
- package/dist/utils/nanoid.test.js.map +7 -0
- package/dist/utils/utility-types.js +1 -0
- package/dist/utils/utility-types.js.map +7 -0
- package/package.json +6 -10
- package/dist/api-reference/helpers/migrate-theme-variables.d.ts +0 -10
- package/dist/api-reference/helpers/migrate-theme-variables.d.ts.map +0 -1
- package/dist/api-reference/helpers/migrate-theme-variables.js +0 -22
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
oasSecurityRequirementSchema,
|
|
4
|
+
pkceOptions,
|
|
5
|
+
securityApiKeySchema,
|
|
6
|
+
securityHttpSchema,
|
|
7
|
+
securityOauthSchema,
|
|
8
|
+
securityOpenIdSchema,
|
|
9
|
+
securitySchemeSchema
|
|
10
|
+
} from "./security-scheme.js";
|
|
11
|
+
describe("Security Schemas", () => {
|
|
12
|
+
describe("API Key Schema", () => {
|
|
13
|
+
it("should validate a valid API key schema", () => {
|
|
14
|
+
const apiKey = {
|
|
15
|
+
type: "apiKey",
|
|
16
|
+
name: "api_key",
|
|
17
|
+
in: "header",
|
|
18
|
+
description: "API Key Authentication",
|
|
19
|
+
uid: "apikey123",
|
|
20
|
+
nameKey: "x-api-key",
|
|
21
|
+
value: "test-api-key"
|
|
22
|
+
};
|
|
23
|
+
const result = securityApiKeySchema.safeParse(apiKey);
|
|
24
|
+
expect(result.success).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it("should apply default values", () => {
|
|
27
|
+
const minimalApiKey = {
|
|
28
|
+
type: "apiKey",
|
|
29
|
+
uid: "apikey123"
|
|
30
|
+
};
|
|
31
|
+
const result = securityApiKeySchema.parse(minimalApiKey);
|
|
32
|
+
expect(result).toEqual({
|
|
33
|
+
type: "apiKey",
|
|
34
|
+
uid: "apikey123",
|
|
35
|
+
name: "",
|
|
36
|
+
in: "header",
|
|
37
|
+
nameKey: "",
|
|
38
|
+
value: ""
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe("HTTP Schema", () => {
|
|
43
|
+
it("should validate a valid HTTP basic schema", () => {
|
|
44
|
+
const httpBasic = {
|
|
45
|
+
type: "http",
|
|
46
|
+
scheme: "basic",
|
|
47
|
+
description: "Basic HTTP Authentication",
|
|
48
|
+
uid: "http123",
|
|
49
|
+
username: "user",
|
|
50
|
+
password: "pass"
|
|
51
|
+
};
|
|
52
|
+
const result = securityHttpSchema.safeParse(httpBasic);
|
|
53
|
+
expect(result.success).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
it("should validate a valid HTTP bearer schema", () => {
|
|
56
|
+
const httpBearer = {
|
|
57
|
+
type: "http",
|
|
58
|
+
scheme: "bearer",
|
|
59
|
+
bearerFormat: "JWT",
|
|
60
|
+
description: "Bearer Authentication",
|
|
61
|
+
uid: "http456",
|
|
62
|
+
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
|
|
63
|
+
};
|
|
64
|
+
const result = securityHttpSchema.safeParse(httpBearer);
|
|
65
|
+
expect(result.success).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
it("should apply default values", () => {
|
|
68
|
+
const minimalHttp = {
|
|
69
|
+
type: "http",
|
|
70
|
+
uid: "http123"
|
|
71
|
+
};
|
|
72
|
+
const result = securityHttpSchema.parse(minimalHttp);
|
|
73
|
+
expect(result).toEqual({
|
|
74
|
+
type: "http",
|
|
75
|
+
uid: "http123",
|
|
76
|
+
scheme: "basic",
|
|
77
|
+
bearerFormat: "JWT",
|
|
78
|
+
nameKey: "",
|
|
79
|
+
username: "",
|
|
80
|
+
password: "",
|
|
81
|
+
token: ""
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
it("should reject invalid scheme values", () => {
|
|
85
|
+
const invalidHttp = {
|
|
86
|
+
type: "http",
|
|
87
|
+
scheme: "digest",
|
|
88
|
+
uid: "http123"
|
|
89
|
+
};
|
|
90
|
+
const result = securityHttpSchema.safeParse(invalidHttp);
|
|
91
|
+
expect(result.success).toBe(false);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
describe("OpenID Connect Schema", () => {
|
|
95
|
+
it("should validate a valid OpenID schema", () => {
|
|
96
|
+
const openId = {
|
|
97
|
+
type: "openIdConnect",
|
|
98
|
+
openIdConnectUrl: "https://example.com/.well-known/openid-configuration",
|
|
99
|
+
description: "OpenID Connect",
|
|
100
|
+
uid: "openid123",
|
|
101
|
+
nameKey: "openid"
|
|
102
|
+
};
|
|
103
|
+
const result = securityOpenIdSchema.safeParse(openId);
|
|
104
|
+
expect(result.success).toBe(true);
|
|
105
|
+
});
|
|
106
|
+
it("should apply default values", () => {
|
|
107
|
+
const minimalOpenId = {
|
|
108
|
+
type: "openIdConnect",
|
|
109
|
+
uid: "openid123"
|
|
110
|
+
};
|
|
111
|
+
const result = securityOpenIdSchema.parse(minimalOpenId);
|
|
112
|
+
expect(result).toEqual({
|
|
113
|
+
type: "openIdConnect",
|
|
114
|
+
uid: "openid123",
|
|
115
|
+
openIdConnectUrl: "",
|
|
116
|
+
nameKey: ""
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
describe("OAuth2 Schema", () => {
|
|
121
|
+
it("should validate a valid OAuth2 implicit flow schema", () => {
|
|
122
|
+
const oauth2Implicit = {
|
|
123
|
+
type: "oauth2",
|
|
124
|
+
description: "OAuth2 Implicit Flow",
|
|
125
|
+
uid: "oauth123",
|
|
126
|
+
flows: {
|
|
127
|
+
implicit: {
|
|
128
|
+
type: "implicit",
|
|
129
|
+
authorizationUrl: "https://example.com/oauth/authorize",
|
|
130
|
+
scopes: {
|
|
131
|
+
"read:api": "Read access",
|
|
132
|
+
"write:api": "Write access"
|
|
133
|
+
},
|
|
134
|
+
selectedScopes: ["read:api"],
|
|
135
|
+
token: "access-token-123"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const result = securityOauthSchema.safeParse(oauth2Implicit);
|
|
140
|
+
expect(result.success).toBe(true);
|
|
141
|
+
});
|
|
142
|
+
it("should validate a valid OAuth2 with missing scopes", () => {
|
|
143
|
+
const oauth2Implicit = {
|
|
144
|
+
type: "oauth2",
|
|
145
|
+
description: "OAuth2 Implicit Flow",
|
|
146
|
+
uid: "oauth123",
|
|
147
|
+
flows: {
|
|
148
|
+
implicit: {
|
|
149
|
+
type: "implicit",
|
|
150
|
+
authorizationUrl: "https://example.com/oauth/authorize",
|
|
151
|
+
scopes: null,
|
|
152
|
+
selectedScopes: ["read:api"],
|
|
153
|
+
token: "access-token-123"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const result = securityOauthSchema.safeParse(oauth2Implicit);
|
|
158
|
+
expect(result.success).toBe(true);
|
|
159
|
+
});
|
|
160
|
+
it("should validate a valid OAuth2 authorization code flow schema", () => {
|
|
161
|
+
const oauth2AuthCode = {
|
|
162
|
+
type: "oauth2",
|
|
163
|
+
description: "OAuth2 Authorization Code Flow",
|
|
164
|
+
uid: "oauth456",
|
|
165
|
+
flows: {
|
|
166
|
+
authorizationCode: {
|
|
167
|
+
type: "authorizationCode",
|
|
168
|
+
authorizationUrl: "https://example.com/oauth/authorize",
|
|
169
|
+
tokenUrl: "https://example.com/oauth/token",
|
|
170
|
+
"x-usePkce": "SHA-256",
|
|
171
|
+
scopes: {
|
|
172
|
+
"read:api": "Read access",
|
|
173
|
+
"write:api": "Write access"
|
|
174
|
+
},
|
|
175
|
+
clientSecret: "client-secret",
|
|
176
|
+
token: "access-token-456",
|
|
177
|
+
"x-scalar-security-query": {
|
|
178
|
+
prompt: "consent"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const result = securityOauthSchema.safeParse(oauth2AuthCode);
|
|
184
|
+
expect(result.success).toBe(true);
|
|
185
|
+
});
|
|
186
|
+
it("should validate a valid OAuth2 client credentials flow schema", () => {
|
|
187
|
+
const oauth2ClientCreds = {
|
|
188
|
+
type: "oauth2",
|
|
189
|
+
description: "OAuth2 Client Credentials Flow",
|
|
190
|
+
uid: "oauth789",
|
|
191
|
+
flows: {
|
|
192
|
+
clientCredentials: {
|
|
193
|
+
type: "clientCredentials",
|
|
194
|
+
tokenUrl: "https://example.com/oauth/token",
|
|
195
|
+
scopes: {},
|
|
196
|
+
clientSecret: "client-secret",
|
|
197
|
+
token: "access-token-789"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
const result = securityOauthSchema.safeParse(oauth2ClientCreds);
|
|
202
|
+
expect(result.success).toBe(true);
|
|
203
|
+
});
|
|
204
|
+
it("should validate a valid OAuth2 password flow schema", () => {
|
|
205
|
+
const oauth2Password = {
|
|
206
|
+
type: "oauth2",
|
|
207
|
+
description: "OAuth2 Password Flow",
|
|
208
|
+
uid: "oauth101",
|
|
209
|
+
flows: {
|
|
210
|
+
password: {
|
|
211
|
+
type: "password",
|
|
212
|
+
tokenUrl: "https://example.com/oauth/token",
|
|
213
|
+
scopes: {},
|
|
214
|
+
username: "testuser",
|
|
215
|
+
password: "testpass",
|
|
216
|
+
clientSecret: "client-secret",
|
|
217
|
+
token: "access-token-101",
|
|
218
|
+
"x-scalar-security-query": {
|
|
219
|
+
prompt: "consent",
|
|
220
|
+
audience: "scalar"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const result = securityOauthSchema.safeParse(oauth2Password);
|
|
226
|
+
expect(result.success).toBe(true);
|
|
227
|
+
});
|
|
228
|
+
it("should apply default values", () => {
|
|
229
|
+
const minimalOauth2 = {
|
|
230
|
+
type: "oauth2",
|
|
231
|
+
uid: "oauth123"
|
|
232
|
+
};
|
|
233
|
+
const result = securityOauthSchema.parse(minimalOauth2);
|
|
234
|
+
expect(result.flows.implicit).toBeDefined();
|
|
235
|
+
expect(result.flows.implicit?.authorizationUrl).toBe("http://localhost:8080");
|
|
236
|
+
expect(result.flows.implicit?.scopes).toEqual({});
|
|
237
|
+
expect(result.flows.implicit?.selectedScopes).toEqual([]);
|
|
238
|
+
expect(result.flows.implicit?.token).toBe("");
|
|
239
|
+
expect(result.nameKey).toBe("");
|
|
240
|
+
});
|
|
241
|
+
it("should validate PKCE options", () => {
|
|
242
|
+
expect(pkceOptions).toContain("SHA-256");
|
|
243
|
+
expect(pkceOptions).toContain("plain");
|
|
244
|
+
expect(pkceOptions).toContain("no");
|
|
245
|
+
});
|
|
246
|
+
it("should apply x-default-scopes", () => {
|
|
247
|
+
const oauth2 = {
|
|
248
|
+
type: "oauth2",
|
|
249
|
+
uid: "oauth123",
|
|
250
|
+
"x-default-scopes": ["read:api", "write:api"]
|
|
251
|
+
};
|
|
252
|
+
const result = securitySchemeSchema.parse(oauth2);
|
|
253
|
+
if (result.type !== "oauth2") {
|
|
254
|
+
throw new Error("Expected oauth2 schema");
|
|
255
|
+
}
|
|
256
|
+
expect(result["x-default-scopes"]).toEqual(["read:api", "write:api"]);
|
|
257
|
+
expect(result.flows.implicit?.selectedScopes).toEqual(["read:api", "write:api"]);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
describe("Security Requirement Schema", () => {
|
|
261
|
+
it("should validate a valid security requirement", () => {
|
|
262
|
+
const securityRequirement = {
|
|
263
|
+
"api_key": [],
|
|
264
|
+
"oauth2": ["read:api", "write:api"]
|
|
265
|
+
};
|
|
266
|
+
const result = oasSecurityRequirementSchema.safeParse(securityRequirement);
|
|
267
|
+
expect(result.success).toBe(true);
|
|
268
|
+
});
|
|
269
|
+
it("should apply default values for empty scopes", () => {
|
|
270
|
+
const securityRequirement = {
|
|
271
|
+
"api_key": void 0
|
|
272
|
+
};
|
|
273
|
+
const result = oasSecurityRequirementSchema.parse(securityRequirement);
|
|
274
|
+
expect(result).toEqual({
|
|
275
|
+
"api_key": []
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
describe("Combined Security Scheme", () => {
|
|
280
|
+
it("should validate all security scheme types", () => {
|
|
281
|
+
const apiKey = {
|
|
282
|
+
type: "apiKey",
|
|
283
|
+
name: "api_key",
|
|
284
|
+
in: "header",
|
|
285
|
+
uid: "apikey123",
|
|
286
|
+
value: "test-api-key"
|
|
287
|
+
};
|
|
288
|
+
const http = {
|
|
289
|
+
type: "http",
|
|
290
|
+
scheme: "bearer",
|
|
291
|
+
uid: "http123",
|
|
292
|
+
token: "bearer-token"
|
|
293
|
+
};
|
|
294
|
+
const openId = {
|
|
295
|
+
type: "openIdConnect",
|
|
296
|
+
openIdConnectUrl: "https://example.com/.well-known/openid-configuration",
|
|
297
|
+
uid: "openid123"
|
|
298
|
+
};
|
|
299
|
+
const oauth2 = {
|
|
300
|
+
type: "oauth2",
|
|
301
|
+
uid: "oauth123",
|
|
302
|
+
flows: {
|
|
303
|
+
implicit: {
|
|
304
|
+
type: "implicit",
|
|
305
|
+
authorizationUrl: "https://example.com/oauth/authorize",
|
|
306
|
+
scopes: {},
|
|
307
|
+
token: ""
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
expect(securitySchemeSchema.safeParse(apiKey).success).toBe(true);
|
|
312
|
+
expect(securitySchemeSchema.safeParse(http).success).toBe(true);
|
|
313
|
+
expect(securitySchemeSchema.safeParse(openId).success).toBe(true);
|
|
314
|
+
expect(securitySchemeSchema.safeParse(oauth2).success).toBe(true);
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
//# sourceMappingURL=security-scheme.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/entities/security-scheme.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport {\n oasSecurityRequirementSchema,\n pkceOptions,\n securityApiKeySchema,\n securityHttpSchema,\n securityOauthSchema,\n securityOpenIdSchema,\n securitySchemeSchema,\n} from './security-scheme'\n\ndescribe('Security Schemas', () => {\n describe('API Key Schema', () => {\n it('should validate a valid API key schema', () => {\n const apiKey = {\n type: 'apiKey',\n name: 'api_key',\n in: 'header',\n description: 'API Key Authentication',\n uid: 'apikey123',\n nameKey: 'x-api-key',\n value: 'test-api-key',\n }\n\n const result = securityApiKeySchema.safeParse(apiKey)\n expect(result.success).toBe(true)\n })\n\n it('should apply default values', () => {\n const minimalApiKey = {\n type: 'apiKey',\n uid: 'apikey123',\n }\n\n const result = securityApiKeySchema.parse(minimalApiKey)\n expect(result).toEqual({\n type: 'apiKey',\n uid: 'apikey123',\n name: '',\n in: 'header',\n nameKey: '',\n value: '',\n })\n })\n })\n\n describe('HTTP Schema', () => {\n it('should validate a valid HTTP basic schema', () => {\n const httpBasic = {\n type: 'http',\n scheme: 'basic',\n description: 'Basic HTTP Authentication',\n uid: 'http123',\n username: 'user',\n password: 'pass',\n }\n\n const result = securityHttpSchema.safeParse(httpBasic)\n expect(result.success).toBe(true)\n })\n\n it('should validate a valid HTTP bearer schema', () => {\n const httpBearer = {\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n description: 'Bearer Authentication',\n uid: 'http456',\n token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',\n }\n\n const result = securityHttpSchema.safeParse(httpBearer)\n expect(result.success).toBe(true)\n })\n\n it('should apply default values', () => {\n const minimalHttp = {\n type: 'http',\n uid: 'http123',\n }\n\n const result = securityHttpSchema.parse(minimalHttp)\n expect(result).toEqual({\n type: 'http',\n uid: 'http123',\n scheme: 'basic',\n bearerFormat: 'JWT',\n nameKey: '',\n username: '',\n password: '',\n token: '',\n })\n })\n\n it('should reject invalid scheme values', () => {\n const invalidHttp = {\n type: 'http',\n scheme: 'digest',\n uid: 'http123',\n }\n\n const result = securityHttpSchema.safeParse(invalidHttp)\n expect(result.success).toBe(false)\n })\n })\n\n describe('OpenID Connect Schema', () => {\n it('should validate a valid OpenID schema', () => {\n const openId = {\n type: 'openIdConnect',\n openIdConnectUrl: 'https://example.com/.well-known/openid-configuration',\n description: 'OpenID Connect',\n uid: 'openid123',\n nameKey: 'openid',\n }\n\n const result = securityOpenIdSchema.safeParse(openId)\n expect(result.success).toBe(true)\n })\n\n it('should apply default values', () => {\n const minimalOpenId = {\n type: 'openIdConnect',\n uid: 'openid123',\n }\n\n const result = securityOpenIdSchema.parse(minimalOpenId)\n expect(result).toEqual({\n type: 'openIdConnect',\n uid: 'openid123',\n openIdConnectUrl: '',\n nameKey: '',\n })\n })\n })\n\n describe('OAuth2 Schema', () => {\n it('should validate a valid OAuth2 implicit flow schema', () => {\n const oauth2Implicit = {\n type: 'oauth2',\n description: 'OAuth2 Implicit Flow',\n uid: 'oauth123',\n flows: {\n implicit: {\n type: 'implicit',\n authorizationUrl: 'https://example.com/oauth/authorize',\n scopes: {\n 'read:api': 'Read access',\n 'write:api': 'Write access',\n },\n selectedScopes: ['read:api'],\n token: 'access-token-123',\n },\n },\n }\n\n const result = securityOauthSchema.safeParse(oauth2Implicit)\n expect(result.success).toBe(true)\n })\n\n it('should validate a valid OAuth2 with missing scopes', () => {\n const oauth2Implicit = {\n type: 'oauth2',\n description: 'OAuth2 Implicit Flow',\n uid: 'oauth123',\n flows: {\n implicit: {\n type: 'implicit',\n authorizationUrl: 'https://example.com/oauth/authorize',\n scopes: null,\n selectedScopes: ['read:api'],\n token: 'access-token-123',\n },\n },\n }\n\n const result = securityOauthSchema.safeParse(oauth2Implicit)\n expect(result.success).toBe(true)\n })\n\n it('should validate a valid OAuth2 authorization code flow schema', () => {\n const oauth2AuthCode = {\n type: 'oauth2',\n description: 'OAuth2 Authorization Code Flow',\n uid: 'oauth456',\n flows: {\n authorizationCode: {\n type: 'authorizationCode',\n authorizationUrl: 'https://example.com/oauth/authorize',\n tokenUrl: 'https://example.com/oauth/token',\n 'x-usePkce': 'SHA-256',\n scopes: {\n 'read:api': 'Read access',\n 'write:api': 'Write access',\n },\n clientSecret: 'client-secret',\n token: 'access-token-456',\n 'x-scalar-security-query': {\n prompt: 'consent',\n },\n },\n },\n }\n\n const result = securityOauthSchema.safeParse(oauth2AuthCode)\n expect(result.success).toBe(true)\n })\n\n it('should validate a valid OAuth2 client credentials flow schema', () => {\n const oauth2ClientCreds = {\n type: 'oauth2',\n description: 'OAuth2 Client Credentials Flow',\n uid: 'oauth789',\n flows: {\n clientCredentials: {\n type: 'clientCredentials',\n tokenUrl: 'https://example.com/oauth/token',\n scopes: {},\n clientSecret: 'client-secret',\n token: 'access-token-789',\n },\n },\n }\n\n const result = securityOauthSchema.safeParse(oauth2ClientCreds)\n expect(result.success).toBe(true)\n })\n\n it('should validate a valid OAuth2 password flow schema', () => {\n const oauth2Password = {\n type: 'oauth2',\n description: 'OAuth2 Password Flow',\n uid: 'oauth101',\n flows: {\n password: {\n type: 'password',\n tokenUrl: 'https://example.com/oauth/token',\n scopes: {},\n username: 'testuser',\n password: 'testpass',\n clientSecret: 'client-secret',\n token: 'access-token-101',\n 'x-scalar-security-query': {\n prompt: 'consent',\n audience: 'scalar',\n },\n },\n },\n }\n\n const result = securityOauthSchema.safeParse(oauth2Password)\n expect(result.success).toBe(true)\n })\n\n it('should apply default values', () => {\n const minimalOauth2 = {\n type: 'oauth2',\n uid: 'oauth123',\n }\n\n const result = securityOauthSchema.parse(minimalOauth2)\n expect(result.flows.implicit).toBeDefined()\n expect(result.flows.implicit?.authorizationUrl).toBe('http://localhost:8080')\n expect(result.flows.implicit?.scopes).toEqual({})\n expect(result.flows.implicit?.selectedScopes).toEqual([])\n expect(result.flows.implicit?.token).toBe('')\n expect(result.nameKey).toBe('')\n })\n\n it('should validate PKCE options', () => {\n expect(pkceOptions).toContain('SHA-256')\n expect(pkceOptions).toContain('plain')\n expect(pkceOptions).toContain('no')\n })\n\n it('should apply x-default-scopes', () => {\n const oauth2 = {\n type: 'oauth2',\n uid: 'oauth123',\n 'x-default-scopes': ['read:api', 'write:api'],\n }\n\n const result = securitySchemeSchema.parse(oauth2)\n if (result.type !== 'oauth2') {\n throw new Error('Expected oauth2 schema')\n }\n expect(result['x-default-scopes']).toEqual(['read:api', 'write:api'])\n expect(result.flows.implicit?.selectedScopes).toEqual(['read:api', 'write:api'])\n })\n })\n\n describe('Security Requirement Schema', () => {\n it('should validate a valid security requirement', () => {\n const securityRequirement = {\n 'api_key': [],\n 'oauth2': ['read:api', 'write:api'],\n }\n\n const result = oasSecurityRequirementSchema.safeParse(securityRequirement)\n expect(result.success).toBe(true)\n })\n\n it('should apply default values for empty scopes', () => {\n const securityRequirement = {\n 'api_key': undefined,\n }\n\n const result = oasSecurityRequirementSchema.parse(securityRequirement)\n expect(result).toEqual({\n 'api_key': [],\n })\n })\n })\n\n describe('Combined Security Scheme', () => {\n it('should validate all security scheme types', () => {\n const apiKey = {\n type: 'apiKey',\n name: 'api_key',\n in: 'header',\n uid: 'apikey123',\n value: 'test-api-key',\n }\n\n const http = {\n type: 'http',\n scheme: 'bearer',\n uid: 'http123',\n token: 'bearer-token',\n }\n\n const openId = {\n type: 'openIdConnect',\n openIdConnectUrl: 'https://example.com/.well-known/openid-configuration',\n uid: 'openid123',\n }\n\n const oauth2 = {\n type: 'oauth2',\n uid: 'oauth123',\n flows: {\n implicit: {\n type: 'implicit',\n authorizationUrl: 'https://example.com/oauth/authorize',\n scopes: {},\n token: '',\n },\n },\n }\n\n expect(securitySchemeSchema.safeParse(apiKey).success).toBe(true)\n expect(securitySchemeSchema.safeParse(http).success).toBe(true)\n expect(securitySchemeSchema.safeParse(openId).success).toBe(true)\n expect(securitySchemeSchema.safeParse(oauth2).success).toBe(true)\n })\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB,MAAM;AACjC,WAAS,kBAAkB,MAAM;AAC/B,OAAG,0CAA0C,MAAM;AACjD,YAAM,SAAS;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,aAAa;AAAA,QACb,KAAK;AAAA,QACL,SAAS;AAAA,QACT,OAAO;AAAA,MACT;AAEA,YAAM,SAAS,qBAAqB,UAAU,MAAM;AACpD,aAAO,OAAO,OAAO,EAAE,KAAK,IAAI;AAAA,IAClC,CAAC;AAED,OAAG,+BAA+B,MAAM;AACtC,YAAM,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN,KAAK;AAAA,MACP;AAEA,YAAM,SAAS,qBAAqB,MAAM,aAAa;AACvD,aAAO,MAAM,EAAE,QAAQ;AAAA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E,aAAO,qBAAqB,UAAU,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI;AAAA,IAClE,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** We should not use these exports anymore, but we need them for commonjs compatibility. */
|
|
2
|
-
export * from './legacy/index.
|
|
3
|
-
export * from './api-reference/index.
|
|
2
|
+
export * from './legacy/index.js';
|
|
3
|
+
export * from './api-reference/index.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
export { migrateThemeVariables } from './api-reference/helpers/migrate-theme-variables.js';
|
|
1
|
+
export * from "./legacy/index.js";
|
|
2
|
+
export * from "./api-reference/index.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/** We should not use these exports anymore, but we need them for commonjs compatibility. */\nexport * from './legacy/index'\nexport * from './api-reference/index'\n"],
|
|
5
|
+
"mappings": "AACA,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/legacy/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './reference-config.
|
|
1
|
+
export * from './reference-config.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
package/dist/legacy/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./reference-config.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
-
import type { ApiReferenceConfiguration } from '../api-reference/index.
|
|
3
|
-
import type { HarRequest, TargetId } from '../snippetz/index.
|
|
2
|
+
import type { ApiReferenceConfiguration } from '../api-reference/index.js';
|
|
3
|
+
import type { HarRequest, TargetId } from '../snippetz/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* This re-export is needed due to a typescript issue
|
|
6
6
|
* @see https://github.com/microsoft/TypeScript/issues/42873
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-config.d.ts","sourceRoot":"","sources":["../../src/legacy/reference-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reference-config.d.ts","sourceRoot":"","sources":["../../src/legacy/reference-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEvF,OAAO,KAAK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AC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACnC,UAAU,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IAC3C,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE;QACf,GAAG,EAAE,MAAM,CAAA;QACX,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC3E,YAAY,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAA;IACxE,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,aAAa,CAAC,EAAE,WAAW,CAAA;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC3E,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,CAAA;CACnD,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
var XScalarStability
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})(XScalarStability ||
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var XScalarStability = /* @__PURE__ */ ((XScalarStability2) => {
|
|
2
|
+
XScalarStability2["Deprecated"] = "deprecated";
|
|
3
|
+
XScalarStability2["Experimental"] = "experimental";
|
|
4
|
+
XScalarStability2["Stable"] = "stable";
|
|
5
|
+
return XScalarStability2;
|
|
6
|
+
})(XScalarStability || {});
|
|
7
|
+
export {
|
|
8
|
+
XScalarStability
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=reference-config.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/legacy/reference-config.ts"],
|
|
4
|
+
"sourcesContent": ["import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types'\n\nimport type { ApiReferenceConfiguration } from '../api-reference/index'\nimport type { HarRequest, TargetId } from '../snippetz/index'\n\n/**\n * This re-export is needed due to a typescript issue\n * @see https://github.com/microsoft/TypeScript/issues/42873\n */\nexport type {\n OpenAPI,\n OpenAPIV2,\n OpenAPIV3,\n OpenAPIV3_1,\n} from '@scalar/openapi-types'\n\nexport type ClientInfo = {\n key: string\n title: string\n link: string\n description: string\n}\n\n/**\n * Alias for the OpenAPI 3.1 ServerObject type\n *\n * @deprecated Use OpenAPIV3_1.ServerObject instead\n */\nexport type Server = OpenAPIV3_1.ServerObject\n\nexport type TargetInfo = {\n key: TargetId\n title: string\n extname: `.${string}` | null\n default: string\n}\n\nexport type HiddenClients =\n // Just hide all\n | true\n // Exclude whole targets or just specific clients\n | Partial<Record<TargetInfo['key'], boolean | ClientInfo['key'][]>>\n // Backwards compatibility with the previous behavior ['fetch', 'xhr']\n | ClientInfo['key'][]\n\nexport type PathRouting = {\n basePath: string\n}\n\n/**\n * @deprecated Use ApiReferenceConfiguration instead\n *\n * @example import type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\n */\nexport type ReferenceConfiguration = Partial<ApiReferenceConfiguration>\n\nexport type BaseParameter = {\n name: string\n description?: string | null\n value: string | number | Record<string, any>\n required?: boolean\n enabled: boolean\n}\n\ntype OptionalCharset = string | null\n\nexport type ContentType =\n | `application/json${OptionalCharset}`\n | `application/xml${OptionalCharset}`\n | `text/plain${OptionalCharset}`\n | `text/html${OptionalCharset}`\n | `application/octet-stream${OptionalCharset}`\n | `application/x-www-form-urlencoded${OptionalCharset}`\n | `multipart/form-data${OptionalCharset}`\n | `*/*${OptionalCharset}`\n | `application/vnd.${string}+json${OptionalCharset}`\n\nexport type Cookie = {\n name: string\n value: string\n}\n\nexport type CustomRequestExample = {\n lang: string\n label: string\n source: string\n}\n\nexport type HarRequestWithPath = HarRequest & {\n path: string\n}\n\nexport type Header = {\n name: string\n value: string\n}\n\nexport enum XScalarStability {\n Deprecated = 'deprecated',\n Experimental = 'experimental',\n Stable = 'stable',\n}\n\nexport type Information = {\n 'description'?: string\n 'operationId'?: string | number\n 'parameters'?: Parameters[]\n 'responses'?: Record<string, OpenAPI.ResponseObject>\n 'security'?: OpenAPIV3.SecurityRequirementObject[]\n 'requestBody'?: RequestBody\n 'summary'?: string\n 'tags'?: string[]\n 'deprecated'?: boolean\n 'servers'?: OpenAPIV3_1.ServerObject[]\n /**\n * Scalar\n */\n 'x-custom-examples'?: CustomRequestExample[]\n 'x-scalar-stability'?: XScalarStability\n /**\n * Redocly, current\n */\n 'x-codeSamples'?: CustomRequestExample[]\n /**\n * Redocly, deprecated\n */\n 'x-code-samples'?: CustomRequestExample[]\n}\n\nexport type Operation = {\n httpVerb: 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'TRACE' | 'CONNECT' | 'DELETE' | 'OPTIONS'\n path: string\n operationId?: string\n name?: string\n description?: string\n information?: Information\n servers?: OpenAPIV3_1.ServerObject[]\n}\n\n/**\n * @deprecated Use Parameter instead\n */\nexport type Parameters = Parameter\n\nexport type Parameter = {\n // Fixed Fields\n name: string\n in?: string\n description?: string\n required?: boolean\n deprecated?: boolean\n allowEmptyValue?: boolean\n // Other\n style?: 'form' | 'simple'\n explode?: boolean\n allowReserved?: boolean\n schema?: Schema\n example?: any\n examples?: Map<string, any>\n content?: RequestBodyMimeTypes\n headers?: { [key: string]: OpenAPI.HeaderObject }\n}\n\nexport type Query = {\n name: string\n value: string\n}\n\n// Create a mapped type to ensure keys are a subset of ContentType\nexport type RequestBodyMimeTypes = {\n [K in ContentType]?: {\n schema?: any\n example?: any\n examples?: any\n }\n}\n\nexport type RequestBody = {\n description?: string\n required?: boolean\n content?: RequestBodyMimeTypes\n}\n\nexport type Schema = {\n type: string\n name?: string\n example?: any\n default?: any\n format?: string\n description?: string\n properties?: Record<string, Schema>\n}\n\n/**\n * This is a very strange and custom way to represent the operation object.\n * It\u2019s the outcome of the `parse` helper.\n *\n * @deprecated This is evil. Stop using it. We\u2019ll transition to use the new store.\n */\nexport type TransformedOperation = Operation & {\n pathParameters?: Parameter[]\n}\n\nexport type CollapsedSidebarItems = Record<string, boolean>\n\nexport type AuthenticationState = {\n customSecurity?: boolean\n /** You can pre-select a single security scheme, multiple, or complex security using an array of arrays */\n preferredSecurityScheme?: string | (string | string[])[] | null\n securitySchemes?:\n | OpenAPIV2.SecurityDefinitionsObject\n | OpenAPIV3.ComponentsObject['securitySchemes']\n | OpenAPIV3_1.ComponentsObject['securitySchemes']\n http?: {\n basic?: {\n username?: string\n password?: string\n }\n bearer?: {\n token?: string\n }\n }\n apiKey?: {\n token?: string\n }\n oAuth2?: {\n clientId?: string\n scopes?: string[]\n accessToken?: string\n state?: string\n username?: string\n password?: string\n }\n}\n\nexport type Heading = {\n depth: number\n value: string\n slug?: string\n}\n\nexport type CodeBlockSSRKey = `components-scalar-code-block${number}`\nexport type DescriptionSectionSSRKey = `components-Content-Introduction-Description-sections${number}`\n\nexport type ScalarState = {\n 'hash'?: string\n 'useGlobalStore-authentication'?: AuthenticationState\n 'useSidebarContent-collapsedSidebarItems'?: CollapsedSidebarItems\n [key: CodeBlockSSRKey]: string\n [key: DescriptionSectionSSRKey]: {\n heading: Heading\n content: string\n }[]\n}\n\nexport type SSRState = {\n payload: {\n data: ScalarState\n }\n url: string\n}\n\nexport type Tag = {\n 'name': string\n 'description': string\n 'operations': TransformedOperation[]\n 'x-displayName'?: string\n}\n\nexport type TagGroup = {\n name: string\n tags: string[]\n}\n\nexport type Definitions = OpenAPIV2.DefinitionsObject\n\n/**\n * Webhook (after our super custom transformation process)\n *\n * @deprecated Let\u2019s get rid of those super custom transformed entities and use the store instead.\n */\nexport type Webhooks = Record<\n string,\n Record<\n OpenAPIV3_1.HttpMethods,\n TransformedOperation & {\n 'x-internal'?: boolean\n }\n >\n>\n\n/**\n * The native OpenAPI Webhook object, but with the x-internal and x-scalar-ignore properties\n */\nexport type Webhook = (OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject) & {\n 'x-internal'?: boolean\n 'x-scalar-ignore'?: boolean\n}\n\n/**\n * @deprecated Use `@scalar/openapi-types` instead\n */\nexport type Spec = {\n 'tags'?: Tag[]\n 'info':\n | Partial<OpenAPIV2.Document['info']>\n | Partial<OpenAPIV3.Document['info']>\n | Partial<OpenAPIV3_1.Document['info']>\n 'host'?: OpenAPIV2.Document['host']\n 'basePath'?: OpenAPIV2.Document['basePath']\n 'schemes'?: OpenAPIV2.Document['schemes']\n 'externalDocs'?: {\n url: string\n description?: string\n }\n 'servers'?: OpenAPIV3.Document['servers'] | OpenAPIV3_1.Document['servers']\n 'components'?: OpenAPIV3.ComponentsObject | OpenAPIV3_1.ComponentsObject\n 'webhooks'?: Webhooks\n 'definitions'?: Definitions\n 'swagger'?: OpenAPIV2.Document['swagger']\n 'openapi'?: OpenAPIV3.Document['openapi'] | OpenAPIV3_1.Document['openapi']\n 'x-tagGroups'?: TagGroup[]\n 'security'?: OpenAPIV3.SecurityRequirementObject[]\n}\n"],
|
|
5
|
+
"mappings": "AAiGO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,gBAAa;AACb,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,YAAS;AAHC,SAAAA;AAAA,GAAA;",
|
|
6
|
+
"names": ["XScalarStability"]
|
|
7
|
+
}
|
package/dist/snippetz/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './snippetz.
|
|
1
|
+
export * from './snippetz.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snippetz/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snippetz/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
package/dist/snippetz/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./snippetz.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../../src/snippetz/snippetz.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,YAAY,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"snippetz.d.ts","sourceRoot":"","sources":["../../src/snippetz/snippetz.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,YAAY,EAAE,OAAO,IAAI,UAAU,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/E;;GAEG;AACH,eAAO,MAAM,iBAAiB,wjBAoCpB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAA;AAEvD,2BAA2B;AAC3B,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAA;AAE1F,iCAAiC;AACjC,MAAM,MAAM,MAAM,GAAG;KAClB,CAAC,IAAI,QAAQ,GAAG;QACf,GAAG,EAAE,CAAC,CAAA;QACN,KAA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
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
"c/libcurl",
|
|
3
|
+
"clojure/clj_http",
|
|
4
|
+
"csharp/httpclient",
|
|
5
|
+
"csharp/restsharp",
|
|
6
|
+
"go/native",
|
|
7
|
+
"http/http1.1",
|
|
8
|
+
"java/asynchttp",
|
|
9
|
+
"java/nethttp",
|
|
10
|
+
"java/okhttp",
|
|
11
|
+
"java/unirest",
|
|
12
|
+
"js/axios",
|
|
13
|
+
"js/fetch",
|
|
14
|
+
"js/jquery",
|
|
15
|
+
"js/ofetch",
|
|
16
|
+
"js/xhr",
|
|
17
|
+
"kotlin/okhttp",
|
|
18
|
+
"node/axios",
|
|
19
|
+
"node/fetch",
|
|
20
|
+
"node/ofetch",
|
|
21
|
+
"node/undici",
|
|
22
|
+
"objc/nsurlsession",
|
|
23
|
+
"ocaml/cohttp",
|
|
24
|
+
"php/curl",
|
|
25
|
+
"php/guzzle",
|
|
26
|
+
"powershell/restmethod",
|
|
27
|
+
"powershell/webrequest",
|
|
28
|
+
"python/python3",
|
|
29
|
+
"python/requests",
|
|
30
|
+
"r/httr",
|
|
31
|
+
"ruby/native",
|
|
32
|
+
"shell/curl",
|
|
33
|
+
"shell/httpie",
|
|
34
|
+
"shell/wget",
|
|
35
|
+
"swift/nsurlsession",
|
|
36
|
+
"dart/http"
|
|
40
37
|
];
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
export {
|
|
39
|
+
AVAILABLE_CLIENTS
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=snippetz.js.map
|