refactor(schema): tighten public contracts (#33771)
This commit is contained in:
parent
5682371d0a
commit
9e9d405d7e
49 changed files with 759 additions and 897 deletions
|
|
@ -1,6 +1,7 @@
|
|||
export * as Credential from "./credential"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { IntegrationMethodID } from "./integration-id"
|
||||
import { ascending } from "./identifier"
|
||||
import { NonNegativeInt, statics } from "./schema"
|
||||
|
|
@ -18,14 +19,14 @@ export const OAuth = Schema.Struct({
|
|||
refresh: Schema.String,
|
||||
access: Schema.String,
|
||||
expires: NonNegativeInt,
|
||||
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
|
||||
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
||||
}).annotate({ identifier: "Credential.OAuth" })
|
||||
|
||||
export interface Key extends Schema.Schema.Type<typeof Key> {}
|
||||
export const Key = Schema.Struct({
|
||||
type: Schema.Literal("key"),
|
||||
key: Schema.String,
|
||||
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
|
||||
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
||||
}).annotate({ identifier: "Credential.Key" })
|
||||
|
||||
export const Value = Schema.Union([OAuth, Key])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue