Skip to content

Commit

Permalink
feat(pipeline-builder): replace semi-structured/object with semi-stru…
Browse files Browse the repository at this point in the history
…ctured/json on start operator (#954)

Because

- We need to replace semi-structured/object with semi-structured/json on
start operator to better support backend

This commit

- replace semi-structured/object with semi-structured/json on start
operator
  • Loading branch information
EiffelFly authored Feb 14, 2024
1 parent 1ba36a0 commit df71434
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export function pickStartOperatorFreeFormFields({
),
});
break;
case "semi-structured/object":
case "semi-structured/json":
fields.push({
key,
instillUIOrder: value.instillUiOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function transformStartOperatorMetadataToZod(
z.array(z.string()).nullable().optional()
);
break;
case "semi-structured/object":
case "semi-structured/json":
zodSchema = zodSchema.setKey(key, z.string().nullable().optional());
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export function pickSmartHintsFromAcceptFormats(
pickHints.push(hint);
}

// Deal with semi-structured. Now we have semi-structured/object
// Deal with semi-structured. Now we have semi-structured/json
// and semi-structured/*, in the view of smart-hint they support the same
// structure
if (
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/lib/vdp-sdk/pipeline/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export type StartOperatorInputType =
| "array:string"
| "*/*"
| "array:*/*"
| "semi-structured/object"
| "semi-structured/json"
| "video/*"
| "array:video/*"
| JSONSchema7TypeName;
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const StartNodeInputType = ({
label = "Multiple Files";
break;
}
case "semi-structured/object": {
case "semi-structured/json": {
icon = (
<Icons.BracketSlash className="m-auto h-4 w-4 stroke-semantic-fg-primary" />
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ export const StartOperatorNode = ({ data, id }: NodeProps<StartNodeData>) => {
};
break;
}
case "semi-structured/object": {
case "semi-structured/json": {
configuraton = {
type: "object",
instillFormat: "semi-structured/object",
instillFormat: "semi-structured/json",
title: formData.title,
description: formData.description,
};
Expand Down Expand Up @@ -374,7 +374,7 @@ export const StartOperatorNode = ({ data, id }: NodeProps<StartNodeData>) => {
if (data.component.configuration.metadata) {
Object.entries(data.component.configuration.metadata).forEach(
([key, value]) => {
if (value.instillFormat === "semi-structured/object") {
if (value.instillFormat === "semi-structured/json") {
semiStructuredObjectKeys.push(key);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ export const StartOperatorNodeFreeForm = ({
onSelect={() => setSelectedType("boolean")}
/>
<StartNodeInputType
type="semi-structured/object"
type="semi-structured/json"
selectedType={selectedType}
onSelect={() => setSelectedType("semi-structured/object")}
onSelect={() => setSelectedType("semi-structured/json")}
/>
</div>
<div className="flex flex-col space-y-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export function pickSelectedTypeFromInstillFormat(
case "array:*/*": {
return "array:*/*";
}
case "semi-structured/object": {
return "semi-structured/object";
case "semi-structured/json": {
return "semi-structured/json";
}
default:
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const InOutPut = () => {

if (startOperatorMetadata) {
Object.entries(startOperatorMetadata).forEach(([key, value]) => {
if (value.instillFormat === "semi-structured/object") {
if (value.instillFormat === "semi-structured/json") {
semiStructuredObjectKeys.push(key);
}
});
Expand Down

0 comments on commit df71434

Please sign in to comment.