Skip to content

Commit a1206e4

Browse files
razor-xseambot
andauthored
fix: De-dupe authMethods (#221)
* fix: De-dupe authMethods * ci: Generate code --------- Co-authored-by: Seam Bot <[email protected]>
1 parent 4f594ac commit a1206e4

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

src/lib/blueprint.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,15 @@ const createEndpointFromOperation = async (
734734
return authMethod as OpenapiAuthMethod
735735
},
736736
)
737-
const endpointAuthMethods = operationAuthMethods
738-
.map(mapOpenapiToSeamAuthMethod)
739-
.filter((authMethod): authMethod is SeamAuthMethod => authMethod != null)
737+
const endpointAuthMethods = [
738+
...new Set(
739+
operationAuthMethods
740+
.map(mapOpenapiToSeamAuthMethod)
741+
.filter(
742+
(authMethod): authMethod is SeamAuthMethod => authMethod != null,
743+
),
744+
),
745+
]
740746

741747
const workspaceScope = getWorkspaceScope(operationAuthMethods)
742748

test/snapshots/seam-blueprint.test.ts.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54969,7 +54969,6 @@ Generated by [AVA](https://avajs.dev).
5496954969
endpoints: [
5497054970
{
5497154971
authMethods: [
54972-
'client_session_token',
5497354972
'client_session_token',
5497454973
'personal_access_token',
5497554974
'api_key',
@@ -55640,7 +55639,6 @@ Generated by [AVA](https://avajs.dev).
5564055639
},
5564155640
{
5564255641
authMethods: [
55643-
'client_session_token',
5564455642
'client_session_token',
5564555643
'personal_access_token',
5564655644
'api_key',
@@ -55773,7 +55771,6 @@ Generated by [AVA](https://avajs.dev).
5577355771
authMethods: [
5577455772
'api_key',
5577555773
'client_session_token',
55776-
'client_session_token',
5577755774
],
5577855775
codeSamples: [],
5577955776
deprecationMessage: '',
@@ -55853,7 +55850,6 @@ Generated by [AVA](https://avajs.dev).
5585355850
},
5585455851
{
5585555852
authMethods: [
55856-
'client_session_token',
5585755853
'client_session_token',
5585855854
'personal_access_token',
5585955855
'api_key',
@@ -56133,7 +56129,6 @@ Generated by [AVA](https://avajs.dev).
5613356129
},
5613456130
{
5613556131
authMethods: [
56136-
'client_session_token',
5613756132
'client_session_token',
5613856133
'personal_access_token',
5613956134
'api_key',
@@ -63474,7 +63469,6 @@ Generated by [AVA](https://avajs.dev).
6347463469
endpoints: [
6347563470
{
6347663471
authMethods: [
63477-
'client_session_token',
6347863472
'client_session_token',
6347963473
'personal_access_token',
6348063474
'api_key',
@@ -64350,7 +64344,6 @@ Generated by [AVA](https://avajs.dev).
6435064344
},
6435164345
{
6435264346
authMethods: [
64353-
'client_session_token',
6435464347
'client_session_token',
6435564348
'personal_access_token',
6435664349
'api_key',
@@ -64405,7 +64398,6 @@ Generated by [AVA](https://avajs.dev).
6440564398
},
6440664399
{
6440764400
authMethods: [
64408-
'client_session_token',
6440964401
'client_session_token',
6441064402
'personal_access_token',
6441164403
'api_key',
@@ -64580,7 +64572,6 @@ Generated by [AVA](https://avajs.dev).
6458064572
},
6458164573
{
6458264574
authMethods: [
64583-
'client_session_token',
6458464575
'client_session_token',
6458564576
'api_key',
6458664577
'personal_access_token',
@@ -68378,7 +68369,6 @@ Generated by [AVA](https://avajs.dev).
6837868369
},
6837968370
{
6838068371
authMethods: [
68381-
'client_session_token',
6838268372
'client_session_token',
6838368373
'personal_access_token',
6838468374
'api_key',
@@ -68447,7 +68437,6 @@ Generated by [AVA](https://avajs.dev).
6844768437
},
6844868438
{
6844968439
authMethods: [
68450-
'client_session_token',
6845168440
'client_session_token',
6845268441
'personal_access_token',
6845368442
'api_key',
@@ -70250,7 +70239,6 @@ Generated by [AVA](https://avajs.dev).
7025070239
'api_key',
7025170240
'personal_access_token',
7025270241
'client_session_token',
70253-
'client_session_token',
7025470242
],
7025570243
codeSamples: [],
7025670244
deprecationMessage: '',
@@ -72478,7 +72466,6 @@ Generated by [AVA](https://avajs.dev).
7247872466
'client_session_token',
7247972467
'api_key',
7248072468
'personal_access_token',
72481-
'client_session_token',
7248272469
],
7248372470
codeSamples: [],
7248472471
deprecationMessage: '',
@@ -72559,7 +72546,6 @@ Generated by [AVA](https://avajs.dev).
7255972546
'client_session_token',
7256072547
'api_key',
7256172548
'personal_access_token',
72562-
'client_session_token',
7256372549
],
7256472550
codeSamples: [],
7256572551
deprecationMessage: '',
@@ -76090,7 +76076,6 @@ Generated by [AVA](https://avajs.dev).
7609076076
},
7609176077
{
7609276078
authMethods: [
76093-
'client_session_token',
7609476079
'client_session_token',
7609576080
'personal_access_token',
7609676081
'api_key',
@@ -76157,7 +76142,6 @@ Generated by [AVA](https://avajs.dev).
7615776142
},
7615876143
{
7615976144
authMethods: [
76160-
'client_session_token',
7616176145
'client_session_token',
7616276146
'personal_access_token',
7616376147
'api_key',
@@ -87373,7 +87357,6 @@ Generated by [AVA](https://avajs.dev).
8737387357
authMethods: [
8737487358
'api_key',
8737587359
'client_session_token',
87376-
'client_session_token',
8737787360
'personal_access_token',
8737887361
],
8737987362
codeSamples: [],
@@ -87409,7 +87392,6 @@ Generated by [AVA](https://avajs.dev).
8740987392
},
8741087393
{
8741187394
authMethods: [
87412-
'personal_access_token',
8741387395
'personal_access_token',
8741487396
'api_key',
8741587397
'client_session_token',
-192 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)