Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Dec 13, 2024
1 parent 2eeba4d commit 3288bf2
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 252 deletions.
23 changes: 10 additions & 13 deletions model/src/args.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ImportFileHandle, PlRef, Ref, ValueType } from '@platforma-sdk/model';
import { ZodAnyDef, ZodSchema, z } from 'zod';
import { PlId } from './helpers';
import { ImportFileHandle, PlRef } from '@platforma-sdk/model';
import { z } from 'zod';

const Species = z.union([
z.literal('hsa'),
Expand All @@ -25,16 +24,14 @@ export type PresetFile = z.infer<typeof PresetFile>;
export const Preset = z.discriminatedUnion('type', [PresetName, PresetFile]);
export type Preset = z.infer<typeof Preset>;

export const BlockArgsValid = z
.object({
input: PlRef,
preset: Preset,
species: z.string().optional(),
limitInput: z.number().int().optional(),
title: z.string().optional(),
presetCommonName: z.string().optional()
})
.strict();
export const BlockArgsValid = z.object({
input: PlRef,
preset: Preset,
species: z.string().optional(),
limitInput: z.number().int().optional(),
title: z.string().optional(),
presetCommonName: z.string().optional()
});
export type BlockArgsValid = z.infer<typeof BlockArgsValid>;

export const BlockArgs = BlockArgsValid.partial({ input: true, preset: true });
Expand Down
Loading

0 comments on commit 3288bf2

Please sign in to comment.