// SIGNED-SOURCE: <5902b51d4e405aedb0834dac96f649cc> /** * AUTO-GENERATED FILE * Do not modify. Update your schema and re-generate for changes. */ import Identity from "../Identity.js"; import { default as s } from "./IdentitySpec.js"; import { P } from "@aphro/runtime-ts"; import { UpdateMutationBuilder } from "@aphro/runtime-ts"; import { CreateMutationBuilder } from "@aphro/runtime-ts"; import { DeleteMutationBuilder } from "@aphro/runtime-ts"; import { makeSavable } from "@aphro/runtime-ts"; import { modelGenMemo } from "@aphro/runtime-ts"; import { Node } from "@aphro/runtime-ts"; import { NodeSpecWithCreate } from "@aphro/runtime-ts"; import { SID_of } from "@aphro/runtime-ts"; import { Context } from "@aphro/runtime-ts"; export type Data = { id: SID_of; identifier: string; token: string; }; // @Sealed(Identity) export default abstract class IdentityBase extends Node { readonly spec = s as unknown as NodeSpecWithCreate; get id(): SID_of { return this.data.id as unknown as SID_of; } get identifier(): string { return this.data.identifier; } get token(): string { return this.data.token; } update(data: Partial) { return makeSavable( this.ctx, new UpdateMutationBuilder(this.ctx, this.spec, this) .set(data) .toChangesets()[0] ); } static create(ctx: Context, data: Partial) { return makeSavable( ctx, new CreateMutationBuilder(ctx, s).set(data).toChangesets()[0] ); } delete() { return makeSavable( this.ctx, new DeleteMutationBuilder(this.ctx, this.spec, this).toChangesets()[0] ); } }