File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,24 @@ export const Info = Schema.Union([OAuth, Key])
3434 . annotate ( { identifier : "Credential.Info" } )
3535export type Info = Schema . Schema . Type < typeof Info >
3636
37+ export const LegacySuccessOAuth = Schema . Struct ( {
38+ type : Schema . Literal ( "success" ) ,
39+ access : Schema . String ,
40+ refresh : Schema . optional ( Schema . String ) ,
41+ expires : Schema . optional ( Schema . Number ) ,
42+ accountId : Schema . optional ( Schema . String ) ,
43+ enterpriseUrl : Schema . optional ( Schema . String ) ,
44+ metadata : Schema . optional ( Schema . Record ( Schema . String , Schema . String ) ) ,
45+ } )
46+
47+ export const LegacySuccessKey = Schema . Struct ( {
48+ type : Schema . Literal ( "success" ) ,
49+ key : Schema . String ,
50+ metadata : Schema . optional ( Schema . Record ( Schema . String , Schema . String ) ) ,
51+ } )
52+
53+ export const LegacySuccessValue = Schema . Union ( [ LegacySuccessOAuth , LegacySuccessKey ] )
54+
3755export class Stored extends Schema . Class < Stored > ( "Credential.Stored" ) ( {
3856 id : ID ,
3957 integrationID : IntegrationSchema . ID ,
Original file line number Diff line number Diff line change @@ -362,24 +362,7 @@ export const locationLayer = Layer.effect(
362362 return error instanceof Error ? error . message : String ( error )
363363 }
364364
365- const LegacySuccessOAuth = Schema . Struct ( {
366- type : Schema . Literal ( "success" ) ,
367- access : Schema . String ,
368- refresh : Schema . optional ( Schema . String ) ,
369- expires : Schema . optional ( Schema . Number ) ,
370- accountId : Schema . optional ( Schema . String ) ,
371- enterpriseUrl : Schema . optional ( Schema . String ) ,
372- metadata : Schema . optional ( Schema . Record ( Schema . String , Schema . String ) ) ,
373- } )
374-
375- const LegacySuccessKey = Schema . Struct ( {
376- type : Schema . Literal ( "success" ) ,
377- key : Schema . String ,
378- metadata : Schema . optional ( Schema . Record ( Schema . String , Schema . String ) ) ,
379- } )
380-
381- const LegacySuccessValue = Schema . Union ( [ LegacySuccessOAuth , LegacySuccessKey ] )
382- const decodeLegacySuccess = Schema . decodeUnknownOption ( LegacySuccessValue )
365+ const decodeLegacySuccess = Schema . decodeUnknownOption ( Credential . LegacySuccessValue )
383366
384367 const settle = Effect . fnUntraced ( function * ( attemptID : AttemptID , exit : Exit . Exit < Credential . Info , unknown > ) {
385368 const now = yield * Clock . currentTimeMillis
You can’t perform that action at this time.
0 commit comments