Skip to content

Commit

Permalink
Preset file support & SDK upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Nov 3, 2024
1 parent 9f4149b commit 4e79c1d
Show file tree
Hide file tree
Showing 16 changed files with 494 additions and 308 deletions.
9 changes: 9 additions & 0 deletions .changeset/slimy-cherries-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@platforma-open/milaboratories.mixcr-clonotyping.workflow': patch
'@platforma-open/milaboratories.mixcr-clonotyping.model': patch
'@platforma-open/milaboratories.mixcr-clonotyping.test': patch
'@platforma-open/milaboratories.mixcr-clonotyping.ui': patch
'@platforma-open/milaboratories.mixcr-clonotyping': patch
---

Preset file support & SDK upgrade
17 changes: 16 additions & 1 deletion model/src/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,25 @@ const Species = z.union([
z.literal('mfas')
]);

export const PresetName = z.object({
type: z.literal('name'),
name: z.string()
});
export type PresetName = z.infer<typeof PresetName>;

export const PresetFile = z.object({
type: z.literal('file'),
file: z.string().transform((v) => v as ImportFileHandle)
});
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: Ref,
preset: z.string(),
preset: Preset,
species: z.string().optional()
})
.strict();
Expand Down
16 changes: 16 additions & 0 deletions model/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import {
BlockModel,
InferHrefType,
It,
MainOutputs,
Option,
Ref,
StagingOutputs,
getImportProgress,
getResourceField,
isPColumn,
isPColumnSpec,
mapResourceFields,
type InferOutputsType
} from '@platforma-sdk/model';
import { BlockArgs, BlockArgsValid } from './args';
Expand Down Expand Up @@ -152,6 +158,16 @@ export const platforma = BlockModel.create<BlockArgs>('Heavy')
) satisfies Record<string, string>;
})

.output(
'mainFileImports',
mapResourceFields(getResourceField(MainOutputs, 'fileImports'), getImportProgress(It))
)

.output(
'prerunFileImports',
mapResourceFields(getResourceField(StagingOutputs, 'fileImports'), getImportProgress(It))
)

.sections((ctx) => {
return [{ type: 'link', href: '/', label: 'Main' }];
})
Expand Down
Loading

0 comments on commit 4e79c1d

Please sign in to comment.