@scalar/types 0.1.4 → 0.1.5
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 +10 -0
- package/dist/api-reference/api-reference-configuration.d.ts +1 -1
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/entities/security-scheme.d.ts +168 -2
- package/dist/entities/security-scheme.d.ts.map +1 -1
- package/dist/entities/security-scheme.js +16 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @scalar/types
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e09dab3: feat: multiple configurations with multiple sources
|
|
8
|
+
- 04e27a1: feat: support x-default-scopes
|
|
9
|
+
- Updated dependencies [e62e677]
|
|
10
|
+
- Updated dependencies [82f16a5]
|
|
11
|
+
- @scalar/openapi-types@0.2.0
|
|
12
|
+
|
|
3
13
|
## 0.1.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -892,7 +892,7 @@ export type ApiReferenceConfigurationWithSources = Omit<ApiReferenceConfiguratio
|
|
|
892
892
|
})[];
|
|
893
893
|
};
|
|
894
894
|
/** Configuration for multiple Api References */
|
|
895
|
-
export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfigurationWithSources> | Partial<ApiReferenceConfigurationWithDefault>[];
|
|
895
|
+
export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfigurationWithSources> | Partial<ApiReferenceConfigurationWithDefault>[] | Partial<ApiReferenceConfigurationWithSources>[];
|
|
896
896
|
/** Typeguard to check to narrow the configs to the one with sources */
|
|
897
897
|
export declare const isConfigurationWithSources: (config: AnyApiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithSources>;
|
|
898
898
|
export {};
|
|
@@ -1 +1 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IAAI,CAC1C,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,EAE/C,OAAO,GAAG,MAAM,CACjB,GAAG;IACF,cAAc,CAAC,EAAE,2BAA2B,CAAA;CAC7C,CAAA;AAED,mDAAmD;AACnD,KAAK,oCAAoC,GAAG,yBAAyB,GAAG;IACtE,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,qDAAqD;AACrD,MAAM,MAAM,oCAAoC,GAAG,IAAI,CAAC,oCAAoC,EAAE,SAAS,CAAC,GAAG;IACzG,OAAO,EAAE,CAAC,iBAAiB,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,EAAE,CAAA;CACvD,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC,GAClC,OAAO,CAAC,oCAAoC,CAAC,GAC7C,OAAO,CAAC,oCAAoC,CAAC,EAAE,CAAA;AAEnD,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,WAC7B,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,oCAAoC,CAC0C,CAAA"}
|
|
1
|
+
{"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAA;AA6ElG,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB;IAClC;;;;;;;;;;;;;;;;;QAiBI;;IAEJ;;;;;;;;;;;;;;;;;;;;QAoBI;;IAEJ;;;;;;OAMG;;IAEH;;;;;;;;;;OAUG;;;;;;;;;;;;EAEH,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAQvE,uCAAuC;AACvC,eAAO,MAAM,4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O,CAAC,yBAAyB,CAAC,GAClC,OAAO,CAAC,oCAAoC,CAAC,GAC7C,OAAO,CAAC,oCAAoC,CAAC,EAAE,GAC/C,OAAO,CAAC,oCAAoC,CAAC,EAAE,CAAA;AAEnD,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,WAC7B,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,oCAAoC,CAC0C,CAAA"}
|
|
@@ -110,6 +110,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
110
110
|
description: z.ZodOptional<z.ZodString>;
|
|
111
111
|
}, {
|
|
112
112
|
type: z.ZodLiteral<"oauth2">;
|
|
113
|
+
/** The default scopes for the oauth flow */
|
|
114
|
+
'x-default-scopes': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
113
115
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
114
116
|
flows: z.ZodDefault<z.ZodObject<{
|
|
115
117
|
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -437,11 +439,13 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
437
439
|
} | undefined;
|
|
438
440
|
};
|
|
439
441
|
description?: string | undefined;
|
|
442
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
440
443
|
}, {
|
|
441
444
|
type: "oauth2";
|
|
442
445
|
description?: string | undefined;
|
|
443
446
|
uid?: string | undefined;
|
|
444
447
|
nameKey?: string | undefined;
|
|
448
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
445
449
|
flows?: {
|
|
446
450
|
password?: {
|
|
447
451
|
type?: "password" | undefined;
|
|
@@ -554,6 +558,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
554
558
|
description: z.ZodOptional<z.ZodString>;
|
|
555
559
|
}, {
|
|
556
560
|
type: z.ZodLiteral<"oauth2">;
|
|
561
|
+
/** The default scopes for the oauth flow */
|
|
562
|
+
'x-default-scopes': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
557
563
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
558
564
|
flows: z.ZodDefault<z.ZodObject<{
|
|
559
565
|
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -875,9 +881,11 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
875
881
|
} | undefined;
|
|
876
882
|
};
|
|
877
883
|
description?: string | undefined;
|
|
884
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
878
885
|
}, {
|
|
879
886
|
type: "oauth2";
|
|
880
887
|
description?: string | undefined;
|
|
888
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
881
889
|
flows?: {
|
|
882
890
|
password?: {
|
|
883
891
|
type?: "password" | undefined;
|
|
@@ -944,7 +952,7 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
944
952
|
openIdConnectUrl?: string | undefined;
|
|
945
953
|
}>]>;
|
|
946
954
|
/** Extended security schemes for workspace usage */
|
|
947
|
-
export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
955
|
+
export declare const securitySchemeSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
948
956
|
description: z.ZodOptional<z.ZodString>;
|
|
949
957
|
}, {
|
|
950
958
|
type: z.ZodLiteral<"apiKey">;
|
|
@@ -1046,6 +1054,8 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
1046
1054
|
description: z.ZodOptional<z.ZodString>;
|
|
1047
1055
|
}, {
|
|
1048
1056
|
type: z.ZodLiteral<"oauth2">;
|
|
1057
|
+
/** The default scopes for the oauth flow */
|
|
1058
|
+
'x-default-scopes': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1049
1059
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
1050
1060
|
flows: z.ZodDefault<z.ZodObject<{
|
|
1051
1061
|
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -1373,11 +1383,13 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
1373
1383
|
} | undefined;
|
|
1374
1384
|
};
|
|
1375
1385
|
description?: string | undefined;
|
|
1386
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1376
1387
|
}, {
|
|
1377
1388
|
type: "oauth2";
|
|
1378
1389
|
description?: string | undefined;
|
|
1379
1390
|
uid?: string | undefined;
|
|
1380
1391
|
nameKey?: string | undefined;
|
|
1392
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1381
1393
|
flows?: {
|
|
1382
1394
|
password?: {
|
|
1383
1395
|
type?: "password" | undefined;
|
|
@@ -1425,7 +1437,161 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
1425
1437
|
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
1426
1438
|
} | undefined;
|
|
1427
1439
|
} | undefined;
|
|
1428
|
-
}>]
|
|
1440
|
+
}>]>, {
|
|
1441
|
+
type: "apiKey";
|
|
1442
|
+
value: string;
|
|
1443
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1444
|
+
nameKey: string;
|
|
1445
|
+
name: string;
|
|
1446
|
+
in: "cookie" | "query" | "header";
|
|
1447
|
+
description?: string | undefined;
|
|
1448
|
+
} | {
|
|
1449
|
+
type: "http";
|
|
1450
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1451
|
+
nameKey: string;
|
|
1452
|
+
scheme: "basic" | "bearer";
|
|
1453
|
+
bearerFormat: string;
|
|
1454
|
+
username: string;
|
|
1455
|
+
password: string;
|
|
1456
|
+
token: string;
|
|
1457
|
+
description?: string | undefined;
|
|
1458
|
+
} | {
|
|
1459
|
+
type: "openIdConnect";
|
|
1460
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1461
|
+
nameKey: string;
|
|
1462
|
+
openIdConnectUrl: string;
|
|
1463
|
+
description?: string | undefined;
|
|
1464
|
+
} | {
|
|
1465
|
+
type: "oauth2";
|
|
1466
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1467
|
+
nameKey: string;
|
|
1468
|
+
flows: {
|
|
1469
|
+
password?: {
|
|
1470
|
+
type: "password";
|
|
1471
|
+
username: string;
|
|
1472
|
+
password: string;
|
|
1473
|
+
token: string;
|
|
1474
|
+
refreshUrl: string;
|
|
1475
|
+
scopes: Record<string, string>;
|
|
1476
|
+
selectedScopes: string[];
|
|
1477
|
+
'x-scalar-client-id': string;
|
|
1478
|
+
tokenUrl: string;
|
|
1479
|
+
clientSecret: string;
|
|
1480
|
+
} | undefined;
|
|
1481
|
+
implicit?: {
|
|
1482
|
+
type: "implicit";
|
|
1483
|
+
token: string;
|
|
1484
|
+
refreshUrl: string;
|
|
1485
|
+
scopes: Record<string, string>;
|
|
1486
|
+
selectedScopes: string[];
|
|
1487
|
+
'x-scalar-client-id': string;
|
|
1488
|
+
authorizationUrl: string;
|
|
1489
|
+
'x-scalar-redirect-uri': string;
|
|
1490
|
+
} | undefined;
|
|
1491
|
+
clientCredentials?: {
|
|
1492
|
+
type: "clientCredentials";
|
|
1493
|
+
token: string;
|
|
1494
|
+
refreshUrl: string;
|
|
1495
|
+
scopes: Record<string, string>;
|
|
1496
|
+
selectedScopes: string[];
|
|
1497
|
+
'x-scalar-client-id': string;
|
|
1498
|
+
tokenUrl: string;
|
|
1499
|
+
clientSecret: string;
|
|
1500
|
+
} | undefined;
|
|
1501
|
+
authorizationCode?: {
|
|
1502
|
+
type: "authorizationCode";
|
|
1503
|
+
token: string;
|
|
1504
|
+
refreshUrl: string;
|
|
1505
|
+
scopes: Record<string, string>;
|
|
1506
|
+
selectedScopes: string[];
|
|
1507
|
+
'x-scalar-client-id': string;
|
|
1508
|
+
authorizationUrl: string;
|
|
1509
|
+
'x-scalar-redirect-uri': string;
|
|
1510
|
+
tokenUrl: string;
|
|
1511
|
+
clientSecret: string;
|
|
1512
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1513
|
+
} | undefined;
|
|
1514
|
+
};
|
|
1515
|
+
description?: string | undefined;
|
|
1516
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1517
|
+
}, {
|
|
1518
|
+
type: "apiKey";
|
|
1519
|
+
value?: string | undefined;
|
|
1520
|
+
description?: string | undefined;
|
|
1521
|
+
uid?: string | undefined;
|
|
1522
|
+
nameKey?: string | undefined;
|
|
1523
|
+
name?: string | undefined;
|
|
1524
|
+
in?: unknown;
|
|
1525
|
+
} | {
|
|
1526
|
+
type: "http";
|
|
1527
|
+
description?: string | undefined;
|
|
1528
|
+
uid?: string | undefined;
|
|
1529
|
+
nameKey?: string | undefined;
|
|
1530
|
+
scheme?: string | undefined;
|
|
1531
|
+
bearerFormat?: string | undefined;
|
|
1532
|
+
username?: string | undefined;
|
|
1533
|
+
password?: string | undefined;
|
|
1534
|
+
token?: string | undefined;
|
|
1535
|
+
} | {
|
|
1536
|
+
type: "openIdConnect";
|
|
1537
|
+
description?: string | undefined;
|
|
1538
|
+
uid?: string | undefined;
|
|
1539
|
+
nameKey?: string | undefined;
|
|
1540
|
+
openIdConnectUrl?: string | undefined;
|
|
1541
|
+
} | {
|
|
1542
|
+
type: "oauth2";
|
|
1543
|
+
description?: string | undefined;
|
|
1544
|
+
uid?: string | undefined;
|
|
1545
|
+
nameKey?: string | undefined;
|
|
1546
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1547
|
+
flows?: {
|
|
1548
|
+
password?: {
|
|
1549
|
+
type?: "password" | undefined;
|
|
1550
|
+
username?: string | undefined;
|
|
1551
|
+
password?: string | undefined;
|
|
1552
|
+
token?: string | undefined;
|
|
1553
|
+
refreshUrl?: string | undefined;
|
|
1554
|
+
scopes?: unknown;
|
|
1555
|
+
selectedScopes?: string[] | undefined;
|
|
1556
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1557
|
+
tokenUrl?: string | undefined;
|
|
1558
|
+
clientSecret?: string | undefined;
|
|
1559
|
+
} | undefined;
|
|
1560
|
+
implicit?: {
|
|
1561
|
+
type?: "implicit" | undefined;
|
|
1562
|
+
token?: string | undefined;
|
|
1563
|
+
refreshUrl?: string | undefined;
|
|
1564
|
+
scopes?: unknown;
|
|
1565
|
+
selectedScopes?: string[] | undefined;
|
|
1566
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1567
|
+
authorizationUrl?: string | undefined;
|
|
1568
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1569
|
+
} | undefined;
|
|
1570
|
+
clientCredentials?: {
|
|
1571
|
+
type?: "clientCredentials" | undefined;
|
|
1572
|
+
token?: string | undefined;
|
|
1573
|
+
refreshUrl?: string | undefined;
|
|
1574
|
+
scopes?: unknown;
|
|
1575
|
+
selectedScopes?: string[] | undefined;
|
|
1576
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1577
|
+
tokenUrl?: string | undefined;
|
|
1578
|
+
clientSecret?: string | undefined;
|
|
1579
|
+
} | undefined;
|
|
1580
|
+
authorizationCode?: {
|
|
1581
|
+
type?: "authorizationCode" | undefined;
|
|
1582
|
+
token?: string | undefined;
|
|
1583
|
+
refreshUrl?: string | undefined;
|
|
1584
|
+
scopes?: unknown;
|
|
1585
|
+
selectedScopes?: string[] | undefined;
|
|
1586
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1587
|
+
authorizationUrl?: string | undefined;
|
|
1588
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1589
|
+
tokenUrl?: string | undefined;
|
|
1590
|
+
clientSecret?: string | undefined;
|
|
1591
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
1592
|
+
} | undefined;
|
|
1593
|
+
} | undefined;
|
|
1594
|
+
}>;
|
|
1429
1595
|
/**
|
|
1430
1596
|
* Security Scheme Object
|
|
1431
1597
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../src/entities/security-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsBvB,eAAO,MAAM,sBAAsB,wCAAyC,CAAA;AAc5E,eAAO,MAAM,oBAAoB;;;;IAV/B,8EAA8E;;IAE9E,6FAA6F;;;;IAb7F,0EAA0E;;;;;;;;;;;;;;;;;;;;EAqBsC,CAAA;AAClH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAkCvE,eAAO,MAAM,kBAAkB;;;;IA3B7B;;;OAGG;;IAOH;;;;OAIG;;;;IA3CH,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDgC,CAAA;AAC5G,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAanE,eAAO,MAAM,oBAAoB;;;;IAP/B;;;OAGG;;;;IAlEH,0EAA0E;;;;;;;;;;;;;;EAsEa,CAAA;AACzF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAsCvE,0CAA0C;AAC1C,eAAO,MAAM,WAAW,qCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../src/entities/security-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsBvB,eAAO,MAAM,sBAAsB,wCAAyC,CAAA;AAc5E,eAAO,MAAM,oBAAoB;;;;IAV/B,8EAA8E;;IAE9E,6FAA6F;;;;IAb7F,0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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqNxE,CAAA;AAEJ;;;;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"}
|
|
@@ -104,6 +104,8 @@ const pkceOptions = ['SHA-256', 'plain', 'no'];
|
|
|
104
104
|
/** Oauth2 security scheme */
|
|
105
105
|
const oasSecuritySchemeOauth2 = commonProps.extend({
|
|
106
106
|
type: z.literal('oauth2'),
|
|
107
|
+
/** The default scopes for the oauth flow */
|
|
108
|
+
'x-default-scopes': z.string().or(z.array(z.string())).optional(),
|
|
107
109
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
108
110
|
flows: z
|
|
109
111
|
.object({
|
|
@@ -169,11 +171,19 @@ const oasSecuritySchemeSchema = z.union([
|
|
|
169
171
|
oasSecuritySchemeOpenId,
|
|
170
172
|
]);
|
|
171
173
|
/** Extended security schemes for workspace usage */
|
|
172
|
-
const securitySchemeSchema = z
|
|
173
|
-
securityApiKeySchema,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
const securitySchemeSchema = z
|
|
175
|
+
.union([securityApiKeySchema, securityHttpSchema, securityOpenIdSchema, securityOauthSchema])
|
|
176
|
+
.transform((data) => {
|
|
177
|
+
// Set selected scopes from x-default-scopes
|
|
178
|
+
if (data.type === 'oauth2' && data['x-default-scopes']?.length) {
|
|
179
|
+
const keys = Object.keys(data.flows);
|
|
180
|
+
keys.forEach((key) => {
|
|
181
|
+
if (data.flows[key]?.selectedScopes && data['x-default-scopes']) {
|
|
182
|
+
data.flows[key].selectedScopes = [data['x-default-scopes']].flat();
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return data;
|
|
187
|
+
});
|
|
178
188
|
|
|
179
189
|
export { oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeApiKeyIn, securitySchemeSchema };
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scalar",
|
|
17
17
|
"references"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.1.
|
|
19
|
+
"version": "0.1.5",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"nanoid": "^5.1.5",
|
|
64
64
|
"type-fest": "^4.20.0",
|
|
65
65
|
"zod": "^3.23.8",
|
|
66
|
-
"@scalar/openapi-types": "0.
|
|
66
|
+
"@scalar/openapi-types": "0.2.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/har-format": "^1.2.15",
|