Fixes: FRMW-2728, FRMW-2729 After this PR gets merged the following middleware will be exported from the `@medusajs/framework/http` import path. - applyParamsAsFilters - clearFiltersByKey - applyDefaultFilters - setContext - getQueryConfig - httpCompression - maybeApplyLinkFilter - refetchEntities - unlessPath - validateBody - validateQuery Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
46 lines
949 B
TypeScript
46 lines
949 B
TypeScript
import {
|
|
BeforeCreate,
|
|
Collection,
|
|
Entity,
|
|
OneToMany,
|
|
OnInit,
|
|
PrimaryKey,
|
|
Property,
|
|
} from "@mikro-orm/core"
|
|
|
|
import { generateEntityId } from "@medusajs/framework/utils"
|
|
import ProviderIdentity from "./provider-identity"
|
|
|
|
@Entity()
|
|
export default class AuthIdentity {
|
|
@PrimaryKey({ columnType: "text" })
|
|
id!: string
|
|
|
|
@OneToMany(() => ProviderIdentity, (o) => o.auth_identity)
|
|
provider_identities = new Collection<ProviderIdentity>(this)
|
|
|
|
@Property({ columnType: "jsonb", nullable: true })
|
|
app_metadata: Record<string, unknown> | null
|
|
|
|
@Property({
|
|
onCreate: () => new Date(),
|
|
columnType: "timestamptz",
|
|
defaultRaw: "now()",
|
|
})
|
|
created_at: Date
|
|
|
|
@Property({
|
|
onCreate: () => new Date(),
|
|
onUpdate: () => new Date(),
|
|
columnType: "timestamptz",
|
|
defaultRaw: "now()",
|
|
})
|
|
updated_at: Date
|
|
|
|
@BeforeCreate()
|
|
@OnInit()
|
|
onCreate() {
|
|
this.id = generateEntityId(this.id, "authid")
|
|
}
|
|
}
|