add organization_id to script_blocks (#3150)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
Shuchang Zheng 2025-08-08 20:24:44 -07:00 committed by GitHub
parent 30329932ab
commit 136fa70c48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 93 additions and 2 deletions

View file

@ -15,6 +15,7 @@ from skyvern.forge.sdk.db.models import (
OrganizationAuthTokenModel,
OrganizationModel,
OutputParameterModel,
ScriptBlockModel,
ScriptFileModel,
ScriptModel,
StepModel,
@ -51,7 +52,7 @@ from skyvern.forge.sdk.workflow.models.workflow import (
WorkflowStatus,
)
from skyvern.schemas.runs import ProxyLocation
from skyvern.schemas.scripts import Script, ScriptFile
from skyvern.schemas.scripts import Script, ScriptBlock, ScriptFile
from skyvern.webeye.actions.actions import (
Action,
ActionType,
@ -538,6 +539,20 @@ def convert_to_script_file(script_file_model: ScriptFileModel) -> ScriptFile:
)
def convert_to_script_block(script_block_model: ScriptBlockModel) -> ScriptBlock:
return ScriptBlock(
script_block_id=script_block_model.script_block_id,
organization_id=script_block_model.organization_id,
script_id=script_block_model.script_id,
script_revision_id=script_block_model.script_revision_id,
script_block_label=script_block_model.script_block_label,
script_file_id=script_block_model.script_file_id,
created_at=script_block_model.created_at,
modified_at=script_block_model.modified_at,
deleted_at=script_block_model.deleted_at,
)
def hydrate_action(action_model: ActionModel) -> Action:
"""
Convert ActionModel to the appropriate Action type based on action_type.